diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:28:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:28:35 +0200 |
commit | 0686fcdb667f1dce67185656d2d011e84638eff3 (patch) | |
tree | 2e834bb4424454a50282ab07a741b0cb89be4370 /sw | |
parent | 3fa5ac8eb9ee6c58d3733a6e2cc18f673d37565d (diff) |
loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: Icb8f62a167cc450bd156f0e3611f30c4d2a57c16
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/tblcpy.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/fields/fldlst.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/layout/movedfwdfrmsbyobjpos.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/mainwn.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/grfsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/gloslst.cxx | 2 |
17 files changed, 35 insertions, 35 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index de3193ec3092..30781fb0ddc9 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -193,7 +193,7 @@ SwPaM* SwCrsrShell::GetCrsr( bool bMakeTableCrsr ) const 0 != ( pCNd = m_pTableCrsr->GetContentNode() ) && pCNd->getLayoutFrm( GetLayout() ) && 0 != ( pCNd = m_pTableCrsr->GetContentNode(false) ) && pCNd->getLayoutFrm( GetLayout() ) ) { - SwShellTableCrsr* pTC = (SwShellTableCrsr*)m_pTableCrsr; + SwShellTableCrsr* pTC = m_pTableCrsr; GetLayout()->MakeTableCrsrs( *pTC ); } } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 99c8a56ab622..de64caf0277a 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1867,7 +1867,7 @@ bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) { SwNodeIndex aEnd( aPos.nNode, 1 ); while( aEnd.GetNode().IsEndNode() && - (const SwNode*)&aEnd.GetNode() != + &aEnd.GetNode() != pSectNd->EndOfSectionNode() ) ++aEnd; diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 8bc9e088da7f..257b73cae1ea 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -127,7 +127,7 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, for( SwFrameFormats::size_type n = 0; n < rFormats.size(); ++n ) { - pFormat = (SwFrameFormat*)rFormats[n]; + pFormat = rFormats[n]; pAnchor = &pFormat->GetAnchor(); const SwPosition* pAPos = pAnchor->GetContentAnchor(); if (pAPos && diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 011714ba931e..54822e80022b 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -182,8 +182,8 @@ bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) // calculate the range const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds(); - const SwNodePtr pSttNd = (SwNodePtr)&rPam.Start()->nNode.GetNode(); - const SwNodePtr pEndNd = (SwNodePtr)&rPam.End()->nNode.GetNode(); + const SwNodePtr pSttNd = &rPam.Start()->nNode.GetNode(); + const SwNodePtr pEndNd = &rPam.End()->nNode.GetNode(); sal_uInt16 nSttPos, nEndPos; if( !rOutlNds.Seek_Entry( pSttNd, &nSttPos ) && diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index de772cdf31bb..c74eed9b0ebd 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -758,7 +758,7 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) : // Create linear array size_t nCount = static_cast<size_t>(nRows) * nCols; pArr = new const _FndBox*[nCount]; - _FndBox** ppTmp = (_FndBox**)pArr; + _FndBox** ppTmp = const_cast<_FndBox**>(pArr); memset(ppTmp, 0, sizeof(const _FndBox*) * nCount); FillFlat( rBoxRef ); @@ -767,7 +767,7 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) : FlatFndBox::~FlatFndBox() { - _FndBox** ppTmp = (_FndBox**)pArr; + _FndBox** ppTmp = const_cast<_FndBox**>(pArr); delete [] ppTmp; if( ppItemSets ) diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index 91f5f1633b75..62ae12cb2238 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -815,7 +815,7 @@ bool SwTable::InsTable( const SwTable& rCpyTable, const SwSelBoxes& rSelBoxes, SwTableNumFormatMerge aTNFM( *pCpyDoc, *pDoc ); - SwTableBox *pSttBox = (SwTableBox*)rSelBoxes[0]; + SwTableBox *pSttBox = rSelBoxes[0]; _FndLine *pFLine, *pInsFLine = 0; _FndBox aFndBox( 0, 0 ); @@ -998,7 +998,7 @@ bool SwTable::InsTable( const SwTable& rCpyTable, const SwSelBoxes& rSelBoxes, for (size_t n = 0; n < rSelBoxes.size(); ++n) { lcl_CpyBox( rCpyTable, pTmpBx, *this, - (SwTableBox*)rSelBoxes[n], true, pUndo ); + rSelBoxes[n], true, pUndo ); } } else diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index edb67589574b..16041a22fb13 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1671,7 +1671,7 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, const SwFrameFormats& rFlyArr = *GetDoc()->GetSpzFrameFormats(); for( auto pFly : rFlyArr ) { - SwFrameFormat *const pFormat = (SwFrameFormat*)pFly; + SwFrameFormat *const pFormat = pFly; const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 83b58b4d26be..71704fc0db07 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -156,7 +156,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, if (pTextNode->IsOutline()) { - const SwNodePtr pSrch = (SwNodePtr)&rNd; + const SwNodePtr pSrch = &rNd; pOutlineNds->erase( pSrch ); } } @@ -171,7 +171,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, if (bInsOutlineIdx && rTextNd.IsOutline()) { - const SwNodePtr pSrch = (SwNodePtr)&rNd; + const SwNodePtr pSrch = &rNd; pOutlineNds->insert( pSrch ); } rTextNd.InvalidateNumRule(); @@ -349,7 +349,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, rNds.GetDoc()->getIDocumentFieldsAccess().SetFieldsDirty( true, NULL, 0 ); if( bNewFrms ) - bNewFrms = &GetDoc()->GetNodes() == (const SwNodes*)&rNds && + bNewFrms = &GetDoc()->GetNodes() == &rNds && GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); if( bNewFrms ) diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx index 13339c5753a2..449c7c63e5b7 100644 --- a/sw/source/core/fields/fldlst.cxx +++ b/sw/source/core/fields/fldlst.cxx @@ -44,7 +44,7 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, bool bBuildTmpLst ) // iterate over all types for(size_t i=0; i < nSize; ++i) { - SwFieldType* pFieldType = (SwFieldType*)rFieldTypes[ i ]; + SwFieldType* pFieldType = rFieldTypes[ i ]; const sal_uInt16 nType = pFieldType->Which(); if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType ) @@ -132,7 +132,7 @@ bool SwInputFieldList::BuildSortLst() // iterate over all types for( size_t i = 0; i < nSize; ++i ) { - SwFieldType* pFieldType = (SwFieldType*)rFieldTypes[ i ]; + SwFieldType* pFieldType = rFieldTypes[ i ]; const sal_uInt16 nType = pFieldType->Which(); if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType ) diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index a5d3e8a952ce..93f837809939 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -2099,7 +2099,7 @@ void _FndBox::SetTableLines( const SwSelBoxes &rBoxes, const SwTable &rTable ) while ( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); const sal_uInt16 nPos = rTable.GetTabLines().GetPos( - (const SwTableLine*&)pLine ) + 1; + const_cast<const SwTableLine*&>(pLine) ) + 1; OSL_ENSURE( nPos != USHRT_MAX, "TableLine not found." ); @@ -2161,7 +2161,7 @@ void _FndBox::DelFrms( SwTable &rTable, bool bAccTableDispose ) if ( pLineBefore ) { nStPos = rTable.GetTabLines().GetPos( - (const SwTableLine*&)pLineBefore ); + const_cast<const SwTableLine*&>(pLineBefore) ); OSL_ENSURE( nStPos != USHRT_MAX, "The fox stole the line!" ); ++nStPos; } @@ -2170,7 +2170,7 @@ void _FndBox::DelFrms( SwTable &rTable, bool bAccTableDispose ) if ( pLineBehind ) { nEndPos = rTable.GetTabLines().GetPos( - (const SwTableLine*&)pLineBehind ); + const_cast<const SwTableLine*&>(pLineBehind) ); OSL_ENSURE( nEndPos != USHRT_MAX, "The fox stole the line!" ); if (nEndPos != 0) --nEndPos; @@ -2320,7 +2320,7 @@ void _FndBox::MakeFrms( SwTable &rTable ) if ( pLineBefore ) { nStPos = rTable.GetTabLines().GetPos( - (const SwTableLine*&)pLineBefore ); + const_cast<const SwTableLine*&>(pLineBefore) ); OSL_ENSURE( nStPos != USHRT_MAX, "Fox stole the line!" ); ++nStPos; @@ -2328,7 +2328,7 @@ void _FndBox::MakeFrms( SwTable &rTable ) if ( pLineBehind ) { nEndPos = rTable.GetTabLines().GetPos( - (const SwTableLine*&)pLineBehind ); + const_cast<const SwTableLine*&>(pLineBehind) ); OSL_ENSURE( nEndPos != USHRT_MAX, "Fox stole the line!" ); --nEndPos; } @@ -2391,10 +2391,10 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber, // bBehind == true: before pLineBehind // == false: after pLineBefore const sal_uInt16 nBfPos = pLineBefore ? - rTable.GetTabLines().GetPos( (const SwTableLine*&)pLineBefore ) : + rTable.GetTabLines().GetPos( const_cast<const SwTableLine*&>(pLineBefore) ) : USHRT_MAX; const sal_uInt16 nBhPos = pLineBehind ? - rTable.GetTabLines().GetPos( (const SwTableLine*&)pLineBehind ) : + rTable.GetTabLines().GetPos( const_cast<const SwTableLine*&>(pLineBehind) ) : USHRT_MAX; //nNumber: how often did we insert @@ -2534,7 +2534,7 @@ bool _FndBox::AreLinesToRestore( const SwTable &rTable ) const sal_uInt16 nBfPos; if(pLineBefore) { - const SwTableLine* rLBefore = (const SwTableLine*)pLineBefore; + const SwTableLine* rLBefore = const_cast<const SwTableLine*>(pLineBefore); nBfPos = rTable.GetTabLines().GetPos( rLBefore ); } else @@ -2543,7 +2543,7 @@ bool _FndBox::AreLinesToRestore( const SwTable &rTable ) const sal_uInt16 nBhPos; if(pLineBehind) { - const SwTableLine* rLBehind = (const SwTableLine*)pLineBehind; + const SwTableLine* rLBehind = const_cast<const SwTableLine*>(pLineBehind); nBhPos = rTable.GetTabLines().GetPos( rLBehind ); } else diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx index 233c37906f64..a7c2bf8042c3 100644 --- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx +++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx @@ -75,7 +75,7 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm if ( rEntry.second >= nPageNumOfRow ) { SwIterator<SwTextFrm,SwTextNode> aFrmIter( *rEntry.first ); - for( SwTextFrm* pTextFrm = aFrmIter.First(); pTextFrm; pTextFrm = (SwTextFrm*)aFrmIter.Next() ) + for( SwTextFrm* pTextFrm = aFrmIter.First(); pTextFrm; pTextFrm = aFrmIter.Next() ) { // #115759# - assure that found text frame // is the first one. diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 94068d448aca..002af6921abb 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -124,7 +124,7 @@ namespace SwContourCache::SwContourCache() : nPntCnt( 0 ), nObjCnt( 0 ) { - memset( (SdrObject**)pSdrObj, 0, sizeof(pSdrObj) ); + memset( pSdrObj, 0, sizeof(pSdrObj) ); memset( pTextRanger, 0, sizeof(pTextRanger) ); } @@ -140,7 +140,7 @@ void SwContourCache::ClrObject( sal_uInt16 nPos ) nPntCnt -= pTextRanger[ nPos ]->GetPointCount(); delete pTextRanger[ nPos ]; --nObjCnt; - memmove( (SdrObject**)pSdrObj + nPos, pSdrObj + nPos + 1, + memmove( const_cast<SdrObject**>(pSdrObj) + nPos, pSdrObj + nPos + 1, ( nObjCnt - nPos ) * sizeof( SdrObject* ) ); memmove( pTextRanger + nPos, pTextRanger + nPos + 1, ( nObjCnt - nPos ) * sizeof( TextRanger* ) ); @@ -245,7 +245,7 @@ const SwRect SwContourCache::ContourRect( const SwFormat* pFormat, const SvxLRSpaceItem &rLRSpace = pFormat->GetLRSpace(); const SvxULSpaceItem &rULSpace = pFormat->GetULSpace(); memmove( pTextRanger + 1, pTextRanger, nObjCnt * sizeof( TextRanger* ) ); - memmove( (SdrObject**)pSdrObj + 1, pSdrObj, nObjCnt++ * sizeof( SdrObject* ) ); + memmove( const_cast<SdrObject**>(pSdrObj) + 1, pSdrObj, nObjCnt++ * sizeof( SdrObject* ) ); pSdrObj[ 0 ] = pObj; // due to #37347 the Object must be entered only // after GetContour() pTextRanger[ 0 ] = new TextRanger( aPolyPolygon, pPolyPolygon, 20, @@ -267,7 +267,7 @@ const SwRect SwContourCache::ContourRect( const SwFormat* pFormat, { const SdrObject* pTmpObj = pSdrObj[ nPos ]; TextRanger* pTmpRanger = pTextRanger[ nPos ]; - memmove( (SdrObject**)pSdrObj + 1, pSdrObj, nPos * sizeof( SdrObject* ) ); + memmove( const_cast<SdrObject**>(pSdrObj) + 1, pSdrObj, nPos * sizeof( SdrObject* ) ); memmove( pTextRanger + 1, pTextRanger, nPos * sizeof( TextRanger* ) ); pSdrObj[ 0 ] = pTmpObj; pTextRanger[ 0 ] = pTmpRanger; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 45f84e20a55f..a9061abc5aff 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3171,7 +3171,7 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox) eShadowLocation = static_cast<const SvxShadowItem*>(pItem)->GetLocation(); const SvxBoxItemLine* pBrd = aBorders; - const sal_Char** pBrdNms = (const sal_Char**)aBorderNames; + const sal_Char** pBrdNms = aBorderNames; for (int i = 0; i < 4; ++i, ++pBrd, ++pBrdNms) { if (const editeng::SvxBorderLine* pLn = rBox.GetLine(*pBrd)) diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 6ffaf31f9b9a..68efc1c171f8 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -860,7 +860,7 @@ void WW8Export::Out_NumRuleAnld( const SwNumRule& rRul, const SwNumFormat& rForm memcpy( aSprmAnld, aSprmAnldDefault, sizeof( aSprmAnld ) ); WW8_ANLD* pA = reinterpret_cast<WW8_ANLD*>(aSprmAnld + 2); // handy pointer - sal_uInt8* pChars = (sal_uInt8*)(pA->rgchAnld); + sal_uInt8* pChars = pA->rgchAnld; sal_uInt16 nCharLen = 31; if( nSwLevel == 11 ) diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx index 707f368831ca..8413077f398c 100644 --- a/sw/source/uibase/app/mainwn.cxx +++ b/sw/source/uibase/app/mainwn.cxx @@ -95,7 +95,7 @@ void EndProgress( SwDocShell *pDocShell ) sal_uInt16 i; for ( i = 0; i < pProgressContainer->size(); ++i ) { - SwProgress *pTmp = (SwProgress*)(*pProgressContainer)[i]; + SwProgress *pTmp = (*pProgressContainer)[i]; if ( pTmp->pDocShell == pDocShell ) { pProgress = pTmp; diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index cfeca301b6bf..b85527709620 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -176,7 +176,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aCrop.SetBottom( convertMm100ToTwip( aScaledCropedRectangle.Bottom() )); Graphic aCompressedGraphic( aDialog->GetCompressedGraphic() ); - rSh.ReRead(OUString(), OUString(), (const Graphic*) &aCompressedGraphic); + rSh.ReRead(OUString(), OUString(), const_cast<const Graphic*>(&aCompressedGraphic)); rSh.SetAttrItem(aCrop); @@ -856,7 +856,7 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) Graphic aGraphic = *rShell.GetGraphic(); GraphicNativeTransform aTransform(aGraphic); aTransform.rotate(aRotation); - rShell.ReRead(OUString(), OUString(), (const Graphic*) &aGraphic); + rShell.ReRead(OUString(), OUString(), const_cast<const Graphic*>(&aGraphic)); SwFlyFrmAttrMgr aManager(false, &rShell, rShell.IsFrmSelected() ? FRMMGR_TYPE_NONE : FRMMGR_TYPE_GRF); const long nRotatedWidth = aManager.GetSize().Height(); diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 48a0d51d82fe..4d3f12cf7598 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -300,7 +300,7 @@ void SwGlossaryList::Update() for( size_t nFiles = 0; nFiles < aFiles.size(); ++nFiles ) { const OUString aTitle = aFiles[ nFiles ]; - ::DateTime* pDT = (::DateTime*) aDateTimeArr[ nFiles ]; + ::DateTime* pDT = aDateTimeArr[ nFiles ]; OUString sName( aTitle.copy( 0, aTitle.getLength() - sExt.getLength() )); |