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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 2 06:26:36 UTC 2020


 cui/source/options/optjava.cxx    |   11 +++++------
 include/svtools/miscopt.hxx       |    3 ---
 sfx2/source/view/viewfrm.cxx      |    5 +++--
 svtools/source/config/miscopt.cxx |   36 ++----------------------------------
 4 files changed, 10 insertions(+), 45 deletions(-)

New commits:
commit 0f3a8a972421aa440f4276b92463a481e5cd4267
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 31 19:49:13 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Nov 2 07:25:54 2020 +0100

    use officecfg or MacroRecorderMode
    
    Change-Id: I2a8d4f401ddfd4368a7b50b4c3c8a72724f9afa3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105154
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 3072fb71b757..ed695295b583 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -32,7 +32,6 @@
 
 #include <officecfg/Office/Common.hxx>
 #include <osl/file.hxx>
-#include <svtools/miscopt.hxx>
 
 #include <strings.hrc>
 #include <vcl/svapp.hxx>
@@ -482,8 +481,10 @@ bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
 
     if ( m_xMacroCB->get_state_changed_from_saved() )
     {
-        SvtMiscOptions aMiscOpt;
-        aMiscOpt.SetMacroRecorderMode(m_xMacroCB->get_active());
+        std::shared_ptr< comphelper::ConfigurationChanges > xChanges(
+                comphelper::ConfigurationChanges::create());
+        officecfg::Office::Common::Misc::MacroRecorderMode::set( m_xMacroCB->get_active(), xChanges );
+        xChanges->commit();
         bModified = true;
     }
 
@@ -561,8 +562,6 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet* /*rSet*/ )
     ClearJavaInfo();
     m_xJavaList->clear();
 
-    SvtMiscOptions aMiscOpt;
-
 #if HAVE_FEATURE_JAVA
     bool bEnabled = false;
     javaFrameworkError eErr = jfw_getEnabled( &bEnabled );
@@ -586,7 +585,7 @@ void SvxJavaOptionsPage::Reset( const SfxItemSet* /*rSet*/ )
 
     m_xExperimentalCB->set_active( officecfg::Office::Common::Misc::ExperimentalMode::get() );
     m_xExperimentalCB->save_state();
-    m_xMacroCB->set_active(aMiscOpt.IsMacroRecorderMode());
+    m_xMacroCB->set_active( officecfg::Office::Common::Misc::MacroRecorderMode::get() );
     m_xMacroCB->save_state();
 
     m_aResetIdle.Start();
diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index f2902de1a4a3..a295aca97c0f 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -73,9 +73,6 @@ class SVT_DLLPUBLIC SvtMiscOptions final : public utl::detail::Options
         sal_Int16   GetToolboxStyle() const;
         void        SetToolboxStyle( sal_Int16 nStyle );
 
-        void        SetMacroRecorderMode( bool bSet );
-        bool        IsMacroRecorderMode() const;
-
     private:
 
         /*-****************************************************************************************************
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 76b8db3754b5..3076c58ea033 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3006,7 +3006,8 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
                     SvtMiscOptions aMiscOptions;
                     const OUString& sName{GetObjectShell()->GetFactory().GetFactoryName()};
                     bool bMacrosDisabled = officecfg::Office::Common::Security::Scripting::DisableMacrosExecution::get();
-                    if (bMacrosDisabled || !aMiscOptions.IsMacroRecorderMode() ||
+                    if (bMacrosDisabled ||
+                         !officecfg::Office::Common::Misc::MacroRecorderMode::get() ||
                          ( sName!="swriter" && sName!="scalc" ) )
                     {
                         rSet.DisableItem( nWhich );
@@ -3031,7 +3032,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
                 {
                     SvtMiscOptions aMiscOptions;
                     const OUString& sName{GetObjectShell()->GetFactory().GetFactoryName()};
-                    if ( !aMiscOptions.IsMacroRecorderMode() ||
+                    if ( !officecfg::Office::Common::Misc::MacroRecorderMode::get() ||
                          ( sName!="swriter" && sName!="scalc" ) )
                     {
                         rSet.DisableItem( nWhich );
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx
index 3390cba46229..09cbfb832dcd 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -52,12 +52,10 @@ using namespace ::com::sun::star;
 #define PROPERTYHANDLE_SYMBOLSTYLE              2
 #define PROPERTYNAME_DISABLEUICUSTOMIZATION "DisableUICustomization"
 #define PROPERTYHANDLE_DISABLEUICUSTOMIZATION   3
-#define PROPERTYNAME_MACRORECORDERMODE       "MacroRecorderMode"
-#define PROPERTYHANDLE_MACRORECORDERMODE        4
 #define PROPERTYNAME_SIDEBARICONSIZE        "SidebarIconSize"
-#define PROPERTYHANDLE_SIDEBARICONSIZE          5
+#define PROPERTYHANDLE_SIDEBARICONSIZE          4
 #define PROPERTYNAME_NOTEBOOKBARICONSIZE    "NotebookbarIconSize"
-#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE      6
+#define PROPERTYHANDLE_NOTEBOOKBARICONSIZE      5
 
 class SvtMiscOptions_Impl : public ConfigItem
 {
@@ -73,7 +71,6 @@ private:
     sal_Int16   m_nToolboxStyle;
     bool        m_bIsToolboxStyleRO;
     bool        m_bDisableUICustomization;
-    bool        m_bMacroRecorderMode;
     bool        m_bIconThemeWasSetAutomatically;
 
         virtual void ImplCommit() override;
@@ -107,12 +104,6 @@ public:
         bool DisableUICustomization() const
         { return m_bDisableUICustomization; }
 
-        void SetMacroRecorderMode( bool bSet )
-        { m_bMacroRecorderMode = bSet; SetModified(); }
-
-        bool IsMacroRecorderMode() const
-        { return m_bMacroRecorderMode; }
-
         sal_Int16 GetSymbolsSize() const
         { return m_nSymbolsSize; }
 
@@ -193,7 +184,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
     , m_bIsSymbolsStyleRO( false )
     , m_nToolboxStyle( 1 )
     , m_bIsToolboxStyleRO( false )
-    , m_bMacroRecorderMode( false )
     , m_bIconThemeWasSetAutomatically( false )
 {
     // Use our static list of configuration keys to get his values.
@@ -277,12 +267,6 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
                     OSL_FAIL("Wrong type of \"Misc\\DisableUICustomization\"!" );
                 break;
             }
-            case PROPERTYHANDLE_MACRORECORDERMODE :
-            {
-                if( !(seqValues[nProperty] >>= m_bMacroRecorderMode) )
-                    OSL_FAIL("Wrong type of \"Misc\\MacroRecorderMode\"!" );
-                break;
-            }
         }
     }
 
@@ -511,11 +495,6 @@ void SvtMiscOptions_Impl::ImplCommit()
                 seqValues[nProperty] <<= m_bDisableUICustomization;
                 break;
             }
-            case PROPERTYHANDLE_MACRORECORDERMODE :
-            {
-                seqValues[nProperty] <<= m_bMacroRecorderMode;
-                break;
-            }
         }
     }
     // Set properties in configuration.
@@ -533,7 +512,6 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
         PROPERTYNAME_TOOLBOXSTYLE,
         PROPERTYNAME_ICONTHEME,
         PROPERTYNAME_DISABLEUICUSTOMIZATION,
-        PROPERTYNAME_MACRORECORDERMODE,
         PROPERTYNAME_SIDEBARICONSIZE,
         PROPERTYNAME_NOTEBOOKBARICONSIZE
     };
@@ -648,16 +626,6 @@ void SvtMiscOptions::SetToolboxStyle( sal_Int16 nStyle )
     m_pImpl->SetToolboxStyle( nStyle );
 }
 
-void SvtMiscOptions::SetMacroRecorderMode( bool bSet )
-{
-    m_pImpl->SetMacroRecorderMode( bSet );
-}
-
-bool SvtMiscOptions::IsMacroRecorderMode() const
-{
-    return m_pImpl->IsMacroRecorderMode();
-}
-
 namespace
 {
     class theSvtMiscOptionsMutex :


More information about the Libreoffice-commits mailing list