summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-11-30 16:40:57 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-12-01 11:16:13 +0100
commit414930465e86e898a2493f61e4832f9a841ebe00 (patch)
treeb1b0e8e5ceaedc30916df586383697a06f2434d1 /cui/source
parenta4a15dc18c4be7fdb840b5d478c39cb1e8206b1a (diff)
drop the needless and broken SkiaConfig abstraction (tdf#137935)
I originally copy&pasted this from the OpenGL setting, but this appears to be just an unnecessary complication. Both the option and writing is in fact simple, and trying to make it abstract and complicated doesn't provide much, and it causes the options not saved if only 'Apply' is used in the config dialog. Change-Id: Ibd55052467988b54429358567d70cbfbb0a34653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106900 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/options/optgdlg.cxx101
-rw-r--r--cui/source/options/optgdlg.hxx5
2 files changed, 8 insertions, 98 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 0dc33f2c64ba..07435990a234 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -101,90 +101,6 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
using namespace ::utl;
-namespace svt {
-
-class SkiaCfg
-{
-private:
- bool mbUseSkia;
- bool mbForceSkiaRaster;
- bool mbModified;
-
-public:
- SkiaCfg();
- ~SkiaCfg();
-
- bool useSkia() const;
- bool forceSkiaRaster() const;
-
- void setUseSkia(bool bSkia);
- void setForceSkiaRaster(bool bSkia);
-
- void reset();
-};
-
-SkiaCfg::SkiaCfg():
- mbModified(false)
-{
- reset();
-}
-
-void SkiaCfg::reset()
-{
- mbUseSkia = officecfg::Office::Common::VCL::UseSkia::get();
- mbForceSkiaRaster = officecfg::Office::Common::VCL::ForceSkiaRaster::get();
- mbModified = false;
-}
-
-SkiaCfg::~SkiaCfg()
-{
- if (!mbModified)
- return;
-
- try
- {
- std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
- if (!officecfg::Office::Common::VCL::UseSkia::isReadOnly())
- officecfg::Office::Common::VCL::UseSkia::set(mbUseSkia, batch);
- if (!officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly())
- officecfg::Office::Common::VCL::ForceSkiaRaster::set(mbForceSkiaRaster, batch);
- batch->commit();
- }
- catch (...)
- {
- }
-}
-
-bool SkiaCfg::useSkia() const
-{
- return mbUseSkia;
-}
-
-bool SkiaCfg::forceSkiaRaster() const
-{
- return mbForceSkiaRaster;
-}
-
-void SkiaCfg::setUseSkia(bool bSkia)
-{
- if (bSkia != mbUseSkia)
- {
- mbUseSkia = bSkia;
- mbModified = true;
- }
-}
-
-void SkiaCfg::setForceSkiaRaster(bool bSkia)
-{
- if (mbForceSkiaRaster != bSkia)
- {
- mbForceSkiaRaster = bSkia;
- mbModified = true;
- }
-}
-
-}
-
// class OfaMiscTabPage --------------------------------------------------
DeactivateRC OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ )
@@ -656,7 +572,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
, pAppearanceCfg(new SvtTabAppearanceCfg)
, pCanvasSettings(new CanvasSettings)
, mpDrawinglayerOpt(new SvtOptionsDrawinglayer)
- , mpSkiaConfig(new svt::SkiaCfg)
, m_xIconSizeLB(m_xBuilder->weld_combo_box("iconsize"))
, m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box("sidebariconsize"))
, m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box("notebookbariconsize"))
@@ -941,8 +856,10 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
if (m_xUseSkia->get_state_changed_from_saved() ||
m_xForceSkiaRaster->get_state_changed_from_saved())
{
- mpSkiaConfig->setUseSkia(m_xUseSkia->get_active());
- mpSkiaConfig->setForceSkiaRaster(m_xForceSkiaRaster->get_active());
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::VCL::UseSkia::set(m_xUseSkia->get_active(), batch);
+ officecfg::Office::Common::VCL::ForceSkiaRaster::set(m_xForceSkiaRaster->get_active(), batch);
+ batch->commit();
bModified = true;
}
@@ -989,7 +906,6 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
void OfaViewTabPage::Reset( const SfxItemSet* )
{
SvtMiscOptions aMiscOptions;
- mpSkiaConfig->reset();
if (aMiscOptions.GetSymbolsSize() != SFX_SYMBOLS_SIZE_AUTO)
{
@@ -1072,16 +988,15 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xUseAntiAliase->save_state();
}
- m_xUseSkia->set_active(mpSkiaConfig->useSkia());
- m_xForceSkiaRaster->set_active(mpSkiaConfig->forceSkiaRaster());
+ m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get());
+ m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get());
+ m_xUseSkia->save_state();
+ m_xForceSkiaRaster->save_state();
m_xFontAntiAliasing->save_state();
m_xAAPointLimit->save_value();
m_xFontShowCB->save_state();
- m_xUseSkia->save_state();
- m_xForceSkiaRaster->save_state();
-
OnAntialiasingToggled(*m_xFontAntiAliasing);
UpdateSkiaStatus();
}
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 0944bb674932..07d3cca86fb7 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -28,10 +28,6 @@ namespace vcl {
class IconThemeInfo;
}
-namespace svt {
- class SkiaCfg;
-}
-
class OfaMiscTabPage : public SfxTabPage
{
private:
@@ -88,7 +84,6 @@ private:
std::unique_ptr<SvtTabAppearanceCfg> pAppearanceCfg;
std::unique_ptr<CanvasSettings> pCanvasSettings;
std::unique_ptr<SvtOptionsDrawinglayer> mpDrawinglayerOpt;
- std::unique_ptr<svt::SkiaCfg> mpSkiaConfig;
std::vector<vcl::IconThemeInfo> mInstalledIconThemes;