summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-10 13:37:34 +0200
committerNoel Grandin <noel@peralex.com>2014-11-10 15:22:17 +0200
commit3652012a51cce55e6d1b5eaa78d555667c064088 (patch)
tree2dd6b093db1d84fd138226207d50676d2e1fbbee /sw
parent526917bbd06e290bb6669e2e52730a5941570b34 (diff)
loplugin: cstylecast
Change-Id: I4fbe7d35b66dda16f19019fd1baf0aa03361390c
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fmtcnct.hxx2
-rw-r--r--sw/inc/fmthdft.hxx2
-rw-r--r--sw/inc/txatritr.hxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx54
-rw-r--r--sw/source/core/crsr/findattr.cxx20
-rw-r--r--sw/source/core/crsr/findtxt.cxx4
-rw-r--r--sw/source/core/crsr/pam.cxx8
-rw-r--r--sw/source/core/crsr/swcrsr.cxx36
8 files changed, 64 insertions, 64 deletions
diff --git a/sw/inc/fmtcnct.hxx b/sw/inc/fmtcnct.hxx
index 4ff7c97c0e3d..d782728be17d 100644
--- a/sw/inc/fmtcnct.hxx
+++ b/sw/inc/fmtcnct.hxx
@@ -23,8 +23,8 @@
#include <svl/poolitem.hxx>
#include <format.hxx>
#include <calbck.hxx>
+#include <frmfmt.hxx>
-class SwFlyFrmFmt;
class IntlWrapper;
/// Connection (text flow) between two FlyFrms.
diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx
index 23c4845e4996..3fcc988c31cb 100644
--- a/sw/inc/fmthdft.hxx
+++ b/sw/inc/fmthdft.hxx
@@ -23,8 +23,8 @@
#include <format.hxx>
#include <svl/poolitem.hxx>
#include <calbck.hxx>
+#include <frmfmt.hxx>
-class SwFrmFmt;
class IntlWrapper;
class SwFmt;
diff --git a/sw/inc/txatritr.hxx b/sw/inc/txatritr.hxx
index cdf3892fc3fc..ced47511f808 100644
--- a/sw/inc/txatritr.hxx
+++ b/sw/inc/txatritr.hxx
@@ -82,7 +82,7 @@ public:
{}
sal_uInt16 GetLanguage() const
- { return ((SvxLanguageItem&)GetAttr()).GetValue(); }
+ { return static_cast<const SvxLanguageItem&>(GetAttr()).GetValue(); }
};
#endif
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index dff0b0fdd3fb..73f6e35d91e4 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -379,7 +379,7 @@ bool SwCrsrShell::GotoTOXMarkBase()
for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() )
{
if( pTOX->ISA( SwTOXBaseSection ) &&
- 0 != ( pSectFmt = ((SwTOXBaseSection*)pTOX)->GetFmt() ) &&
+ 0 != ( pSectFmt = static_cast<SwTOXBaseSection*>(pTOX)->GetFmt() ) &&
0 != ( pSectNd = pSectFmt->GetSectionNode() ))
{
SwNodeIndex aIdx( *pSectNd, 1 );
@@ -447,11 +447,11 @@ bool SwCrsrShell::GotoNxtPrvTblFormula( bool bNext, bool bOnlyErrors )
for( n = 0; n < nMaxItems; ++n )
if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2(
RES_BOXATR_FORMULA, n ) ) &&
- 0 != (pTBox = ((SwTblBoxFormula*)pItem)->GetTableBox() ) &&
+ 0 != (pTBox = static_cast<const SwTblBoxFormula*>(pItem)->GetTableBox() ) &&
pTBox->GetSttNd() &&
pTBox->GetSttNd()->GetNodes().IsDocNodes() &&
( !bOnlyErrors ||
- !((SwTblBoxFormula*)pItem)->HasValidBoxes() ) )
+ !static_cast<const SwTblBoxFormula*>(pItem)->HasValidBoxes() ) )
{
const SwCntntFrm* pCFrm;
SwNodeIndex aIdx( *pTBox->GetSttNd() );
@@ -519,7 +519,7 @@ bool SwCrsrShell::GotoNxtPrvTOXMark( bool bNext )
for( n = 0; n < nMaxItems; ++n )
if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2(
RES_TXTATR_TOXMARK, n ) ) &&
- 0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) &&
+ 0 != (pTxtTOX = static_cast<const SwTOXMark*>(pItem)->GetTxtTOXMark() ) &&
( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() &&
0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, false )) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
@@ -592,7 +592,7 @@ void lcl_MakeFldLst(
pTxtFld = pFmtFld->GetTxtFld();
if ( pTxtFld != NULL
&& ( !bChkInpFlag
- || ((SwSetExpField*)pTxtFld->GetFmtFld().GetField())->GetInputFlag() ) )
+ || static_cast<const SwSetExpField*>(pTxtFld->GetFmtFld().GetField())->GetInputFlag() ) )
{
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
const SwCntntFrm* pCFrm =
@@ -710,7 +710,7 @@ bool SwCrsrShell::MoveFldType(
{
// create dummy for the search
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
- (SwDateTimeFieldType*)mpDoc->getIDocumentFieldsAccess().GetSysFldType( RES_DATETIMEFLD ) ) );
+ static_cast<SwDateTimeFieldType*>(mpDoc->getIDocumentFieldsAccess().GetSysFldType( RES_DATETIMEFLD ) ) ) );
pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
mpDoc->IsClipBoard() );
@@ -730,7 +730,7 @@ bool SwCrsrShell::MoveFldType(
if( bDelFld )
{
- delete (SwFmtFld*)&pTxtFld->GetAttr();
+ delete static_cast<SwFmtFld*>(&pTxtFld->GetAttr());
delete pTxtFld;
}
@@ -852,7 +852,7 @@ SwField* SwCrsrShell::GetCurFld( const bool bIncludeInputFldAtStart ) const
{
// TabellenFormel ? wandel internen in externen Namen um
const SwTableNode* pTblNd = IsCrsrInTbl();
- ((SwTblField*)pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
+ static_cast<SwTblField*>(pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
}
return pCurFld;
@@ -967,7 +967,7 @@ bool SwCrsrShell::GotoNextOutline()
SwCallLink aLk( *this ); // watch Crsr-Moves
SwCrsrSaveState aSaveState( *pCrsr );
pCrsr->GetPoint()->nNode = *pNd;
- pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)pNd, 0 );
+ pCrsr->GetPoint()->nContent.Assign( static_cast<SwTxtNode*>(pNd), 0 );
bool bRet = !pCrsr->IsSelOvr();
if( bRet )
@@ -998,7 +998,7 @@ bool SwCrsrShell::GotoPrevOutline()
SwCallLink aLk( *this ); // watch Crsr-Moves
SwCrsrSaveState aSaveState( *pCrsr );
pCrsr->GetPoint()->nNode = *pNd;
- pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)pNd, 0 );
+ pCrsr->GetPoint()->nContent.Assign( static_cast<SwTxtNode*>(pNd), 0 );
bRet = !pCrsr->IsSelOvr();
if( bRet )
@@ -1022,7 +1022,7 @@ sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel )
{
pNd = rNds.GetOutLineNds()[ nPos ];
- if( ((SwTxtNode*)pNd)->GetAttrOutlineLevel()-1 <= nLevel )
+ if( static_cast<SwTxtNode*>(pNd)->GetAttrOutlineLevel()-1 <= nLevel )
return nPos;
}
@@ -1261,13 +1261,13 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
UpdateCrsr();
}
else if( RES_TABLEFLD == pFld->Which() &&
- ((SwTblField*)pFld)->IsIntrnlName() )
+ static_cast<const SwTblField*>(pFld)->IsIntrnlName() )
{
// create from internal (for CORE) the external
// (for UI) formula
const SwTableNode* pTblNd = pTxtNd->FindTableNode();
if( pTblNd ) // steht in einer Tabelle
- ((SwTblField*)pFld)->PtrToBoxNm( &pTblNd->GetTable() );
+ const_cast<SwTblField*>(static_cast<const SwTblField*>(pFld))->PtrToBoxNm( &pTblNd->GetTable() );
}
}
@@ -1314,7 +1314,7 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
SwCallLink aLk( *this ); // watch Crsr-Moves
SwCrsrSaveState aSaveState( *m_pCurCrsr );
- m_pCurCrsr->GetPoint()->nNode = *((SwTxtFtn*)pTxtAttr)->GetStartNode();
+ m_pCurCrsr->GetPoint()->nNode = *static_cast<SwTxtFtn*>(pTxtAttr)->GetStartNode();
SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection(
&m_pCurCrsr->GetPoint()->nNode,
true, !IsReadOnlyAvailable() );
@@ -1493,7 +1493,7 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( pF )
{
// then the CellFrame
- pFrm = (SwCntntFrm*)pF;
+ pFrm = static_cast<SwCntntFrm*>(pF);
while( pF && !pF->IsCellFrm() )
pF = pF->GetUpper();
}
@@ -1516,7 +1516,7 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXVALUE;
else
#endif
- ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
+ const_cast<SwTblBoxFormula*>(static_cast<const SwTblBoxFormula*>(pItem))->PtrToBoxNm( &pTblNd->GetTable() );
bRet = true;
if( bSetCrsr )
@@ -1675,7 +1675,7 @@ bool SwContentAtPos::IsInProtectSect() const
break;
case SW_FTN:
- pNd = &((SwTxtFtn*)pFndTxtAttr)->GetTxtNode();
+ pNd = &static_cast<const SwTxtFtn*>(pFndTxtAttr)->GetTxtNode();
break;
case SW_INETATTR:
@@ -1911,14 +1911,14 @@ bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
RES_LR_SPACE, RES_LR_SPACE,
RES_PARATR_ADJUST, RES_PARATR_ADJUST,
0 );
- SvxLRSpaceItem aLR( (SvxLRSpaceItem&)
- pCNd->GetAttr( RES_LR_SPACE ) );
+ SvxLRSpaceItem aLR( static_cast<const SvxLRSpaceItem&>(
+ pCNd->GetAttr( RES_LR_SPACE ) ) );
aLR.SetTxtLeft( aFPos.nTabCnt );
aLR.SetTxtFirstLineOfst( 0 );
aSet.Put( aLR );
- const SvxAdjustItem& rAdj = (SvxAdjustItem&)pCNd->
- GetAttr( RES_PARATR_ADJUST );
+ const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>(pCNd->
+ GetAttr( RES_PARATR_ADJUST ));
if( SVX_ADJUST_LEFT != rAdj.GetAdjust() )
aSet.Put( SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ) );
@@ -2101,7 +2101,7 @@ const SwRangeRedline* SwCrsrShell::GotoRedline( sal_uInt16 nArrPos, bool bSelect
// Check for overlaps. These can happen when FmtColl-
// Redlines were streched over a whole paragraph
SwPaM* pCur = m_pCurCrsr;
- SwPaM* pNextPam = (SwPaM*)pCur->GetNext();
+ SwPaM* pNextPam = static_cast<SwPaM*>(pCur->GetNext());
SwPosition* pCStt = pCur->Start(), *pCEnd = pCur->End();
while( pCur != pNextPam )
{
@@ -2149,11 +2149,11 @@ const SwRangeRedline* SwCrsrShell::GotoRedline( sal_uInt16 nArrPos, bool bSelect
if( bDel )
{
// not needed anymore
- SwPaM* pPrevPam = (SwPaM*)pNextPam->GetPrev();
+ SwPaM* pPrevPam = static_cast<SwPaM*>(pNextPam->GetPrev());
delete pNextPam;
pNextPam = pPrevPam;
}
- pNextPam = (SwPaM*)pNextPam->GetNext();
+ pNextPam = static_cast<SwPaM*>(pNextPam->GetNext());
}
}
@@ -2243,7 +2243,7 @@ bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext )
const SwFrmFmts* pFmts = GetDoc()->GetSpzFrmFmts();
for( sal_uInt16 n = 0, nEnd = pFmts->size(); n < nEnd; ++n )
{
- SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)(*pFmts)[ n ];
+ SwFlyFrmFmt* pFmt = static_cast<SwFlyFrmFmt*>((*pFmts)[ n ]);
const SwFmtURL& rURLItem = pFmt->GetURL();
if( rURLItem.GetMap() || !rURLItem.GetURL().isEmpty() )
{
@@ -2295,7 +2295,7 @@ bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext )
const SdrObject* pSObj = pFndFmt->FindSdrObject();
if (pSObj)
{
- ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
+ static_cast<SwFEShell*>(this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
MakeSelVisible();
bRet = true;
}
@@ -2305,7 +2305,7 @@ bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext )
SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, false );
if( pFly )
{
- ((SwFEShell*)this)->SelectFlyFrm( *pFly, true );
+ static_cast<SwFEShell*>(this)->SelectFlyFrm( *pFly, true );
MakeSelVisible();
bRet = true;
}
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 21390e527123..ebae430fc797 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -57,16 +57,16 @@ bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 )
switch( rItem1.Which() )
{
case RES_CHRATR_FONT:
- return ((SvxFontItem&)rItem1).GetFamilyName() ==
- ((SvxFontItem&)rItem2).GetFamilyName();
+ return static_cast<const SvxFontItem&>(rItem1).GetFamilyName() ==
+ static_cast<const SvxFontItem&>(rItem2).GetFamilyName();
case RES_CHRATR_COLOR:
- return ((SvxColorItem&)rItem1).GetValue().IsRGBEqual(
- ((SvxColorItem&)rItem2).GetValue() );
+ return static_cast<const SvxColorItem&>(rItem1).GetValue().IsRGBEqual(
+ static_cast<const SvxColorItem&>(rItem2).GetValue() );
case RES_PAGEDESC:
bool bNumOffsetEqual = false;
- ::boost::optional<sal_uInt16> oNumOffset1 = ((SwFmtPageDesc&)rItem1).GetNumOffset();
- ::boost::optional<sal_uInt16> oNumOffset2 = ((SwFmtPageDesc&)rItem1).GetNumOffset();
+ ::boost::optional<sal_uInt16> oNumOffset1 = static_cast<const SwFmtPageDesc&>(rItem1).GetNumOffset();
+ ::boost::optional<sal_uInt16> oNumOffset2 = static_cast<const SwFmtPageDesc&>(rItem1).GetNumOffset();
if (!oNumOffset1 && !oNumOffset2)
{
bNumOffsetEqual = true;
@@ -83,7 +83,7 @@ bool CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 )
if (bNumOffsetEqual == false)
return false;
- return ((SwFmtPageDesc&)rItem1).GetPageDesc() == ((SwFmtPageDesc&)rItem2).GetPageDesc();
+ return static_cast<const SwFmtPageDesc&>(rItem1).GetPageDesc() == static_cast<const SwFmtPageDesc&>(rItem2).GetPageDesc();
}
return rItem1 == rItem2;
}
@@ -915,8 +915,8 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, SwMoveFn fnMove,
if( !pNode->IsTxtNode() ) // CharAttr are only in text nodes
continue;
- if( ((SwTxtNode*)pNode)->HasHints() &&
- lcl_Search( *(SwTxtNode*)pNode, *pPam, rAttr, fnMove, bValue ))
+ if( static_cast<SwTxtNode*>(pNode)->HasHints() &&
+ lcl_Search( *static_cast<SwTxtNode*>(pNode), *pPam, rAttr, fnMove, bValue ))
{
// set to the values of the attribute
SetMark();
@@ -1005,7 +1005,7 @@ bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, SwMoveFn fnMove,
if( (!aOtherSet.Count() ||
lcl_Search( *pNode, aOtherSet, bNoColls )) &&
- (*fnSearch)( *(SwTxtNode*)pNode, aCmpArr, *pPam ))
+ (*fnSearch)( *static_cast<SwTxtNode*>(pNode), aCmpArr, *pPam ))
{
// set to the values of the attribute
SetMark();
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index c6b2a7478266..42f7d7fa82ff 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -253,7 +253,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
// if there are SwPostItFields inside our current node text, we
// split the text into separate pieces and search for text inside
// the pieces as well as inside the fields
- const SwpHints *pHts = ((SwTxtNode*)pNode)->GetpSwpHints();
+ const SwpHints *pHts = static_cast<SwTxtNode*>(pNode)->GetpSwpHints();
// count PostItFields by looping over all fields
sal_Int32 aNumberPostits = 0;
@@ -446,7 +446,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
if ( nSearchScript == nCurrScript )
{
const LanguageType eCurrLang =
- ((SwTxtNode*)pNode)->GetLang( bSrchForward ?
+ static_cast<SwTxtNode*>(pNode)->GetLang( bSrchForward ?
nStart :
nEnd );
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index ad5bbf510314..599d9ba0674f 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -272,14 +272,14 @@ bool CheckNodesRange( const SwNodeIndex& rStt,
bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode )
{
if( pNd->IsCntntNode() )
- return ((SwCntntNode*)pNd)->GoNext( pIdx, nMode );
+ return static_cast<SwCntntNode*>(pNd)->GoNext( pIdx, nMode );
return false;
}
bool GoPrevious( SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode )
{
if( pNd->IsCntntNode() )
- return ((SwCntntNode*)pNd)->GoPrevious( pIdx, nMode );
+ return static_cast<SwCntntNode*>(pNd)->GoPrevious( pIdx, nMode );
return false;
}
@@ -760,7 +760,7 @@ SwCntntNode* GetNode( SwPaM & rPam, bool& rbFirst, SwMoveFn fnMove,
(
0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) ) ||
( !bInReadOnly && pFrm->IsProtected() ) ||
- (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow())
+ (pFrm->IsTxtFrm() && static_cast<SwTxtFrm*>(pFrm)->IsHiddenNow())
) ||
( !bInReadOnly && pNd->FindSectionNode() &&
pNd->FindSectionNode()->GetSection().IsProtect()
@@ -794,7 +794,7 @@ SwCntntNode* GetNode( SwPaM & rPam, bool& rbFirst, SwMoveFn fnMove,
if( 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) ) ||
( !bInReadOnly && pFrm->IsProtected() ) ||
( pFrm->IsTxtFrm() &&
- ((SwTxtFrm*)pFrm)->IsHiddenNow() ) )
+ static_cast<SwTxtFrm*>(pFrm)->IsHiddenNow() ) )
{
pNd = 0;
continue;
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 400c1466750b..e5c9073bb86f 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -324,7 +324,7 @@ bool SwCursor::IsSelOvr( int eFlags )
const SwNode* pNd = &GetPoint()->nNode.GetNode();
if( pNd->IsCntntNode() && !dynamic_cast<SwUnoCrsr*>(this) )
{
- const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() );
+ const SwCntntFrm* pFrm = static_cast<const SwCntntNode*>(pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() );
if( pFrm && pFrm->IsValid()
&& 0 == pFrm->Frm().Height()
&& 0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
@@ -341,7 +341,7 @@ bool SwCursor::IsSelOvr( int eFlags )
if( !pFrm )
{
bGoNxt = !bGoNxt;
- pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() );
+ pFrm = static_cast<const SwCntntNode*>(pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() );
while ( pFrm && 0 == pFrm->Frm().Height() )
{
pFrm = bGoNxt ? pFrm->GetNextCntntFrm()
@@ -405,7 +405,7 @@ bool SwCursor::IsSelOvr( int eFlags )
}
if( (pNd = &GetMark()->nNode.GetNode())->IsCntntNode()
- && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() )
+ && !static_cast<const SwCntntNode*>(pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() )
&& !dynamic_cast<SwUnoCrsr*>(this) )
{
DeleteMark();
@@ -522,7 +522,7 @@ bool SwCursor::IsSelOvr( int eFlags )
pMyNd = pOuterTableNd;
else
{
- SwCntntNode* pCNd = (SwCntntNode*)pMyNd;
+ SwCntntNode* pCNd = const_cast<SwCntntNode*>(static_cast<const SwCntntNode*>(pMyNd));
GetPoint()->nContent.Assign( pCNd, bSelTop ? pCNd->Len() : 0 );
return false;
}
@@ -694,7 +694,7 @@ bool SwCursor::IsAtValidPos( bool bPoint ) const
const SwPosition* pPos = bPoint ? GetPoint() : GetMark();
const SwNode* pNd = &pPos->nNode.GetNode();
- if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) &&
+ if( pNd->IsCntntNode() && !static_cast<const SwCntntNode*>(pNd)->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) &&
!dynamic_cast<const SwUnoCrsr*>(this) )
{
return false;
@@ -751,13 +751,13 @@ static sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
sal_uInt16 nCrsrCnt = 0;
if( FND_IN_SEL & eFndRngs )
{
- while( pCurCrsr != ( pTmpCrsr = (SwPaM*)pTmpCrsr->GetNext() ))
+ while( pCurCrsr != ( pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext()) ))
++nCrsrCnt;
if( nCrsrCnt && !bIsUnoCrsr )
pPHdl = new _PercentHdl( 0, nCrsrCnt, pDoc->GetDocShell() );
}
else
- pSaveCrsr = (SwPaM*)pSaveCrsr->GetPrev();
+ pSaveCrsr = static_cast<SwPaM*>(pSaveCrsr->GetPrev());
bool bEnd = false;
do {
@@ -842,7 +842,7 @@ static sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
if( bEnd || !( eFndRngs & ( FND_IN_SELALL | FND_IN_SEL )) )
break;
- pTmpCrsr = ((SwPaM*)pTmpCrsr->GetNext());
+ pTmpCrsr = static_cast<SwPaM*>(pTmpCrsr->GetNext());
if( nCrsrCnt && pPHdl )
{
pPHdl->NextPos( ++pPHdl->nActPos );
@@ -1585,7 +1585,7 @@ SwCursor::DoSetBidiLevelLeftRight(
{
sal_uInt8 nCrsrLevel = GetCrsrBidiLevel();
bool bForward = ! io_rbLeft;
- ((SwTxtFrm*)pSttFrm)->PrepareVisualMove( nPos, nCrsrLevel,
+ const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pSttFrm))->PrepareVisualMove( nPos, nCrsrLevel,
bForward, bInsertCrsr );
rIdx = nPos;
SetCrsrBidiLevel( nCrsrLevel );
@@ -1710,7 +1710,7 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
if ( &rTmpNode != &rNode && rTmpNode.IsTxtNode() )
{
Point aPt;
- const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, GetPoint() );
+ const SwCntntFrm* pEndFrm = static_cast<SwTxtNode&>(rTmpNode).getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, GetPoint() );
if ( pEndFrm )
{
if ( ! pEndFrm->IsRightToLeft() != ! pSttFrm->IsRightToLeft() )
@@ -1736,7 +1736,7 @@ void SwCursor::DoSetBidiLevelUpDown()
if ( rNode.IsTxtNode() )
{
const SwScriptInfo* pSI =
- SwScriptInfo::GetScriptInfo( (SwTxtNode&)rNode );
+ SwScriptInfo::GetScriptInfo( static_cast<SwTxtNode&>(rNode) );
if ( pSI )
{
SwIndex& rIdx = GetPoint()->nContent;
@@ -2177,7 +2177,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
SwPosition* pPos = pCur->GetMark();
if( pNd != &pPos->nNode.GetNode() )
pPos->nNode = *pNd;
- pPos->nContent.Assign( (SwCntntNode*)pNd, 0 );
+ pPos->nContent.Assign( const_cast<SwCntntNode*>(static_cast<const SwCntntNode*>(pNd)), 0 );
aIdx.Assign( *pSttNd->EndOfSectionNode(), - 1 );
if( !( pNd = &aIdx.GetNode())->IsCntntNode() )
@@ -2186,17 +2186,17 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
pPos = pCur->GetPoint();
if (pNd && pNd != &pPos->nNode.GetNode())
pPos->nNode = *pNd;
- pPos->nContent.Assign((SwCntntNode*)pNd, pNd ? ((SwCntntNode*)pNd)->Len() : 0);
+ pPos->nContent.Assign(const_cast<SwCntntNode*>(static_cast<const SwCntntNode*>(pNd)), pNd ? static_cast<const SwCntntNode*>(pNd)->Len() : 0);
aTmp.erase( aTmp.begin() + nPos );
}
else
bDel = true;
- pCur = (SwPaM*)pCur->GetNext();
+ pCur = static_cast<SwPaM*>(pCur->GetNext());
if( bDel )
{
- SwPaM* pDel = (SwPaM*)pCur->GetPrev();
+ SwPaM* pDel = static_cast<SwPaM*>(pCur->GetPrev());
if( pDel == pAktCrsr )
pAktCrsr->DeleteMark();
@@ -2212,7 +2212,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
SwNodeIndex aIdx( *pSttNd, 1 );
if( &aIdx.GetNodes() != &rNds )
break;
- const SwNode* pNd = &aIdx.GetNode();
+ SwNode* pNd = &aIdx.GetNode();
if( !pNd->IsCntntNode() )
pNd = rNds.GoNextSection( &aIdx, true, false );
@@ -2220,7 +2220,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
? pAktCrsr
: pAktCrsr->Create( pAktCrsr );
pNew->GetPoint()->nNode = *pNd;
- pNew->GetPoint()->nContent.Assign( (SwCntntNode*)pNd, 0 );
+ pNew->GetPoint()->nContent.Assign( static_cast<SwCntntNode*>(pNd), 0 );
pNew->SetMark();
SwPosition* pPos = pNew->GetPoint();
@@ -2228,7 +2228,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
if( !( pNd = &pPos->nNode.GetNode())->IsCntntNode() )
pNd = rNds.GoPrevSection( &pPos->nNode, true, false );
- pPos->nContent.Assign((SwCntntNode*)pNd, pNd ? ((SwCntntNode*)pNd)->Len() : 0);
+ pPos->nContent.Assign(static_cast<SwCntntNode*>(pNd), pNd ? static_cast<SwCntntNode*>(pNd)->Len() : 0);
}
}
return pAktCrsr;