[Libreoffice-commits] core.git: 2 commits - sw/source
Noel Grandin
noel at peralex.com
Wed Nov 19 03:23:46 PST 2014
sw/source/core/docnode/section.cxx | 42 ++++-----
sw/source/core/docnode/swbaslnk.cxx | 10 +-
sw/source/core/draw/dcontact.cxx | 44 +++++-----
sw/source/core/draw/dflyobj.cxx | 6 -
sw/source/core/draw/dpage.cxx | 8 -
sw/source/core/draw/dview.cxx | 22 ++---
sw/source/core/edit/autofmt.cxx | 14 +--
sw/source/core/edit/edatmisc.cxx | 6 -
sw/source/core/edit/edattr.cxx | 28 +++---
sw/source/core/edit/eddel.cxx | 2
sw/source/core/edit/edfcol.cxx | 4
sw/source/core/edit/edfld.cxx | 10 +-
sw/source/core/edit/edfldexp.cxx | 2
sw/source/core/edit/edfmt.cxx | 2
sw/source/core/edit/edglbldc.cxx | 4
sw/source/core/edit/editsh.cxx | 32 +++----
sw/source/core/edit/edlingu.cxx | 2
sw/source/core/edit/ednumber.cxx | 6 -
sw/source/core/edit/edredln.cxx | 2
sw/source/core/edit/edtab.cxx | 16 +--
sw/source/core/edit/edtox.cxx | 8 -
sw/source/core/edit/edws.cxx | 10 +-
sw/source/core/fields/authfld.cxx | 42 ++++-----
sw/source/core/fields/cellfml.cxx | 28 +++---
sw/source/core/fields/chpfld.cxx | 2
sw/source/core/fields/dbfld.cxx | 36 ++++----
sw/source/core/fields/ddefld.cxx | 30 +++----
sw/source/core/fields/ddetbl.cxx | 10 +-
sw/source/core/fields/docufld.cxx | 68 ++++++++--------
sw/source/core/fields/expfld.cxx | 42 ++++-----
sw/source/core/fields/fldbas.cxx | 20 ++--
sw/source/core/fields/flddat.cxx | 4
sw/source/core/fields/fldlst.cxx | 4
sw/source/core/fields/macrofld.cxx | 2
sw/source/core/fields/reffld.cxx | 24 ++---
sw/source/core/fields/scrptfld.cxx | 2
sw/source/core/fields/tblcalc.cxx | 4
sw/source/core/fields/usrfld.cxx | 18 ++--
sw/source/core/frmedt/fecopy.cxx | 22 ++---
sw/source/core/frmedt/fedesc.cxx | 22 ++---
sw/source/core/frmedt/fefly1.cxx | 88 ++++++++++----------
sw/source/core/frmedt/feflyole.cxx | 8 -
sw/source/core/frmedt/feshview.cxx | 104 ++++++++++++------------
sw/source/core/frmedt/fetab.cxx | 52 ++++++------
sw/source/core/frmedt/fews.cxx | 36 ++++----
sw/source/core/frmedt/tblsel.cxx | 120 ++++++++++++++--------------
sw/source/core/graphic/grfatr.cxx | 6 -
sw/source/core/graphic/ndgrf.cxx | 24 ++---
sw/source/core/layout/atrfrm.cxx | 112 +++++++++++++-------------
sw/source/core/layout/calcmove.cxx | 110 +++++++++++++-------------
sw/source/core/layout/colfrm.cxx | 36 ++++----
sw/source/core/layout/dbg_lay.cxx | 2
sw/source/core/layout/findfrm.cxx | 152 ++++++++++++++++++------------------
sw/source/core/layout/flowfrm.cxx | 98 +++++++++++------------
sw/source/core/layout/fly.cxx | 94 +++++++++++-----------
55 files changed, 851 insertions(+), 851 deletions(-)
New commits:
commit 0ad264911b9217a3241f6c0e1769b22e8bd76e48
Author: Noel Grandin <noel at peralex.com>
Date: Wed Nov 19 09:31:53 2014 +0200
loplugin: cstylecast
Change-Id: If25e3b030d484f03078bfba265bed82b315e2742
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 4f10aeb..4d05948 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -104,7 +104,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt )
// also delete surrounding FlyFrames if any
for( sal_uInt16 n = 0; n < pClpDoc->GetSpzFrmFmts()->size(); ++n )
{
- SwFlyFrmFmt* pFly = (SwFlyFrmFmt*)(*pClpDoc->GetSpzFrmFmts())[n];
+ SwFlyFrmFmt* pFly = static_cast<SwFlyFrmFmt*>((*pClpDoc->GetSpzFrmFmts())[n]);
pClpDoc->getIDocumentLayoutAccess().DelLayoutFmt( pFly );
}
pClpDoc->GetDocumentFieldsManager().GCFieldTypes(); // delete the FieldTypes
@@ -199,7 +199,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt )
}
else
{
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall( pObj );
+ SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall( pObj ));
SwFrmFmt *pFmt = pContact->GetFmt();
SwFmtAnchor aAnchor( pFmt->GetAnchor() );
if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
@@ -232,7 +232,7 @@ static const Point &lcl_FindBasePos( const SwFrm *pFrm, const Point &rPt )
while ( pF && !pF->Frm().IsInside( rPt ) )
{
if ( pF->IsCntntFrm() )
- pF = ((SwCntntFrm*)pF)->GetFollow();
+ pF = static_cast<const SwCntntFrm*>(pF)->GetFollow();
else
pF = 0;
}
@@ -301,7 +301,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
{
SdrObject *pObj = aMrkList.GetMark( i )->GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall( pObj );
+ SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall( pObj ));
SwFrmFmt *pFmt = pContact->GetFmt();
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
@@ -549,7 +549,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
// only select if it can be shifted/copied in the same shell
if( bSelectInsert )
{
- SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aPt, false );
+ SwFlyFrm* pFlyFrm = static_cast<SwFlyFrmFmt*>(pFlyFmt)->GetFrm( &aPt, false );
if( pFlyFrm )
{
//JP 12.05.98: should this be in SelectFlyFrm???
@@ -976,7 +976,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
if( RES_FLYFRMFMT == pNew->Which() )
{
const Point aPt( GetCrsrDocPos() );
- SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pNew)->
+ SwFlyFrm* pFlyFrm = static_cast<SwFlyFrmFmt*>(pNew)->
GetFrm( &aPt, false );
if( pFlyFrm )
SelectFlyFrm( *pFlyFrm, true );
@@ -1371,7 +1371,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
pFmt = FindFrmFmt( pOldObj );
Point aNullPt;
- SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pFmt)->GetFrm( &aNullPt );
+ SwFlyFrm* pFlyFrm = static_cast<const SwFlyFrmFmt*>(pFmt)->GetFrm( &aNullPt );
pAnchor = pFlyFrm ? pFlyFrm->GetAnchorFrm() : NULL;
if (!pAnchor || pAnchor->FindFooterOrHeader())
@@ -1411,9 +1411,9 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
aFrmSet.Set( pFmt->GetAttrSet() );
Point aNullPt;
- if( pAnchor->IsTxtFrm() && ((SwTxtFrm*)pAnchor)->IsFollow() )
+ if( pAnchor->IsTxtFrm() && static_cast<const SwTxtFrm*>(pAnchor)->IsFollow() )
{
- const SwTxtFrm* pTmp = (SwTxtFrm*)pAnchor;
+ const SwTxtFrm* pTmp = static_cast<const SwTxtFrm*>(pAnchor);
do {
pTmp = pTmp->FindMaster();
OSL_ENSURE( pTmp, "Where's my Master?" );
@@ -1421,7 +1421,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
pAnchor = pTmp;
}
if( pOldObj->ISA( SdrCaptionObj ))
- aNullPt = ((SdrCaptionObj*)pOldObj)->GetTailPos();
+ aNullPt = static_cast<SdrCaptionObj*>(pOldObj)->GetTailPos();
else
aNullPt = aOldObjRect.TopLeft();
@@ -1564,7 +1564,7 @@ bool SwFEShell::Paste(const Graphic &rGrf, const OUString& rURL)
if(dynamic_cast< SdrGrafObj* >(pObj))
{
- SdrGrafObj* pNewGrafObj = (SdrGrafObj*)pObj->Clone();
+ SdrGrafObj* pNewGrafObj = static_cast<SdrGrafObj*>(pObj->Clone());
pNewGrafObj->SetGraphic(rGrf);
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index 2240feb..353d5b4 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -74,15 +74,15 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
break;
}
}
- pPage = (SwPageFrm*) pPage->GetPrev();
+ pPage = static_cast<SwPageFrm*>( pPage->GetPrev() );
}
if ( !pPage )
{
- pPage = (SwPageFrm*) (GetLayout()->Lower());
+ pPage = static_cast<SwPageFrm*>(GetLayout()->Lower());
pFlow = pPage->FindFirstBodyCntnt();
if ( !pFlow )
{
- pPage = (SwPageFrm*)pPage->GetNext();
+ pPage = static_cast<SwPageFrm*>(pPage->GetNext());
pFlow = pPage->FindFirstBodyCntnt();
OSL_ENSURE( pFlow, "Dokuemnt ohne Inhalt?!?" );
}
@@ -96,7 +96,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
GetDoc()->SetAttr( aNew, *(SwFmt*)pFlow->FindTabFrm()->GetFmt() );
else
{
- SwPaM aPaM( *((SwCntntFrm*)pFlow)->GetNode() );
+ SwPaM aPaM( *static_cast<const SwCntntFrm*>(pFlow)->GetNode() );
GetDoc()->getIDocumentContentOperations().InsertPoolItem( aPaM, aNew, 0 );
}
EndAllActionAndCall();
@@ -185,7 +185,7 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const
{
const SwCntntNode* pCNd;
const SwFrm* pMkFrm, *pPtFrm;
- const SwPageDesc* pFnd, *pRetDesc = (SwPageDesc*)0xffffffff;
+ const SwPageDesc* pFnd, *pRetDesc = reinterpret_cast<SwPageDesc*>(0xffffffff);
const Point aNulPt;
FOREACHPAM_START(GetCrsr())
@@ -206,27 +206,27 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const
if( !pMkFrm || !pPtFrm )
pFnd = 0;
else if( pMkFrm == pPtFrm )
- pFnd = ((SwPageFrm*)pMkFrm)->GetPageDesc();
+ pFnd = static_cast<const SwPageFrm*>(pMkFrm)->GetPageDesc();
else
{
// swap pointer if PtFrm before MkFrm
- if( ((SwPageFrm*)pMkFrm)->GetPhyPageNum() >
- ((SwPageFrm*)pPtFrm)->GetPhyPageNum() )
+ if( static_cast<const SwPageFrm*>(pMkFrm)->GetPhyPageNum() >
+ static_cast<const SwPageFrm*>(pPtFrm)->GetPhyPageNum() )
{
const SwFrm* pTmp = pMkFrm; pMkFrm = pPtFrm; pPtFrm = pTmp;
}
// now check from MkFrm to PtFrm for equal PageDescs
- pFnd = ((SwPageFrm*)pMkFrm)->GetPageDesc();
+ pFnd = static_cast<const SwPageFrm*>(pMkFrm)->GetPageDesc();
while( pFnd && pMkFrm != pPtFrm )
{
pMkFrm = pMkFrm->GetNext();
- if( !pMkFrm || pFnd != ((SwPageFrm*)pMkFrm)->GetPageDesc() )
+ if( !pMkFrm || pFnd != static_cast<const SwPageFrm*>(pMkFrm)->GetPageDesc() )
pFnd = 0;
}
}
- if( (SwPageDesc*)0xffffffff == pRetDesc )
+ if( reinterpret_cast<SwPageDesc*>(0xffffffff) == pRetDesc )
pRetDesc = pFnd;
else if( pFnd != pRetDesc )
{
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 13535e2..a88dd95 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -106,7 +106,7 @@ static bool lcl_FindAnchorPos(
SfxItemSet& rSet )
{
bool bRet = true;
- SwFmtAnchor aNewAnch( (SwFmtAnchor&)rSet.Get( RES_ANCHOR ) );
+ SwFmtAnchor aNewAnch( static_cast<const SwFmtAnchor&>(rSet.Get( RES_ANCHOR )) );
RndStdIds nNew = aNewAnch.GetAnchorId();
const SwFrm *pNewAnch;
@@ -120,7 +120,7 @@ static bool lcl_FindAnchorPos(
{
// starting from the upper-left corner of the Fly,
// search nearest CntntFrm
- const SwFrm* pFrm = rFrm.IsFlyFrm() ? ((SwFlyFrm&)rFrm).GetAnchorFrm()
+ const SwFrm* pFrm = rFrm.IsFlyFrm() ? static_cast<const SwFlyFrm&>(rFrm).GetAnchorFrm()
: &rFrm;
pNewAnch = ::FindAnchor( pFrm, aTmpPnt );
if( pNewAnch->IsProtected() )
@@ -129,7 +129,7 @@ static bool lcl_FindAnchorPos(
break;
}
- SwPosition aPos( *((SwCntntFrm*)pNewAnch)->GetNode() );
+ SwPosition aPos( *static_cast<const SwCntntFrm*>(pNewAnch)->GetNode() );
if ((FLY_AT_CHAR == nNew) || (FLY_AS_CHAR == nNew))
{
// textnode should be found, as only in those
@@ -138,7 +138,7 @@ static bool lcl_FindAnchorPos(
aTmpPnt.setX(aTmpPnt.getX() - 1); // do not land in the fly!
if( !pNewAnch->GetCrsrOfst( &aPos, aTmpPnt, &aState ) )
{
- SwCntntNode* pCNd = ((SwCntntFrm*)pNewAnch)->GetNode();
+ SwCntntNode* pCNd = const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(pNewAnch))->GetNode();
if( pNewAnch->Frm().Bottom() < aTmpPnt.Y() )
pCNd->MakeStartIndex( &aPos.nContent );
else
@@ -170,7 +170,7 @@ static bool lcl_FindAnchorPos(
if( pNewAnch && &rFrm != pNewAnch && !pNewAnch->IsProtected() )
{
- aPos.nNode = *((SwFlyFrm*)pNewAnch)->GetFmt()->GetCntnt().
+ aPos.nNode = *static_cast<const SwFlyFrm*>(pNewAnch)->GetFmt()->GetCntnt().
GetCntntIdx();
aNewAnch.SetAnchor( &aPos );
break;
@@ -204,7 +204,7 @@ bool sw_ChkAndSetNewAnchor(
const SwFmtAnchor &rOldAnch = rFmt.GetAnchor();
const RndStdIds nOld = rOldAnch.GetAnchorId();
- RndStdIds nNew = ((SwFmtAnchor&)rSet.Get( RES_ANCHOR )).GetAnchorId();
+ RndStdIds nNew = static_cast<const SwFmtAnchor&>(rSet.Get( RES_ANCHOR )).GetAnchorId();
if( nOld == nNew )
return false;
@@ -267,7 +267,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
return 0;
SdrObject *pO = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- return ( pO && pO->ISA(SwVirtFlyDrawObj) ) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0;
+ return ( pO && pO->ISA(SwVirtFlyDrawObj) ) ? static_cast<SwVirtFlyDrawObj*>(pO)->GetFlyFrm() : 0;
}
return 0;
}
@@ -301,11 +301,11 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
if( pFmt && FLY_AT_FLY == pFmt->GetAnchor().GetAnchorId() )
{
const SwFrm* pFly = pObj->ISA(SwVirtFlyDrawObj) ?
- ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetAnchorFrm() :
- ((SwDrawContact*)GetUserCall(pObj))->GetAnchorFrm( pObj );
+ static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm()->GetAnchorFrm() :
+ static_cast<SwDrawContact*>(GetUserCall(pObj))->GetAnchorFrm( pObj );
OSL_ENSURE( pFly, "IsFlyInFly: Where's my anchor?" );
OSL_ENSURE( pFly->IsFlyFrm(), "IsFlyInFly: Funny anchor!" );
- return ((SwFlyFrm*)pFly)->GetFmt();
+ return static_cast<const SwFlyFrm*>(pFly)->GetFmt();
}
Point aTmpPos = pObj->GetCurrentBoundRect().TopLeft();
@@ -346,7 +346,7 @@ void SwFEShell::SetFlyPos( const Point& rAbsPos )
// Set an anchor starting from the absolute position for paragraph bound Flys
// Anchor and new RelPos will be calculated and set by the Fly
if ( pFly->IsFlyAtCntFrm() )
- ((SwFlyAtCntFrm*)pFly)->SetAbsPos( rAbsPos );
+ static_cast<SwFlyAtCntFrm*>(pFly)->SetAbsPos( rAbsPos );
else
{
const SwFrm *pAnch = pFly->GetAnchorFrm();
@@ -487,14 +487,14 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt )
}
case FLY_AT_PAGE:
{
- aAnch.SetPageNum( ((const SwPageFrm*)pNewAnch)->
+ aAnch.SetPageNum( static_cast<const SwPageFrm*>(pNewAnch)->
GetPhyPageNum() );
break;
}
case FLY_AT_FLY:
{
- SwPosition aPos( *((SwFlyFrm*)pNewAnch)->GetFmt()->
+ SwPosition aPos( *static_cast<const SwFlyFrm*>(pNewAnch)->GetFmt()->
GetCntnt().GetCntntIdx() );
aAnch.SetAnchor( &aPos );
break;
@@ -604,7 +604,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, bool bAnchValid,
const SwPosition& rPos = *pCrsr->Start();
- SwFmtAnchor& rAnch = (SwFmtAnchor&)rSet.Get( RES_ANCHOR );
+ SwFmtAnchor& rAnch = const_cast<SwFmtAnchor&>(static_cast<const SwFmtAnchor&>(rSet.Get( RES_ANCHOR )));
RndStdIds eRndId = rAnch.GetAnchorId();
switch( eRndId )
{
@@ -655,17 +655,17 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, bool bAnchValid,
const SfxPoolItem* pItem;
if( SfxItemState::SET == rSet.GetItemState( RES_HORI_ORIENT, false, &pItem )
- && text::HoriOrientation::NONE == ((SwFmtHoriOrient*)pItem)->GetHoriOrient() )
+ && text::HoriOrientation::NONE == static_cast<const SwFmtHoriOrient*>(pItem)->GetHoriOrient() )
{
bHOriChgd = true;
- aOldH = *((SwFmtHoriOrient*)pItem);
+ aOldH = *static_cast<const SwFmtHoriOrient*>(pItem);
((SfxItemSet&)rSet).Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT ) );
}
if( SfxItemState::SET == rSet.GetItemState( RES_VERT_ORIENT, false, &pItem )
- && text::VertOrientation::NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient() )
+ && text::VertOrientation::NONE == static_cast<const SwFmtVertOrient*>(pItem)->GetVertOrient() )
{
bVOriChgd = true;
- aOldV = *((SwFmtVertOrient*)pItem);
+ aOldV = *static_cast<const SwFmtVertOrient*>(pItem);
((SfxItemSet&)rSet).Put( SwFmtVertOrient( 0, text::VertOrientation::TOP ) );
}
}
@@ -684,10 +684,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, bool bAnchValid,
pRet->DelFrms();
const SwFrm* pAnch = ::FindAnchor( GetLayout(), aPt, false );
- SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
+ SwPosition aPos( *static_cast<const SwCntntFrm*>(pAnch)->GetNode() );
if ( FLY_AS_CHAR == eRndId )
{
- aPos.nContent.Assign( ((SwCntntFrm*)pAnch)->GetNode(), 0 );
+ aPos.nContent.Assign( const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(pAnch))->GetNode(), 0 );
}
pOldAnchor->SetAnchor( &aPos );
@@ -765,7 +765,7 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName,
if( SfxItemState::SET == pFlyAttrSet->GetItemState( RES_ANCHOR, false,
&pItem ) )
{
- SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
+ SwFmtAnchor* pAnchor = const_cast<SwFmtAnchor*>(static_cast<const SwFmtAnchor*>(pItem));
switch( pAnchor->GetAnchorId())
{
case FLY_AT_PARA:
@@ -947,7 +947,7 @@ void SwFEShell::SetPageObjsNewPage( std::vector<SwFrmFmt*>& rFillArr, int nOffse
{
SwContact *pCon = pFmt->FindContactObj();
if( pCon )
- ((SwDrawContact*)pCon)->DisconnectFromLayout();
+ static_cast<SwDrawContact*>(pCon)->DisconnectFromLayout();
}
else
pFmt->DelFrms();
@@ -997,7 +997,7 @@ bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
const SfxPoolItem* pItem;
if( SfxItemState::SET == rSet.GetItemState( RES_ANCHOR, false, &pItem ) )
{
- SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
+ const SwFmtAnchor* pAnchor = static_cast<const SwFmtAnchor*>(pItem);
RndStdIds eType = pAnchor->GetAnchorId();
if ( FLY_AT_PAGE != eType )
@@ -1078,7 +1078,7 @@ bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
StartAllAction();
if( SfxItemState::SET == rSet.GetItemState( RES_ANCHOR, false ))
{
- RndStdIds nNew = ((SwFmtAnchor&)rSet.Get( RES_ANCHOR )).GetAnchorId();
+ RndStdIds nNew = static_cast<const SwFmtAnchor&>(rSet.Get( RES_ANCHOR )).GetAnchorId();
if ( nNew != pFmt->GetAnchor().GetAnchorId() )
{
ChgAnchor( nNew );
@@ -1149,7 +1149,7 @@ SwFrmFmt* SwFEShell::GetCurFrmFmt() const
{
SwFrmFmt* pRet = 0;
SwLayoutFrm *pFly = FindFlyFrm();
- if( pFly && ( pRet = (SwFrmFmt*)pFly->GetFmt()->DerivedFrom() ) ==
+ if( pFly && ( pRet = static_cast<SwFrmFmt*>(pFly->GetFmt()->DerivedFrom()) ) ==
GetDoc()->GetDfltFrmFmt() )
pRet = 0;
return pRet;
@@ -1163,7 +1163,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, bool bKeepOrient, Point* pDocPos )
const SwFrmFmt* pFmt = GetFmtFromObj( *pDocPos );
if(PTR_CAST(SwFlyFrmFmt, pFmt))
- pFly = ((SwFlyFrmFmt*)pFmt)->GetFrm();
+ pFly = static_cast<const SwFlyFrmFmt*>(pFmt)->GetFrm();
}
else
pFly = FindFlyFrm();
@@ -1298,7 +1298,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
pAnchor->IsTxtFrm() &&
!pAnchor->GetNext() && !pAnchor->GetPrev() &&
pAnchor->GetUpper()->IsFlyFrm() &&
- 0 != ( pTNd = ((SwTxtFrm*)pAnchor)->GetNode()->GetTxtNode()) &&
+ 0 != ( pTNd = static_cast<const SwTxtFrm*>(pAnchor)->GetNode()->GetTxtNode()) &&
0 != ( pHts = pTNd->GetpSwpHints() ))
{
// search for a sequence field:
@@ -1307,10 +1307,10 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
{
const SfxPoolItem* pItem = &(*pHts)[ n ]->GetAttr();
if( RES_TXTATR_FIELD == pItem->Which()
- && TYP_SEQFLD == ((SwFmtFld*)pItem)->GetField()->GetTypeId() )
+ && TYP_SEQFLD == static_cast<const SwFmtFld*>(pItem)->GetField()->GetTypeId() )
{
// sequence field found
- SwFlyFrm* pChgFly = (SwFlyFrm*)pAnchor->GetUpper();
+ SwFlyFrm* pChgFly = const_cast<SwFlyFrm*>(static_cast<const SwFlyFrm*>(pAnchor->GetUpper()));
// calculate the changed size:
// width must change, height can change
Size aNewSz( aSz.Width() + pChgFly->Frm().Width() -
@@ -1343,7 +1343,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
// if the object changes, the contour is outside the object
OSL_ENSURE( pFly->Lower()->IsNoTxtFrm(), "Request without NoTxt" );
- SwNoTxtNode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetNoTxtNode();
+ SwNoTxtNode *pNd = static_cast<SwCntntFrm*>(pFly->Lower())->GetNode()->GetNoTxtNode();
OSL_ENSURE( pNd, "Request without Node" );
pNd->SetContour( 0 );
ClrContourCache();
@@ -1363,7 +1363,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
// a new anchor is to be set. The anchor and the new RelPos are
// calculated by the Fly and set
if( pFly->IsFlyAtCntFrm() )
- ((SwFlyAtCntFrm*)pFly)->SetAbsPos( aPt );
+ static_cast<SwFlyAtCntFrm*>(pFly)->SetAbsPos( aPt );
else
{
const SwFrmFmt *pFmt = pFly->GetFmt();
@@ -1422,7 +1422,7 @@ void SwFEShell::SetFlyName( const OUString& rName )
{
SwLayoutFrm *pFly = FindFlyFrm();
if( pFly )
- GetDoc()->SetFlyName( *(SwFlyFrmFmt*)pFly->GetFmt(), rName );
+ GetDoc()->SetFlyName( *static_cast<SwFlyFrmFmt*>(pFly->GetFmt()), rName );
else {
OSL_ENSURE( false, "no FlyFrame selected" );
}
@@ -1444,7 +1444,7 @@ const uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const
SwFlyFrm * pFly = FindFlyFrm();
if (pFly && pFly->Lower() && pFly->Lower()->IsNoTxtFrm())
{
- SwOLENode *pNd = ((SwNoTxtFrm*)pFly->Lower())->GetNode()->GetOLENode();
+ SwOLENode *pNd = static_cast<SwNoTxtFrm*>(pFly->Lower())->GetNode()->GetOLENode();
if (pNd)
xObj = pNd->GetOLEObj().GetOleRef();
}
@@ -1474,7 +1474,7 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, OUString* pURL,
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV,SDRSEARCH_PICKMACRO ) &&
pObj->ISA(SwVirtFlyDrawObj) )
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
const SwFmtURL &rURL = pFly->GetFmt()->GetURL();
if( !rURL.GetURL().isEmpty() || rURL.GetMap() )
{
@@ -1541,10 +1541,10 @@ const Graphic *SwFEShell::GetGrfAtPos( const Point &rPt,
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV ) && pObj->ISA(SwVirtFlyDrawObj) )
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
- SwGrfNode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetGrfNode();
+ SwGrfNode *pNd = static_cast<SwCntntFrm*>(pFly->Lower())->GetNode()->GetGrfNode();
if ( pNd )
{
if ( pNd->IsGrfLink() )
@@ -1585,9 +1585,9 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj( const Point& rPt, SwRect** pRectToFill
{
// first check it:
if ( pObj->ISA(SwVirtFlyDrawObj) )
- pRet = ((SwVirtFlyDrawObj*)pObj)->GetFmt();
+ pRet = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFmt();
else if ( pObj->GetUserCall() ) //not for group objects
- pRet = ((SwDrawContact*)pObj->GetUserCall())->GetFmt();
+ pRet = static_cast<SwDrawContact*>(pObj->GetUserCall())->GetFmt();
if(pRet && pRectToFill)
**pRectToFill = pObj->GetCurrentBoundRect();
}
@@ -1607,7 +1607,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromAnyObj( const Point& rPt ) const
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
SwFrm* pFrm = pNd->getLayoutFrm( GetLayout(), &rPt, 0, false )->FindFlyFrm();
- pRet = pFrm ? ((SwLayoutFrm*)pFrm)->GetFmt() : 0;
+ pRet = pFrm ? static_cast<SwLayoutFrm*>(pFrm)->GetFmt() : 0;
}
return pRet;
}
@@ -1633,7 +1633,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
{
eType = OBJCNT_CONTROL;
uno::Reference< awt::XControlModel > xModel =
- ((SdrUnoObj&)(*pInvestigatedObj)).GetUnoControlModel();
+ static_cast<const SdrUnoObj&>(*pInvestigatedObj).GetUnoControlModel();
if( xModel.is() )
{
uno::Any aVal;
@@ -1652,10 +1652,10 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
}
else if( pInvestigatedObj->ISA(SwVirtFlyDrawObj) )
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj&)(*pInvestigatedObj)).GetFlyFrm();
+ const SwFlyFrm *pFly = static_cast<const SwVirtFlyDrawObj&>(*pInvestigatedObj).GetFlyFrm();
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
- if ( ((SwCntntFrm*)pFly->Lower())->GetNode()->GetGrfNode() )
+ if ( static_cast<const SwCntntFrm*>(pFly->Lower())->GetNode()->GetGrfNode() )
eType = OBJCNT_GRF;
else
eType = OBJCNT_OLE;
@@ -1878,7 +1878,7 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
aRestVec.clear();
/* number of page rFmt resides on */
- sal_uInt16 nPageNum = SwFmtGetPageNum((SwFlyFrmFmt *) &rFmt);
+ sal_uInt16 nPageNum = SwFmtGetPageNum(static_cast<SwFlyFrmFmt *>(&rFmt));
::std::vector< const SwFrmFmt * >::const_iterator aIt;
@@ -1891,7 +1891,7 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
if (aString != rReference && aString != rFmt.GetName())
{
sal_uInt16 nNum1 =
- SwFmtGetPageNum((SwFlyFrmFmt *) *aIt);
+ SwFmtGetPageNum(static_cast<const SwFlyFrmFmt *>(*aIt));
if (nNum1 == nPageNum -1)
aPrevPageVec.push_back(aString);
diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx
index e7f34c5..b58e4c7 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -46,7 +46,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
SwFlyFrm *pFly = FindFlyFrm();
if ( pFly && pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
- SwOLENode *pNd = ((SwNoTxtFrm*)pFly->Lower())->GetNode()->GetOLENode();
+ SwOLENode *pNd = static_cast<SwNoTxtFrm*>(pFly->Lower())->GetNode()->GetOLENode();
if ( !pNd || pNd->GetOLEObj().GetOleRef() != xObj )
pFly = 0;
}
@@ -65,10 +65,10 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
{
SwNode *pNd = GetNodes()[ nSttIdx+1 ];
if ( pNd->IsOLENode() &&
- ((SwOLENode*)pNd)->GetOLEObj().GetOleRef() == xObj )
+ static_cast<SwOLENode*>(pNd)->GetOLEObj().GetOleRef() == xObj )
{
bExist = true;
- SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() );
+ SwFrm *pFrm = static_cast<SwOLENode*>(pNd)->getLayoutFrm( GetLayout() );
if ( pFrm )
pFly = pFrm->FindFlyFrm();
break;
@@ -121,7 +121,7 @@ bool SwFEShell::FinishOLEObj() // Server is terminated
if( CNT_OLE == GetCntType() )
ClearAutomaticContour();
- if( ((SwOleClient*)pIPClient)->IsCheckForOLEInCaption() !=
+ if( static_cast<SwOleClient*>(pIPClient)->IsCheckForOLEInCaption() !=
IsCheckForOLEInCaption() )
SetCheckForOLEInCaption( !IsCheckForOLEInCaption() );
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 44e9910..edbceef 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -102,7 +102,7 @@ SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, SwViewShell *pSh )
{
SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
if ( pO && pO->ISA(SwVirtFlyDrawObj) )
- return ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
+ return static_cast<SwVirtFlyDrawObj*>(pO)->GetFlyFrm();
}
return 0;
}
@@ -178,7 +178,7 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
LockView( false );
}
if ( nType & CNT_GRF &&
- ((SwNoTxtFrm*)pOldSelFly->Lower())->HasAnimation() )
+ static_cast<SwNoTxtFrm*>(pOldSelFly->Lower())->HasAnimation() )
{
GetWin()->Invalidate( pOldSelFly->Frm().SVRect() );
}
@@ -246,8 +246,8 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
{
const SwFlyFrm *pTmp = GetFlyFromMarked( &rMrkList, this );
OSL_ENSURE( pTmp, "Graphic without Fly" );
- if ( ((SwNoTxtFrm*)pTmp->Lower())->HasAnimation() )
- ((SwNoTxtFrm*)pTmp->Lower())->StopAnimation( GetOut() );
+ if ( static_cast<const SwNoTxtFrm*>(pTmp->Lower())->HasAnimation() )
+ static_cast<const SwNoTxtFrm*>(pTmp->Lower())->StopAnimation( GetOut() );
}
}
else if ( !pOldSelFly && bHadSelection )
@@ -297,11 +297,11 @@ bool SwFEShell::MoveAnchor( SwMove nDir )
SdrObject *pObj = pMrkList->GetMark( 0 )->GetMarkedSdrObj();
if( pObj->ISA(SwVirtFlyDrawObj) )
{
- pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
pOld = pFly->AnchorFrm();
}
else
- pOld = ((SwDrawContact*)GetUserCall(pObj))->GetAnchorFrm( pObj );
+ pOld = static_cast<SwDrawContact*>(GetUserCall(pObj))->GetAnchorFrm( pObj );
bool bRet = false;
if( pOld )
{
@@ -342,7 +342,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir )
pNew = pOld->GetNext();
if( pNew && pNew != pOld )
{
- aAnch.SetPageNum( ((SwPageFrm*)pNew)->GetPhyPageNum() );
+ aAnch.SetPageNum( static_cast<SwPageFrm*>(pNew)->GetPhyPageNum() );
bRet = true;
}
break;
@@ -353,7 +353,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir )
if( SwMove::LEFT == nDir || SwMove::RIGHT == nDir )
{
SwPosition pos = *aAnch.GetCntntAnchor();
- SwTxtNode* pTxtNd = ((SwTxtFrm*)pOld)->GetTxtNode();
+ SwTxtNode* pTxtNd = static_cast<SwTxtFrm*>(pOld)->GetTxtNode();
const sal_Int32 nAct = pos.nContent.GetIndex();
if( SwMove::LEFT == nDir )
{
@@ -391,7 +391,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir )
if( pNew && pNew != pOld && pNew->IsCntntFrm() )
{
SwPosition pos = *aAnch.GetCntntAnchor();
- SwTxtNode* pTxtNd = ((SwTxtFrm*)pNew)->GetTxtNode();
+ SwTxtNode* pTxtNd = static_cast<SwTxtFrm*>(pNew)->GetTxtNode();
pos.nNode = *pTxtNd;
sal_Int32 nTmp = 0;
if( bRet )
@@ -641,7 +641,7 @@ long SwFEShell::EndDrag( const Point *, bool )
SwViewShell *pSh = this;
do {
pSh->StartAction();
- } while ( this != (pSh = (SwViewShell*)pSh->GetNext()) );
+ } while ( this != (pSh = static_cast<SwViewShell*>(pSh->GetNext())) );
StartUndo( UNDO_START );
@@ -665,8 +665,8 @@ long SwFEShell::EndDrag( const Point *, bool )
do {
pSh->EndAction();
if( pSh->IsA( TYPE( SwCrsrShell ) ) )
- ((SwCrsrShell*)pSh)->CallChgLnk();
- } while ( this != (pSh = (SwViewShell*)pSh->GetNext()) );
+ static_cast<SwCrsrShell*>(pSh)->CallChgLnk();
+ } while ( this != (pSh = static_cast<SwViewShell*>(pSh->GetNext())) );
GetDoc()->getIDocumentState().SetModified();
::FrameNotify( this, FLY_DRAG );
@@ -733,7 +733,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst )
SdrObject *pO = pLst->GetMark( j )->GetMarkedSdrObj();
if ( pO->ISA(SwVirtFlyDrawObj) )
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
+ SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pO)->GetFlyFrm();
const SwFmtHoriOrient &rHori = pFly->GetFmt()->GetHoriOrient();
aHori = rHori.GetHoriOrient();
@@ -750,7 +750,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst )
}
else
{
- SwFrm* pAnch = ( (SwDrawContact*)GetUserCall(pO) )->GetAnchorFrm( pO );
+ SwFrm* pAnch = static_cast<SwDrawContact*>( GetUserCall(pO) )->GetAnchorFrm( pO );
if( !pAnch )
continue;
pPage = pAnch->FindPageFrm();
@@ -892,7 +892,7 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
InvalidateWindows( SwRect( pObj->GetCurrentBoundRect() ) );
if ( pObj->ISA(SwVirtFlyDrawObj) )
{
- SwFmt *pFmt = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm()->GetFmt();
+ SwFmt *pFmt = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm()->GetFmt();
SvxOpaqueItem aOpa( pFmt->GetOpaque() );
aOpa.SetValue( nLayerId == pIDDMA->GetHellId() );
pFmt->SetFmtAttr( aOpa );
@@ -974,7 +974,7 @@ void SwFEShell::EndTextEdit()
SdrObjUserCall* pUserCall;
if( 0 != ( pUserCall = GetUserCall(pObj) ) )
{
- SdrObject *pTmp = ((SwContact*)pUserCall)->GetMaster();
+ SdrObject *pTmp = static_cast<SwContact*>(pUserCall)->GetMaster();
if( !pTmp )
pTmp = pObj;
pUserCall->Changed( *pTmp, SDRUSERCALL_RESIZE, pTmp->GetLastBoundRect() );
@@ -1153,7 +1153,7 @@ bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
SdrObject *pCandidate = pPage->GetObj(a);
if (pCandidate->ISA(SwVirtFlyDrawObj) &&
- ( (SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt) )
+ static_cast<SwVirtFlyDrawObj*>(pCandidate)->GetCurrentBoundRect().IsInside(rPt) )
{
bRet = false;
}
@@ -1179,7 +1179,7 @@ static bool lcl_IsControlGroup( const SdrObject *pObj )
else if( pObj->ISA( SdrObjGroup ) )
{
bRet = true;
- const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
+ const SdrObjList *pLst = static_cast<const SdrObjGroup*>(pObj)->GetSubList();
for ( size_t i = 0; i < pLst->GetObjCount(); ++i )
if( !::lcl_IsControlGroup( pLst->GetObj( i ) ) )
return false;
@@ -1244,7 +1244,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, sal_uInt16 /*GOTOOBJ_...*
{
const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
if( pStartObj->ISA(SwVirtFlyDrawObj) )
- aPos = ((SwVirtFlyDrawObj*)pStartObj)->GetFlyFrm()->Frm().Pos();
+ aPos = static_cast<const SwVirtFlyDrawObj*>(pStartObj)->GetFlyFrm()->Frm().Pos();
else
aPos = pStartObj->GetSnapRect().TopLeft();
@@ -1286,7 +1286,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, sal_uInt16 /*GOTOOBJ_...*
continue;
if( bFlyFrm )
{
- SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pObj;
+ SwVirtFlyDrawObj *pO = static_cast<SwVirtFlyDrawObj*>(pObj);
SwFlyFrm *pFly = pO->GetFlyFrm();
if( GOTOOBJ_FLY_ANY != ( GOTOOBJ_FLY_ANY & eType ) )
{
@@ -1299,13 +1299,13 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, sal_uInt16 /*GOTOOBJ_...*
case GOTOOBJ_FLY_GRF:
if ( pFly->Lower() &&
(pFly->Lower()->IsLayoutFrm() ||
- !((SwCntntFrm*)pFly->Lower())->GetNode()->GetGrfNode()))
+ !static_cast<SwCntntFrm*>(pFly->Lower())->GetNode()->GetGrfNode()))
continue;
break;
case GOTOOBJ_FLY_OLE:
if ( pFly->Lower() &&
(pFly->Lower()->IsLayoutFrm() ||
- !((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode()))
+ !static_cast<SwCntntFrm*>(pFly->Lower())->GetNode()->GetOLENode()))
continue;
break;
}
@@ -1331,7 +1331,7 @@ const SdrObject* SwFEShell::GetBestObject( bool bNext, sal_uInt16 /*GOTOOBJ_...*
continue;
if( bFlyFrm )
{
- SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pTmpObj;
+ SwVirtFlyDrawObj *pO = static_cast<SwVirtFlyDrawObj*>(pTmpObj);
aCurPos = pO->GetFlyFrm()->Frm().Pos();
}
else
@@ -1393,7 +1393,7 @@ bool SwFEShell::GotoObj( bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
bool bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
if( bFlyFrm )
{
- SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pBest;
+ const SwVirtFlyDrawObj *pO = static_cast<const SwVirtFlyDrawObj*>(pBest);
const SwRect& rFrm = pO->GetFlyFrm()->Frm();
SelectObj( rFrm.Pos(), 0, (SdrObject*)pBest );
if( !ActionPend() )
@@ -1622,7 +1622,7 @@ bool SwFEShell::ImpEndCreate()
// Always via FindAnchor, to assure the frame will be bound
// to the previous. With GetCrsOfst we can also reach the next. THIS IS WRONG.
pAnch = ::FindAnchor( pPage, aPt, bBodyOnly );
- aPos.nNode = *((SwCntntFrm*)pAnch)->GetNode();
+ aPos.nNode = *static_cast<const SwCntntFrm*>(pAnch)->GetNode();
// do not set in ReadnOnly-content
if( aPos.nNode.GetNode().IsProtect() )
@@ -1663,9 +1663,9 @@ bool SwFEShell::ImpEndCreate()
nXOffset = pAnch->Frm().Left()+pAnch->Frm().Width()-rBound.Right();
else
nXOffset = rBound.Left() - pAnch->Frm().Left();
- if( pAnch->IsTxtFrm() && ((SwTxtFrm*)pAnch)->IsFollow() )
+ if( pAnch->IsTxtFrm() && static_cast<const SwTxtFrm*>(pAnch)->IsFollow() )
{
- SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
+ const SwTxtFrm* pTmp = static_cast<const SwTxtFrm*>(pAnch);
do {
pTmp = pTmp->FindMaster();
OSL_ENSURE( pTmp, "Where's my Master?" );
@@ -1745,7 +1745,7 @@ bool SwFEShell::ImpEndCreate()
{
Point aRelNullPt;
if( OBJ_CAPTION == nIdent )
- aRelNullPt = ((SdrCaptionObj&)rSdrObj).GetTailPos();
+ aRelNullPt = static_cast<SdrCaptionObj&>(rSdrObj).GetTailPos();
else
aRelNullPt = rBound.TopLeft();
@@ -1755,9 +1755,9 @@ bool SwFEShell::ImpEndCreate()
SwFmtHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
aSet.Put( aHori );
// OD 2004-03-30 #i26791# - set vertical position
- if( pAnch->IsTxtFrm() && ((SwTxtFrm*)pAnch)->IsFollow() )
+ if( pAnch->IsTxtFrm() && static_cast<const SwTxtFrm*>(pAnch)->IsFollow() )
{
- SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
+ const SwTxtFrm* pTmp = static_cast<const SwTxtFrm*>(pAnch);
do {
pTmp = pTmp->FindMaster();
assert(pTmp && "Where's my Master?");
@@ -1767,7 +1767,7 @@ bool SwFEShell::ImpEndCreate()
}
SwFmtVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
aSet.Put( aVert );
- SwDrawFrmFmt* pFmt = (SwDrawFrmFmt*)getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
+ SwDrawFrmFmt* pFmt = static_cast<SwDrawFrmFmt*>(getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet ));
// #i36010# - set layout direction of the position
pFmt->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
@@ -1788,9 +1788,9 @@ bool SwFEShell::ImpEndCreate()
aVertical.SetVertOrient( text::VertOrientation::LINE_CENTER );
pFmt->SetFmtAttr( aVertical );
}
- if( pAnch->IsTxtFrm() && ((SwTxtFrm*)pAnch)->IsFollow() )
+ if( pAnch->IsTxtFrm() && static_cast<const SwTxtFrm*>(pAnch)->IsFollow() )
{
- SwTxtFrm* pTmp = (SwTxtFrm*)pAnch;
+ const SwTxtFrm* pTmp = static_cast<const SwTxtFrm*>(pAnch);
do {
pTmp = pTmp->FindMaster();
OSL_ENSURE( pTmp, "Where's my Master?" );
@@ -1949,7 +1949,7 @@ short SwFEShell::GetAnchorId() const
nRet = -1;
break;
}
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
short nId = static_cast<short>(pContact->GetFmt()->GetAnchor().GetAnchorId());
if ( nRet == SHRT_MAX )
nRet = nId;
@@ -2057,7 +2057,7 @@ bool SwFEShell::IsGroupSelected()
if ( pObj->IsGroupObject() &&
// --> #i38505# No ungroup allowed for 3d objects
!pObj->Is3DObj() &&
- FLY_AS_CHAR != ((SwDrawContact*)GetUserCall(pObj))->
+ FLY_AS_CHAR != static_cast<SwDrawContact*>(GetUserCall(pObj))->
GetFmt()->GetAnchor().GetAnchorId() )
{
return true;
@@ -2277,13 +2277,13 @@ sal_uInt8 SwFEShell::IsSelObjProtected( sal_uInt16 eType ) const
if( pObj->ISA(SwVirtFlyDrawObj) )
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
if ( (FLYPROTECT_CONTENT & eType) && pFly->GetFmt()->GetProtect().IsCntntProtected() )
nChk |= FLYPROTECT_CONTENT;
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
- SwOLENode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode();
+ SwOLENode *pNd = static_cast<SwCntntFrm*>(pFly->Lower())->GetNode()->GetOLENode();
uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->GetOLEObj().GetOleRef() : 0 );
if ( xObj.is() )
{
@@ -2310,10 +2310,10 @@ sal_uInt8 SwFEShell::IsSelObjProtected( sal_uInt16 eType ) const
}
const SwFrm* pAnch;
if( pObj->ISA(SwVirtFlyDrawObj) )
- pAnch = ( (SwVirtFlyDrawObj*)pObj )->GetFlyFrm()->GetAnchorFrm();
+ pAnch = static_cast<SwVirtFlyDrawObj*>( pObj )->GetFlyFrm()->GetAnchorFrm();
else
{
- SwDrawContact* pTmp = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact* pTmp = static_cast<SwDrawContact*>(GetUserCall(pObj));
pAnch = pTmp ? pTmp->GetAnchorFrm( pObj ) : NULL;
}
if( pAnch && pAnch->IsProtected() )
@@ -2332,7 +2332,7 @@ bool SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
// --> make code robust
OSL_ENSURE( pContact, "<SwFEShell::GetObjAttr(..)> - missing <pContact> - please inform OD." );
if ( pContact )
@@ -2362,7 +2362,7 @@ bool SwFEShell::SetObjAttr( const SfxItemSet& rSet )
for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
+ SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj));
GetDoc()->SetAttr( rSet, *pContact->GetFmt() );
}
@@ -2381,7 +2381,7 @@ bool SwFEShell::IsAlignPossible() const
if ( nCnt == 1 )
{
SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
- SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO);
+ SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pO));
OSL_ENSURE( pC, "No SwDrawContact!");
//only as character bound drawings can be aligned
bRet = pC && pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR;
@@ -2426,7 +2426,7 @@ void SwFEShell::CheckUnboundObjects()
SwFmtAnchor aAnch;
{
const SwFrm *pAnch = ::FindAnchor( pPage, aPt, true );
- SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
+ SwPosition aPos( *static_cast<const SwCntntFrm*>(pAnch)->GetNode() );
aAnch.SetType( FLY_AT_PARA );
aAnch.SetAnchor( &aPos );
((SwRect&)GetCharRect()).Pos() = aPt;
@@ -2442,7 +2442,7 @@ void SwFEShell::CheckUnboundObjects()
Point aRelNullPt;
if( OBJ_CAPTION == nIdent )
- aRelNullPt = ((SdrCaptionObj*)pObj)->GetTailPos();
+ aRelNullPt = static_cast<SdrCaptionObj*>(pObj)->GetTailPos();
else
aRelNullPt = rBound.TopLeft();
@@ -2451,7 +2451,7 @@ void SwFEShell::CheckUnboundObjects()
SwFrmFmt* pFmt = getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
SwDrawContact *pContact = new SwDrawContact(
- (SwDrawFrmFmt*)pFmt, pObj );
+ static_cast<SwDrawFrmFmt*>(pFmt), pObj );
// #i35635#
pContact->MoveObjToVisibleLayer( pObj );
@@ -2488,7 +2488,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) &&
pObj->ISA(SwVirtFlyDrawObj) )
{
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
rRect = pFly->Frm();
// Target and source should not be equal and the list
@@ -2520,7 +2520,7 @@ int SwFEShell::Chain( SwFrmFmt &rSource, const Point &rPt )
pDView->SetHitTolerancePixel( 0 );
pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE );
pDView->SetHitTolerancePixel( nOld );
- SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
+ SwFlyFrm *pFly = static_cast<SwVirtFlyDrawObj*>(pObj)->GetFlyFrm();
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)pFly->GetFmt();
GetDoc()->Chain(rSource, *pFmt);
@@ -2751,13 +2751,13 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
break;
}
- ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
+ static_cast<SdrPathObj*>(pObj)->SetPathPoly(aPoly);
}
else if(pObj->ISA(SdrCaptionObj))
{
bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
SID_DRAW_CAPTION_VERTICAL == nSlotId );
- ((SdrTextObj*)pObj)->SetVerticalWriting(bVerticalText);
+ static_cast<SdrTextObj*>(pObj)->SetVerticalWriting(bVerticalText);
if(bVerticalText)
{
SfxItemSet aSet(pObj->GetMergedItemSet());
@@ -2766,13 +2766,13 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
pObj->SetMergedItemSet(aSet);
}
- ((SdrCaptionObj*)pObj)->SetLogicRect(aRect);
- ((SdrCaptionObj*)pObj)->SetTailPos(
+ static_cast<SdrCaptionObj*>(pObj)->SetLogicRect(aRect);
+ static_cast<SdrCaptionObj*>(pObj)->SetTailPos(
aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2));
}
else if(pObj->ISA(SdrTextObj))
{
- SdrTextObj* pText = (SdrTextObj*)pObj;
+ SdrTextObj* pText = static_cast<SdrTextObj*>(pObj);
pText->SetLogicRect(aRect);
bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotId);
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 8648050..a12edc0 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -127,7 +127,7 @@ void SwFEShell::ParkCursorInTab()
if (*pMk > aEndPos)
aEndPos = *pMk;
- pTmpCrsr = (SwCursor *) pTmpCrsr->GetNext();
+ pTmpCrsr = static_cast<SwCursor *>( pTmpCrsr->GetNext() );
}
while (pTmpCrsr != pSwCrsr);
@@ -362,7 +362,7 @@ bool SwFEShell::DeleteRow(bool bCompleteTable)
// 2. the preceding row, if there is another row before this
// 3. otherwise below the table
{
- SwTableNode* pTblNd = ((SwCntntFrm*)pFrm)->GetNode()->FindTableNode();
+ SwTableNode* pTblNd = static_cast<SwCntntFrm*>(pFrm)->GetNode()->FindTableNode();
// search all boxes / lines
_FndBox aFndBox( 0, 0 );
@@ -565,7 +565,7 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
if ( pColumnCacheLastCellFrm != pBox )
{
pTab->GetTable()->GetTabCols( *pLastCols,
- ((SwCellFrm*)pBox)->GetTabBox(), true);
+ static_cast<const SwCellFrm*>(pBox)->GetTabBox(), true);
pColumnCacheLastCellFrm = pBox;
}
rToFill = *pLastCols;
@@ -578,7 +578,7 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
}
if ( !pLastCols )
{
- GetDoc()->GetTabCols( rToFill, 0, (SwCellFrm*)pBox );
+ GetDoc()->GetTabCols( rToFill, 0, static_cast<const SwCellFrm*>(pBox) );
pLastCols = new SwTabCols( rToFill );
pColumnCacheLastTable = pTab->GetTable();
@@ -634,7 +634,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
}
if ( !pLastRows )
{
- GetDoc()->GetTabRows( rToFill, 0, (SwCellFrm*)pBox );
+ GetDoc()->GetTabRows( rToFill, 0, static_cast<const SwCellFrm*>(pBox) );
pLastRows = new SwTabCols( rToFill );
pRowCacheLastTable = pTab->GetTable();
@@ -656,7 +656,7 @@ void SwFEShell::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly )
pBox = pBox->GetUpper();
} while ( !pBox->IsCellFrm() );
- GetDoc()->SetTabCols( rNew, bCurRowOnly, 0, (SwCellFrm*)pBox );
+ GetDoc()->SetTabCols( rNew, bCurRowOnly, 0, static_cast<SwCellFrm*>(pBox) );
EndAllActionAndCall();
}
@@ -697,7 +697,7 @@ void SwFEShell::SetTabRows( const SwTabCols &rNew, bool bCurColOnly )
pBox = pBox->GetUpper();
} while ( !pBox->IsCellFrm() );
- GetDoc()->SetTabRows( rNew, bCurColOnly, 0, (SwCellFrm*)pBox );
+ GetDoc()->SetTabRows( rNew, bCurColOnly, 0, static_cast<SwCellFrm*>(pBox) );
EndAllActionAndCall();
}
@@ -715,7 +715,7 @@ void SwFEShell::SetMouseTabRows( const SwTabCols &rNew, bool bCurColOnly, const
{
SET_CURR_SHELL( this );
StartAllAction();
- GetDoc()->SetTabRows( rNew, bCurColOnly, 0, (SwCellFrm*)pBox );
+ GetDoc()->SetTabRows( rNew, bCurColOnly, 0, static_cast<const SwCellFrm*>(pBox) );
EndAllActionAndCall();
}
}
@@ -947,7 +947,7 @@ void SwFEShell::UnProtectCells()
} while ( pFrm && !pFrm->IsCellFrm() );
if( pFrm )
{
- SwTableBox *pBox = (SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox();
+ SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox()));
aBoxes.insert( pBox );
}
}
@@ -990,7 +990,7 @@ bool SwFEShell::CanUnProtectCells() const
} while ( pFrm && !pFrm->IsCellFrm() );
if( pFrm )
{
- SwTableBox *pBox = (SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox();
+ SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox()));
aBoxes.insert( pBox );
}
}
@@ -1042,7 +1042,7 @@ static sal_uInt16 lcl_GetRowNumber( const SwPosition& rPos )
while ( !pRow->GetUpper()->IsTabFrm() )
pRow = pRow->GetUpper();
- const SwTabFrm* pTabFrm = (const SwTabFrm*)pRow->GetUpper();
+ const SwTabFrm* pTabFrm = static_cast<const SwTabFrm*>(pRow->GetUpper());
const SwTableLine* pTabLine = static_cast<const SwRowFrm*>(pRow)->GetTabLine();
sal_uInt16 nI = 0;
@@ -1108,7 +1108,7 @@ bool SwFEShell::CheckHeadline( bool bRepeat ) const
}
else
{
- bRet = ((SwLayoutFrm*)pTab->Lower())->IsAnLower( pFrm ) ||
+ bRet = static_cast<SwLayoutFrm*>(pTab->Lower())->IsAnLower( pFrm ) ||
pTab->IsInHeadline( *pFrm );
}
}
@@ -1149,7 +1149,7 @@ bool SwFEShell::IsAdjustCellWidthAllowed( bool bBalance ) const
do
{ pFrm = pFrm->GetUpper();
} while ( !pFrm->IsCellFrm() );
- SwTableBox *pBox = (SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox();
+ SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox()));
aBoxes.insert( pBox );
}
@@ -1161,7 +1161,7 @@ bool SwFEShell::IsAdjustCellWidthAllowed( bool bBalance ) const
SwNodeIndex aIdx( *pBox->GetSttNd(), 1 );
SwTxtNode* pCNd = aIdx.GetNode().GetTxtNode();
if( !pCNd )
- pCNd = (SwTxtNode*)GetDoc()->GetNodes().GoNext( &aIdx );
+ pCNd = static_cast<SwTxtNode*>(GetDoc()->GetNodes().GoNext( &aIdx ));
while ( pCNd )
{
@@ -1272,7 +1272,7 @@ bool SwFEShell::DeleteTblSel()
// position they'll be set to the old position
while( !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
- ParkCrsr( SwNodeIndex( *((SwCellFrm*)pFrm)->GetTabBox()->GetSttNd() ));
+ ParkCrsr( SwNodeIndex( *static_cast<SwCellFrm*>(pFrm)->GetTabBox()->GetSttNd() ));
bRet = GetDoc()->DeleteRowCol( aBoxes );
@@ -1356,7 +1356,7 @@ static const SwFrm *lcl_FindFrmInTab( const SwLayoutFrm *pLay, const Point &rPt,
{
if ( pFrm->IsLayoutFrm() )
{
- const SwFrm *pTmp = ::lcl_FindFrmInTab( (SwLayoutFrm*)pFrm, rPt, nFuzzy );
+ const SwFrm *pTmp = ::lcl_FindFrmInTab( static_cast<const SwLayoutFrm*>(pFrm), rPt, nFuzzy );
if ( pTmp )
return pTmp;
}
@@ -1461,7 +1461,7 @@ static const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
}
const SwFrm* pTmp = bSearchForFrmInTab ?
- ::lcl_FindFrmInTab( (SwLayoutFrm*)pFrm, aPt, nTmpFuzzy ) :
+ ::lcl_FindFrmInTab( static_cast<const SwLayoutFrm*>(pFrm), aPt, nTmpFuzzy ) :
0;
if ( pTmp )
@@ -1563,7 +1563,7 @@ static const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
const SwFrm* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) const
{
- const SwPageFrm *pPage = (SwPageFrm*)GetLayout()->Lower();
+ const SwPageFrm *pPage = static_cast<SwPageFrm*>(GetLayout()->Lower());
vcl::Window* pOutWin = GetWin();
SwTwips nFuzzy = COLFUZZY;
if( pOutWin )
@@ -1576,7 +1576,7 @@ const SwFrm* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) con
}
while ( pPage && !pPage->Frm().IsNear( rPt, nFuzzy ) )
- pPage = (SwPageFrm*)pPage->GetNext();
+ pPage = static_cast<const SwPageFrm*>(pPage->GetNext());
const SwCellFrm *pFrm = 0;
if ( pPage )
@@ -1599,11 +1599,11 @@ const SwFrm* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) con
}
}
}
- const SwLayoutFrm *pLay = (SwLayoutFrm*)pPage->Lower();
+ const SwLayoutFrm *pLay = static_cast<const SwLayoutFrm*>(pPage->Lower());
while ( pLay && !pFrm )
{
pFrm = lcl_FindFrm( pLay, rPt, nFuzzy, pbRow, pbCol );
- pLay = (SwLayoutFrm*)pLay->GetNext();
+ pLay = static_cast<const SwLayoutFrm*>(pLay->GetNext());
}
}
return pFrm;
@@ -1860,19 +1860,19 @@ SwTab SwFEShell::WhichMouseTabCol( const Point &rPt ) const
bool bSelect = false;
// First try: Do we get the row/col move cursor?
- SwCellFrm* pFrm = (SwCellFrm*)GetBox( rPt, &bRow, 0 );
+ const SwCellFrm* pFrm = static_cast<const SwCellFrm*>(GetBox( rPt, &bRow, 0 ));
if ( !pFrm )
{
// Second try: Do we get the row/col/tab selection cursor?
- pFrm = (SwCellFrm*)GetBox( rPt, &bRow, &bCol );
+ pFrm = static_cast<const SwCellFrm*>(GetBox( rPt, &bRow, &bCol ));
bSelect = true;
}
if( pFrm )
{
while( pFrm && pFrm->Lower() && pFrm->Lower()->IsRowFrm() )
- pFrm = (SwCellFrm*)((SwLayoutFrm*)pFrm->Lower())->Lower();
+ pFrm = static_cast<const SwCellFrm*>(static_cast<const SwLayoutFrm*>(pFrm->Lower())->Lower());
if( pFrm && pFrm->GetTabBox()->GetSttNd() &&
pFrm->GetTabBox()->GetSttNd()->IsInProtectSect() )
pFrm = 0;
@@ -2005,7 +2005,7 @@ void SwFEShell::SetMouseTabCols( const SwTabCols &rNew, bool bCurRowOnly,
{
SET_CURR_SHELL( this );
StartAllAction();
- GetDoc()->SetTabCols( rNew, bCurRowOnly, 0, (SwCellFrm*)pBox );
+ GetDoc()->SetTabCols( rNew, bCurRowOnly, 0, static_cast<const SwCellFrm*>(pBox) );
EndAllActionAndCall();
}
}
@@ -2173,7 +2173,7 @@ bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff )
/** The cells are destroyed in here */
bool bRet = GetDoc()->SetColRowWidthHeight(
- *(SwTableBox*)((SwCellFrm*)pFrm)->GetTabBox(),
+ *const_cast<SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox()),
eType, nDiff, nLogDiff );
delete pLastCols, pLastCols = 0;
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 8928367..3274757 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -59,12 +59,12 @@ void SwFEShell::EndAllActionAndCall()
do {
if( pTmp->IsA( TYPE(SwCrsrShell) ) )
{
- ((SwFEShell*)pTmp)->EndAction();
- ((SwFEShell*)pTmp)->CallChgLnk();
+ static_cast<SwFEShell*>(pTmp)->EndAction();
+ static_cast<SwFEShell*>(pTmp)->CallChgLnk();
}
else
pTmp->EndAction();
- } while( this != ( pTmp = (SwViewShell*)pTmp->GetNext() ));
+ } while( this != ( pTmp = static_cast<SwViewShell*>(pTmp->GetNext()) ));
}
// Determine the Cntnt's nearest to the point
@@ -162,7 +162,7 @@ sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const
while ( pPage && !pPage->Frm().IsInside( rPoint ) )
pPage = pPage->GetNext();
if ( pPage )
- return ((const SwPageFrm*)pPage)->GetPhyPageNum();
+ return static_cast<const SwPageFrm*>(pPage)->GetPhyPageNum();
else
return 0;
}
@@ -187,15 +187,15 @@ bool SwFEShell::GetPageNumber( long nYPos, bool bAtCrsrPos, sal_uInt16& rPhyNum,
else // first visible page
{
pPage = Imp()->GetFirstVisPage();
- if ( pPage && ((SwPageFrm*)pPage)->IsEmptyPage() )
+ if ( pPage && static_cast<const SwPageFrm*>(pPage)->IsEmptyPage() )
pPage = pPage->GetNext();
}
if( pPage )
{
- rPhyNum = ((const SwPageFrm*)pPage)->GetPhyPageNum();
- rVirtNum = ((const SwPageFrm*)pPage)->GetVirtPageNum();
- const SvxNumberType& rNum = ((const SwPageFrm*)pPage)->GetPageDesc()->GetNumType();
+ rPhyNum = static_cast<const SwPageFrm*>(pPage)->GetPhyPageNum();
+ rVirtNum = static_cast<const SwPageFrm*>(pPage)->GetVirtPageNum();
+ const SvxNumberType& rNum = static_cast<const SwPageFrm*>(pPage)->GetPageDesc()->GetNumType();
rDisplay = rNum.GetNumStr( rVirtNum );
}
@@ -239,7 +239,7 @@ sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, bool bStopAtFly ) const
nReturn |= FRMTYPE_COLUMN;
break;
case FRM_PAGE: nReturn |= FRMTYPE_PAGE;
- if( ((SwPageFrm*)pFrm)->IsFtnPage() )
+ if( static_cast<const SwPageFrm*>(pFrm)->IsFtnPage() )
nReturn |= FRMTYPE_FTNPAGE;
break;
case FRM_HEADER: nReturn |= FRMTYPE_HEADER; break;
@@ -248,13 +248,13 @@ sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, bool bStopAtFly ) const
nReturn |= FRMTYPE_BODY;
break;
case FRM_FTN: nReturn |= FRMTYPE_FOOTNOTE; break;
- case FRM_FLY: if( ((SwFlyFrm*)pFrm)->IsFlyLayFrm() )
+ case FRM_FLY: if( static_cast<const SwFlyFrm*>(pFrm)->IsFlyLayFrm() )
nReturn |= FRMTYPE_FLY_FREE;
- else if ( ((SwFlyFrm*)pFrm)->IsFlyAtCntFrm() )
+ else if ( static_cast<const SwFlyFrm*>(pFrm)->IsFlyAtCntFrm() )
nReturn |= FRMTYPE_FLY_ATCNT;
else
{
- OSL_ENSURE( ((SwFlyFrm*)pFrm)->IsFlyInCntFrm(),
+ OSL_ENSURE( static_cast<const SwFlyFrm*>(pFrm)->IsFlyInCntFrm(),
"New frametype?" );
nReturn |= FRMTYPE_FLY_INCNT;
}
@@ -268,7 +268,7 @@ sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, bool bStopAtFly ) const
default: /* do nothing */ break;
}
if ( pFrm->IsFlyFrm() )
- pFrm = ((SwFlyFrm*)pFrm)->GetAnchorFrm();
+ pFrm = static_cast<const SwFlyFrm*>(pFrm)->GetAnchorFrm();
else
pFrm = pFrm->GetUpper();
}
@@ -361,7 +361,7 @@ void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
break;
}
}
- pPage = (SwPageFrm*)pPage->GetPrev();
+ pPage = static_cast<const SwPageFrm*>(pPage->GetPrev());
}
}
@@ -379,7 +379,7 @@ sal_uInt16 SwFEShell::GetPageOffset() const
if ( oNumOffset )
return oNumOffset.get();
}
- pPage = (SwPageFrm*)pPage->GetPrev();
+ pPage = static_cast<const SwPageFrm*>(pPage->GetPrev());
}
return 0;
}
@@ -565,7 +565,7 @@ sal_uInt16 SwFEShell::_GetCurColNum( const SwFrm *pFrm,
{
if( ( FRM_PAGE | FRM_FLY | FRM_SECTION ) & pFrm->GetType() )
{
- pPara->pFrmFmt = ((SwLayoutFrm*)pFrm)->GetFmt();
+ pPara->pFrmFmt = static_cast<const SwLayoutFrm*>(pFrm)->GetFmt();
pPara->pPrtRect = &pFrm->Prt();
pPara->pFrmRect = &pFrm->Frm();
break;
@@ -1002,7 +1002,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
else
{
if( _opRef && pFly && pFly->IsFlyInCntFrm() )
- *_opRef = ( (SwFlyInCntFrm*)pFly )->GetRefPoint();
+ *_opRef = static_cast<const SwFlyInCntFrm*>( pFly )->GetRefPoint();
_orRect = pUpper->Frm();
if( !pUpper->IsBodyFrm() )
@@ -1026,7 +1026,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
const SwTwips nBaseOfstForFly = ( pFrm->IsTxtFrm() && pFly ) ?
- ((SwTxtFrm*)pFrm)->GetBaseOfstForFly( !bWrapThrough ) :
+ static_cast<const SwTxtFrm*>(pFrm)->GetBaseOfstForFly( !bWrapThrough ) :
0;
if( bVert || bVertL2R )
{
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 220955d..0ed2af2 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -285,7 +285,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
// Skip any repeated headlines in the follow:
const SwLayoutFrm* pRow = pTable->IsFollow() ?
pTable->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTable->Lower();
+ static_cast<const SwLayoutFrm*>(pTable->Lower());
while( pRow && bTblIsValid )
{
@@ -311,7 +311,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
SwTableBox* pBox = (SwTableBox*)
- ((SwCellFrm*)pCell)->GetTabBox();
+ static_cast<const SwCellFrm*>(pCell)->GetTabBox();
// check for cell protection??
if( !bChkProtected ||
!pBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
@@ -360,7 +360,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
}
if ( pCell->GetNext() )
{
- pCell = (const SwLayoutFrm*)pCell->GetNext();
+ pCell = static_cast<const SwLayoutFrm*>(pCell->GetNext());
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
}
@@ -368,7 +368,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
pCell = ::lcl_FindNextCellFrm( pCell );
}
}
- pRow = (const SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
}
}
@@ -488,7 +488,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
// Skip any repeated headlines in the follow:
const SwLayoutFrm* pRow = pTable->IsFollow() ?
pTable->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTable->Lower();
+ static_cast<const SwLayoutFrm*>(pTable->Lower());
while( pRow && bTblIsValid && bValidChartSel )
{
@@ -544,7 +544,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
nFrmBottom <= nUnionBottom+ nYFuzzy )
aCellFrms.push_back(
- _Sort_CellFrm( *(SwCellFrm*)pCell) );
+ _Sort_CellFrm( *static_cast<const SwCellFrm*>(pCell)) );
else
{
bValidChartSel = false;
@@ -553,7 +553,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
}
if ( pCell->GetNext() )
{
- pCell = (const SwLayoutFrm*)pCell->GetNext();
+ pCell = static_cast<const SwLayoutFrm*>(pCell->GetNext());
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
}
@@ -561,7 +561,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
pCell = ::lcl_FindNextCellFrm( pCell );
}
}
- pRow = (const SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
}
if( !bValidChartSel )
@@ -702,7 +702,7 @@ bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
// Skip any repeated headlines in the follow:
const SwLayoutFrm* pRow = pTable->IsFollow() ?
pTable->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTable->Lower();
+ static_cast<const SwLayoutFrm*>(pTable->Lower());
while( pRow )
{
@@ -730,11 +730,11 @@ bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
OSL_ENSURE( pCell->IsCellFrm(), "Frame without cell" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
- pUpperCell = (SwCellFrm*)pCell;
+ pUpperCell = static_cast<const SwCellFrm*>(pCell);
if( pCell->GetNext() )
{
- pCell = (const SwLayoutFrm*)pCell->GetNext();
+ pCell = static_cast<const SwLayoutFrm*>(pCell->GetNext());
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
}
@@ -750,7 +750,7 @@ bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
i = aUnions.size();
break;
}
- pRow = (const SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
}
}
@@ -771,7 +771,7 @@ bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
// Skip any repeated headlines in the follow:
const SwLayoutFrm* pRow = pTable->IsFollow() ?
pTable->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTable->Lower();
+ static_cast<const SwLayoutFrm*>(pTable->Lower());
while( pRow )
{
@@ -799,12 +799,12 @@ bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
OSL_ENSURE( pCell->IsCellFrm(), "Frame without cell" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{
- SwCellFrm* pC = (SwCellFrm*)pCell;
+ SwCellFrm* pC = const_cast<SwCellFrm*>(static_cast<const SwCellFrm*>(pCell));
rBoxes.push_back( pC );
}
if( pCell->GetNext() )
{
- pCell = (const SwLayoutFrm*)pCell->GetNext();
+ pCell = static_cast<const SwLayoutFrm*>(pCell->GetNext());
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
}
@@ -818,7 +818,7 @@ bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
break;
}
- pRow = (const SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
}
}
}
@@ -852,13 +852,13 @@ static void lcl_InsTblBox( SwTableNode* pTblNd, SwDoc* pDoc, SwTableBox* pBox,
->GetCntntNode();
if( pCNd && pCNd->IsTxtNode() )
pDoc->GetNodes().InsBoxen( pTblNd, pBox->GetUpper(),
- (SwTableBoxFmt*)pBox->GetFrmFmt(),
- ((SwTxtNode*)pCNd)->GetTxtColl(),
+ static_cast<SwTableBoxFmt*>(pBox->GetFrmFmt()),
+ static_cast<SwTxtNode*>(pCNd)->GetTxtColl(),
pCNd->GetpSwAttrSet(),
nInsPos, nCnt );
else
pDoc->GetNodes().InsBoxen( pTblNd, pBox->GetUpper(),
- (SwTableBoxFmt*)pBox->GetFrmFmt(),
+ static_cast<SwTableBoxFmt*>(pBox->GetFrmFmt()),
(SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl(), 0,
nInsPos, nCnt );
}
@@ -945,7 +945,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// Skip any repeated headlines in the follow:
const SwLayoutFrm* pRow = pTabFrm->IsFollow() ?
pTabFrm->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTabFrm->Lower();
+ static_cast<const SwLayoutFrm*>(pTabFrm->Lower());
while ( pRow )
{
@@ -960,7 +960,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( rUnion.Top() <= pCell->Frm().Top() &&
rUnion.Bottom() >= pCell->Frm().Bottom() )
{
- SwTableBox* pBox =(SwTableBox*)((SwCellFrm*)pCell)->GetTabBox();
+ SwTableBox* pBox = const_cast<SwTableBox*>(static_cast<const SwCellFrm*>(pCell)->GetTabBox());
// only overlap to the right?
if( ( rUnion.Left() - COLFUZZY ) <= pCell->Frm().Left() &&
@@ -1031,7 +1031,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if( SfxItemState::SET == pBox->GetFrmFmt()->GetAttrSet()
.GetItemState( RES_BOX, false, &pItem ))
{
- SvxBoxItem aBox( *(SvxBoxItem*)pItem );
+ SvxBoxItem aBox( *static_cast<const SvxBoxItem*>(pItem) );
aBox.SetLine( 0, BOX_LINE_RIGHT );
pBox->GetFrmFmt()->SetFmtAttr( aBox );
}
@@ -1099,7 +1099,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
}
if ( pCell->GetNext() )
{
- pCell = (const SwLayoutFrm*)pCell->GetNext();
+ pCell = static_cast<const SwLayoutFrm*>(pCell->GetNext());
// --> Check if table cell is not empty
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
@@ -1108,7 +1108,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
pCell = ::lcl_FindNextCellFrm( pCell );
}
}
- pRow = (const SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
}
}
@@ -1506,7 +1506,7 @@ static SwTwips lcl_CalcWish( const SwLayoutFrm *pCell, long nWish,
{
while ( pTmp->GetPrev() )
{
- pTmp = (SwLayoutFrm*)pTmp->GetPrev();
+ pTmp = static_cast<const SwLayoutFrm*>(pTmp->GetPrev());
long nTmp = pTmp->GetFmt()->GetFrmSize().GetWidth();
nRet += ( bRTL ? ( -1 ) : 1 ) * nTmp * nAct / nWish;
}
@@ -1523,9 +1523,9 @@ static void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
{
// Put Start at beginning of a row.
// Put End at the end of its row.
- rpStart = (SwLayoutFrm*)rpStart->GetUpper()->Lower();
+ rpStart = static_cast<const SwLayoutFrm*>(rpStart->GetUpper()->Lower());
while ( rpEnd->GetNext() )
- rpEnd = (SwLayoutFrm*)rpEnd->GetNext();
+ rpEnd = static_cast<const SwLayoutFrm*>(rpEnd->GetNext());
std::deque<const SwLayoutFrm *> aSttArr, aEndArr;
const SwLayoutFrm *pTmp;
@@ -1558,18 +1558,18 @@ static void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
rpEnd = aEndArr[ n+1 ];
if( n )
{
- const SwCellFrm* pCellFrm = (SwCellFrm*)aSttArr[ n-1 ];
+ const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>(aSttArr[ n-1 ]);
const SwTableLines& rLns = pCellFrm->
GetTabBox()->GetTabLines();
- if( rLns[ 0 ] == ((SwRowFrm*)aSttArr[ n ])->GetTabLine() &&
+ if( rLns[ 0 ] == static_cast<const SwRowFrm*>(aSttArr[ n ])->GetTabLine() &&
rLns[ rLns.size() - 1 ] ==
- ((SwRowFrm*)aEndArr[ n ])->GetTabLine() )
+ static_cast<const SwRowFrm*>(aEndArr[ n ])->GetTabLine() )
{
rpStart = rpEnd = pCellFrm;
while ( rpStart->GetPrev() )
- rpStart = (SwLayoutFrm*)rpStart->GetPrev();
+ rpStart = static_cast<const SwLayoutFrm*>(rpStart->GetPrev());
while ( rpEnd->GetNext() )
- rpEnd = (SwLayoutFrm*)rpEnd->GetNext();
+ rpEnd = static_cast<const SwLayoutFrm*>(rpEnd->GetNext());
}
}
}
@@ -1581,9 +1581,9 @@ static void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
// Beginning and end should not be in protected cells
while ( rpStart->GetFmt()->GetProtect().IsCntntProtected() )
- rpStart = (SwLayoutFrm*)rpStart->GetNext();
+ rpStart = static_cast<const SwLayoutFrm*>(rpStart->GetNext());
while ( rpEnd->GetFmt()->GetProtect().IsCntntProtected() )
- rpEnd = (SwLayoutFrm*)rpEnd->GetPrev();
+ rpEnd = static_cast<const SwLayoutFrm*>(rpEnd->GetPrev());
}
static void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
@@ -1608,7 +1608,7 @@ static void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
{
const SwFrm *pTmp = pTab->FindPrev();
OSL_ENSURE( pTmp->IsTabFrm(), "Predecessor of Follow is not Master." );
- pTab = (const SwTabFrm*)pTmp;
+ pTab = static_cast<const SwTabFrm*>(pTmp);
}
SwTwips nSX = 0;
@@ -1729,7 +1729,7 @@ static void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
const SwTabFrm *pTmpTab = rpEnd->FindTabFrm();
if ( !pTmpLeaf || !pTmpTab->IsAnLower( pTmpLeaf ) )
{
- pTmpTab = (const SwTabFrm*)pTmpTab->FindPrev();
+ pTmpTab = static_cast<const SwTabFrm*>(pTmpTab->FindPrev());
OSL_ENSURE( pTmpTab->IsTabFrm(), "Predecessor of Follow not Master.");
rpEnd = pTmpTab->FindLastCntnt()->GetUpper();
while( !rpEnd->IsCellFrm() )
@@ -1868,10 +1868,10 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
// within the union and use their values for a new union
const SwLayoutFrm* pRow = pTable->IsFollow() ?
pTable->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTable->Lower();
+ static_cast<const SwLayoutFrm*>(pTable->Lower());
while ( pRow && !pRow->Frm().IsOver( aUnion ) )
- pRow = (SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
// #i31976#
// A follow flow row may contain emtpy cells. These are not
@@ -1899,7 +1899,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
{
if ( pFirst->GetNext() )
{
- pFirst = (const SwLayoutFrm*)pFirst->GetNext();
+ pFirst = static_cast<const SwLayoutFrm*>(pFirst->GetNext());
if ( pFirst->Lower() && pFirst->Lower()->IsRowFrm() )
pFirst = pFirst->FirstCell();
}
@@ -1984,7 +1984,7 @@ bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
// Skip any repeated headlines in the follow:
const SwLayoutFrm* pRow = pTable->IsFollow() ?
pTable->GetFirstNonHeadlineRow() :
- (const SwLayoutFrm*)pTable->Lower();
+ static_cast<const SwLayoutFrm*>(pTable->Lower());
while ( pRow )
{
@@ -2003,7 +2003,7 @@ bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
if ( pCell->GetNext() )
{
- pCell = (const SwLayoutFrm*)pCell->GetNext();
+ pCell = static_cast<const SwLayoutFrm*>(pCell->GetNext());
if ( pCell->Lower() && pCell->Lower()->IsRowFrm() )
pCell = pCell->FirstCell();
}
@@ -2011,7 +2011,7 @@ bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
pCell = ::lcl_FindNextCellFrm( pCell );
}
}
- pRow = (const SwLayoutFrm*)pRow->GetNext();
+ pRow = static_cast<const SwLayoutFrm*>(pRow->GetNext());
}
}
return true;
@@ -2024,9 +2024,9 @@ bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
static void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling )
{
SwRowFrm *pRow = new SwRowFrm( rLine, pUpper );
- if ( pUpper->IsTabFrm() && ((SwTabFrm*)pUpper)->IsFollow() )
+ if ( pUpper->IsTabFrm() && static_cast<SwTabFrm*>(pUpper)->IsFollow() )
{
- SwTabFrm* pTabFrm = (SwTabFrm*)pUpper;
+ SwTabFrm* pTabFrm = static_cast<SwTabFrm*>(pUpper);
pTabFrm->FindMaster()->InvalidatePos(); //can absorb the line
if ( pSibling && pTabFrm->IsInHeadline( *pSibling ) )
@@ -2188,21 +2188,21 @@ void _FndBox::DelFrms( SwTable &rTable, bool bAccTableDispose )
{
bool bDel = true;
SwTabFrm *pUp = !pFrm->GetPrev() && !pFrm->GetNext() ?
- (SwTabFrm*)pFrm->GetUpper() : 0;
+ static_cast<SwTabFrm*>(pFrm->GetUpper()) : 0;
if ( !pUp )
{
const sal_uInt16 nRepeat =
- ((SwTabFrm*)pFrm->GetUpper())->GetTable()->GetRowsToRepeat();
+ static_cast<SwTabFrm*>(pFrm->GetUpper())->GetTable()->GetRowsToRepeat();
if ( nRepeat > 0 &&
- ((SwTabFrm*)pFrm->GetUpper())->IsFollow() )
+ static_cast<SwTabFrm*>(pFrm->GetUpper())->IsFollow() )
{
if ( !pFrm->GetNext() )
{
SwRowFrm* pFirstNonHeadline =
- ((SwTabFrm*)pFrm->GetUpper())->GetFirstNonHeadlineRow();
+ static_cast<SwTabFrm*>(pFrm->GetUpper())->GetFirstNonHeadlineRow();
if ( pFirstNonHeadline == pFrm )
{
- pUp = (SwTabFrm*)pFrm->GetUpper();
+ pUp = static_cast<SwTabFrm*>(pFrm->GetUpper());
}
}
}
@@ -2216,7 +2216,7 @@ void _FndBox::DelFrms( SwTable &rTable, bool bAccTableDispose )
SwFrm *pTmp = pPrev->FindPrev();
OSL_ENSURE( pTmp->IsTabFrm(),
"Predecessor of Follow is no Master.");
- pPrev = (SwTabFrm*)pTmp;
+ pPrev = static_cast<SwTabFrm*>(pTmp);
}
if ( pPrev )
{
@@ -2258,12 +2258,12 @@ void _FndBox::DelFrms( SwTable &rTable, bool bAccTableDispose )
SwFrm* pTabFrm = pFrm->GetUpper();
if ( pTabFrm->IsTabFrm() &&
!pFrm->GetNext() &&
- ((SwTabFrm*)pTabFrm)->GetFollow() )
+ static_cast<SwTabFrm*>(pTabFrm)->GetFollow() )
{
// We do not delete the follow flow line,
// this will be done automatically in the
// next turn.
- ((SwTabFrm*)pTabFrm)->SetFollowFlowLine( false );
+ static_cast<SwTabFrm*>(pTabFrm)->SetFollowFlowLine( false );
}
//Set acc table dispose state
pFrm->SetAccTableDispose( bAccTableDispose );
@@ -2291,14 +2291,14 @@ static void lcl_UpdateRepeatedHeadlines( SwTabFrm& rTabFrm, bool bCalcLowers )
// Delete remaining headlines:
SwRowFrm* pLower = 0;
- while ( 0 != ( pLower = (SwRowFrm*)rTabFrm.Lower() ) && pLower->IsRepeatedHeadline() )
+ while ( 0 != ( pLower = static_cast<SwRowFrm*>(rTabFrm.Lower()) ) && pLower->IsRepeatedHeadline() )
{
pLower->Cut();
delete pLower;
}
// Insert fresh set of headlines:
- pLower = (SwRowFrm*)rTabFrm.Lower();
+ pLower = static_cast<SwRowFrm*>(rTabFrm.Lower());
SwTable& rTable = *rTabFrm.GetTable();
const sal_uInt16 nRepeat = rTable.GetRowsToRepeat();
for ( sal_uInt16 nIdx = 0; nIdx < nRepeat; ++nIdx )
@@ -2374,9 +2374,9 @@ void _FndBox::MakeFrms( SwTable &rTable )
for ( i = nStPos; (sal_uInt16)i <= nEndPos; ++i )
::lcl_InsertRow( *rTable.GetTabLines()[static_cast<sal_uInt16>(i)],
- (SwLayoutFrm*)pUpperFrm, pSibling );
+ static_cast<SwLayoutFrm*>(pUpperFrm), pSibling );
if ( pUpperFrm->IsTabFrm() )
- ((SwTabFrm*)pUpperFrm)->SetCalcLowers();
+ static_cast<SwTabFrm*>(pUpperFrm)->SetCalcLowers();
}
else if ( rTable.GetRowsToRepeat() > 0 )
{
@@ -2450,7 +2450,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
for ( ; i < nMax; ++i )
::lcl_InsertRow( *rTable.GetTabLines()[i], pUpperFrm, pSibling );
if ( pUpperFrm->IsTabFrm() )
- ((SwTabFrm*)pUpperFrm)->SetCalcLowers();
+ static_cast<SwTabFrm*>(pUpperFrm)->SetCalcLowers();
}
else // insert before
{
@@ -2487,7 +2487,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
pUpperFrm = pSibling->GetUpper();
if ( pLineBefore )
- pSibling = (SwRowFrm*) pSibling->GetNext();
+ pSibling = static_cast<SwRowFrm*>( pSibling->GetNext() );
sal_uInt16 nMax = nBhPos != USHRT_MAX ?
nBhPos - nCnt :
@@ -2498,7 +2498,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
::lcl_InsertRow( *rTable.GetTabLines()[i],
pUpperFrm, pSibling );
if ( pUpperFrm->IsTabFrm() )
- ((SwTabFrm*)pUpperFrm)->SetCalcLowers();
+ static_cast<SwTabFrm*>(pUpperFrm)->SetCalcLowers();
}
}
}
@@ -2519,7 +2519,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
lcl_UpdateRepeatedHeadlines( *pTable, true );
}
- OSL_ENSURE( ((SwRowFrm*)pTable->Lower())->GetTabLine() ==
+ OSL_ENSURE( static_cast<SwRowFrm*>(pTable->Lower())->GetTabLine() ==
rTable.GetTabLines()[0], "MakeNewFrms: Table corruption!" );
}
}
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index ddae7db..a5347fe 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -56,7 +56,7 @@ sal_uInt16 SwMirrorGrf::GetValueCount() const
bool SwMirrorGrf::operator==( const SfxPoolItem& rItem) const
{
return SfxEnumItem::operator==(rItem) &&
- ((SwMirrorGrf&)rItem).IsGrfToggle() == IsGrfToggle();
+ static_cast<const SwMirrorGrf&>(rItem).IsGrfToggle() == IsGrfToggle();
}
static bool lcl_IsHoriOnEvenPages(int nEnum, bool bToggle)
@@ -168,7 +168,7 @@ SfxPoolItem* SwRotationGrf::Clone( SfxItemPool * ) const
bool SwRotationGrf::operator==( const SfxPoolItem& rCmp ) const
{
return SfxUInt16Item::operator==( rCmp ) &&
- GetUnrotatedSize() == ((SwRotationGrf&)rCmp).GetUnrotatedSize();
+ GetUnrotatedSize() == static_cast<const SwRotationGrf&>(rCmp).GetUnrotatedSize();
}
bool SwRotationGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
@@ -232,7 +232,7 @@ SfxPoolItem* SwGammaGrf::Clone( SfxItemPool * ) const
bool SwGammaGrf::operator==( const SfxPoolItem& rCmp ) const
{
return SfxPoolItem::operator==( rCmp ) &&
- nValue == ((SwGammaGrf&)rCmp).GetValue();
+ nValue == static_cast<const SwGammaGrf&>(rCmp).GetValue();
}
bool SwGammaGrf::QueryValue( uno::Any& rVal, sal_uInt8 ) const
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 911ba85..0989b78 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -131,7 +131,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) ))
{
// file exists, so create connection without an update
- ((SwBaseLink*)&refLink)->Connect();
+ static_cast<SwBaseLink*>(&refLink)->Connect();
}
}
}
@@ -172,7 +172,7 @@ bool SwGrfNode::ReRead(
if( nNewType != refLink->GetObjType() )
{
refLink->Disconnect();
- ((SwBaseLink*)&refLink)->SetObjType( nNewType );
+ static_cast<SwBaseLink*>(&refLink)->SetObjType( nNewType );
}
}
@@ -214,7 +214,7 @@ bool SwGrfNode::ReRead(
else if ( bNewGrf )
{
//TODO refLink->setInputStream(getInputStream());
- ((SwBaseLink*)&refLink)->SwapIn();
+ static_cast<SwBaseLink*>(&refLink)->SwapIn();
}
}
onGraphicChanged();
@@ -249,7 +249,7 @@ bool SwGrfNode::ReRead(
onGraphicChanged();
bReadGrf = true;
// create connection without update, as we have the graphic
- ((SwBaseLink*)&refLink)->Connect();
+ static_cast<SwBaseLink*>(&refLink)->Connect();
}
else if( pGrfObj )
{
@@ -258,7 +258,7 @@ bool SwGrfNode::ReRead(
onGraphicChanged();
bReadGrf = true;
// create connection without update, as we have the graphic
- ((SwBaseLink*)&refLink)->Connect();
+ static_cast<SwBaseLink*>(&refLink)->Connect();
}
else
{
@@ -268,7 +268,7 @@ bool SwGrfNode::ReRead(
onGraphicChanged();
if ( bNewGrf )
{
- ((SwBaseLink*)&refLink)->SwapIn();
+ static_cast<SwBaseLink*>(&refLink)->SwapIn();
}
}
}
@@ -520,7 +520,7 @@ bool SwGrfNode::SwapIn( bool bWaitForData )
bool bRet = false;
bInSwapIn = true;
- SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
+ SwBaseLink* pLink = static_cast<SwBaseLink*>((::sfx2::SvBaseLink*) refLink);
if( pLink )
{
@@ -737,7 +737,7 @@ void SwGrfNode::ReleaseLink()
{
bInSwapIn = true;
- SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
+ SwBaseLink* pLink = static_cast<SwBaseLink*>((::sfx2::SvBaseLink*) refLink);
pLink->SwapIn( true, true );
bInSwapIn = false;
}
@@ -986,7 +986,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
}
- return (sal_IntPtr)pRet;
+ return reinterpret_cast<sal_IntPtr>(pRet);
}
/// delete all QuickDraw-Bitmaps in the specified document
@@ -1005,7 +1005,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc )
if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() &&
rLnkMgr.GetDisplayNames( pLnk, 0, &sFileNm ) &&
pLnk->ISA( SwBaseLink ) && 0 != ( pGrfNd =
- ((SwBaseLink*)pLnk)->GetCntntNode()->GetGrfNode()) )
+ static_cast<SwBaseLink*>(pLnk)->GetCntntNode()->GetGrfNode()) )
{
pGrfNd->ReleaseGraphicFromCache();
}
@@ -1096,14 +1096,14 @@ bool SwGrfNode::IsSelected() const
const SwNode* pN = this;
const SwViewShell* pV = pESh;
do {
- if( pV->ISA( SwEditShell ) && pN == &((SwCrsrShell*)pV)
+ if( pV->ISA( SwEditShell ) && pN == &static_cast<const SwCrsrShell*>(pV)
->GetCrsr()->GetPoint()->nNode.GetNode() )
{
bRet = true;
break;
}
}
- while( pESh != ( pV = (SwViewShell*)pV->GetNext() ));
+ while( pESh != ( pV = static_cast<SwViewShell*>(pV->GetNext()) ));
}
return bRet;
}
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 80df90c..3720cd3 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -148,9 +148,9 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
while ( aIdx < nEnd )
{
if ( pNode->IsCntntNode() &&
- ((SwCntntNode*)pNode)->GetDepends() )
+ static_cast<SwCntntNode*>(pNode)->GetDepends() )
{
- SwCrsrShell *pShell = SwIterator<SwCrsrShell,SwCntntNode>::FirstElement( *(SwCntntNode*)pNode );
+ SwCrsrShell *pShell = SwIterator<SwCrsrShell,SwCntntNode>::FirstElement( *static_cast<SwCntntNode*>(pNode) );
if( pShell )
{
pShell->ParkCrsr( aIdx );
@@ -199,13 +199,13 @@ SwFmtFrmSize& SwFmtFrmSize::operator=( const SwFmtFrmSize& rCpy )
bool SwFmtFrmSize::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- return( m_eFrmHeightType == ((SwFmtFrmSize&)rAttr).m_eFrmHeightType &&
- m_eFrmWidthType == ((SwFmtFrmSize&)rAttr).m_eFrmWidthType &&
- m_aSize == ((SwFmtFrmSize&)rAttr).GetSize()&&
- m_nWidthPercent == ((SwFmtFrmSize&)rAttr).GetWidthPercent() &&
- m_eWidthPercentRelation == ((SwFmtFrmSize&)rAttr).GetWidthPercentRelation() &&
- m_nHeightPercent == ((SwFmtFrmSize&)rAttr).GetHeightPercent() &&
- m_eHeightPercentRelation == ((SwFmtFrmSize&)rAttr).GetHeightPercentRelation() );
+ return( m_eFrmHeightType == static_cast<const SwFmtFrmSize&>(rAttr).m_eFrmHeightType &&
+ m_eFrmWidthType == static_cast<const SwFmtFrmSize&>(rAttr).m_eFrmWidthType &&
+ m_aSize == static_cast<const SwFmtFrmSize&>(rAttr).GetSize()&&
+ m_nWidthPercent == static_cast<const SwFmtFrmSize&>(rAttr).GetWidthPercent() &&
+ m_eWidthPercentRelation == static_cast<const SwFmtFrmSize&>(rAttr).GetWidthPercentRelation() &&
+ m_nHeightPercent == static_cast<const SwFmtFrmSize&>(rAttr).GetHeightPercent() &&
+ m_eHeightPercentRelation == static_cast<const SwFmtFrmSize&>(rAttr).GetHeightPercentRelation() );
}
SfxPoolItem* SwFmtFrmSize::Clone( SfxItemPool* ) const
@@ -465,8 +465,8 @@ SwFmtHeader::SwFmtHeader( bool bOn )
bool SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- return ( GetRegisteredIn() == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
- bActive == ((SwFmtHeader&)rAttr).IsActive() );
+ return ( GetRegisteredIn() == static_cast<const SwFmtHeader&>(rAttr).GetRegisteredIn() &&
+ bActive == static_cast<const SwFmtHeader&>(rAttr).IsActive() );
}
SfxPoolItem* SwFmtHeader::Clone( SfxItemPool* ) const
@@ -515,8 +515,8 @@ void SwFmtFooter::RegisterToFormat( SwFmt& rFmt )
bool SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- return ( GetRegisteredIn() == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
- bActive == ((SwFmtFooter&)rAttr).IsActive() );
+ return ( GetRegisteredIn() == static_cast<const SwFmtFooter&>(rAttr).GetRegisteredIn() &&
+ bActive == static_cast<const SwFmtFooter&>(rAttr).IsActive() );
}
SfxPoolItem* SwFmtFooter::Clone( SfxItemPool* ) const
@@ -552,10 +552,10 @@ void SwFmtCntnt::SetNewCntntIdx( const SwNodeIndex *pIdx )
bool SwFmtCntnt::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- if( (bool)pStartNode != (bool)((SwFmtCntnt&)rAttr).pStartNode )
+ if( (bool)pStartNode != (bool)static_cast<const SwFmtCntnt&>(rAttr).pStartNode )
return false;
if( pStartNode )
- return ( *pStartNode == *((SwFmtCntnt&)rAttr).GetCntntIdx() );
+ return ( *pStartNode == *static_cast<const SwFmtCntnt&>(rAttr).GetCntntIdx() );
return true;
}
@@ -603,9 +603,9 @@ bool SwFmtPageDesc::KnowsPageDesc() const
bool SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- return ( pDefinedIn == ((SwFmtPageDesc&)rAttr).pDefinedIn ) &&
- ( oNumOffset == ((SwFmtPageDesc&)rAttr).oNumOffset ) &&
- ( GetPageDesc() == ((SwFmtPageDesc&)rAttr).GetPageDesc() );
+ return ( pDefinedIn == static_cast<const SwFmtPageDesc&>(rAttr).pDefinedIn ) &&
+ ( oNumOffset == static_cast<const SwFmtPageDesc&>(rAttr).oNumOffset ) &&
+ ( GetPageDesc() == static_cast<const SwFmtPageDesc&>(rAttr).GetPageDesc() );
}
SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list