diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-01-23 22:59:43 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-01-23 23:15:17 +0100 |
commit | 35f70c86f2d75cca18a34b2290a71753b3910879 (patch) | |
tree | e4a4071cadf33f795396fadf264f9d9564b030ba /sw | |
parent | a5970372925cc4ff2c2a0fd6e615a7282b113505 (diff) |
do not use manual iteration
Change-Id: If53c38b21cad756259f084ad84de090def596eb0
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/draw/dpage.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 24f2d35b5c48..52348ef79398 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -128,11 +128,17 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg ) const SdrPageGridFrameList* SwDPage::GetGridFrameList( const SdrPageView* pPV, const Rectangle *pRect ) const { - SwViewShell *pSh = static_cast< SwDrawModel* >(GetModel())->GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell(); - while (pSh && pSh->Imp()->GetPageView() != pPV) - pSh = pSh->GetNext(); - if (pSh) + SwViewShell* pSh = static_cast< SwDrawModel* >(GetModel())->GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell(); + if(pSh) { + for(SwViewShell& rShell : pSh->GetRingContainer()) + { + if(rShell.Imp()->GetPageView() == pPV) + { + pSh = &rShell; + break; + } + } if ( pGridLst ) const_cast<SwDPage*>(this)->pGridLst->Clear(); else |