[Libreoffice-commits] .: 3 commits - compilerplugins/clang compilerplugins/Makefile-clang.mk sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 15 14:33:57 PDT 2012
compilerplugins/Makefile-clang.mk | 1
compilerplugins/clang/lclstaticfix.cxx | 9 -
compilerplugins/clang/lclstaticfix.hxx | 4
compilerplugins/clang/plugin.cxx | 91 +++++++++++++
compilerplugins/clang/plugin.hxx | 18 ++
compilerplugins/clang/postfixincrementfix.cxx | 165 ++++++++++++++++++++++++
compilerplugins/clang/postfixincrementfix.hxx | 40 +++++
sw/source/core/crsr/crstrvl.cxx | 2
sw/source/core/crsr/pam.cxx | 2
sw/source/core/crsr/swcrsr.cxx | 6
sw/source/core/crsr/trvlreg.cxx | 4
sw/source/core/crsr/trvltbl.cxx | 2
sw/source/core/doc/docbm.cxx | 6
sw/source/core/doc/docchart.cxx | 6
sw/source/core/doc/doccomp.cxx | 8 -
sw/source/core/doc/docdde.cxx | 2
sw/source/core/doc/docedt.cxx | 30 ++--
sw/source/core/doc/docfmt.cxx | 8 -
sw/source/core/doc/docnew.cxx | 2
sw/source/core/doc/docnum.cxx | 14 +-
sw/source/core/doc/docsort.cxx | 2
sw/source/core/doc/tblcpy.cxx | 2
sw/source/core/doc/tblrwcl.cxx | 2
sw/source/core/docnode/ndcopy.cxx | 12 -
sw/source/core/docnode/ndsect.cxx | 16 +-
sw/source/core/docnode/ndtbl.cxx | 2
sw/source/core/docnode/node.cxx | 6
sw/source/core/docnode/node2lay.cxx | 2
sw/source/core/docnode/nodes.cxx | 26 +--
sw/source/core/docnode/section.cxx | 4
sw/source/core/edit/acorrect.cxx | 2
sw/source/core/edit/edattr.cxx | 2
sw/source/core/edit/edglss.cxx | 2
sw/source/core/edit/editsh.cxx | 2
sw/source/core/edit/edsect.cxx | 6
sw/source/core/frmedt/fecopy.cxx | 4
sw/source/core/frmedt/tblsel.cxx | 2
sw/source/core/layout/atrfrm.cxx | 2
sw/source/core/text/EnhancedPDFExportHelper.cxx | 2
sw/source/core/text/txtfrm.cxx | 2
sw/source/core/txtnode/atrftn.cxx | 2
sw/source/core/txtnode/ndtxt.cxx | 8 -
sw/source/core/undo/unmove.cxx | 2
sw/source/core/undo/unovwr.cxx | 2
sw/source/core/undo/untbl.cxx | 6
sw/source/core/undo/untblk.cxx | 2
sw/source/core/unocore/unochart.cxx | 4
sw/source/core/unocore/unocrsrhelper.cxx | 2
sw/source/core/unocore/unotbl.cxx | 2
sw/source/core/unocore/unotext.cxx | 2
sw/source/core/view/viewsh.cxx | 2
sw/source/core/view/vnew.cxx | 2
sw/source/filter/basflt/fltini.cxx | 2
sw/source/filter/html/htmlgrin.cxx | 4
sw/source/filter/rtf/rtftbl.cxx | 2
sw/source/filter/ww1/fltshell.cxx | 6
sw/source/filter/ww1/w1class.cxx | 10 -
sw/source/filter/ww1/w1class.hxx | 16 +-
sw/source/filter/ww1/w1filter.cxx | 30 ++--
sw/source/filter/ww8/WW8TableInfo.cxx | 2
sw/source/filter/ww8/wrtw8sty.cxx | 4
sw/source/filter/ww8/ww8glsy.cxx | 6
sw/source/filter/ww8/ww8par6.cxx | 4
sw/source/ui/dialog/uiregionsw.cxx | 2
sw/source/ui/dochdl/swdtflvr.cxx | 2
sw/source/ui/docvw/PostItMgr.cxx | 36 ++---
sw/source/ui/fldui/fldref.cxx | 2
sw/source/ui/misc/bookmark.cxx | 2
sw/source/ui/utlui/bookctrl.cxx | 2
sw/source/ui/utlui/content.cxx | 2
sw/source/ui/utlui/navipi.cxx | 2
71 files changed, 500 insertions(+), 192 deletions(-)
New commits:
commit f2655f92c193ce37aa76f2dd285d260d214f7d8c
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Oct 15 23:31:02 2012 +0200
postfix operator++ -> prefix operator++
Change-Id: I51506a83009db838d8e12d5559c46b404e59f9b5
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 2e44aea..94a2924 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1743,7 +1743,7 @@ sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
while( aEnd.GetNode().IsEndNode() &&
(const SwNode*)&aEnd.GetNode() !=
pSectNd->EndOfSectionNode() )
- aEnd++;
+ ++aEnd;
if( aEnd.GetNode().IsEndNode() &&
pCNd->Len() == aPos.nContent.GetIndex() )
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 1ef6f04..0a21e66 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1049,7 +1049,7 @@ String SwPaM::GetTxt() const
{
if (! bFirst)
{
- aNodeIndex++;
+ ++aNodeIndex;
}
bFirst = false;
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 434bf34..68c79cf 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -560,7 +560,7 @@ GoNextCell:
do {
if( !IDX.GetNode().IsStartNode() )
break;
- IDX++;
+ ++IDX;
if( 0 == ( pCNd = IDX.GetNode().GetCntntNode() ))
pCNd = IDX.GetNodes().GoNext( &IDX );
if( 0 == ( bProt = pCNd->IsProtect() ))
@@ -585,7 +585,7 @@ SetNextCrsr:
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
// end of table, so go to next node
- IDX++;
+ ++IDX;
SwNode* pNd;
if( ( pNd = &IDX.GetNode())->IsEndNode() || HasMark())
{
@@ -1955,7 +1955,7 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt )
}
}
- rPtIdx++;
+ ++rPtIdx;
if( !rPtIdx.GetNode().IsCntntNode() )
GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_True, sal_False );
GetPoint()->nContent.Assign( GetCntntNode(), 0 );
diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx
index bfef7e0..4c41be9 100644
--- a/sw/source/core/crsr/trvlreg.cxx
+++ b/sw/source/core/crsr/trvlreg.cxx
@@ -96,7 +96,7 @@ sal_Bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
do {
while( aIdx.GetIndex() < nEndCount &&
0 == ( pNd = aIdx.GetNode().GetSectionNode()) )
- aIdx++;
+ ++aIdx;
if( pNd ) // is there another section node?
{
@@ -126,7 +126,7 @@ sal_Bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion,
sal_True, !bInReadOnly );
if( !pCNd )
{
- aIdx++;
+ ++aIdx;
continue;
}
rCurCrsr.GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 07fc9a4..8260d2f 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -571,7 +571,7 @@ sal_Bool GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
do {
while( aIdx.GetIndex() < nLastNd &&
0 == ( pTblNd = aIdx.GetNode().GetTableNode()) )
- aIdx++;
+ ++aIdx;
if( pTblNd ) // any further table node?
{
if( fnPosTbl == fnMoveForward ) // at the beginning?
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 64b171f..dec25f4 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -485,7 +485,7 @@ namespace sw { namespace mark
bool isSortingNeeded = false;
for(iterator_t ppMark = m_vMarks.begin();
ppMark != m_vMarks.end();
- ppMark++)
+ ++ppMark)
{
// is on position ??
bool bChangedPos = false, bChangedOPos = false;
@@ -521,7 +521,7 @@ namespace sw { namespace mark
bool isSortingNeeded = false;
for(iterator_t ppMark = m_vMarks.begin();
ppMark != m_vMarks.end();
- ppMark++)
+ ++ppMark)
{
// is on position ??
bool bChangedPos = false, bChangedOPos = false;
@@ -566,7 +566,7 @@ namespace sw { namespace mark
// reassignment is performed after the move
for(iterator_t ppMark = m_vMarks.begin();
ppMark != m_vMarks.end();
- ppMark++)
+ ++ppMark)
{
// navigator marks should not be moved
// TODO: Check if this might make them invalid
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index ae23079..c64270a 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -132,7 +132,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const
SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
aName.Equals( pONd->GetChartTblName() ) &&
pONd->getLayoutFrm( rVSh.GetLayout() ) )
@@ -189,7 +189,7 @@ void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const String &rNewName )
SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
SwOLENode *pNd = aIdx.GetNode().GetOLENode();
if( pNd && aOldName == pNd->GetChartTblName() )
{
@@ -236,7 +236,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable )
SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while (0 != (pStNd = aIdx.GetNode().GetStartNode()))
{
- aIdx++;
+ ++aIdx;
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
aName.Equals( pONd->GetChartTblName() ) /* OLE node is chart? */ &&
0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ )
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 02db609..56ba45e 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1030,7 +1030,7 @@ sal_uLong SwCompareLine::GetHashValue() const
{
if( aIdx.GetNode().IsTxtNode() )
nRet = GetTxtNodeHashValue( (SwTxtNode&)aIdx.GetNode(), nRet );
- aIdx++;
+ ++aIdx;
}
}
break;
@@ -1094,7 +1094,7 @@ namespace
}
sRet.Append( aIdx.GetNode().GetTxtNode()->GetExpandTxt() );
}
- aIdx++;
+ ++aIdx;
}
return sRet;
}
@@ -1566,7 +1566,7 @@ void SwCompareData::ShowDelete( const CompareData& rData, sal_uLong nStt,
((SwCompareData&)rData).rDoc.CopyWithFlyInFly( aRg, 0, aInsPos );
rDoc.SetModified();
- aSavePos++;
+ ++aSavePos;
// #i65201#: These SwPaMs are calculated when the (old) delete-redlines are hidden,
// they will be inserted when the delete-redlines are shown again.
@@ -1905,7 +1905,7 @@ sal_uInt16 _SaveMergeRedlines::InsertRedline()
pDoc->SetRedlineMode_intern( eOld );
pDestRedl->SetMark();
- aSaveNd++;
+ ++aSaveNd;
pDestRedl->GetMark()->nNode = aSaveNd;
pDestRedl->GetMark()->nContent.Assign( aSaveNd.GetNode().GetCntntNode(),
nSaveCnt );
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index 7023c8d..1a70772 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -58,7 +58,7 @@ namespace
const ::rtl::OUString sNameLc = bCaseSensitive ? rName : GetAppCharClass().lowercase(rName);
for(IDocumentMarkAccess::const_iterator_t ppMark = rMarkAccess.getMarksBegin();
ppMark != rMarkAccess.getMarksEnd();
- ppMark++)
+ ++ppMark)
{
if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get()))
{
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index ad53369..89398e4 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -178,7 +178,7 @@ static void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, xub_StrLen &rSt
{
// skip all special attributes
do {
- rIdx++;
+ ++rIdx;
} while( (rStart = rIdx.GetIndex()) < pNode->GetTxt().Len()
&& !lcl_MayOverwrite(pNode, rStart) );
}
@@ -688,7 +688,7 @@ _SaveRedlEndPosForRestore::~_SaveRedlEndPosForRestore()
void _SaveRedlEndPosForRestore::_Restore()
{
- (*pSavIdx)++;
+ ++(*pSavIdx);
SwCntntNode* pNode = pSavIdx->GetNode().GetCntntNode();
// If there's no content node at the remembered position, we will not restore the old position
// This may happen if a table (or section?) will be inserted.
@@ -796,13 +796,13 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
{
// start behind the characters (to fix the attributes!)
if( nStart < pNode->GetTxt().Len() )
- rIdx++;
+ ++rIdx;
pNode->InsertText( rtl::OUString(c), rIdx, INS_EMPTYEXPAND );
if( nStart+1 < rIdx.GetIndex() )
{
rIdx = nStart;
pNode->EraseText( rIdx, 1 );
- rIdx++;
+ ++rIdx;
}
}
}
@@ -845,7 +845,7 @@ bool SwDoc::MoveAndJoin( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
if( bRet && !bOneNode )
{
if( bJoinTxt )
- aIdx++;
+ ++aIdx;
SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode();
SwNodeIndex aNxtIdx( aIdx );
if( pTxtNd && pTxtNd->CanJoinNext( &aNxtIdx ) )
@@ -1170,9 +1170,9 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
sal_Bool bNoDelFrms = 0 != (DOC_NO_DELFRMS & eMvFlags);
if( GetNodes()._MoveNodes( rRange, GetNodes(), rPos, !bNoDelFrms ) )
{
- aIdx++; // again back to old position
+ ++aIdx; // again back to old position
if( pSaveInsPos )
- (*pSaveInsPos)++;
+ ++(*pSaveInsPos);
}
else
{
@@ -1733,7 +1733,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
if( bOneNd ) // that's it
break;
- aSttIdx++;
+ ++aSttIdx;
}
else
{
@@ -2356,7 +2356,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
SplitNode( *aDelPam.GetPoint(), false );
- aMkNd++;
+ ++aMkNd;
aDelPam.GetMark()->nNode = aMkNd;
aDelPam.GetMark()->nContent.Assign(
aMkNd.GetNode().GetCntntNode(), nMkCnt );
@@ -2373,7 +2373,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr,
SwPaM aTmpRange( *aDelPam.GetPoint() );
aTmpRange.SetMark();
- aPtNd++;
+ ++aPtNd;
aDelPam.GetPoint()->nNode = aPtNd;
aDelPam.GetPoint()->nContent.Assign( aPtNd.GetNode().GetCntntNode(),
nPtCnt);
@@ -2471,7 +2471,7 @@ SetRedlineMode( eOld );
*rPam.GetMark() = *aDelPam.GetMark();
- aPtNd++;
+ ++aPtNd;
rPam.GetMark()->nNode = aPtNd;
rPam.GetMark()->nContent.Assign( aPtNd.GetNode().GetCntntNode(),
nPtCnt );
@@ -2683,12 +2683,12 @@ void SwDoc::TransliterateText(
SwNodeIndex aIdx( pStt->nNode );
if( nSttCnt )
{
- aIdx++;
+ ++aIdx;
if( pTNd )
pTNd->TransliterateText( rTrans, nSttCnt, pTNd->GetTxt().Len(), pUndo );
}
- for( ; aIdx.GetIndex() < nEndNd; aIdx++ )
+ for( ; aIdx.GetIndex() < nEndNd; ++aIdx )
{
if( 0 != ( pTNd = aIdx.GetNode().GetTxtNode() ))
pTNd->TransliterateText( rTrans, 0, pTNd->GetTxt().Len(), pUndo );
@@ -2759,12 +2759,12 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const
SwNodeIndex aIdx( pStt->nNode );
if( nSttCnt )
{
- aIdx++;
+ ++aIdx;
if( pTNd )
pTNd->CountWords( rStat, nSttCnt, pTNd->GetTxt().Len() );
}
- for( ; aIdx.GetIndex() < nEndNd; aIdx++ )
+ for( ; aIdx.GetIndex() < nEndNd; ++aIdx )
if( 0 != ( pTNd = aIdx.GetNode().GetTxtNode() ))
pTNd->CountWords( rStat, 0, pTNd->GetTxt().Len() );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 833ece4..1ace419 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -453,7 +453,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
}
}
- aTmpStt++;
+ ++aTmpStt;
}
if( pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetCntntNode()->Len() )
// set up a later, and all CharFmtAttr -> TxtFmtAttr
@@ -487,7 +487,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
if( bTxtAttr )
{
if( bAdd )
- aTmpEnd++;
+ ++aTmpEnd;
GetNodes().ForEach( pStt->nNode, aTmpEnd, lcl_RstTxtAttr, &aPara );
}
@@ -975,7 +975,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet,
SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_CHARFMT, sal_False ) ||
SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_INETFMT, sal_False ) );
- for(; aSt < aEnd; aSt++ )
+ for(; aSt < aEnd; ++aSt )
{
pNode = aSt.GetNode().GetCntntNode();
if( !pNode )
@@ -2275,7 +2275,7 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight, sal_Bool bModulu
SwRegHistory aRegH( pTNd, *pTNd, pHistory );
pTNd->SetAttr( aLS );
}
- aIdx++;
+ ++aIdx;
}
SetModified();
}
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index e036737..00da7bd 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1226,7 +1226,7 @@ void SwDoc::Paste( const SwDoc& rSource )
rSource.CopyRange( aCpyPam, rInsPos, true );
{
- aIndexBefore++;
+ ++aIndexBefore;
SwPaM aPaM(SwPosition(aIndexBefore),
SwPosition(rInsPos.nNode));
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index ecabe39..4e0d3c1 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -482,7 +482,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( aEndRg == aSttRg )
{
OSL_FAIL( "Moving outlines: Surprising selection" );
- aEndRg++;
+ ++aEndRg;
}
const SwNode* pNd;
@@ -499,7 +499,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
break;
aSttRg--;
}
- aSttRg++;
+ ++aSttRg;
aEndRg--;
while( aEndRg.GetNode().IsStartNode() )
@@ -511,7 +511,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
break;
aEndRg--;
}
- aEndRg++;
+ ++aEndRg;
// calculation of the new position
if( nOffset < 0 && nAktPos < sal_uInt16(-nOffset) )
@@ -556,7 +556,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
}
}
// We do not want to move into tables (at the moment)
- aInsertPos++;
+ ++aInsertPos;
pNd = &aInsertPos.GetNode();
if( pNd->IsTableNode() )
pNd = pNd->StartOfSectionNode();
@@ -1507,7 +1507,7 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext,
break;
if( bNext )
- aIdx++;
+ ++aIdx;
else
aIdx--;
}
@@ -1567,7 +1567,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
if ( !bInvestigateStartNode )
{
if (bForward)
- aIdx++;
+ ++aIdx;
else
aIdx--;
}
@@ -1605,7 +1605,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos,
if ( bInvestigateStartNode )
{
if (bForward)
- aIdx++;
+ ++aIdx;
else
aIdx--;
}
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index eb3e876..79a3aaa 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -409,7 +409,7 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt)
// Iterate over a selected range
SwSortTxtElement* pSE = new SwSortTxtElement( aStart );
aSortSet.insert(pSE);
- aStart++;
+ ++aStart;
}
// Now comes the tricky part: Move Nodes (and always keep Undo in mind)
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 4fd021b..88228b2 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -548,7 +548,7 @@ static void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
pCpyDoc->CopyWithFlyInFly( *pRg, 0, aInsIdx, sal_False );
else
pDoc->GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
- aSavePos++;
+ ++aSavePos;
SwTableLine* pLine = pDstBox->GetUpper();
while( pLine->GetUpper() )
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index d4c54b4..6e065ae 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2259,7 +2259,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
SwNodeIndex aIdx( rPos.nNode, -1 );
SwTableNode* pTblNd = aIdx.GetNode().FindTableNode();
- aIdx++;
+ ++aIdx;
OSL_ENSURE( pTblNd, "Where is the TableNode now?" );
pTblNd->GetTable().SetRowsToRepeat( GetRowsToRepeat() );
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 20fe09f..a2b015f 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -88,7 +88,7 @@ namespace
if( ( rNode.IsSectionNode() && rNode.EndOfSectionIndex() >= nEnd )
|| ( rNode.IsEndNode() && rNode.StartOfSectionNode()->GetIndex() < nStart ) )
++rDelCount;
- rLastIdx++;
+ ++rLastIdx;
}
while( rLastIdx.GetIndex() < nNewIdx );
}
@@ -146,7 +146,7 @@ namespace
mark_vector_t vMarksToCopy;
for(IDocumentMarkAccess::const_iterator_t ppMark = pSrcMarkAccess->getMarksBegin();
ppMark != pSrcMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
{
const ::sw::mark::IMark* const pMark = ppMark->get();
const SwPosition& rMarkStart = pMark->GetMarkStart();
@@ -836,7 +836,7 @@ static bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam )
do
{
- aIdx++;
+ ++aIdx;
pTxtNd = aIdx.GetNode().GetTxtNode();
if ( !pTxtNd || !pTxtNd->IsInList() )
@@ -1090,7 +1090,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// If we didn't split a textnode, the PaM should start at the inserted table node
if( rPos.nContent.GetIndex() == pDestTxtNd->Len() )
{ // Insertion at the last position of a textnode (empty or not)
- aInsPos++; // The table will be inserted behind the text node
+ ++aInsPos; // The table will be inserted behind the text node
}
else if( rPos.nContent.GetIndex() )
{ // Insertion in the middle of a text node, it has to be split
@@ -1232,7 +1232,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
{
SwNodeIndex aSaveIdx( aInsPos, -1 );
CopyWithFlyInFly( aRg, 0,aInsPos, bMakeNewFrms, sal_False );
- aSaveIdx++;
+ ++aSaveIdx;
pEnd->nNode = aSaveIdx;
pEnd->nContent.Assign( aSaveIdx.GetNode().GetTxtNode(), 0 );
}
@@ -1324,7 +1324,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte
SwNodeIndex aSavePos( rInsPos, -1 );
sal_Bool bEndIsEqualEndPos = rInsPos == rRg.aEnd;
GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, sal_True );
- aSavePos++;
+ ++aSavePos;
if( bEndIsEqualEndPos )
((SwNodeIndex&)rRg.aEnd) = aSavePos;
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 27c1b7f..e99ee7c 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -218,7 +218,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
while( pPrvNd != aStt.GetNode().StartOfSectionNode() )
aStt--;
while( pPrvNd != aEnd.GetNode().StartOfSectionNode() )
- aEnd++;
+ ++aEnd;
--aEnd; // im InsertSection ist Ende inclusive
pNewSectNode = GetNodes().InsertTextSection(
@@ -436,7 +436,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
!( pNxtNd->StartOfSectionIndex() < nCmp &&
nCmp < aIdx.GetIndex() ) )
{
- aIdx++;
+ ++aIdx;
}
if( !pNxtNd )
pNxtNd = pNd->EndOfSectionNode();
@@ -462,7 +462,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
0 != aIdx.GetNode().FindSectionNode() )
{
do {
- aIdx++;
+ ++aIdx;
} while( aIdx.GetNode().IsEndNode() &&
0 != aIdx.GetNode().FindSectionNode() );
{
@@ -494,7 +494,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
nRet = 1;
if( ppSttNd )
{
- aIdx++;
+ ++aIdx;
*ppSttNd = &aIdx.GetNode();
}
}
@@ -826,20 +826,20 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
do {
aInsPos--;
} while( aInsPos.GetNode().IsSectionNode() );
- aInsPos++;
+ ++aInsPos;
}
}
else
{
SwNode* pNd;
- aInsPos++;
+ ++aInsPos;
if (!lcl_IsTOXSection(rSectionData))
{
while( aInsPos.GetIndex() < Count() - 1 &&
( pNd = &aInsPos.GetNode())->IsEndNode() &&
pNd->StartOfSectionNode()->IsSectionNode())
{
- aInsPos++;
+ ++aInsPos;
}
}
}
@@ -1353,7 +1353,7 @@ sal_Bool SwSectionNode::IsCntntHidden() const
return sal_False; // Nicht versteckter Inhalt wurde gefunden
OSL_ENSURE( aTmp.GetNode().IsEndNode(), "EndNode expected" );
}
- aTmp++;
+ ++aTmp;
}
return sal_True; // Alles versteckt
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 228aa68..570b039 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2004,7 +2004,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
// kein Fly ?? also Kopf- oder Fusszeile: dann immer einen
// TextNode ueberig lassen.
- aIdx++;
+ ++aIdx;
if (GetIDocumentUndoRedo().DoesUndo())
{
GetIDocumentUndoRedo().ClearRedo();
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 7c80a5f..46b0f63 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1180,7 +1180,7 @@ sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const
if( pIdx->GetIndex() < Len() )
{
if( !IsTxtNode() )
- (*pIdx)++;
+ ++(*pIdx);
else
{
const SwTxtNode& rTNd = *GetTxtNode();
@@ -1211,7 +1211,7 @@ sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const
bRet = sal_False;
}
else if( nPos < rTNd.GetTxt().Len() )
- (*pIdx)++;
+ ++(*pIdx);
else
bRet = sal_False;
}
@@ -1696,7 +1696,7 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const
while( aIdx < rNds.Count()-1 &&
(( pNd = &aIdx.GetNode())->IsSectionNode() ||
( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode() )))
- aIdx++;
+ ++aIdx;
if( pNd->GetNodeType() != nNdType || rNds.Count()-1 == aIdx.GetIndex() )
return sal_False;
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index b5ff192..5af266b 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -98,7 +98,7 @@ SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx)
}
if ( bFound )
break;
- aTmp++;
+ ++aTmp;
}
if( aTmp == rNodes.Count()-1 )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 400fe2d..f65f02a 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -124,7 +124,7 @@ SwNodes::~SwNodes()
if( pNode == pEndOfContent )
break;
- aNdIdx++;
+ ++aNdIdx;
delete pNode;
}
}
@@ -404,7 +404,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
((SwCntntNode*)pFrmNd)->MakeFrms( *pCNd );
pFrmNd = pCNd;
}
- aIdx++;
+ ++aIdx;
}
}
}
@@ -758,7 +758,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
SwNodeIndex aTmpEIdx( aOrigInsPos.aEnd );
new SwEndNode( aTmpEIdx, *pTmpStt );
aTmpEIdx--;
- aTmpSIdx++;
+ ++aTmpSIdx;
// setze die StartOfSection richtig
aRg.aEnd++;
@@ -1054,7 +1054,7 @@ void SwNodes::SectionUp(SwNodeRange *pRange)
if( pAktNode->IsStartNode() )
aTmpIdx = pAktNode->EndOfSectionIndex() + 1;
else
- aTmpIdx++;
+ ++aTmpIdx;
}
return ;
}
@@ -1108,7 +1108,7 @@ void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEn
// durchlaufe bis der erste zu aendernde Start-Node gefunden wurde
// ( Es wird vom eingefuegten EndNode bis nach vorne die Indexe gesetzt )
- for( ;; aTmpIdx++ )
+ for( ;; ++aTmpIdx )
{
pAktNode = &aTmpIdx.GetNode();
pAktNode->pStartOfSection = aSttNdStack[ aSttNdStack.size()-1 ];
@@ -1406,7 +1406,7 @@ SwCntntNode* SwNodes::GoNext(SwNodeIndex *pIdx) const
SwNodeIndex aTmp(*pIdx, +1);
SwNode* pNd = 0;
while( aTmp < Count()-1 && 0 == ( pNd = &aTmp.GetNode())->IsCntntNode() )
- aTmp++;
+ ++aTmp;
if( aTmp == Count()-1 )
pNd = 0;
@@ -1708,7 +1708,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
return;
}
- aSttIdx++;
+ ++aSttIdx;
}
else if( pDestNd )
{
@@ -1790,7 +1790,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
{
if ( pSrcNd && aEndIdx.GetNode().IsCntntNode() )
{
- aEndIdx++;
+ ++aEndIdx;
}
if( !bSplitDestNd )
{
@@ -2014,7 +2014,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
if( nLevel ) // vollstaendige Section
{
--nLevel;
- aInsPos++; // EndNode schon vorhanden
+ ++aInsPos; // EndNode schon vorhanden
}
else if( !pAktNode->pStartOfSection->IsSectionNode() )
{
@@ -2045,7 +2045,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
SwNode *const pTmpNd = & aInsPos.GetNode();
if( pTmpNd->IsSectionNode() ||
pTmpNd->StartOfSectionNode()->IsSectionNode() )
- aInsPos++; // ueberspringen
+ ++aInsPos; // ueberspringen
}
else {
OSL_FAIL( "wie kommt diser Node ins Nodes-Array??" );
@@ -2067,7 +2067,7 @@ void SwNodes::_DelDummyNodes( const SwNodeRange& rRg )
if( ND_SECTIONDUMMY == aIdx.GetNode().GetNodeType() )
RemoveNode( aIdx.GetIndex(), 1, sal_True );
else
- aIdx++;
+ ++aIdx;
}
}
@@ -2140,7 +2140,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx,
return (SwCntntNode*)pNd;
}
}
- aTmp++;
+ ++aTmp;
bFirst = sal_False;
}
return 0;
@@ -2319,7 +2319,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx,
if( rSect.IsHiddenFlag() )
aIdx = aIdx.GetNode().EndOfSectionIndex()+1;
else
- aIdx++;
+ ++aIdx;
}
if( aIdx.GetNode().IsTableNode() )
{
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index c21e4c5..460ca0e 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1359,7 +1359,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh,
aIdx--;
DelFlyInRange( aIdx, aEndIdx );
_DelBookmarks(aIdx, aEndIdx);
- aIdx++;
+ ++aIdx;
pDoc->GetNodes().Delete( aIdx, aEndIdx.GetIndex() - aIdx.GetIndex() );
}
@@ -1485,7 +1485,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh,
SwTblNumFmtMerge aTNFM( *pSrcDoc, *pDoc );
pSrcDoc->CopyWithFlyInFly( *pCpyRg, 0, rInsPos, bCreateFrm );
- aSave++;
+ ++aSave;
if( !bCreateFrm )
::MakeFrms( pDoc, aSave, rInsPos );
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 62547c5..1d1916d 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -397,7 +397,7 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPo
if( ppPara )
{
- (*pIdx)++;
+ ++(*pIdx);
pTxtNd = pIdx->GetNode().GetTxtNode();
}
bRet = sal_True;
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 71f7127..d60925d 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -583,7 +583,7 @@ sal_uInt16 SwEditShell::GetScriptType() const
{
sal_uLong nEndIdx = pEnd->nNode.GetIndex();
SwNodeIndex aIdx( pStt->nNode );
- for( ; aIdx.GetIndex() <= nEndIdx; aIdx++ )
+ for( ; aIdx.GetIndex() <= nEndIdx; ++aIdx )
if( aIdx.GetNode().IsTxtNode() )
{
const SwTxtNode* pTNd = aIdx.GetNode().GetTxtNode();
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 50f479f..3f66b05 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -266,7 +266,7 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
// die gemerkte Node-Position wieder auf den richtigen Node
if( bRet && pSttNd )
- (*pSttNd)++;
+ ++(*pSttNd);
return bRet;
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 3ef955c..291727e 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -440,7 +440,7 @@ sal_Bool SwEditShell::HasOLEObj( const String &rName ) const
SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
SwNode& rNd = aIdx.GetNode();
if( rNd.IsOLENode() &&
rName == ((SwOLENode&)rNd).GetChartTblName() &&
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index cc69005..07f11b4 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -236,7 +236,7 @@ void SwEditShell::SetSectionAttr( const SfxItemSet& rSet,
StartOfSectionNode()->GetSectionNode())) )
_SetSectionAttr( *pSttSectNd->GetSection().GetFmt(),
rSet );
- aSIdx++;
+ ++aSIdx;
}
}
}
@@ -387,10 +387,10 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
if( rCurrentNode.IsCntntNode() &&
( pCurrentPos->nContent.GetIndex() ==
rCurrentNode.GetCntntNode()->Len() ) )
- aEnd++;
+ ++aEnd;
while( (aEnd != pInnermostNode->EndOfSectionNode()->GetIndex()) &&
aEnd.GetNode().IsEndNode() )
- aEnd++;
+ ++aEnd;
bool bEnd = ( aEnd == pInnermostNode->EndOfSectionNode()->GetIndex() );
// evalutate result: if both start + end, end is preferred
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index d3326a9..b31f8e6 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -818,7 +818,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
aIndexBefore--;
pClpDoc->CopyRange( rCopy, rInsPos, false );
{
- aIndexBefore++;
+ ++aIndexBefore;
SwPaM aPaM(SwPosition(aIndexBefore),
SwPosition(rInsPos.nNode));
aPaM.GetDoc()->MakeUniqueNumRules(aPaM);
@@ -1050,7 +1050,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
pClpDoc->CopyRange( aCpyPam, rInsPos, false );
{
- aIndexBefore++;
+ ++aIndexBefore;
SwPaM aPaM(SwPosition(aIndexBefore),
SwPosition(rInsPos.nNode));
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index abc8aad..43e38e0 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1380,7 +1380,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
pDoc->GetIDocumentUndoRedo().DoUndo(bUndo);
}
SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
- rInsPosNd++;
+ ++rInsPosNd;
if( pUndo )
pUndo->MoveBoxCntnt( pDoc, aRg, rInsPosNd );
else
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index da3abe4..5e6768e 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -220,7 +220,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
aIdx = nEnd-1;
}
}
- aIdx++;
+ ++aIdx;
pNode = & aIdx.GetNode();
}
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 5133878..324eb74 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -2064,7 +2064,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
IDocumentMarkAccess* const pMarkAccess = mrSh.GetDoc()->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin();
ppMark != pMarkAccess->getBookmarksEnd();
- ppMark++)
+ ++ppMark)
{
//get the name
const ::sw::mark::IMark* pBkmk = ppMark->get();
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bc47cf4..f795666 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -533,7 +533,7 @@ bool sw_HideObj( const SwTxtFrm& _rFrm,
if ( pFrmFmt->Which() == RES_FLYFRMFMT )
{
SwNodeIndex nCntntIndex = *(pFrmFmt->GetCntnt().GetCntntIdx());
- nCntntIndex++;
+ ++nCntntIndex;
if ( nCntntIndex.GetNode().IsNoTxtNode() )
{
bRet = false;
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 6000271..ab78c15 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -388,7 +388,7 @@ void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const
// before: Src: SxxxE, Dst: SnE
// now: Src: SxxxE, Dst: SnxxxE
// after: Src: SxxxE, Dst: SxxxE
- aStart++;
+ ++aStart;
rDstNodes.Delete( aStart, nDestLen );
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 44fe54d..899b93a 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1032,7 +1032,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
for(IDocumentMarkAccess::const_iterator_t ppMark =
pMarkAccess->getMarksBegin();
ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
{
// Bookmarks must never grow to either side, when
// editing (directly) to the left or right (#i29942#)!
@@ -3015,7 +3015,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
->ExpandField(true));
if( aExpand.Len() )
{
- aDestIdx++; // dahinter einfuegen;
+ ++aDestIdx; // dahinter einfuegen;
rDestNd.InsertText( aExpand, aDestIdx );
aDestIdx = nInsPos + nAttrStartIdx;
nInsPos = nInsPos + aExpand.Len();
@@ -3041,7 +3041,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
GetNumStr( rFtn.GetNumber() );
if( sExpand.Len() )
{
- aDestIdx++; // insert behind
+ ++aDestIdx; // insert behind
SvxEscapementItem aItem(
SVX_ESCAPEMENT_SUPERSCRIPT );
rDestNd.InsertItem(aItem,
@@ -3339,7 +3339,7 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
// Dadurch wird die Attributierung des 1. Zeichen expandiert!
m_Text.SetChar( nStartPos, rText.GetChar( 0 ) );
- ((SwIndex&)rStart)++;
+ ++((SwIndex&)rStart);
m_Text.Erase( rStart.GetIndex(), nLen - 1 );
Update( rStart, nLen - 1, true );
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 7d1b59c..d279278 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -306,7 +306,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
if( nSttNode != nEndNode && bJoinTxt )
{
- aIdx++;
+ ++aIdx;
SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode();
if( pTxtNd && pTxtNd->CanJoinNext() )
{
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index c76b5b0..dfc199c 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -214,7 +214,7 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand();
pTxtNd->SetIgnoreDontExpand( sal_True );
- rIdx++;
+ ++rIdx;
for( xub_StrLen n = 0; n < aDelStr.Len(); n++ )
{
// do it individually, to keep the attributes!
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index cfe3b3c..aab7ebd 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -653,7 +653,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext)
rDoc.TableToText( pTblNd, cTrenner );
- aSaveIdx++;
+ ++aSaveIdx;
SwCntntNode* pCNd = aSaveIdx.GetNode().GetCntntNode();
if( !pCNd && 0 == ( pCNd = rDoc.GetNodes().GoNext( &aSaveIdx ) ) &&
0 == ( pCNd = rDoc.GetNodes().GoPrevious( &aSaveIdx )) )
@@ -2097,8 +2097,8 @@ void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& r
pDoc->MoveNodeRange( rRg, rPos, (pSaveTbl->IsNewModel()) ?
IDocumentContentOperations::DOC_NO_DELFRMS :
IDocumentContentOperations::DOC_MOVEDEFAULT );
- aTmp++;
- aTmp2++;
+ ++aTmp;
+ ++aTmp2;
pUndo->SetDestRange( aTmp2, rPos, aTmp );
pMoves->push_back( pUndo );
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index bebaeb2..aa029c9 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -223,7 +223,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
if( !pTxtFmtColl ) // if 0 than it's no TextNode -> delete
{
SwNodeIndex aDelIdx( rIdx );
- rIdx++;
+ ++rIdx;
SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode();
xub_StrLen nCnt = 0;
if( pCNd )
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index d0ef2d8..8e3bca5 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -88,7 +88,7 @@ void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc )
SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
if (0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
ChartPrettyPainter::IsChart( pONd->GetOLEObj().GetObject() ) )
{
@@ -164,7 +164,7 @@ void SwChartLockController_Helper::LockUnlockAllCharts( sal_Bool bLock )
SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
if (0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
pONd->GetChartTblName().Len() > 0 /* is chart object? */)
{
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 130fd2a..7d67310 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -899,7 +899,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr,
if(!nErrno)
{
- aSave++;
+ ++aSave;
pUnoCrsr->SetMark();
pUnoCrsr->GetMark()->nNode = aSave;
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 65186e0..23dcb2e 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -3547,7 +3547,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
SwNodeIndex aIdx( *pFmt->GetDoc()->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 );
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
SwNode *const pNd = & aIdx.GetNode();
if ( pNd->IsOLENode() &&
aOldName == ((SwOLENode*)pNd)->GetChartTblName() )
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 353384c..68e67c2 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -960,7 +960,7 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException)
SwNodeIndex aStartIdx(*pStartNode);
do
{
- aStartIdx++;
+ ++aStartIdx;
SwNode& rCurrentNode = aStartIdx.GetNode();
if(rCurrentNode.GetNodeType() == ND_SECTIONNODE
||rCurrentNode.GetNodeType() == ND_TABLENODE)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 631f8d3..220cd4f 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -660,7 +660,7 @@ sal_Bool ViewShell::HasCharts() const
StartOfSectionNode(), 1 );
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
const SwOLENode *pNd = aIdx.GetNode().GetOLENode();
if( pNd && pNd->GetChartTblName().Len() )
{
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 62eaf72..e841f78 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -354,7 +354,7 @@ ViewShell::~ViewShell()
SwNodeIndex aIdx( *rNds.GetEndOfAutotext().StartOfSectionNode(), 1 );
while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) )
{
- aIdx++;
+ ++aIdx;
if ( 0 != ( pGNd = aIdx.GetNode().GetGrfNode() ) )
{
if( pGNd->IsAnimated() )
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 13fb977..7c2fa60 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -534,7 +534,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor,
pTxtNd->GetMinMaxSize( aIdx.GetIndex(), nMinFrm,
nMaxFrm, nAbsMinCnts );
}
- aIdx++;
+ ++aIdx;
}
if( bOnlyOneNode )
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 5781084..c6d8554 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1283,7 +1283,7 @@ sal_Bool SwHTMLParser::HasCurrentParaBookmarks( sal_Bool bIgnoreStack ) const
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
{
const ::sw::mark::IMark* pBookmark = ppMark->get();
sal_uLong nBookNdIdx = pBookmark->GetMarkPos().nNode.GetIndex();
@@ -1351,7 +1351,7 @@ void SwHTMLParser::StripTrailingPara()
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
{
::sw::mark::IMark* pMark = ppMark->get();
sal_uLong nBookNdIdx = pMark->GetMarkPos().nNode.GetIndex();
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index 884878b..6e90c94 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -907,7 +907,7 @@ void SwRTFParser::NewTblLine()
SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
if( pCNd && pCNd->HasSwAttrSet() )
pCNd->ResetAllAttr();
- aIdx++;
+ ++aIdx;
}
}
pPam->Exchange();
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index b3e129a..3fdf831 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -441,12 +441,12 @@ static sal_Bool IterateNumrulePiece( const SwNodeIndex& rEnd,
{
while( ( rTmpStart <= rEnd )
&& !( rTmpStart.GetNode().IsTxtNode() ) ) // suche gueltigen Anfang
- rTmpStart++;
+ ++rTmpStart;
rTmpEnd = rTmpStart;
while( ( rTmpEnd <= rEnd )
&& ( rTmpEnd.GetNode().IsTxtNode() ) ) // suche gueltiges Ende + 1
- rTmpEnd++;
+ ++rTmpEnd;
rTmpEnd--; // gueltiges Ende
@@ -504,7 +504,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
pDoc->SetNumRule( aTmpPam, *pRul, false );
aTmpStart = aTmpEnd; // Start fuer naechstes Teilstueck
- aTmpStart++;
+ ++aTmpStart;
}
}
else
diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx
index 787e2fb..202b48f 100644
--- a/sw/source/filter/ww1/w1class.cxx
+++ b/sw/source/filter/ww1/w1class.cxx
@@ -892,7 +892,7 @@ Ww1Bookmarks::Ww1Bookmarks(Ww1Fib& rInFib)
// vor- und zurueckspringen, wobei ein weiterer Index oder ein Bitfeld
// oder etwas aehnliches zum Merken der bereits abgearbeiteten Bookmarks
// noetig wird.
-void Ww1Bookmarks::operator ++( int )
+void Ww1Bookmarks::operator++()
{
if( bOK )
{
@@ -1061,7 +1061,7 @@ Ww1Pap::Ww1Pap(Ww1Fib& _rFib)
void Ww1Pap::Seek(sal_uLong ulSeek)
{
while (ulSeek > Where())
- (*this)++;
+ ++(*this);
}
// SH: Where hat einen Parameter mitbekommen, der sagt, ob bei Neuanlegen eines
@@ -1085,7 +1085,7 @@ sal_uLong Ww1Pap::Where( sal_Bool bSetIndex )
return ulRet;
}
-void Ww1Pap::operator++(int)
+void Ww1Pap::operator++()
{
if (pPap != NULL)
if (++nFkpIndex > pPap->Count())
@@ -1160,7 +1160,7 @@ Ww1Chp::Ww1Chp(Ww1Fib& _rFib)
void Ww1Chp::Seek(sal_uLong ulSeek)
{
while (ulSeek > Where())
- (*this)++;
+ ++(*this);
}
// SH: Where hat einen Parameter mitbekommen, der sagt, ob bei Neuanlegen eines
@@ -1185,7 +1185,7 @@ sal_uLong Ww1Chp::Where( sal_Bool bSetIndex )
return ulRet;
}
-void Ww1Chp::operator++(int)
+void Ww1Chp::operator++()
{
if (pChp != NULL)
if (++nFkpIndex > pChp->Count())
diff --git a/sw/source/filter/ww1/w1class.hxx b/sw/source/filter/ww1/w1class.hxx
index 9710b1b..f372d3f 100644
--- a/sw/source/filter/ww1/w1class.hxx
+++ b/sw/source/filter/ww1/w1class.hxx
@@ -168,7 +168,7 @@ public:
if (ulCountBytes > ulNew)
ulCountBytes = ulNew;
}
- void operator++(int)
+ void operator++()
{
OSL_ENSURE(ulSeek+1<ulCountBytes, "Ww1PlainText");
ulSeek++;
@@ -1138,7 +1138,7 @@ public:
if (grpfIhdt & 0x0020) nFirstFootL = nextIhdd++;
OSL_ENSURE(nextIhdd<=Count(), "Ww1HeaderFooter");
}
- sal_Bool operator++(int)
+ sal_Bool operator++()
{
sal_Bool bRet = sal_True;
eHeaderFooterMode = (HeaderFooterMode)((short)eHeaderFooterMode + 1);
@@ -1231,7 +1231,7 @@ public:
{}
// innerhalb des textes
sal_uLong Where() { return Where(nPlcIndex); }
- void operator++(int)
+ void operator++()
{
OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Fields");
nPlcIndex++;
@@ -1303,7 +1303,7 @@ public:
delete pPos[0];
}
sal_uLong Where() const { return pPos[nIsEnd]->WhereCP(nPlcIdx[nIsEnd]); }
- void operator++(int);
+ void operator++();
sal_Bool GetError() const { return !bOK; }
long GetHandle() const;
sal_Bool GetIsEnd() const { return ( nIsEnd ) ? sal_True : sal_False; }
@@ -1333,7 +1333,7 @@ public:
ulRet = Ww1PlcFootnoteRef::Where(nPlcIndex);
return ulRet;
}
- void operator++(int)
+ void operator++()
{
OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Footnotes");
nPlcIndex++;
@@ -1352,7 +1352,7 @@ public:
: Ww1PlcSep(rFibL), aHdd(rFibL, grpfIhdt), nPlcIndex(0) {}
Ww1HeaderFooter& GetHdd() { return aHdd; }
- void operator++(int) { nPlcIndex++; }
+ void operator++() { nPlcIndex++; }
sal_uInt8* GetData() { return Ww1PlcSep::GetData(nPlcIndex); }
// innerhalb des textes
sal_uLong Where() { return Ww1PlcSep::Where(nPlcIndex); }
@@ -1393,7 +1393,7 @@ public:
Ww1Pap(Ww1Fib& rFib);
~Ww1Pap() { delete pPap; }
sal_uLong Where( sal_Bool bSetIndex = sal_True ); // innerhalb des textes
- void operator++(int);
+ void operator++();
sal_Bool FillStart(sal_uInt8*& pB, sal_uInt16& nSize)
{
UpdateIdx();
@@ -1460,7 +1460,7 @@ public:
Ww1Chp( Ww1Fib& rFib );
~Ww1Chp() { delete pChp; }
sal_uLong Where( sal_Bool bSetIndex = sal_True ); // innerhalb des textes
- void operator++(int);
+ void operator++();
sal_Bool FillStart(W1_CHP& rChp)
{
UpdateIdx();
diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx
index 14e978c..a0c9eae 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -354,7 +354,7 @@ void Ww1Bookmarks::Start(Ww1Shell& rOut, Ww1Manager& rMan)
if (rMan.Where() >= Where())
{
Out(rOut, rMan);
- (*this)++;
+ ++(*this);
}
}
@@ -390,7 +390,7 @@ void Ww1Footnotes::Start(Ww1Shell& rOut, Ww1Manager& rMan)
rOut.EndFootnote();
}
else
- (*this)++;
+ ++(*this);
}
}
@@ -400,7 +400,7 @@ void Ww1Footnotes::Stop(Ww1Shell& /*rOut*/, Ww1Manager& rMan, sal_Unicode& c)
{
OSL_ENSURE(nPlcIndex < Count(), "Ww1Footnotes");
c = ' ';
- (*this)++;
+ ++(*this);
}
}
@@ -412,7 +412,7 @@ void Ww1Fields::Start(Ww1Shell& rOut, Ww1Manager& rMan)
if (GetData()->chGet() == 19)
Out(rOut, rMan);
else
- (*this)++; // ignore
+ ++(*this); // ignore
}
}
@@ -425,7 +425,7 @@ void Ww1Fields::Stop( Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode& c)
{
rMan.Fill( c );
OSL_ENSURE(c==21, "Ww1Fields");
- (*this)++;
+ ++(*this);
c = ' ';
if (pField)
// haben wir ein fertiges feld da, das eingefuegt werden soll?
@@ -575,7 +575,7 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
// zuende ist oder der ergebnisteil beginnt. dabei koennen
// natuerlich neue felder beginnen (word unterstuetzt felder,
// die wiederum felder beinhalten).
- (*this)++;
+ ++(*this);
pData = GetData();
if (pData->chGet()==19) // nested field
{
@@ -608,7 +608,7 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
c = rMan.Fill(sErgebnis, GetLength());
if (!Ww1PlainText::IsChar(c))
sErgebnis += c; //~ mdt: sonderzeichenbenhandlung
- (*this)++;
+ ++(*this);
pData = GetData();
}
OSL_ENSURE(pData->chGet()==21, "Ww1PlainText");
@@ -982,7 +982,7 @@ oncemore:
this->sErgebnis = sErgebnis;
}
else // oops: we are terribly wrong: skip this
- (*this)++;
+ ++(*this);
}
sal_uLong Ww1Fields::GetLength()
@@ -1022,7 +1022,7 @@ void Ww1Sep::Start(Ww1Shell& rOut, Ww1Manager& rMan)
Ww1SprmSep aSprm(rFib, SVBT32ToUInt32(pByte + 2));
aSprm.Start(rOut, rMan);
aSprm.Stop(rOut, rMan);
- (*this)++;
+ ++(*this);
aHdd.Start(rOut, rMan);
}
}
@@ -1041,7 +1041,7 @@ void Ww1Pap::Start(Ww1Shell& rOut, Ww1Manager& rMan)
// und ausgeben:
aSprm.Start(rOut, rMan);
}
- (*this)++;
+ ++(*this);
}
}
@@ -1162,7 +1162,7 @@ void Ww1Chp::Start(Ww1Shell& rOut, Ww1Manager& rMan)
aPic.Out(rOut, rMan);
}
}
- (*this)++;
+ ++(*this);
}
}
@@ -1245,7 +1245,7 @@ sal_Unicode Ww1PlainText::Out( Ww1Shell& rOut, sal_uLong& ulEnd )
while (ulSeek < ulEnd)
{
sal_Unicode c = (*this)[ulSeek];
- (*this)++;
+ ++(*this);
if (Ww1PlainText::IsChar(c))
rOut << c;
else
@@ -1263,7 +1263,7 @@ sal_Unicode Ww1PlainText::Out( String& rStr, sal_uLong ulEnd )
while (ulSeek < ulEnd)
{
sal_Unicode c = (*this)[ulSeek];
- (*this)++;
+ ++(*this);
if( Ww1PlainText::IsChar(c) )
rStr += c;
else
@@ -1278,7 +1278,7 @@ sal_Unicode Ww1PlainText::Out( String& rStr, sal_uLong ulEnd )
sal_Unicode Ww1PlainText::Out( sal_Unicode& rRead )
{
rRead = (*this)[ulSeek];
- (*this)++;
+ ++(*this);
return rRead;
}
@@ -1933,7 +1933,7 @@ void Ww1HeaderFooter::Start(Ww1Shell& rOut, Ww1Manager& rMan)
// noetig:
if (!rMan.Pushed())
{
- while ((*this)++)
+ while (++(*this))
switch (eHeaderFooterMode)
{
case FtnSep:
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 41920e6..1a30749 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -366,7 +366,7 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
WW8TableNodeInfoInner::Pointer_t pInner = aIt->second;
sResult += pInner->toString();
- aIt++;
+ ++aIt;
}
sResult += dbg_out(*mpNode);
sResult += "</tableNodeInfo>";
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index ab70d5b..2141e28 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2034,13 +2034,13 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
nTTyp );
{
SwNodeIndex aContentIdx = *pNdIdx;
- aContentIdx++;
+ ++aContentIdx;
if ( aContentIdx.GetNode().IsTableNode() )
{
bool bContainsOnlyTables = true;
do {
aContentIdx = *(aContentIdx.GetNode().EndOfSectionNode());
- aContentIdx++;
+ ++aContentIdx;
if ( !aContentIdx.GetNode().IsTableNode() &&
aContentIdx.GetIndex() != pNdIdx->GetNode().EndOfSectionIndex() )
{
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index bdaded8..1ee6476 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -112,7 +112,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
while( !( aStart.GetNode().IsStartNode() && SwNormalStartNode ==
aStart.GetNode().GetStartNode()->GetStartNodeType()) &&
aStart < aDocEnd )
- aStart++;
+ ++aStart;
if( aStart < aDocEnd )
{
@@ -124,7 +124,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
SwPaM aPam( aStart );
{
SwNodeIndex& rIdx = aPam.GetPoint()->nNode;
- rIdx++;
+ ++rIdx;
if( 0 == ( pCNd = rIdx.GetNode().GetTxtNode() ) )
{
pCNd = pD->GetNodes().MakeTxtNode( rIdx, pColl );
@@ -139,7 +139,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
if(( 0 == ( pCNd = rIdx.GetNode().GetCntntNode() ) )
|| HasBareGraphicEnd(pD,rIdx))
{
- rIdx++;
+ ++rIdx;
pCNd = pD->GetNodes().MakeTxtNode( rIdx, pColl );
rIdx = *pCNd;
}
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 042ef68..9d9aaed 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2200,11 +2200,11 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrmFmt *pFlyFmt,
{
SwTableNode *pTable = aIdx.GetNode().GetTableNode();
aIdx = *aIdx.GetNode().EndOfSectionNode();
- aIdx++;
+ ++aIdx;
if ( (aIdx < aEnd) && aIdx.GetNode().IsTxtNode() )
{
SwTxtNode *pNd = aIdx.GetNode().GetTxtNode();
- aIdx++;
+ ++aIdx;
if (aIdx == aEnd && pNd && !pNd->GetTxt().Len())
{
//An extra pre-created by writer unused paragraph
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 6f6fad5..56b399a 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -128,7 +128,7 @@ static void lcl_FillSubRegionList( SwWrtShell& rSh, ComboBox& rSubRegions, Combo
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
{
const ::sw::mark::IMark* pBkmk = ppMark->get();
if( pBkmk->IsExpanded() )
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index da2faf1..d851951 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -840,7 +840,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
// find all DDE-Bookmarks
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
{
if(IDocumentMarkAccess::DDE_BOOKMARK == IDocumentMarkAccess::GetType(**ppMark))
vDdeMarks.push_back(ppMark->get());
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index c82a782..f0ee12e 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -572,7 +572,7 @@ void SwPostItMgr::LayoutPostIts()
long mlPageBorder = 0;
long mlPageEnd = 0;
- for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
+ for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); ++i)
{
SwSidebarItem* pItem = (*i);
SwSidebarWin* pPostIt = pItem->pPostIt;
@@ -680,7 +680,7 @@ void SwPostItMgr::LayoutPostIts()
- enlarge all notes till GetNextBorder(), as we resized to average value before
*/
//lets hide the ones which overlap the page
- for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++)
+ for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i)
{
if (mPages[n]->lOffset != 0)
(*i)->TranslateTopPosition(mPages[n]->lOffset);
@@ -717,7 +717,7 @@ void SwPostItMgr::LayoutPostIts()
}
else
{
- for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++)
+ for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i)
(*i)->SetPosAndSize();
bool bOldScrollbar = mPages[n]->bScrollbar;
@@ -736,7 +736,7 @@ void SwPostItMgr::LayoutPostIts()
if (!ShowNotes())
{ // we do not want to see the notes anymore -> Options-Writer-View-Notes
bool bRepair = false;
- for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
SwSidebarItem* pItem = (*i);
if ( !pItem->UseElement() )
@@ -801,7 +801,7 @@ void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
const bool bOldUp = ArrowEnabled(KEY_PAGEUP,aPage);
const bool bOldDown = ArrowEnabled(KEY_PAGEDOWN,aPage);
const long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height();
- for(SwSidebarItem_iterator i = mPages[aPage-1]->mList->begin(); i!= mPages[aPage-1]->mList->end(); i++)
+ for(SwSidebarItem_iterator i = mPages[aPage-1]->mList->begin(); i!= mPages[aPage-1]->mList->end(); ++i)
{
SwSidebarWin* pPostIt = (*i)->pPostIt;
// if this is an answer, we should take the normal position and not the real, slightly moved position
@@ -872,7 +872,7 @@ void SwPostItMgr::MakeVisible(const SwSidebarWin* pPostIt,long aPage )
{
if (mPages[n]->mList->size()>0)
{
- for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
+ for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); ++i)
{
if ((*i)->pPostIt==pPostIt)
{
@@ -950,12 +950,12 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
bScrollbars = true;
lTopBorder += GetSidebarScrollerHeight() + 10;
lBottomBorder -= (GetSidebarScrollerHeight() + 10);
- for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++)
+ for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i)
(*i)->SetSize(Size((*i)->VirtualSize().getWidth(),(*i)->GetMinimumSizeWithMeta()));
}
else
{
- for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++)
+ for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i)
{
if ( (*i)->VirtualSize().getHeight() > lAverageHeight)
(*i)->SetSize(Size((*i)->VirtualSize().getWidth(),lAverageHeight));
@@ -973,7 +973,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
loop++;
bDone = true;
lSpaceUsed = lTopBorder + GetSpaceBetween();
- for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++)
+ for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i)
{
SwSidebarWin_iterator aNextPostIt = i;
++aNextPostIt;
@@ -1199,7 +1199,7 @@ void SwPostItMgr::Delete()
}
void SwPostItMgr::Hide( const String& rAuthor )
{
- for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( (*i)->pPostIt && ((*i)->pPostIt->GetAuthor() == rAuthor) )
{
@@ -1213,7 +1213,7 @@ void SwPostItMgr::Hide( const String& rAuthor )
void SwPostItMgr::Hide()
{
- for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
(*i)->bShow = false;
(*i)->pPostIt->HideNote();
@@ -1223,7 +1223,7 @@ void SwPostItMgr::Hide()
void SwPostItMgr::Show()
{
- for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
(*i)->bShow = true;
}
@@ -1268,7 +1268,7 @@ SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection,
{
if (mvPostItFlds.size()>1)
{
- for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
if ( (*i)->pPostIt ==aPostIt)
{
@@ -1283,7 +1283,7 @@ SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection,
}
else
{
- iNextPostIt++;
+ ++iNextPostIt;
if ( iNextPostIt==mvPostItFlds.end() )
{
return NULL;
@@ -1305,12 +1305,12 @@ long SwPostItMgr::GetNextBorder()
{
for (unsigned long n=0;n<mPages.size();n++)
{
- for(SwSidebarItem_iterator b = mPages[n]->mList->begin(); b!= mPages[n]->mList->end(); b++)
+ for(SwSidebarItem_iterator b = mPages[n]->mList->begin(); b!= mPages[n]->mList->end(); ++b)
{
if ((*b)->pPostIt == mpActivePostIt)
{
SwSidebarItem_iterator aNext = b;
- aNext++;
+ ++aNext;
bool bFollow = (aNext == mPages[n]->mList->end()) ? false : (*aNext)->pPostIt->IsFollow();
if ( mPages[n]->bScrollbar || bFollow )
{
@@ -1498,7 +1498,7 @@ void SwPostItMgr::CorrectPositions()
// find first valid note
SwSidebarWin *pFirstPostIt = 0;
- for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
+ for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i)
{
pFirstPostIt = (*i)->pPostIt;
if (pFirstPostIt)
@@ -1523,7 +1523,7 @@ void SwPostItMgr::CorrectPositions()
long aAnchorPosY = 0;
for (unsigned long n=0;n<mPages.size();n++)
{
- for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
+ for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); ++i)
{
// check, if anchor overlay object exists.
if ( (*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->Anchor() )
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 19c52a6..34f82f2 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -493,7 +493,7 @@ void SwFldRefPage::UpdateSubType()
IDocumentMarkAccess* const pMarkAccess = pSh->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin();
ppMark != pMarkAccess->getBookmarksEnd();
- ppMark++)
+ ++ppMark)
{
const ::sw::mark::IMark* pBkmk = ppMark->get();
if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk))
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 9a139d0..ea0ed33 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -156,7 +156,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe
sal_uInt16 nId = 0;
for( IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
ppBookmark != pMarkAccess->getBookmarksEnd();
- ppBookmark++)
+ ++ppBookmark)
{
if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
aBookmarkBox.InsertEntry( SwBoxEntry( ppBookmark->get()->GetName(), nId++ ) );
diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx
index 29bcb73..651172d 100644
--- a/sw/source/ui/utlui/bookctrl.cxx
+++ b/sw/source/ui/utlui/bookctrl.cxx
@@ -106,7 +106,7 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt )
::std::map<sal_Int32, sal_uInt16> aBookmarkIdx;
for(IDocumentMarkAccess::const_iterator_t ppBookmark = ppBookmarkStart;
ppBookmark != pMarkAccess->getBookmarksEnd();
- ppBookmark++)
+ ++ppBookmark)
{
if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
{
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index e07a695..980b3f8 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -607,7 +607,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged)
IDocumentMarkAccess* const pMarkAccess = pWrtShell->getIDocumentMarkAccess();
for(IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
ppBookmark != pMarkAccess->getBookmarksEnd();
- ppBookmark++)
+ ++ppBookmark)
{
if(lcl_IsUiVisibleBookmark(*ppBookmark))
{
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 1786b13..8695dfc 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -551,7 +551,7 @@ void SwNavigationPI::MakeMark()
::std::vector< ::rtl::OUString > vNavMarkNames;
for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
ppMark != pMarkAccess->getMarksEnd();
- ppMark++)
+ ++ppMark)
if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER )
vNavMarkNames.push_back(ppMark->get()->GetName());
::std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
commit dc3aa430f911b9c2131034c0f517c297820e565d
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Oct 15 23:29:36 2012 +0200
rewriter for postfix->prefix operator++
Change-Id: I59a7490ec76b10fd31033d1ceccd1e3eae0ad398
diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index f183906..818015f 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -13,6 +13,7 @@ CLANGSRC= \
plugin.cxx \
bodynotinblock.cxx \
lclstaticfix.cxx \
+ postfixincrementfix.cxx \
sallogareas.cxx \
unusedvariablecheck.cxx \
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 853cf74..7ecf599 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -20,6 +20,7 @@
#include "bodynotinblock.hxx"
#include "lclstaticfix.hxx"
+#include "postfixincrementfix.hxx"
#include "sallogareas.hxx"
#include "unusedvariablecheck.hxx"
@@ -150,6 +151,7 @@ class PluginHandler
, args( args )
, bodyNotInBlock( context )
, lclStaticFix( context, rewriter )
+ , postfixIncrementFix( context, rewriter )
, salLogAreas( context )
, unusedVariableCheck( context )
{
@@ -160,6 +162,8 @@ class PluginHandler
return;
if( isArg( "lclstaticfix" ))
lclStaticFix.run();
+ else if( isArg( "postfixincrementfix" ))
+ postfixIncrementFix.run();
else if( args.empty())
{
bodyNotInBlock.run();
@@ -201,6 +205,7 @@ class PluginHandler
vector< string > args;
BodyNotInBlock bodyNotInBlock;
LclStaticFix lclStaticFix;
+ PostfixIncrementFix postfixIncrementFix;
SalLogAreas salLogAreas;
UnusedVariableCheck unusedVariableCheck;
};
diff --git a/compilerplugins/clang/postfixincrementfix.cxx b/compilerplugins/clang/postfixincrementfix.cxx
new file mode 100644
index 0000000..ee63b8e
--- /dev/null
+++ b/compilerplugins/clang/postfixincrementfix.cxx
@@ -0,0 +1,165 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include "postfixincrementfix.hxx"
+
+#include <clang/Basic/SourceManager.h>
+
+namespace loplugin
+{
+
+PostfixIncrementFix::PostfixIncrementFix( ASTContext& context, Rewriter& rewriter )
+ : RewritePlugin( context, rewriter )
+ {
+ }
+
+void PostfixIncrementFix::run()
+ {
+ TraverseDecl( context.getTranslationUnitDecl());
+ }
+
+bool PostfixIncrementFix::VisitFunctionDecl( FunctionDecl* declaration )
+ {
+ // TODO also LO header files? or a subdir?
+ if( !context.getSourceManager().isFromMainFile( declaration->getLocStart()))
+ return true;
+ if( !declaration->doesThisDeclarationHaveABody())
+ return true;
+ StmtParents parents;
+ fixPostfixOperators( declaration->getBody(), parents );
+ return true;
+ }
+
+void PostfixIncrementFix::fixPostfixOperators( const Stmt* stmt, StmtParents& parents )
+ {
+ if( const CXXOperatorCallExpr* op = dyn_cast<CXXOperatorCallExpr>( stmt ))
+ { // postfix ++ has two arguments (the operand and the hidden extra int)
+ if( op->getOperator() == OO_PlusPlus && op->getNumArgs() == 2 )
+ fixPostfixOperator( op, parents );
+ }
+ // For primitive types it would be UnaryOperatorExpr, but probably no good reason to change those.
+ parents.push_back( stmt );
+ for( ConstStmtIterator it = stmt->child_begin();
+ it != stmt->child_end();
+ ++it )
+ {
+ if( *it != NULL ) // some children can be apparently NULL
+ fixPostfixOperators( *it, parents );
+ }
+ assert( parents.back() == stmt );
+ parents.pop_back();
+ }
+
+void PostfixIncrementFix::fixPostfixOperator( const CXXOperatorCallExpr* op, StmtParents& parents )
+ {
+ if( !canChangePostfixToPrefix( op, parents, parents.size() - 1 ))
+ return;
+ if( !shouldDoChange( op->getArg( 0 )))
+ return;
+ // Adding spaces around the moved ++ should not be necessary
+ // (there might a problem with e.g. a+b++ -> a+++b (i.e. a++ +b),
+ // but we don't change such expressions).
+ if( insertText( op->getLocStart(), "++" )) // insert is intentionally first, in case it fails
+ removeText( op->getCallee()->getSourceRange());
+ }
+
+bool PostfixIncrementFix::canChangePostfixToPrefix( const CXXOperatorCallExpr* op, StmtParents& parents, int parent_pos )
+ {
+ // check if foo++ can be safely replaced by ++foo
+ switch( parents[ parent_pos ]->getStmtClass())
+ {
+ case Stmt::CompoundStmtClass:
+ return true;
+ // these mean somebody is going to use it
+ case Stmt::ImplicitCastExprClass:
+ case Stmt::MaterializeTemporaryExprClass:
+ case Stmt::BinaryOperatorClass:
+ case Stmt::UnaryOperatorClass:
+ case Stmt::CallExprClass:
+ case Stmt::CXXOperatorCallExprClass:
+ return false;
+ case Stmt::CXXBindTemporaryExprClass:
+ // tricky, it may just mean the temporary will be cleaned up
+ // (by ExprWithCleanups), ignore and go up
+ assert( parent_pos > 0 ); // should not happen
+ return canChangePostfixToPrefix( op, parents, parent_pos - 1 );
+ case Stmt::ExprWithCleanupsClass:
+ // cleanup of a temporary, should be harmless (if the use
+ // of the postfix ++ operator here relies on the fact that
+ // the dtor for the object will be called, that's pretty insane
+ // code). Ignore and go up.
+ assert( parent_pos > 0 ); // should not happen
+ return canChangePostfixToPrefix( op, parents, parent_pos - 1 );
+ case Stmt::ParenExprClass: // parentheses, go up
+ assert( parent_pos > 0 );
+ return canChangePostfixToPrefix( op, parents, parent_pos - 1 );
+ case Stmt::IfStmtClass:
+ return canChangeInConditionStatement( op, cast< IfStmt >( parents[ parent_pos ] )->getCond(),
+ parents, parent_pos );
+ case Stmt::WhileStmtClass:
+ return canChangeInConditionStatement( op, cast< WhileStmt >( parents[ parent_pos ] )->getCond(),
+ parents, parent_pos );
+ case Stmt::DoStmtClass:
+ return canChangeInConditionStatement( op, cast< DoStmt >( parents[ parent_pos ] )->getCond(),
+ parents, parent_pos );
+ case Stmt::ForStmtClass:
+ return canChangeInConditionStatement( op, dyn_cast< ForStmt >( parents[ parent_pos ] )->getCond(),
+ parents, parent_pos );
+ default:
+ DiagnosticsEngine& diag = context.getDiagnostics();
+ unsigned diagid = diag.getCustomDiagID( DiagnosticsEngine::Fatal,
+ "cannot analyze operator++ (plugin needs fixing) [loplugin]" );
+ diag.Report( op->getLocStart(), diagid ) << parents[ parent_pos ]->getSourceRange();
+// parents[ parent_pos ]->dump();
+// parents[ std::max( parent_pos - 3, 0 ) ]->dump();
+ return false;
+ }
+ }
+
+bool PostfixIncrementFix::canChangeInConditionStatement( const CXXOperatorCallExpr* op, const Expr* condition,
+ const StmtParents& parents, int parent_pos )
+ {
+ // cannot be changed in condition, can be changed in statements
+ if( parent_pos == parents.size() - 1 )
+ return op != condition;
+ else
+ { // indirect child
+ assert( parent_pos + 1 < parents.size());
+ return parents[ parent_pos + 1 ] != condition;
+ }
+ }
+
+bool PostfixIncrementFix::shouldDoChange( const Expr* operand )
+ {
+ // TODO Changing 'a->b++' to '++a->b' is technically the same, but the latter probably looks confusing,
+ // so either avoid that, or add parentheses. Avoid for now.
+ const Expr* expr = const_cast< Expr* >( operand )->IgnoreImplicit(); // does not have const version
+ switch( expr->getStmtClass())
+ {
+ case Stmt::ParenExprClass:
+ return true; // there are already parentheses, ok to move the ++
+ case Stmt::MemberExprClass:
+ return false; // ++a->b , avoid
+ case Stmt::DeclRefExprClass:
+ return true;
+ default:
+ {
+ DiagnosticsEngine& diag = context.getDiagnostics();
+ unsigned diagid = diag.getCustomDiagID( DiagnosticsEngine::Fatal,
+ "cannot analyze operator++ (plugin needs fixing) [loplugin]" );
+ diag.Report( expr->getLocStart(), diagid ) << operand->getSourceRange();
+ expr->dump();
+ operand->dump();
+ return false;
+ }
+ }
+ }
+
+} // namespace
diff --git a/compilerplugins/clang/postfixincrementfix.hxx b/compilerplugins/clang/postfixincrementfix.hxx
new file mode 100644
index 0000000..6f6b414
--- /dev/null
+++ b/compilerplugins/clang/postfixincrementfix.hxx
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#ifndef POSTFIXINCREMENTFIX_H
+#define POSTFIXINCREMENTFIX_H
+
+#include "plugin.hxx"
+
+namespace loplugin
+{
+
+class PostfixIncrementFix
+ : public RecursiveASTVisitor< PostfixIncrementFix >
+ , public RewritePlugin
+ {
+ public:
+ explicit PostfixIncrementFix( ASTContext& context, Rewriter& rewriter );
+ void run();
+ bool VisitFunctionDecl( FunctionDecl* declaration );
+ private:
+ typedef std::vector< const Stmt* > StmtParents;
+ void fixPostfixOperator( const CXXOperatorCallExpr* op, StmtParents& parents );
+ void fixPostfixOperators( const Stmt* stmt, StmtParents& parents );
+ bool canChangePostfixToPrefix( const CXXOperatorCallExpr* op, StmtParents& parents, int parent_pos );
+ bool canChangeInConditionStatement( const CXXOperatorCallExpr* op, const Expr* condition,
+ const StmtParents& parents, int parent_pos );
+ bool shouldDoChange( const Expr* op );
+ };
+
+} // namespace
+
+#endif // POSTFIXINCREMENTFIX_H
+
commit 2e3642e66bfeddd3dbb9c91637059e32b444ac52
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Oct 15 17:34:13 2012 +0200
convenience functions for source rewriters
Change-Id: I36e2b49bc615db0b12b03ffa755fa51acc6830a0
diff --git a/compilerplugins/clang/lclstaticfix.cxx b/compilerplugins/clang/lclstaticfix.cxx
index c6b6136..849fea5 100644
--- a/compilerplugins/clang/lclstaticfix.cxx
+++ b/compilerplugins/clang/lclstaticfix.cxx
@@ -22,7 +22,7 @@ namespace loplugin
{
LclStaticFix::LclStaticFix( ASTContext& context, Rewriter& rewriter )
- : Plugin( context ), rewriter( rewriter )
+ : RewritePlugin( context, rewriter )
{
}
@@ -46,12 +46,7 @@ bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
return true;
if( name.compare( 0, 4, "lcl_" ) != 0 )
return true;
- if( rewriter.InsertText( declaration->getLocStart(), "static " ))
- { // the logic is backwards, true here meant it failed, so report
- report( DiagnosticsEngine::Warning,
- "cannot fix lcl_ function (result of macro expansion?) [loplugin]",
- declaration->getLocStart());
- }
+ insertText( declaration->getLocStart(), "static " );
return true;
}
diff --git a/compilerplugins/clang/lclstaticfix.hxx b/compilerplugins/clang/lclstaticfix.hxx
index be89b46..fdf9d34 100644
--- a/compilerplugins/clang/lclstaticfix.hxx
+++ b/compilerplugins/clang/lclstaticfix.hxx
@@ -18,14 +18,12 @@ namespace loplugin
class LclStaticFix
: public RecursiveASTVisitor< LclStaticFix >
- , public Plugin
+ , public RewritePlugin
{
public:
explicit LclStaticFix( ASTContext& context, Rewriter& rewriter );
void run();
bool VisitFunctionDecl( FunctionDecl* declaration );
- private:
- Rewriter& rewriter;
};
} // namespace
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 115193c..853cf74 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -52,6 +52,92 @@ bool Plugin::ignoreLocation( SourceLocation loc )
return context.getSourceManager().isInSystemHeader( context.getSourceManager().getExpansionLoc( loc ));
}
+
+RewritePlugin::RewritePlugin( ASTContext& context, Rewriter& rewriter )
+ : Plugin( context )
+ , rewriter( rewriter )
+ {
+ }
+
+bool RewritePlugin::insertText( SourceLocation Loc, StringRef Str, bool InsertAfter, bool indentNewLines )
+ {
+ if( rewriter.InsertText( Loc, Str, InsertAfter, indentNewLines ))
+ return reportEditFailure( Loc );
+ return true;
+ }
+
+bool RewritePlugin::insertTextAfter( SourceLocation Loc, StringRef Str )
+ {
+ if( rewriter.InsertTextAfter( Loc, Str ))
+ return reportEditFailure( Loc );
+ return true;
+ }
+
+bool RewritePlugin::insertTextAfterToken( SourceLocation Loc, StringRef Str )
+ {
+ if( rewriter.InsertTextAfterToken( Loc, Str ))
+ return reportEditFailure( Loc );
+ return true;
+ }
+
+bool RewritePlugin::insertTextBefore( SourceLocation Loc, StringRef Str )
+ {
+ if( rewriter.InsertTextBefore( Loc, Str ))
+ return reportEditFailure( Loc );
+ return true;
+ }
+
+bool RewritePlugin::removeText( SourceLocation Start, unsigned Length, RewriteOptions opts )
+ {
+ if( rewriter.RemoveText( Start, Length, opts ))
+ return reportEditFailure( Start );
+ return true;
+ }
+
+bool RewritePlugin::removeText( CharSourceRange range, RewriteOptions opts )
+ {
+ if( rewriter.RemoveText( range, opts ))
+ return reportEditFailure( range.getBegin());
+ return true;
+ }
+
+bool RewritePlugin::removeText( SourceRange range, RewriteOptions opts )
+ {
+ if( rewriter.RemoveText( range, opts ))
+ return reportEditFailure( range.getBegin());
+ return true;
+ }
+
+bool RewritePlugin::replaceText( SourceLocation Start, unsigned OrigLength, StringRef NewStr )
+ {
+ if( rewriter.ReplaceText( Start, OrigLength, NewStr ))
+ return reportEditFailure( Start );
+ return true;
+ }
+
+bool RewritePlugin::replaceText( SourceRange range, StringRef NewStr )
+ {
+ if( rewriter.ReplaceText( range, NewStr ))
+ return reportEditFailure( range.getBegin());
+ return true;
+ }
+
+bool RewritePlugin::replaceText( SourceRange range, SourceRange replacementRange )
+ {
+ if( rewriter.ReplaceText( range, replacementRange ))
+ return reportEditFailure( range.getBegin());
+ return true;
+ }
+
+bool RewritePlugin::reportEditFailure( SourceLocation loc )
+ {
+ DiagnosticsEngine& diag = context.getDiagnostics();
+ diag.Report( loc, diag.getCustomDiagID( DiagnosticsEngine::Warning,
+ "cannot perform source modification (macro expansion involved?) [loplugin]" ));
+ return false;
+ }
+
+
/**
Class that manages all LO modules.
*/
diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx
index 6d273ed..b8a48fa 100644
--- a/compilerplugins/clang/plugin.hxx
+++ b/compilerplugins/clang/plugin.hxx
@@ -39,7 +39,25 @@ class RewritePlugin
public:
explicit RewritePlugin( ASTContext& context, Rewriter& rewriter );
protected:
+ typedef Rewriter::RewriteOptions RewriteOptions;
+ // These following insert/remove/replaceText functions map to functions
+ // in clang::Rewriter, with two differences:
+ // - they (more intuitively) return false on failure rather than true
+ // - they report a warning when the change cannot be done
+ bool insertText( SourceLocation Loc, StringRef Str,
+ bool InsertAfter = true, bool indentNewLines = false );
+ bool insertTextAfter( SourceLocation Loc, StringRef Str );
+ bool insertTextAfterToken( SourceLocation Loc, StringRef Str );
+ bool insertTextBefore( SourceLocation Loc, StringRef Str );
+ bool removeText( SourceLocation Start, unsigned Length, RewriteOptions opts = RewriteOptions());
+ bool removeText( CharSourceRange range, RewriteOptions opts = RewriteOptions());
+ bool removeText( SourceRange range, RewriteOptions opts = RewriteOptions());
+ bool replaceText( SourceLocation Start, unsigned OrigLength, StringRef NewStr );
+ bool replaceText( SourceRange range, StringRef NewStr );
+ bool replaceText( SourceRange range, SourceRange replacementRange );
Rewriter& rewriter;
+ private:
+ bool reportEditFailure( SourceLocation loc );
};
inline
More information about the Libreoffice-commits
mailing list