diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-27 11:06:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-27 18:42:13 +0200 |
commit | 9e0b3423f21c23a8ef2fe749ea7dd7c1194c2f9a (patch) | |
tree | 26f2674f88359c5e6c3e1d0f888c7b31836c36ee /sw/source | |
parent | bbd500e14fce92b27cfc09e7cffd346e36eb5fb0 (diff) |
loplugin:referencecasting find more redundant static_cast
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae
Reviewed-on: https://gerrit.libreoffice.org/78191
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/attr/calbck.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/CntntIdxStore.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/frmcrsr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/itradj.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldedt.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewling.cxx | 2 |
13 files changed, 22 insertions, 23 deletions
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index b90ebafae831..cef9b02b059f 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -283,7 +283,7 @@ SwClient* SwModify::Remove( SwClient* pDepend ) { // if object being removed is the current or next object in an // iterator, advance this iterator - rIter.m_pPosition = static_cast<SwClient*>(pR); + rIter.m_pPosition = pR; } } } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index d5fa25e5d592..538009793741 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -471,7 +471,7 @@ bool SwCursorShell::bColumnChange() if(pParent!=nullptr) { pCurrCol=static_cast<SwFrame*>(pParent)->FindColFrame(); - pCurrFrame = static_cast<SwFrame*>(pParent); + pCurrFrame = pParent; } else { diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index b62490995652..7355257bf711 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -398,7 +398,7 @@ void ContentIdxStoreImpl::RestoreFlys(SwDoc* pDoc, updater_t const & rUpdater, b else if( bAuto ) { SwFrameFormat *pFrameFormat = (*pSpz)[ aEntry.m_nIdx ]; - SfxPoolItem const *pAnchor = static_cast<SfxPoolItem const *>(&pFrameFormat->GetAnchor()); + SfxPoolItem const *pAnchor = &pFrameFormat->GetAnchor(); pFrameFormat->NotifyClients( pAnchor, pAnchor ); } } diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 0c69d1d4a9a6..be514788ec6a 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1015,7 +1015,7 @@ void SwDoc::DelTextFormatColl( SwTextFormatColl const *pColl, bool bBroadcast ) static bool lcl_SetTextFormatColl( const SwNodePtr& rpNode, void* pArgs ) { - SwContentNode* pCNd = static_cast<SwContentNode*>(rpNode->GetTextNode()); + SwContentNode* pCNd = rpNode->GetTextNode(); if( pCNd == nullptr) return true; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 057ebdbb5ee5..48d9eab2e1b9 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -218,7 +218,7 @@ SwTableNode* SwDoc::IsIdxInTable(const SwNodeIndex& rIdx) SwTableNode* pTableNd = nullptr; sal_uLong nIndex = rIdx.GetIndex(); do { - SwNode* pNd = static_cast<SwNode*>(GetNodes()[ nIndex ]->StartOfSectionNode()); + SwNode* pNd = GetNodes()[ nIndex ]->StartOfSectionNode(); if( nullptr != ( pTableNd = pNd->GetTableNode() ) ) break; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 552180f46525..9e7644dd7f8e 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1839,8 +1839,8 @@ void SwFEShell::GetConnectableFrameFormats(SwFrameFormat & rFormat, StartAction(); SwFormatChain rChain = rFormat.GetChain(); - SwFrameFormat * pOldChainNext = static_cast<SwFrameFormat *>(rChain.GetNext()); - SwFrameFormat * pOldChainPrev = static_cast<SwFrameFormat *>(rChain.GetPrev()); + SwFrameFormat * pOldChainNext = rChain.GetNext(); + SwFrameFormat * pOldChainPrev = rChain.GetPrev(); if (pOldChainNext) mxDoc->Unchain(rFormat); diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index e47dc10c3a25..7eae6a55198e 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -197,7 +197,7 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const SwPosition &rPos, bNoScroll ); pFrame->GetFormatted(); - const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper()); + const SwFrame* pTmpFrame = pFrame->GetUpper(); if (pTmpFrame->getFrameArea().Top() == FAR_AWAY && !bAllowFarAway) return false; @@ -373,7 +373,7 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const SwTextFrame* pFrame = &(const_cast<SwTextFrame*>(this)->GetFrameAtOfst( nOffset )); pFrame->GetFormatted(); - const SwFrame* pTmpFrame = static_cast<SwFrame*>(pFrame->GetUpper()); + const SwFrame* pTmpFrame = pFrame->GetUpper(); SwRectFnSet aRectFnSet(pTmpFrame); SwTwips nUpperMaxY = aRectFnSet.GetPrtBottom(*pTmpFrame); diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index 27659330e387..f32bc444712e 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -749,7 +749,7 @@ void SwTextAdjuster::CalcDropAdjust() if( pPor->InGlueGrp() && pPor->GetNextPortion() && pPor->GetNextPortion()->IsDropPortion() ) { - const SwLinePortion *pDropPor = static_cast<SwDropPortion*>( pPor->GetNextPortion() ); + const SwLinePortion *pDropPor = pPor->GetNextPortion(); SwGluePortion *pLeft = static_cast<SwGluePortion*>( pPor ); // 4) pRight: Find the GluePor coming after the DropPor diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 72d3363e800b..9c59c5353fea 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -139,7 +139,7 @@ sal_uInt16 SwTextFormatter::GetFrameRstHeight() const // GetFrameRstHeight() is being called with Footnote. // Wrong: const SwFrame *pUpper = pFrame->GetUpper(); - const SwFrame *pPage = static_cast<const SwFrame*>(m_pFrame->FindPageFrame()); + const SwFrame *pPage = m_pFrame->FindPageFrame(); const SwTwips nHeight = pPage->getFrameArea().Top() + pPage->getFramePrintArea().Top() + pPage->getFramePrintArea().Height() - Y(); @@ -1040,7 +1040,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) if( !rInf.IsErgoDone() ) { if( m_pFrame->IsInFootnote() && !m_pFrame->GetIndPrev() ) - pPor = static_cast<SwLinePortion*>(NewErgoSumPortion( rInf )); + pPor = NewErgoSumPortion( rInf ); rInf.SetErgoDone( true ); } @@ -1085,7 +1085,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) const bool bFootnoteNum = m_pFrame->IsFootnoteNumFrame(); rInf.GetParaPortion()->SetFootnoteNum( bFootnoteNum ); if( bFootnoteNum ) - pPor = static_cast<SwLinePortion*>(NewFootnoteNumPortion( rInf )); + pPor = NewFootnoteNumPortion( rInf ); rInf.SetFootnoteDone( true ); } @@ -1094,7 +1094,7 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) if( !rInf.IsErgoDone() && !pPor && ! rInf.IsMulti() ) { if( m_pFrame->IsInFootnote() && !m_pFrame->GetIndPrev() ) - pPor = static_cast<SwLinePortion*>(NewErgoSumPortion( rInf )); + pPor = NewErgoSumPortion( rInf ); rInf.SetErgoDone( true ); } @@ -1106,12 +1106,12 @@ SwLinePortion *SwTextFormatter::WhichFirstPortion(SwTextFormatInfo &rInf) // If we're in the follow, then of course not if (GetTextFrame()->GetTextNodeForParaProps()->GetNumRule()) - pPor = static_cast<SwLinePortion*>(NewNumberPortion( rInf )); + pPor = NewNumberPortion( rInf ); rInf.SetNumDone( true ); } // 8. The DropCaps if( !pPor && GetDropFormat() && ! rInf.IsMulti() ) - pPor = static_cast<SwLinePortion*>(NewDropPortion( rInf )); + pPor = NewDropPortion( rInf ); // 9. Kerning portions at beginning of line in grid mode if ( !pPor && !m_pCurr->GetNextPortion() ) @@ -2464,7 +2464,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf ) SwFlyCntPortion *SwTextFormatter::NewFlyCntPortion( SwTextFormatInfo &rInf, SwTextAttr *pHint ) const { - const SwFrame *pFrame = static_cast<SwFrame*>(m_pFrame); + const SwFrame *pFrame = m_pFrame; SwFlyInContentFrame *pFly; SwFrameFormat* pFrameFormat = static_cast<SwTextFlyCnt*>(pHint)->GetFlyCnt().GetFrameFormat(); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index ddb0d1263768..5ac8ff1a5a45 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -547,7 +547,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry if( pAny ) { const SwTableNode* pTableNode = pSttNode->FindTableNode(); - SwFrameFormat* pTableFormat = static_cast<SwFrameFormat*>(pTableNode->GetTable().GetFrameFormat()); + SwFrameFormat* pTableFormat = pTableNode->GetTable().GetFrameFormat(); //SwTable& rTable = static_cast<SwTableNode*>(pSttNode)->GetTable(); if(FN_UNO_TEXT_TABLE == rEntry.nWID) { diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 0ab716c8bd27..2230e40d014c 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -663,8 +663,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() pTableNode && (&pTableNode->GetTable() != m_pOwnTable)) { // this is a foreign table - SwFrameFormat* pTableFormat = - static_cast<SwFrameFormat*>(pTableNode->GetTable().GetFrameFormat()); + SwFrameFormat* pTableFormat = pTableNode->GetTable().GetFrameFormat(); xRef = SwXTextTable::CreateXTextTable(pTableFormat); } else @@ -1146,7 +1145,7 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) { SwTableNode const*const pTableNode = pSttNode->FindTableNode(); SwFrameFormat *const pTableFormat = - static_cast<SwFrameFormat*>(pTableNode->GetTable().GetFrameFormat()); + pTableNode->GetTable().GetFrameFormat(); SwTableBox *const pBox = pSttNode->GetTableBox(); xParentText = pBox diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 2290a3b632fc..aaaf1e21d28f 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -285,7 +285,7 @@ IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button&, rButton, void) SwFieldMgr& rMgr = pTabPage->GetFieldMgr(); SwField *pCurField = rMgr.GetCurField(); if (pCurField->GetTypeId() == TYP_DBFLD) - pOldTyp = static_cast<SwDBFieldType*>(pCurField->GetTyp()); + pOldTyp = pCurField->GetTyp(); rMgr.GoNextPrev( bNext, pOldTyp ); pCurField = rMgr.GetCurField(); diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 28fad568e8c1..380ecebcbc27 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -647,7 +647,7 @@ bool SwView::ExecSpellPopup(const Point& rPt) m_pWrtShell->Push(); SwRect aToFill; - SwCursorShell *pCursorShell = static_cast<SwCursorShell*>(m_pWrtShell.get()); + SwCursorShell *pCursorShell = m_pWrtShell.get(); SwPaM *pCursor = pCursorShell->GetCursor(); SwPosition aPoint(*pCursor->GetPoint()); const SwTextNode *pNode = aPoint.nNode.GetNode().GetTextNode(); |