summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dialog
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-08 14:10:57 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-09 09:29:34 +0200
commitd884c4be18a82f61fe6db6f22cb1bf1092afd48a (patch)
tree89de580b7cc48cc91e7f072b62fc57c528e7a55a /sw/source/uibase/dialog
parentad1f0bdeac30fca1dc56a08803ef23f2aca4db05 (diff)
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I37166c03ffd0f8f76ddc03ce556b6e6341a02b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167355 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw/source/uibase/dialog')
-rw-r--r--sw/source/uibase/dialog/watermarkdialog.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/uibase/dialog/watermarkdialog.cxx b/sw/source/uibase/dialog/watermarkdialog.cxx
index 413d20f28415..bfe03c3e94df 100644
--- a/sw/source/uibase/dialog/watermarkdialog.cxx
+++ b/sw/source/uibase/dialog/watermarkdialog.cxx
@@ -23,7 +23,13 @@
#include <sfx2/viewsh.hxx>
#include <svl/itemset.hxx>
-#define IS_MOBILE (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
+static bool isLOKMobilePhone()
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return false;
+ SfxViewShell* pCurrent = SfxViewShell::Current();
+ return pCurrent && pCurrent->isLOKMobilePhone();
+}
SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindings)
: SfxDialogController(pParent, "modules/swriter/ui/watermarkdialog.ui", "WatermarkDialog")
@@ -37,7 +43,7 @@ SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindin
{
InitFields();
- if (IS_MOBILE)
+ if (isLOKMobilePhone())
{
m_xBuilder->weld_label("ColorLabel")->hide();
m_xColor->hide();