summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-12-09 12:36:28 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-12-09 13:23:28 +0100
commitecee3285eaeb6bf6ae6695a81cd80177439c73df (patch)
tree8bb489d05088ce2dbdecd916b7f3d55fd5d70389 /sc/source/ui
parent7b2166c8217cb32f2f7951f074e33d9fe890bb9b (diff)
Fix checking for relevant change
The event can contain multiple changes, and the wanted change may be not the first one. Additionally, now it's safe even if Changes would be empty (is this possible?). Change-Id: Icde844961a492bc02a6b9dd3d6ca04f57a5f4e94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 986be06b4041..b7258e86e36e 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1712,11 +1712,15 @@ void ScViewOptiChangesListener::stopListening()
// virtual
void SAL_CALL ScViewOptiChangesListener::changesOccurred(const util::ChangesEvent& rEvent)
{
- OUString sChangedEntry;
- rEvent.Changes[0].Accessor >>= sChangedEntry;
-
- if (sChangedEntry == "Display/ColumnRowHighlighting")
- mrViewShell.GetViewData().GetView()->HighlightOverlay();
+ for (const auto& change : rEvent.Changes)
+ {
+ if (OUString sChangedEntry;
+ (change.Accessor >>= sChangedEntry) && sChangedEntry == "Display/ColumnRowHighlighting")
+ {
+ mrViewShell.GetViewData().GetView()->HighlightOverlay();
+ break;
+ }
+ }
}
// virtual