From 38dd55f6022a6ec217a2a54459a2875f1bef1f5e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 28 Oct 2020 09:39:37 +0000 Subject: cid#1468666 'Constant' variable guards dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie27df6c7e4a10d943d0a2e2a6880a5fe2c34fbcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104922 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/options/optgdlg.cxx | 21 +++++++++++++++------ cui/source/options/optgdlg.hxx | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'cui') 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 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); -- cgit