summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docdesc.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 22:59:16 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-01-23 23:15:16 +0100
commit01dc078165371c8b225934b53e8544c29d3246f2 (patch)
treeb01c1d16ccf59cd24336b568e2d7e57ca45442db /sw/source/core/doc/docdesc.cxx
parent07c7c88bc2d9d860ea92ab562ea0431ec1949b29 (diff)
do not use manual iteration
Change-Id: I036bc37c6af1a387c0f05f8fe56375d32ab048bc
Diffstat (limited to 'sw/source/core/doc/docdesc.cxx')
-rw-r--r--sw/source/core/doc/docdesc.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index d083b431a012..cce02770ca19 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -710,18 +710,20 @@ extern std::vector<SvGlobalName*> *pGlobalOLEExcludeList;
void SwDoc::PrtOLENotify( bool bAll )
{
- SwFEShell *pShell = 0;
- if ( getIDocumentLayoutAccess().GetCurrentViewShell() )
+ SwFEShell *pShell = nullptr;
{
SwViewShell *pSh = getIDocumentLayoutAccess().GetCurrentViewShell();
- if ( !pSh->ISA(SwFEShell) )
- do
- { pSh = static_cast<SwViewShell*>(pSh->GetNext());
- } while ( !pSh->ISA(SwFEShell) &&
- pSh != getIDocumentLayoutAccess().GetCurrentViewShell() );
-
- if ( pSh->ISA(SwFEShell) )
- pShell = static_cast<SwFEShell*>(pSh);
+ if ( pSh )
+ {
+ for(SwViewShell& rShell : pSh->GetRingContainer())
+ {
+ if(rShell.ISA(SwFEShell))
+ {
+ pShell = static_cast<SwFEShell*>(&rShell);
+ break;
+ }
+ }
+ }
}
if ( !pShell )
{