diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-28 09:39:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-28 14:53:10 +0100 |
commit | 38dd55f6022a6ec217a2a54459a2875f1bef1f5e (patch) | |
tree | db2e564eda4f50be8330767a9f99e73d14b8ddaf /cui | |
parent | 5d07ba3c1e887993715425721ab165567ee5fdea (diff) |
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@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 21 | ||||
-rw-r--r-- | cui/source/options/optgdlg.hxx | 1 |
2 files changed, 16 insertions, 6 deletions
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); |