summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdouno.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-01 14:22:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-11 18:24:29 +0200
commit7c66fc45239d2589e90fd694d54b3ff826b1bd15 (patch)
tree064a3ba4eaeaf05ae13ebcebfc6d8beb9234d8f2 /svx/source/svdraw/svdouno.cxx
parent3a6d360b5e585b8e92cc0d58d5fbc497448e11fb (diff)
use internal iterator for SfxBroadcaster
So we can avoid exposing the internal listener vector. (which allows further optimisations) Change-Id: If288141a37314dcc01d203029dc51c71ec2b7f54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdouno.cxx')
-rw-r--r--svx/source/svdraw/svdouno.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 6ea734a7341c..5cf4a5e55709 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -334,9 +334,12 @@ void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
o3tl::sorted_vector< SdrView* > aPreviouslyVisible;
{
- SdrViewIter aIter( this );
- for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
- aPreviouslyVisible.insert( pView );
+ SdrViewIter::ForAllViews(this,
+ [&aPreviouslyVisible] (SdrView* pView)
+ {
+ aPreviouslyVisible.insert( pView );
+ return false;
+ });
}
SdrRectObj::NbcSetLayer( _nLayer );
@@ -344,9 +347,8 @@ void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
// collect all views in which our new layer is visible
o3tl::sorted_vector< SdrView* > aNewlyVisible;
- {
- SdrViewIter aIter( this );
- for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
+ SdrViewIter::ForAllViews( this,
+ [&aPreviouslyVisible, &aNewlyVisible] (SdrView* pView)
{
if ( aPreviouslyVisible.erase(pView) == 0 )
{
@@ -355,8 +357,7 @@ void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
// => remember this view, as our visibility there changed
aNewlyVisible.insert( pView );
}
- }
- }
+ });
// now aPreviouslyVisible contains all views where we became invisible
for (const auto& rpView : aPreviouslyVisible)