From 9117fb44bc7bd6b8764911c731c84a9e5dcc37f0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 24 Jul 2021 22:18:46 +0200 Subject: use officecfg for help options Change-Id: I2d19541cff07bf8159715d8f32d771cbf201ece4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119475 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/options/optgdlg.cxx | 19 +++++-------------- cui/source/options/treeopt.cxx | 11 ++++++----- 2 files changed, 11 insertions(+), 19 deletions(-) (limited to 'cui') diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 9194219d2056..f1f46e144701 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -217,16 +216,11 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) bool bModified = false; std::shared_ptr batch(comphelper::ConfigurationChanges::create()); - SvtHelpOptions aHelpOptions; if ( m_xPopUpNoHelpCB->get_state_changed_from_saved() ) - { - auto xChanges = comphelper::ConfigurationChanges::create(); - officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::set(m_xPopUpNoHelpCB->get_active(), xChanges); - xChanges->commit(); - } + officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::set(m_xPopUpNoHelpCB->get_active(), batch); if ( m_xExtHelpCB->get_state_changed_from_saved() ) - aHelpOptions.SetExtendedHelp( m_xExtHelpCB->get_active() ); + officecfg::Office::Common::Help::ExtendedTip::set(m_xExtHelpCB->get_active(), batch); if ( m_xShowTipOfTheDay->get_state_changed_from_saved() ) { @@ -236,10 +230,7 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) if ( m_xFileDlgCB->get_state_changed_from_saved() ) { - std::shared_ptr< comphelper::ConfigurationChanges > xChanges( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::UseSystemFileDialog::set( !m_xFileDlgCB->get_active(), xChanges ); - xChanges->commit(); + officecfg::Office::Common::Misc::UseSystemFileDialog::set( !m_xFileDlgCB->get_active(), batch ); bModified = true; } @@ -287,8 +278,8 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) void OfaMiscTabPage::Reset( const SfxItemSet* rSet ) { - SvtHelpOptions aHelpOptions; - m_xExtHelpCB->set_active( aHelpOptions.IsHelpTips() && aHelpOptions.IsExtendedHelp() ); + m_xExtHelpCB->set_active( officecfg::Office::Common::Help::Tip::get() && + officecfg::Office::Common::Help::ExtendedTip::get() ); m_xExtHelpCB->save_state(); m_xPopUpNoHelpCB->set_active( officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::get() ); m_xPopUpNoHelpCB->save_state(); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 698196afe099..0d617a8d3552 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -90,7 +90,6 @@ #include #include #include -#include #include #include #include @@ -1223,10 +1222,12 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet } // evaluate help options - if ( SvtHelpOptions().IsHelpTips() != Help::IsQuickHelpEnabled() ) - SvtHelpOptions().IsHelpTips() ? Help::EnableQuickHelp() : Help::DisableQuickHelp(); - if ( SvtHelpOptions().IsExtendedHelp() != Help::IsBalloonHelpEnabled() ) - SvtHelpOptions().IsExtendedHelp() ? Help::EnableBalloonHelp() : Help::DisableBalloonHelp(); + bool bHelpTips = officecfg::Office::Common::Help::Tip::get(); + if ( bHelpTips != Help::IsQuickHelpEnabled() ) + bHelpTips ? Help::EnableQuickHelp() : Help::DisableQuickHelp(); + bool bExtendedHelp = officecfg::Office::Common::Help::ExtendedTip::get(); + if ( bExtendedHelp != Help::IsBalloonHelpEnabled() ) + bExtendedHelp ? Help::EnableBalloonHelp() : Help::DisableBalloonHelp(); batch->commit(); } -- cgit