summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/core/data/stlsheet.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 062be0a05280..7679f1936a6b 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -297,18 +297,18 @@ bool ScStyleSheet::IsUsed() const
}
case SfxStyleFamily::Frame:
{
- const size_t nListenerCount = GetSizeOfVector();
- for (size_t n = 0; n < nListenerCount; ++n)
- {
- auto pUser(dynamic_cast<svl::StyleSheetUser*>(GetListener(n)));
- if (pUser && pUser->isUsedByModel())
+ ForAllListeners([this] (SfxListener* pListener)
{
- eUsage = Usage::USED;
- break;
- }
- else
- eUsage = Usage::NOTUSED;
- }
+ auto pUser(dynamic_cast<svl::StyleSheetUser*>(pListener));
+ if (pUser && pUser->isUsedByModel())
+ {
+ eUsage = Usage::USED;
+ return true; // break loop
+ }
+ else
+ eUsage = Usage::NOTUSED;
+ return false;
+ });
return eUsage == Usage::USED;
}
default: