diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-02 13:31:09 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-02 13:31:09 +0200 |
commit | b6aac4e597263f16703feeeab4007c96ad5ac209 (patch) | |
tree | f636f11f34ac7d9bc4f17776bfaffe9d5e9e9638 /sw | |
parent | 6d96156778b11ceb076d1e51c38379be44fb06da (diff) |
Improved loplugin:redundantcast const_cast handling: sw
Change-Id: I7a420427f7be1b42907272b314cf3b864e1fe7ba
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/vdraw.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 |
10 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 585c8c81afc2..4694f5593d10 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -674,7 +674,7 @@ namespace // iterate over relevant redlines and decide for each whether it should // be saved, or split + saved - SwRedlineTable& rRedlineTable = const_cast<SwRedlineTable&>( pDoc->getIDocumentRedlineAccess().GetRedlineTable() ); + SwRedlineTable& rRedlineTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); for( ; nCurrentRedline < rRedlineTable.size(); nCurrentRedline++ ) { SwRangeRedline* pCurrent = rRedlineTable[ nCurrentRedline ]; diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 1864b6e1d6ba..3787418e9e78 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -1278,7 +1278,7 @@ SwTableAutoFormatTable::SwTableAutoFormatTable() { aBox.SetLine( i <= 3 ? &aLn : nullptr, SvxBoxItemLine::TOP ); aBox.SetLine( (3 == ( i & 3 )) ? &aLn : nullptr, SvxBoxItemLine::RIGHT ); - const_cast<SwBoxAutoFormat&>(pNew->GetBoxFormat( i )).SetBox( aBox ); + pNew->GetBoxFormat( i ).SetBox( aBox ); } pNew->SetUserDefined(false); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 9a1bdbd8eea2..90b952ab52e7 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -4212,7 +4212,7 @@ void SwDoc::ClearLineNumAttrs( SwPosition & rPos ) && pTextNode->GetText().isEmpty()) { const SfxPoolItem* pFormatItem = nullptr; - SfxItemSet rSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), + SfxItemSet rSet( pTextNode->GetDoc()->GetAttrPool(), RES_PARATR_BEGIN, RES_PARATR_END - 1, 0); pTextNode->SwContentNode::GetAttr( rSet ); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index cf10f8805a96..bfb1b8be3b8b 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1828,7 +1828,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) ( !m_rThis.IsTabFrame() || ( m_rThis.GetUpper()->IsInTab() && m_rThis.GetUpper()->FindTabFrame()->IsFwdMoveAllowed() ) ) && - nullptr != const_cast<SwFrame&>(m_rThis).GetNextCellLeaf() ) + nullptr != m_rThis.GetNextCellLeaf() ) { bNoFwd = false; } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index e7e91f37ad7e..f25c70d3250a 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1172,7 +1172,7 @@ void SwTextNode::Update( if (!pCursor) continue; - SwIndex& rIndex = const_cast<SwIndex&>(pCursor->Start()->nContent); + SwIndex& rIndex = pCursor->Start()->nContent; if (&pCursor->Start()->nNode.GetNode() == this && rIndex.GetIndex() == rPos.GetIndex()) { // The cursor position of this other shell is exactly our insert position. diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 740f645701e9..34f94890c817 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -867,11 +867,11 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI if(pRelH ) bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pRelH, MID_FRMSIZE_REL_HEIGHT); if (pRelHRelation) - bRet &= const_cast<SwFormatFrameSize&>(aFrameSz).PutValue(*pRelHRelation, MID_FRMSIZE_REL_HEIGHT_RELATION); + bRet &= aFrameSz.PutValue(*pRelHRelation, MID_FRMSIZE_REL_HEIGHT_RELATION); if(pRelW ) bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pRelW, MID_FRMSIZE_REL_WIDTH); if (pRelWRelation) - bRet &= const_cast<SwFormatFrameSize&>(aFrameSz).PutValue(*pRelWRelation, MID_FRMSIZE_REL_WIDTH_RELATION); + bRet &= aFrameSz.PutValue(*pRelWRelation, MID_FRMSIZE_REL_WIDTH_RELATION); if(pSyncWidth) bRet &= ((SfxPoolItem&)aFrameSz).PutValue(*pSyncWidth, MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT); if(pSyncHeight) diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index dbdd6e13d971..123f4405fa40 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1994,7 +1994,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark( m_pDoc = pDoc; m_pTOXMark = & pTextAttr->GetTOXMark(); const_cast<SwTOXMark*>(m_pTOXMark)->Add(this); - const_cast<SwTOXType &>(rTOXType).Add(& m_TypeDepend); + rTOXType.Add(& m_TypeDepend); } uno::Reference< text::XTextRange > SAL_CALL diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 8ef6860d25ff..969f2e033e23 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -138,7 +138,7 @@ void SwViewShellImp::PaintLayer( const SdrLayerID _nLayerID, if (pPrintData) { // hide drawings but not form controls (form controls are handled elsewhere) - SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView()); + SdrView &rSdrView = GetPageView()->GetView(); rSdrView.setHideDraw( !pPrintData->IsPrintDraw() ); } basegfx::B2IRectangle const pageFrame( diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d7dbd1d575bf..add0ba01426b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3286,7 +3286,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t SwFrameFormat *pTableFormat = pTable->GetFrameFormat( ); const SwFormatFrameSize &rSize = pTableFormat->GetFrameSize(); int nWidthPercent = rSize.GetWidthPercent(); - uno::Reference<beans::XPropertySet> xPropertySet(SwXTextTables::GetObject(const_cast<SwTableFormat&>(*pTable->GetFrameFormat( ))),uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(SwXTextTables::GetObject(*pTable->GetFrameFormat( )),uno::UNO_QUERY); bool isWidthRelative = false; xPropertySet->getPropertyValue("IsWidthRelative") >>= isWidthRelative; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index a4f312bac620..76af28b3dc49 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3831,7 +3831,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrameFormat* pFlyFram bool RtfAttributeOutput::FlyFrameOLEMath(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode, const Size& rSize) { - uno::Reference <embed::XEmbeddedObject> xObj(const_cast<SwOLENode&>(rOLENode).GetOLEObj().GetOleRef()); + uno::Reference <embed::XEmbeddedObject> xObj(rOLENode.GetOLEObj().GetOleRef()); sal_Int64 nAspect = rOLENode.GetAspect(); svt::EmbeddedObjectRef aObjRef(xObj, nAspect); SvGlobalName aObjName(aObjRef->getClassID()); |