summaryrefslogtreecommitdiff
path: root/desktop/source/lib
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2024-04-23 14:40:14 +0300
committerGökay ŞATIR <gokaysatir@collabora.com>2024-05-01 16:16:52 +0200
commit1ac07d2c9d45cc5db3f689d287ad9be939ef1124 (patch)
treea739ff8b428664ab533ef722579d367261eaf671 /desktop/source/lib
parentd7790878e315f795f5d9965dd9997ba3a5004c60 (diff)
Use a for loop for setting view properties.
Since there may be no view with the given id, checking the list first is safer. Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I4c305e0a0f6ce7cccdfea9889c414a6054ed3a88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166531 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 4d8c4a60105488be84ea80775dc04a24582752fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166720 Tested-by: Jenkins
Diffstat (limited to 'desktop/source/lib')
-rw-r--r--desktop/source/lib/init.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 22a0abd3a6e3..a857dec6f3f5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7232,26 +7232,24 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*p
}
}
-static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, const bool readOnly)
+static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const bool readOnly)
{
comphelper::ProfileZone aZone("doc_setViewReadOnly");
SolarMutexGuard aGuard;
SetLastExceptionMsg();
- doc_setView(pThis, nId);
- SfxViewShell::Current()->SetLokReadOnlyView(readOnly);
+ SfxLokHelper::setViewReadOnly(nId, readOnly);
}
-static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, const bool allow)
+static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const bool allow)
{
comphelper::ProfileZone aZone("doc_setAllowChangeComments");
SolarMutexGuard aGuard;
SetLastExceptionMsg();
- doc_setView(pThis, nId);
- SfxViewShell::Current()->SetAllowChangeComments(allow);
+ SfxLokHelper::setAllowChangeComments(nId, allow);
}
static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId, bool nEnabled)