diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-07-08 16:40:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-07-08 16:47:31 +0200 |
commit | e26dfe3a29eed9982cd8e6e3df4912a6210d09b0 (patch) | |
tree | 74da95689961343d37f149d8368d2091c74eadab /sw/source | |
parent | 9af0403ddc024b843c214eb43923692fb1dfd9eb (diff) |
loplugin:redundantcast: redundant static_casts in sw
Change-Id: I09c1ebaf5742e983ee05942a4c7c17c6aa5179cc
Diffstat (limited to 'sw/source')
55 files changed, 109 insertions, 115 deletions
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 31529e1bbd58..0c59541d70c1 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -587,7 +587,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes() sal_uLong nLineNum = 0; SwTextFrame* pTextFrame = nullptr; SwTextFrame* pCurrTextFrame = nullptr; - pTextFrame = static_cast< SwTextFrame* >(static_cast< SwPageFrame* > (pCurrPage)->ContainsContent()); + pTextFrame = static_cast< SwTextFrame* >(pCurrPage->ContainsContent()); if (pCurrFrame->IsInFly())//such as, graphic,chart { SwFlyFrame *pFlyFrame = pCurrFrame->FindFlyFrame(); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 78d81ffc9d9e..3f9ddc991617 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1481,7 +1481,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa VEC_SHAPE::iterator vi =vecxShapeRemove.begin(); for (; vi != vecxShapeRemove.end(); ++vi) { - ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->get()); + ::accessibility::AccessibleShape *pAccShape = vi->get(); if (pAccShape) { pAccShape->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE, uno::Any(), uno::Any()); @@ -1536,7 +1536,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa vi = vecxShapeAdd.begin(); for (; vi != vecxShapeAdd.end(); ++vi) { - ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->get()); + ::accessibility::AccessibleShape *pAccShape = vi->get(); if (pAccShape) { pAccShape->CommitChange(nEventID, uno::Any(), uno::Any()); @@ -1547,7 +1547,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa vi = vecxShapeAdd.begin(); for (; vi != vecxShapeAdd.end(); ++vi) { - ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->get()); + ::accessibility::AccessibleShape *pAccShape = vi->get(); if (pAccShape) { SdrObject *pObj = GetSdrObjectFromXShape(pAccShape->GetXShape()); @@ -1577,7 +1577,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa vi = vecxShapeRemove.begin(); for (; vi != vecxShapeRemove.end(); ++vi) { - ::accessibility::AccessibleShape *pAccShape = static_cast< ::accessibility::AccessibleShape * >(vi->get()); + ::accessibility::AccessibleShape *pAccShape = vi->get(); if (pAccShape) { uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent(); @@ -3446,7 +3446,7 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::BuildSelectedParas() } // prepare next turn: get next cursor in ring - pCursor = static_cast<SwPaM*>( pCursor->GetNext() ); + pCursor = pCursor->GetNext(); } while ( pCursor != pRingStart ); return pRetSelectedParas; diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 272b89f9357f..fe59bc748fa3 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -680,7 +680,7 @@ SwCalcOper SwCalc::GetToken() CalcOp* pFnd = ::FindOperator( sLowerCaseName ); if( pFnd ) { - switch( ( eCurrOper = static_cast<CalcOp*>(pFnd)->eOp ) ) + switch( ( eCurrOper = pFnd->eOp ) ) { case CALC_SUM: case CALC_MEAN: diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 62f751d1d125..1dc870259a88 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -483,7 +483,7 @@ bool SwCursorShell::bColumnChange() return false; } - SwFrame* pCurrCol=static_cast<SwFrame*>(pCurrFrame)->FindColFrame(); + SwFrame* pCurrCol=pCurrFrame->FindColFrame(); while(pCurrCol== nullptr && pCurrFrame!=nullptr ) { @@ -2437,8 +2437,8 @@ sal_uInt16 SwCursorShell::GetCursorCnt( bool bAll ) const *m_pCurrentCursor->GetPoint() != *m_pCurrentCursor->GetMark())) ? 1 : 0; while( pTmp != m_pCurrentCursor ) { - if( bAll || ( static_cast<SwPaM*>(pTmp)->HasMark() && - *static_cast<SwPaM*>(pTmp)->GetPoint() != *static_cast<SwPaM*>(pTmp)->GetMark())) + if( bAll || ( pTmp->HasMark() && + *pTmp->GetPoint() != *pTmp->GetMark())) ++n; pTmp = pTmp->GetNext(); } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 5ade3ec3cf5d..a8c7f906100e 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -2143,7 +2143,7 @@ const SwRangeRedline* SwCursorShell::GotoRedline( sal_uInt16 nArrPos, bool bSele if( bDel ) { // not needed anymore - SwPaM* pPrevPam = static_cast<SwPaM*>(pNextPam->GetPrev()); + SwPaM* pPrevPam = pNextPam->GetPrev(); delete pNextPam; pNextPam = pPrevPam; } diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index e86bef32262e..f4d3a3f5f552 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -759,7 +759,7 @@ static sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurrentCurso pPHdl.reset(new PercentHdl( 0, nCursorCnt, pDoc->GetDocShell() )); } else - pSaveCursor = static_cast<SwPaM*>(pSaveCursor->GetPrev()); + pSaveCursor = pSaveCursor->GetPrev(); bool bEnd = false; do { diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 7f21526746c6..459b569b5a5a 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -379,7 +379,7 @@ namespace ::sw::UndoGuard const undoGuard(pDestDoc->GetIDocumentUndoRedo()); do { - pDestDoc->getIDocumentContentOperations().DeleteAndJoin( *static_cast<SwPaM*>(pDelPam->GetNext()) ); + pDestDoc->getIDocumentContentOperations().DeleteAndJoin( *pDelPam->GetNext() ); if( !pDelPam->IsMultiSelection() ) break; delete pDelPam->GetNext(); diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index c07b8b0417a8..0e33eb56c561 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( static_cast<void*>(GetRegisteredIn()) == static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject ) - static_cast<SwModify*>(GetRegisteredIn())->Remove(this); + GetRegisteredIn()->Remove(this); pAutoCompleteWord->DocumentDying(*pDoc); break; } diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index ce48a9d81270..c92b7331dc31 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1408,7 +1408,7 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, if( rpInsRing ) { - SwPaM* pCorr = static_cast<SwPaM*>(rpInsRing->GetPrev()); + SwPaM* pCorr = rpInsRing->GetPrev(); if( *pCorr->GetPoint() == *pTmp->GetPoint() ) *pCorr->GetPoint() = *pTmp->GetMark(); } @@ -1504,8 +1504,8 @@ void CompareData::CheckRanges( CompareData& rData ) void CompareData::ShowInsert( sal_uLong nStt, sal_uLong nEnd ) { - SwPaM* pTmp = new SwPaM( static_cast<const SwCompareLine*>(GetLine( nStt ))->GetNode(), 0, - static_cast<const SwCompareLine*>(GetLine( nEnd-1 ))->GetEndNode(), 0, + SwPaM* pTmp = new SwPaM( GetLine( nStt )->GetNode(), 0, + GetLine( nEnd-1 )->GetEndNode(), 0, pInsRing ); if( !pInsRing ) pInsRing = pTmp; @@ -1520,8 +1520,8 @@ void CompareData::ShowDelete( sal_uLong nInsPos ) { SwNodeRange aRg( - static_cast<const SwCompareLine*>(rData.GetLine( nStt ))->GetNode(), 0, - static_cast<const SwCompareLine*>(rData.GetLine( nEnd-1 ))->GetEndNode(), 1 ); + rData.GetLine( nStt )->GetNode(), 0, + rData.GetLine( nEnd-1 )->GetEndNode(), 1 ); sal_uInt16 nOffset = 0; const SwCompareLine* pLine = nullptr; @@ -1540,9 +1540,9 @@ void CompareData::ShowDelete( if( pLine ) { if( nOffset ) - pLineNd = &static_cast<const SwCompareLine*>(pLine)->GetEndNode(); + pLineNd = &pLine->GetEndNode(); else - pLineNd = &static_cast<const SwCompareLine*>(pLine)->GetNode(); + pLineNd = &pLine->GetNode(); } else { @@ -1568,7 +1568,7 @@ void CompareData::ShowDelete( if( pInsRing ) { - SwPaM* pCorr = static_cast<SwPaM*>(pInsRing->GetPrev()); + SwPaM* pCorr = pInsRing->GetPrev(); if( *pCorr->GetPoint() == *pTmp->GetPoint() ) { SwNodeIndex aTmpPos( pTmp->GetMark()->nNode, -1 ); @@ -1603,8 +1603,8 @@ void CompareData::CheckForChangesInLine( const CompareData& rData, if( i ) { - const SwCompareLine* pDstLn = static_cast<const SwCompareLine*>(GetLine( rThisStt + nDstFrom - 1 )); - const SwCompareLine* pSrcLn = static_cast<const SwCompareLine*>(rData.GetLine( rStt + nSrcFrom - 1 )); + const SwCompareLine* pDstLn = GetLine( rThisStt + nDstFrom - 1 ); + const SwCompareLine* pSrcLn = rData.GetLine( rStt + nSrcFrom - 1 ); // Show differences in detail for lines that // were matched as only slightly different @@ -2142,8 +2142,8 @@ bool LineArrayComparator::Compare( int nIdx1, int nIdx2 ) const return false; } - const SwTextNode *pTextNd1 = static_cast<const SwCompareLine*>( rData1.GetLine( nFirst1 + nIdx1 ) )->GetNode().GetTextNode(); - const SwTextNode *pTextNd2 = static_cast<const SwCompareLine*>( rData2.GetLine( nFirst2 + nIdx2 ) )->GetNode().GetTextNode(); + const SwTextNode *pTextNd1 = rData1.GetLine( nFirst1 + nIdx1 )->GetNode().GetTextNode(); + const SwTextNode *pTextNd2 = rData2.GetLine( nFirst2 + nIdx2 )->GetNode().GetTextNode(); if( !pTextNd1 || !pTextNd2 || ( CmpOptions.bUseRsid && !pTextNd1->CompareParRsid( *pTextNd2 ) ) ) diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 4c440b8b3721..e043c9137f6e 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -109,7 +109,7 @@ void PaMCorrAbs( const SwPaM& rRange, do { lcl_PaMCorrAbs( *_pStackCursor, aStart, aEnd, aNewPos ); } while ( (_pStackCursor != nullptr ) && - ((_pStackCursor = static_cast<SwPaM *>(_pStackCursor->GetNext())) != pCursorShell->GetStackCursor()) ); + ((_pStackCursor = _pStackCursor->GetNext()) != pCursorShell->GetStackCursor()) ); for(SwPaM& rPaM : const_cast<SwShellCursor*>(pCursorShell->GetCursor_())->GetRingContainer()) { @@ -260,7 +260,7 @@ void PaMCorrRel( const SwNodeIndex &rOldNode, do { lcl_PaMCorrRel1( _pStackCursor, pOldNode, aNewPos, nCntIdx ); } while ( (_pStackCursor != nullptr ) && - ((_pStackCursor = static_cast<SwPaM *>(_pStackCursor->GetNext())) != pCursorShell->GetStackCursor()) ); + ((_pStackCursor = _pStackCursor->GetNext()) != pCursorShell->GetStackCursor()) ); SwPaM* pStartPaM = pCursorShell->GetCursor_(); for(SwPaM& rPaM : pStartPaM->GetRingContainer()) diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 23a886b28247..da581f9cab57 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -58,8 +58,7 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo) const_cast<SwModify*>(rInfo.aAnchorCharFormatDep.GetRegisteredIn())->Add( &aAnchorCharFormatDep ); else if( aAnchorCharFormatDep.GetRegisteredIn() ) - static_cast<SwModify*>(aAnchorCharFormatDep.GetRegisteredIn())->Remove( - &aAnchorCharFormatDep ); + aAnchorCharFormatDep.GetRegisteredIn()->Remove( &aAnchorCharFormatDep ); aFormat = rInfo.aFormat; nFootnoteOffset = rInfo.nFootnoteOffset; diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx index d22aa01a2b7b..339e8b1de5b3 100644 --- a/sw/source/core/doc/docglos.cxx +++ b/sw/source/core/doc/docglos.cxx @@ -192,7 +192,7 @@ bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const OUString& rEntry, aACD.RestoreDontExpandItems( rInsPos ); if( pShell ) pShell->SaveTableBoxContent( &rInsPos ); - } while( (_pStartCursor = static_cast<SwPaM *>(_pStartCursor->GetNext())) != + } while( (_pStartCursor = _pStartCursor->GetNext()) != _pStartCursor2 ); GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, nullptr ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 10b218a25586..226af7310a4b 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -338,7 +338,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection( RndStdIds eAnchorType, SfxItemState::SET == pAnchorNode->GetSwAttrSet(). GetItemState(RES_PARATR_ADJUST, true, &pItem)) { - static_cast<SwContentNode *>(pNewTextNd)->SetAttr(*pItem); + pNewTextNd->SetAttr(*pItem); } pFormat = MakeFlySection_( *pAnchorPos, *pNewTextNd, @@ -502,7 +502,7 @@ static bool lcl_TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, (nPamEndContentIndex > nFlyContentIndex ))); } - } while( !bOk && pPam != ( pTmp = static_cast<const SwPaM*>(pTmp->GetNext()) )); + } while( !bOk && pPam != ( pTmp = pTmp->GetNext() )); return bOk; } diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx index 8b9b880e5163..2f1cdc7a3e18 100644 --- a/sw/source/core/doc/extinput.cxx +++ b/sw/source/core/doc/extinput.cxx @@ -256,7 +256,7 @@ void SwDoc::DeleteExtTextInput( SwExtTextInput* pDel ) if( pDel == mpExtInputRing ) { if( pDel->GetNext() != mpExtInputRing ) - mpExtInputRing = static_cast<SwPaM*>(pDel->GetNext()); + mpExtInputRing = pDel->GetNext(); else mpExtInputRing = nullptr; } diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 01752deb6de6..1fabfa941ec4 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2305,7 +2305,7 @@ sal_uInt16 SwDoc::MergeTable( SwPaM& rPam ) rPam.DeleteMark(); SwPaM* pTmp = &rPam; - while( &rPam != ( pTmp = static_cast<SwPaM*>(pTmp->GetNext()) )) + while( &rPam != ( pTmp = pTmp->GetNext() )) for( int i = 0; i < 2; ++i ) pTmp->GetBound( (bool)i ) = *rPam.GetPoint(); } @@ -3695,7 +3695,7 @@ static bool lcl_SetAFormatBox(FndBox_ & rBox, SetAFormatTabPara *pSetPara, bool if (rBox.GetBox()->GetSttNd()) { - SwTableBox* pSetBox = static_cast<SwTableBox*>(rBox.GetBox()); + SwTableBox* pSetBox = rBox.GetBox(); if (!pSetBox->HasDirectFormatting() || bResetDirect) { if (bResetDirect) @@ -4556,7 +4556,7 @@ bool SwDoc::UnProtectTables( const SwPaM& rPam ) bFound = pStt->nNode.GetIndex() < nTableIdx && nTableIdx < pEnd->nNode.GetIndex(); - } while( !bFound && &rPam != ( pTmp = static_cast<SwPaM*>(pTmp->GetNext()) ) ); + } while( !bFound && &rPam != ( pTmp = pTmp->GetNext() ) ); if( !bFound ) continue; // Continue searching } diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 03735e8f869c..6f197f4ff227 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -200,7 +200,7 @@ bool FindBox_( FndBox_ & rBox, LinesAndTable* pPara ) } else if (rBox.GetBox()) { - ::InsertLine(pPara->m_rLines, static_cast<SwTableLine*>(rBox.GetBox()->GetUpper())); + ::InsertLine(pPara->m_rLines, rBox.GetBox()->GetUpper()); } return true; } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 392143c44e96..e42598c2ab00 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1027,14 +1027,14 @@ void SwContentNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNe if( pFormat->GetRegisteredIn() ) { // If Parent, register anew in the new Parent - static_cast<SwModify*>(pFormat->GetRegisteredIn())->Add( this ); + pFormat->GetRegisteredIn()->Add( this ); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFormatColl(), GetFormatColl() ); } else { // Else register anyways when dying - static_cast<SwModify*>(GetRegisteredIn())->Remove( this ); + GetRegisteredIn()->Remove( this ); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, nullptr, nullptr ); } @@ -1360,7 +1360,7 @@ void SwContentNode::DelFrames( bool bIsDisposeAccTable ) nullptr != ( pCFrame = pFootnote->GetRefFromAttr()) && pCFrame->IsFollow() ) { OSL_ENSURE( pCFrame->IsTextFrame(), "NoTextFrame has Footnote?" ); - static_cast<SwTextFrame*>(pCFrame->FindMaster())->Prepare( PREP_FTN_GONE ); + pCFrame->FindMaster()->Prepare( PREP_FTN_GONE ); } } //Set acc table dispose state diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 0093c4006347..5277af00a11b 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -158,7 +158,7 @@ uno::Reference<drawing::XShape> lcl_getWatermark(const uno::Reference<text::XTex SwTextFormatColl& SwEditShell::GetDfltTextFormatColl() const { - return *static_cast<SwTextFormatColl*>( (GetDoc()->GetDfltTextFormatColl())); + return *GetDoc()->GetDfltTextFormatColl(); } sal_uInt16 SwEditShell::GetTextFormatCollCount() const diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index fe5b50ad23b4..950e79b6c38d 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -305,7 +305,7 @@ bool SwEditShell::GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const } while ( pFrame && !pFrame->IsCellFrame() ); if ( pFrame ) { - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); aBoxes.insert( pBox ); } } while( false ); @@ -322,7 +322,7 @@ bool SwEditShell::GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const SwTableFormulaUpdate aTableUpdate( &rTable ); aTableUpdate.m_eFlags = TBL_BOXNAME; - static_cast<SwDoc*>(GetDoc())->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate ); + GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate ); rSet.Put( pTableFormat->GetAttrSet() ); } @@ -347,7 +347,7 @@ void SwEditShell::SetTableBoxFormulaAttrs( const SfxItemSet& rSet ) } while ( pFrame && !pFrame->IsCellFrame() ); if ( pFrame ) { - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); aBoxes.insert( pBox ); } } while( false ); @@ -379,7 +379,7 @@ bool SwEditShell::IsTableBoxTextFormat() const pFrame = pFrame->GetUpper(); } while ( pFrame && !pFrame->IsCellFrame() ); if ( pFrame ) - pBox = static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); + pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox(); } if( !pBox ) @@ -419,7 +419,7 @@ OUString SwEditShell::GetTableBoxText() const pFrame = pFrame->GetUpper(); } while ( pFrame && !pFrame->IsCellFrame() ); if ( pFrame ) - pBox = static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); + pBox = static_cast<SwCellFrame*>(pFrame)->GetTabBox(); } sal_uLong nNd; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index dd7fc5fe02e2..894fa01509d4 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -236,7 +236,7 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) for (size_t i = 0; i < rMrkList.GetMarkCount(); ++i) { SdrObject* pObject = rMrkList.GetMark(i)->GetMarkedSdrObj(); - SwContact* pDrawContact = static_cast<SwContact*>(GetUserCall(pObject)); + SwContact* pDrawContact = GetUserCall(pObject); SwFrameFormat* pFormat = pDrawContact->GetFormat(); if (aTextBoxShapes.find(pFormat) != aTextBoxShapes.end()) { diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 5d0538f3337c..f8236a19dfca 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -941,7 +941,7 @@ void SwFEShell::UnProtectCells() } while ( pFrame && !pFrame->IsCellFrame() ); if( pFrame ) { - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); aBoxes.insert( pBox ); } } @@ -984,7 +984,7 @@ bool SwFEShell::CanUnProtectCells() const } while ( pFrame && !pFrame->IsCellFrame() ); if( pFrame ) { - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); aBoxes.insert( pBox ); } } @@ -1149,7 +1149,7 @@ bool SwFEShell::IsAdjustCellWidthAllowed( bool bBalance ) const if (!pFrame) return false; - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); aBoxes.insert( pBox ); } diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index c15266976511..630959e1e2ea 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -1267,7 +1267,7 @@ bool SwFEShell::IsFrameVertical(const bool bEnvironment, bool& bRTL, bool& bVert return bVert; } // #i26791# - SwContact* pContact = static_cast<SwContact*>(GetUserCall( pObj )); + SwContact* pContact = GetUserCall( pObj ); if ( !pContact ) { OSL_FAIL( "<SwFEShell::IsFrameVertical(..)> - missing SwContact instance at marked object -> This is a serious situation" ); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 7f6ee37014fd..3bc70aba25ef 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2092,7 +2092,7 @@ void SwFormatChain::SetPrev( SwFlyFrameFormat *pFormat ) if ( pFormat ) pFormat->Add( &aPrev ); else if ( aPrev.GetRegisteredIn() ) - static_cast<SwModify*>(aPrev.GetRegisteredIn())->Remove( &aPrev ); + aPrev.GetRegisteredIn()->Remove( &aPrev ); } void SwFormatChain::SetNext( SwFlyFrameFormat *pFormat ) @@ -2100,7 +2100,7 @@ void SwFormatChain::SetNext( SwFlyFrameFormat *pFormat ) if ( pFormat ) pFormat->Add( &aNext ); else if ( aNext.GetRegisteredIn() ) - static_cast<SwModify*>(aNext.GetRegisteredIn())->Remove( &aNext ); + aNext.GetRegisteredIn()->Remove( &aNext ); } bool SwFormatChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -3171,8 +3171,7 @@ bool SwFlyFrameFormat::IsBackgroundTransparent() const } else { - const GraphicObject *pTmpGrf = - static_cast<const GraphicObject*>(aBackground.GetGraphicObject()); + const GraphicObject *pTmpGrf = aBackground.GetGraphicObject(); if ( (pTmpGrf) && (pTmpGrf->GetAttr().GetTransparency() != 0) ) diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a0d668d0ee93..44e8af08633c 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1867,7 +1867,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) } } // Do not calculate split cell frames. - else if ( !pNewUpper->IsCellFrame() || static_cast<SwLayoutFrame*>(pNewUpper)->Lower() ) + else if ( !pNewUpper->IsCellFrame() || pNewUpper->Lower() ) pNewUpper->Calc(m_rThis.getRootFrame()->GetCurrShell()->GetOut()); SwFootnoteBossFrame *pNewBoss = pNewUpper->FindFootnoteBossFrame(); diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 3f6a87c6ed37..2fc08751728c 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -1147,7 +1147,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) } long nHeight = (9*(rRect.*fnRect->fnGetHeight)())/10; long nTop; - const SwFormat *pFormat = static_cast<SwContact*>(GetUserCall(pSdrObj))->GetFormat(); + const SwFormat *pFormat = GetUserCall(pSdrObj)->GetFormat(); const SvxULSpaceItem &rUL = pFormat->GetULSpace(); if( bMove ) { diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index a2e0ef6012fc..a8d04afc4e38 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -376,7 +376,7 @@ SwPageFrame* SwLayAction::CheckFirstVisPage( SwPageFrame *pPage ) SwContentFrame *pChk = pCnt; bool bPageChgd = false; while ( pCnt && pCnt->IsFollow() ) - pCnt = static_cast<SwContentFrame*>(pCnt)->FindMaster(); + pCnt = pCnt->FindMaster(); if ( pCnt && pChk != pCnt ) { bPageChgd = true; pPage = pCnt->FindPageFrame(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 8de9ddbc8039..f36fd923fb64 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1661,7 +1661,7 @@ static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage, // parent fly frame. if (pFrame->IsFlyFrame() && (pFly->GetAnchorFrame()->FindFlyFrame() == pFrame) && - static_cast<const SwFlyFrameFormat*>(pFly->GetFormat())->IsBackgroundBrushInherited() + pFly->GetFormat()->IsBackgroundBrushInherited() ) { SwRect aRect; @@ -3971,7 +3971,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const { bool bBackgroundTransparent = GetFormat()->IsBackgroundTransparent(); if ( !bBackgroundTransparent && - static_cast<const SwFlyFrameFormat*>(GetFormat())->IsBackgroundBrushInherited() ) + GetFormat()->IsBackgroundBrushInherited() ) { const SvxBrushItem* pBackgrdBrush = nullptr; const Color* pSectionTOXColor = nullptr; @@ -4001,7 +4001,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const else { const GraphicObject *pTmpGrf = - static_cast<const GraphicObject*>(pBackgrdBrush->GetGraphicObject()); + pBackgrdBrush->GetGraphicObject(); if ( (pTmpGrf) && (pTmpGrf->GetAttr().GetTransparency() != 0) ) diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 86dac9e92664..74b450b34402 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -325,7 +325,7 @@ void SwSectionFrame::Paste( SwFrame* pParent, SwFrame* pSibling ) // newly created pSect by the InsertGroup SwColumnFrame *pCol = static_cast<SwColumnFrame*>(pParent->GetUpper()); while( !pSibling && nullptr != ( pCol = static_cast<SwColumnFrame*>(pCol->GetNext()) ) ) - pSibling = static_cast<SwLayoutFrame*>(static_cast<SwColumnFrame*>(pCol)->Lower())->Lower(); + pSibling = static_cast<SwLayoutFrame*>(pCol->Lower())->Lower(); if( pSibling ) { // Even worse: every following column content has to diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 422d64e9fce4..3295980254c9 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -476,7 +476,7 @@ static void lcl_MoveRowContent( SwRowFrame& rSourceLine, SwRowFrame& rDestLine ) if ( pTmp ) { // NEW TABLES - SwCellFrame* pDestCell = static_cast<SwCellFrame*>(pCurrDestCell); + SwCellFrame* pDestCell = pCurrDestCell; if ( pDestCell->GetTabBox()->getRowSpan() < 1 ) pDestCell = & const_cast<SwCellFrame&>(pDestCell->FindStartEndOfRowSpanCell( true )); @@ -838,7 +838,7 @@ static long lcl_GetMaximumLayoutRowSpan( const SwRowFrame& rRow ) bool SwTabFrame::RemoveFollowFlowLine() { // find FollowFlowLine - SwRowFrame* pFollowFlowLine = static_cast<SwRowFrame*>(GetFollow()->GetFirstNonHeadlineRow()); + SwRowFrame* pFollowFlowLine = GetFollow()->GetFirstNonHeadlineRow(); // find last row in master SwFrame* pLastLine = GetLastLower(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index a102300b8ba1..eadbdd298c0f 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -211,7 +211,7 @@ bool SwPageFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, { if ( pCMS && (pCMS->m_bStop || pCMS->m_bExactOnly) ) { - static_cast<SwCursorMoveState*>(pCMS)->m_bStop = true; + pCMS->m_bStop = true; return false; } const SwContentFrame *pCnt = GetContentPos( aPoint, false, false, pCMS, false ); @@ -422,7 +422,7 @@ bool SwRootFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, const_cast<SwRootFrame*>(this)->SetCallbackActionEnabled( false ); OSL_ENSURE( (Lower() && Lower()->IsPageFrame()), "No PageFrame found." ); if( pCMS && pCMS->m_pFill ) - static_cast<SwCursorMoveState*>(pCMS)->m_bFillRet = false; + pCMS->m_bFillRet = false; Point aOldPoint = rPoint; // search for page containing rPoint. The borders around the pages are considered @@ -479,7 +479,7 @@ bool SwCellFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint, const SwTabFrame *pTab = FindTabFrame(); if ( pTab->IsFollow() && pTab->IsInHeadline( *this ) ) { - static_cast<SwCursorMoveState*>(pCMS)->m_bStop = true; + pCMS->m_bStop = true; return false; } } diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index afd00eb3389a..1cf2c0fe026f 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -81,7 +81,7 @@ void SwAnchoredObjectPosition::GetInfoAboutObj() // determine contact object { - mpContact = static_cast<SwContact*>(GetUserCall( &mrDrawObj )); + mpContact = GetUserCall( &mrDrawObj ); assert(mpContact && "SwAnchoredObjectPosition::GetInfoAboutObj() - missing SwContact-object."); } diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index c01d474488e7..3050008c7ca9 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -518,7 +518,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() SwTwips nTopMargin = (pAnchorFrameForVertPos->*fnRect->fnGetTopMargin)(); if ( pAnchorFrameForVertPos->IsTextFrame() ) { - nTopMargin -= static_cast<const SwTextFrame*>(pAnchorFrameForVertPos)-> + nTopMargin -= pAnchorFrameForVertPos-> GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } nVertOffsetToFrameAnchorPos += nTopMargin; diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 2cf4c4cd657e..617bf177c4d8 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -250,7 +250,7 @@ SwTable::~SwTable() } // the table can be deleted if it's the last client of the FrameFormat - SwTableFormat* pFormat = static_cast<SwTableFormat*>(GetFrameFormat()); + SwTableFormat* pFormat = GetFrameFormat(); pFormat->Remove( this ); // remove if( !pFormat->HasWriterListeners() ) diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index d953c208019b..ecb9d0afb207 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1145,8 +1145,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() else if ( pFrame->IsInSct() ) { const SwSectionFrame* pSctFrame = pFrame->FindSctFrame(); - const SwSection* pSection = - static_cast<const SwSectionFrame*>(pSctFrame)->GetSection(); + const SwSection* pSection = pSctFrame->GetSection(); if ( TOX_CONTENT_SECTION == pSection->GetType() ) { @@ -1202,7 +1201,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements() } pRowFrame = static_cast<const SwRowFrame*>(pRowFrame->GetNext()); } - pMasterFrame = static_cast<const SwTabFrame*>(pMasterFrame->GetFollow()); + pMasterFrame = pMasterFrame->GetFollow(); } } } diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 5ad56099dbaf..6c544e75fbca 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -545,7 +545,7 @@ void SwTextFrame::AdjustFollow_( SwTextFormatter &rLine, { while( GetFollow() ) { - if( static_cast<SwTextFrame*>(GetFollow())->IsLocked() ) + if( GetFollow()->IsLocked() ) { OSL_FAIL( "+SwTextFrame::JoinFrame: Follow is locked." ); return; diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index ce0c0f0ed38d..f9b24e02abca 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -60,8 +60,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, sal_uInt16 nMaxSizeDiff; - const SwScriptInfo& rSI = - static_cast<SwParaPortion*>(rInf.GetParaPortion())->GetScriptInfo(); + const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo(); sal_uInt16 nMaxComp = ( SwFontScript::CJK == rInf.GetFont()->GetActual() ) && rSI.CountCompChg() && diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 53b3c903a2d9..dbb67b832d84 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1412,7 +1412,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoint, if( bFieldInfo && ( nWidth30 < nX || bRightOver || bLeftOver || ( pPor->InNumberGrp() && !pPor->IsFootnoteNumPortion() ) || ( pPor->IsMarginPortion() && nWidth > nX + 30 ) ) ) - static_cast<SwCursorMoveState*>(pCMS)->m_bPosCorr = true; + pCMS->m_bPosCorr = true; // #i27615# if (pCMS) @@ -1433,16 +1433,16 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoint, if( pCMS ) { if( pPor->IsFlyPortion() && bFieldInfo ) - static_cast<SwCursorMoveState*>(pCMS)->m_bPosCorr = true; + pCMS->m_bPosCorr = true; if (!bRightOver && nX) { if( pPor->IsFootnoteNumPortion()) - static_cast<SwCursorMoveState*>(pCMS)->m_bFootnoteNoInfo = true; + pCMS->m_bFootnoteNoInfo = true; else if (pPor->InNumberGrp() ) // #i23726# { - static_cast<SwCursorMoveState*>(pCMS)->m_nInNumPostionOffset = nX; - static_cast<SwCursorMoveState*>(pCMS)->m_bInNumPortion = true; + pCMS->m_nInNumPostionOffset = nX; + pCMS->m_bInNumPortion = true; } } } @@ -1553,7 +1553,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoint, ! static_cast<SwMultiPortion*>(pPor)->OnTop() ) nTmpY = 0; - SwTextCursorSave aSave( const_cast<SwTextCursor*>(static_cast<const SwTextCursor*>(this)), static_cast<SwMultiPortion*>(pPor), + SwTextCursorSave aSave( const_cast<SwTextCursor*>(this), static_cast<SwMultiPortion*>(pPor), nTmpY, nX, nCurrStart, nSpaceAdd ); SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() ); @@ -1679,7 +1679,7 @@ sal_Int32 SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoint, // set cursor bidi level if ( pCMS ) - static_cast<SwCursorMoveState*>(pCMS)->m_nCursorBidiLevel = + pCMS->m_nCursorBidiLevel = aDrawInf.GetCursorBidiLevel(); if( bFieldInfo && nLength == pPor->GetLen() && diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 4adfddceef88..59118504be07 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2085,7 +2085,7 @@ void SwTextFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart, if( pPos->IsMultiPortion() && static_cast<SwMultiPortion*>(pPos)->HasFlyInContent() ) { OSL_ENSURE( !GetMulti(), "Too much multi" ); - const_cast<SwTextFormatter*>(static_cast<const SwTextFormatter*>(this))->pMulti = static_cast<SwMultiPortion*>(pPos); + const_cast<SwTextFormatter*>(this)->pMulti = static_cast<SwMultiPortion*>(pPos); SwLineLayout *pLay = &GetMulti()->GetRoot(); Point aSt( aTmpInf.X(), aStart.Y() ); diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index a84f75798b9d..4b32adad98bb 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -467,7 +467,7 @@ void SwHiddenTextPortion::Paint( const SwTextPaintInfo & rInf) const aPos.Y() -= 150; aPos.X() -= 25; SwRect aRect( aPos, Size( 100, 200 ) ); - static_cast<OutputDevice*>(pOut)->DrawRect( aRect.SVRect() ); + pOut->DrawRect( aRect.SVRect() ); pOut->SetFillColor( aOldColor ); #endif } diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index b3ef2f1fa7fa..c8969bf47cbb 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -511,7 +511,7 @@ SwDropPortion *SwTextFormatter::NewDropPortion( SwTextFormatInfo &rInf ) nPorLen = m_pFrame->GetTextNode()->GetDropLen( nPorLen ); if( !nPorLen ) { - static_cast<SwTextFormatter*>(this)->ClearDropFormat(); + ClearDropFormat(); return nullptr; } @@ -541,7 +541,7 @@ SwDropPortion *SwTextFormatter::NewDropPortion( SwTextFormatInfo &rInf ) // font is used. if ( GetDropLines() < 2 ) { - static_cast<SwTextFormatter*>(this)->SetPaintDrop( true ); + SetPaintDrop( true ); return pDropPor; } @@ -587,7 +587,7 @@ SwDropPortion *SwTextFormatter::NewDropPortion( SwTextFormatInfo &rInf ) pCurrPart = pPart; } - static_cast<SwTextFormatter*>(this)->SetPaintDrop( true ); + SetPaintDrop( true ); return pDropPor; } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index c509ae6b6df8..ec13901c974f 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -385,7 +385,7 @@ void SwTextFrame::DestroyImpl() if( nullptr != ( pCNd = dynamic_cast<SwContentNode*>( GetRegisteredIn() ) ) && !pCNd->GetDoc()->IsInDtor() && HasFootnote() ) { - SwTextNode *pTextNd = static_cast<SwTextFrame*>(this)->GetTextNode(); + SwTextNode *pTextNd = GetTextNode(); const SwFootnoteIdxs &rFootnoteIdxs = pCNd->GetDoc()->GetFootnoteIdxs(); size_t nPos = 0; sal_uLong nIndex = pCNd->GetIndex(); diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index fe7c97ce1df6..260adc0185f3 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -190,7 +190,7 @@ void SwFormatFootnote::GetFootnoteText( OUString& rStr ) const ++aIdx; while ( !aIdx.GetNode().IsEndNode() ) { if ( aIdx.GetNode().IsTextNode() ) - rStr += " " + static_cast<SwTextNode*>((aIdx.GetNode().GetTextNode()))->GetExpandText(); + rStr += " " + aIdx.GetNode().GetTextNode()->GetExpandText(); ++aIdx; } } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 1ab0dff5b169..da8a62ab65c7 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1503,8 +1503,7 @@ void lcl_CopyHint( if( pDest && pDest->GetpSwpHints() && pDest->GetpSwpHints()->Contains( pNewHt ) ) { - SwCharFormat* pFormat = - static_cast<SwCharFormat*>(pHt->GetCharFormat().GetCharFormat()); + SwCharFormat* pFormat = pHt->GetCharFormat().GetCharFormat(); if (pOtherDoc) { diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 6d21b64596bc..ee6d9d6d2b11 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -955,8 +955,7 @@ void SwHistory::Add( SwTextAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr ) static_txtattr_cast<SwTextRefMark*>(pHint), nNodeIdx); break; default: - pHt = new SwHistorySetText( - static_cast<SwTextAttr*>(pHint), nNodeIdx ); + pHt = new SwHistorySetText( pHint, nNodeIdx ); } } else diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 7a2896c6e0cb..d8d7ff42894b 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -526,7 +526,7 @@ sal_Int32 SwXDrawPage::getCount() throw( uno::RuntimeException, std::exception ) return 0; else { - static_cast<SwXDrawPage*>(this)->GetSvxPage(); + GetSvxPage(); std::set<const SwFrameFormat*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pDoc); @@ -553,7 +553,7 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex, std::set<const SwFrameFormat* if(!pDoc->getIDocumentDrawModelAccess().GetDrawModel()) throw lang::IndexOutOfBoundsException(); - static_cast<SwXDrawPage*>(this)->GetSvxPage(); + GetSvxPage(); std::set<const SwFrameFormat*> aTextBoxes; if (!pTextBoxes) { @@ -580,7 +580,7 @@ sal_Bool SwXDrawPage::hasElements() throw( uno::RuntimeException, std::exception if(!pDoc->getIDocumentDrawModelAccess().GetDrawModel()) return false; else - return static_cast<SwXDrawPage*>(this)->GetSvxPage()->hasElements(); + return GetSvxPage()->hasElements(); } void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) @@ -1442,7 +1442,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a break; } if(pItem) - static_cast<SfxPoolItem*>(pItem)->PutValue(aValue, pEntry->nMemberId); + pItem->PutValue(aValue, pEntry->nMemberId); } } else diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index a50abf74a860..c5b1f69ade1c 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -134,7 +134,7 @@ SwUnoInternalPaM& SwUnoInternalPaM::operator=(const SwPaM& rPaM) } else DeleteMark(); - while(&rPaM != (pTmp = static_cast<const SwPaM*>(pTmp->GetNext()))) + while(&rPaM != (pTmp = pTmp->GetNext())) { if(pTmp->HasMark()) new SwPaM(*pTmp->GetMark(), *pTmp->GetPoint(), this); @@ -285,7 +285,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SwPaM *pTmpCursor = &rPaM; do { pDoc->SetTextFormatColl(*pTmpCursor, pLocal); - pTmpCursor = static_cast<SwPaM*>(pTmpCursor->GetNext()); + pTmpCursor = pTmpCursor->GetNext(); } while ( pTmpCursor != &rPaM ); pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); } @@ -649,7 +649,7 @@ SwUnoCursorHelper::GetCurTextFormatColl(SwPaM & rPaM, const bool bConditional) } } - pTmpCursor = static_cast<SwPaM*>(pTmpCursor->GetNext()); + pTmpCursor = pTmpCursor->GetNext(); } while ( pTmpCursor != &rPaM ); return (bError) ? nullptr : pFormat; } @@ -734,7 +734,7 @@ void SwXTextCursor::DeleteAndInsert(const OUString& rText, UnoActionContext aAction(pDoc); const sal_Int32 nTextLen = rText.getLength(); pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, nullptr); - auto pCurrent = static_cast<SwCursor*>(pUnoCursor); + auto pCurrent = pUnoCursor; do { if (pCurrent->HasMark()) diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 010e4a1569c9..2d1da9e34b1a 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -324,7 +324,7 @@ void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem // Is the move to the new one finished and will the old one be deleted? if( static_cast<const SwFormatChg*>(pNew)->pChangedFormat == pClient->GetRegisteredIn() && static_cast<const SwFormatChg*>(pOld)->pChangedFormat->IsFormatInDTOR() ) - static_cast<SwModify*>(pClient->GetRegisteredIn())->Remove(pClient); + pClient->GetRegisteredIn()->Remove(pClient); break; } } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 5dcf99c3ab40..04e7321b4a0c 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1744,7 +1744,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( SfxStyleSheetBase* pBase; SfxStyleSheetBasePool* pPool = pLocalDoc->GetDocShell()->GetStyleSheetPool(); - pBase = static_cast<SfxStyleSheetBasePool*>(pPool)->Find(sCharFormatName, SfxStyleFamily::Char); + pBase = pPool->Find(sCharFormatName, SfxStyleFamily::Char); if(!pBase) pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char); pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index c38c1e31978c..30449edfc0a7 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1734,7 +1734,7 @@ void SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>(const SfxItemPropertySimpleEnt aFormat.SetCharFormat(*pCharFormatIt); else if(m_pBasePool) { - auto pBase(static_cast<SfxStyleSheetBasePool*>(m_pBasePool)->Find(rCharName, SfxStyleFamily::Char)); + auto pBase(m_pBasePool->Find(rCharName, SfxStyleFamily::Char)); if(!pBase) pBase = &m_pBasePool->Make(rCharName, SfxStyleFamily::Char); aFormat.SetCharFormat(static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat()); diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx index e6f4d44fcc50..933881085af8 100644 --- a/sw/source/core/unocore/unotextmarkup.cxx +++ b/sw/source/core/unocore/unotextmarkup.cxx @@ -378,7 +378,7 @@ static void lcl_commitGrammarMarkUp( if ( bCommit ) { if( nType == text::TextMarkupType::SENTENCE ) - static_cast<SwGrammarMarkUp*>(pWList)->setSentence( nStart+nLength ); + pWList->setSentence( nStart+nLength ); else pWList->Insert( rIdentifier, xMarkupInfoContainer, nStart, nLength ); } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 0dd248da9dc2..118e2243efa8 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1085,7 +1085,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) SwRect aPageRect( pPage->GetBoundRect(GetWin()) ); if ( bBookMode ) { - const SwPageFrame& rFormatPage = static_cast<const SwPageFrame*>(pPage)->GetFormatPage(); + const SwPageFrame& rFormatPage = pPage->GetFormatPage(); aPageRect.SSize() = rFormatPage.GetBoundRect(GetWin()).SSize(); } diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 2ffbe0074239..d0cb168dc060 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -171,7 +171,7 @@ bool Writer::CopyNextPam( SwPaM ** ppPam ) } // otherwise copy the next value from the next Pam - *ppPam = static_cast<SwPaM*>((*ppPam)->GetNext() ); + *ppPam = (*ppPam)->GetNext(); *pCurPam->GetPoint() = *(*ppPam)->Start(); *pCurPam->GetMark() = *(*ppPam)->End(); diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx index 97f244f205e3..e0cecc089573 100644 --- a/sw/source/ui/vba/vbasystem.cxx +++ b/sw/source/ui/vba/vbasystem.cxx @@ -210,14 +210,14 @@ SwVbaSystem::setCursor( sal_Int32 _cursor ) throw (uno::RuntimeException, std::e } case word::WdCursorType::wdCursorWait: { - const Pointer& rPointer( static_cast< PointerStyle >( PointerStyle::Wait ) ); + const Pointer& rPointer( PointerStyle::Wait ); //It will set the edit window, toobar and statusbar's mouse pointer. setCursorHelper( getCurrentWordDoc(mxContext), rPointer, true ); break; } case word::WdCursorType::wdCursorIBeam: { - const Pointer& rPointer( static_cast< PointerStyle >( PointerStyle::Text ) ); + const Pointer& rPointer( PointerStyle::Text ); //It will set the edit window, toobar and statusbar's mouse pointer. setCursorHelper( getCurrentWordDoc( mxContext ), rPointer, true ); break; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 25a848c733d4..4ec653074d3b 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -266,7 +266,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SvxLRSpaceItem aLR(RES_LR_SPACE); if ( !bSect && (bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY) ) { - SwFrameFormat* pFormat = static_cast<SwFrameFormat*>(rSh.GetFlyFrameFormat()); + SwFrameFormat* pFormat = rSh.GetFlyFrameFormat(); const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED); bool bVerticalFrame(false); @@ -425,7 +425,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY ) { - SwFrameFormat* pFormat = static_cast<SwFrameFormat*>(rSh.GetFlyFrameFormat()); + SwFrameFormat* pFormat = rSh.GetFlyFrameFormat(); const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED); const long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top(); const long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower()); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index a4d3caa7f8ca..da2675e47559 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1385,8 +1385,8 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage() throw( RuntimeEx throw RuntimeException(); if(!mxXDrawPage.is()) { - static_cast<SwXTextDocument*>(this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); - static_cast<SwXTextDocument*>(this)->mxXDrawPage = pDrawPage; + pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); + mxXDrawPage = pDrawPage; // Create a Reference to trigger the complete initialization of the // object. Otherwise in some corner cases it would get initialized // at ::InitNewDoc -> which would get called during |