summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/tabdlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-26 10:23:55 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-29 09:28:32 +0200
commit064b335cf721db96fe556c78b15d0abe0edec70d (patch)
treea0ed369c2b5f06871bcb20f4952e559d84365738 /sfx2/source/dialog/tabdlg.cxx
parent95d3e0d478686c7fa84f0bb8c466a1082333a47b (diff)
call SfxViewShell::Current() just once
Change-Id: Iea3777cfb86c64c01cf1029ff3ba6a834d8c3619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166706 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sfx2/source/dialog/tabdlg.cxx')
-rw-r--r--sfx2/source/dialog/tabdlg.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 01d6c0e440cf..d38be362dbea 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -137,10 +137,16 @@ css::uno::Reference< css::frame::XFrame > SfxTabPage::GetFrame() const
return css::uno::Reference< css::frame::XFrame >();
}
+static bool isLOKMobilePhone()
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return false;
+ const SfxViewShell* pCurrentShell = SfxViewShell::Current();
+ return pCurrentShell && pCurrentShell->isLOKMobilePhone();
+}
+
SfxTabPage::SfxTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rID, const SfxItemSet *rAttrSet)
- : BuilderPage(pPage, pController, rUIXMLDescription, rID,
- comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current()
- && SfxViewShell::Current()->isLOKMobilePhone())
+ : BuilderPage(pPage, pController, rUIXMLDescription, rID, isLOKMobilePhone())
, mpSet(rAttrSet)
, mbHasExchangeSupport(false)
, mpImpl(new TabPageImpl)