[Libreoffice-commits] core.git: cui/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 28 13:53:54 UTC 2020


 cui/source/options/optgdlg.cxx |   21 +++++++++++++++------
 cui/source/options/optgdlg.hxx |    1 +
 2 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 38dd55f6022a6ec217a2a54459a2875f1bef1f5e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 28 09:39:37 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 28 14:53:10 2020 +0100

    cid#1468666 'Constant' variable guards dead code
    
    Change-Id: Ie27df6c7e4a10d943d0a2e2a6880a5fe2c34fbcb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104922
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 535285b70d90..b1b128a000c6 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -742,23 +742,29 @@ IMPL_LINK_NOARG(OfaViewTabPage, OnUseSkiaToggled, weld::ToggleButton&, void)
     UpdateSkiaStatus();
 }
 
+void OfaViewTabPage::HideSkiaWidgets()
+{
+    m_xUseSkia->hide();
+    m_xForceSkiaRaster->hide();
+    m_xSkiaStatusEnabled->hide();
+    m_xSkiaStatusDisabled->hide();
+}
+
 void OfaViewTabPage::UpdateSkiaStatus()
 {
-    bool skiaHidden = true;
 #if HAVE_FEATURE_SKIA
+    bool skiaHidden = true;
+
     // For now Skia is used mainly on Windows, enable the controls there.
     if (Application::GetToolkitName() == "win")
         skiaHidden = false;
     // It can also be used on Linux, but only with the rarely used 'gen' backend.
     if (Application::GetToolkitName() == "x11")
         skiaHidden = false;
-#endif
+
     if (skiaHidden)
     {
-        m_xUseSkia->hide();
-        m_xForceSkiaRaster->hide();
-        m_xSkiaStatusEnabled->hide();
-        m_xSkiaStatusDisabled->hide();
+        HideSkiaWidgets();
         return;
     }
 
@@ -770,6 +776,9 @@ void OfaViewTabPage::UpdateSkiaStatus()
     // FIXME: should really add code to show a 'lock' icon here.
     m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
     m_xForceSkiaRaster->set_sensitive(m_xUseSkia->get_active() && !officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly());
+#else
+    HideSkiaWidgets();
+#endif
 }
 
 std::unique_ptr<SfxTabPage> OfaViewTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 973260283aaf..93dc5280b98e 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -124,6 +124,7 @@ private:
     DECL_LINK(OnUseSkiaToggled, weld::ToggleButton&, void);
     DECL_STATIC_LINK(OfaViewTabPage, OnMoreIconsClick, weld::Button&, void);
     void UpdateSkiaStatus();
+    void HideSkiaWidgets();
 
 public:
     OfaViewTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);


More information about the Libreoffice-commits mailing list