diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-24 10:39:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-25 10:09:51 +0200 |
commit | c7ab37e17c514b1c86fca10ff8734e9752f458fa (patch) | |
tree | 9cbfd797462575ff6ba02eca9444587fca984368 | |
parent | 64572975221c9fafed8363393d96f6a11b14e92c (diff) |
loplugin: cstylecast
Change-Id: I30e5d05641f7dea749820db4dc7ed87342d0c35a
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/expfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/frmedt/feflyole.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/frmedt/fetab.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/flyfrm.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/flyfrms.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/inc/frame.hxx | 50 | ||||
-rw-r--r-- | sw/source/core/inc/frmtool.hxx | 20 | ||||
-rw-r--r-- | sw/source/core/inc/ftnboss.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/pagefrm.hxx | 38 | ||||
-rw-r--r-- | sw/source/core/inc/rootfrm.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/inc/tabfrm.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/txtfly.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 18 | ||||
-rw-r--r-- | sw/source/core/inc/viewimp.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 6 |
20 files changed, 98 insertions, 98 deletions
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index ec0f4e2bcad6..45301f745826 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1111,7 +1111,7 @@ OUString SwDocInfoField::Expand() const uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING ); aNew >>= sVal; } - ((SwDocInfoField*)this)->aContent = sVal; + const_cast<SwDocInfoField*>(this)->aContent = sVal; } } } @@ -2205,7 +2205,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, } } // start formatting - ((SwFmtFld&)pTxtFld->GetFmtFld()).ModifyNotification( 0, 0 ); + const_cast<SwFmtFld&>(pTxtFld->GetFmtFld()).ModifyNotification( 0, 0 ); } // queries for relative page numbering diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 310036319696..fbf07425545c 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -239,7 +239,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, { pTxtNode = pCntFrm->GetNode()->GetTxtNode(); rPos.nNode = *pTxtNode; - ((SwTxtNode*)pTxtNode)->MakeEndIndex( &rPos.nContent ); + const_cast<SwTxtNode*>(pTxtNode)->MakeEndIndex( &rPos.nContent ); } else { diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 4d059483f08b..e69cfe932fd5 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -168,7 +168,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt ) rIdx.GetIndex(), RES_TXTATR_FLYCNT)); if( pTxtFly ) { - ((SwFmtFlyCnt&)pTxtFly->GetFlyCnt()).SetFlyFmt( 0 ); + const_cast<SwFmtFlyCnt&>(pTxtFly->GetFlyCnt()).SetFlyFmt( 0 ); pTxtNd->EraseText( rIdx, 1 ); } } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index a88dd95263e4..a5ab5c0d178f 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -659,14 +659,14 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, bool bAnchValid, { bHOriChgd = true; aOldH = *static_cast<const SwFmtHoriOrient*>(pItem); - ((SfxItemSet&)rSet).Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT ) ); + const_cast<SfxItemSet&>(rSet).Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT ) ); } if( SfxItemState::SET == rSet.GetItemState( RES_VERT_ORIENT, false, &pItem ) && text::VertOrientation::NONE == static_cast<const SwFmtVertOrient*>(pItem)->GetVertOrient() ) { bVOriChgd = true; aOldV = *static_cast<const SwFmtVertOrient*>(pItem); - ((SfxItemSet&)rSet).Put( SwFmtVertOrient( 0, text::VertOrientation::TOP ) ); + const_cast<SfxItemSet&>(rSet).Put( SwFmtVertOrient( 0, text::VertOrientation::TOP ) ); } } @@ -706,12 +706,12 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, bool bAnchValid, } } - ((SfxItemSet&)rSet).Put( *pOldAnchor ); + const_cast<SfxItemSet&>(rSet).Put( *pOldAnchor ); if( bHOriChgd ) - ((SfxItemSet&)rSet).Put( aOldH ); + const_cast<SfxItemSet&>(rSet).Put( aOldH ); if( bVOriChgd ) - ((SfxItemSet&)rSet).Put( aOldV ); + const_cast<SfxItemSet&>(rSet).Put( aOldV ); GetDoc()->SetFlyFrmAttr( *pRet, (SfxItemSet&)rSet ); GetDoc()->GetIDocumentUndoRedo().DoUndo(bDoesUndo); diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx index b58e4c714525..92938ba8f73a 100644 --- a/sw/source/core/frmedt/feflyole.cxx +++ b/sw/source/core/frmedt/feflyole.cxx @@ -101,9 +101,9 @@ void SwFEShell::MakeObjVisible( const uno::Reference < embed::XEmbeddedObject >& aTmp += pFly->Frm().Pos(); if ( !aTmp.IsOver( VisArea() ) ) { - ((SwFEShell*)this)->StartAction(); - ((SwFEShell*)this)->MakeVisible( aTmp ); - ((SwFEShell*)this)->EndAction(); + const_cast<SwFEShell*>(this)->StartAction(); + const_cast<SwFEShell*>(this)->MakeVisible( aTmp ); + const_cast<SwFEShell*>(this)->EndAction(); } } } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index edbceef18e31..026e3af759fa 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -776,7 +776,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) aTmpCalcPnt = pCnt->Prt(); aTmpCalcPnt += pCnt->Frm().Pos(); if ( aRect.IsOver( aTmpCalcPnt ) ) - ((SwFrm*)pCnt)->Prepare( PREP_FLY_ATTR_CHG ); + static_cast<SwFrm*>(pCnt)->Prepare( PREP_FLY_ATTR_CHG ); pCnt = pCnt->GetNextCntntFrm(); } } @@ -2429,7 +2429,7 @@ void SwFEShell::CheckUnboundObjects() SwPosition aPos( *static_cast<const SwCntntFrm*>(pAnch)->GetNode() ); aAnch.SetType( FLY_AT_PARA ); aAnch.SetAnchor( &aPos ); - ((SwRect&)GetCharRect()).Pos() = aPt; + const_cast<SwRect&>(GetCharRect()).Pos() = aPt; } // First the action here, to assure GetCharRect delivers current values. diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index a12edc00a815..9880be5bf436 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -1390,7 +1390,7 @@ static const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt, do { if ( pFrm->IsInTab() ) - pFrm = ((SwFrm*)pFrm)->ImplFindTabFrm(); + pFrm = const_cast<SwFrm*>(pFrm)->ImplFindTabFrm(); if ( pFrm->IsTabFrm() ) { diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 0ed2af2b2628..2e65da8b6071 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -120,7 +120,7 @@ static const SwLayoutFrm *lcl_FindNextCellFrm( const SwLayoutFrm *pLay ) void GetTblSelCrs( const SwCrsrShell &rShell, SwSelBoxes& rBoxes ) { rBoxes.clear(); - if( rShell.IsTableMode() && ((SwCrsrShell&)rShell).UpdateTblSelBoxes()) + if( rShell.IsTableMode() && const_cast<SwCrsrShell&>(rShell).UpdateTblSelBoxes()) { rBoxes.insert(rShell.GetTableCrsr()->GetSelectedBoxes()); } diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 8dc0d7bb4399..c6ca43ce21df 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -193,8 +193,8 @@ public: void ChgRelPos( const Point &rAbsPos ); bool IsInvalid() const { return bInvalid; } - void Invalidate() const { ((SwFlyFrm*)this)->bInvalid = true; } - void Validate() const { ((SwFlyFrm*)this)->bInvalid = false; } + void Invalidate() const { const_cast<SwFlyFrm*>(this)->bInvalid = true; } + void Validate() const { const_cast<SwFlyFrm*>(this)->bInvalid = false; } bool IsMinHeight() const { return bMinHeight; } bool IsLocked() const { return bLocked; } diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index 49dfe5b3c2b0..ef011259007c 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -225,20 +225,20 @@ public: inline void SwFlyInCntFrm::InvalidateLayout() const { - ((SwFlyInCntFrm*)this)->bInvalidLayout = true; + const_cast<SwFlyInCntFrm*>(this)->bInvalidLayout = true; } inline void SwFlyInCntFrm::InvalidateCntnt() const { - ((SwFlyInCntFrm*)this)->bInvalidCntnt = true; + const_cast<SwFlyInCntFrm*>(this)->bInvalidCntnt = true; } inline void SwFlyInCntFrm::ValidateLayout() const { - ((SwFlyInCntFrm*)this)->bInvalidLayout = false; + const_cast<SwFlyInCntFrm*>(this)->bInvalidLayout = false; } inline void SwFlyInCntFrm::ValidateCntnt() const { - ((SwFlyInCntFrm*)this)->bInvalidCntnt = false; + const_cast<SwFlyInCntFrm*>(this)->bInvalidCntnt = false; } #endif diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 651684ad4fbd..cd96b26dc02d 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -674,7 +674,7 @@ public: SwFrm* GetIndNext() { return ( mpNext || !IsInSct() ) ? mpNext : _GetIndNext(); } - const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); } + const SwFrm* GetIndNext() const { return static_cast<const SwFrm*>(this)->GetIndNext(); } sal_uInt16 GetPhyPageNum() const; // page number without offset sal_uInt16 GetVirtPageNum() const; // page number with offset @@ -909,37 +909,37 @@ public: inline bool SwFrm::IsInDocBody() const { if ( mbInfInvalid ) - ((SwFrm*)this)->SetInfFlags(); + const_cast<SwFrm*>(this)->SetInfFlags(); return mbInfBody; } inline bool SwFrm::IsInFtn() const { if ( mbInfInvalid ) - ((SwFrm*)this)->SetInfFlags(); + const_cast<SwFrm*>(this)->SetInfFlags(); return mbInfFtn; } inline bool SwFrm::IsInTab() const { if ( mbInfInvalid ) - ((SwFrm*)this)->SetInfFlags(); + const_cast<SwFrm*>(this)->SetInfFlags(); return mbInfTab; } inline bool SwFrm::IsInFly() const { if ( mbInfInvalid ) - ((SwFrm*)this)->SetInfFlags(); + const_cast<SwFrm*>(this)->SetInfFlags(); return mbInfFly; } inline bool SwFrm::IsInSct() const { if ( mbInfInvalid ) - ((SwFrm*)this)->SetInfFlags(); + const_cast<SwFrm*>(this)->SetInfFlags(); return mbInfSct; } bool SwFrm::IsVertical() const { if( mbInvalidVert ) - ((SwFrm*)this)->SetDirFlags( true ); + const_cast<SwFrm*>(this)->SetDirFlags( true ); return mbVertical; } inline bool SwFrm::IsVertLR() const @@ -949,26 +949,26 @@ inline bool SwFrm::IsVertLR() const inline bool SwFrm::IsRightToLeft() const { if( mbInvalidR2L ) - ((SwFrm*)this)->SetDirFlags( false ); + const_cast<SwFrm*>(this)->SetDirFlags( false ); return mbRightToLeft; } inline void SwFrm::SetCompletePaint() const { - ((SwFrm*)this)->mbCompletePaint = true; + const_cast<SwFrm*>(this)->mbCompletePaint = true; } inline void SwFrm::ResetCompletePaint() const { - ((SwFrm*)this)->mbCompletePaint = false; + const_cast<SwFrm*>(this)->mbCompletePaint = false; } inline void SwFrm::SetRetouche() const { - ((SwFrm*)this)->mbRetouche = true; + const_cast<SwFrm*>(this)->mbRetouche = true; } inline void SwFrm::ResetRetouche() const { - ((SwFrm*)this)->mbRetouche = false; + const_cast<SwFrm*>(this)->mbRetouche = false; } inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf() @@ -1031,12 +1031,12 @@ inline void SwFrm::InvalidateNextPos( bool bNoFtn ) inline void SwFrm::Calc() const { if ( !mbValidPos || !mbValidPrtArea || !mbValidSize ) - ((SwFrm*)this)->PrepareMake(); + const_cast<SwFrm*>(this)->PrepareMake(); } inline void SwFrm::OptCalc() const { if ( !mbValidPos || !mbValidPrtArea || !mbValidSize ) - ((SwFrm*)this)->OptPrepareMake(); + const_cast<SwFrm*>(this)->OptPrepareMake(); } inline Point SwFrm::GetRelPos() const @@ -1050,15 +1050,15 @@ inline Point SwFrm::GetRelPos() const inline const SwPageFrm *SwFrm::FindPageFrm() const { - return ((SwFrm*)this)->FindPageFrm(); + return const_cast<SwFrm*>(this)->FindPageFrm(); } inline const SwFrm *SwFrm::FindColFrm() const { - return ((SwFrm*)this)->FindColFrm(); + return const_cast<SwFrm*>(this)->FindColFrm(); } inline const SwFrm *SwFrm::FindFooterOrHeader() const { - return ((SwFrm*)this)->FindFooterOrHeader(); + return const_cast<SwFrm*>(this)->FindFooterOrHeader(); } inline SwTabFrm *SwFrm::FindTabFrm() { @@ -1066,7 +1066,7 @@ inline SwTabFrm *SwFrm::FindTabFrm() } inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( bool bFtn ) const { - return ((SwFrm*)this)->FindFtnBossFrm( bFtn ); + return const_cast<SwFrm*>(this)->FindFtnBossFrm( bFtn ); } inline SwFtnFrm *SwFrm::FindFtnFrm() { @@ -1083,19 +1083,19 @@ inline SwSectionFrm *SwFrm::FindSctFrm() inline const SwTabFrm *SwFrm::FindTabFrm() const { - return IsInTab() ? ((SwFrm*)this)->ImplFindTabFrm() : 0; + return IsInTab() ? const_cast<SwFrm*>(this)->ImplFindTabFrm() : 0; } inline const SwFtnFrm *SwFrm::FindFtnFrm() const { - return IsInFtn() ? ((SwFrm*)this)->ImplFindFtnFrm() : 0; + return IsInFtn() ? const_cast<SwFrm*>(this)->ImplFindFtnFrm() : 0; } inline const SwFlyFrm *SwFrm::FindFlyFrm() const { - return IsInFly() ? ((SwFrm*)this)->ImplFindFlyFrm() : 0; + return IsInFly() ? const_cast<SwFrm*>(this)->ImplFindFlyFrm() : 0; } inline const SwSectionFrm *SwFrm::FindSctFrm() const { - return IsInSct() ? ((SwFrm*)this)->ImplFindSctFrm() : 0; + return IsInSct() ? const_cast<SwFrm*>(this)->ImplFindSctFrm() : 0; } inline SwFrm *SwFrm::FindNext() { @@ -1109,7 +1109,7 @@ inline const SwFrm *SwFrm::FindNext() const if ( mpNext ) return mpNext; else - return ((SwFrm*)this)->_FindNext(); + return const_cast<SwFrm*>(this)->_FindNext(); } // #i27138# - add parameter <_bInSameFtn> inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) @@ -1125,7 +1125,7 @@ inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const if ( mpNext && mpNext->IsCntntFrm() ) return (SwCntntFrm*)mpNext; else - return ((SwFrm*)this)->_FindNextCnt( _bInSameFtn ); + return const_cast<SwFrm*>(this)->_FindNextCnt( _bInSameFtn ); } inline SwFrm *SwFrm::FindPrev() { @@ -1139,7 +1139,7 @@ inline const SwFrm *SwFrm::FindPrev() const if ( mpPrev && !mpPrev->IsSctFrm() ) return mpPrev; else - return ((SwFrm*)this)->_FindPrev(); + return const_cast<SwFrm*>(this)->_FindPrev(); } inline bool SwFrm::IsLayoutFrm() const diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 04b70539b57d..4db4225cdbfb 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -457,9 +457,9 @@ inline sal_uInt16 SwBorderAttrs::GetBottomLine( const SwFrm& _rFrm ) const } inline void SwBorderAttrs::SetGetCacheLine( bool bNew ) const { - ((SwBorderAttrs*)this)->bCacheGetLine = bNew; - ((SwBorderAttrs*)this)->bCachedGetBottomLine = - ((SwBorderAttrs*)this)->bCachedGetTopLine = false; + const_cast<SwBorderAttrs*>(this)->bCacheGetLine = bNew; + const_cast<SwBorderAttrs*>(this)->bCachedGetBottomLine = + const_cast<SwBorderAttrs*>(this)->bCachedGetTopLine = false; // invalidate cache for values <bJoinedWithPrev> and <bJoinedWithNext> bCachedJoinedWithPrev = false; bCachedJoinedWithNext = false; @@ -468,43 +468,43 @@ inline void SwBorderAttrs::SetGetCacheLine( bool bNew ) const inline sal_uInt16 SwBorderAttrs::CalcTopLine() const { if ( bTopLine ) - ((SwBorderAttrs*)this)->_CalcTopLine(); + const_cast<SwBorderAttrs*>(this)->_CalcTopLine(); return nTopLine; } inline sal_uInt16 SwBorderAttrs::CalcBottomLine() const { if ( bBottomLine ) - ((SwBorderAttrs*)this)->_CalcBottomLine(); + const_cast<SwBorderAttrs*>(this)->_CalcBottomLine(); return nBottomLine; } inline sal_uInt16 SwBorderAttrs::CalcLeftLine() const { if ( bLeftLine ) - ((SwBorderAttrs*)this)->_CalcLeftLine(); + const_cast<SwBorderAttrs*>(this)->_CalcLeftLine(); return nLeftLine; } inline sal_uInt16 SwBorderAttrs::CalcRightLine() const { if ( bRightLine ) - ((SwBorderAttrs*)this)->_CalcRightLine(); + const_cast<SwBorderAttrs*>(this)->_CalcRightLine(); return nRightLine; } inline sal_uInt16 SwBorderAttrs::CalcTop() const { if ( bTop ) - ((SwBorderAttrs*)this)->_CalcTop(); + const_cast<SwBorderAttrs*>(this)->_CalcTop(); return nTop; } inline sal_uInt16 SwBorderAttrs::CalcBottom() const { if ( bBottom ) - ((SwBorderAttrs*)this)->_CalcBottom(); + const_cast<SwBorderAttrs*>(this)->_CalcBottom(); return nBottom; } inline bool SwBorderAttrs::IsLine() const { if ( bLine ) - ((SwBorderAttrs*)this)->_IsLine(); + const_cast<SwBorderAttrs*>(this)->_IsLine(); return bIsLine; } diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx index e51e12468a54..bd0efb9c02b9 100644 --- a/sw/source/core/inc/ftnboss.hxx +++ b/sw/source/core/inc/ftnboss.hxx @@ -125,12 +125,12 @@ public: inline const SwLayoutFrm *SwFtnBossFrm::FindBodyCont() const { - return ((SwFtnBossFrm*)this)->FindBodyCont(); + return const_cast<SwFtnBossFrm*>(this)->FindBodyCont(); } inline const SwFtnContFrm *SwFtnBossFrm::FindFtnCont() const { - return ((SwFtnBossFrm*)this)->FindFtnCont(); + return const_cast<SwFtnBossFrm*>(this)->FindFtnCont(); } #endif diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index 129ee68f8c22..52b86063942f 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -344,81 +344,81 @@ inline const SwCntntFrm *SwPageFrm::FindFirstBodyCntnt() const } inline const SwCntntFrm *SwPageFrm::FindLastBodyCntnt() const { - return ((SwPageFrm*)this)->FindLastBodyCntnt(); + return const_cast<SwPageFrm*>(this)->FindLastBodyCntnt(); } inline void SwPageFrm::InvalidateFlyLayout() const { - ((SwPageFrm*)this)->bInvalidFlyLayout = true; + const_cast<SwPageFrm*>(this)->bInvalidFlyLayout = true; } inline void SwPageFrm::InvalidateFlyCntnt() const { - ((SwPageFrm*)this)->bInvalidFlyCntnt = true; + const_cast<SwPageFrm*>(this)->bInvalidFlyCntnt = true; } inline void SwPageFrm::InvalidateFlyInCnt() const { - ((SwPageFrm*)this)->bInvalidFlyInCnt = true; + const_cast<SwPageFrm*>(this)->bInvalidFlyInCnt = true; } inline void SwPageFrm::InvalidateLayout() const { - ((SwPageFrm*)this)->bInvalidLayout = true; + const_cast<SwPageFrm*>(this)->bInvalidLayout = true; } inline void SwPageFrm::InvalidateCntnt() const { - ((SwPageFrm*)this)->bInvalidCntnt = true; + const_cast<SwPageFrm*>(this)->bInvalidCntnt = true; } inline void SwPageFrm::InvalidateSpelling() const { - ((SwPageFrm*)this)->bInvalidSpelling = true; + const_cast<SwPageFrm*>(this)->bInvalidSpelling = true; } inline void SwPageFrm::InvalidateSmartTags() const { - ((SwPageFrm*)this)->bInvalidSmartTags = true; + const_cast<SwPageFrm*>(this)->bInvalidSmartTags = true; } inline void SwPageFrm::InvalidateAutoCompleteWords() const { - ((SwPageFrm*)this)->bInvalidAutoCmplWrds = true; + const_cast<SwPageFrm*>(this)->bInvalidAutoCmplWrds = true; } inline void SwPageFrm::InvalidateWordCount() const { - ((SwPageFrm*)this)->bInvalidWordCount = true; + const_cast<SwPageFrm*>(this)->bInvalidWordCount = true; } inline void SwPageFrm::ValidateFlyLayout() const { - ((SwPageFrm*)this)->bInvalidFlyLayout = false; + const_cast<SwPageFrm*>(this)->bInvalidFlyLayout = false; } inline void SwPageFrm::ValidateFlyCntnt() const { - ((SwPageFrm*)this)->bInvalidFlyCntnt = false; + const_cast<SwPageFrm*>(this)->bInvalidFlyCntnt = false; } inline void SwPageFrm::ValidateFlyInCnt() const { - ((SwPageFrm*)this)->bInvalidFlyInCnt = false; + const_cast<SwPageFrm*>(this)->bInvalidFlyInCnt = false; } inline void SwPageFrm::ValidateLayout() const { - ((SwPageFrm*)this)->bInvalidLayout = false; + const_cast<SwPageFrm*>(this)->bInvalidLayout = false; } inline void SwPageFrm::ValidateCntnt() const { - ((SwPageFrm*)this)->bInvalidCntnt = false; + const_cast<SwPageFrm*>(this)->bInvalidCntnt = false; } inline void SwPageFrm::ValidateSpelling() const { - ((SwPageFrm*)this)->bInvalidSpelling = false; + const_cast<SwPageFrm*>(this)->bInvalidSpelling = false; } inline void SwPageFrm::ValidateSmartTags() const { - ((SwPageFrm*)this)->bInvalidSmartTags = false; + const_cast<SwPageFrm*>(this)->bInvalidSmartTags = false; } inline void SwPageFrm::ValidateAutoCompleteWords() const { - ((SwPageFrm*)this)->bInvalidAutoCmplWrds = false; + const_cast<SwPageFrm*>(this)->bInvalidAutoCmplWrds = false; } inline void SwPageFrm::ValidateWordCount() const { - ((SwPageFrm*)this)->bInvalidWordCount = false; + const_cast<SwPageFrm*>(this)->bInvalidWordCount = false; } inline bool SwPageFrm::IsInvalid() const diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 3fa2f4a1b71f..8d91b2cc93a4 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -299,8 +299,8 @@ public: */ bool MakeTblCrsrs( SwTableCursor& ); - void DisallowTurbo() const { ((SwRootFrm*)this)->bTurboAllowed = false; } - void ResetTurboFlag() const { ((SwRootFrm*)this)->bTurboAllowed = true; } + void DisallowTurbo() const { const_cast<SwRootFrm*>(this)->bTurboAllowed = false; } + void ResetTurboFlag() const { const_cast<SwRootFrm*>(this)->bTurboAllowed = true; } bool IsTurboAllowed() const { return bTurboAllowed; } void SetTurbo( const SwCntntFrm *pCntnt ) { pTurbo = pCntnt; } void ResetTurbo() { pTurbo = 0; } @@ -372,7 +372,7 @@ public: inline long SwRootFrm::GetBrowseWidth() const { if ( !bBrowseWidthValid ) - ((SwRootFrm*)this)->ImplCalcBrowseWidth(); + const_cast<SwRootFrm*>(this)->ImplCalcBrowseWidth(); return nBrowseWidth; } @@ -384,7 +384,7 @@ inline void SwRootFrm::InvalidateBrowseWidth() inline void SwRootFrm::SetVirtPageNum( const bool bOf) const { - ((SwRootFrm*)this)->bIsVirtPageNum = bOf; + const_cast<SwRootFrm*>(this)->bIsVirtPageNum = bOf; } #endif // INCLUDED_SW_SOURCE_CORE_INC_ROOTFRM_HXX diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index f44ce884c1f7..543317419453 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -224,7 +224,7 @@ public: inline const SwCntntFrm *SwTabFrm::FindLastCntnt() const { - return ((SwTabFrm*)this)->FindLastCntnt(); + return const_cast<SwTabFrm*>(this)->FindLastCntnt(); } inline const SwTabFrm *SwTabFrm::GetFollow() const diff --git a/sw/source/core/inc/txtfly.hxx b/sw/source/core/inc/txtfly.hxx index ddb3de8269af..4fe14f436b90 100644 --- a/sw/source/core/inc/txtfly.hxx +++ b/sw/source/core/inc/txtfly.hxx @@ -341,7 +341,7 @@ inline SwTwips SwTxtFly::GetMinBottom() const inline const SwCntntFrm* SwTxtFly::GetMaster() const { - return pMaster ? pMaster : ((SwTxtFly*)this)->_GetMaster(); + return pMaster ? pMaster : const_cast<SwTxtFly*>(this)->_GetMaster(); } inline long SwTxtFly::GetNextTop() const @@ -351,7 +351,7 @@ inline long SwTxtFly::GetNextTop() const inline void SwTxtFly::SetNextTop( long nNew ) const { - ((SwTxtFly*)this)->nNextTop = nNew; + const_cast<SwTxtFly*>(this)->nNextTop = nNew; } inline SwRect SwTxtFly::GetFrm( const SwRect &rRect, bool bTop ) const diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 5d828838bdc5..d76fc92c0f13 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -659,7 +659,7 @@ public: inline const SwParaPortion *SwTxtFrm::GetPara() const { - return ((SwTxtFrm*)this)->GetPara(); + return const_cast<SwTxtFrm*>(this)->GetPara(); } inline bool SwTxtFrm::HasPara() const @@ -722,7 +722,7 @@ inline SwTxtFrm *SwTxtFrm::GetFollow() inline const SwTxtFrm *SwTxtFrm::GetFrmAtPos( const SwPosition &rPos) const { - return ((SwTxtFrm*)this)->GetFrmAtPos( rPos ); + return const_cast<SwTxtFrm*>(this)->GetFrmAtPos( rPos ); } inline void SwTxtFrm::AdjustFollow( SwTxtFormatter &rLine, @@ -740,20 +740,20 @@ inline void SwTxtFrm::SetOfst( const sal_Int32 nNewOfst ) inline void SwTxtFrm::SetRepaint() const { - ((SwTxtFrm*)this)->bRepaint = true; + const_cast<SwTxtFrm*>(this)->bRepaint = true; } inline void SwTxtFrm::ResetRepaint() const { - ((SwTxtFrm*)this)->bRepaint = false; + const_cast<SwTxtFrm*>(this)->bRepaint = false; } inline void SwTxtFrm::SetBlinkPor() const { - ((SwTxtFrm*)this)->bBlinkPor = true; + const_cast<SwTxtFrm*>(this)->bBlinkPor = true; } inline void SwTxtFrm::ResetBlinkPor() const { - ((SwTxtFrm*)this)->bBlinkPor = false; + const_cast<SwTxtFrm*>(this)->bBlinkPor = false; } #define SWAP_IF_SWAPPED( pFrm )\ @@ -761,7 +761,7 @@ inline void SwTxtFrm::ResetBlinkPor() const if ( pFrm->IsVertical() && pFrm->IsSwapped() )\ { \ bUndoSwap = true; \ - ((SwTxtFrm*)pFrm)->SwapWidthAndHeight(); \ + const_cast<SwTxtFrm*>(pFrm)->SwapWidthAndHeight(); \ } #define SWAP_IF_NOT_SWAPPED( pFrm )\ @@ -769,12 +769,12 @@ inline void SwTxtFrm::ResetBlinkPor() const if ( pFrm->IsVertical() && ! pFrm->IsSwapped() )\ { \ bUndoSwap = true; \ - ((SwTxtFrm*)pFrm)->SwapWidthAndHeight(); \ + const_cast<SwTxtFrm*>(pFrm)->SwapWidthAndHeight(); \ } #define UNDO_SWAP( pFrm )\ if ( bUndoSwap )\ - ((SwTxtFrm*)pFrm)->SwapWidthAndHeight(); + const_cast<SwTxtFrm*>(pFrm)->SwapWidthAndHeight(); /** * Helper class which can be used instead of the macros if a function diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 341c1d088cb0..8c64a8d5d5e3 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -282,7 +282,7 @@ inline SwPageFrm *SwViewImp::GetFirstVisPage() inline const SwPageFrm *SwViewImp::GetFirstVisPage() const { if ( bFirstPageInvalid ) - ((SwViewImp*)this)->SetFirstVisPage(); + const_cast<SwViewImp*>(this)->SetFirstVisPage(); return pFirstVisPage; } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 3720cd3933fe..e00ff22df286 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1996,7 +1996,7 @@ void SwFmtChain::SetPrev( SwFlyFrmFmt *pFmt ) if ( pFmt ) pFmt->Add( &aPrev ); else if ( aPrev.GetRegisteredIn() ) - ((SwModify*)aPrev.GetRegisteredIn())->Remove( &aPrev ); + static_cast<SwModify*>(aPrev.GetRegisteredIn())->Remove( &aPrev ); } void SwFmtChain::SetNext( SwFlyFrmFmt *pFmt ) @@ -2004,7 +2004,7 @@ void SwFmtChain::SetNext( SwFlyFrmFmt *pFmt ) if ( pFmt ) pFmt->Add( &aNext ); else if ( aNext.GetRegisteredIn() ) - ((SwModify*)aNext.GetRegisteredIn())->Remove( &aNext ); + static_cast<SwModify*>(aNext.GetRegisteredIn())->Remove( &aNext ); } bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -3285,7 +3285,7 @@ IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint, nFlags = IMAP_MIRROR_HORZ; } - return ((ImageMap*)rURL.GetMap())->GetHitIMapObject( aOrigSz, + return const_cast<ImageMap*>(rURL.GetMap())->GetHitIMapObject( aOrigSz, aActSz, aPos, nFlags ); } |