diff options
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 24 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/connctrl.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 10 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/obj3d.cxx | 11 | ||||
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 11 | ||||
-rw-r--r-- | svx/source/form/fmsrcimp.cxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 6 | ||||
-rw-r--r-- | svx/source/sdr/contact/objectcontactofpageview.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontact.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontactofsdrpage.cxx | 24 | ||||
-rw-r--r-- | svx/source/svdraw/svdmark.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 36 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdpagv.cxx | 2 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 6 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 2 |
18 files changed, 76 insertions, 78 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index c4de12bbcfc3..26fbc948bf94 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -537,13 +537,13 @@ bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle( void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryItem& rGeometryItem ) { // AdjustmentValues - const Any* pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "AdjustmentValues" ); + const Any* pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "AdjustmentValues" ); if ( pAny ) *pAny >>= seqAdjustmentValues; // Coordsize - const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "ViewBox" ); + const Any* pViewBox = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "ViewBox" ); css::awt::Rectangle aViewBox; if ( pViewBox && (*pViewBox >>= aViewBox ) ) { @@ -556,31 +556,31 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt // Path/Coordinates - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "Coordinates" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "Coordinates" ); if ( pAny ) *pAny >>= seqCoordinates; // Path/GluePoints - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "GluePoints" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "GluePoints" ); if ( pAny ) *pAny >>= seqGluePoints; // Path/Segments - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "Segments" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "Segments" ); if ( pAny ) *pAny >>= seqSegments; // Path/SubViewSize - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "SubViewSize" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "SubViewSize" ); if ( pAny ) *pAny >>= seqSubViewSize; // Path/StretchX - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "StretchX" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "StretchX" ); if ( pAny ) { sal_Int32 nStretchX = 0; @@ -590,7 +590,7 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt // Path/StretchY - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "StretchY" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "StretchY" ); if ( pAny ) { sal_Int32 nStretchY = 0; @@ -600,19 +600,19 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt // Path/TextFrames - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "TextFrames" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( sPath, "TextFrames" ); if ( pAny ) *pAny >>= seqTextFrames; // Equations - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "Equations" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "Equations" ); if ( pAny ) *pAny >>= seqEquations; // Handles - pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "Handles" ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(rGeometryItem).GetPropertyValueByName( "Handles" ); if ( pAny ) *pAny >>= seqHandles; } @@ -1632,7 +1632,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_Int32& rSrcPt, sal_Int32& rSegmen _aCenter.Y() = nCoordHeight/2 * fYScale; fWidth = nCoordWidth/2; fHeight = nCoordHeight/2; - const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "ViewBox" ); + const Any* pViewBox = rGeometryItem.GetPropertyValueByName( "ViewBox" ); css::awt::Rectangle aViewBox; if ( pViewBox && (*pViewBox >>= aViewBox ) ) { diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index a264b93939df..cefeb456d3e3 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -139,7 +139,7 @@ double GetLength( const tools::Polygon& rPolygon ) { sal_uInt16 nCount = rPolygon.GetSize(); while( --nCount ) - fLength += ((tools::Polygon&)rPolygon).CalcDistance( nCount, nCount - 1 ); + fLength += const_cast<tools::Polygon&>(rPolygon).CalcDistance( nCount, nCount - 1 ); } return fLength; } @@ -536,7 +536,7 @@ void CalcDistances( const tools::Polygon& rPoly, std::vector< double >& rDistanc { for ( i = 0; i < nCount; i++ ) { - double fDistance = i ? ((tools::Polygon&)rPoly).CalcDistance( i, i - 1 ) : 0.0; + double fDistance = i ? const_cast<tools::Polygon&>(rPoly).CalcDistance( i, i - 1 ) : 0.0; rDistances.push_back( fDistance ); } std::partial_sum( rDistances.begin(), rDistances.end(), rDistances.begin() ); diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 13d5004424fb..d622a7d52e6d 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -161,8 +161,8 @@ void SvxXConnectionPreview::Construct() const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj); pEdgeObj = pTmpEdgeObj->Clone(); - SdrObjConnection& rConn1 = (SdrObjConnection&)pEdgeObj->GetConnection( true ); - SdrObjConnection& rConn2 = (SdrObjConnection&)pEdgeObj->GetConnection( false ); + SdrObjConnection& rConn1 = pEdgeObj->GetConnection( true ); + SdrObjConnection& rConn2 = pEdgeObj->GetConnection( false ); rConn1 = pTmpEdgeObj->GetConnection( true ); rConn2 = pTmpEdgeObj->GetConnection( false ); diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index cdf0e5d05003..b65d75b0992a 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -332,7 +332,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) if(pHdl) { - ((SdrHdlList&)rHdlList).ResetFocusHdl(); + const_cast<SdrHdlList&>(rHdlList).ResetFocusHdl(); bGrabFocusToFirstControl = false; } } @@ -367,7 +367,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) const SdrHdlList& rHdlList = pView->GetHdlList(); bool bForward(!aCode.IsShift()); - ((SdrHdlList&)rHdlList).TravelFocusHdl(bForward); + const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward); bProc = true; } @@ -514,7 +514,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) // switch snapping off if(!bWasNoSnap) - ((SdrDragStat&)rDragStat).SetNoSnap(); + const_cast<SdrDragStat&>(rDragStat).SetNoSnap(); if(bWasSnapEnabled) pView->SetSnapEnabled(false); @@ -523,7 +523,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) // restore snap if(!bWasNoSnap) - ((SdrDragStat&)rDragStat).SetNoSnap(bWasNoSnap); + const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap); if(bWasSnapEnabled) pView->SetSnapEnabled(bWasSnapEnabled); } @@ -585,7 +585,7 @@ void GraphCtrl::KeyInput( const KeyEvent& rKEvt ) if(pNewOne) { - ((SdrHdlList&)rHdlList).SetFocusHdl(pNewOne); + const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne); } } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index a73ff87da1ed..44534a92627d 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -808,7 +808,7 @@ void IMapWindow::StartPolyEdit() if(!pHdl) { - ((SdrHdlList&)rHdlList).TravelFocusHdl(true); + const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(true); } } diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index 8267a14d9ad0..52b553d50d30 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -696,22 +696,21 @@ E3dObject& E3dObject::operator=(const E3dObject& rObj) return *this; SdrObject::operator=(rObj); - const E3dObject& r3DObj = (const E3dObject&) rObj; - if (r3DObj.GetSubList()) + if (rObj.GetSubList()) { - maSubList.CopyObjects(*r3DObj.GetSubList()); + maSubList.CopyObjects(*rObj.GetSubList()); } // BoundVol can be copied since also the children are copied - maLocalBoundVol = r3DObj.maLocalBoundVol; - maTransformation = r3DObj.maTransformation; + maLocalBoundVol = rObj.maLocalBoundVol; + maTransformation = rObj.maTransformation; // Because the parent may have changed, definitely redefine the total // transformation next time SetTransformChanged(); // Copy selection status - mbIsSelected = r3DObj.mbIsSelected; + mbIsSelected = rObj.mbIsSelected; return *this; } diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index e8d707392db1..7e80afac9779 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -243,7 +243,7 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const if(nObjCount > 1) { - const_cast<E3dScene*>(this)->mp3DDepthRemapper = new Imp3DDepthRemapper((E3dScene&)(*this)); + const_cast<E3dScene*>(this)->mp3DDepthRemapper = new Imp3DDepthRemapper(const_cast<E3dScene&>(*this)); } } @@ -281,7 +281,7 @@ void E3dScene::NbcSetSnapRect(const tools::Rectangle& rRect) SetRectsDirty(); E3dObject::NbcSetSnapRect(rRect); aCamera.SetDeviceWindow(rRect); - aCameraSet.SetViewportRectangle((tools::Rectangle&)rRect); + aCameraSet.SetViewportRectangle(rRect); ImpCleanup3DDepthMapper(); } @@ -325,7 +325,7 @@ void E3dScene::SetCamera(const Camera3D& rNewCamera) // Set perspective GetCameraSet().SetPerspective(aCamera.GetProjection() == ProjectionType::Perspective); - GetCameraSet().SetViewportRectangle((tools::Rectangle&)aCamera.GetDeviceWindow()); + GetCameraSet().SetViewportRectangle(aCamera.GetDeviceWindow()); ImpCleanup3DDepthMapper(); } @@ -419,10 +419,9 @@ E3dScene& E3dScene::operator=(const E3dScene& rObj) return *this; E3dObject::operator=(rObj); - const E3dScene& r3DObj = (const E3dScene&) rObj; - aCamera = r3DObj.aCamera; + aCamera = rObj.aCamera; - aCameraSet = r3DObj.aCameraSet; + aCameraSet = rObj.aCameraSet; static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera(); InvalidateBoundVolume(); diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 8ad18af31eee..87d3dafc64cd 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -53,7 +53,7 @@ #define EQUAL_BOOKMARKS(a, b) a == b -#define IFACECAST(c) ((const Reference< XInterface >&)c) +#define IFACECAST(c) static_cast<const Reference< XInterface >&>(c) using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 83fdc6285cb6..3a7377d65ff5 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -389,11 +389,11 @@ bool GalleryTheme::InsertObject( const SgaObject& rObj, sal_uIntPtr nInsertPos ) if (pOldObj) { - ((SgaObject&) rObj).SetTitle( pOldObj->GetTitle() ); + const_cast<SgaObject&>(rObj).SetTitle( pOldObj->GetTitle() ); } } else if (rObj.GetTitle() == "__<empty>__") - ((SgaObject&) rObj).SetTitle(""); + const_cast<SgaObject&>(rObj).SetTitle(""); ImplWriteSgaObject(rObj, nInsertPos, &aNewEntry); pFoundEntry->nOffset = aNewEntry.nOffset; @@ -846,7 +846,7 @@ bool GalleryTheme::InsertGraphic( const Graphic& rGraphic, sal_uIntPtr nInsertPo if( rGraphic.GetType() != GraphicType::NONE ) { ConvertDataFormat nExportFormat = ConvertDataFormat::Unknown; - const GfxLink aGfxLink( ( (Graphic&) rGraphic ).GetLink() ); + const GfxLink aGfxLink( rGraphic.GetLink() ); if( aGfxLink.GetDataSize() ) { diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 552ac31866bf..77be097549a4 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -58,7 +58,7 @@ namespace sdr mrPageWindow(rPageWindow) { // init PreviewRenderer flag - setPreviewRenderer(((SdrPaintView&)rPageWindow.GetPageView().GetView()).IsPreviewRenderer()); + setPreviewRenderer(static_cast<SdrPaintView&>(rPageWindow.GetPageView().GetView()).IsPreviewRenderer()); // init timer SetPriority(TaskPriority::HIGH); diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index fd57b8acd34d..aab8310c0388 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -166,7 +166,7 @@ ViewContact& ViewContact::GetViewContact(sal_uInt32 /*nIndex*/) const { // This is the default implementation; call would be an error OSL_FAIL("ViewContact::GetViewContact: This call needs to be overridden when GetObjectCount() can return results != 0 (!)"); - return (ViewContact&)(*this); + return const_cast<ViewContact&>(*this); } ViewContact* ViewContact::GetParentContact() const diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index d85f54f80c18..cbbc44efb654 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -522,9 +522,9 @@ ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const { switch(nIndex) { - case 0: return (ViewContact&)maViewContactOfPageBackground; - case 1: return (ViewContact&)maViewContactOfPageShadow; - case 2: return (ViewContact&)maViewContactOfPageFill; + case 0: return const_cast<ViewContactOfPageBackground&>(maViewContactOfPageBackground); + case 1: return const_cast<ViewContactOfPageShadow&>(maViewContactOfPageShadow); + case 2: return const_cast<ViewContactOfPageFill&>(maViewContactOfPageFill); case 3: { const SdrPage& rPage = GetSdrPage(); @@ -535,17 +535,17 @@ ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const } else { - return (ViewContact&)maViewContactOfMasterPage; + return const_cast<ViewContactOfMasterPage&>(maViewContactOfMasterPage); } } - case 4: return (ViewContact&)maViewContactOfOuterPageBorder; - case 5: return (ViewContact&)maViewContactOfInnerPageBorder; - case 6: return (ViewContact&)maViewContactOfGridBack; - case 7: return (ViewContact&)maViewContactOfHelplinesBack; - case 8: return (ViewContact&)maViewContactOfPageHierarchy; - case 9: return (ViewContact&)maViewContactOfGridFront; - case 10: case 11: return (ViewContact&)maViewContactOfHelplinesFront; - default: assert(false);return (ViewContact&)maViewContactOfHelplinesFront; + case 4: return const_cast<ViewContactOfOuterPageBorder&>(maViewContactOfOuterPageBorder); + case 5: return const_cast<ViewContactOfInnerPageBorder&>(maViewContactOfInnerPageBorder); + case 6: return const_cast<ViewContactOfGrid&>(maViewContactOfGridBack); + case 7: return const_cast<ViewContactOfHelplines&>(maViewContactOfHelplinesBack); + case 8: return const_cast<ViewContactOfPageHierarchy&>(maViewContactOfPageHierarchy); + case 9: return const_cast<ViewContactOfGrid&>(maViewContactOfGridFront); + case 10: case 11: return const_cast<ViewContactOfHelplines&>(maViewContactOfHelplinesFront); + default: assert(false);return const_cast<ViewContactOfHelplines&>(maViewContactOfHelplinesFront); } } diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx index 7c4747ab0684..30396fcd2e5a 100644 --- a/svx/source/svdraw/svdmark.cxx +++ b/svx/source/svdraw/svdmark.cxx @@ -495,7 +495,7 @@ const OUString& SdrMarkList::GetMarkDescription() const const OUString& SdrMarkList::GetPointMarkDescription(bool bGlue) const { - bool& rNameOk = (bool&)(bGlue ? mbGluePointNameOk : mbPointNameOk); + bool& rNameOk = const_cast<bool&>(bGlue ? mbGluePointNameOk : mbPointNameOk); OUString& rName = const_cast<OUString&>(bGlue ? maGluePointName : maPointName); const size_t nMarkCount(GetMarkCount()); size_t nMarkPtAnz(0); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 30a4177d0bf4..1b8b0dbe0311 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -884,7 +884,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // AdjustmentValues const OUString sAdjustmentValues( "AdjustmentValues" ); - const Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sAdjustmentValues ); + const Any* pAny = aGeometryItem.GetPropertyValueByName( sAdjustmentValues ); if ( pAny ) *pAny >>= seqAdjustmentValues; if ( pDefCustomShape && pDefData ) // now check if we have to default some adjustment values @@ -920,7 +920,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Coordsize const OUString sViewBox( "ViewBox" ); - const Any* pViewBox = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sViewBox ); + const Any* pViewBox = aGeometryItem.GetPropertyValueByName( sViewBox ); css::awt::Rectangle aViewBox; if ( !pViewBox || !(*pViewBox >>= aViewBox ) ) { @@ -942,7 +942,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Path/Coordinates const OUString sCoordinates( "Coordinates" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); + pAny = aGeometryItem.GetPropertyValueByName( sPath, sCoordinates ); if ( !pAny && pDefCustomShape && pDefCustomShape->nVertices && pDefCustomShape->pVertices ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates; @@ -961,7 +961,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Path/GluePoints const OUString sGluePoints( "GluePoints" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sGluePoints ); + pAny = aGeometryItem.GetPropertyValueByName( sPath, sGluePoints ); if ( !pAny && pDefCustomShape && pDefCustomShape->nGluePoints && pDefCustomShape->pGluePoints ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints; @@ -979,7 +979,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Path/Segments const OUString sSegments( "Segments" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sSegments ); + pAny = aGeometryItem.GetPropertyValueByName( sPath, sSegments ); if ( !pAny && pDefCustomShape && pDefCustomShape->nElements && pDefCustomShape->pElements ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments; @@ -999,7 +999,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Path/StretchX const OUString sStretchX( "StretchX" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sStretchX ); + pAny = aGeometryItem.GetPropertyValueByName( sPath, sStretchX ); if ( !pAny && pDefCustomShape ) { sal_Int32 nXRef = pDefCustomShape->nXRef; @@ -1013,7 +1013,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Path/StretchY const OUString sStretchY( "StretchY" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sStretchY ); + pAny = aGeometryItem.GetPropertyValueByName( sPath, sStretchY ); if ( !pAny && pDefCustomShape ) { sal_Int32 nYRef = pDefCustomShape->nYRef; @@ -1027,7 +1027,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Path/TextFrames const OUString sTextFrames( "TextFrames" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sTextFrames ); + pAny = aGeometryItem.GetPropertyValueByName( sPath, sTextFrames ); if ( !pAny && pDefCustomShape && pDefCustomShape->nTextRect && pDefCustomShape->pTextRect ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames; @@ -1049,7 +1049,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Equations const OUString sEquations( "Equations" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sEquations ); + pAny = aGeometryItem.GetPropertyValueByName( sEquations ); if ( !pAny && pDefCustomShape && pDefCustomShape->nCalculation && pDefCustomShape->pCalculation ) { css::uno::Sequence< OUString > seqEquations; @@ -1066,7 +1066,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) // Handles const OUString sHandles( "Handles" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sHandles ); + pAny = aGeometryItem.GetPropertyValueByName( sHandles ); if ( !pAny && pDefCustomShape && pDefCustomShape->nHandles && pDefCustomShape->pHandles ) { css::uno::Sequence< css::beans::PropertyValues > seqHandles; @@ -1111,7 +1111,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::Viewbox : { const OUString sViewBox( "ViewBox" ); - const Any* pViewBox = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sViewBox ); + const Any* pViewBox = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sViewBox ); css::awt::Rectangle aViewBox; if ( pViewBox && ( *pViewBox >>= aViewBox ) ) { @@ -1125,7 +1125,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::Path : { const OUString sCoordinates( "Coordinates" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); if ( pAny && pDefCustomShape && pDefCustomShape->nVertices && pDefCustomShape->pVertices ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates1, seqCoordinates2; @@ -1150,7 +1150,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::Gluepoints : { const OUString sGluePoints( "GluePoints" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sGluePoints ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, sGluePoints ); if ( pAny && pDefCustomShape && pDefCustomShape->nGluePoints && pDefCustomShape->pGluePoints ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints1, seqGluePoints2; @@ -1176,7 +1176,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons { // Path/Segments const OUString sSegments( "Segments" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sSegments ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, sSegments ); if ( pAny ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments1, seqSegments2; @@ -1220,7 +1220,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::StretchX : { const OUString sStretchX( "StretchX" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sStretchX ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, sStretchX ); if ( pAny && pDefCustomShape ) { sal_Int32 nStretchX = 0; @@ -1238,7 +1238,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::StretchY : { const OUString sStretchY( "StretchY" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sStretchY ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, sStretchY ); if ( pAny && pDefCustomShape ) { sal_Int32 nStretchY = 0; @@ -1256,7 +1256,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::Equations : { const OUString sEquations( "Equations" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sEquations ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sEquations ); if ( pAny && pDefCustomShape && pDefCustomShape->nCalculation && pDefCustomShape->pCalculation ) { css::uno::Sequence< OUString > seqEquations1, seqEquations2; @@ -1281,7 +1281,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons case DefaultType::TextFrames : { const OUString sTextFrames( "TextFrames" ); - pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sTextFrames ); + pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, sTextFrames ); if ( pAny && pDefCustomShape && pDefCustomShape->nTextRect && pDefCustomShape->pTextRect ) { css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames1, seqTextFrames2; diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 894d6cbff6c0..0c3dad0cd56f 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2205,7 +2205,7 @@ OUString SdrPathObj::getSpecialDragComment(const SdrDragStat& rDrag) const else { ImpPathForDragAndCreate aDragAndCreate(*const_cast<SdrPathObj*>(this)); - bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag)); + bool bDidWork(aDragAndCreate.beginPathDrag(const_cast<SdrDragStat&>(rDrag))); if(bDidWork) { @@ -2220,7 +2220,7 @@ basegfx::B2DPolyPolygon SdrPathObj::getSpecialDragPoly(const SdrDragStat& rDrag) { basegfx::B2DPolyPolygon aRetval; ImpPathForDragAndCreate aDragAndCreate(*const_cast<SdrPathObj*>(this)); - bool bDidWork(aDragAndCreate.beginPathDrag((SdrDragStat&)rDrag)); + bool bDidWork(aDragAndCreate.beginPathDrag(const_cast<SdrDragStat&>(rDrag))); if(bDidWork) { diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index fd94f4388877..a4d4c34d949a 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -709,7 +709,7 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const aR.Right() += aSiz.Width(); aR.Top() -= aSiz.Height(); aR.Bottom() += aSiz.Height(); - ((SdrView&)GetView()).InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aR); + const_cast<SdrView&>(GetView()).InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aR); } } } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index ed47f0a254c1..e6114ffc2776 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -108,7 +108,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId ) if( pStm ) { - Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() ); + Graphic aGraphic( aGrfObject.GetGraphic() ); const GfxLink aGfxLink( aGraphic.GetLink() ); bool bRet = false; @@ -513,7 +513,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, SvxGraphicHelperStream_Impl aStream( ImplGetGraphicStream( rPictureStorageName, rPictureStreamName ) ); if( aStream.xStream.is() ) { - Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() ); + Graphic aGraphic( aGrfObject.GetGraphic() ); const GfxLink aGfxLink( aGraphic.GetLink() ); const OUString aMimeType( ImplGetGraphicMimeType( rPictureStreamName ) ); uno::Reference < beans::XPropertySet > xProps( aStream.xStream, uno::UNO_QUERY ); @@ -663,7 +663,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt if( aGrfObject.GetType() != GraphicType::NONE ) { OUString aStreamName( aPictureStreamName ); - Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() ); + Graphic aGraphic( aGrfObject.GetGraphic() ); const GfxLink aGfxLink( aGraphic.GetLink() ); OUString aExtension; bool bUseGfxLink( true ); diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 8713164a2750..07619419abfe 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -201,7 +201,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, ( rGraphic.GetType() != GraphicType::GdiMetafile ) && rGraphic.IsLink() ) { // try to write native link - const GfxLink aGfxLink( ( (Graphic&) rGraphic ).GetLink() ); + const GfxLink aGfxLink( rGraphic.GetLink() ); switch( aGfxLink.GetType() ) { |