diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-25 11:03:10 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-05-25 11:02:57 +0000 |
commit | d3714207b1d8cc323a639a942121b6c1aa4cd61b (patch) | |
tree | ad6d1ec19c087c8636aac37045b13f4d4d26f24e | |
parent | 78e4b913d1bdcef83f66249fb5006803f28f96d1 (diff) |
remove some unnecessary casts and convert some to const_cast
Change-Id: I590a87c832bc59947ae04e52d3ac5ea71574bb11
Reviewed-on: https://gerrit.libreoffice.org/15888
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 4 | ||||
-rw-r--r-- | include/svx/svdpntv.hxx | 13 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuconrec.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuconrec.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/sdrpagewindow.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdcrtv.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdocirc.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdotxdr.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/draw/dview.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/porfly.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtdd.cxx | 2 |
16 files changed, 18 insertions, 35 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 4536cda3ad52..75faa0925fd1 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2582,7 +2582,7 @@ bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uIn DffRecordList* pCList = maShapeRecords.pCList; // we got a backup of the current position if ( pCList ) nCurrent = pCList->nCurrent; - if ( ((SdrEscherImport*)this )->maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) ) + if ( const_cast<SdrPowerPointImport*>(this)->maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) ) { sal_uInt32 nStreamPos = rSt.Tell(); PPTTextObj aTextObj( rSt, (SdrPowerPointImport&)*this, rPersistEntry, NULL ); @@ -2615,7 +2615,7 @@ bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uIn } if ( pCList ) // restoring pCList->nCurrent = nCurrent; - ((SdrEscherImport*)this )->maShapeRecords.pCList = pCList; + const_cast<SdrPowerPointImport*>(this)->maShapeRecords.pCList = pCList; } } } diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 1b3603257c22..ee4ba06c2ba5 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -334,21 +334,8 @@ public: virtual void HideSdrPage(); // Iterieren ueber alle angemeldeten PageViews -// sal_uInt16 GetPageViewCount() const { return sal_uInt16(aPagV.Count()); } -// SdrPageView* GetPageViewByIndex(sal_uInt16 nPvNum) const { return ((SdrPageView*)aPagV.GetObject(nPvNum)); } SdrPageView* GetSdrPageView() const { return mpPageView; } - // Pageview einer bestimmten Seite ermitteln -// SdrPageView* GetPageViewByPage(const SdrPage* pPage) const; -// sal_uInt16 GetIndexByPageView(const SdrPageView* pPV) const; - - // Test, ob eine Seite getroffen -// SdrPageView* HitPage(const Point& rPnt) const; - - // Die Seite, die dem Punkt am naechsten ist. Liefert nur NULL, - // wenn absolut keine Seite angemeldet ist. -// SdrPageView* GetPageViewByPosition(const Point& rPnt) const; - // Eine SdrView kann auf mehreren Fenstern gleichzeitig abgebiltet sein: virtual void AddWindowToPaintView(OutputDevice* pNewWin); virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin); diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx index e93322753be3..a39f12fc9235 100644 --- a/sc/source/ui/drawfunc/fuconrec.cxx +++ b/sc/source/ui/drawfunc/fuconrec.cxx @@ -267,8 +267,6 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec // don't set default text, start edit mode instead // (Edit mode is started in ScTabViewShell::ExecDraw, because // it must be handled by FuText) - // String aText(ScResId(STR_CAPTION_DEFAULT_TEXT)); - // ((SdrCaptionObj*)pObj)->SetText(aText); static_cast<SdrCaptionObj*>(pObj)->SetLogicRect(aRect); static_cast<SdrCaptionObj*>(pObj)->SetTailPos( diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index f90cac33d578..27c72a30a3f5 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -268,7 +268,7 @@ void SdTransferable::CreateData() mpSdViewIntern->EndListening(*mpSdDrawDocumentIntern ); mpSdViewIntern->hideMarkHandles(); SdrPageView* pPageView = mpSdViewIntern->ShowSdrPage(pPage); - ((SdrMarkView*)mpSdViewIntern)->MarkAllObj(pPageView); + mpSdViewIntern->MarkAllObj(pPageView); } else if( mpSdView && !mpSdDrawDocumentIntern ) { @@ -723,7 +723,7 @@ void SdTransferable::SetPageBookmarks( const std::vector<OUString> &rPageBookmar if( pPage ) { - ( (SdrMarkView*) mpSdViewIntern )->MarkAllObj( mpSdViewIntern->ShowSdrPage( pPage ) ); + mpSdViewIntern->MarkAllObj( mpSdViewIntern->ShowSdrPage( pPage ) ); } } diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index d8ee5ddecd1b..9dec24693992 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -907,8 +907,6 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const } // The default text is not inserted anymore. - // String aText(SdResId(STR_POOLSHEET_TEXT)); - // ((SdrCaptionObj*)pObj)->SetText(aText); static_cast<SdrCaptionObj*>(pObj)->SetLogicRect(aRect); static_cast<SdrCaptionObj*>(pObj)->SetTailPos( diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index f62a81ab95e5..68f4b5a2ab4a 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -264,7 +264,7 @@ namespace if(pObjA && pObjA->ISA(SdrPathObj)) { - basegfx::B2DPolyPolygon aPolyA(((SdrPathObj*)pObjA)->GetPathPoly()); + basegfx::B2DPolyPolygon aPolyA(pObjA->GetPathPoly()); aPolyA = basegfx::tools::correctOrientations(aPolyA); basegfx::B2DPolyPolygon aPolyB; @@ -275,7 +275,7 @@ namespace if(pObjB && pObjB->ISA(SdrPathObj)) { - basegfx::B2DPolyPolygon aCandidate(((SdrPathObj*)pObjB)->GetPathPoly()); + basegfx::B2DPolyPolygon aCandidate(pObjB->GetPathPoly()); aCandidate = basegfx::tools::correctOrientations(aCandidate); aPolyB.append(aCandidate); } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index cd9f8880cbac..2e97cb78026c 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -477,7 +477,7 @@ bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const if (!rLogRect.IsEmpty()) pAktCreate->NbcSetLogicRect(rLogRect); // make sure drag start point is inside WorkArea - const Rectangle& rWorkArea = ((SdrDragView*)this)->GetWorkArea(); + const Rectangle& rWorkArea = GetWorkArea(); if(!rWorkArea.IsEmpty()) { diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 4ea4c4de24c5..c314edf2826a 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1923,7 +1923,7 @@ SdrHdl* SdrObjCustomShape::GetHdl( sal_uInt32 nHdlNum ) const com::sun::star::awt::Point aPosition( aInteractionHandles[ nCustomShapeHdlNum ].xInteraction->getPosition() ); pH = new SdrHdl( Point( aPosition.X, aPosition.Y ), HDL_CUSTOMSHAPE1 ); pH->SetPointNum( nCustomShapeHdlNum ); - pH->SetObj( (SdrObject*)this ); + pH->SetObj( const_cast<SdrObjCustomShape*>(this) ); } catch ( const uno::RuntimeException& ) { diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index c0677ccc2c54..1468008781d2 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -464,7 +464,7 @@ SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const { pH = new SdrHdl(aPnt,eLocalKind); pH->SetPointNum(nPNum); - pH->SetObj((SdrObject*)this); + pH->SetObj(const_cast<SdrCircObj*>(this)); pH->SetRotationAngle(aGeo.nRotationAngle); } diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 19e87c9134ec..24be46ef69d2 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -337,7 +337,7 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const // hack for calc grid sync to ensure the hatched area // for a textbox is displayed at correct position pH = new ImpTextframeHdl(maRect + GetGridOffset() ); - pH->SetObj((SdrObject*)this); + pH->SetObj(const_cast<SdrRectObj*>(this)); pH->SetRotationAngle(aGeo.nRotationAngle); break; } @@ -375,7 +375,7 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const } pH = new SdrHdl(aPnt,eKind); - pH->SetObj((SdrObject*)this); + pH->SetObj(const_cast<SdrRectObj*>(this)); pH->SetRotationAngle(aGeo.nRotationAngle); } diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index d28fc2e74708..36de7ba1de9c 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -56,7 +56,7 @@ SdrHdl* SdrTextObj::GetHdl(sal_uInt32 nHdlNum) const if (aGeo.nRotationAngle!=0) RotatePoint(aPnt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); if (eKind!=HDL_MOVE) { pH=new SdrHdl(aPnt,eKind); - pH->SetObj((SdrObject*)this); + pH->SetObj(const_cast<SdrTextObj*>(this)); pH->SetRotationAngle(aGeo.nRotationAngle); } return pH; diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 8fe3df18977b..7d2d701ea44a 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1573,10 +1573,10 @@ sal_uInt16 SdrPage::GetPageNum() const if (mbMaster) { if (pModel && pModel->IsMPgNumsDirty()) - ((SdrModel*)pModel)->RecalcPageNums(true); + pModel->RecalcPageNums(true); } else { if (pModel && pModel->IsPagNumsDirty()) - ((SdrModel*)pModel)->RecalcPageNums(false); + pModel->RecalcPageNums(false); } return nPageNum; } diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 2df0aa05bddc..cc81412e463b 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -461,7 +461,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject( { bool bDrawObject(true); - if ( !SwFlyFrm::IsPaint( (SdrObject*)this, pShell ) ) + if ( !SwFlyFrm::IsPaint( const_cast<SwVirtFlyDrawObj*>(this), pShell ) ) { bDrawObject = false; } diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 0f005b878951..3e109c75fceb 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -931,7 +931,7 @@ void SwDrawView::DeleteMarked() SdrPageView* pDrawPageView = rImp.GetPageView(); if ( pDrawPageView ) { - SdrMarkView* pMarkView = PTR_CAST( SdrMarkView, &(pDrawPageView->GetView()) ); + SdrMarkView* pMarkView = &(pDrawPageView->GetView()); if ( pMarkView ) { ReplaceMarkedDrawVirtObjs( *pMarkView ); diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index ac84ea739bce..aefa9d40cb36 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -228,7 +228,7 @@ void SwFlyCntPortion::Paint( const SwTextPaintInfo &rInf ) const if( (GetFlyFrm()->IsCompletePaint() || GetFlyFrm()->Frm().IsOver( aRepaintRect )) && - SwFlyFrm::IsPaint( (SdrObject*)GetFlyFrm()->GetVirtDrawObj(), + SwFlyFrm::IsPaint( const_cast<SwVirtFlyDrawObj*>(GetFlyFrm()->GetVirtDrawObj()), GetFlyFrm()->getRootFrm()->GetCurrShell() )) { SwRect aRect( GetFlyFrm()->Frm() ); diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx index 044d201ff4fe..92c576445258 100644 --- a/sw/source/uibase/docvw/edtdd.cxx +++ b/sw/source/uibase/docvw/edtdd.cxx @@ -434,7 +434,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) EXCHG_IN_ACTION_LINK == m_nDropAction) || SotClipboardFormatId::SBA_CTRLDATAEXCHANGE == m_nDropFormat ) { - SdrMarkView* pMView = PTR_CAST( SdrMarkView, rSh.GetDrawView() ); + SdrMarkView* pMView = rSh.GetDrawView(); if( pMView && !pMView->IsDesignMode() ) return DND_ACTION_NONE; } |