summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-24 16:13:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-24 17:33:49 +0000
commit28f909df366d731ee0684d0608e5a00dcf70181c (patch)
treee3b97acadb7185b961f9b9a325c2c18ed9e8a7ec
parent6c7b85c2001edacd4f722a8cc87ad9df0385f94b (diff)
Revert "Simplify loops and reduce scope of some variables"
doesn't appear to be equivalent, first continue now skips second GetBound assign that original code would have done This reverts commit b56614c6bc8d32a68099c7841ba4a4076f584057. Change-Id: I113670064fd285795234ae9c9e09be0cc0697cd0
-rw-r--r--sw/source/core/doc/docredln.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index ba755ab43a82..7342206325c3 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1298,20 +1298,20 @@ void SwRangeRedline::DelCopyOfSection(size_t nMyPos)
const SwRedlineTbl& rTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl();
sal_uInt16 n = nMyPos;
OSL_ENSURE( n != USHRT_MAX, "How strange. We don't exist!" );
- while ( n > 0 )
+ for( bool bBreak = false; !bBreak && n > 0; )
{
--n;
+ bBreak = true;
if( rTbl[ n ]->GetBound(true) == *aPam.GetPoint() )
{
rTbl[ n ]->GetBound(true) = *pEnd;
- continue;
+ bBreak = false;
}
if( rTbl[ n ]->GetBound(false) == *aPam.GetPoint() )
{
rTbl[ n ]->GetBound(false) = *pEnd;
- continue;
+ bBreak = false;
}
- break;
}
SwPosition aEnd( *pEnd );
@@ -1345,39 +1345,41 @@ void SwRangeRedline::MoveFromSection(size_t nMyPos)
const SwRedlineTbl& rTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl();
std::vector<SwPosition*> aBeforeArr, aBehindArr;
OSL_ENSURE( this, "this is not in the array?" );
+ bool bBreak = false;
+ SwRedlineTbl::size_type n;
- for( SwRedlineTbl::size_type n = nMyPos+1; n < rTbl.size(); ++n )
+ for( n = nMyPos+1; !bBreak && n < rTbl.size(); ++n )
{
+ bBreak = true;
if( rTbl[ n ]->GetBound(true) == *GetPoint() )
{
SwRangeRedline* pRedl = rTbl[n];
aBehindArr.push_back(&pRedl->GetBound(true));
- continue;
+ bBreak = false;
}
if( rTbl[ n ]->GetBound(false) == *GetPoint() )
{
SwRangeRedline* pRedl = rTbl[n];
aBehindArr.push_back(&pRedl->GetBound(false));
- continue;
+ bBreak = false;
}
- break;
}
- for( SwRedlineTbl::size_type n = nMyPos; n ; )
+ for( bBreak = false, n = nMyPos; !bBreak && n ; )
{
--n;
+ bBreak = true;
if( rTbl[ n ]->GetBound(true) == *GetPoint() )
{
SwRangeRedline* pRedl = rTbl[n];
aBeforeArr.push_back(&pRedl->GetBound(true));
- continue;
+ bBreak = false;
}
if( rTbl[ n ]->GetBound(false) == *GetPoint() )
{
SwRangeRedline* pRedl = rTbl[n];
aBeforeArr.push_back(&pRedl->GetBound(false));
- continue;
+ bBreak = false;
}
- break;
}
const SwNode* pKeptCntntSectNode( &pCntntSect->GetNode() ); // #i95711#