diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-29 12:05:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-29 12:05:00 +0200 |
commit | 148953244fc8d741ef84ef777ad566ae80edd28a (patch) | |
tree | 807234f01238659c42e87bd1975e6c091f5e89e0 /sw | |
parent | 5dc811daf9ea03dfccabec3a80a44bd12fa62d66 (diff) |
loplugin:redundantcast: const_cast to same type
Change-Id: I7cb919140539d0d573b5fbf786a6041843c2388a
Diffstat (limited to 'sw')
27 files changed, 51 insertions, 51 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index a27b7e9abe88..ce8bd7a9839a 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -258,13 +258,13 @@ namespace sw { MoveTo(our_pClientIters); our_pClientIters = this; - m_pCurrent = m_pPosition = const_cast<WriterListener*>(m_rRoot.m_pWriterListeners); + m_pCurrent = m_pPosition = m_rRoot.m_pWriterListeners; } WriterListener* GetLeftOfPos() { return m_pPosition->m_pLeft; } WriterListener* GetRightOfPos() { return m_pPosition->m_pRight; } WriterListener* GoStart() { - if((m_pPosition = const_cast<WriterListener*>(m_rRoot.m_pWriterListeners))) + if((m_pPosition = m_rRoot.m_pWriterListeners)) while( m_pPosition->m_pLeft ) m_pPosition = m_pPosition->m_pLeft; return m_pCurrent = m_pPosition; @@ -302,7 +302,7 @@ public: TElementType* Last() { if(!m_pPosition) - m_pPosition = const_cast<sw::WriterListener*>(m_rRoot.m_pWriterListeners); + m_pPosition = m_rRoot.m_pWriterListeners; if(!m_pPosition) return static_cast<TElementType*>(Sync()); while(GetRightOfPos()) @@ -339,7 +339,7 @@ public: SwClient* Last() { if(!m_pPosition) - m_pPosition = const_cast<sw::WriterListener*>(m_rRoot.m_pWriterListeners); + m_pPosition = m_rRoot.m_pWriterListeners; if(!m_pPosition) return m_pCurrent = nullptr; while(GetRightOfPos()) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 0428b3fc1fa5..c92cb80d5d4e 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1343,7 +1343,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() else if( nStartIndex.GetNode().IsTableNode() ) { SwTableNode * pTable = static_cast<SwTableNode *>(&(nStartIndex.GetNode())); - SwTableFormat* pFormat = const_cast<SwTableFormat*>(pTable->GetTable().GetFrameFormat()); + SwTableFormat* pFormat = pTable->GetTable().GetFrameFormat(); pFrm = SwIterator<SwFrm, SwTableFormat>(*pFormat).First(); } diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index cee5edbcf05b..7647b351f473 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -166,7 +166,7 @@ void SwAccessibleNoTextFrame::Dispose( bool bRecursive ) SolarMutexGuard aGuard; if( aDepend.GetRegisteredIn() ) - const_cast < SwModify *>( aDepend.GetRegisteredIn() )->Remove( &aDepend ); + aDepend.GetRegisteredIn()->Remove( &aDepend ); SwAccessibleFrameBase::Dispose( bRecursive ); } diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 3d64f3a15778..e09c04ed307a 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -43,7 +43,7 @@ void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* ) if(pDead && pDead->pObject == pRegisteredIn) { // I've got a notification from the object I know - SwModify* pAbove = const_cast<SwModify*>(pRegisteredIn->GetRegisteredIn()); + SwModify* pAbove = pRegisteredIn->GetRegisteredIn(); if(pAbove) { // if the dying object itself was listening at an SwModify, I take over diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 6a00e2ee4cff..1583090703d0 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -823,7 +823,7 @@ static SwPageDesc* lcl_FindPageDesc( SwPageDescs *pPageDescs, SwPageDesc* res = NULL; if( it != pPageDescs->end() ) { - res = const_cast <SwPageDesc *>( &( *it ) );; + res = &( *it ) ;; if( pPos ) *pPos = std::distance( pPageDescs->begin(), it ); } @@ -856,7 +856,7 @@ bool SwDoc::ContainsPageDesc( const SwPageDesc *pDesc, size_t* pPos ) if (pDesc == NULL) return false; SwPageDesc *res = lcl_FindPageDesc<CompareSwPageDescToPtr>( - const_cast <SwPageDescs *>( &maPageDescs ), pPos, + &maPageDescs, pPos, CompareSwPageDescToPtr(pDesc) ); return res != NULL; } diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index b89ae65d0110..5d6c51c156a0 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -47,12 +47,12 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo) if ( rInfo.aPageDescDep.GetRegisteredIn() ) const_cast<SwModify*>(rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep ); else if ( aPageDescDep.GetRegisteredIn() ) - const_cast<SwModify*>(aPageDescDep.GetRegisteredIn())->Remove( &aPageDescDep ); + aPageDescDep.GetRegisteredIn()->Remove( &aPageDescDep ); if ( rInfo.aCharFormatDep.GetRegisteredIn() ) const_cast<SwModify*>(rInfo.aCharFormatDep.GetRegisteredIn())->Add( &aCharFormatDep ); else if ( aCharFormatDep.GetRegisteredIn() ) - const_cast<SwModify*>(aCharFormatDep.GetRegisteredIn())->Remove( &aCharFormatDep ); + aCharFormatDep.GetRegisteredIn()->Remove( &aCharFormatDep ); if ( rInfo.aAnchorCharFormatDep.GetRegisteredIn() ) const_cast<SwModify*>(rInfo.aAnchorCharFormatDep.GetRegisteredIn())->Add( diff --git a/sw/source/core/inc/pagedeschint.hxx b/sw/source/core/inc/pagedeschint.hxx index 715caee10cf9..d76aa95d3e70 100644 --- a/sw/source/core/inc/pagedeschint.hxx +++ b/sw/source/core/inc/pagedeschint.hxx @@ -32,7 +32,7 @@ public: : pPageDesc(p) {} - SwPageDesc* GetPageDesc() const { return const_cast<SwPageDesc*>(pPageDesc); } + SwPageDesc* GetPageDesc() const { return pPageDesc; } }; #endif diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index d0005711da16..93d139c25f3f 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -3468,7 +3468,7 @@ bool IsFlyFrameFormatInHeader(const SwFrameFormat& rFormat) const SwFlyFrameFormat* pFlyFrameFormat = dynamic_cast<const SwFlyFrameFormat*>(&rFormat); if (!pFlyFrameFormat) return false; - SwFlyFrm* pFlyFrm = const_cast<SwFlyFrm*>(pFlyFrameFormat->GetFrm()); + SwFlyFrm* pFlyFrm = pFlyFrameFormat->GetFrm(); if (!pFlyFrm) // fdo#54648: "hidden" drawing object has no layout frame { return false; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 36ba34545917..eb770178616a 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -5366,7 +5366,7 @@ static const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm // determine last row of complete table. SwFrm* pLastRow = pLastTabFrm->GetLastLower(); // return first bottom border cell in last row - SwFrm* pLowerCell = const_cast<SwFrm*>(pLastRow->GetLower()); + SwFrm* pLowerCell = pLastRow->GetLower(); while ( !pLowerCell->IsCellFrm() || ( pLowerCell->GetLower() && pLowerCell->GetLower()->IsRowFrm() ) ) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 879bdff06afd..477053a9c9e2 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2033,7 +2033,7 @@ void SwTabFrm::MakeAll() // First, we remove an existing follow flow line. if ( HasFollowFlowLine() ) { - SwFrm* pLastLine = const_cast<SwFrm*>(GetLastLower()); + SwFrm* pLastLine = GetLastLower(); RemoveFollowFlowLine(); // invalidate and rebuild last row if ( pLastLine ) @@ -4347,7 +4347,7 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, bool bTst, bool bInfo ) && this == pTab->GetFirstNonHeadlineRow() && !pTab->IsInRecalcLowerRow() ) { - SwTabFrm* pMasterTab = const_cast< SwTabFrm* >( pTab->FindMaster() ); + SwTabFrm* pMasterTab = pTab->FindMaster(); pMasterTab->InvalidatePos(); } } diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 333cc1edad84..15dd6d36a5b1 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -544,7 +544,7 @@ bool SwTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const bool bRet = false; if( pImp && !pImp->bInPutMuchBlocks ) { - SwBlockName* pBlkNm = const_cast<SwBlockName*>( pImp->aNames[ nIdx ] ); + SwBlockName* pBlkNm = pImp->aNames[ nIdx ]; if( !pBlkNm->bIsOnlyTextFlagInit && !pImp->IsFileChanged() && !pImp->OpenFile( true ) ) { diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index a8f5ff228ddd..3e6467424851 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -878,7 +878,7 @@ SwTextPortion *SwTextFormatter::WhichTextPor( SwTextFormatInfo &rInf ) const pPor = new SwFieldMarkPortion(); else if (rInf.GetText()[rInf.GetIdx()]==CH_TXT_ATR_FORMELEMENT) { - SwTextNode *pNd = const_cast<SwTextNode *>(rInf.GetTextFrm()->GetTextNode()); + SwTextNode *pNd = rInf.GetTextFrm()->GetTextNode(); const SwDoc *doc = pNd->GetDoc(); SwIndex aIndex(pNd, rInf.GetIdx()); SwPosition aPosition(*pNd, aIndex); diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 5220493a09d8..760a5a7fce96 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -856,7 +856,7 @@ void SwFieldFormCheckboxPortion::Paint( const SwTextPaintInfo& rInf ) const bool SwFieldFormCheckboxPortion::Format( SwTextFormatInfo & rInf ) { - SwTextNode *pNd = const_cast < SwTextNode * >( rInf.GetTextFrm( )->GetTextNode( ) ); + SwTextNode *pNd = rInf.GetTextFrm( )->GetTextNode( ); const SwDoc *doc = pNd->GetDoc( ); SwIndex aIndex( pNd, rInf.GetIdx( ) ); SwPosition aPosition( *pNd, aIndex ); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index f5ed6540ade8..3421c32a2cc7 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -804,7 +804,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf, if( rInf.IsTest() ) return new SwFootnotePortion( rFootnote.GetViewNumStr( *pDoc ), pFootnote ); - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_SWAPPED swap(pFrm); sal_uInt16 nReal; { @@ -1105,7 +1105,7 @@ sal_Int32 SwTextFormatter::FormatQuoVadis( const sal_Int32 nOffset ) sal_Int32 nRet; { - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_NOT_SWAPPED swap(pFrm); nRet = FormatLine( nStart ); } diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index dff0acfd82c8..d954926c9435 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -57,7 +57,7 @@ inline bool IsNastyFollow( const SwTextFrm *pFrm ) SwTextFrmBreak::SwTextFrmBreak( SwTextFrm *pNewFrm, const SwTwips nRst ) : nRstHeight(nRst), pFrm(pNewFrm) { - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_SWAPPED swap(pFrm); SWRECTFN( pFrm ) nOrigin = (pFrm->*fnRect->fnGetPrtTop)(); bKeep = !pFrm->IsMoveable() || IsNastyFollow( pFrm ); @@ -104,7 +104,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const { bool bFit = false; - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_SWAPPED swap(pFrm); SWRECTFN( pFrm ) // nOrigin is an absolut value, rLine referes to the swapped situation. @@ -161,7 +161,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const bool SwTextFrmBreak::IsBreakNow( SwTextMargin &rLine ) { - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_SWAPPED swap(pFrm); // bKeep is stronger than IsBreakNow() // Is there enough space ? @@ -220,7 +220,7 @@ WidowsAndOrphans::WidowsAndOrphans( SwTextFrm *pNewFrm, const SwTwips nRst, bool bChkKeep ) : SwTextFrmBreak( pNewFrm, nRst ), nWidLines( 0 ), nOrphLines( 0 ) { - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_SWAPPED swap(pFrm); if( bKeep ) { @@ -302,7 +302,7 @@ bool WidowsAndOrphans::FindBreak( SwTextFrm *pFrame, SwTextMargin &rLine, // Thus, assertion on situation, that these are different to figure out why. OSL_ENSURE( pFrm == pFrame, "<WidowsAndOrphans::FindBreak> - pFrm != pFrame" ); - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm)); + SWAP_IF_SWAPPED swap(pFrm); bool bRet = true; sal_uInt16 nOldOrphans = nOrphLines; diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 9a40d8cc3f8a..2d2bced5d62b 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -1371,7 +1371,7 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet, return false; SwTextNode * const pTextNode = - dynamic_cast<SwTextNode *>(const_cast<SwModify *>(GetRegisteredIn())); + dynamic_cast<SwTextNode *>(GetRegisteredIn()); OSL_ENSURE(pTextNode, "SwRegHistory not registered at text node?"); if (!pTextNode) @@ -1432,12 +1432,12 @@ void SwRegHistory::_MakeSetWhichIds() if( GetRegisteredIn()->ISA( SwContentNode ) ) { pSet = static_cast<SwContentNode*>( - const_cast<SwModify*>(GetRegisteredIn()))->GetpSwAttrSet(); + GetRegisteredIn())->GetpSwAttrSet(); } else if ( GetRegisteredIn()->ISA( SwFormat ) ) { pSet = &static_cast<SwFormat*>( - const_cast<SwModify*>(GetRegisteredIn()))->GetAttrSet(); + GetRegisteredIn())->GetAttrSet(); } if( pSet && pSet->Count() ) { diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 8eec8e292f41..ec5770db5516 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -868,7 +868,7 @@ void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext) SwDoc & rDoc = rContext.GetDoc(); if ( m_pOldSet.get() ) { SwUndoFormatAttrHelper aTmp( - *const_cast<SwTextFormatColl*>(rDoc.GetDfltTextFormatColl()) ); + *rDoc.GetDfltTextFormatColl() ); rDoc.SetDefault( *m_pOldSet ); m_pOldSet.reset( 0 ); if ( aTmp.GetUndo() ) { diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 828bb206a12c..42a8013ee4c5 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -990,7 +990,7 @@ void SwXShape::AddExistingShapeToFormat( SdrObject& _rObj ) { if ( pSwShape->m_bDescriptor ) { - SwFrameFormat* pFormat = ::FindFrameFormat( const_cast< SdrObject* >( pCurrent ) ); + SwFrameFormat* pFormat = ::FindFrameFormat( pCurrent ); if ( pFormat ) pFormat->Add( pSwShape ); pSwShape->m_bDescriptor = false; diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 852362495522..4d175fb843db 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -811,7 +811,7 @@ SwFieldType* SwXFieldMaster::GetFieldType(bool const bDontCreate) const if (m_pImpl->m_bIsDescriptor) return 0; else - return static_cast<SwFieldType*>(const_cast<SwModify*>(m_pImpl->GetRegisteredIn())); + return static_cast<SwFieldType*>(m_pImpl->GetRegisteredIn()); } typedef std::vector<SwFormatField*> SwDependentFields; @@ -1297,8 +1297,8 @@ SwXTextField::getTextFieldMaster() throw (uno::RuntimeException, std::exception) SwFieldType* pType = 0; if (m_pImpl->m_bIsDescriptor && m_pImpl->m_FieldTypeClient.GetRegisteredIn()) { - pType = static_cast<SwFieldType*>(const_cast<SwModify*>( - m_pImpl->m_FieldTypeClient.GetRegisteredIn())); + pType = static_cast<SwFieldType*>( + m_pImpl->m_FieldTypeClient.GetRegisteredIn()); } else { @@ -1995,7 +1995,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) m_pImpl->m_bIsDescriptor = false; if (m_pImpl->m_FieldTypeClient.GetRegisteredIn()) { - const_cast<SwModify*>(m_pImpl->m_FieldTypeClient.GetRegisteredIn()) + m_pImpl->m_FieldTypeClient.GetRegisteredIn() ->Remove(&m_pImpl->m_FieldTypeClient); } m_pImpl->m_pProps.reset(); diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 12b4c4f9c137..827d4fbdd83f 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -97,7 +97,7 @@ void SwXFootnote::Impl::Invalidate() { if (GetRegisteredIn()) { - const_cast<SwModify*>(GetRegisteredIn())->Remove(this); + GetRegisteredIn()->Remove(this); } m_pFormatFootnote = 0; m_rThis.SetDoc(0); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index a476a4b9fc9e..25230777c170 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1383,7 +1383,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) // update page numbers pTOX->GetFormat()->Add(m_pImpl.get()); pTOX->GetFormat()->SetXObject(static_cast< ::cppu::OWeakObject*>(this)); - const_cast<SwTOXBaseSection*>(pTOX)->UpdatePageNum(); + pTOX->UpdatePageNum(); m_pImpl->m_pProps.reset(); m_pImpl->m_pDoc = pDoc; @@ -1624,10 +1624,10 @@ void SwXDocumentIndexMark::Impl::Invalidate() { if (GetRegisteredIn()) { - const_cast<SwModify*>(GetRegisteredIn())->Remove(this); + GetRegisteredIn()->Remove(this); if (m_TypeDepend.GetRegisteredIn()) { - const_cast<SwModify*>(m_TypeDepend.GetRegisteredIn())->Remove( + m_TypeDepend.GetRegisteredIn()->Remove( &m_TypeDepend); } } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 417241597972..89e716ceac83 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -472,7 +472,7 @@ public: SwUnoCrsr * GetCursor() { return static_cast<SwUnoCrsr*>( - const_cast<SwModify*>(GetRegisteredIn())); + GetRegisteredIn()); } uno::Reference< text::XTextContent > NextElement_Impl() @@ -763,14 +763,14 @@ void SwXTextRange::Impl::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew // if the depend was removed then the range must be removed too if (!m_ObjectDepend.GetRegisteredIn() && GetRegisteredIn()) { - const_cast<SwModify*>(GetRegisteredIn())->Remove(this); + GetRegisteredIn()->Remove(this); } // or if the range has been removed but the depend is still // connected then the depend must be removed else if (bAlreadyRegistered && !GetRegisteredIn() && m_ObjectDepend.GetRegisteredIn()) { - const_cast<SwModify*>(m_ObjectDepend.GetRegisteredIn()) + m_ObjectDepend.GetRegisteredIn() ->Remove(& m_ObjectDepend); } } @@ -1527,7 +1527,7 @@ public: SwUnoCrsr * GetCursor() { return static_cast<SwUnoCrsr*>( - const_cast<SwModify*>(GetRegisteredIn())); + GetRegisteredIn()); } void MakeRanges(); @@ -1719,7 +1719,7 @@ public: SwUnoCrsr * GetCursor() { return static_cast<SwUnoCrsr*>( - const_cast<SwModify*>(GetRegisteredIn())); + GetRegisteredIn()); } protected: @@ -1769,8 +1769,8 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr, if (!i_rFrames.size()) return false; - SwFrameFormat *const pFormat = static_cast<SwFrameFormat*>(const_cast<SwModify*>( - i_rFrames.front()->GetRegisteredIn())); + SwFrameFormat *const pFormat = static_cast<SwFrameFormat*>( + i_rFrames.front()->GetRegisteredIn()); i_rFrames.pop_front(); // the format should be valid here, otherwise the client // would have been removed in ::Modify diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index d322d7e32ac1..c0ce5748a7c5 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -82,7 +82,7 @@ void SwXReferenceMark::Impl::Invalidate() { if (IsValid()) { - const_cast<SwModify*>(GetRegisteredIn())->Remove(this); + GetRegisteredIn()->Remove(this); } m_pDoc = 0; m_pMarkFormat = 0; diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index cbd5bc6f08ae..4662759f9f56 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2075,7 +2075,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex pCursor = reinterpret_cast<OTextCursorHelper*>( sal::static_int_cast<sal_IntPtr>(xRangeTunnel->getSomething(OTextCursorHelper::getUnoTunnelId()))); } - SwDoc* pDoc = pRange ? const_cast<SwDoc*>(pRange->GetDoc()) : pCursor ? const_cast<SwDoc*>(pCursor->GetDoc()) : nullptr; + SwDoc* pDoc = pRange ? pRange->GetDoc() : pCursor ? pCursor->GetDoc() : nullptr; if(!pDoc || !nRows || !nColumns) throw lang::IllegalArgumentException(); SwUnoInternalPaM aPam(*pDoc); diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index c82f6f958d67..50892e443e8b 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -173,7 +173,7 @@ namespace myImplHelpers SwTextFormatColl* MapperImpl<SwTextFormatColl>::MakeStyle(const OUString &rName) { return mrDoc.MakeTextFormatColl(rName, - const_cast<SwTextFormatColl *>(mrDoc.GetDfltTextFormatColl())); + mrDoc.GetDfltTextFormatColl()); } template<> class MapperImpl<SwCharFormat> diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 318e5afe16c0..2b8065f2251e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4006,7 +4006,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType) if (pFormat) aDrop.SetCharFormat(const_cast<SwCharFormat*>(pFormat)); else if(pNewSwCharFormat) - aDrop.SetCharFormat(const_cast<SwCharFormat*>(pNewSwCharFormat)); + aDrop.SetCharFormat(pNewSwCharFormat); SwPosition aStart(*pEndNd); m_pCtrlStck->NewAttr(aStart, aDrop); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 590774a9eb02..97044dc2eb26 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -218,7 +218,7 @@ IMPL_LINK_NOARG(SwView, FormControlActivated) if ( pSdrView && pSdrView->IsTextEdit() ) pSdrView->SdrEndTextEdit( true ); - const_cast< SwView* >( this )->AttrChangedNotify( m_pWrtShell ); + AttrChangedNotify( m_pWrtShell ); } return 0L; |