summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-03 19:08:17 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 01:10:04 +0100
commitae3e797258f14f4348ce542c71815e44e2c3f9f8 (patch)
tree5348b3e8c9add086105c58eff4c9f30090b8933d /sw
parent7cc956c554c74525d63b9eb98083b2811a9170f6 (diff)
use C++11 iteration
Change-Id: I78d4184f73a11e0f1ef0a1763d207a9a97ac44ee
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/view/viewsh.cxx28
1 files changed, 11 insertions, 17 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 23b76571c274..a8de6eaa60ee 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2032,21 +2032,20 @@ SfxItemPool& SwViewShell::GetAttrPool()
void SwViewShell::ApplyViewOptions( const SwViewOption &rOpt )
{
- SwViewShell *pSh = this;
- do
- { pSh->StartAction();
- pSh = static_cast<SwViewShell*>(pSh->GetNext());
- } while ( pSh != this );
+ for(SwViewShell& rSh : GetRingContainer())
+ rSh.StartAction();
ImplApplyViewOptions( rOpt );
// With one layout per view it is not longer necessary
// to sync these "layout related" view options
// But as long as we have to disable "multiple layout"
- pSh = static_cast<SwViewShell*>(this->GetNext());
- while ( pSh != this )
+
+ for(SwViewShell& rSh : GetRingContainer())
{
- SwViewOption aOpt( *pSh->GetViewOptions() );
+ if(&rSh == this)
+ continue;
+ SwViewOption aOpt( *rSh.GetViewOptions() );
aOpt.SetFldName( rOpt.IsFldName() );
aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() );
aOpt.SetShowHiddenPara( rOpt.IsShowHiddenPara() );
@@ -2054,18 +2053,13 @@ void SwViewShell::ApplyViewOptions( const SwViewOption &rOpt )
aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() );
aOpt.SetViewLayoutColumns( rOpt.GetViewLayoutColumns() );
aOpt.SetPostIts(rOpt.IsPostIts());
- if ( !(aOpt == *pSh->GetViewOptions()) )
- pSh->ImplApplyViewOptions( aOpt );
- pSh = static_cast<SwViewShell*>(pSh->GetNext());
+ if ( !(aOpt == *rSh.GetViewOptions()) )
+ rSh.ImplApplyViewOptions( aOpt );
}
// End of disabled multiple window
- pSh = this;
- do
- { pSh->EndAction();
- pSh = static_cast<SwViewShell*>(pSh->GetNext());
- } while ( pSh != this );
-
+ for(SwViewShell& rSh : GetRingContainer())
+ rSh.EndAction();
}
void SwViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )