summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 22:59:22 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:15:16 +0100
commit1bbb0a9209f6d5c365290684b2f5c18f0ad3c76f (patch)
treefb14d2592ebc998855dbfb7651069a0081636afc
parent01dc078165371c8b225934b53e8544c29d3246f2 (diff)
do not use manual iteration
Change-Id: Ice6579d96f6cefb159e73492ce3bdabba00bd95b
-rw-r--r--sw/source/core/doc/doclay.cxx32
1 files changed, 13 insertions, 19 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 116af5956256..10a72166f7bc 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1268,18 +1268,17 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel(
IMPL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem*, EMPTYARG )
{
- SwViewShell *pSh, *pStartSh;
- pSh = pStartSh = pThis->getIDocumentLayoutAccess().GetCurrentViewShell();
- if( pStartSh )
- do {
- if( pSh->GetWin() )
+ SwViewShell* pStartSh = pThis->getIDocumentLayoutAccess().GetCurrentViewShell();
+ if(pStartSh)
+ for(SwViewShell& rShell : pStartSh->GetRingContainer())
+ {
+ if(rShell.GetWin())
{
// Make sure to repaint with virtual device
- pSh->LockPaint();
- pSh->UnlockPaint( true );
+ rShell.LockPaint();
+ rShell.UnlockPaint( true );
}
- pSh = static_cast<SwViewShell*>(pSh->GetNext());
- } while( pSh != pStartSh );
+ }
return 0;
}
@@ -1637,19 +1636,14 @@ std::set<SwRootFrm*> SwDoc::GetAllLayouts()
{
std::set<SwRootFrm*> aAllLayouts;
SwViewShell *pStart = getIDocumentLayoutAccess().GetCurrentViewShell();
- SwViewShell *pTemp = pStart;
- if ( pTemp )
+ if(pStart)
{
- do
+ for(SwViewShell& rShell : pStart->GetRingContainer())
{
- if (pTemp->GetLayout())
- {
- aAllLayouts.insert(pTemp->GetLayout());
- pTemp = static_cast<SwViewShell*>(pTemp->GetNext());
- }
- } while(pTemp!=pStart);
+ if(rShell.GetLayout())
+ aAllLayouts.insert(rShell.GetLayout());
+ }
}
-
return aAllLayouts;
}