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 --- sfx2/inc/pch/precompiled_sfx.hxx | 1 - sfx2/source/appl/app.cxx | 8 +++++--- sfx2/source/appl/appcfg.cxx | 15 ++++++++------- sfx2/source/appl/appserv.cxx | 9 ++++++--- sfx2/source/appl/sfxhelp.cxx | 1 - sfx2/source/inc/appdata.hxx | 1 - 6 files changed, 19 insertions(+), 16 deletions(-) (limited to 'sfx2') diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index b60b8ec2945e..fc1d910d520e 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -335,7 +335,6 @@ #include #include #include -#include #include #include #include diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index e410902ccdb7..0dd179a065cd 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include @@ -129,11 +129,13 @@ SfxApplication* SfxApplication::GetOrCreate() ::framework::SetIsDockingWindowVisible( IsDockingWindowVisible ); #if HAVE_FEATURE_XMLHELP Application::SetHelp( pSfxHelp ); - if (!utl::ConfigManager::IsFuzzing() && SvtHelpOptions().IsHelpTips()) + bool bHelpTip = officecfg::Office::Common::Help::Tip::get(); + bool bExtendedHelpTip = officecfg::Office::Common::Help::ExtendedTip::get(); + if (!utl::ConfigManager::IsFuzzing() && bHelpTip) Help::EnableQuickHelp(); else Help::DisableQuickHelp(); - if (!utl::ConfigManager::IsFuzzing() && SvtHelpOptions().IsHelpTips() && SvtHelpOptions().IsExtendedHelp()) + if (!utl::ConfigManager::IsFuzzing() && bHelpTip && bExtendedHelpTip) Help::EnableBalloonHelp(); else Help::DisableBalloonHelp(); diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 4a5913bbe4b7..2b95176869d5 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -117,7 +116,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) const WhichRangesContainer& pRanges = rSet.GetRanges(); SvtSaveOptions aSaveOptions; - SvtHelpOptions aHelpOptions; SvtSecurityOptions aSecurityOptions; SvtMiscOptions aMiscOptions; @@ -224,12 +222,12 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) break; case SID_HELPBALLOONS : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ), - aHelpOptions.IsExtendedHelp() ) ) ) + officecfg::Office::Common::Help::ExtendedTip::get() ) ) ) bRet = true; break; case SID_HELPTIPS : if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ), - aHelpOptions.IsHelpTips() ) ) ) + officecfg::Office::Common::Help::Tip::get() ) ) ) bRet = true; break; case SID_HELP_STYLESHEET : @@ -410,7 +408,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) SfxItemPool &rPool = GetPool(); SvtSaveOptions aSaveOptions; - SvtHelpOptions aHelpOptions; SvtSecurityOptions aSecurityOptions; SvtMiscOptions aMiscOptions; std::shared_ptr< comphelper::ConfigurationChanges > batch( @@ -526,14 +523,18 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); - aHelpOptions.SetExtendedHelp(static_cast(pItem)->GetValue()); + officecfg::Office::Common::Help::ExtendedTip::set( + static_cast(pItem)->GetValue(), + batch); } // HelpTips if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); - aHelpOptions.SetHelpTips( static_cast(pItem)->GetValue()); + officecfg::Office::Common::Help::Tip::set( + static_cast(pItem)->GetValue(), + batch); } if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), true, &pItem)) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index e61cd7f510df..b0e08c424563 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -67,7 +67,6 @@ #include #include -#include #include #include @@ -578,7 +577,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help::EnableQuickHelp(); else Help::DisableQuickHelp(); - SvtHelpOptions().SetHelpTips( bOn ); + auto xChanges = comphelper::ConfigurationChanges::create(); + officecfg::Office::Common::Help::Tip::set(bOn, xChanges); + xChanges->commit(); Invalidate(SID_HELPTIPS); bDone = true; @@ -605,7 +606,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help::EnableBalloonHelp(); else Help::DisableBalloonHelp(); - SvtHelpOptions().SetExtendedHelp( bOn ); + auto xChanges = comphelper::ConfigurationChanges::create(); + officecfg::Office::Common::Help::ExtendedTip::set(bOn, xChanges); + xChanges->commit(); Invalidate(SID_HELPBALLOONS); bDone = true; diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index df0543b15a21..b158062683e7 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index 0861ad69758f..8bea6e44b6a2 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -46,7 +46,6 @@ class SfxDdeTriggerTopic_Impl; class SfxDocumentTemplates; class SfxFrame; class SvtSaveOptions; -class SvtHelpOptions; class SfxViewFrame; class SfxSlotPool; class SfxDispatcher; -- cgit