diff options
36 files changed, 257 insertions, 254 deletions
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 0f5e18bbd1d8..b556e9bd0f7d 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -320,7 +320,9 @@ inline const SwFrmFmt *SwPageDesc::GetLeftFmt(bool const bFirst) const class SwPageDescExt { +public: SwPageDesc aPageDesc; +private: SwDoc * pDoc; OUString sFollow; diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index 8e10ddc46412..3b7b303ec5db 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -44,6 +44,7 @@ #include <calbck.hxx> #include <TextCursorHelper.hxx> #include <unotext.hxx> +#include <frmfmt.hxx> class SwUnoCrsr; class SwTable; @@ -152,7 +153,7 @@ public: static SwXCell* CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTbl = 0 ); SwTableBox* FindBox(SwTable* pTable, SwTableBox* pBox); - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } }; class SwXTextTableRow : public cppu::WeakImplHelper2 @@ -165,7 +166,7 @@ class SwXTextTableRow : public cppu::WeakImplHelper2 const SfxItemPropertySet* m_pPropSet; SwTableLine* pLine; - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } protected: virtual ~SwXTextTableRow(); //SwClient @@ -274,7 +275,7 @@ public: const SwUnoCrsr* GetCrsr() const; SwUnoCrsr* GetCrsr(); - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } }; struct SwRangeDescriptor @@ -432,7 +433,7 @@ public: //SwClient virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE; - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } }; class SwXCellRange : public cppu::WeakImplHelper7 @@ -529,7 +530,7 @@ public: //SwClient virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE; - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } sal_uInt16 getRowCount(void); sal_uInt16 getColumnCount(void); @@ -552,7 +553,7 @@ class SwXTableRows : public cppu::WeakImplHelper2 public SwClient { - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } protected: virtual ~SwXTableRows(); public: @@ -593,7 +594,7 @@ class SwXTableColumns : public cppu::WeakImplHelper2 public SwClient { - SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + SwFrmFmt* GetFrmFmt() const { return const_cast<SwFrmFmt*>(static_cast<const SwFrmFmt*>(GetRegisteredIn())); } protected: virtual ~SwXTableColumns(); public: diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index 7dc780e5d64b..b5ce09bae32b 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -45,9 +45,9 @@ SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt ) bool SwFmtFlyCnt::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); - return( pTxtAttr && ((SwFmtFlyCnt&)rAttr).pTxtAttr && - pTxtAttr->GetStart() == ((SwFmtFlyCnt&)rAttr).pTxtAttr->GetStart() && - pFmt == ((SwFmtFlyCnt&)rAttr).GetFrmFmt() ); + return( pTxtAttr && static_cast<const SwFmtFlyCnt&>(rAttr).pTxtAttr && + pTxtAttr->GetStart() == static_cast<const SwFmtFlyCnt&>(rAttr).pTxtAttr->GetStart() && + pFmt == static_cast<const SwFmtFlyCnt&>(rAttr).GetFrmFmt() ); } SfxPoolItem* SwFmtFlyCnt::Clone( SfxItemPool* ) const @@ -213,21 +213,21 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm ) SwFrm* pFrm = aIter.First(); if ( pFrm ) { - SwTxtFrm *pFirst = (SwTxtFrm*)pCurrFrm; + SwTxtFrm *pFirst = const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pCurrFrm)); while ( pFirst->IsFollow() ) pFirst = pFirst->FindMaster(); do { SwTxtFrm *pTmp = pFirst; do - { if( ( (SwFlyFrm*)pFrm )->GetAnchorFrm() == (SwFrm*) pTmp ) + { if( static_cast<SwFlyFrm*>(pFrm)->GetAnchorFrm() == static_cast<SwFrm*>(pTmp) ) { if ( pTmp != pCurrFrm ) { - pTmp->RemoveFly( (SwFlyFrm*)pFrm ); - ((SwTxtFrm*)pCurrFrm)->AppendFly( (SwFlyFrm*)pFrm ); + pTmp->RemoveFly( static_cast<SwFlyFrm*>(pFrm) ); + const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pCurrFrm))->AppendFly( static_cast<SwFlyFrm*>(pFrm) ); } - return (SwFlyInCntFrm*)pFrm; + return static_cast<SwFlyInCntFrm*>(pFrm); } pTmp = pTmp->GetFollow(); } while ( pTmp ); @@ -243,7 +243,7 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm ) // Die Rekursion wird durch den Lockmechanismus in SwTxtFrm::Format() // abgewuergt. SwFrm* pCurrFrame = const_cast< SwFrm* >(pCurrFrm); - SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, pCurrFrame, pCurrFrame ); + SwFlyInCntFrm *pFly = new SwFlyInCntFrm( static_cast<SwFlyFrmFmt*>(pFrmFmt), pCurrFrame, pCurrFrame ); pCurrFrame->AppendFly( pFly ); pFly->RegistFlys(); diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 3a0328e6f940..80b5e757b374 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -212,11 +212,11 @@ OUString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, bool bInclStrings ) const if( pSectNd ) { - const SwFmtFtnEndAtTxtEnd& rFtnEnd = (SwFmtFtnEndAtTxtEnd&) + const SwFmtFtnEndAtTxtEnd& rFtnEnd = static_cast<const SwFmtFtnEndAtTxtEnd&>( pSectNd->GetSection().GetFmt()->GetFmtAttr( IsEndNote() ? static_cast<sal_uInt16>(RES_END_AT_TXTEND) : - static_cast<sal_uInt16>(RES_FTN_AT_TXTEND) ); + static_cast<sal_uInt16>(RES_FTN_AT_TXTEND) ) ); if( FTNEND_ATTXTEND_OWNNUMANDFMT == rFtnEnd.GetValue() ) { @@ -473,7 +473,7 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib ) while ( pFrm && !pFrm->IsFtnFrm() ) pFrm = pFrm->GetUpper(); - SwFtnFrm *pFtn = (SwFtnFrm*)pFrm; + SwFtnFrm *pFtn = static_cast<SwFtnFrm*>(pFrm); while ( pFtn && pFtn->GetMaster() ) pFtn = pFtn->GetMaster(); OSL_ENSURE( pFtn->GetAttr() == this, "Ftn mismatch error." ); diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 66bfb8de1679..773339ab9dc8 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -441,8 +441,8 @@ bool SwFmtRuby::QueryValue( uno::Any& rVal, nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { - case MID_RUBY_TEXT: rVal <<= (OUString)sRubyTxt; break; - case MID_RUBY_ADJUST: rVal <<= (sal_Int16)nAdjustment; break; + case MID_RUBY_TEXT: rVal <<= sRubyTxt; break; + case MID_RUBY_ADJUST: rVal <<= (sal_Int16)nAdjustment; break; case MID_RUBY_CHARSTYLE: { OUString aString; @@ -452,8 +452,7 @@ bool SwFmtRuby::QueryValue( uno::Any& rVal, break; case MID_RUBY_ABOVE: { - sal_Bool bAbove = !nPosition; - rVal.setValue(&bAbove, ::getBooleanCppuType()); + rVal <<= bool(!nPosition) ; } break; default: diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 76d35001c166..c504100fbec4 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -81,7 +81,7 @@ long EvalGridWidthAdd( const SwTextGridItem *const pGrid, const SwDrawTextInfo & SfxStyleSheetBase* pStyle = pBasePool->Find(sString, (SfxStyleFamily)SFX_STYLE_FAMILY_PARA); SfxItemSet& aTmpSet = pStyle->GetItemSet(); - SvxFontHeightItem &aDefaultFontItem = (SvxFontHeightItem&)aTmpSet.Get(RES_CHRATR_CJK_FONTSIZE); + const SvxFontHeightItem &aDefaultFontItem = static_cast<const SvxFontHeightItem&>(aTmpSet.Get(RES_CHRATR_CJK_FONTSIZE)); const SwDoc* pDoc = rInf.GetShell()->GetDoc(); const long nGridWidthAdd = GetGridWidth(*pGrid, *pDoc) - aDefaultFontItem.GetHeight(); diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index ce2d7c40d7bd..5f8bf848ec10 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -745,7 +745,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) { pLastFont = pSpaceFont; pLastFont->SetDevFont( rDo.GetInf().GetShell(), rDo.GetOut() ); - ( (SwDoDrawCapital&) rDo ).DrawSpace( aStartPos ); + static_cast<SwDoDrawCapital&>( rDo ).DrawSpace( aStartPos ); } if ( bWordWise ) delete pSpaceFontAccess; diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index 200f2114b1be..5f1d84c44282 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -52,7 +52,7 @@ static bool lcl_IsLessStart( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 ) return nS1 < nS2; } - return (sal_IntPtr)&rHt1 < (sal_IntPtr)&rHt2; + return reinterpret_cast<sal_IntPtr>(&rHt1) < reinterpret_cast<sal_IntPtr>(&rHt2); } // order is important! for requirements see hintids.hxx return ( nWhich1 > nWhich2 ); @@ -85,7 +85,7 @@ static bool lcl_IsLessEnd( const SwTxtAttr &rHt1, const SwTxtAttr &rHt2 ) return nS1 > nS2; } - return (sal_IntPtr)&rHt1 > (sal_IntPtr)&rHt2; + return reinterpret_cast<sal_IntPtr>(&rHt1) > reinterpret_cast<sal_IntPtr>(&rHt2); } // order is important! for requirements see hintids.hxx return ( nWhich1 < nWhich2 ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 74f918a2b3d6..211c26d3433b 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -316,7 +316,7 @@ static void lcl_ChangeFtnRef( SwTxtNode &rNode ) if( !pFrm ) return; } - SwTxtFtn *pAttr = (SwTxtFtn*)pHt; + SwTxtFtn *pAttr = static_cast<SwTxtFtn*>(pHt); OSL_ENSURE( pAttr->GetStartNode(), "FtnAtr ohne StartNode." ); SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 ); SwCntntNode *pNd = aIdx.GetNode().GetCntntNode(); @@ -3680,8 +3680,8 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal GetNodes().IsDocNodes() ) { _ChgTxtCollUpdateNum( - (SwTxtFmtColl*)static_cast<const SwFmtChg*>(pOldValue)->pChangedFmt, - (SwTxtFmtColl*)static_cast<const SwFmtChg*>(pNewValue)->pChangedFmt ); + static_cast<const SwTxtFmtColl*>(static_cast<const SwFmtChg*>(pOldValue)->pChangedFmt), + static_cast<const SwTxtFmtColl*>(static_cast<const SwFmtChg*>(pNewValue)->pChangedFmt) ); } //UUUU reset fill information @@ -3821,7 +3821,7 @@ void SwTxtNode::UpdateOutlineState() int SwTxtNode::GetAttrOutlineLevel() const { - return ((const SfxUInt16Item &)GetAttr(RES_PARATR_OUTLINELEVEL)).GetValue(); + return static_cast<const SfxUInt16Item &>(GetAttr(RES_PARATR_OUTLINELEVEL)).GetValue(); } void SwTxtNode::SetAttrOutlineLevel(int nLevel) @@ -4966,7 +4966,7 @@ sal_uInt32 SwTxtNode::GetRsid( sal_Int32 nStt, sal_Int32 nEnd ) const SfxItemSet aSet( (SfxItemPool&) (GetDoc()->GetAttrPool()), RES_CHRATR_RSID, RES_CHRATR_RSID ); if ( GetAttr(aSet, nStt, nEnd) ) { - SvxRsidItem* pRsid = (SvxRsidItem*)aSet.GetItem(RES_CHRATR_RSID); + const SvxRsidItem* pRsid = static_cast<const SvxRsidItem*>(aSet.GetItem(RES_CHRATR_RSID)); if( pRsid ) return pRsid->GetValue(); } diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx index 859db92ab4f1..cdad0bcd579e 100644 --- a/sw/source/core/txtnode/swfntcch.cxx +++ b/sw/source/core/txtnode/swfntcch.cxx @@ -52,7 +52,7 @@ SwFontAccess::SwFontAccess( const void *pOwn, SwViewShell *pSh ) : SwFontObj *SwFontAccess::Get( ) { - return (SwFontObj *) SwCacheAccess::Get( ); + return static_cast<SwFontObj *>( SwCacheAccess::Get( ) ); } SwCacheObj *SwFontAccess::NewObj( ) diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index d51e951d948a..518794e6447f 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -490,7 +490,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_FONT, true, &pItem )) { - const SvxFontItem *pFont = (const SvxFontItem *)pItem; + const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); aSub[SW_LATIN].SetFamily( pFont->GetFamily() ); aSub[SW_LATIN].Font::SetName( pFont->GetFamilyName() ); aSub[SW_LATIN].Font::SetStyleName( pFont->GetStyleName() ); @@ -500,7 +500,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_FONTSIZE, true, &pItem )) { - const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; + const SvxFontHeightItem *pHeight = static_cast<const SvxFontHeightItem *>(pItem); aSub[SW_LATIN].SvxFont::SetPropr( 100 ); aSub[SW_LATIN].aSize = aSub[SW_LATIN].Font::GetSize(); Size aTmpSize = aSub[SW_LATIN].aSize; @@ -520,7 +520,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONT, true, &pItem )) { - const SvxFontItem *pFont = (const SvxFontItem *)pItem; + const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); aSub[SW_CJK].SetFamily( pFont->GetFamily() ); aSub[SW_CJK].Font::SetName( pFont->GetFamilyName() ); aSub[SW_CJK].Font::SetStyleName( pFont->GetStyleName() ); @@ -530,7 +530,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONTSIZE, true, &pItem )) { - const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; + const SvxFontHeightItem *pHeight = static_cast<const SvxFontHeightItem *>(pItem); aSub[SW_CJK].SvxFont::SetPropr( 100 ); aSub[SW_CJK].aSize = aSub[SW_CJK].Font::GetSize(); Size aTmpSize = aSub[SW_CJK].aSize; @@ -556,7 +556,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONT, true, &pItem )) { - const SvxFontItem *pFont = (const SvxFontItem *)pItem; + const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); aSub[SW_CTL].SetFamily( pFont->GetFamily() ); aSub[SW_CTL].Font::SetName( pFont->GetFamilyName() ); aSub[SW_CTL].Font::SetStyleName( pFont->GetStyleName() ); @@ -566,7 +566,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONTSIZE, true, &pItem )) { - const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; + const SvxFontHeightItem *pHeight = static_cast<const SvxFontHeightItem *>(pItem); aSub[SW_CTL].SvxFont::SetPropr( 100 ); aSub[SW_CTL].aSize = aSub[SW_CTL].Font::GetSize(); Size aTmpSize = aSub[SW_CTL].aSize; @@ -639,7 +639,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_ESCAPEMENT, true, &pItem )) { - const SvxEscapementItem *pEsc = (const SvxEscapementItem *)pItem; + const SvxEscapementItem *pEsc = static_cast<const SvxEscapementItem *>(pItem); SetEscapement( pEsc->GetEsc() ); if( aSub[SW_LATIN].IsEsc() ) SetProportion( pEsc->GetProp() ); diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 095b20dd3c4d..4ba366200924 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1028,7 +1028,7 @@ SwTxtAttr* MakeTxtAttr( { case RES_TXTATR_CHARFMT: { - SwFmtCharFmt &rFmtCharFmt = (SwFmtCharFmt&) rNew; + SwFmtCharFmt &rFmtCharFmt = static_cast<SwFmtCharFmt&>(rNew); if( !rFmtCharFmt.GetCharFmt() ) { rFmtCharFmt.SetCharFmt( rDoc.GetDfltCharFmt() ); @@ -1038,7 +1038,7 @@ SwTxtAttr* MakeTxtAttr( } break; case RES_TXTATR_INETFMT: - pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd ); + pNew = new SwTxtINetFmt( static_cast<SwFmtINetFmt&>(rNew), nStt, nEnd ); break; case RES_TXTATR_FIELD: @@ -1068,7 +1068,7 @@ SwTxtAttr* MakeTxtAttr( case RES_TXTATR_FLYCNT: { // erst hier wird das Frame-Format kopiert (mit Inhalt) !! - pNew = new SwTxtFlyCnt( (SwFmtFlyCnt&)rNew, nStt ); + pNew = new SwTxtFlyCnt( static_cast<SwFmtFlyCnt&>(rNew), nStt ); // Kopie von einem Text-Attribut if ( static_cast<const SwFmtFlyCnt &>(rAttr).GetTxtFlyCnt() ) { @@ -1078,21 +1078,21 @@ SwTxtAttr* MakeTxtAttr( } break; case RES_TXTATR_FTN: - pNew = new SwTxtFtn( (SwFmtFtn&)rNew, nStt ); + pNew = new SwTxtFtn( static_cast<SwFmtFtn&>(rNew), nStt ); // ggfs. SeqNo kopieren - if( ((SwFmtFtn&)rAttr).GetTxtFtn() ) - ((SwTxtFtn*)pNew)->SetSeqNo( ((SwFmtFtn&)rAttr).GetTxtFtn()->GetSeqRefNo() ); + if( static_cast<SwFmtFtn&>(rAttr).GetTxtFtn() ) + static_cast<SwTxtFtn*>(pNew)->SetSeqNo( static_cast<SwFmtFtn&>(rAttr).GetTxtFtn()->GetSeqRefNo() ); break; case RES_TXTATR_REFMARK: pNew = nStt == nEnd - ? new SwTxtRefMark( (SwFmtRefMark&)rNew, nStt ) - : new SwTxtRefMark( (SwFmtRefMark&)rNew, nStt, &nEnd ); + ? new SwTxtRefMark( static_cast<SwFmtRefMark&>(rNew), nStt ) + : new SwTxtRefMark( static_cast<SwFmtRefMark&>(rNew), nStt, &nEnd ); break; case RES_TXTATR_TOXMARK: - pNew = new SwTxtTOXMark( (SwTOXMark&)rNew, nStt, &nEnd ); + pNew = new SwTxtTOXMark( static_cast<SwTOXMark&>(rNew), nStt, &nEnd ); break; case RES_TXTATR_CJK_RUBY: - pNew = new SwTxtRuby( (SwFmtRuby&)rNew, nStt, nEnd ); + pNew = new SwTxtRuby( static_cast<SwFmtRuby&>(rNew), nStt, nEnd ); break; case RES_TXTATR_META: case RES_TXTATR_METAFIELD: @@ -1143,7 +1143,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) break; case RES_TXTATR_FTN: - ((SwTxtFtn*)pAttr)->SetStartNode( 0 ); + static_cast<SwTxtFtn*>(pAttr)->SetStartNode( 0 ); static_cast<SwFmtFtn&>(pAttr->GetAttr()).InvalidateFootnote(); break; @@ -1180,7 +1180,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) break; case RES_DDEFLD: if (GetNodes().IsDocNodes() && pTxtFld->GetpTxtNode()) - ((SwDDEFieldType*)pFld->GetTyp())->DecRefCnt(); + static_cast<SwDDEFieldType*>(pFld->GetTyp())->DecRefCnt(); break; case RES_POSTITFLD: { @@ -1275,7 +1275,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) { case RES_TXTATR_FLYCNT: { - SwTxtFlyCnt *pFly = (SwTxtFlyCnt *)pAttr; + SwTxtFlyCnt *pFly = static_cast<SwTxtFlyCnt *>(pAttr); SwFrmFmt* pFmt = pAttr->GetFlyCnt().GetFrmFmt(); if( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nInsMode) ) { @@ -1388,10 +1388,10 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) } // wird eine neue Fussnote eingefuegt ?? - bool bNewFtn = 0 == ((SwTxtFtn*)pAttr)->GetStartNode(); + bool bNewFtn = 0 == static_cast<SwTxtFtn*>(pAttr)->GetStartNode(); if( bNewFtn ) { - ((SwTxtFtn*)pAttr)->MakeNewTextSection( GetNodes() ); + static_cast<SwTxtFtn*>(pAttr)->MakeNewTextSection( GetNodes() ); SwRegHistory* pHist = GetpSwpHints() ? GetpSwpHints()->GetHistory() : 0; if( pHist ) @@ -1401,7 +1401,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) { // loesche alle Frames der Section, auf die der StartNode zeigt sal_uLong nSttIdx = - ((SwTxtFtn*)pAttr)->GetStartNode()->GetIndex(); + static_cast<SwTxtFtn*>(pAttr)->GetStartNode()->GetIndex(); sal_uLong nEndIdx = rNodes[ nSttIdx++ ]->EndOfSectionIndex(); SwCntntNode* pCNd; for( ; nSttIdx < nEndIdx; ++nSttIdx ) @@ -1443,11 +1443,11 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // der Index noch gar nicht in der Verwaltung stehen !! } if( !pTxtFtn ) - pTxtFtn = (SwTxtFtn*)pAttr; + pTxtFtn = static_cast<SwTxtFtn*>(pAttr); // fuers Update der Nummern und zum Sortieren // muss der Node gesetzt sein. - ((SwTxtFtn*)pAttr)->ChgTxtNode( this ); + static_cast<SwTxtFtn*>(pAttr)->ChgTxtNode( this ); // FussNote im Redline-Bereich NICHT ins FtnArray einfuegen! if( StartOfSectionIndex() > rNodes.GetEndOfRedlines().GetIndex() ) @@ -1458,7 +1458,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) } SwNodeIndex aTmpIndex( *this ); pDoc->GetFtnIdxs().UpdateFtn( aTmpIndex); - ((SwTxtFtn*)pAttr)->SetSeqRefNo(); + static_cast<SwTxtFtn*>(pAttr)->SetSeqRefNo(); } break; @@ -2211,7 +2211,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, if( nAttrStart > nStt ) { rSet.InvalidateItem( nHintWhich ); - pPrev->mpItem = (SfxPoolItem*)-1; + pPrev->mpItem = reinterpret_cast<SfxPoolItem*>(-1); } else { @@ -2220,7 +2220,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, } } } - else if( (SfxPoolItem*)-1 != pPrev->mpItem ) + else if( reinterpret_cast<SfxPoolItem*>(-1) != pPrev->mpItem ) { if( pPrev->mnEndPos == nAttrStart && *pPrev->mpItem == *pItem ) @@ -2231,7 +2231,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, else { rSet.InvalidateItem( nHintWhich ); - pPrev->mpItem = (SfxPoolItem*)-1; + pPrev->mpItem = reinterpret_cast<SfxPoolItem*>(-1); } } } @@ -2247,7 +2247,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, for (size_t n = 0; n < coArrSz; ++n) { const SwPoolItemEndPair& rItemPair = (*pAttrArr)[ n ]; - if( (0 != rItemPair.mpItem) && ((SfxPoolItem*)-1 != rItemPair.mpItem) ) + if( (0 != rItemPair.mpItem) && (reinterpret_cast<SfxPoolItem*>(-1) != rItemPair.mpItem) ) { const sal_uInt16 nWh = static_cast<sal_uInt16>(n + RES_CHRATR_BEGIN); @@ -2619,7 +2619,7 @@ bool SwpHints::CalcHiddenParaField() const SwFmtFld& rFld = pTxtHt->GetFmtFld(); if( RES_HIDDENPARAFLD == rFld.GetField()->GetTyp()->Which() ) { - if( !((SwHiddenParaField*)rFld.GetField())->IsHidden() ) + if( !static_cast<const SwHiddenParaField*>(rFld.GetField())->IsHidden() ) { SetHiddenParaField(false); return bOldHasHiddenParaField != bNewHasHiddenParaField; @@ -3049,7 +3049,7 @@ bool SwpHints::TryInsertHint( break; case RES_DDEFLD: if( rNode.GetNodes().IsDocNodes() ) - ((SwDDEFieldType*)pFld->GetTyp())->IncRefCnt(); + static_cast<SwDDEFieldType*>(pFld->GetTyp())->IncRefCnt(); break; } } @@ -3061,30 +3061,30 @@ bool SwpHints::TryInsertHint( switch( pFld->GetTyp()->Which() ) { case RES_SETEXPFLD: - bInsFldType = ((SwSetExpFieldType*)pFld->GetTyp())->IsDeleted(); - if( nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType*)pFld->GetTyp())->GetType() ) + bInsFldType = static_cast<SwSetExpFieldType*>(pFld->GetTyp())->IsDeleted(); + if( nsSwGetSetExpType::GSE_SEQ & static_cast<SwSetExpFieldType*>(pFld->GetTyp())->GetType() ) { // bevor die ReferenzNummer gesetzt wird, sollte // das Feld am richtigen FeldTypen haengen! - SwSetExpFieldType* pFldType = (SwSetExpFieldType*) - pDoc->getIDocumentFieldsAccess().InsertFldType( *pFld->GetTyp() ); + SwSetExpFieldType* pFldType = static_cast<SwSetExpFieldType*>( + pDoc->getIDocumentFieldsAccess().InsertFldType( *pFld->GetTyp() ) ); if( pFldType != pFld->GetTyp() ) { SwFmtFld* pFmtFld = const_cast<SwFmtFld*>(&pTxtFld->GetFmtFld()); pFmtFld->RegisterToFieldType( *pFldType ); pFmtFld->GetField()->ChgTyp( pFldType ); } - pFldType->SetSeqRefNo( *(SwSetExpField*)pFld ); + pFldType->SetSeqRefNo( *const_cast<SwSetExpField*>(static_cast<const SwSetExpField*>(pFld)) ); } break; case RES_USERFLD: - bInsFldType = ((SwUserFieldType*)pFld->GetTyp())->IsDeleted(); + bInsFldType = static_cast<SwUserFieldType*>(pFld->GetTyp())->IsDeleted(); break; case RES_DDEFLD: if( pDoc->getIDocumentFieldsAccess().IsNewFldLst() ) - ((SwDDEFieldType*)pFld->GetTyp())->IncRefCnt(); - bInsFldType = ((SwDDEFieldType*)pFld->GetTyp())->IsDeleted(); + static_cast<SwDDEFieldType*>(pFld->GetTyp())->IncRefCnt(); + bInsFldType = static_cast<SwDDEFieldType*>(pFld->GetTyp())->IsDeleted(); break; case RES_POSTITFLD: @@ -3101,7 +3101,7 @@ bool SwpHints::TryInsertHint( } break; case RES_TXTATR_FTN : - ((SwTxtFtn*)pHint)->ChgTxtNode( &rNode ); + static_cast<SwTxtFtn*>(pHint)->ChgTxtNode( &rNode ); break; case RES_TXTATR_REFMARK: static_txtattr_cast<SwTxtRefMark*>(pHint)->ChgTxtNode( &rNode ); @@ -3303,7 +3303,7 @@ void SwpHints::DeleteAtPos( const size_t nPos ) { const SwTxtNode* pNd = pTxtFld->GetpTxtNode(); if( pNd && pNd->GetNodes().IsDocNodes() ) - ((SwDDEFieldType*)pFldTyp)->DecRefCnt(); + const_cast<SwDDEFieldType*>(static_cast<const SwDDEFieldType*>(pFldTyp))->DecRefCnt(); pTxtFld->ChgTxtNode(0); } else if ( m_bHasHiddenParaField && @@ -3420,7 +3420,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, continue; } const SfxPoolItem* pItem = CharFmt::GetItem( *pHt, nWhichId ); - const sal_uInt16 nLng = ((SvxLanguageItem*)pItem)->GetLanguage(); + const sal_uInt16 nLng = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage(); // Umfasst das Attribut den Bereich komplett? if( nAttrStart <= nBegin && nEnd <= *pEndIdx ) @@ -3432,7 +3432,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, } if( LANGUAGE_DONTKNOW == nRet ) { - nRet = ((SvxLanguageItem&)GetSwAttrSet().Get( nWhichId )).GetLanguage(); + nRet = static_cast<const SvxLanguageItem&>(GetSwAttrSet().Get( nWhichId )).GetLanguage(); if( LANGUAGE_DONTKNOW == nRet ) nRet = static_cast<sal_uInt16>(GetAppLanguage()); } diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 2e0e57389576..a04fdffbd3f8 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1074,7 +1074,7 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM, OSL_ENSURE( pFont, "target font missing?" ); if (pFont) { - SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( nFontWhichId ); + SvxFontItem aFontItem = static_cast<const SvxFontItem&>( aSet.Get( nFontWhichId ) ); aFontItem.SetFamilyName( pFont->GetName()); aFontItem.SetFamily( pFont->GetFamily()); aFontItem.SetStyleName( pFont->GetStyleName()); @@ -1599,7 +1599,7 @@ bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf ) if( pLinguNode != this ) { pLinguNode = this; - pLinguFrm = (SwTxtFrm*)getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), (Point*)(rHyphInf.GetCrsrPos()) ); + pLinguFrm = static_cast<SwTxtFrm*>(getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), (Point*)(rHyphInf.GetCrsrPos()) )); } SwTxtFrm *pFrm = pLinguFrm; if( pFrm ) diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx index 626f1a5cc23f..55e9953b87bf 100644 --- a/sw/source/core/undo/SwUndoFmt.cxx +++ b/sw/source/core/undo/SwUndoFmt.cxx @@ -198,12 +198,12 @@ SwUndoTxtFmtCollCreate::SwUndoTxtFmtCollCreate SwFmt * SwUndoTxtFmtCollCreate::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeTxtFmtColl(sNewName, (SwTxtFmtColl *)pDerivedFrom, true); + return pDoc->MakeTxtFmtColl(sNewName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); } void SwUndoTxtFmtCollCreate::Delete() { - pDoc->DelTxtFmtColl((SwTxtFmtColl *) pNew, true); + pDoc->DelTxtFmtColl(static_cast<SwTxtFmtColl *>(pNew), true); } SwFmt * SwUndoTxtFmtCollCreate::Find(const OUString & rName) const @@ -219,12 +219,12 @@ SwUndoTxtFmtCollDelete::SwUndoTxtFmtCollDelete(SwTxtFmtColl * _pOld, SwFmt * SwUndoTxtFmtCollDelete::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeTxtFmtColl(sOldName, (SwTxtFmtColl *) pDerivedFrom, true); + return pDoc->MakeTxtFmtColl(sOldName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); } void SwUndoTxtFmtCollDelete::Delete(SwFmt * pOld) { - pDoc->DelTxtFmtColl((SwTxtFmtColl *) pOld, true); + pDoc->DelTxtFmtColl(static_cast<SwTxtFmtColl *>(pOld), true); } SwFmt * SwUndoTxtFmtCollDelete::Find(const OUString & rName) const @@ -240,7 +240,7 @@ SwUndoCondTxtFmtCollCreate::SwUndoCondTxtFmtCollCreate(SwConditionTxtFmtColl *_p SwFmt * SwUndoCondTxtFmtCollCreate::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeCondTxtFmtColl(sNewName, (SwTxtFmtColl *)pDerivedFrom, true); + return pDoc->MakeCondTxtFmtColl(sNewName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); } SwUndoCondTxtFmtCollDelete::SwUndoCondTxtFmtCollDelete(SwTxtFmtColl * _pOld, @@ -251,7 +251,7 @@ SwUndoCondTxtFmtCollDelete::SwUndoCondTxtFmtCollDelete(SwTxtFmtColl * _pOld, SwFmt * SwUndoCondTxtFmtCollDelete::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeCondTxtFmtColl(sOldName, (SwTxtFmtColl *) pDerivedFrom, true); + return pDoc->MakeCondTxtFmtColl(sOldName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); } SwUndoRenameFmtColl::SwUndoRenameFmtColl(const OUString & sInitOldName, @@ -275,12 +275,12 @@ SwUndoCharFmtCreate::SwUndoCharFmtCreate(SwCharFmt * pNewFmt, SwFmt * SwUndoCharFmtCreate::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeCharFmt(sNewName, (SwCharFmt *) pDerivedFrom, true); + return pDoc->MakeCharFmt(sNewName, static_cast<SwCharFmt *>(pDerivedFrom), true); } void SwUndoCharFmtCreate::Delete() { - pDoc->DelCharFmt((SwCharFmt *) pNew, true); + pDoc->DelCharFmt(static_cast<SwCharFmt *>(pNew), true); } SwFmt * SwUndoCharFmtCreate::Find(const OUString & rName) const @@ -295,12 +295,12 @@ SwUndoCharFmtDelete::SwUndoCharFmtDelete(SwCharFmt * pOld, SwDoc * pDocument) SwFmt * SwUndoCharFmtDelete::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeCharFmt(sOldName, (SwCharFmt *) pDerivedFrom, true); + return pDoc->MakeCharFmt(sOldName, static_cast<SwCharFmt *>(pDerivedFrom), true); } void SwUndoCharFmtDelete::Delete(SwFmt * pFmt) { - pDoc->DelCharFmt((SwCharFmt *) pFmt, true); + pDoc->DelCharFmt(static_cast<SwCharFmt *>(pFmt), true); } SwFmt * SwUndoCharFmtDelete::Find(const OUString & rName) const @@ -330,12 +330,12 @@ SwUndoFrmFmtCreate::SwUndoFrmFmtCreate(SwFrmFmt * pNewFmt, SwFmt * SwUndoFrmFmtCreate::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeFrmFmt(sNewName, (SwFrmFmt *) pDerivedFrom, true, bAuto); + return pDoc->MakeFrmFmt(sNewName, static_cast<SwFrmFmt *>(pDerivedFrom), true, bAuto); } void SwUndoFrmFmtCreate::Delete() { - pDoc->DelFrmFmt((SwFrmFmt *) pNew, true); + pDoc->DelFrmFmt(static_cast<SwFrmFmt *>(pNew), true); } SwFmt * SwUndoFrmFmtCreate::Find(const OUString & rName) const @@ -350,12 +350,12 @@ SwUndoFrmFmtDelete::SwUndoFrmFmtDelete(SwFrmFmt * pOld, SwDoc * pDocument) SwFmt * SwUndoFrmFmtDelete::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeFrmFmt(sOldName, (SwFrmFmt *) pDerivedFrom, true); + return pDoc->MakeFrmFmt(sOldName, static_cast<SwFrmFmt *>(pDerivedFrom), true); } void SwUndoFrmFmtDelete::Delete(SwFmt * pFmt) { - pDoc->DelFrmFmt((SwFrmFmt *) pFmt, true); + pDoc->DelFrmFmt(static_cast<SwFrmFmt *>(pFmt), true); } SwFmt * SwUndoFrmFmtDelete::Find(const OUString & rName) const diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx index 5d78c9e36e35..00dc9a3f70ab 100644 --- a/sw/source/core/undo/SwUndoPageDesc.cxx +++ b/sw/source/core/undo/SwUndoPageDesc.cxx @@ -107,8 +107,8 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, OSL_ENSURE(0 != pDoc, "no document?"); #if OSL_DEBUG_LEVEL > 1 - DebugHeaderFooterContent( (SwPageDesc&)aOld ); - DebugHeaderFooterContent( (SwPageDesc&)aNew ); + DebugHeaderFooterContent( aOld.aPageDesc ); + DebugHeaderFooterContent( aNew.aPageDesc ); #endif /* @@ -118,8 +118,8 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, But this happens, this Undo Ctor will destroy the unnecessary duplicate and manipulate the content pointer of the both page descriptions. */ - SwPageDesc &rOldDesc = (SwPageDesc&)aOld; - SwPageDesc &rNewDesc = (SwPageDesc&)aNew; + SwPageDesc &rOldDesc = aOld.aPageDesc; + SwPageDesc &rNewDesc = aNew.aPageDesc; const SwFmtHeader& rOldHead = rOldDesc.GetMaster().GetHeader(); const SwFmtHeader& rNewHead = rNewDesc.GetMaster().GetHeader(); const SwFmtFooter& rOldFoot = rOldDesc.GetMaster().GetFooter(); @@ -182,10 +182,10 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, // After this exchange method the old page description will point to zero, // the new one will point to the node position of the original content nodes. - ExchangeContentNodes( (SwPageDesc&)aOld, (SwPageDesc&)aNew ); + ExchangeContentNodes( aOld.aPageDesc, aNew.aPageDesc ); #if OSL_DEBUG_LEVEL > 1 - DebugHeaderFooterContent( (SwPageDesc&)aOld ); - DebugHeaderFooterContent( (SwPageDesc&)aNew ); + DebugHeaderFooterContent( aOld.aPageDesc ); + DebugHeaderFooterContent( aNew.aPageDesc ); #endif } } @@ -340,7 +340,7 @@ void SwUndoPageDesc::UndoImpl(::sw::UndoRedoContext &) { // Move (header/footer)content node responsibility from new page descriptor to old one again. if( bExchange ) - ExchangeContentNodes( (SwPageDesc&)aNew, (SwPageDesc&)aOld ); + ExchangeContentNodes( aNew.aPageDesc, aOld.aPageDesc ); pDoc->ChgPageDesc(aOld.GetName(), aOld); } @@ -348,7 +348,7 @@ void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &) { // Move (header/footer)content node responsibility from old page descriptor to new one again. if( bExchange ) - ExchangeContentNodes( (SwPageDesc&)aOld, (SwPageDesc&)aNew ); + ExchangeContentNodes( aOld.aPageDesc, aNew.aPageDesc ); pDoc->ChgPageDesc(aNew.GetName(), aNew); } diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 497d48bc070b..f1b886ded356 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -471,7 +471,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId())) { - aPos.nContent.Assign( (SwTxtNode*)pNd, rAnchor.GetPageNum() ); + aPos.nContent.Assign( static_cast<SwTxtNode*>(pNd), rAnchor.GetPageNum() ); if ( aPos.nContent.GetIndex() > pNd->GetTxtNode()->GetTxt().getLength()) { // #i35443# - invalid position. @@ -515,7 +515,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) // To prevent that, first detach the connection between attribute and // format. const SwPosition *pPos = rOldAnch.GetCntntAnchor(); - SwTxtNode *pTxtNode = (SwTxtNode*)&pPos->nNode.GetNode(); + SwTxtNode *pTxtNode = static_cast<SwTxtNode*>(&pPos->nNode.GetNode()); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 4cac9fc0dff5..44669e503079 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -58,7 +58,7 @@ static void lcl_MakeAutoFrms( const SwFrmFmts& rSpzArr, sal_uLong nMovedIndex ) const SwFmtAnchor* pAnchor; for( size_t n = 0; n < rSpzArr.size(); ++n ) { - pFmt = (SwFlyFrmFmt*)rSpzArr[n]; + pFmt = static_cast<SwFlyFrmFmt*>(rSpzArr[n]); pAnchor = &pFmt->GetAnchor(); if (pAnchor->GetAnchorId() == FLY_AT_CHAR) { @@ -722,7 +722,7 @@ static void lcl_ReAnchorAtCntntFlyFrames( const SwFrmFmts& rSpzArr, SwPosition & const SwPosition* pAPos; for( size_t n = 0; n < rSpzArr.size(); ++n ) { - pFmt = (SwFlyFrmFmt*)rSpzArr[n]; + pFmt = static_cast<SwFlyFrmFmt*>(rSpzArr[n]); pAnchor = &pFmt->GetAnchor(); if (pAnchor->GetAnchorId() == FLY_AT_PARA) { @@ -765,7 +765,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) else { if( pInsNd->IsCntntNode() ) - aPos.nContent.Assign( (SwCntntNode*)pInsNd, nSttCntnt ); + aPos.nContent.Assign( static_cast<SwCntntNode*>(pInsNd), nSttCntnt ); if( !bTblDelLastNd ) pInsNd = 0; // do not delete Node! } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 5e1bb0b618b9..e0dd5b727af6 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -491,7 +491,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, // Unfortunately an index needs to be created. Otherwise there // will be problems with TextNode because the index will be // deleted in the DTOR of SwFtn! - SwTxtNode* pTxtNd = (SwTxtNode*)pFtnNd; + SwTxtNode* pTxtNd = const_cast<SwTxtNode*>(static_cast<const SwTxtNode*>(pFtnNd)); if( !pHistory ) pHistory = new SwHistory; SwTxtAttr* const pFtnHnt = @@ -516,7 +516,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, // Unfortunately an index needs to be created. Otherwise there // will be problems with TextNode because the index will be // deleted in the DTOR of SwFtn! - SwTxtNode* pTxtNd = (SwTxtNode*)pFtnNd; + SwTxtNode* pTxtNd = const_cast<SwTxtNode*>(static_cast<const SwTxtNode*>(pFtnNd)); if( !pHistory ) pHistory = new SwHistory; SwTxtAttr* const pFtnHnt = diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index e3eaed054ee2..2c5485d776c4 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -456,7 +456,7 @@ void SwUndoDelLayFmt::RedoForRollback() SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt ) : SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ), - pOldFmt( (SwFrmFmt*)rFlyFmt.DerivedFrom() ), pNewFmt( &rNewFrmFmt ), + pOldFmt( static_cast<SwFrmFmt*>(rFlyFmt.DerivedFrom()) ), pNewFmt( &rNewFrmFmt ), pItemSet( new SfxItemSet( *rFlyFmt.GetAttrSet().GetPool(), rFlyFmt.GetAttrSet().GetRanges() )), nOldNode( 0 ), nNewNode( 0 ), @@ -640,7 +640,7 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) bAnchorChgd = true; - const SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem; + const SwFmtAnchor* pAnchor = static_cast<const SwFmtAnchor*>(pItem); switch( nOldAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) ) { case FLY_AS_CHAR: diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 6accc6aeb8b0..1a94cecbda8f 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -211,7 +211,7 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &) // save group object SwDrawFrmFmt* pFmt = pObjArr->pFmt; - SwDrawContact* pDrawContact = (SwDrawContact*)pFmt->FindContactObj(); + SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(pFmt->FindContactObj()); SdrObject* pObj = pDrawContact->GetMaster(); pObjArr->pObj = pObj; @@ -267,7 +267,7 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &) pObj = rSave.pObj; - SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); + SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); @@ -326,8 +326,8 @@ SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj ) nSize = (sal_uInt16)pObj->GetSubList()->GetObjCount() + 1; pObjArr = new SwUndoGroupObjImpl[ nSize ]; - SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); - SwDrawFrmFmt* pFmt = (SwDrawFrmFmt*)pContact->GetFmt(); + SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); + SwDrawFrmFmt* pFmt = static_cast<SwDrawFrmFmt*>(pContact->GetFmt()); pObjArr->pObj = pObj; pObjArr->pFmt = pFmt; @@ -403,7 +403,7 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &) // save group object SwDrawFrmFmt* pFmt = pObjArr->pFmt; - SwDrawContact* pContact = (SwDrawContact*)pFmt->FindContactObj(); + SwDrawContact* pContact = static_cast<SwDrawContact*>(pFmt->FindContactObj()); // object will destroy itself pContact->Changed( *pObjArr->pObj, SDRUSERCALL_DELETE, @@ -546,8 +546,8 @@ void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); SdrObject *pObj = rSave.pObj; - SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj); - SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt(); + SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); + SwDrawFrmFmt *pFmt = static_cast<SwDrawFrmFmt*>(pContact->GetFmt()); // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx index 21b7b1dabc33..dd73605fa8fe 100644 --- a/sw/source/core/undo/unfmco.cxx +++ b/sw/source/core/undo/unfmco.cxx @@ -73,11 +73,11 @@ void SwUndoFmtColl::DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM) // Only one TextFrmColl can be applied to a section, thus request only in // this array. sal_uInt16 const nPos = rDoc.GetTxtFmtColls()->GetPos( - (SwTxtFmtColl*)pFmtColl ); + static_cast<SwTxtFmtColl*>(pFmtColl) ); // does the format still exist? if( USHRT_MAX != nPos ) { - rDoc.SetTxtFmtColl(rPaM, (SwTxtFmtColl*)pFmtColl, mbReset, + rDoc.SetTxtFmtColl(rPaM, static_cast<SwTxtFmtColl*>(pFmtColl), mbReset, mbResetListAttrs); } } diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index d07fdca060ac..a156a4a9b614 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -414,7 +414,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) break; case ND_GRFNODE: { - SwGrfNode* pGrfNd = (SwGrfNode*)pCNd; + SwGrfNode* pGrfNd = static_cast<SwGrfNode*>(pCNd); OUString sFile; OUString sFilter; if( pGrfNd->IsGrfLink() ) @@ -902,7 +902,7 @@ void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext) SwFrmFmt* pFmt; SdrObject *pSdrObj = 0; if( OBJECT.pUndoAttr && - 0 != (pFmt = (SwFrmFmt*)OBJECT.pUndoAttr->GetFmt( rDoc )) && + 0 != (pFmt = static_cast<SwFrmFmt*>(OBJECT.pUndoAttr->GetFmt( rDoc ))) && ( LTYPE_DRAW != eType || 0 != (pSdrObj = pFmt->FindSdrObject()) ) ) { @@ -941,7 +941,7 @@ void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext) SwFrmFmt* pFmt; SdrObject *pSdrObj = 0; if( OBJECT.pUndoAttr && - 0 != (pFmt = (SwFrmFmt*)OBJECT.pUndoAttr->GetFmt( rDoc )) && + 0 != (pFmt = static_cast<SwFrmFmt*>(OBJECT.pUndoAttr->GetFmt( rDoc ))) && ( LTYPE_DRAW != eType || 0 != (pSdrObj = pFmt->FindSdrObject()) ) ) { diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx index e02e87a9d697..3e983fffbce1 100644 --- a/sw/source/core/undo/unspnd.cxx +++ b/sw/source/core/undo/unspnd.cxx @@ -100,7 +100,7 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext) // than delete it again SwNodeIndex aDelNd( *pTblNd, -1 ); - rPam.GetPoint()->nContent.Assign( (SwCntntNode*)pCurrNd, 0 ); + rPam.GetPoint()->nContent.Assign( static_cast<SwCntntNode*>(pCurrNd), 0 ); RemoveIdxRel( aDelNd.GetIndex(), *rPam.GetPoint() ); pDoc->GetNodes().Delete( aDelNd ); } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index aafa683e289b..32e1311d9345 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -287,8 +287,8 @@ void SwUndoInsTbl::UndoImpl(::sw::UndoRedoContext & rContext) sTblNm = pTblNd->GetTable().GetFrmFmt()->GetName(); if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) ) - pDDEFldType = (SwDDEFieldType*)((SwDDETable&)pTblNd->GetTable()). - GetDDEFldType()->Copy(); + pDDEFldType = static_cast<SwDDEFieldType*>(static_cast<SwDDETable&>(pTblNd->GetTable()). + GetDDEFldType()->Copy()); rDoc.GetNodes().Delete( aIdx, pTblNd->EndOfSectionIndex() - aIdx.GetIndex() + 1 ); @@ -312,8 +312,8 @@ void SwUndoInsTbl::RedoImpl(::sw::UndoRedoContext & rContext) if( pDDEFldType ) { - SwDDEFieldType* pNewType = (SwDDEFieldType*)rDoc.getIDocumentFieldsAccess().InsertFldType( - *pDDEFldType); + SwDDEFieldType* pNewType = static_cast<SwDDEFieldType*>(rDoc.getIDocumentFieldsAccess().InsertFldType( + *pDDEFldType)); SwDDETable* pDDETbl = new SwDDETable( pTblNode->GetTable(), pNewType ); pTblNode->SetNewTable( pDDETbl ); delete pDDEFldType, pDDEFldType = 0; @@ -408,7 +408,7 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh ) pBoxSaves = new SwTblToTxtSaves( (SwTblToTxtSaves::size_type)rTbl.GetTabSortBoxes().size() ); if( rTbl.IsA( TYPE( SwDDETable ) ) ) - pDDEFldType = (SwDDEFieldType*)((SwDDETable&)rTbl).GetDDEFldType()->Copy(); + pDDEFldType = static_cast<SwDDEFieldType*>(static_cast<const SwDDETable&>(rTbl).GetDDEFldType()->Copy()); bCheckNumFmt = rTbl.GetFrmFmt()->GetDoc()->IsInsTblFormatNum(); @@ -473,8 +473,8 @@ void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext) if( pDDEFldType ) { - SwDDEFieldType* pNewType = (SwDDEFieldType*)rDoc.getIDocumentFieldsAccess().InsertFldType( - *pDDEFldType); + SwDDEFieldType* pNewType = static_cast<SwDDEFieldType*>(rDoc.getIDocumentFieldsAccess().InsertFldType( + *pDDEFldType)); SwDDETable* pDDETbl = new SwDDETable( pTblNd->GetTable(), pNewType ); pTblNd->SetNewTable( pDDETbl, false ); delete pDDEFldType, pDDEFldType = 0; @@ -531,7 +531,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd, for( n = pTblNd->GetIndex() + 1; n < nTmpEnd; ++n ) { if( ( pNd = (*this)[ n ] )->IsCntntNode() ) - ((SwCntntNode*)pNd)->DelFrms(); + static_cast<SwCntntNode*>(pNd)->DelFrms(); pNd->pStartOfSection = pTblNd; } } @@ -636,8 +636,8 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext) OSL_ENSURE( pTblNd, "Could not find any TableNode" ); if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) ) - pDDEFldType = (SwDDEFieldType*)((SwDDETable&)pTblNd->GetTable()). - GetDDEFldType()->Copy(); + pDDEFldType = static_cast<SwDDEFieldType*>(static_cast<SwDDETable&>(pTblNd->GetTable()). + GetDDEFldType()->Copy()); rDoc.TableToText( pTblNd, cTrenner ); @@ -909,9 +909,10 @@ sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine ) { SwTableFmlUpdate aMsgHnt( pSwTable ); aMsgHnt.eFlags = TBL_BOXNAME; - ((SwTblBoxFormula*)pItem)->ChgDefinedIn( pFmt ); - ((SwTblBoxFormula*)pItem)->ChangeState( &aMsgHnt ); - ((SwTblBoxFormula*)pItem)->ChgDefinedIn( 0 ); + SwTblBoxFormula* pFormulaItem = const_cast<SwTblBoxFormula*>(static_cast<const SwTblBoxFormula*>(pItem)); + pFormulaItem->ChgDefinedIn( pFmt ); + pFormulaItem->ChangeState( &aMsgHnt ); + pFormulaItem->ChgDefinedIn( 0 ); } } nRet = aSets.size(); @@ -995,7 +996,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, } // SwTableBox must have a format - SwTableBox aParent( (SwTableBoxFmt*)pFmt, rTbl.GetTabLines().size(), 0 ); + SwTableBox aParent( static_cast<SwTableBoxFmt*>(pFmt), rTbl.GetTabLines().size(), 0 ); // fill FrmFmts with defaults (0) pFmt = 0; @@ -1099,16 +1100,16 @@ void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx, SwIterator<SwTabFrm,SwFmt> aIter( *pOldFmt ); for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( pTblLn ? ((SwRowFrm*)pLast)->GetTabLine() == pTblLn - : ((SwCellFrm*)pLast)->GetTabBox() == pTblBx ) + if( pTblLn ? static_cast<SwRowFrm*>(pLast)->GetTabLine() == pTblLn + : static_cast<SwCellFrm*>(pLast)->GetTabBox() == pTblBx ) { pLast->RegisterToFormat(*pFmt); pLast->InvalidateAll(); pLast->ReinitializeFrmSizeAttrFlags(); if ( !pTblLn ) { - ((SwCellFrm*)pLast)->SetDerivedVert( false ); - ((SwCellFrm*)pLast)->CheckDirChange(); + static_cast<SwCellFrm*>(pLast)->SetDerivedVert( false ); + static_cast<SwCellFrm*>(pLast)->CheckDirChange(); } } } @@ -1176,7 +1177,7 @@ void _SaveLine::SaveCntntAttrs( SwDoc* pDoc ) void _SaveLine::CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl ) { - SwTableLineFmt* pFmt = (SwTableLineFmt*)rSTbl.aFrmFmts[ nItemSet ]; + SwTableLineFmt* pFmt = static_cast<SwTableLineFmt*>(rSTbl.aFrmFmts[ nItemSet ]); if( !pFmt ) { SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc(); @@ -1330,7 +1331,7 @@ void _SaveBox::SaveCntntAttrs( SwDoc* pDoc ) void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl ) { - SwTableBoxFmt* pFmt = (SwTableBoxFmt*)rSTbl.aFrmFmts[ nItemSet ]; + SwTableBoxFmt* pFmt = static_cast<SwTableBoxFmt*>(rSTbl.aFrmFmts[ nItemSet ]); if( !pFmt ) { SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc(); @@ -1711,7 +1712,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode ); if( pSave->GetHistory() ) pSave->GetHistory()->Rollback( &rDoc ); - SwTableBox* pBox = new SwTableBox( (SwTableBoxFmt*)pCpyBox->GetFrmFmt(), aIdx, + SwTableBox* pBox = new SwTableBox( static_cast<SwTableBoxFmt*>(pCpyBox->GetFrmFmt()), aIdx, pCpyBox->GetUpper() ); rLnBoxes.push_back( pBox ); } @@ -1978,7 +1979,7 @@ CHECKTABLE(pTblNd->GetTable()) aIdx = *it; SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode, pColl ); - pBox = new SwTableBox( (SwTableBoxFmt*)pCpyBox->GetFrmFmt(), *pSttNd, + pBox = new SwTableBox( static_cast<SwTableBoxFmt*>(pCpyBox->GetFrmFmt()), *pSttNd, pCpyBox->GetUpper() ); rLnBoxes.push_back( pBox ); @@ -2191,19 +2192,19 @@ SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox, false, &pItem )) { bNewFmt = true; - nNewFmtIdx = ((SwTblBoxNumFormat*)pItem)->GetValue(); + nNewFmtIdx = static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue(); } if( SfxItemState::SET == pNewSet->GetItemState( RES_BOXATR_FORMULA, false, &pItem )) { bNewFml = true; - aNewFml = ((SwTblBoxFormula*)pItem)->GetFormula(); + aNewFml = static_cast<const SwTblBoxFormula*>(pItem)->GetFormula(); } if( SfxItemState::SET == pNewSet->GetItemState( RES_BOXATR_VALUE, false, &pItem )) { bNewValue = true; - fNewNum = ((SwTblBoxValue*)pItem)->GetValue(); + fNewNum = static_cast<const SwTblBoxValue*>(pItem)->GetValue(); } } @@ -2398,7 +2399,7 @@ void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext) if( !pNd->IsCntntNode() ) pNd = rDoc.GetNodes().GoNext( &pPam->GetPoint()->nNode ); - pPam->GetPoint()->nContent.Assign( (SwCntntNode*)pNd, 0 ); + pPam->GetPoint()->nContent.Assign( static_cast<SwCntntNode*>(pNd), 0 ); } void SwUndoTblNumFmt::SetBox( const SwTableBox& rBox ) diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index eb8a2b2f97b3..52611e56626b 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -230,7 +230,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) pTxtNode->ResetAllAttr(); if( USHRT_MAX != pDoc->GetTxtFmtColls()->GetPos( pTxtFmtColl )) - pTxtFmtColl = (SwTxtFmtColl*)pTxtNode->ChgFmtColl( pTxtFmtColl ); + pTxtFmtColl = static_cast<SwTxtFmtColl*>(pTxtNode->ChgFmtColl( pTxtFmtColl )) ; pHistory->SetTmpEnd( nSetPos ); pHistory->TmpRollback( pDoc, 0, false ); diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index b1eb6ac93abb..b43ef0172b62 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -88,7 +88,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, OUString sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true ); SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR); + static_cast<SwDocStyleSheet*>(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); SwFmtDrop* pDrop = 0; SwFmtCharFmt *pCharFmt = 0; if(pStyle) @@ -96,13 +96,13 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pStyle ) ); if (RES_PARATR_DROP == pMap->nWID) { - pDrop = (SwFmtDrop*)rItem.Clone(); // because rItem is const... + pDrop = static_cast<SwFmtDrop*>(rItem.Clone()); // because rItem is const... pDrop->SetCharFmt(xStyle->GetCharFmt()); m_pDoc->SetDefault(*pDrop); } else // RES_TXTATR_CHARFMT == pMap->nWID { - pCharFmt = (SwFmtCharFmt*)rItem.Clone(); // because rItem is const... + pCharFmt = static_cast<SwFmtCharFmt*>(rItem.Clone()); // because rItem is const... pCharFmt->SetCharFmt(xStyle->GetCharFmt()); m_pDoc->SetDefault(*pCharFmt); } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index e9ecf7590a1c..6e3154ee7a93 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -821,8 +821,8 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) ) { const SvxFontListItem* pFontListItem = - (const SvxFontListItem* )pDoc->GetDocShell() - ->GetItem( SID_ATTR_CHAR_FONTLIST ); + static_cast<const SvxFontListItem* >(pDoc->GetDocShell() + ->GetItem( SID_ATTR_CHAR_FONTLIST )); const FontList* pList = pFontListItem->GetFontList(); vcl::FontInfo aInfo = pList->Get( diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index aca3920b78aa..0482df5324b0 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -307,7 +307,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) uno::Reference< drawing::XShape > xRet; if(pObj->ISA(SwVirtFlyDrawObj) || pObj->GetObjInventor() == SWGInventor) { - SwFlyDrawContact* pFlyContact = (SwFlyDrawContact*)pObj->GetUserCall(); + SwFlyDrawContact* pFlyContact = static_cast<SwFlyDrawContact*>(pObj->GetUserCall()); if(pFlyContact) { SwFrmFmt* pFlyFmt = pFlyContact->GetFmt(); @@ -1124,7 +1124,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); aItemSet.SetParent(&pFmt->GetAttrSet()); - SwFmtAnchor aAnchor = (const SwFmtAnchor&)aItemSet.Get(pEntry->nWID); + SwFmtAnchor aAnchor = static_cast<const SwFmtAnchor&>(aItemSet.Get(pEntry->nWID)); SwPosition aPos(*pFrame->GetFrmFmt()->GetCntnt().GetCntntIdx()); aAnchor.SetAnchor(&aPos); aAnchor.SetType(FLY_AT_FLY); diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx index 06bc09796e64..97b62ecf1ed4 100644 --- a/sw/source/core/unocore/unoevent.cxx +++ b/sw/source/core/unocore/unoevent.cxx @@ -197,7 +197,7 @@ void SwFrameEventDescriptor::setMacroItem(const SvxMacroItem& rItem) const SvxMacroItem& SwFrameEventDescriptor::getMacroItem() { - return (const SvxMacroItem&)rFrame.GetFrmFmt()->GetFmtAttr(RES_FRMMACRO); + return static_cast<const SvxMacroItem&>(rFrame.GetFrmFmt()->GetFmtAttr(RES_FRMMACRO)); } sal_uInt16 SwFrameEventDescriptor::getMacroItemWhich() const @@ -234,7 +234,7 @@ void SwFrameStyleEventDescriptor::setMacroItem(const SvxMacroItem& rItem) SfxStyleSheetBase* pBase = pBasePool->Find(rStyle.GetStyleName()); if (pBase) { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); SfxItemSet& rStyleSet = xStyle->GetItemSet(); SfxItemSet aSet(*rStyleSet.GetPool(), RES_FRMMACRO, RES_FRMMACRO); aSet.Put(rItem); @@ -255,8 +255,8 @@ const SvxMacroItem& SwFrameStyleEventDescriptor::getMacroItem() SfxStyleSheetBase* pBase = pBasePool->Find(rStyle.GetStyleName()); if (pBase) { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase) ); - return (const SvxMacroItem&)xStyle->GetItemSet().Get(RES_FRMMACRO); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase)) ); + return static_cast<const SvxMacroItem&>(xStyle->GetItemSet().Get(RES_FRMMACRO)); } else return aEmptyMacroItem; diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 93fae3bb3879..630f840ae689 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1371,7 +1371,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) aDateTime.SetSec(m_pImpl->m_pProps->pDateTime->Seconds); } SwPostItField* pPostItField = new SwPostItField( - (SwPostItFieldType*)pFldType, + static_cast<SwPostItFieldType*>(pFldType), m_pImpl->m_pProps->sPar1, // author m_pImpl->m_pProps->sPar2, // content m_pImpl->m_pProps->sPar3, // author's initials @@ -1388,7 +1388,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) case SW_SERVICE_FIELDTYPE_SCRIPT: { SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_SCRIPTFLD); - pFld = new SwScriptField((SwScriptFieldType*)pFldType, + pFld = new SwScriptField(static_cast<SwScriptFieldType*>(pFldType), m_pImpl->m_pProps->sPar1, m_pImpl->m_pProps->sPar2, m_pImpl->m_pProps->bBool1); } @@ -1438,7 +1438,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) case SW_SERVICE_FIELDTYPE_TEMPLATE_NAME: { SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_TEMPLNAMEFLD); - pFld = new SwTemplNameField((SwTemplNameFieldType*)pFldType, + pFld = new SwTemplNameField(static_cast<SwTemplNameFieldType*>(pFldType), m_pImpl->m_pProps->nFormat); uno::Any aFormat; aFormat <<= m_pImpl->m_pProps->nFormat; @@ -1501,7 +1501,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) case SW_SERVICE_FIELDTYPE_GET_REFERENCE: { SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_GETREFFLD); - pFld = new SwGetRefField((SwGetRefFieldType*)pFldType, + pFld = new SwGetRefField(static_cast<SwGetRefFieldType*>(pFldType), m_pImpl->m_pProps->sPar1, 0, 0, @@ -1520,7 +1520,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) case SW_SERVICE_FIELDTYPE_JUMP_EDIT: { SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_JUMPEDITFLD); - pFld = new SwJumpEditField((SwJumpEditFieldType*)pFldType, + pFld = new SwJumpEditField(static_cast<SwJumpEditFieldType*>(pFldType), m_pImpl->m_pProps->nUSHORT1, m_pImpl->m_pProps->sPar2, m_pImpl->m_pProps->sPar1); } @@ -1593,11 +1593,11 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) if (m_pImpl->m_pProps->bBool2) nUserSubType |= nsSwExtendedSubType::SUB_CMD; if (m_pImpl->m_pProps->bFormatIsDefault && - nsSwGetSetExpType::GSE_STRING == ((SwUserFieldType*)pFldType)->GetType()) + nsSwGetSetExpType::GSE_STRING == static_cast<SwUserFieldType*>(pFldType)->GetType()) { m_pImpl->m_pProps->nFormat = -1; } - pFld = new SwUserField((SwUserFieldType*)pFldType, + pFld = new SwUserField(static_cast<SwUserFieldType*>(pFldType), nUserSubType, m_pImpl->m_pProps->nFormat); } @@ -1605,7 +1605,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) case SW_SERVICE_FIELDTYPE_REF_PAGE_SET: { SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_REFPAGESETFLD); - pFld = new SwRefPageSetField( (SwRefPageSetFieldType*)pFldType, + pFld = new SwRefPageSetField( static_cast<SwRefPageSetFieldType*>(pFldType), m_pImpl->m_pProps->nUSHORT1, m_pImpl->m_pProps->bBool1 ); } @@ -1640,7 +1640,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) pDoc->getIDocumentFieldsAccess().GetFldType(RES_DDEFLD, m_pImpl->m_sTypeName, true); if (!pFldType) throw uno::RuntimeException(); - pFld = new SwDDEField( (SwDDEFieldType*)pFldType ); + pFld = new SwDDEField( static_cast<SwDDEFieldType*>(pFldType) ); } break; case SW_SERVICE_FIELDTYPE_DATABASE_NAME: @@ -1651,7 +1651,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) aData.sDataSource = m_pImpl->m_pProps->sPar1; aData.sCommand = m_pImpl->m_pProps->sPar2; aData.nCommandType = m_pImpl->m_pProps->nSHORT1; - pFld = new SwDBNameField((SwDBNameFieldType*)pFldType, aData); + pFld = new SwDBNameField(static_cast<SwDBNameFieldType*>(pFldType), aData); sal_uInt16 nSubType = pFld->GetSubType(); if (m_pImpl->m_pProps->bBool2) nSubType &= ~nsSwExtendedSubType::SUB_INVISIBLE; @@ -1669,7 +1669,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) aData.sCommand = m_pImpl->m_pProps->sPar2; aData.nCommandType = m_pImpl->m_pProps->nSHORT1; SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_DBNEXTSETFLD); - pFld = new SwDBNextSetField((SwDBNextSetFieldType*)pFldType, + pFld = new SwDBNextSetField(static_cast<SwDBNextSetFieldType*>(pFldType), m_pImpl->m_pProps->sPar3, OUString(), aData); } #endif @@ -1681,8 +1681,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) aData.sDataSource = m_pImpl->m_pProps->sPar1; aData.sCommand = m_pImpl->m_pProps->sPar2; aData.nCommandType = m_pImpl->m_pProps->nSHORT1; - pFld = new SwDBNumSetField( (SwDBNumSetFieldType*) - pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_DBNUMSETFLD), + pFld = new SwDBNumSetField( static_cast<SwDBNumSetFieldType*>( + pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_DBNUMSETFLD)), m_pImpl->m_pProps->sPar3, OUString::number(m_pImpl->m_pProps->nFormat), aData ); @@ -1720,7 +1720,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) throw uno::RuntimeException(); pFld = new SwDBField(static_cast<SwDBFieldType*>(pFldType), m_pImpl->m_pProps->nFormat); - ((SwDBField*)pFld)->InitContent(m_pImpl->m_pProps->sPar1); + static_cast<SwDBField*>(pFld)->InitContent(m_pImpl->m_pProps->sPar1); sal_uInt16 nSubType = pFld->GetSubType(); if (m_pImpl->m_pProps->bBool2) nSubType &= ~nsSwExtendedSubType::SUB_INVISIBLE; @@ -1738,7 +1738,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) throw uno::RuntimeException(); // detect the field type's sub type and set an appropriate number format if (m_pImpl->m_pProps->bFormatIsDefault && - nsSwGetSetExpType::GSE_STRING == ((SwSetExpFieldType*)pFldType)->GetType()) + nsSwGetSetExpType::GSE_STRING == static_cast<SwSetExpFieldType*>(pFldType)->GetType()) { m_pImpl->m_pProps->nFormat = -1; } @@ -1848,7 +1848,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SwMacroField::CreateMacroString(aName, m_pImpl->m_pProps->sPar1, m_pImpl->m_pProps->sPar3); } - pFld = new SwMacroField((SwMacroFieldType*)pFldType, aName, + pFld = new SwMacroField(static_cast<SwMacroFieldType*>(pFldType), aName, m_pImpl->m_pProps->sPar2); } break; @@ -1892,8 +1892,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) break; case SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS: // create field - pFld = new SwCombinedCharField( (SwCombinedCharFieldType*) - pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_COMBINED_CHARS), + pFld = new SwCombinedCharField( static_cast<SwCombinedCharFieldType*>( + pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_COMBINED_CHARS)), m_pImpl->m_pProps->sPar1); break; case SW_SERVICE_FIELDTYPE_DROPDOWN: @@ -1921,12 +1921,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) if (m_pImpl->m_pProps->bFormatIsDefault) m_pImpl->m_pProps->nFormat = -1; } - pFld = new SwTblField( (SwTblFieldType*) - pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_TABLEFLD), + pFld = new SwTblField( static_cast<SwTblFieldType*>( + pDoc->getIDocumentFieldsAccess().GetSysFldType(RES_TABLEFLD)), m_pImpl->m_pProps->sPar2, nType, m_pImpl->m_pProps->nFormat); - ((SwTblField*)pFld)->ChgExpStr(m_pImpl->m_pProps->sPar1); + static_cast<SwTblField*>(pFld)->ChgExpStr(m_pImpl->m_pProps->sPar1); } break; default: OSL_FAIL("was ist das fuer ein Typ?"); @@ -2528,19 +2528,19 @@ void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/ void SAL_CALL SwXTextField::update() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - SwField const*const pFld = m_pImpl->GetField(); + SwField * pFld = const_cast<SwField*>(m_pImpl->GetField()); if (pFld) { switch(pFld->Which()) { case RES_DATETIMEFLD: - ((SwDateTimeField*)pFld)->SetDateTime( ::DateTime( ::DateTime::SYSTEM ) ); + static_cast<SwDateTimeField*>(pFld)->SetDateTime( ::DateTime( ::DateTime::SYSTEM ) ); break; case RES_EXTUSERFLD: { - SwExtUserField* pExtUserFld = (SwExtUserField*)pFld; - pExtUserFld->SetExpansion( ((SwExtUserFieldType*)pFld->GetTyp())->Expand( + SwExtUserField* pExtUserFld = static_cast<SwExtUserField*>(pFld); + pExtUserFld->SetExpansion( static_cast<SwExtUserFieldType*>(pFld->GetTyp())->Expand( pExtUserFld->GetSubType(), pExtUserFld->GetFormat() ) ); } @@ -2548,24 +2548,24 @@ void SAL_CALL SwXTextField::update() throw (uno::RuntimeException, std::exceptio case RES_AUTHORFLD: { - SwAuthorField* pAuthorFld = (SwAuthorField*)pFld; - pAuthorFld->SetExpansion( ((SwAuthorFieldType*)pFld->GetTyp())->Expand( + SwAuthorField* pAuthorFld = static_cast<SwAuthorField*>(pFld); + pAuthorFld->SetExpansion( static_cast<SwAuthorFieldType*>(pFld->GetTyp())->Expand( pAuthorFld->GetFormat() ) ); } break; case RES_FILENAMEFLD: { - SwFileNameField* pFileNameFld = (SwFileNameField*)pFld; - pFileNameFld->SetExpansion( ((SwFileNameFieldType*)pFld->GetTyp())->Expand( + SwFileNameField* pFileNameFld = static_cast<SwFileNameField*>(pFld); + pFileNameFld->SetExpansion( static_cast<SwFileNameFieldType*>(pFld->GetTyp())->Expand( pFileNameFld->GetFormat() ) ); } break; case RES_DOCINFOFLD: { - SwDocInfoField* pDocInfFld = (SwDocInfoField*)pFld; - pDocInfFld->SetExpansion( ((SwDocInfoFieldType*)pFld->GetTyp())->Expand( + SwDocInfoField* pDocInfFld = static_cast<SwDocInfoField*>(pFld); + pDocInfFld->SetExpansion( static_cast<SwDocInfoFieldType*>(pFld->GetTyp())->Expand( pDocInfFld->GetSubType(), pDocInfFld->GetFormat(), pDocInfFld->GetLanguage(), @@ -2652,14 +2652,14 @@ void SwXTextField::Impl::Modify( { case RES_REMOVE_UNO_OBJECT: case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) + if( (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) Invalidate(); break; case RES_FMT_CHG: // Am I re-attached to a new one and will the old one be deleted? - if( ((SwFmtChg*)pNew)->pChangedFmt == GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() ) + if( static_cast<const SwFmtChg*>(pNew)->pChangedFmt == GetRegisteredIn() && + static_cast<const SwFmtChg*>(pOld)->pChangedFmt->IsFmtInDTOR() ) Invalidate(); break; } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index db5cb5b39392..86d91c5c80bc 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -954,8 +954,8 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItem OUString sStyle; *pStyleName >>= sStyle; SwStyleNameMapper::FillUIName(sStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true); - pStyle = (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, - SFX_STYLE_FAMILY_FRAME); + pStyle = static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, + SFX_STYLE_FAMILY_FRAME)); } const ::uno::Any* pColumns = NULL; @@ -1028,8 +1028,8 @@ bool SwGraphicProperties_Impl::AnyToItemSet( OUString sStyle; *pStyleName >>= sStyle; SwStyleNameMapper::FillUIName(sStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true); - pStyle = (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, - SFX_STYLE_FAMILY_FRAME); + pStyle = static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, + SFX_STYLE_FAMILY_FRAME)); } const ::uno::Any* pHEvenMirror = 0; @@ -1276,7 +1276,7 @@ void SwXFrame::setName(const OUString& rName) throw( uno::RuntimeException, std: SwFrmFmt* pFmt = GetFrmFmt(); if(pFmt) { - pFmt->GetDoc()->SetFlyName((SwFlyFrmFmt&)*pFmt, rName); + pFmt->GetDoc()->SetFlyName(static_cast<SwFlyFrmFmt&>(*pFmt), rName); if(pFmt->GetName() != rName) { throw uno::RuntimeException(); @@ -1360,8 +1360,8 @@ static SwFrmFmt *lcl_GetFrmFmt( const :: uno::Any& rValue, SwDoc *pDoc ) SwStyleNameMapper::FillUIName(uTemp, sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true); SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)pDocSh->GetStyleSheetPool()->Find(sStyle, - SFX_STYLE_FAMILY_FRAME); + static_cast<SwDocStyleSheet*>(pDocSh->GetStyleSheetPool()->Find(sStyle, + SFX_STYLE_FAMILY_FRAME)); if(pStyle) pRet = pStyle->GetFrmFmt(); } @@ -1518,9 +1518,9 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: // see SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, bool bKeepOrient, Point* pDocPos ) SwFlyFrm *pFly = 0; { - const :: SwFrmFmt* pFmtXX = pFmt; + const SwFrmFmt* pFmtXX = pFmt; if (PTR_CAST(SwFlyFrmFmt, pFmtXX)) - pFly = ((SwFlyFrmFmt*)pFmtXX)->GetFrm(); + pFly = static_cast<const SwFlyFrmFmt*>(pFmtXX)->GetFrm(); } if ( pFly ) { @@ -1548,7 +1548,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: OUString sGrfName; OUString sFltName; GraphicObject *pGrfObj = 0; - pFmt->GetDoc()->GetGrfNms( *(SwFlyFrmFmt*)pFmt, &sGrfName, &sFltName ); + pFmt->GetDoc()->GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), &sGrfName, &sFltName ); OUString sTmp; aValue >>= sTmp; UnoActionContext aAction(pFmt->GetDoc()); @@ -1716,7 +1716,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: if( nZOrder >= 0 && aTextBoxes.find(pFmt) == aTextBoxes.end()) { SdrObject* pObject = - GetOrCreateSdrObject( (SwFlyFrmFmt&)*pFmt ); + GetOrCreateSdrObject( static_cast<SwFlyFrmFmt&>(*pFmt) ); SwDrawModel *pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel(); pDrawModel->GetPage(0)-> SetObjectOrdNum(pObject->GetOrdNum(), nZOrder); @@ -1737,7 +1737,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); aSet.SetParent(&pFmt->GetAttrSet()); - SwFmtAnchor aAnchor = (const :: SwFmtAnchor&)aSet.Get(pEntry->nWID); + SwFmtAnchor aAnchor = static_cast<const SwFmtAnchor&>(aSet.Get(pEntry->nWID)); SwPosition aPos(*pFrame->GetFrmFmt()->GetCntnt().GetCntntIdx()); aAnchor.SetAnchor(&aPos); @@ -1870,7 +1870,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == nMemberId) { - SwFmtAnchor aAnchor = (const :: SwFmtAnchor&)aSet.Get(pEntry->nWID); + SwFmtAnchor aAnchor = static_cast<const SwFmtAnchor&>(aSet.Get(pEntry->nWID)); if(aAnchor.GetAnchorId() == FLY_AT_FLY) { const :: SwPosition* pPosition = aAnchor.GetCntntAnchor(); @@ -1907,7 +1907,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: // see SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) SwFlyFrm *pFly = 0; if (PTR_CAST(SwFlyFrmFmt, pFmt)) - pFly = ((SwFlyFrmFmt*)pFmt)->GetFrm(); + pFly = static_cast<SwFlyFrmFmt*>(pFmt)->GetFrm(); if (pFly) { const :: SfxPoolItem* pItem; @@ -2050,7 +2050,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) throw uno::RuntimeException(); if( pGrfNode->IsGrfLink() ) { - pFmt->GetDoc()->GetGrfNms( *(SwFlyFrmFmt*)pFmt, &sGrfName, 0 ); + pFmt->GetDoc()->GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), &sGrfName, 0 ); } else { @@ -2088,7 +2088,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else if( FN_UNO_GRAPHIC_FILTER == pEntry->nWID ) { OUString sFltName; - pFmt->GetDoc()->GetGrfNms( *(SwFlyFrmFmt*)pFmt, 0, &sFltName ); + pFmt->GetDoc()->GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), 0, &sFltName ); aAny <<= sFltName; } else if( FN_UNO_GRAPHIC == pEntry->nWID ) @@ -2726,7 +2726,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan RndStdIds eAnchorId = FLY_AT_PARA; if(SfxItemState::SET == aFrmSet.GetItemState(RES_ANCHOR, false, &pItem) ) { - eAnchorId = ((const SwFmtAnchor*)pItem)->GetAnchorId(); + eAnchorId = static_cast<const SwFmtAnchor*>(pItem)->GetAnchorId(); if( FLY_AT_FLY == eAnchorId && !aPam.GetNode().FindFlyStartNode()) { @@ -2735,9 +2735,9 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan aFrmSet.Put(aAnchor); } else if ((FLY_AT_PAGE == eAnchorId) && - 0 == ((const SwFmtAnchor*)pItem)->GetPageNum() ) + 0 == static_cast<const SwFmtAnchor*>(pItem)->GetPageNum() ) { - SwFmtAnchor aAnchor( *((const SwFmtAnchor*)pItem) ); + SwFmtAnchor aAnchor( *static_cast<const SwFmtAnchor*>(pItem) ); aAnchor.SetAnchor( aPam.GetPoint() ); aFrmSet.Put(aAnchor); } @@ -2791,7 +2791,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan pDoc->SetFlyName((SwFlyFrmFmt&)*pFmt, m_sName); } // wake up the SwXTextFrame - ((SwXTextFrame*)this)->SetDoc( bIsDescriptor ? m_pDoc : GetFrmFmt()->GetDoc() ); + static_cast<SwXTextFrame*>(this)->SetDoc( bIsDescriptor ? m_pDoc : GetFrmFmt()->GetDoc() ); } else if( eType == FLYCNTTYPE_GRF) { @@ -3039,7 +3039,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) { SfxItemSet aSet( pDoc->GetAttrPool(), RES_ANCHOR, RES_ANCHOR ); aSet.SetParent(&pFmt->GetAttrSet()); - SwFmtAnchor aAnchor = (const SwFmtAnchor&)aSet.Get(RES_ANCHOR); + SwFmtAnchor aAnchor = static_cast<const SwFmtAnchor&>(aSet.Get(RES_ANCHOR)); aAnchor.SetAnchor( aIntPam.Start() ); aSet.Put(aAnchor); pDoc->SetFlyFrmAttr( *pFmt, aSet ); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 9d7ddef93c66..ab964094342b 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -134,7 +134,7 @@ SwUnoInternalPaM& SwUnoInternalPaM::operator=(const SwPaM& rPaM) } else DeleteMark(); - while(&rPaM != (pTmp = (const SwPaM*)pTmp->GetNext())) + while(&rPaM != (pTmp = static_cast<const SwPaM*>(pTmp->GetNext()))) { if(pTmp->HasMark()) new SwPaM(*pTmp->GetMark(), *pTmp->GetPoint(), this); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 4a465a2cee4d..09cdf3ead506 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -290,15 +290,15 @@ void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem { case RES_REMOVE_UNO_OBJECT: case RES_OBJECTDYING: - if( (void*)pClient->GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) + if( (void*)pClient->GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) ((SwModify*)pClient->GetRegisteredIn())->Remove(pClient); break; case RES_FMT_CHG: // Is the move to the new one finished and will the old one be deleted? - if( ((SwFmtChg*)pNew)->pChangedFmt == pClient->GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() ) - ((SwModify*)pClient->GetRegisteredIn())->Remove(pClient); + if( static_cast<const SwFmtChg*>(pNew)->pChangedFmt == pClient->GetRegisteredIn() && + static_cast<const SwFmtChg*>(pOld)->pChangedFmt->IsFmtInDTOR() ) + static_cast<SwModify*>(pClient->GetRegisteredIn())->Remove(pClient); break; } } @@ -1081,7 +1081,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, : ((pPortion) ? pPortion->GetCursor() : 0); if (pUnoCrsr && pDoc == rToFill.GetDoc()) { - OSL_ENSURE((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr, + OSL_ENSURE(static_cast<SwPaM*>(pUnoCrsr->GetNext()) == pUnoCrsr, "what to do about rings?"); bRet = true; *rToFill.GetPoint() = *pUnoCrsr->GetPoint(); diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 78bc9433bb9d..83a88886cfa4 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1963,8 +1963,8 @@ void SwXNumberingRules::SetPropertiesToNumFmt( if( !sBulletFontName.isEmpty() && pLclDocShell ) { const SvxFontListItem* pFontListItem = - (const SvxFontListItem* )pLclDocShell - ->GetItem( SID_ATTR_CHAR_FONTLIST ); + static_cast<const SvxFontListItem* >(pLclDocShell + ->GetItem( SID_ATTR_CHAR_FONTLIST )); const FontList* pList = pFontListItem->GetFontList(); vcl::FontInfo aInfo = pList->Get( sBulletFontName, WEIGHT_NORMAL, ITALIC_NONE); @@ -2061,7 +2061,7 @@ void SwXNumberingRules::SetPropertiesToNumFmt( if(!pSetVOrient) { if(aFmt.GetGraphicOrientation()) - pSetVOrient = (SwFmtVertOrient*)aFmt.GetGraphicOrientation()->Clone(); + pSetVOrient = static_cast<SwFmtVertOrient*>(aFmt.GetGraphicOrientation()->Clone()); else pSetVOrient = new SwFmtVertOrient; } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index a48d9ad851e3..6a1f06a2b37f 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1359,7 +1359,7 @@ void SwXStyle::setName(const OUString& rName) throw( uno::RuntimeException, std: bool bExcept = true; if(pBase && pBase->IsUserDefined()) { - rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); bExcept = !xTmp->SetName(rName); if(!bExcept) m_sStyleName = rName; @@ -1436,7 +1436,7 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle) SfxStyleSheetBase* pBase = pBasePool->Find(m_sStyleName); if(pBase) { - rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) ); + rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase)) ); //make it a 'real' style - necessary for pooled styles xBase->GetItemSet(); if(xBase->GetParent() != sParentStyle) @@ -1907,8 +1907,8 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, (!pFmt->GetBulletFont() || pFmt->GetBulletFont()->GetName() != pBulletFontNames[i]) ) { const SvxFontListItem* pFontListItem = - (const SvxFontListItem* )pDoc->GetDocShell() - ->GetItem( SID_ATTR_CHAR_FONTLIST ); + static_cast<const SvxFontListItem*>(pDoc->GetDocShell() + ->GetItem( SID_ATTR_CHAR_FONTLIST )); const FontList* pList = pFontListItem->GetFontList(); vcl::FontInfo aInfo = pList->Get( pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE); @@ -2167,7 +2167,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, OUString sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true ); SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR); + static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); if(pStyle) pDrop->SetCharFmt(pStyle->GetCharFmt()); else @@ -2256,7 +2256,7 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl( pBasePool->SetSearchMask(eFamily, nSaveMask ); OSL_ENSURE(pBase, "where is the style?" ); if(pBase) - aBaseImpl.setNewBase(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase)); + aBaseImpl.setNewBase(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); else throw uno::RuntimeException(); } @@ -2344,7 +2344,7 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, sal_Bool bHidden = sal_False; if(pBase) { - rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) ); + rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase)) ); bHidden = xBase->IsHidden(); } aRet.setValue(&bHidden, ::getBooleanCppuType()); @@ -2353,7 +2353,7 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, { if (pBase) { - rtl::Reference<SwDocStyleSheet> xBase(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase)); + rtl::Reference<SwDocStyleSheet> xBase(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); xBase->GetGrabBagItem(aRet); } } @@ -2361,7 +2361,7 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, { if(!rBase.getNewBase().is()) { - rBase.setNewBase(new SwDocStyleSheet( *(SwDocStyleSheet*)pBase )); + rBase.setNewBase(new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) )); } //UUUU @@ -2428,7 +2428,7 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxPoolItem* pItem; if (SfxItemState::SET == rBase.GetItemSet().GetItemState(RES_PAGEDESC, true, &pItem)) { - const SwPageDesc* pDesc = ((const SwFmtPageDesc*)pItem)->GetPageDesc(); + const SwPageDesc* pDesc = static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc(); if(pDesc) { OUString aString; @@ -2853,7 +2853,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates( if(pBase) { const OUString* pNames = rPropertyNames.getConstArray(); - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) @@ -2997,7 +2997,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >& if(pBase) { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); switch(eFamily) { case SFX_STYLE_FAMILY_CHAR: @@ -3107,7 +3107,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( ) if(pBase) { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); SwFmt *pTargetFmt = 0; sal_uInt16 nPgDscPos = USHRT_MAX; switch(eFamily) @@ -3238,7 +3238,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Seq if(pBase) { - rtl::Reference< SwDocStyleSheet > xStyle(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase)); + rtl::Reference< SwDocStyleSheet > xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); sal_Int8 nPropSetId = PROPERTY_MAP_CHAR_STYLE; switch(eFamily) { @@ -3403,7 +3403,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( OSL_ENSURE(pBase, "where is the style?" ); if(pBase) { - aBaseImpl.setNewBase(new SwDocStyleSheet(*(SwDocStyleSheet*)pBase)); + aBaseImpl.setNewBase(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); } else { @@ -3753,7 +3753,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( if(bHeader || bFooter || rPropName == UNO_NAME_FIRST_IS_SHARED) { // slot is a Header/Footer slot - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); const SfxItemSet& rSet = xStyle->GetItemSet(); const SvxSetItem* pSetItem; @@ -3826,7 +3826,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( if (bHeader || bFooter) { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); const SfxItemSet& rSet = xStyle->GetItemSet(); const SvxSetItem* pSetItem; if(SfxItemState::SET == rSet.GetItemState(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, false, (const SfxPoolItem**)&pSetItem)) @@ -3905,7 +3905,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( case FN_PARAM_FTN_INFO : { - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pBase ) ); + rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); const SfxItemSet& rSet = xStyle->GetItemSet(); const SfxPoolItem& rItem = rSet.Get(FN_PARAM_FTN_INFO); rItem.QueryValue(pRet[nProp], nMemberId); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index dc88bfc03fc9..1e46e2e92b94 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -275,7 +275,7 @@ static uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimp OUString sPDesc; if(SfxItemState::SET == rSet.GetItemState(RES_PAGEDESC, false, &pItem)) { - const SwPageDesc* pDsc = ((const SwFmtPageDesc*)pItem)->GetPageDesc(); + const SwPageDesc* pDsc = static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc(); if(pDsc) { sPDesc = SwStyleNameMapper::GetProgName(pDsc->GetName(), nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC ); @@ -614,8 +614,8 @@ static void lcl_FormatTable(SwFrmFmt* pTblFmt) { if(pFrm->IsValid()) pFrm->InvalidatePos(); - ((SwTabFrm*)pFrm)->SetONECalcLowers(); - ((SwTabFrm*)pFrm)->Calc(); + static_cast<SwTabFrm*>(pFrm)->SetONECalcLowers(); + static_cast<SwTabFrm*>(pFrm)->Calc(); } } } @@ -758,8 +758,8 @@ void sw_setValue( SwXCell &rCell, double nVal ) // - the current number format is not a number format according to the number formatter, but rather a text format // - the current number format is not even a valid number formatter number format, but rather Writer's own 'special' text number format if(SfxItemState::SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, true, &pItem) - || pDoc->GetNumberFormatter()->IsTextFormat(((SwTblBoxNumFormat*)pItem)->GetValue()) - || ((SwTblBoxNumFormat*)pItem)->GetValue() == NUMBERFORMAT_TEXT) + || pDoc->GetNumberFormatter()->IsTextFormat(static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue()) + || static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue() == NUMBERFORMAT_TEXT) { aSet.Put(SwTblBoxNumFormat(0)); } @@ -940,7 +940,7 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException, const SfxPoolItem* pItem; SwFrmFmt* pBoxFmt = pBox->GetFrmFmt(); if(SfxItemState::SET != pBoxFmt->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, true, &pItem) - || pMyDoc->GetNumberFormatter()->IsTextFormat(((SwTblBoxNumFormat*)pItem)->GetValue())) + || pMyDoc->GetNumberFormatter()->IsTextFormat(static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue())) { aSet.Put(SwTblBoxNumFormat(0)); } @@ -1548,8 +1548,8 @@ const SwPaM* SwXTextTableCursor::GetPaM() const { return GetCrsr(); } SwPaM* SwXTextTableCursor::GetPaM() { return GetCrsr(); } const SwDoc* SwXTextTableCursor::GetDoc() const { return GetFrmFmt()->GetDoc(); } SwDoc* SwXTextTableCursor::GetDoc() { return GetFrmFmt()->GetDoc(); } -const SwUnoCrsr* SwXTextTableCursor::GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); } -SwUnoCrsr* SwXTextTableCursor::GetCrsr() { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); } +const SwUnoCrsr* SwXTextTableCursor::GetCrsr() const { return static_cast<const SwUnoCrsr*>(aCrsrDepend.GetRegisteredIn()); } +SwUnoCrsr* SwXTextTableCursor::GetCrsr() { return static_cast<SwUnoCrsr*>(aCrsrDepend.GetRegisteredIn()); } uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) throw( uno::RuntimeException, std::exception ) { @@ -3420,8 +3420,8 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); pDoc->GetTabBorders(rCrsr, aSet); const SvxBoxInfoItem& rBoxInfoItem = - (const SvxBoxInfoItem&)aSet.Get(SID_ATTR_BORDER_INNER); - const SvxBoxItem& rBox = (const SvxBoxItem&)aSet.Get(RES_BOX); + static_cast<const SvxBoxInfoItem&>(aSet.Get(SID_ATTR_BORDER_INNER)); + const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); if (FN_UNO_TABLE_BORDER == pEntry->nWID) { |