diff options
96 files changed, 242 insertions, 242 deletions
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx index fc5a4e5f0bb7..adc84bbeffab 100644 --- a/sw/inc/ftninfo.hxx +++ b/sw/inc/ftninfo.hxx @@ -54,11 +54,11 @@ public: SwCharFormat* GetCharFormat(SwDoc &rDoc) const; void SetCharFormat( SwCharFormat* ); - SwClient *GetCharFormatDep() const { return (SwClient*)&aCharFormatDep; } + SwClient *GetCharFormatDep() const { return const_cast<SwClient*>(static_cast<SwClient const *>(&aCharFormatDep)); } SwCharFormat* GetAnchorCharFormat(SwDoc &rDoc) const; void SetAnchorCharFormat( SwCharFormat* ); - SwClient *GetAnchorCharFormatDep() const { return (SwClient*)&aAnchorCharFormatDep; } + SwClient *GetAnchorCharFormatDep() const { return const_cast<SwClient*>(static_cast<SwClient const *>(&aAnchorCharFormatDep)); } SwEndNoteInfo & operator=(const SwEndNoteInfo&); bool operator==( const SwEndNoteInfo &rInf ) const; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index c6b433e33e2f..7815447e2381 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1191,7 +1191,7 @@ uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType ) uno::Any aRet; if ( rType == cppu::UnoType<XAccessibleText>::get()) { - uno::Reference<XAccessibleText> aAccText = (XAccessibleText *) *this; // resolve ambiguity + uno::Reference<XAccessibleText> aAccText = static_cast<XAccessibleText *>(*this); // resolve ambiguity aRet <<= aAccText; } else if ( rType == cppu::UnoType<XAccessibleEditableText>::get()) diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 1eb97f33e5e9..1b0574420d7f 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -178,8 +178,8 @@ _CalcOp* FindOperator( const OUString& rSrch ) aSrch.pUName = &rSrch; aSrch.eOp = CALC_NAME; - return static_cast<_CalcOp*>(bsearch( (void*) &aSrch, - (void*) aOpTable, + return static_cast<_CalcOp*>(bsearch( static_cast<void*>(&aSrch), + static_cast<void const *>(aOpTable), sizeof( aOpTable ) / sizeof( _CalcOp ), sizeof( _CalcOp ), OperatorCompare )); diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index 76e8e3bcfc77..1db2c606c746 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -225,7 +225,7 @@ SwCallLink::~SwCallLink() if( rStNd.EndOfSectionNode()->StartOfSectionIndex() > nNode || nNode > rStNd.EndOfSectionIndex() ) - rShell.GetFlyMacroLnk().Call( (void*)pFlyFrm->GetFormat() ); + rShell.GetFlyMacroLnk().Call( const_cast<SwFlyFrameFormat *>(pFlyFrm->GetFormat()) ); } } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 5464ce356371..0b8aba3ca019 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -491,7 +491,7 @@ bool SwCrsrShell::bColumnChange() if(pParent!=NULL) { pCurrCol=static_cast<SwFrm*>(pParent)->FindColFrm(); - pCurrFrm = (SwFrm*)pParent; + pCurrFrm = static_cast<SwFrm*>(pParent); } else { @@ -2163,7 +2163,7 @@ void SwCrsrShell::ShGetFcs( bool bUpdate ) /** Get current frame in which the cursor is positioned. */ SwContentFrm *SwCrsrShell::GetCurrFrm( const bool bCalcFrm ) const { - SET_CURR_SHELL( (SwViewShell*)this ); + SET_CURR_SHELL( static_cast<SwViewShell*>(const_cast<SwCrsrShell *>(this)) ); SwContentFrm *pRet = 0; SwContentNode *pNd = m_pCurCrsr->GetContentNode(); if ( pNd ) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index a1cbabf2f112..b75c504ed436 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1089,7 +1089,7 @@ void SwPaM::InvalidatePaM() // pretend that the PaM marks inserted text to recalc the portion... SwInsText aHint( Start()->nContent.GetIndex(), End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 ); - SwModify *_pModify=(SwModify*)_pTextNd; + SwModify *_pModify=const_cast<SwModify*>(static_cast<SwModify const *>(_pTextNd)); _pModify->ModifyNotification( 0, &aHint); } } diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index c3d591c8c215..38cb79e8ef52 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -167,7 +167,7 @@ void SwVisCrsr::_SetPosAndShow() if( aRect.Height() ) { ::SwCalcPixStatics( m_pCrsrShell->GetOut() ); - ::SwAlignRect( aRect, (SwViewShell*)m_pCrsrShell ); + ::SwAlignRect( aRect, static_cast<SwViewShell const *>(m_pCrsrShell) ); } if( !m_pCrsrShell->IsOverwriteCrsr() || m_bIsDragCrsr || m_pCrsrShell->IsSelection() ) diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 5b6271e58465..834ff27b5999 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -371,7 +371,7 @@ void ContentIdxStoreImpl::RestoreFlys(SwDoc* pDoc, updater_t& rUpdater, bool bAu else if( bAuto ) { SwFrameFormat *pFrameFormat = (*pSpz)[ aEntry.m_nIdx ]; - SfxPoolItem *pAnchor = (SfxPoolItem*)&pFrameFormat->GetAnchor(); + SfxPoolItem const *pAnchor = static_cast<SfxPoolItem const *>(&pFrameFormat->GetAnchor()); pFrameFormat->NotifyClients( pAnchor, pAnchor ); } } diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index acfcb57c8e94..9388bfee030b 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -145,7 +145,7 @@ void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *) { case RES_REMOVE_UNO_OBJECT: case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) + if( static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) static_cast<SwModify*>(GetRegisteredIn())->Remove(this); pAutoCompleteWord->DocumentDying(*pDoc); break; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index fb43e0c78b25..2d3866147018 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -946,7 +946,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // just one page is special ... if ( 1 == aVec.size() ) - aVec.insert( aVec.begin() + 1, (SwPageFrm *)0 ); // insert a second empty page + aVec.insert( aVec.begin() + 1, nullptr ); // insert a second empty page else { // now extend the number of pages to fit a multiple of 4 diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx index 8cc57ff8ab34..282df7f7af2a 100644 --- a/sw/source/core/doc/docglos.cxx +++ b/sw/source/core/doc/docglos.cxx @@ -158,7 +158,7 @@ bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const OUString& rEntry, SwNodeIndex aStt( pGDoc->GetNodes().GetEndOfExtras(), 1 ); SwContentNode* pContentNd = pGDoc->GetNodes().GoNext( &aStt ); const SwTableNode* pTableNd = pContentNd->FindTableNode(); - SwPaM aCpyPam( pTableNd ? *(SwNode*)pTableNd : *(SwNode*)pContentNd ); + SwPaM aCpyPam( pTableNd ? *const_cast<SwNode*>(static_cast<SwNode const *>(pTableNd)) : *static_cast<SwNode*>(pContentNd) ); aCpyPam.SetMark(); // till the nodes array's end diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 4d8a04b22e99..1dc1d432ced2 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1115,7 +1115,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable OSL_ENSURE( pHint && pHint->Which() == RES_TXTATR_FLYCNT, "Missing FlyInCnt-Hint." ); OSL_ENSURE( pHint && pHint->GetFlyCnt(). - GetFrameFormat() == (SwFrameFormat*)pOldFormat, + GetFrameFormat() == static_cast<SwFrameFormat*>(pOldFormat), "Wrong TextFlyCnt-Hint." ); #endif const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt()).SetFlyFormat( pNewFormat ); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 302ebefd8b9e..ef6b904587db 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -896,7 +896,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const #endif // remove the temporary shell if it is there as it was done before - pRet->SetTmpDocShell( (SfxObjectShell*)NULL ); + pRet->SetTmpDocShell( nullptr ); (void)pRet->release(); diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx index 578b5767c8a6..c4f5cbb22a30 100644 --- a/sw/source/core/doc/lineinfo.cxx +++ b/sw/source/core/doc/lineinfo.cxx @@ -121,7 +121,7 @@ SwCharFormat* SwLineNumberInfo::GetCharFormat( IDocumentStylePoolAccess& rIDSPA if ( !GetRegisteredIn() ) { SwCharFormat* pFormat = rIDSPA.GetCharFormatFromPool( RES_POOLCHR_LINENUM ); - pFormat->Add( (SwClient*)this ); + pFormat->Add( const_cast<SwClient*>(static_cast<SwClient const *>(this)) ); } return const_cast<SwCharFormat*>(static_cast<const SwCharFormat*>(GetRegisteredIn())); } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 893104502584..c3d62ed4928b 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -504,7 +504,7 @@ void SwNoTextFrm::Format( const SwBorderAttrs * ) bool SwNoTextFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos, SwCrsrMoveState *pCMS ) const { - if ( &rPos.nNode.GetNode() != (SwNode*)GetNode() ) + if ( &rPos.nNode.GetNode() != static_cast<SwNode const *>(GetNode()) ) return false; Calc(); diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index e100b39b965c..0da9ae91a690 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -553,7 +553,7 @@ void SwDoc::DelSectionFormat( SwSectionFormat *pFormat, bool bDelNodes ) 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) { SwNodeIndex aUpdIdx( *pIdx ); - getIDocumentContentOperations().DeleteSection( (SwNode*)pSectNd ); + getIDocumentContentOperations().DeleteSection( const_cast<SwNode*>(static_cast<SwNode const *>(pSectNd)) ); if( pFootnoteEndAtTextEnd ) GetFootnoteIdxs().UpdateFootnote( aUpdIdx ); getIDocumentState().SetModified(); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 16041a22fb13..5fc6f391b774 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -215,7 +215,7 @@ SwTableNode* SwDoc::IsIdxInTable(const SwNodeIndex& rIdx) SwTableNode* pTableNd = 0; sal_uLong nIndex = rIdx.GetIndex(); do { - SwNode* pNd = (SwNode*)GetNodes()[ nIndex ]->StartOfSectionNode(); + SwNode* pNd = static_cast<SwNode*>(GetNodes()[ nIndex ]->StartOfSectionNode()); if( 0 != ( pTableNd = pNd->GetTableNode() ) ) break; @@ -1907,7 +1907,7 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor ) if( pCNd ) { // Change the Shell's Cursor or the one passed? - SwPaM* pPam = (SwPaM*)&rCursor; + SwPaM* pPam = const_cast<SwPaM*>(static_cast<SwPaM const *>(&rCursor)); pPam->GetPoint()->nNode = aIdx; pPam->GetPoint()->nContent.Assign( pCNd, 0 ); pPam->SetMark(); // Both want a part of it @@ -2492,7 +2492,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, if( pBoxFrm ) { - pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); + pTab = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoxFrm))->ImplFindTabFrm(); pBox = pBoxFrm->GetTabBox(); } else if( pCrsr ) @@ -2512,7 +2512,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, } while ( !pTmpFrm->IsCellFrm() ); pBoxFrm = static_cast<const SwCellFrm*>(pTmpFrm); - pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); + pTab = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoxFrm))->ImplFindTabFrm(); pBox = pBoxFrm->GetTabBox(); } else if( !pCrsr && !pBoxFrm ) @@ -2706,7 +2706,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, if( pBoxFrm ) { - pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); + pTab = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoxFrm))->ImplFindTabFrm(); pBox = pBoxFrm->GetTabBox(); } else if( pCrsr ) @@ -2726,7 +2726,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, } while ( !pTmpFrm->IsCellFrm() ); pBoxFrm = static_cast<const SwCellFrm*>(pTmpFrm); - pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); + pTab = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoxFrm))->ImplFindTabFrm(); pBox = pBoxFrm->GetTabBox(); } else if( !pCrsr && !pBoxFrm ) @@ -2781,7 +2781,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, const SwCursor* OSL_ENSURE( pBoxFrm, "SetTabRows called without pBoxFrm" ); - pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); + pTab = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoxFrm))->ImplFindTabFrm(); // If the Table is still using relative values (USHRT_MAX) // we need to switch to absolute ones. diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index e405c5f2a2fa..6913c1fbf417 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -1470,7 +1470,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance ) // It's more robust if we calculate the minimum values for the whole Table const SwTabFrm *pTab = pStart->ImplFindTabFrm(); - pStart = (SwLayoutFrm*)pTab->FirstCell(); + pStart = const_cast<SwLayoutFrm*>(static_cast<SwLayoutFrm const *>(pTab->FirstCell())); pEnd = const_cast<SwLayoutFrm*>(pTab->FindLastContent()->GetUpper()); while( !pEnd->IsCellFrm() ) pEnd = pEnd->GetUpper(); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 6cacd008e309..a7c205563a02 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -516,7 +516,7 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, const SwFrameFormat* pFrameFormat = rFormats[ n ]; const SwFormatContent& rContent = pFrameFormat->GetContent(); if( rContent.GetContentIdx() && - &rContent.GetContentIdx()->GetNode() == (SwNode*)pSttNd ) + &rContent.GetContentIdx()->GetNode() == static_cast<SwNode const *>(pSttNd) ) { pFormat = pFrameFormat; break; @@ -618,7 +618,7 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, const SwFormatContent& rContent = pHdFtFormat->GetContent(); if( rContent.GetContentIdx() && &rContent.GetContentIdx()->GetNode() == - (SwNode*)pSttNd ) + static_cast<SwNode const *>(pSttNd) ) { pPgDesc = &rPgDsc; break; @@ -638,7 +638,7 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, const SwFootnoteIdxs& rFootnoteArr = pDoc->GetFootnoteIdxs(); for( size_t n = 0; n < rFootnoteArr.size(); ++n ) if( 0 != ( pTextFootnote = rFootnoteArr[ n ])->GetStartNode() && - (SwNode*)pSttNd == + static_cast<SwNode const *>(pSttNd) == &pTextFootnote->GetStartNode()->GetNode() ) { pNd = &pTextFootnote->GetTextNode(); @@ -1111,7 +1111,7 @@ bool SwContentNode::InvalidateNumRule() SwContentFrm *SwContentNode::getLayoutFrm( const SwRootFrm* _pRoot, const Point* pPoint, const SwPosition *pPos, const bool bCalcFrm ) const { - return static_cast<SwContentFrm*>( ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT, + return static_cast<SwContentFrm*>( ::GetFrmOfModify( _pRoot, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), FRM_CNTNT, pPoint, pPos, bCalcFrm )); } @@ -1119,7 +1119,7 @@ SwRect SwContentNode::FindLayoutRect( const bool bPrtArea, const Point* pPoint, const bool bCalcFrm ) const { SwRect aRet; - SwContentFrm* pFrm = static_cast<SwContentFrm*>( ::GetFrmOfModify( 0, *(SwModify*)this, + SwContentFrm* pFrm = static_cast<SwContentFrm*>( ::GetFrmOfModify( 0, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), FRM_CNTNT, pPoint, 0, bCalcFrm ) ); if( pFrm ) aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm(); @@ -1130,7 +1130,7 @@ SwRect SwContentNode::FindPageFrmRect( const bool bPrtArea, const Point* pPoint, const bool bCalcFrm ) const { SwRect aRet; - SwFrm* pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, + SwFrm* pFrm = ::GetFrmOfModify( 0, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), FRM_CNTNT, pPoint, 0, bCalcFrm ); if( pFrm && 0 != ( pFrm = pFrm->FindPageFrm() )) aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm(); diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index 4ed1518c2d56..09edd1df58ae 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -163,7 +163,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, bool bSearc if( pNd ) { if( pNd->IsContentNode() ) - pMod = (SwModify*)pNd->GetContentNode(); + pMod = const_cast<SwModify*>(static_cast<SwModify const *>(pNd->GetContentNode())); else { OSL_ENSURE( pNd->IsTableNode(), "For Tablenodes only" ); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index ffc6bc876b54..c2e920b7791b 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -812,7 +812,7 @@ void SwSectionFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_OBJECTDYING: if( !GetDoc()->IsInDtor() && pOld && - static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject == (void*)GetRegisteredIn() ) + static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject == static_cast<void*>(GetRegisteredIn()) ) { // My Parents will be destroyed, so get the Parent's Parent // and update @@ -824,7 +824,7 @@ void SwSectionFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_FMT_CHG: if( !GetDoc()->IsInDtor() && - static_cast<const SwFormatChg*>(pNew)->pChangedFormat == (void*)GetRegisteredIn() && + static_cast<const SwFormatChg*>(pNew)->pChangedFormat == static_cast<void*>(GetRegisteredIn()) && static_cast<const SwFormatChg*>(pNew)->pChangedFormat->IsA( TYPE( SwSectionFormat )) ) { // My Parent will be changed, thus I need to update @@ -977,16 +977,16 @@ void SwSectionFormat::UpdateParent() if (!pProtect->IsContentProtected() != !pSection->IsProtectFlag()) { - pLast->ModifyNotification( (SfxPoolItem*)pProtect, - (SfxPoolItem*)pProtect ); + pLast->ModifyNotification( static_cast<SfxPoolItem const *>(pProtect), + static_cast<SfxPoolItem const *>(pProtect) ); } // edit in readonly sections if (!pEditInReadonly->GetValue() != !pSection->IsEditInReadonlyFlag()) { - pLast->ModifyNotification( (SfxPoolItem*)pEditInReadonly, - (SfxPoolItem*)pEditInReadonly ); + pLast->ModifyNotification( static_cast<SfxPoolItem const *>(pEditInReadonly), + static_cast<SfxPoolItem const *>(pEditInReadonly) ); } if( bIsHidden == pSection->IsHiddenFlag() ) @@ -1414,7 +1414,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) pPam = pCrsr; } - SvMemoryStream aStrm( (void*)aSeq.getConstArray(), aSeq.getLength(), + SvMemoryStream aStrm( const_cast<sal_Int8 *>(aSeq.getConstArray()), aSeq.getLength(), StreamMode::READ ); aStrm.Seek( 0 ); diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index efd249ff071d..43ba556daef7 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -996,7 +996,7 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) cons { if( !rURL.GetMap() || pFlyFrm->GetFormat()->GetIMapObject( rRec.aPos, pFlyFrm )) - return (SdrObject*)this; + return const_cast<SdrObject*>(static_cast<SdrObject const *>(this)); return 0; } diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 3e109c75fceb..ac67d6214938 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -298,7 +298,7 @@ SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const const SwFlyFrm *pFly = pAnch->FindFlyFrm(); if ( pFly ) { - SdrObject *pRet = (SdrObject*)pFly->GetVirtDrawObj(); + SdrObject *pRet = const_cast<SdrObject*>(static_cast<SdrObject const *>(pFly->GetVirtDrawObj())); return pRet != pObj ? pRet : 0; } } diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 72d76a34b384..f498f753912c 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -574,14 +574,14 @@ sfx2::LinkManager& SwEditShell::GetLinkManager() void *SwEditShell::GetIMapInventor() const { // The node on which the cursor points should be sufficient as a unique identifier - return (void*)&(GetCrsr()->GetNode()); + return static_cast<void*>(&(GetCrsr()->GetNode())); } // #i73788# Graphic SwEditShell::GetIMapGraphic() const { // returns always a graphic if the cursor is in a Fly - SET_CURR_SHELL( (SwViewShell*)this ); + SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) ); Graphic aRet; SwPaM* pCrsr = GetCrsr(); if ( !pCrsr->HasMark() ) diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index 2303e07a3a45..b87ec6f742d6 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -172,7 +172,7 @@ SwMvContext::~SwMvContext() SwFrameFormat *SwEditShell::GetTableFormat() // fastest test on a table { const SwTableNode* pTableNd = IsCrsrInTable(); - return pTableNd ? (SwFrameFormat*)pTableNd->GetTable().GetFrameFormat() : 0; + return pTableNd ? static_cast<SwFrameFormat*>(pTableNd->GetTable().GetFrameFormat()) : 0; } // TODO: Why is this called 3x for a new document? diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index ec4f7c4ae7d2..f8fa23ce9d9b 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -88,7 +88,7 @@ void SwAuthorityFieldType::RemoveField(sal_IntPtr nHandle) for(SwAuthDataArr::size_type j = 0; j < m_DataArr.size(); ++j) { SwAuthEntry* pTemp = &m_DataArr[j]; - sal_IntPtr nRet = reinterpret_cast<sal_IntPtr>((void*)pTemp); + sal_IntPtr nRet = reinterpret_cast<sal_IntPtr>(static_cast<void*>(pTemp)); if(nRet == nHandle) { pTemp->RemoveRef(); @@ -117,14 +117,14 @@ sal_IntPtr SwAuthorityFieldType::AddField(const OUString& rFieldContents) if(rTemp == *pEntry) { delete pEntry; - nRet = reinterpret_cast<sal_IntPtr>((void*)&rTemp); + nRet = reinterpret_cast<sal_IntPtr>(static_cast<void*>(&rTemp)); rTemp.AddRef(); return nRet; } } //if it is a new Entry - insert - nRet = reinterpret_cast<sal_IntPtr>((void*)pEntry); + nRet = reinterpret_cast<sal_IntPtr>(static_cast<void*>(pEntry)); pEntry->AddRef(); m_DataArr.push_back(pEntry); //re-generate positions of the fields @@ -136,7 +136,7 @@ bool SwAuthorityFieldType::AddField(sal_IntPtr nHandle) { for(auto &rTemp : m_DataArr) { - sal_IntPtr nTmp = reinterpret_cast<sal_IntPtr>((void*)&rTemp); + sal_IntPtr nTmp = reinterpret_cast<sal_IntPtr>(static_cast<void*>(&rTemp)); if( nTmp == nHandle ) { rTemp.AddRef(); @@ -153,7 +153,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(sal_IntPtr nHandle) c { for(auto &rTemp : m_DataArr) { - sal_IntPtr nTmp = reinterpret_cast<sal_IntPtr>((void*)&rTemp); + sal_IntPtr nTmp = reinterpret_cast<sal_IntPtr>(static_cast<void const *>(&rTemp)); if( nTmp == nHandle ) { return &rTemp; @@ -224,7 +224,7 @@ sal_IntPtr SwAuthorityFieldType::GetHandle(sal_uInt16 nPos) if( nPos < m_DataArr.size() ) { SwAuthEntry* pTemp = &m_DataArr[nPos]; - return reinterpret_cast<sal_IntPtr>((void*)pTemp); + return reinterpret_cast<sal_IntPtr>(static_cast<void*>(pTemp)); } return 0; } diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 1010f0032b8e..a44b3db93441 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -548,7 +548,7 @@ void SwTableFormula::PtrToBoxNm( const SwTable* pTable ) case EXTRNL_NAME: return; } - m_sFormula = ScanString( fnFormula, *pTable, (void*)pNd ); + m_sFormula = ScanString( fnFormula, *pTable, const_cast<void*>(static_cast<void const *>(pNd)) ); m_eNmType = EXTRNL_NAME; } @@ -573,7 +573,7 @@ void SwTableFormula::BoxNmToPtr( const SwTable* pTable ) case INTRNL_NAME: return; } - m_sFormula = ScanString( fnFormula, *pTable, (void*)pNd ); + m_sFormula = ScanString( fnFormula, *pTable, const_cast<void*>(static_cast<void const *>(pNd)) ); m_eNmType = INTRNL_NAME; } @@ -595,7 +595,7 @@ void SwTableFormula::ToRelBoxNm( const SwTable* pTable ) case REL_NAME: return; } - m_sFormula = ScanString( fnFormula, *pTable, (void*)pNd ); + m_sFormula = ScanString( fnFormula, *pTable, const_cast<void*>(static_cast<void const *>(pNd)) ); m_eNmType = REL_NAME; } @@ -1196,7 +1196,7 @@ void SwTableFormula::ToSplitMergeBoxNm( SwTableFormulaUpdate& rTableUpd ) else pTable = rTableUpd.pTable; - m_sFormula = ScanString( &SwTableFormula::_SplitMergeBoxNm, *pTable, (void*)&rTableUpd ); + m_sFormula = ScanString( &SwTableFormula::_SplitMergeBoxNm, *pTable, static_cast<void*>(&rTableUpd) ); m_eNmType = INTRNL_NAME; } diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index b4823e6a61e2..9f6a74d2fcd6 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -156,7 +156,7 @@ bool SwDDETable::NoDDETable() if( aLines.empty() ) return false; OSL_ENSURE( !GetTabSortBoxes().empty(), "Table without content?" ); - SwNode* pNd = (SwNode*)GetTabSortBoxes()[0]->GetSttNd(); + SwNode* pNd = const_cast<SwNode*>(static_cast<SwNode const *>(GetTabSortBoxes()[0]->GetSttNd())); if( !pNd->GetNodes().IsDocNodes() ) return false; diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 35d9210e26f8..391ce161675e 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -93,7 +93,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc ) aNew.SetNumOffset( oPageNumOffset ); if ( pFlow->IsInTab() ) - GetDoc()->SetAttr( aNew, *(SwFormat*)pFlow->FindTabFrm()->GetFormat() ); + GetDoc()->SetAttr( aNew, *const_cast<SwFormat*>(static_cast<SwFormat const *>(pFlow->FindTabFrm()->GetFormat())) ); else { SwPaM aPaM( *static_cast<const SwContentFrm*>(pFlow)->GetNode() ); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 2937f04928e4..7a73af074341 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -985,7 +985,7 @@ bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const } } - SET_CURR_SHELL( (SwViewShell*)this ); + SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) ); if( !rSet.Set( pFly->GetFormat()->GetAttrSet(), true ) ) return false; @@ -1823,8 +1823,8 @@ void SwFEShell::GetConnectableFrameFormats(SwFrameFormat & rFormat, StartAction(); SwFormatChain rChain = rFormat.GetChain(); - SwFrameFormat * pOldChainNext = (SwFrameFormat *) rChain.GetNext(); - SwFrameFormat * pOldChainPrev = (SwFrameFormat *) rChain.GetPrev(); + SwFrameFormat * pOldChainNext = static_cast<SwFrameFormat *>(rChain.GetNext()); + SwFrameFormat * pOldChainPrev = static_cast<SwFrameFormat *>(rChain.GetPrev()); if (pOldChainNext) mpDoc->Unchain(rFormat); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 4b46bfc02103..b72bead59631 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -111,7 +111,7 @@ static void lcl_GrabCursor( SwFEShell* pSh, SwFlyFrm* pOldSelFly) (!pOldSelFly || pOldSelFly->GetFormat() != pFlyFormat) ) { // now call set macro if applicable - pSh->GetFlyMacroLnk().Call( (void*)pFlyFormat ); + pSh->GetFlyMacroLnk().Call( const_cast<void*>(static_cast<void const *>(pFlyFormat)) ); extern bool g_bNoInterrupt; // in swmodule.cxx // if a dialog was started inside a macro, then // MouseButtonUp arrives at macro and not to us. Therefore @@ -552,7 +552,7 @@ FrmTypeFlags SwFEShell::GetSelFrmType() const { // obtain marked item as fly frame; if no fly frame, it must // be a draw object - const SwFlyFrm* pFly = ::GetFlyFromMarked(pMarkList, (SwViewShell*)this); + const SwFlyFrm* pFly = ::GetFlyFromMarked(pMarkList, const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this))); if ( pFly != NULL ) { if( pFly->IsFlyLayFrm() ) @@ -978,7 +978,7 @@ bool SwFEShell::IsFrmSelected() const return false; else return 0 != ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(), - (SwViewShell*)this ); + const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) ); } bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 78d406b4cb87..44dd490907d8 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -70,7 +70,7 @@ void SwFEShell::EndAllActionAndCall() // Determine the Content's nearest to the point Point SwFEShell::GetContentPos( const Point& rPoint, bool bNext ) const { - SET_CURR_SHELL( (SwViewShell*)this ); + SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) ); return GetLayout()->GetNextPrevContentPos( rPoint, bNext ); } @@ -79,7 +79,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, { const SwFrm *pFrm = Imp()->HasDrawView() ? ::GetFlyFromMarked( &Imp()->GetDrawView()->GetMarkedObjectList(), - (SwViewShell*)this) + const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this))) : 0; if( !pFrm ) @@ -597,8 +597,8 @@ sal_uInt16 SwFEShell::GetCurOutColNum( SwGetCurColNumPara* pPara ) const OSL_ENSURE( pFrm, "Crsr parked?" ); if( pFrm ) { - pFrm = pFrm->IsInTab() ? (SwFrm*)pFrm->FindTabFrm() - : (SwFrm*)pFrm->FindSctFrm(); + pFrm = pFrm->IsInTab() ? static_cast<SwFrm*>(pFrm->FindTabFrm()) + : static_cast<SwFrm*>(pFrm->FindSctFrm()); OSL_ENSURE( pFrm, "No Tab, no Sect" ); if( pFrm ) nRet = _GetCurColNum( pFrm, pPara ); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 5c2867e5a6a2..f2e55e34ac2c 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -520,7 +520,7 @@ bool SwGrfNode::SwapIn( bool bWaitForData ) bool bRet = false; bInSwapIn = true; - SwBaseLink* pLink = static_cast<SwBaseLink*>((::sfx2::SvBaseLink*) refLink); + SwBaseLink* pLink = static_cast<SwBaseLink*>(static_cast<sfx2::SvBaseLink*>(refLink)); if( pLink ) { @@ -737,7 +737,7 @@ void SwGrfNode::ReleaseLink() { bInSwapIn = true; - SwBaseLink* pLink = static_cast<SwBaseLink*>((::sfx2::SvBaseLink*) refLink); + SwBaseLink* pLink = static_cast<SwBaseLink*>(static_cast<sfx2::SvBaseLink*>(refLink)); pLink->SwapIn( true, true ); bInSwapIn = false; } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 93d139c25f3f..e48f4be06632 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -159,7 +159,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrameFormat *pFormat ) pNode = & aIdx.GetNode(); } } - rCnt.SetNewContentIdx( (const SwNodeIndex*)0 ); + rCnt.SetNewContentIdx( nullptr ); // When deleting a header/footer-format, we ALWAYS need to disable // the undo function (Bug 31069) @@ -2696,7 +2696,7 @@ SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint, else { const sal_uInt16 nFrmType = RES_FLYFRMFMT == Which() ? FRM_FLY : USHRT_MAX; - pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, nFrmType, pPoint, + pFrm = ::GetFrmOfModify( 0, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), nFrmType, pPoint, 0, bCalcFrm ); } @@ -3049,7 +3049,7 @@ void SwFlyFrameFormat::MakeFrms() SwFlyFrm* SwFlyFrameFormat::GetFrm( const Point* pPoint, const bool bCalcFrm ) const { - return static_cast<SwFlyFrm*>(::GetFrmOfModify( 0, *(SwModify*)this, FRM_FLY, + return static_cast<SwFlyFrm*>(::GetFrmOfModify( 0, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), FRM_FLY, pPoint, 0, bCalcFrm )); } diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index ec2da7d8f385..e52cfd0d0447 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1314,7 +1314,7 @@ void SwContentFrm::MakeAll() { // In this Prepare, an _InvalidateSize() might happen. // mbValidSize becomes false and Format() gets called. - Prepare( PREP_POS_CHGD, (const void*)&bFormatted, false ); + Prepare( PREP_POS_CHGD, static_cast<const void*>(&bFormatted), false ); if ( bWidow && GetFollow() ) { Prepare( PREP_WIDOWS_ORPHANS, 0, false ); @@ -1370,7 +1370,7 @@ void SwContentFrm::MakeAll() MakePos(); if( aOldPos != (Frm().*fnRect->fnGetPos)() ) { - Prepare( PREP_POS_CHGD, (const void*)&bFormatted, false ); + Prepare( PREP_POS_CHGD, static_cast<const void*>(&bFormatted), false ); if ( !mbValidSize ) { (Frm().*fnRect->fnSetWidth)( (GetUpper()-> @@ -1801,7 +1801,7 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, // Within footnotes, we may even need to put the SwFootnoteFrm somewhere else, if // there's no SwFootnoteFrm there. SwFrm* pTmpFrm = pFrm->IsInFootnote() && !pNewUpper->FindFootnoteFrm() ? - (SwFrm*)pFrm->FindFootnoteFrm() : pFrm; + static_cast<SwFrm*>(pFrm->FindFootnoteFrm()) : pFrm; SwLayoutFrm *pUp = pTmpFrm->GetUpper(); SwFrm *pOldNext = pTmpFrm->GetNext(); pTmpFrm->RemoveFromLayout(); diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx index 60d73c5c58ed..244dac889d09 100644 --- a/sw/source/core/layout/dumpfilter.cxx +++ b/sw/source/core/layout/dumpfilter.cxx @@ -104,7 +104,7 @@ namespace sw // Dump the layout XML into the XOutputStream xmlOutputBufferPtr outBuffer = xmlOutputBufferCreateIO( - writeCallback, closeCallback, ( void* ) xOut.get(), NULL ); + writeCallback, closeCallback, static_cast<void*>(xOut.get()), NULL ); xmlTextWriterPtr writer = xmlNewTextWriter( outBuffer ); xmlTextWriterSetIndent(writer, 1); diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 18189ba9ad95..fdf9ca38fc9e 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1088,7 +1088,7 @@ SwFrm *SwFrm::_FindPrev() (bFootnote && pPrvCnt->IsInFootnote()) ) { pRet = pPrvCnt->IsInTab() ? pPrvCnt->FindTabFrm() - : (SwFrm*)pPrvCnt; + : static_cast<SwFrm*>(pPrvCnt); return pRet; } pPrvCnt = pPrvCnt->GetPrevContentFrm(); @@ -1097,7 +1097,7 @@ SwFrm *SwFrm::_FindPrev() else if ( pThis->IsInFly() ) { pRet = pPrvCnt->IsInTab() ? pPrvCnt->FindTabFrm() - : (SwFrm*)pPrvCnt; + : static_cast<SwFrm*>(pPrvCnt); return pRet; } else // footer or header or Fly @@ -1112,7 +1112,7 @@ SwFrm *SwFrm::_FindPrev() if ( pCntUp == pUp ) { pRet = pPrvCnt->IsInTab() ? pPrvCnt->FindTabFrm() - : (SwFrm*)pPrvCnt; + : static_cast<SwFrm*>(pPrvCnt); return pRet; } } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 41cac22cbd5f..197a68d8e8f8 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2482,7 +2482,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) SwPageFrm *pNewPage = m_rThis.FindPageFrm(); if( pNewPage != pOldPage ) { - m_rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, false ); + m_rThis.Prepare( PREP_BOSS_CHGD, static_cast<const void*>(pOldPage), false ); SwViewShell *pSh = m_rThis.getRootFrm()->GetCurrShell(); if ( pSh && !pSh->Imp()->IsUpdateExpFields() ) pSh->GetDoc()->getIDocumentFieldsAccess().SetNewFieldLst(true); // Will be done by CalcLayout() later on diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 4d7c3d81ecb6..02eed3a77595 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -197,7 +197,7 @@ void SwFlyFrm::InsertCnt() OSL_ENSURE( rContent.GetContentIdx(), ":-( no content prepared." ); sal_uLong nIndex = rContent.GetContentIdx()->GetIndex(); // Lower() means SwColumnFrm; the Content then needs to be inserted into the (Column)BodyFrm - ::_InsertCnt( Lower() ? static_cast<SwLayoutFrm*>(static_cast<SwLayoutFrm*>(Lower())->Lower()) : (SwLayoutFrm*)this, + ::_InsertCnt( Lower() ? static_cast<SwLayoutFrm*>(static_cast<SwLayoutFrm*>(Lower())->Lower()) : static_cast<SwLayoutFrm*>(this), GetFormat()->GetDoc(), nIndex ); // NoText always have a fixed height. diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index dde26732eff6..cbd0d3045e78 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -187,7 +187,7 @@ void SwFlyInCntFrm::NotifyBackground( SwPageFrm *, const SwRect& rRect, if ( eHint == PREP_FLY_ATTR_CHG ) AnchorFrm()->Prepare( PREP_FLY_ATTR_CHG ); else - AnchorFrm()->Prepare( eHint, (void*)&rRect ); + AnchorFrm()->Prepare( eHint, static_cast<void const *>(&rRect) ); } const Point SwFlyInCntFrm::GetRelPos() const diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index dd4866f44993..a5b27b6f5725 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -549,7 +549,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) { if ( !pNew->GetVirtDrawObj()->IsInserted() ) getRootFrm()->GetDrawPage()->InsertObject( - (SdrObject*)pNew->GetVirtDrawObj(), + static_cast<SdrObject*>(pNew->GetVirtDrawObj()), pNew->GetVirtDrawObj()->GetReferencedObj().GetOrdNumDirect() ); InvalidateSpelling(); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 3855f33ed544..698772a2434d 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2207,11 +2207,11 @@ void SwBorderAttrs::_GetBottomLine( const SwFrm& _rFrm ) SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) : SwCacheAccess( rCach, (pFrm->IsContentFrm() ? - (void*)static_cast<const SwContentFrm*>(pFrm)->GetNode() : - (void*)static_cast<const SwLayoutFrm*>(pFrm)->GetFormat()), + const_cast<void*>(static_cast<void const *>(static_cast<const SwContentFrm*>(pFrm)->GetNode())) : + const_cast<void*>(static_cast<void const *>(static_cast<const SwLayoutFrm*>(pFrm)->GetFormat()))), (pFrm->IsContentFrm() ? - ((SwModify*)static_cast<const SwContentFrm*>(pFrm)->GetNode())->IsInCache() : - ((SwModify*)static_cast<const SwLayoutFrm*>(pFrm)->GetFormat())->IsInCache()) ), + static_cast<SwModify const *>(static_cast<const SwContentFrm*>(pFrm)->GetNode())->IsInCache() : + static_cast<SwModify const *>(static_cast<const SwLayoutFrm*>(pFrm)->GetFormat())->IsInCache()) ), pConstructor( pFrm ) { } @@ -2886,7 +2886,7 @@ static void lcl_NotifyContent( const SdrObject *pThis, SwContentFrm *pCnt, // #i23129# - only invalidate, if the text frame // printing area overlaps with the given rectangle. else if ( aCntPrt.IsOver( rRect ) ) - pCnt->Prepare( eHint, (void*)&aCntPrt._Intersection( rRect ) ); + pCnt->Prepare( eHint, static_cast<void*>(&aCntPrt._Intersection( rRect )) ); if ( pCnt->GetDrawObjs() ) { const SwSortedObjs &rObjs = *pCnt->GetDrawObjs(); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 4836695768c2..ca53eda8e784 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -780,7 +780,7 @@ SwLayoutFrm *SwFrm::GetPrevFootnoteLeaf( MakePageType eMakeFootnote ) const SwFootnoteBossFrm* pNewBoss = pRet->FindFootnoteBossFrm(); bool bJump = false; if( pOldBoss->IsColumnFrm() && pOldBoss->GetPrev() ) // a previous column exists - bJump = pOldBoss->GetPrev() != (SwFrm*)pNewBoss; // did we chose it? + bJump = pOldBoss->GetPrev() != static_cast<SwFrm const *>(pNewBoss); // did we chose it? else if( pNewBoss->IsColumnFrm() && pNewBoss->GetNext() ) bJump = true; // there is another column after the boss (not the old boss) else @@ -846,7 +846,7 @@ void sw_RemoveFootnotes( SwFootnoteBossFrm* pBoss, bool bPageOnly, bool bEndNote if ( !pFootnote->GetAttr()->GetFootnote().IsEndNote() || bEndNotes ) { - pFootnote->GetRef()->Prepare( PREP_FTN, (void*)pFootnote->GetAttr() ); + pFootnote->GetRef()->Prepare( PREP_FTN, static_cast<void*>(pFootnote->GetAttr()) ); if ( bPageOnly && !pNxt ) pNxt = pFootnote->GetFollow(); pFootnote->Cut(); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index c06706e0dc06..5289d58faf3a 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1094,7 +1094,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) if ( pContent->IsInSct() ) { - const SwSectionFrm *pSct = ((SwFrm*)pContent)->ImplFindSctFrm(); + const SwSectionFrm *pSct = const_cast<SwFrm*>(static_cast<SwFrm const *>(pContent))->ImplFindSctFrm(); if ( !pSct->IsValid() ) { pSct->Calc(); @@ -1120,7 +1120,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) if ( !bPageChg && pContent->IsInTab() ) { - const SwTabFrm *pTab = ((SwFrm*)pContent)->ImplFindTabFrm(); + const SwTabFrm *pTab = const_cast<SwFrm*>(static_cast<SwFrm const *>(pContent))->ImplFindTabFrm(); if ( !pTab->IsValid() ) { pTab->Calc(); @@ -1135,7 +1135,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) if ( !bPageChg && pContent->IsInSct() ) { - const SwSectionFrm *pSct = ((SwFrm*)pContent)->ImplFindSctFrm(); + const SwSectionFrm *pSct = const_cast<SwFrm*>(static_cast<SwFrm const *>(pContent))->ImplFindSctFrm(); if ( !pSct->IsValid() ) { pSct->Calc(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index eb770178616a..95493a149f6a 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1663,7 +1663,7 @@ static void lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, ) { SwRect aRect; - SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly ); + SwBorderAttrAccess aAccess( SwFrm::GetCache(), static_cast<SwFrm const *>(pFly) ); const SwBorderAttrs &rAttrs = *aAccess.Get(); ::lcl_CalcBorderRect( aRect, pFly, rAttrs, true, rProperties ); rRegion -= aRect; @@ -1680,7 +1680,7 @@ static void lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, //So the border won't get dismantled by the background of the other //Fly. SwRect aRect; - SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly ); + SwBorderAttrAccess aAccess( SwFrm::GetCache(), static_cast<SwFrm const *>(pFly) ); const SwBorderAttrs &rAttrs = *aAccess.Get(); ::lcl_CalcBorderRect( aRect, pFly, rAttrs, true, rProperties ); rRegion -= aRect; @@ -3202,7 +3202,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c gProp.pSGlobalShell = pSh; if( !pSh->GetWin() ) - gProp.pSProgress = SfxProgress::GetActiveProgress( (SfxObjectShell*) pSh->GetDoc()->GetDocShell() ); + gProp.pSProgress = SfxProgress::GetActiveProgress( static_cast<SfxObjectShell*>(pSh->GetDoc()->GetDocShell()) ); ::SwCalcPixStatics( pSh->GetOut() ); aGlobalRetoucheColor = pSh->Imp()->GetRetoucheColor(); @@ -4246,7 +4246,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const pPage = FindPageFrm(); - SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)this ); + SwBorderAttrAccess aAccess( SwFrm::GetCache(), static_cast<SwFrm const *>(this) ); const SwBorderAttrs &rAttrs = *aAccess.Get(); // paint background @@ -4376,7 +4376,7 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const // #i29550# if ( IsCollapsingBorders() ) { - SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)this ); + SwBorderAttrAccess aAccess( SwFrm::GetCache(), static_cast<SwFrm const *>(this) ); const SwBorderAttrs &rAttrs = *aAccess.Get(); // paint shadow diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index e9cc07bd9833..3922b7a9d3da 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -914,9 +914,9 @@ static void lcl_ColumnRefresh( SwSectionFrm* pSect, bool bFollow ) do { pCol->_InvalidateSize(); pCol->_InvalidatePos(); - ((SwLayoutFrm*)pCol)->Lower()->_InvalidateSize(); + static_cast<SwLayoutFrm*>(pCol)->Lower()->_InvalidateSize(); pCol->Calc(); // calculation of column and - ((SwLayoutFrm*)pCol)->Lower()->Calc(); // body + static_cast<SwLayoutFrm*>(pCol)->Lower()->Calc(); // body pCol = static_cast<SwColumnFrm*>(pCol->GetNext()); } while ( pCol ); } @@ -1859,7 +1859,7 @@ bool SwSectionFrm::Growable() const (Frm().*fnRect->fnGetBottom)() ) > 0 ) return true; - return ( GetUpper() && ((SwFrm*)GetUpper())->Grow( LONG_MAX, true ) ); + return ( GetUpper() && const_cast<SwFrm*>(static_cast<SwFrm const *>(GetUpper()))->Grow( LONG_MAX, true ) ); } SwTwips SwSectionFrm::_Grow( SwTwips nDist, bool bTst ) @@ -2124,7 +2124,7 @@ bool SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const if( IsInTab() || ( !IsInDocBody() && FindFooterOrHeader() ) ) return false; // It doesn't work in tables/headers/footers if( IsInFly() ) // In column based or chained frames - return 0 != ((SwFrm*)GetUpper())->GetNextLeaf( MAKEPAGE_NONE ); + return 0 != const_cast<SwFrm*>(static_cast<SwFrm const *>(GetUpper()))->GetNextLeaf( MAKEPAGE_NONE ); return true; } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index c2f63c184c95..6b2202f70666 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2098,7 +2098,7 @@ void SwTabFrm::MakeAll() } if ( nOld != (Frm().*fnRect->fnGetHeight)() ) - lcl_RecalcTable( *this, (SwLayoutFrm*)pRow, aNotify ); + lcl_RecalcTable( *this, static_cast<SwLayoutFrm*>(pRow), aNotify ); continue; } @@ -2394,7 +2394,7 @@ void SwTabFrm::MakeAll() if ( !GetFollow()->GetFollow() ) { - SwFrm* pNxt = ((SwFrm*)GetFollow())->FindNext(); + SwFrm* pNxt = static_cast<SwFrm*>(GetFollow())->FindNext(); if ( pNxt ) { // #i18103# - no formatting of found next diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 73ca1dd29ed8..537a0f11e059 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1450,9 +1450,9 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) { const bool bFootnotePage = pBoss->IsPageFrm() && static_cast<const SwPageFrm*>(pBoss)->IsFootnotePage(); if ( bFootnotePage && !IsFootnoteContFrm() ) - pFrm = (SwFrm*)pBoss->FindFootnoteCont(); + pFrm = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoss->FindFootnoteCont())); if ( !pFrm ) - pFrm = (SwFrm*)pBoss->FindBodyCont(); + pFrm = const_cast<SwFrm*>(static_cast<SwFrm const *>(pBoss->FindBodyCont())); if ( !pFrm ) return 0; diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 3f4af08fa8ea..fdc6d6ff24ca 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -207,20 +207,20 @@ void* lcl_GetKeyFromFrame( const SwFrm& rFrm ) void* pKey = 0; if ( rFrm.IsPageFrm() ) - pKey = (void*)static_cast<const SwPageFrm&>(rFrm).GetFormat()->getIDocumentSettingAccess(); + pKey = const_cast<void*>(static_cast<void const *>((static_cast<const SwPageFrm&>(rFrm).GetFormat()->getIDocumentSettingAccess()))); else if ( rFrm.IsTextFrm() ) - pKey = (void*)static_cast<const SwTextFrm&>(rFrm).GetTextNode(); + pKey = const_cast<void*>(static_cast<void const *>(static_cast<const SwTextFrm&>(rFrm).GetTextNode())); else if ( rFrm.IsSctFrm() ) - pKey = (void*)static_cast<const SwSectionFrm&>(rFrm).GetSection(); + pKey = const_cast<void*>(static_cast<void const *>(static_cast<const SwSectionFrm&>(rFrm).GetSection())); else if ( rFrm.IsTabFrm() ) - pKey = (void*)static_cast<const SwTabFrm&>(rFrm).GetTable(); + pKey = const_cast<void*>(static_cast<void const *>(static_cast<const SwTabFrm&>(rFrm).GetTable())); else if ( rFrm.IsRowFrm() ) - pKey = (void*)static_cast<const SwRowFrm&>(rFrm).GetTabLine(); + pKey = const_cast<void*>(static_cast<void const *>(static_cast<const SwRowFrm&>(rFrm).GetTabLine())); else if ( rFrm.IsCellFrm() ) { const SwTabFrm* pTabFrm = rFrm.FindTabFrm(); const SwTable* pTable = pTabFrm->GetTable(); - pKey = (void*) & static_cast<const SwCellFrm&>(rFrm).GetTabBox()->FindStartOfRowSpan( *pTable ); + pKey = const_cast<void*>(static_cast<void const *>(& static_cast<const SwCellFrm&>(rFrm).GetTabBox()->FindStartOfRowSpan( *pTable ))); } return pKey; @@ -235,7 +235,7 @@ bool lcl_HasPreviousParaSameNumRule( const SwTextNode& rNode ) const SwNode* pNode = &rNode; const SwNumRule* pNumRule = rNode.GetNumRule(); - while (! (pNode == rNodes.DocumentSectionStartNode((SwNode*)&rNode) ) ) + while (! (pNode == rNodes.DocumentSectionStartNode(const_cast<SwNode*>(static_cast<SwNode const *>(&rNode))) ) ) { --aIdx; diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 51abdd35146f..86d173fd1d4f 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -192,7 +192,7 @@ bool SwTextFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, SwTextFrm *pFrm = GetAdjFrmAtPos( const_cast<SwTextFrm*>(this), rPos, bRightMargin, bNoScroll ); pFrm->GetFormatted(); - const SwFrm* pTmpFrm = (SwFrm*)pFrm->GetUpper(); + const SwFrm* pTmpFrm = static_cast<SwFrm*>(pFrm->GetUpper()); SWRECTFN ( pFrm ) const SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)(); @@ -362,7 +362,7 @@ bool SwTextFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const SwTextFrm* pFrm = &(const_cast<SwTextFrm*>(this)->GetFrmAtOfst( nOffset )); pFrm->GetFormatted(); - const SwFrm* pTmpFrm = (SwFrm*)pFrm->GetUpper(); + const SwFrm* pTmpFrm = static_cast<SwFrm*>(pFrm->GetUpper()); SWRECTFN( pTmpFrm ) SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)(); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 3e6467424851..5ecb0b3f4bae 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -143,7 +143,7 @@ sal_uInt16 SwTextFormatter::GetFrmRstHeight() const // GetFrmRstHeight() is being called with Footnote. // Wrong: const SwFrm *pUpper = pFrm->GetUpper(); - const SwFrm *pPage = (const SwFrm*)pFrm->FindPageFrm(); + const SwFrm *pPage = static_cast<const SwFrm*>(pFrm->FindPageFrm()); const SwTwips nHeight = pPage->Frm().Top() + pPage->Prt().Top() + pPage->Prt().Height() - Y(); @@ -279,7 +279,7 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf ) if( pPor->InTextGrp() && !pPor->InExpGrp() ) { const sal_uInt16 nOldWhich = pCurr->GetWhichPor(); - *(SwLinePortion*)pCurr = *pPor; + *static_cast<SwLinePortion*>(pCurr) = *pPor; pCurr->SetPortion( pPor->GetPortion() ); pCurr->SetWhichPor( nOldWhich ); pPor->SetPortion( 0 ); @@ -1031,7 +1031,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) if( !rInf.IsErgoDone() ) { if( pFrm->IsInFootnote() && !pFrm->GetIndPrev() ) - pPor = (SwLinePortion*)NewErgoSumPortion( rInf ); + pPor = static_cast<SwLinePortion*>(NewErgoSumPortion( rInf )); rInf.SetErgoDone( true ); } @@ -1076,7 +1076,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) const bool bFootnoteNum = pFrm->IsFootnoteNumFrm(); rInf.GetParaPortion()->SetFootnoteNum( bFootnoteNum ); if( bFootnoteNum ) - pPor = (SwLinePortion*)NewFootnoteNumPortion( rInf ); + pPor = static_cast<SwLinePortion*>(NewFootnoteNumPortion( rInf )); rInf.SetFootnoteDone( true ); } @@ -1085,7 +1085,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) if( !rInf.IsErgoDone() && !pPor && ! rInf.IsMulti() ) { if( pFrm->IsInFootnote() && !pFrm->GetIndPrev() ) - pPor = (SwLinePortion*)NewErgoSumPortion( rInf ); + pPor = static_cast<SwLinePortion*>(NewErgoSumPortion( rInf )); rInf.SetErgoDone( true ); } @@ -1097,12 +1097,12 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) // If we're in the follow, then of course not if( GetTextFrm()->GetTextNode()->GetNumRule() ) - pPor = (SwLinePortion*)NewNumberPortion( rInf ); + pPor = static_cast<SwLinePortion*>(NewNumberPortion( rInf )); rInf.SetNumDone( true ); } // 8. The DropCaps if( !pPor && GetDropFormat() && ! rInf.IsMulti() ) - pPor = (SwLinePortion*)NewDropPortion( rInf ); + pPor = static_cast<SwLinePortion*>(NewDropPortion( rInf )); // 9. Kerning portions at beginning of line in grid mode if ( !pPor && !pCurr->GetPortion() ) @@ -2476,7 +2476,7 @@ SwFlyCntPortion *SwTextFormatter::NewFlyCntPortion( SwTextFormatInfo &rInf, SwTextAttr *pHint ) const { SwFlyCntPortion *pRet = 0; - const SwFrm *pFrame = (SwFrm*)pFrm; + const SwFrm *pFrame = static_cast<SwFrm*>(pFrm); SwFlyInCntFrm *pFly; SwFrameFormat* pFrameFormat = static_cast<SwTextFlyCnt*>(pHint)->GetFlyCnt().GetFrameFormat(); diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index a13c1501777b..dacc158f7a7d 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -656,7 +656,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const // follow field portions if ( ! IsFollow() ) { - SwLinePortion *pThis = (SwLinePortion*)this; + SwLinePortion *pThis = const_cast<SwLinePortion*>(static_cast<SwLinePortion const *>(this)); pThis->Width( nSumWidth ); rInf.DrawViewOpt( *this, POR_NUMBER ); pThis->Width( nOldWidth ); @@ -682,7 +682,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const else { // logical const: reset width - SwLinePortion *pThis = (SwLinePortion*)this; + SwLinePortion *pThis = const_cast<SwLinePortion*>(static_cast<SwLinePortion const *>(this)); bPaintSpace = bPaintSpace && nFixWidth < nOldWidth; sal_uInt16 nSpaceOffs = nFixWidth; pThis->Width( nFixWidth ); diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 792c9ef3b63e..d6efaabb72dc 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -190,7 +190,7 @@ public: inline SwLinePortion &SwLinePortion::operator=(const SwLinePortion &rPortion) { - *(SwPosSize*)this = rPortion; + *static_cast<SwPosSize*>(this) = rPortion; nLineLength = rPortion.nLineLength; nAscent = rPortion.nAscent; nWhichPor = rPortion.nWhichPor; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index aadea9a52914..5e78961844a9 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -210,7 +210,7 @@ SwTwips SwTextFrm::EmptyHeight() const if ( pSh->IsA( TYPE(SwCrsrShell) ) ) { SwCrsrShell *pCrSh = static_cast<SwCrsrShell*>(pSh); SwContentFrm *pCurrFrm=pCrSh->GetCurrFrm(); - if (pCurrFrm==(SwContentFrm*)this) { + if (pCurrFrm==static_cast<SwContentFrm const *>(this)) { // do nothing } else { return 1; diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx index 00a7d4549024..389cb67ef918 100644 --- a/sw/source/core/text/txtcache.cxx +++ b/sw/source/core/text/txtcache.cxx @@ -22,7 +22,7 @@ #include "porlay.hxx" SwTextLine::SwTextLine( SwTextFrm *pFrm, SwParaPortion *pNew ) : - SwCacheObj( (void*)pFrm ), + SwCacheObj( static_cast<void*>(pFrm) ), pLine( pNew ) { } diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 002af6921abb..8b585516db6e 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -454,7 +454,7 @@ const SwContentFrm* SwTextFly::_GetMaster() { pMaster = pCurrFrm; while( pMaster && pMaster->IsFollow() ) - pMaster = (SwContentFrm*)pMaster->FindMaster(); + pMaster = static_cast<SwContentFrm*>(pMaster->FindMaster()); return pMaster; } diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index d954926c9435..3ff2662ea7cd 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -466,7 +466,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrm *pFrame, SwTextMargin &rLine ) return false; } - pMaster->Prepare( PREP_WIDOWS, (void*)&nNeed ); + pMaster->Prepare( PREP_WIDOWS, static_cast<void*>(&nNeed) ); return true; } diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 3ba10e149c04..0b6a85269217 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -428,7 +428,7 @@ OUString SwForm::GetFormAuth() {return OUString("<A>");} SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm, sal_uInt16 nCreaType, const OUString& rTitle ) - : SwClient((SwModify*)pTyp) + : SwClient(const_cast<SwModify*>(static_cast<SwModify const *>(pTyp))) , aForm(rForm) , aTitle(rTitle) , eLanguage((LanguageType)::GetAppLanguage()) diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index bca151d1dd74..ee67fa2bfa06 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -153,7 +153,7 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode ) if( !aAnchor.GetContentAnchor() || !aAnchor.GetContentAnchor()->nNode.GetNode().GetNodes().IsDocNodes() || - &aAnchor.GetContentAnchor()->nNode.GetNode() != (SwNode*)pNode ) + &aAnchor.GetContentAnchor()->nNode.GetNode() != static_cast<SwNode const *>(pNode) ) aPos.nNode = *pNode; else aPos.nNode = aAnchor.GetContentAnchor()->nNode; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 277a4d5cc6c5..54c8ab238420 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2400,7 +2400,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength, { // insert dummy span covering the gap o_rSpanMap.insert(AttrSpanMap_t::value_type( - AttrSpan_t(nLastEnd, aSpan.first), (const SwTextAttr *)0)); + AttrSpan_t(nLastEnd, aSpan.first), nullptr)); } nLastEnd = aSpan.second; @@ -2411,7 +2411,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength, if (nLastEnd != nLength && nLength != 0) { o_rSpanMap.insert( - AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), (const SwTextAttr *)0)); + AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), nullptr)); } } diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 6260382cc1e5..933df1518edc 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -168,7 +168,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) OSL_ENSURE( rContent.GetContentIdx(), "Fly ohne Inhalt" ); SaveSection( *rContent.GetContentIdx() ); - const_cast<SwFormatContent&>(rContent).SetNewContentIdx( (const SwNodeIndex*)0 ); + const_cast<SwFormatContent&>(rContent).SetNewContentIdx( nullptr ); } // OD 02.07.2003 #108784# - remove 'master' drawing object from drawing page else if ( RES_DRAWFRMFMT == pFrameFormat->Which() ) diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 21281a4fe268..f4e21ef873bc 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -305,7 +305,7 @@ void SwUndoInsTable::RedoImpl(::sw::UndoRedoContext & rContext) const SwTable* pTable = rDoc.InsertTable( aInsTableOpts, aPos, nRows, nCols, nAdjust, pAutoFormat, pColWidth ); - ((SwFrameFormat*)pTable->GetFrameFormat())->SetName( sTableNm ); + static_cast<SwFrameFormat*>(pTable->GetFrameFormat())->SetName( sTableNm ); SwTableNode* pTableNode = rDoc.GetNodes()[nSttNode]->GetTableNode(); if( pDDEFieldType ) @@ -793,7 +793,7 @@ void SwUndoTextToTable::RedoImpl(::sw::UndoRedoContext & rContext) SwTable const*const pTable = rContext.GetDoc().TextToTable( aInsTableOpts, rPam, cTrenner, nAdjust, pAutoFormat ); - ((SwFrameFormat*)pTable->GetFrameFormat())->SetName( sTableNm ); + static_cast<SwFrameFormat*>(pTable->GetFrameFormat())->SetName( sTableNm ); } void SwUndoTextToTable::RepeatImpl(::sw::RepeatContext & rContext) diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 8f805e537162..18606735ebf7 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -568,7 +568,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc) { SwVbaObjectForCodeNameProvider* pObjProv = new SwVbaObjectForCodeNameProvider(rDoc.GetDocShell()); - xRet = (cppu::OWeakObject*)pObjProv; + xRet = static_cast<cppu::OWeakObject*>(pObjProv); } #endif break; @@ -578,7 +578,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc) if (rDoc.GetDocShell() && ooo::vba::isAlienWordDoc(*rDoc.GetDocShell())) { SwVbaCodeNameProvider* pObjProv = new SwVbaCodeNameProvider(rDoc.GetDocShell()); - xRet = (cppu::OWeakObject*)pObjProv; + xRet = static_cast<cppu::OWeakObject*>(pObjProv); } } #endif @@ -702,7 +702,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc) : (eFamily == SFX_STYLE_FAMILY_FRAME) ? new SwXFrameStyle(&rDoc) : new SwXStyle(&rDoc, eFamily, nObjectType == SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE); - xRet = (cppu::OWeakObject*)pNewStyle; + xRet = static_cast<cppu::OWeakObject*>(pNewStyle); } break; case SW_SERVICE_FIELDTYPE_DATETIME: @@ -794,13 +794,13 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc) xRet = SwXParagraph::CreateXParagraph(rDoc, 0); break; case SW_SERVICE_NUMBERING_RULES : - xRet = (cppu::OWeakObject*)new SwXNumberingRules(rDoc); + xRet = static_cast<cppu::OWeakObject*>(new SwXNumberingRules(rDoc)); break; case SW_SERVICE_TEXT_COLUMNS : - xRet = (cppu::OWeakObject*)new SwXTextColumns(0); + xRet = static_cast<cppu::OWeakObject*>(new SwXTextColumns(0)); break; case SW_SERVICE_DEFAULTS: - xRet = (cppu::OWeakObject*)new SwXTextDefaults(&rDoc); + xRet = static_cast<cppu::OWeakObject*>(new SwXTextDefaults(&rDoc)); break; case SW_SERVICE_IMAP_RECTANGLE : xRet = SvUnoImageMapRectangleObject_createInstance( sw_GetSupportedMacroItems() ); @@ -817,7 +817,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc) // This should not happen during copy/paste, as this will unlink // charts using table data. if (rDoc.GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED) - xRet = (cppu::OWeakObject*) rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider( true /* create - if not yet available */ ); + xRet = static_cast<cppu::OWeakObject*>(rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider( true /* create - if not yet available */ )); else SAL_WARN("sw.uno", "not creating chart data provider for embedded object"); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index e0e668b8c3a3..de3afb5f6661 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -538,7 +538,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry if( pAny ) { const SwTableNode* pTableNode = pSttNode->FindTableNode(); - SwFrameFormat* pTableFormat = (SwFrameFormat*)pTableNode->GetTable().GetFrameFormat(); + SwFrameFormat* pTableFormat = static_cast<SwFrameFormat*>(pTableNode->GetTable().GetFrameFormat()); //SwTable& rTable = static_cast<SwTableNode*>(pSttNode)->GetTable(); if(FN_UNO_TEXT_TABLE == rEntry.nWID) { diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 42a8013ee4c5..d1b01a48f8cd 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -286,7 +286,7 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj SwXShape* pxShape = SwIterator<SwXShape,SwFormat>( *pFormat ).First(); if(pxShape) { - xShape = *(cppu::OWeakObject*)pxShape; + xShape = *static_cast<cppu::OWeakObject*>(pxShape); } else xShape = pObj->getUnoShape(); @@ -861,7 +861,7 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage() xPageAgg = *static_cast<uno::Reference< uno::XAggregation > const *>(aAgg.getValue()); } if( xPageAgg.is() ) - xPageAgg->setDelegator( (cppu::OWeakObject*)this ); + xPageAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) ); } return pDrawPage; } @@ -949,7 +949,7 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) : xShape = 0; m_refCount++; if( xShapeAgg.is() ) - xShapeAgg->setDelegator( (cppu::OWeakObject*)this ); + xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) ); m_refCount--; uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY); @@ -2139,7 +2139,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) uno::Any aPos; aPos <<= xTextRange; setPropertyValue("TextRange", aPos); - uno::Reference< drawing::XShape > xTemp( (cppu::OWeakObject*) this, uno::UNO_QUERY ); + uno::Reference< drawing::XShape > xTemp( static_cast<cppu::OWeakObject*>(this), uno::UNO_QUERY ); xDP->add( xTemp ); } } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 4d175fb843db..6d048c959410 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2648,7 +2648,7 @@ void SwXTextField::Impl::Modify( { case RES_REMOVE_UNO_OBJECT: case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) + if( static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) Invalidate(); break; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 89e716ceac83..bd09158a7301 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -290,7 +290,7 @@ void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem { case RES_REMOVE_UNO_OBJECT: case RES_OBJECTDYING: - if( (void*)pClient->GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) + if( static_cast<void*>(pClient->GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) pClient->GetRegisteredIn()->Remove(pClient); break; diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 8b578ff2369b..0417bbe3a093 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -1281,7 +1281,7 @@ static void lcl_CreatePortions( lcl_FillAnnotationStartArray( *pDoc, *pUnoCrsr, AnnotationStarts ); PortionStack_t PortionStack; - PortionStack.push( PortionList_t(&i_rPortions, (const SwTextAttr *)0) ); + PortionStack.push( PortionList_t(&i_rPortions, nullptr) ); std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pUnoCrsr->GetNode()); diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 4662759f9f56..3bcbdce084bf 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -3061,7 +3061,7 @@ sal_uInt16 SwXTextTable::getColumnCount() void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) { if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT && - (void*)GetRegisteredIn() == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) + static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) GetRegisteredIn()->Remove(this); else ClientModify(this, pOld, pNew); @@ -3946,7 +3946,7 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex) pFrameFormat->CallSwClientNotify(aHint); if(!aHint.m_pResult) aHint.m_pResult = new SwXTextTableRow(pFrameFormat, pLine); - uno::Reference<beans::XPropertySet> xRet = (beans::XPropertySet*)aHint.m_pResult; + uno::Reference<beans::XPropertySet> xRet = static_cast<beans::XPropertySet*>(aHint.m_pResult); return uno::makeAny(xRet); } diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 1c436df90235..81333b442ad2 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -155,8 +155,8 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow, mpImp( new SwViewShellImp( this ) ), mpWin( pWindow ), mpOut( pOutput ? pOutput - : pWindow ? (OutputDevice*)pWindow - : (OutputDevice*)rDocument.getIDocumentDeviceAccess().getPrinter( true )), + : pWindow ? static_cast<OutputDevice*>(pWindow) + : static_cast<OutputDevice*>(rDocument.getIDocumentDeviceAccess().getPrinter( true ))), mpTmpRef( 0 ), mpOpt( 0 ), mpAccOptions( new SwAccessibilityOptions ), @@ -231,8 +231,8 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow, mpImp( new SwViewShellImp( this ) ), mpWin( pWindow ), mpOut( pOutput ? pOutput - : pWindow ? (OutputDevice*)pWindow - : (OutputDevice*)rShell.GetDoc()->getIDocumentDeviceAccess().getPrinter( true )), + : pWindow ? static_cast<OutputDevice*>(pWindow) + : static_cast<OutputDevice*>(rShell.GetDoc()->getIDocumentDeviceAccess().getPrinter( true ))), mpTmpRef( 0 ), mpOpt( 0 ), mpAccOptions( new SwAccessibilityOptions ), diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index eda765bc9142..84a903d02662 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -423,14 +423,14 @@ SwHTMLImageWatcher::SwHTMLImageWatcher( // Als Event-Listener am Shape anmelden, damit wir es beim dispose // loslassen ko"onnen ... - uno::Reference< XEventListener > xEvtLstnr = (XEventListener *)this; + uno::Reference< XEventListener > xEvtLstnr = static_cast<XEventListener *>(this); uno::Reference< XComponent > xComp( xShape, UNO_QUERY ); xComp->addEventListener( xEvtLstnr ); // Zum Schluss halten wir noch eine Referenz auf uns selbst, damit // wir am Leben bleiben ... (eigentlich sollte das nicht neotig sein, // weil wir ja noch an diversen anderen Stellen angemeldet sind) - xThis = (awt::XImageConsumer *)this; + xThis = static_cast<awt::XImageConsumer *>(this); // und am ImageProducer anmelden, um die Groesse zu erehalten ... xSrc->getImageProducer()->addConsumer( xThis ); @@ -443,7 +443,7 @@ SwHTMLImageWatcher::~SwHTMLImageWatcher() void SwHTMLImageWatcher::clear() { // Am Shape als Event-Listener abmelden - uno::Reference< XEventListener > xEvtLstnr = (XEventListener *)this; + uno::Reference< XEventListener > xEvtLstnr = static_cast<XEventListener *>(this); uno::Reference< XComponent > xComp( xShape, UNO_QUERY ); xComp->removeEventListener( xEvtLstnr ); @@ -548,7 +548,7 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height ) // uns selbst abmelden und loeschen clear(); - uno::Reference< awt::XImageConsumer > xTmp = (awt::XImageConsumer*)this; + uno::Reference< awt::XImageConsumer > xTmp = static_cast<awt::XImageConsumer*>(this); xThis = 0; } @@ -581,7 +581,7 @@ void SwHTMLImageWatcher::complete( sal_Int32 Status, { // uns selbst abmelden und loeschen clear(); - uno::Reference< awt::XImageConsumer > xTmp = (awt::XImageConsumer*)this; + uno::Reference< awt::XImageConsumer > xTmp = static_cast<awt::XImageConsumer*>(this); xThis = 0; } } @@ -595,7 +595,7 @@ void SwHTMLImageWatcher::disposing(const lang::EventObject& evt) throw ( uno::Ru if( evt.Source == xShape ) { clear(); - xTmp = (awt::XImageConsumer*)this; + xTmp = static_cast<awt::XImageConsumer*>(this); xThis = 0; } } diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index d2a5fe33cbca..0fbcc5224df4 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -507,7 +507,7 @@ void SwHTMLParser::NewNumBulListItem( int nToken ) } SwTextNode* pTextNode = pPam->GetNode().GetTextNode(); - ((SwContentNode *)pTextNode)->SetAttr( SwNumRuleItem(aNumRuleName) ); + static_cast<SwContentNode *>(pTextNode)->SetAttr( SwNumRuleItem(aNumRuleName) ); pTextNode->SetAttrListLevel(nLevel); // #i57656# - <IsCounted()> state of text node has to be adjusted accordingly. if ( nLevel < MAXLEVEL ) @@ -604,7 +604,7 @@ void SwHTMLParser::SetNodeNum( sal_uInt8 nLevel, bool bCountedInList ) OSL_ENSURE( GetNumInfo().GetNumRule(), "Kein Numerierungs-Regel" ); const OUString& rName = GetNumInfo().GetNumRule()->GetName(); - ((SwContentNode *)pTextNode)->SetAttr( SwNumRuleItem(rName) ); + static_cast<SwContentNode *>(pTextNode)->SetAttr( SwNumRuleItem(rName) ); pTextNode->SetAttrListLevel( nLevel ); pTextNode->SetCountedInList( bCountedInList ); diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 6576adf1b414..c2acc8353624 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -3169,7 +3169,7 @@ void SvxCSS1Parser::ParseProperty( const OUString& rProperty, if( !bSortedPropFns ) { - qsort( (void*) aCSS1PropFnTab, + qsort( static_cast<void*>(aCSS1PropFnTab), sizeof( aCSS1PropFnTab ) / sizeof( CSS1PropEntry ), sizeof( CSS1PropEntry ), CSS1PropEntryCompare ); @@ -3184,7 +3184,7 @@ void SvxCSS1Parser::ParseProperty( const OUString& rProperty, void* pFound; if( 0 != ( pFound = bsearch( &aSrch, - (void*) aCSS1PropFnTab, + static_cast<void*>(aCSS1PropFnTab), sizeof( aCSS1PropFnTab ) / sizeof( CSS1PropEntry ), sizeof( CSS1PropEntry ), CSS1PropEntryCompare ))) diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 6f46915793a6..d3c221305e4e 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -105,7 +105,7 @@ uno::Sequence< OUString > SAL_CALL DocxExport_getSupportedServiceNames() throw() uno::Reference< uno::XInterface > SAL_CALL DocxExport_createInstance(const uno::Reference< uno::XComponentContext > & xCtx ) throw( uno::Exception ) { - return (cppu::OWeakObject*) new DocxExportFilter( xCtx ); + return static_cast<cppu::OWeakObject*>(new DocxExportFilter( xCtx )); } extern "C" diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx index 43f61ddef9ea..466e539ff1e3 100644 --- a/sw/source/filter/ww8/rtfexportfilter.cxx +++ b/sw/source/filter/ww8/rtfexportfilter.cxx @@ -114,7 +114,7 @@ uno::Sequence< OUString > SAL_CALL RtfExport_getSupportedServiceNames() throw() uno::Reference< uno::XInterface > SAL_CALL RtfExport_createInstance(const uno::Reference< uno::XComponentContext >& xCtx) throw(uno::Exception) { - return (cppu::OWeakObject*) new RtfExportFilter(xCtx); + return static_cast<cppu::OWeakObject*>(new RtfExportFilter(xCtx)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index de2c3d0236a0..9c4e50a615f0 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -306,7 +306,7 @@ SdrObject* SwWW8ImplReader::ReadLine(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) { WW8_DP_LINE aLine; - if( !ReadGrafStart( (void*)&aLine, sizeof( aLine ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aLine), sizeof( aLine ), pHd, rSet ) ) return 0; Point aP[2]; @@ -338,7 +338,7 @@ SdrObject* SwWW8ImplReader::ReadRect(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) { WW8_DP_RECT aRect; - if( !ReadGrafStart( (void*)&aRect, sizeof( aRect ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aRect), sizeof( aRect ), pHd, rSet ) ) return 0; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, @@ -359,7 +359,7 @@ SdrObject* SwWW8ImplReader::ReadElipse(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) { WW8_DP_ELIPSE aElipse; - if( !ReadGrafStart( (void*)&aElipse, sizeof( aElipse ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aElipse), sizeof( aElipse ), pHd, rSet ) ) return 0; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, @@ -380,7 +380,7 @@ SdrObject* SwWW8ImplReader::ReadArc(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) { WW8_DP_ARC aArc; - if( !ReadGrafStart( (void*)&aArc, sizeof( aArc ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aArc), sizeof( aArc ), pHd, rSet ) ) return 0; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, @@ -413,7 +413,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) { WW8_DP_POLYLINE aPoly; - if( !ReadGrafStart( (void*)&aPoly, sizeof( aPoly ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aPoly), sizeof( aPoly ), pHd, rSet ) ) return 0; sal_uInt16 nCount = SVBT16ToShort( aPoly.aBits1 ) >> 1 & 0x7fff; @@ -1158,7 +1158,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) bool bDummy; WW8_DP_TXTBOX aTextB; - if( !ReadGrafStart( (void*)&aTextB, sizeof( aTextB ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aTextB), sizeof( aTextB ), pHd, rSet ) ) return 0; Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) + m_nDrawXOfs2, @@ -1199,7 +1199,7 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) WW8_DP_CALLOUT_TXTBOX aCallB; - if( !ReadGrafStart( (void*)&aCallB, sizeof( aCallB ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&aCallB), sizeof( aCallB ), pHd, rSet ) ) return 0; sal_uInt16 nCount = SVBT16ToShort( aCallB.dpPolyLine.aBits1 ) >> 1 & 0x7fff; @@ -1252,7 +1252,7 @@ SdrObject *SwWW8ImplReader::ReadGroup(WW8_DPHEAD* pHd, SfxAllItemSet &rSet) { sal_Int16 nGrouped; - if( !ReadGrafStart( (void*)&nGrouped, sizeof( nGrouped ), pHd, rSet ) ) + if( !ReadGrafStart( static_cast<void*>(&nGrouped), sizeof( nGrouped ), pHd, rSet ) ) return 0; #ifdef OSL_BIGENDIAN diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 4cdeafc4a371..1df8650a0a6a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2091,7 +2091,7 @@ bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const return false; } rPos = pPLCF_PosArray[nInIdx]; - rpValue = pPLCF_Contents ? (void*)&pPLCF_Contents[nInIdx * nStru] : 0; + rpValue = pPLCF_Contents ? static_cast<void*>(&pPLCF_Contents[nInIdx * nStru]) : 0; return true; } @@ -2291,7 +2291,7 @@ bool WW8PLCF::Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const } rStart = pPLCF_PosArray[ nIdx ]; rEnd = pPLCF_PosArray[ nIdx + 1 ]; - rpValue = (void*)&pPLCF_Contents[nIdx * nStru]; + rpValue = static_cast<void*>(&pPLCF_Contents[nIdx * nStru]); return true; } @@ -2385,7 +2385,7 @@ bool WW8PLCFpcd_Iter::Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const } rStart = rPLCF.pPLCF_PosArray[nIdx]; rEnd = rPLCF.pPLCF_PosArray[nIdx + 1]; - rpValue = (void*)&rPLCF.pPLCF_Contents[nIdx * rPLCF.nStru]; + rpValue = static_cast<void*>(&rPLCF.pPLCF_Contents[nIdx * rPLCF.nStru]); return true; } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 28cbc4761a37..d6307d7d14ce 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -228,7 +228,7 @@ public: const void* GetData( long nInIdx ) const { return ( nInIdx >= nIMax ) ? 0 - : (const void*)&pPLCF_Contents[nInIdx * nStru]; + : static_cast<const void*>(&pPLCF_Contents[nInIdx * nStru]); } sal_Int32 GetPos( long nInIdx ) const { return ( nInIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nInIdx]; } @@ -313,7 +313,7 @@ public: const void* GetData( sal_Int32 nInIdx ) const { return ( nInIdx >= nIMax ) ? 0 : - (const void*)&pPLCF_Contents[nInIdx * nStru]; + static_cast<const void*>(&pPLCF_Contents[nInIdx * nStru]); } }; diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index a14b8396713c..d2a2fa7b8c84 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -174,7 +174,7 @@ sal_Int32 ReadThroughComponent( { // sax parser sends wrapped exceptions, // try to find the original one - xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r); + xml::sax::SAXException aSaxEx = *static_cast<xml::sax::SAXException*>(&r); bool bTryChild = true; while( bTryChild ) diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 91f336ce970b..9c35e3984d14 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -458,8 +458,8 @@ sal_uLong SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed, const OUString* pFileName ) { return IsStgWriter() - ? ((StgWriter *)this)->Write( rPaM, rMed.GetOutputStorage(), pFileName, &rMed ) - : ((Writer *)this)->Write( rPaM, *rMed.GetOutStream(), pFileName ); + ? static_cast<StgWriter *>(this)->Write( rPaM, rMed.GetOutputStorage(), pFileName, &rMed ) + : static_cast<Writer *>(this)->Write( rPaM, *rMed.GetOutStream(), pFileName ); } bool SwXMLWriter::WriteThroughComponent( diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index e81e72a214be..24c3df4753c7 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -125,7 +125,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent, sEntry += "\t"; sEntry += m_sTable; SvTreeListEntry* pEntry = m_pTable->InsertEntry(sEntry); - pEntry->SetUserData((void*)0); + pEntry->SetUserData(nullptr); } } Reference<XQueriesSupplier> xQSupplier(m_xConnection, UNO_QUERY); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index cd993247d8a2..c379cebc17ae 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -370,7 +370,7 @@ void AbstractSwFieldDlg_Impl::ActivateDatabasePage() vcl::Window* AbstractSwFieldDlg_Impl::GetWindow() { - return (vcl::Window*)pDlg; + return static_cast<vcl::Window*>(pDlg); } void AbstractSwFieldDlg_Impl::ShowReferencePage() @@ -565,7 +565,7 @@ void AbstractIndexMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) vcl::Window* AbstractIndexMarkFloatDlg_Impl::GetWindow() { - return (vcl::Window*)pDlg; + return static_cast<vcl::Window*>(pDlg); } void AbstractAuthMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) @@ -575,12 +575,12 @@ void AbstractAuthMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) vcl::Window* AbstractAuthMarkFloatDlg_Impl::GetWindow() { - return (vcl::Window*)pDlg; + return static_cast<vcl::Window*>(pDlg); } vcl::Window* AbstractSwWordCountFloatDlg_Impl::GetWindow() { - return (vcl::Window*)pDlg; + return static_cast<vcl::Window*>(pDlg); } void AbstractSwWordCountFloatDlg_Impl::UpdateCounts() diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index ff621d35cc78..b4c22ace24d1 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -957,7 +957,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) break; case SID_SOURCEVIEW: { - SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView() + SfxViewShell* pCurrView = GetView() ? static_cast<SfxViewShell*>(GetView()) : SfxViewShell::Current(); bool bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView); rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView)); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 9eafac523a17..de7796e09613 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -587,7 +587,7 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_SOURCEVIEW: { SfxViewShell* pViewShell = GetView() - ? (SfxViewShell*)GetView() + ? static_cast<SfxViewShell*>(GetView()) : SfxViewShell::Current(); SfxViewFrame* pViewFrm = pViewShell->GetViewFrame(); SwSrcView* pSrcView = dynamic_cast< SwSrcView *>( pViewShell ); @@ -1339,7 +1339,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie // The HTML template still has to be set SetHTMLTemplate( *GetDoc() ); //Styles from HTML.vor - SfxViewShell* pViewShell = GetView() ? (SfxViewShell*)GetView() + SfxViewShell* pViewShell = GetView() ? static_cast<SfxViewShell*>(GetView()) : SfxViewShell::Current(); SfxViewFrame* pViewFrm = pViewShell->GetViewFrame(); pViewFrm->GetDispatcher()->Execute( SID_VIEWSHELL0, SfxCallMode::SYNCHRON ); @@ -1573,7 +1573,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, // If the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure SwDocShell *const pNew(new SwDocShell(SfxObjectCreateMode::INTERNAL)); xLockRef = pNew; - xDocSh = (SfxObjectShell*)xLockRef; + xDocSh = static_cast<SfxObjectShell*>(xLockRef); if( xDocSh->DoLoad( pMed ) ) { SwDoc const& rDoc(*pNew->GetDoc()); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index f2c9e7a580b1..db52e412c910 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -618,7 +618,7 @@ bool SwDBManager::GetTableNames(ListBox* pListBox, const OUString& rDBName) for(long i = 0; i < aTables.getLength(); i++) { sal_uInt16 nEntry = pListBox->InsertEntry(pTables[i]); - pListBox->SetEntryData(nEntry, (void*)0); + pListBox->SetEntryData(nEntry, nullptr); } } uno::Reference<sdb::XQueriesSupplier> xQSupplier = uno::Reference<sdb::XQueriesSupplier>(xConnection, uno::UNO_QUERY); @@ -1132,7 +1132,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, const SwXMailMerge *pEvtSrc = GetMailMergeEvtSrc(); if(pEvtSrc) { - uno::Reference< uno::XInterface > xRef( (text::XMailMergeBroadcaster *) pEvtSrc ); + uno::Reference< uno::XInterface > xRef( const_cast<text::XMailMergeBroadcaster *>(static_cast<text::XMailMergeBroadcaster const *>(pEvtSrc)) ); text::MailMergeEvent aEvt( xRef, xWorkDocSh->GetModel() ); pEvtSrc->LaunchMailMergeEvent( aEvt ); } diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index ba2dd451f302..829a7afde7c4 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -378,7 +378,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) sTableName = pTableNames[i]; SvTreeListEntry* pTableEntry = InsertEntry(sTableName, aImg, aImg, pParent, bShowColumns); //to discriminate between queries and tables the user data of table entries is set - pTableEntry->SetUserData((void*)0); + pTableEntry->SetUserData(nullptr); } } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index c8af011d563c..456be91c7373 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -451,7 +451,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo aDocShellRef = pTmpDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pTmpDoc ); - pTmpDoc->SetTmpDocShell( (SfxObjectShell*)NULL ); + pTmpDoc->SetTmpDocShell( nullptr ); if( nSelectionType & nsSelectionType::SEL_TXT && !pWrtShell->HasMark() ) { @@ -902,7 +902,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) aDocShellRef = pTmpDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pTmpDoc ); - pTmpDoc->SetTmpDocShell( (SfxObjectShell*)NULL ); + pTmpDoc->SetTmpDocShell( nullptr ); if( pWrtShell->IsObjSelected() ) eBufferType = TRNSFR_DRAWING; @@ -1062,7 +1062,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, const OUString& rStr aDocShellRef = pCDoc->GetTmpDocShell(); if( aDocShellRef.Is() ) SwTransferable::InitOle( aDocShellRef, *pCDoc ); - pCDoc->SetTmpDocShell( (SfxObjectShell*)NULL ); + pCDoc->SetTmpDocShell( nullptr ); eBufferType = TRNSFR_DOCUMENT; @@ -1645,7 +1645,7 @@ bool SwTransferable::_PasteFileContent( TransferableDataHelper& rData, pRead = ReadAscii; if( rData.GetString( nFormat, sData ) ) { - pStream = new SvMemoryStream( (void*)sData.getStr(), + pStream = new SvMemoryStream( const_cast<sal_Unicode *>(sData.getStr()), sData.getLength() * sizeof( sal_Unicode ), StreamMode::READ ); #ifdef OSL_BIGENDIAN diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index 0cbea139e619..80d55eae1b77 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -111,7 +111,7 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt) { // Drag handle g_bNoInterrupt = true; - bReturn = pSdrView->BegDragObj(m_aStartPos, (OutputDevice*) NULL, aVEvt.pHdl); + bReturn = pSdrView->BegDragObj(m_aStartPos, nullptr, aVEvt.pHdl); m_pWin->SetDrawAction(true); } else if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT) diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 52f9cc7ad84c..8800bfae5229 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -595,7 +595,7 @@ void SwView::_CheckReadonlyState() static bool bFirst = true; if ( bFirst ) { - qsort( (void*)aROIds, sizeof(aROIds)/sizeof(sal_uInt16), sizeof(sal_uInt16), lcl_CmpIds ); + qsort( static_cast<void*>(aROIds), sizeof(aROIds)/sizeof(sal_uInt16), sizeof(sal_uInt16), lcl_CmpIds ); bFirst = false; } if ( SfxItemState::DISABLED == eStateRO ) @@ -612,7 +612,7 @@ void SwView::_CheckReadonlyState() static bool bAllProtFirst = true; if ( bAllProtFirst ) { - qsort( (void*)aAllProtIds, sizeof(aAllProtIds)/sizeof(sal_uInt16), sizeof(sal_uInt16), lcl_CmpIds ); + qsort( static_cast<void*>(aAllProtIds), sizeof(aAllProtIds)/sizeof(sal_uInt16), sizeof(sal_uInt16), lcl_CmpIds ); bAllProtFirst = false; } rDis.SetSlotFilter( SfxSlotFilterState::ENABLED_READONLY, diff --git a/sw/source/uibase/uno/dlelstnr.cxx b/sw/source/uibase/uno/dlelstnr.cxx index be28c315f3e8..b3c7ba28cd02 100644 --- a/sw/source/uibase/uno/dlelstnr.cxx +++ b/sw/source/uibase/uno/dlelstnr.cxx @@ -52,14 +52,14 @@ SwLinguServiceEventListener::SwLinguServiceEventListener() xDesktop->addTerminateListener( this ); xLngSvcMgr = LinguServiceManager::create(xContext); - xLngSvcMgr->addLinguServiceManagerListener( (XLinguServiceEventListener *) this ); + xLngSvcMgr->addLinguServiceManagerListener( static_cast<XLinguServiceEventListener *>(this) ); if (SvtLinguConfig().HasGrammarChecker()) { xGCIterator = sw::proofreadingiterator::get(xContext); Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY ); if (xBC.is()) - xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this ); + xBC->addLinguServiceEventListener( static_cast<XLinguServiceEventListener *>(this) ); } } catch (const uno::Exception&) diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 35e1042485b5..6967c1726651 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -859,7 +859,7 @@ void SwXAutoTextEntry::removeTextContent( uno::Reference< text::XText > SwXAutoTextEntry::getText() throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - uno::Reference< text::XText > xRet = (text::XText*)this; + uno::Reference< text::XText > xRet = static_cast<text::XText*>(this); return xRet; } diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx index 139af7861efa..8b281b03ba19 100644 --- a/sw/source/uibase/uno/unodispatch.cxx +++ b/sw/source/uibase/uno/unodispatch.cxx @@ -47,12 +47,12 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : if(m_xIntercepted.is()) { m_refCount++; - m_xIntercepted->registerDispatchProviderInterceptor((frame::XDispatchProviderInterceptor*)this); + m_xIntercepted->registerDispatchProviderInterceptor(static_cast<frame::XDispatchProviderInterceptor*>(this)); // this should make us the top-level dispatch-provider for the component, via a call to our // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fulfill uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY); if (xInterceptedComponent.is()) - xInterceptedComponent->addEventListener((lang::XEventListener*)this); + xInterceptedComponent->addEventListener(static_cast<lang::XEventListener*>(this)); m_refCount--; } } @@ -137,10 +137,10 @@ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& ) DispatchMutexLock_Impl aLock(*this); if (m_xIntercepted.is()) { - m_xIntercepted->releaseDispatchProviderInterceptor((frame::XDispatchProviderInterceptor*)this); + m_xIntercepted->releaseDispatchProviderInterceptor(static_cast<frame::XDispatchProviderInterceptor*>(this)); uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY); if (xInterceptedComponent.is()) - xInterceptedComponent->removeEventListener((lang::XEventListener*)this); + xInterceptedComponent->removeEventListener(static_cast<lang::XEventListener*>(this)); m_xDispatch = 0; } m_xIntercepted = NULL; @@ -174,10 +174,10 @@ void SwXDispatchProviderInterceptor::Invalidate() DispatchMutexLock_Impl aLock(*this); if (m_xIntercepted.is()) { - m_xIntercepted->releaseDispatchProviderInterceptor((frame::XDispatchProviderInterceptor*)this); + m_xIntercepted->releaseDispatchProviderInterceptor(static_cast<frame::XDispatchProviderInterceptor*>(this)); uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY); if (xInterceptedComponent.is()) - xInterceptedComponent->removeEventListener((lang::XEventListener*)this); + xInterceptedComponent->removeEventListener(static_cast<lang::XEventListener*>(this)); m_xDispatch = 0; } m_xIntercepted = NULL; @@ -242,7 +242,7 @@ void SwXDispatch::dispatch(const util::URL& aURL, { frame::FeatureStateEvent aEvent; aEvent.IsEnabled = sal_True; - aEvent.Source = *(cppu::OWeakObject*)this; + aEvent.Source = *static_cast<cppu::OWeakObject*>(this); const SwDBData& rData = m_pView->GetWrtShell().GetDBDesc(); svx::ODataAccessDescriptor aDescriptor; @@ -283,7 +283,7 @@ void SwXDispatch::addStatusListener( m_bOldEnable = bEnable; frame::FeatureStateEvent aEvent; aEvent.IsEnabled = bEnable; - aEvent.Source = *(cppu::OWeakObject*)this; + aEvent.Source = *static_cast<cppu::OWeakObject*>(this); aEvent.FeatureURL = aURL; // one of the URLs requires a special state .... @@ -351,7 +351,7 @@ void SwXDispatch::selectionChanged( const lang::EventObject& ) throw(uno::Runti m_bOldEnable = bEnable; frame::FeatureStateEvent aEvent; aEvent.IsEnabled = bEnable; - aEvent.Source = *(cppu::OWeakObject*)this; + aEvent.Source = *static_cast<cppu::OWeakObject*>(this); StatusListenerList::iterator aListIter = m_aListenerList.begin(); for(aListIter = m_aListenerList.begin(); aListIter != m_aListenerList.end(); ++aListIter) @@ -373,7 +373,7 @@ void SwXDispatch::disposing( const lang::EventObject& rSource ) throw(uno::Runti m_bListenerAdded = false; lang::EventObject aObject; - aObject.Source = (cppu::OWeakObject*)this; + aObject.Source = static_cast<cppu::OWeakObject*>(this); StatusListenerList::iterator aListIter = m_aListenerList.begin(); for(; aListIter != m_aListenerList.end(); ++aListIter) { diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 0aaf8ce54730..b2a954f82488 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -1024,7 +1024,7 @@ void SAL_CALL SwXMailMerge::setPropertyValue( if (bChanged) { - PropertyChangeEvent aChgEvt( (XPropertySet *) this, rPropertyName, + PropertyChangeEvent aChgEvt( static_cast<XPropertySet *>(this), rPropertyName, sal_False, pCur->nWID, aOld, rValue ); launchEvent( aChgEvt ); } @@ -1144,7 +1144,7 @@ void SAL_CALL SwXMailMerge::dispose() { bDisposing = true; - EventObject aEvtObj( (XPropertySet *) this ); + EventObject aEvtObj( static_cast<XPropertySet *>(this) ); aEvtListeners.disposeAndClear( aEvtObj ); aMergeListeners.disposeAndClear( aEvtObj ); aPropListeners.disposeAndClear( aEvtObj ); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 0f6a93b88264..6e0c7aa39a6f 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -433,7 +433,7 @@ SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper () if(!xPropertyHelper.is()) { pPropertyHelper = new SwXDocumentPropertyHelper(*pDocShell->GetDoc()); - xPropertyHelper = (cppu::OWeakObject*)pPropertyHelper; + xPropertyHelper = static_cast<cppu::OWeakObject*>(pPropertyHelper); } return pPropertyHelper; } @@ -452,7 +452,7 @@ void SwXTextDocument::GetNumberFormatter() xNumFormatAgg = Reference< XAggregation >(xTmp, UNO_QUERY); } if(xNumFormatAgg.is()) - xNumFormatAgg->setDelegator((cppu::OWeakObject*)(SwXTextDocumentBaseClass*)this); + xNumFormatAgg->setDelegator(static_cast<cppu::OWeakObject*>(static_cast<SwXTextDocumentBaseClass*>(this))); } else { @@ -4071,7 +4071,7 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich) break; case SW_CREATE_DRAW_DEFAULTS: if(!xDrawDefaults.is()) - xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc); + xDrawDefaults = static_cast<cppu::OWeakObject*>(new SwSvxUnoDrawPool(m_pDoc)); xRet = xDrawDefaults; break; #if OSL_DEBUG_LEVEL > 0 diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 95281f806b5f..ff8c62cae34c 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1075,7 +1075,7 @@ static void* lcl_GetOutlineKey( SwContentTree* pTree, SwOutlineContent* pContent SwWrtShell* pShell = pTree->GetWrtShell(); sal_Int32 nPos = pContent->GetYPos(); - key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + key = static_cast<void*>(pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos )); } return key; @@ -1322,12 +1322,12 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) if(sEntry.isEmpty()) sEntry = sSpace; if(!pChild || (nLevel == 0)) - pChild = InsertEntry(sEntry, pParent, false, TREELIST_APPEND,(void*)pCnt); + pChild = InsertEntry(sEntry, pParent, false, TREELIST_APPEND,const_cast<SwContent *>(pCnt)); else { //back search parent. if(static_cast<const SwOutlineContent*>(pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel) - pChild = InsertEntry(sEntry, pChild, false, TREELIST_APPEND, (void*)pCnt); + pChild = InsertEntry(sEntry, pChild, false, TREELIST_APPEND, const_cast<SwContent *>(pCnt)); else { pChild = Prev(pChild); @@ -1340,7 +1340,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) } if(pChild) pChild = InsertEntry(sEntry, pChild, - false, TREELIST_APPEND, (void*)pCnt); + false, TREELIST_APPEND, const_cast<SwContent *>(pCnt)); } } } @@ -1357,7 +1357,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) OUString sEntry = pCnt->GetName(); if (sEntry.isEmpty()) sEntry = sSpace; - pChild = InsertEntry(sEntry, pParent, false, TREELIST_APPEND, (void*)pCnt); + pChild = InsertEntry(sEntry, pParent, false, TREELIST_APPEND, const_cast<SwContent *>(pCnt)); } if (pChild) { @@ -1449,7 +1449,7 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) if(pChild->HasChildren()) { sal_Int32 nPos = static_cast<SwContent*>(pChild->GetUserData())->GetYPos(); - void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + void* key = static_cast<void*>(pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos )); mCurrOutLineNodeMap.insert(std::map<void*, bool>::value_type( key, false ) ); std::map<void*, bool>::iterator iter = mOutLineNodeMap.find( key ); if( iter != mOutLineNodeMap.end() && mOutLineNodeMap[key]) @@ -1469,7 +1469,7 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) { SwWrtShell* pShell = GetWrtShell(); sal_Int32 nPos = static_cast<SwContent*>(pParent->GetUserData())->GetYPos(); - void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + void* key = static_cast<void*>(pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos )); mOutLineNodeMap[key] = true; } } @@ -1501,7 +1501,7 @@ bool SwContentTree::Collapse( SvTreeListEntry* pParent ) { SwWrtShell* pShell = GetWrtShell(); sal_Int32 nPos = static_cast<SwContent*>(pParent->GetUserData())->GetYPos(); - void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos ); + void* key = static_cast<void*>(pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos )); mOutLineNodeMap[key] = false; } } @@ -1683,7 +1683,7 @@ void SwContentTree::Display( bool bActive ) if(sEntry.isEmpty()) sEntry = sSpace; InsertEntry( sEntry, pParent, - false, TREELIST_APPEND, (void*)pCnt); + false, TREELIST_APPEND, const_cast<SwContent *>(pCnt)); } } } @@ -1988,7 +1988,7 @@ bool SwContentTree::HasContentChanged() pArrType->Init(&bInvalidate); pArrType->FillMemberList(); - pEntry->SetUserData((void*)pArrType); + pEntry->SetUserData(static_cast<void*>(pArrType)); if(!bRepaint) { if(GetChildCount(pEntry) != pArrType->GetMemberCount()) @@ -2000,7 +2000,7 @@ bool SwContentTree::HasContentChanged() { pEntry = Next(pEntry); const SwContent* pCnt = pArrType->GetMember(j); - pEntry->SetUserData((void*)pCnt); + pEntry->SetUserData(const_cast<SwContent *>(pCnt)); OUString sEntryText = GetEntryText(pEntry); if( sEntryText != pCnt->GetName() && !(sEntryText == sSpace && pCnt->GetName().isEmpty())) @@ -2046,7 +2046,7 @@ bool SwContentTree::HasContentChanged() else { pArrType->Init(&bInvalidate); - pEntry->SetUserData((void*)pArrType); + pEntry->SetUserData(static_cast<void*>(pArrType)); if(IsExpanded(pEntry)) { bool bLevelOrVisibiblityChanged = false; @@ -2069,7 +2069,7 @@ bool SwContentTree::HasContentChanged() pEntry = Next(pEntry); bNext = false; const SwContent* pCnt = pArrType->GetMember(j); - pEntry->SetUserData((void*)pCnt); + pEntry->SetUserData(const_cast<SwContent *>(pCnt)); OUString sEntryText = GetEntryText(pEntry); if( sEntryText != pCnt->GetName() && !(sEntryText == sSpace && pCnt->GetName().isEmpty())) @@ -2100,7 +2100,7 @@ bool SwContentTree::HasContentChanged() for(size_t j = 0; j < nChildCount; ++j) { const SwContent* pCnt = pArrType->GetMember(j); - pChild->SetUserData((void*)pCnt); + pChild->SetUserData(const_cast<SwContent *>(pCnt)); OUString sEntryText = GetEntryText(pChild); if( sEntryText != pCnt->GetName() && !(sEntryText == sSpace && pCnt->GetName().isEmpty())) @@ -2759,7 +2759,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) pActiveShell->GetView().GetEditWin(); vcl::KeyCode tempKeycode( KEY_ESCAPE ); KeyEvent rKEvt( 0 , tempKeycode ); - ((vcl::Window*)&pEditWindow)->KeyInput( rKEvt ); + static_cast<vcl::Window*>(&pEditWindow)->KeyInput( rKEvt ); //rView.GetEditWin().GrabFocus(); } } @@ -3223,7 +3223,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) case EDIT_MODE_EDIT: if(pBase) { - SwPtrItem aPtrItem( FN_INSERT_MULTI_TOX, (void*)pBase); + SwPtrItem aPtrItem( FN_INSERT_MULTI_TOX, const_cast<SwTOXBase *>(pBase)); pActiveShell->GetView().GetViewFrame()-> GetDispatcher()->Execute(FN_INSERT_MULTI_TOX, SfxCallMode::ASYNCHRON, &aPtrItem, 0L); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 5c04c7fdea9e..dcf28a84fc1c 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1616,7 +1616,7 @@ SwWrtShell::SwWrtShell( SwWrtShell& rSh, vcl::Window *_pWin, SwView &rShell ) BITFLD_INI_LIST SET_CURR_SHELL( this ); - SetSfxViewShell( (SfxViewShell *)&rShell ); + SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) ); SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) ); // place the cursor on the first field... @@ -1633,7 +1633,7 @@ SwWrtShell::SwWrtShell( SwDoc& rDoc, vcl::Window *_pWin, SwView &rShell, { BITFLD_INI_LIST SET_CURR_SHELL( this ); - SetSfxViewShell( (SfxViewShell *)&rShell ); + SetSfxViewShell( static_cast<SfxViewShell *>(&rShell) ); SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) ); // place the cursor on the first field... |