diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-24 10:39:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-25 10:09:50 +0200 |
commit | 64572975221c9fafed8363393d96f6a11b14e92c (patch) | |
tree | 513df982eac45c32b2c446961c2fe1bc6da38dde | |
parent | 1be3bfed0a76c7e43f0376fb375abcfb5d954eb8 (diff) |
loplugin: cstylecast
Change-Id: I8c5d2302695d22e4fe976a370b75b26dec373024
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/swserv.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/ndcopy.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl1.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/draw/dpage.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/edit/acorrect.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edtab.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 4 |
15 files changed, 31 insertions, 31 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 55c690b9876f..e51fd928fd96 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -958,7 +958,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons else if ( !rGrfObj.GetGraphic().IsSupportedGraphic() ) nResId = STR_COMCORE_CANT_SHOW; - ((SwNoTxtFrm*)this)->nWeight = -1; + const_cast<SwNoTxtFrm*>(this)->nWeight = -1; OUString aText; if ( !nResId && (aText = pGrfNd->GetTitle()).isEmpty() && diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index de948b2921d7..ce473a67014e 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -233,7 +233,7 @@ bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const // To avoid recursions: convert ServerType! SwServerObject::ServerModes eSave = eType; if( !pChkLnk ) - ((SwServerObject*)this)->eType = NONE_SERVER; + const_cast<SwServerObject*>(this)->eType = NONE_SERVER; for( sal_uInt16 n = rLnks.size(); n; ) { const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); @@ -253,7 +253,7 @@ bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const } } if( !pChkLnk ) - ((SwServerObject*)this)->eType = eSave; + const_cast<SwServerObject*>(this)->eType = eSave; } return false; diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index e3fd50cb564c..899802fc6be0 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -734,7 +734,7 @@ void SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos, if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT, true, (const SfxPoolItem**)&pNumFmtItem ) && pNFmtr && 0 != (pNumFormat = pNFmtr->GetEntry( pNumFmtItem->GetValue() )) ) - pFmt->SetValueFormat( ((SvNumberformat*)pNumFormat)->GetFormatstring(), + pFmt->SetValueFormat( const_cast<SvNumberformat*>(pNumFormat)->GetFormatstring(), pNumFormat->GetLanguage(), ::GetAppLanguage()); else @@ -1093,7 +1093,7 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl() { aBox.SetLine( i <= 3 ? &aLn : 0, BOX_LINE_TOP ); aBox.SetLine( (3 == ( i & 3 )) ? &aLn : 0, BOX_LINE_RIGHT ); - ((SwBoxAutoFmt&)pNew->GetBoxFmt( i )).SetBox( aBox ); + const_cast<SwBoxAutoFmt&>(pNew->GetBoxFmt( i )).SetBox( aBox ); } m_pImpl->m_AutoFormats.push_back(pNew); diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index afe7eea64527..47d5f6231ff1 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -223,8 +223,8 @@ static void lcl_CopyTblLine( const SwTableLine* pLine, _CopyTable* pCT ) pCT->pTblNd->GetTable().GetTabLines().push_back( pNewLine ); } pCT->pInsLine = pNewLine; - for( SwTableBoxes::iterator it = ((SwTableLine*)pLine)->GetTabBoxes().begin(); - it != ((SwTableLine*)pLine)->GetTabBoxes().end(); ++it) + for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(pLine)->GetTabBoxes().begin(); + it != const_cast<SwTableLine*>(pLine)->GetTabBoxes().end(); ++it) lcl_CopyTblBox(*it, pCT ); } diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 3c9af0415b25..4e9b0380d22a 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -864,7 +864,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, if ( pTab->IsFollow() && pTab->IsInHeadline( *pCell ) ) continue; - ((SwTableBox*)pCell->GetTabBox())->ClaimFrmFmt(); + const_cast<SwTableBox*>(pCell->GetTabBox())->ClaimFrmFmt(); SwFrmFmt *pFmt = pCell->GetFmt(); SvxBoxItem aBox( pFmt->GetBox() ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 9f72b912ae92..98126b722ca2 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -940,14 +940,14 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV if( pFmt->GetRegisteredIn() ) { // If Parent, register anew in the new Parent - ((SwModify*)pFmt->GetRegisteredIn())->Add( this ); + static_cast<SwModify*>(pFmt->GetRegisteredIn())->Add( this ); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFmtColl(), GetFmtColl() ); } else { // Else register anyways when dying - ((SwModify*)GetRegisteredIn())->Remove( this ); + static_cast<SwModify*>(GetRegisteredIn())->Remove( this ); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, 0, 0 ); } @@ -1275,7 +1275,7 @@ void SwCntntNode::DelFrms( bool bIsDisposeAccTable ) 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) { OSL_ENSURE( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); - ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); + static_cast<SwTxtFrm*>(pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); } } //Set acc table dispose state diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index a8ee50e2cc48..3dd8e3bd4b4f 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1631,7 +1631,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer ) // Instead of removing 'master' object from drawing page, move the // 'master' drawing object into the corresponding invisible layer. { - //((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)-> + //static_cast<SwFrmFmt*>(GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)-> // RemoveObject( GetMaster()->GetOrdNum() ); // #i18447# - in order to consider group object correct // use new method <SwDrawContact::MoveObjToInvisibleLayer(..)> @@ -2449,8 +2449,8 @@ void SwDrawVirtObj::RecalcSnapRect() const Rectangle& SwDrawVirtObj::GetSnapRect() const { - ((SwDrawVirtObj*)this)->aSnapRect = rRefObj.GetSnapRect(); - ((SwDrawVirtObj*)this)->aSnapRect += GetOffset(); + const_cast<SwDrawVirtObj*>(this)->aSnapRect = rRefObj.GetSnapRect(); + const_cast<SwDrawVirtObj*>(this)->aSnapRect += GetOffset(); return aSnapRect; } @@ -2475,8 +2475,8 @@ void SwDrawVirtObj::NbcSetSnapRect(const Rectangle& rRect) const Rectangle& SwDrawVirtObj::GetLogicRect() const { - ((SwDrawVirtObj*)this)->aSnapRect = rRefObj.GetLogicRect(); - ((SwDrawVirtObj*)this)->aSnapRect += GetOffset(); + const_cast<SwDrawVirtObj*>(this)->aSnapRect = rRefObj.GetLogicRect(); + const_cast<SwDrawVirtObj*>(this)->aSnapRect += GetOffset(); return aSnapRect; } diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 3228772a9b38..4d1557ebb1f1 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -502,9 +502,9 @@ void SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const void SwVirtFlyDrawObj::SetRect() const { if ( GetFlyFrm()->Frm().HasArea() ) - ((SwVirtFlyDrawObj*)this)->aOutRect = GetFlyFrm()->Frm().SVRect(); + const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = GetFlyFrm()->Frm().SVRect(); else - ((SwVirtFlyDrawObj*)this)->aOutRect = Rectangle(); + const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = Rectangle(); } const Rectangle& SwVirtFlyDrawObj::GetCurrentBoundRect() const diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 7e955e6a1080..1793c196bd13 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -90,9 +90,9 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList( if (pSh) { if ( pGridLst ) - ((SwDPage*)this)->pGridLst->Clear(); + const_cast<SwDPage*>(this)->pGridLst->Clear(); else - ((SwDPage*)this)->pGridLst = new SdrPageGridFrameList; + const_cast<SwDPage*>(this)->pGridLst = new SdrPageGridFrameList; if ( pRect ) { @@ -101,7 +101,7 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList( const SwFrm *pPg = pSh->GetLayout()->Lower(); do { if ( pPg->Frm().IsOver( aRect ) ) - ::InsertGridFrame( ((SwDPage*)this)->pGridLst, pPg ); + ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst, pPg ); pPg = pPg->GetNext(); } while ( pPg ); } @@ -111,7 +111,7 @@ const SdrPageGridFrameList* SwDPage::GetGridFrameList( const SwFrm *pPg = pSh->Imp()->GetFirstVisPage(); if ( pPg ) do - { ::InsertGridFrame( ((SwDPage*)this)->pGridLst, pPg ); + { ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst, pPg ); pPg = pPg->GetNext(); } while ( pPg && pPg->Frm().IsOver( pSh->VisArea() ) ); } diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 5d828e1db39c..6c738e11d5e5 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -463,7 +463,7 @@ void SwDontExpandItem::SaveDontExpandItems( const SwPosition& rPos ) const SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); if( pTxtNd ) { - pDontExpItems = new SfxItemSet( ((SwDoc*)pTxtNd->GetDoc())->GetAttrPool(), + pDontExpItems = new SfxItemSet( const_cast<SwDoc*>(pTxtNd->GetDoc())->GetAttrPool(), aCharFmtSetRange ); const sal_Int32 n = rPos.nContent.GetIndex(); if( !pTxtNd->GetAttr( *pDontExpItems, n, n, diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index aadc7c3ea0c1..6b0fadac7331 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -438,7 +438,7 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl if( m_aFlags.bAFmtByInput ) { nLvl = rNd.GetAutoFmtLvl(); - ((SwTxtNode&)rNd).SetAutoFmtLvl( 0 ); + const_cast<SwTxtNode&>(rNd).SetAutoFmtLvl( 0 ); if( nLvl ) return nLvl; } diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 4c6ac6266dfd..4d7c107e3377 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -34,7 +34,7 @@ SwTxtFmtColl& SwEditShell::GetDfltTxtFmtColl() const { - return *((SwTxtFmtColl*) (GetDoc()->GetDfltTxtFmtColl())); + return *static_cast<SwTxtFmtColl*>( (GetDoc()->GetDfltTxtFmtColl())); } sal_uInt16 SwEditShell::GetTxtFmtCollCount() const diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 33755b15633e..9486d9b62f46 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -441,7 +441,7 @@ void SwHyphIter::Start( SwEditShell *pShell, SwDocPositions eStart, SwDocPositio // nothing to do (at least not in the way as in the "else" part) bOldIdle = pShell->GetViewOptions()->IsIdle(); - ((SwViewOption*)pShell->GetViewOptions())->SetIdle( false ); + const_cast<SwViewOption*>(pShell->GetViewOptions())->SetIdle( false ); _Start( pShell, eStart, eEnd ); } @@ -450,7 +450,7 @@ void SwHyphIter::End() { if( !GetSh() ) return; - ((SwViewOption*)GetSh()->GetViewOptions())->SetIdle( bOldIdle ); + const_cast<SwViewOption*>(GetSh()->GetViewOptions())->SetIdle( bOldIdle ); _End(); } diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 1395e1fad8ef..eb7fbbbfe31f 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -281,7 +281,7 @@ void SwEditShell::SetTblChgMode( TblChgMode eMode ) if( pTblNd ) { - ((SwTable&)pTblNd->GetTable()).SetTblChgMode( eMode ); + const_cast<SwTable&>(pTblNd->GetTable()).SetTblChgMode( eMode ); if( !GetDoc()->getIDocumentState().IsModified() ) // Bug 57028 { GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified(); @@ -321,7 +321,7 @@ bool SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const SwTableFmlUpdate aTblUpdate( (SwTable*)&rTbl ); aTblUpdate.eFlags = TBL_BOXNAME; - ((SwDoc*)GetDoc())->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); + static_cast<SwDoc*>(GetDoc())->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); rSet.Put( pTblFmt->GetAttrSet() ); } diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 7504cce86063..b9c3db188d82 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -106,7 +106,7 @@ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly) { OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase); - ((SwTOXBase&)rTOXBase).SetProtected(bReadonly); + const_cast<SwTOXBase&>(rTOXBase).SetProtected(bReadonly); OSL_ENSURE( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" ); SwSectionData aSectionData(rTOXSect); @@ -143,7 +143,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) CalcLayout(); // insert page numbering - ((SwTOXBaseSection*)pTOX)->UpdatePageNum(); + const_cast<SwTOXBaseSection*>(pTOX)->UpdatePageNum(); pTOX->SetPosAtStartEnd( *GetCrsr()->GetPoint() ); |