Kaydet (Commit) 3d93bde2 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use C++11 iteration

Change-Id: I94528ad25eb7fae3a9e7fb7aa6bc721f40d8c187
üst efbb2e5c
...@@ -1627,33 +1627,28 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd ) ...@@ -1627,33 +1627,28 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd )
// loops _behind_ the last node in the selection, which always works if you // loops _behind_ the last node in the selection, which always works if you
// are in content.) To achieve this, we'll force cursor(s) to point into // are in content.) To achieve this, we'll force cursor(s) to point into
// content, if UpdateCrsrPos() hasn't already done so. // content, if UpdateCrsrPos() hasn't already done so.
SwPaM* pCmp = m_pCurCrsr; for(SwPaM& rCmp : m_pCurCrsr->GetRingContainer())
do
{ {
// start will move forwards, end will move backwards // start will move forwards, end will move backwards
bool bPointIsStart = ( pCmp->Start() == pCmp->GetPoint() ); bool bPointIsStart = ( rCmp.Start() == rCmp.GetPoint() );
// move point; forward if it's the start, backwards if it's the end // move point; forward if it's the start, backwards if it's the end
if( ! pCmp->GetPoint()->nNode.GetNode().IsCntntNode() ) if( ! rCmp.GetPoint()->nNode.GetNode().IsCntntNode() )
pCmp->Move( bPointIsStart ? fnMoveForward : fnMoveBackward, rCmp.Move( bPointIsStart ? fnMoveForward : fnMoveBackward,
fnGoCntnt ); fnGoCntnt );
// move mark (if exists); forward if it's the start, else backwards // move mark (if exists); forward if it's the start, else backwards
if( pCmp->HasMark() ) if( rCmp.HasMark() )
{ {
if( ! pCmp->GetMark()->nNode.GetNode().IsCntntNode() ) if( ! rCmp.GetMark()->nNode.GetNode().IsCntntNode() )
{ {
pCmp->Exchange(); rCmp.Exchange();
pCmp->Move( !bPointIsStart ? fnMoveForward : fnMoveBackward, rCmp.Move( !bPointIsStart ? fnMoveForward : fnMoveBackward,
fnGoCntnt ); fnGoCntnt );
pCmp->Exchange(); rCmp.Exchange();
} }
} }
// iterate to next PaM in ring
pCmp = static_cast<SwPaM*>( pCmp->GetNext() );
} }
while( pCmp != m_pCurCrsr );
SwRect aOld( m_aCharRect ); SwRect aOld( m_aCharRect );
bool bFirst = true; bool bFirst = true;
......
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