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/core/doc | |
parent | 9af0403ddc024b843c214eb43923692fb1dfd9eb (diff) |
loplugin:redundantcast: redundant static_casts in sw
Change-Id: I09c1ebaf5742e983ee05942a4c7c17c6aa5179cc
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/doc/doccorr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docftn.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/doc/docglos.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/extinput.cxx | 2 |
8 files changed, 21 insertions, 22 deletions
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; } |