[Libreoffice-commits] core.git: include/svtools sfx2/source svtools/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 1 18:34:43 UTC 2020


 include/svtools/miscopt.hxx       |    2 -
 sfx2/source/doc/iframe.cxx        |    4 +-
 svtools/source/config/miscopt.cxx |   54 +++++---------------------------------
 3 files changed, 10 insertions(+), 50 deletions(-)

New commits:
commit f70f3a46b8de6397bbcc09e8b9c8be9451919ae1
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 31 18:04:35 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Nov 1 19:34:04 2020 +0100

    use officecfg for IsPluginsEnabled
    
    Change-Id: Id80ba8a87af7f87b8232949b70804b1a021b23d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105147
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index cbaf146f607e..90e3702a2838 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -57,8 +57,6 @@ class SVT_DLLPUBLIC SvtMiscOptions final : public utl::detail::Options
 
         bool        DisableUICustomization() const;
 
-        bool        IsPluginsEnabled() const;
-
         sal_Int16   GetSymbolsSize() const;
         void        SetSymbolsSize( sal_Int16 eSet );
         ToolBoxButtonSize   GetSidebarIconSize() const;
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index e74ccc353b63..e37607c91a46 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -35,7 +35,7 @@
 
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
-#include <svtools/miscopt.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <svl/itemprop.hxx>
 #include <sfx2/frmdescr.hxx>
 #include <sfx2/sfxdlg.hxx>
@@ -155,7 +155,7 @@ sal_Bool SAL_CALL IFrameObject::load(
     const uno::Sequence < css::beans::PropertyValue >& /*lDescriptor*/,
     const uno::Reference < frame::XFrame >& xFrame )
 {
-    if ( SvtMiscOptions().IsPluginsEnabled() )
+    if ( officecfg::Office::Common::Misc::PluginsEnabled::get() )
     {
         DBG_ASSERT( !mxFrame.is(), "Frame already existing!" );
         VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 592f05b5c4eb..fe216fe263e0 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -44,31 +44,27 @@ using namespace ::com::sun::star;
 #define ROOTNODE_MISC                       "Office.Common/Misc"
 
 // PROPERTYHANDLE defines must be sequential from zero for Commit/Load
-#define PROPERTYNAME_PLUGINSENABLED         "PluginsEnabled"
-#define PROPERTYHANDLE_PLUGINSENABLED           0
 #define PROPERTYNAME_SYMBOLSET              "SymbolSet"
-#define PROPERTYHANDLE_SYMBOLSET                1
+#define PROPERTYHANDLE_SYMBOLSET                0
 #define PROPERTYNAME_TOOLBOXSTYLE           "ToolboxStyle"
-#define PROPERTYHANDLE_TOOLBOXSTYLE             2
+#define PROPERTYHANDLE_TOOLBOXSTYLE             1
 #define PROPERTYNAME_ICONTHEME              "SymbolStyle"
-#define PROPERTYHANDLE_SYMBOLSTYLE              3
+#define PROPERTYHANDLE_SYMBOLSTYLE              2
 #define PROPERTYNAME_SHOWLINKWARNINGDIALOG  "ShowLinkWarningDialog"
-#define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG    4
+#define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG    3
 #define PROPERTYNAME_DISABLEUICUSTOMIZATION "DisableUICustomization"
-#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION   5
+#define PROPERTYHANDLE_DISABLEUICUSTOMIZATION   4
 #define PROPERTYNAME_MACRORECORDERMODE       "MacroRecorderMode"
-#define PROPERTYHANDLE_MACRORECORDERMODE        6
+#define PROPERTYHANDLE_MACRORECORDERMODE        5
 #define PROPERTYNAME_SIDEBARICONSIZE        "SidebarIconSize"
-#define PROPERTYHANDLE_SIDEBARICONSIZE          7
+#define PROPERTYHANDLE_SIDEBARICONSIZE          6
 #define PROPERTYNAME_NOTEBOOKBARICONSIZE    "NotebookbarIconSize"
-#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE      8
+#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE      7
 
 class SvtMiscOptions_Impl : public ConfigItem
 {
 private:
     ::std::vector<Link<LinkParamNone*,void>> aList;
-    bool        m_bPluginsEnabled;
-    bool        m_bIsPluginsEnabledRO;
     sal_Int16   m_nSymbolsSize;
     bool        m_bIsSymbolsSizeRO;
     ToolBoxButtonSize m_nSidebarIconSize;
@@ -121,9 +117,6 @@ public:
         bool IsMacroRecorderMode() const
         { return m_bMacroRecorderMode; }
 
-        bool IsPluginsEnabled() const
-        { return m_bPluginsEnabled; }
-
         sal_Int16 GetSymbolsSize() const
         { return m_nSymbolsSize; }
 
@@ -204,8 +197,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
     // Init baseclasses first
     : ConfigItem( ROOTNODE_MISC )
 
-    , m_bPluginsEnabled( false )
-    , m_bIsPluginsEnabledRO( false )
     , m_nSymbolsSize( 0 )
     , m_bIsSymbolsSizeRO( false )
     , m_nSidebarIconSize( ToolBoxButtonSize::DontCare )
@@ -239,16 +230,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
             continue;
         switch( nProperty )
         {
-            case PROPERTYHANDLE_PLUGINSENABLED :
-            {
-                if( !(seqValues[nProperty] >>= m_bPluginsEnabled) )
-                {
-                    OSL_FAIL("Wrong type of \"Misc\\PluginsEnabled\"!" );
-                }
-                m_bIsPluginsEnabledRO = seqRO[nProperty];
-                break;
-            }
-
             case PROPERTYHANDLE_SYMBOLSET :
             {
                 if( !(seqValues[nProperty] >>= m_nSymbolsSize) )
@@ -361,13 +342,6 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames )
             continue;
         switch( comphelper::findValue(aInternalPropertyNames, rPropertyNames[nProperty]) )
         {
-            case PROPERTYHANDLE_PLUGINSENABLED      :   {
-                                                            if( !(seqValues[nProperty] >>= m_bPluginsEnabled) )
-                                                            {
-                                                                OSL_FAIL("Wrong type of \"Misc\\PluginsEnabled\"!" );
-                                                            }
-                                                        }
-                                                    break;
             case PROPERTYHANDLE_SYMBOLSET           :   {
                                                             if( !(seqValues[nProperty] >>= m_nSymbolsSize) )
                                                             {
@@ -521,13 +495,6 @@ void SvtMiscOptions_Impl::ImplCommit()
     {
         switch( nProperty )
         {
-            case PROPERTYHANDLE_PLUGINSENABLED :
-            {
-                if ( !m_bIsPluginsEnabledRO )
-                    seqValues[nProperty] <<= m_bPluginsEnabled;
-                break;
-            }
-
             case PROPERTYHANDLE_SYMBOLSET :
             {
                 if ( !m_bIsSymbolsSizeRO )
@@ -601,7 +568,6 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
 {
     return Sequence<OUString>
     {
-        PROPERTYNAME_PLUGINSENABLED,
         PROPERTYNAME_SYMBOLSET,
         PROPERTYNAME_TOOLBOXSTYLE,
         PROPERTYNAME_ICONTHEME,
@@ -641,10 +607,6 @@ SvtMiscOptions::~SvtMiscOptions()
     m_pImpl.reset();
 }
 
-bool SvtMiscOptions::IsPluginsEnabled() const
-{
-    return m_pImpl->IsPluginsEnabled();
-}
 
 sal_Int16 SvtMiscOptions::GetSymbolsSize() const
 {


More information about the Libreoffice-commits mailing list