[Libreoffice-commits] core.git: framework/source include/svtools sfx2/source svtools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 23 12:01:57 UTC 2021
framework/source/uielement/toolbarmanager.cxx | 4 -
framework/source/uielement/toolbarmodemenucontroller.cxx | 2
framework/source/uielement/toolbarsmenucontroller.cxx | 3 -
include/svtools/miscopt.hxx | 2
sfx2/source/appl/appserv.cxx | 2
sfx2/source/sidebar/SidebarToolBox.cxx | 3 -
svtools/source/config/miscopt.cxx | 32 ---------------
7 files changed, 10 insertions(+), 38 deletions(-)
New commits:
commit 252e403213bf2a1c1b1f7b07f1dd647b450cb312
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 23 10:11:06 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 23 14:01:23 2021 +0200
use officecfg to retrieve DisableUICustomization
Change-Id: I87b3019c8e10eb2453746340beea4c4623dc65e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119400
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index e85de886b442..00bf67de463b 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -729,7 +729,7 @@ void ToolBarManager::RefreshImages()
void ToolBarManager::UpdateControllers()
{
- if( SvtMiscOptions().DisableUICustomization() )
+ if( officecfg::Office::Common::Misc::DisableUICustomization::get() )
{
Any a;
Reference< XLayoutManager > xLayoutManager;
@@ -1947,7 +1947,7 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const * pToolBar)
else
pMenu->EnableItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false);
- if (SvtMiscOptions().DisableUICustomization())
+ if (officecfg::Office::Common::Misc::DisableUICustomization::get())
{
pMenu->EnableItem(MENUITEM_TOOLBAR_VISIBLEBUTTON, false);
pMenu->EnableItem(MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, false);
diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx b/framework/source/uielement/toolbarmodemenucontroller.cxx
index cd6f2716a23a..dfe2e4ff4378 100644
--- a/framework/source/uielement/toolbarmodemenucontroller.cxx
+++ b/framework/source/uielement/toolbarmodemenucontroller.cxx
@@ -84,7 +84,7 @@ ToolbarModeMenuController::~ToolbarModeMenuController()
void ToolbarModeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu )
{
- if ( SvtMiscOptions().DisableUICustomization() )
+ if ( officecfg::Office::Common::Misc::DisableUICustomization::get() )
return;
SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 83816bc64bdb..c67dab5f2856 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/ui/theWindowStateConfiguration.hpp>
+#include <officecfg/Office/Common.hxx>
#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
#include <vcl/image.hxx>
@@ -300,7 +301,7 @@ Sequence< Sequence< css::beans::PropertyValue > > ToolbarsMenuController::getLay
void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const & rPopupMenu )
{
- if( SvtMiscOptions().DisableUICustomization() )
+ if( officecfg::Office::Common::Misc::DisableUICustomization::get() )
return;
SolarMutexGuard aSolarMutexGuard;
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index 0300cb3eca02..e408fb8b747d 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -54,8 +54,6 @@ class SVT_DLLPUBLIC SvtMiscOptions final : public utl::detail::Options
void AddListenerLink( const Link<LinkParamNone*,void>& rLink );
void RemoveListenerLink( const Link<LinkParamNone*,void>& rLink );
- bool DisableUICustomization() const;
-
sal_Int16 GetSymbolsSize() const;
void SetSymbolsSize( sal_Int16 eSet );
ToolBoxButtonSize GetSidebarIconSize() const;
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 6693eb56892a..e61cd7f510df 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1108,7 +1108,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
case SID_CONFIGACCEL:
case SID_CONFIGEVENT:
{
- if( SvtMiscOptions().DisableUICustomization() )
+ if( officecfg::Office::Common::Misc::DisableUICustomization::get() )
rSet.DisableItem(nWhich);
break;
}
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index dc9bdcedd07d..bcdd31a7d17d 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -21,6 +21,7 @@
#include <sidebar/ControllerFactory.hxx>
#include <sfx2/viewfrm.hxx>
+#include <officecfg/Office/Common.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
@@ -301,7 +302,7 @@ public:
virtual ToolBoxButtonSize GetDefaultButtonSize() const override
{
- return SvtMiscOptions().GetNotebookbarIconSize();
+ return static_cast<ToolBoxButtonSize>(officecfg::Office::Common::Misc::NotebookbarIconSize::get());
}
};
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 96edcd27908c..4e72e97a289d 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -47,12 +47,10 @@ using namespace ::com::sun::star;
#define PROPERTYHANDLE_SYMBOLSET 0
#define PROPERTYNAME_ICONTHEME "SymbolStyle"
#define PROPERTYHANDLE_SYMBOLSTYLE 1
-#define PROPERTYNAME_DISABLEUICUSTOMIZATION "DisableUICustomization"
-#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION 2
#define PROPERTYNAME_SIDEBARICONSIZE "SidebarIconSize"
-#define PROPERTYHANDLE_SIDEBARICONSIZE 3
+#define PROPERTYHANDLE_SIDEBARICONSIZE 2
#define PROPERTYNAME_NOTEBOOKBARICONSIZE "NotebookbarIconSize"
-#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE 4
+#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE 3
class SvtMiscOptions_Impl : public ConfigItem
{
@@ -65,7 +63,6 @@ private:
ToolBoxButtonSize m_nNotebookbarIconSize;
bool m_bIsNotebookbarIconSizeRO;
bool m_bIsSymbolsStyleRO;
- bool m_bDisableUICustomization;
bool m_bIconThemeWasSetAutomatically;
virtual void ImplCommit() override;
@@ -96,9 +93,6 @@ public:
// public interface
- bool DisableUICustomization() const
- { return m_bDisableUICustomization; }
-
sal_Int16 GetSymbolsSize() const
{ return m_nSymbolsSize; }
@@ -237,12 +231,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
break;
}
- case PROPERTYHANDLE_DISABLEUICUSTOMIZATION :
- {
- if( !(seqValues[nProperty] >>= m_bDisableUICustomization) )
- OSL_FAIL("Wrong type of \"Misc\\DisableUICustomization\"!" );
- break;
- }
}
}
@@ -310,11 +298,6 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames )
OSL_FAIL("Wrong type of \"Misc\\SymbolStyle\"!" );
}
break;
- case PROPERTYHANDLE_DISABLEUICUSTOMIZATION : {
- if( !(seqValues[nProperty] >>= m_bDisableUICustomization) )
- OSL_FAIL("Wrong type of \"Misc\\DisableUICustomization\"!" );
- }
- break;
}
}
}
@@ -445,11 +428,6 @@ void SvtMiscOptions_Impl::ImplCommit()
break;
}
- case PROPERTYHANDLE_DISABLEUICUSTOMIZATION :
- {
- seqValues[nProperty] <<= m_bDisableUICustomization;
- break;
- }
}
}
// Set properties in configuration.
@@ -465,7 +443,6 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
{
PROPERTYNAME_SYMBOLSET,
PROPERTYNAME_ICONTHEME,
- PROPERTYNAME_DISABLEUICUSTOMIZATION,
PROPERTYNAME_SIDEBARICONSIZE,
PROPERTYNAME_NOTEBOOKBARICONSIZE
};
@@ -565,11 +542,6 @@ void SvtMiscOptions::SetIconTheme(const OUString& iconTheme)
m_pImpl->SetIconTheme(iconTheme, SvtMiscOptions_Impl::SetModifiedFlag::SET);
}
-bool SvtMiscOptions::DisableUICustomization() const
-{
- return m_pImpl->DisableUICustomization();
-}
-
namespace
{
class theSvtMiscOptionsMutex :
More information about the Libreoffice-commits
mailing list