Kaydet (Commit) 3652012a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin: cstylecast

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