Kaydet (Commit) 6fa11c72 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use C++11 iteration

Change-Id: I35592172210b83cc7d24308c001dd73bdf30c01b
üst 369f0117
...@@ -697,14 +697,12 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const ...@@ -697,14 +697,12 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const
{ {
const SwNumRule* pNumRuleAtCurrentSelection = NULL; const SwNumRule* pNumRuleAtCurrentSelection = NULL;
const SwPaM* pCurrentCrsr = GetCrsr();
bool bDifferentNumRuleFound = false; bool bDifferentNumRuleFound = false;
const SwPaM* pCrsr = pCurrentCrsr; for(const SwPaM& rCurrentCrsr : GetCrsr()->GetRingContainer())
do
{ {
const SwNodeIndex aEndNode = pCrsr->End()->nNode; const SwNodeIndex aEndNode = rCurrentCrsr.End()->nNode;
for ( SwNodeIndex aNode = pCrsr->Start()->nNode; aNode <= aEndNode; aNode++ ) for ( SwNodeIndex aNode = rCurrentCrsr.Start()->nNode; aNode <= aEndNode; aNode++ )
{ {
const SwNumRule* pNumRule = GetDoc()->GetNumRuleAtPos( SwPosition( aNode ) ); const SwNumRule* pNumRule = GetDoc()->GetNumRuleAtPos( SwPosition( aNode ) );
if ( pNumRule == NULL ) if ( pNumRule == NULL )
...@@ -725,9 +723,9 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const ...@@ -725,9 +723,9 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const
} }
} }
} }
if(bDifferentNumRuleFound)
pCrsr = static_cast< const SwPaM* >(pCrsr->GetNext()); break;
} while ( !bDifferentNumRuleFound && pCrsr != pCurrentCrsr ); }
return pNumRuleAtCurrentSelection; return pNumRuleAtCurrentSelection;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment