summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 14:38:27 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 17:46:18 +0100
commit798ffd674b26666d0ada967f144bfdd54821e79f (patch)
tree64475d5a86fba088e965ad0aa2b6299d7e1e72a9
parent6aca1a26c3d46cd9b79bf7b109622352b1d0e12b (diff)
use C++11 iteration
Change-Id: I8992c9fd853b7b92e328826063b50244f9fa3544
-rw-r--r--sw/source/core/doc/doccorr.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index eaf11f6691ad..b012731b0815 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -320,17 +320,16 @@ SwEditShell const * SwDoc::GetEditShell() const
// Layout and OLE shells should be available
if( pCurrentView )
{
- SwViewShell const *pFirstVSh = pCurrentView;
- SwViewShell const *pCurrentVSh = pFirstVSh;
- // look for an EditShell (if it exists)
- do {
- if( pCurrentVSh->IsA( TYPE( SwEditShell ) ) )
+ for(const SwViewShell& rCurrentSh : pCurrentView->GetRingContainer())
+ {
+ // look for an EditShell (if it exists)
+ if( rCurrentSh.IsA( TYPE( SwEditShell ) ) )
{
- return static_cast<const SwEditShell*>(pCurrentVSh);
+ return static_cast<const SwEditShell*>(&rCurrentSh);
}
- } while( pFirstVSh != ( pCurrentVSh = static_cast<SwViewShell*>(pCurrentVSh->GetNext()) ));
+ }
}
- return 0;
+ return nullptr;
}
SwEditShell* SwDoc::GetEditShell()