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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 24 17:32:44 UTC 2021


 include/unotools/saveopt.hxx       |    4 ---
 sfx2/source/appl/appcfg.cxx        |    9 +++++--
 unotools/source/config/saveopt.cxx |   44 -------------------------------------
 3 files changed, 7 insertions(+), 50 deletions(-)

New commits:
commit 8690061b7d2d7c50ba96b40af4c4549fd9378b80
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 23 16:06:24 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 24 19:32:09 2021 +0200

    use officecfg to retrieve SaveWorkingSet
    
    Change-Id: I9f4e4c2caffa828670ddedb1c6fc324e28162b9d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119456
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 1420269f2fbf..4a7c21cac08a 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -37,7 +37,6 @@ public:
         AutoSave,
         AutoSavePrompt,
         DocInfSave,
-        SaveWorkingSet,
         WarnAlienFormat,
         LoadDocPrinter,
         OdfDefaultVersion,
@@ -108,9 +107,6 @@ public:
     void                    SetDocInfoSave(bool b);
     bool                IsDocInfoSave() const;
 
-    void                    SetSaveWorkingSet( bool b );
-    bool                IsSaveWorkingSet() const;
-
     void                    SetLoadUserSettings(bool b);
     bool                IsLoadUserSettings() const;
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index ae9b8c7a86fc..68faf7d0e75f 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -200,8 +200,9 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_ATTR_WORKINGSET :
                     {
                         bRet = true;
-                        if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveWorkingSet))
-                            if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet())))
+                        if (!officecfg::Office::Common::Save::WorkingSet::isReadOnly())
+                            if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ),
+                                    officecfg::Office::Common::Save::WorkingSet::get())))
                                 bRet = false;
                     }
                     break;
@@ -487,7 +488,9 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
     if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), true, &pItem))
     {
         DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr, "BoolItem expected");
-        aSaveOptions.SetSaveWorkingSet(static_cast<const SfxBoolItem *>(pItem)->GetValue());
+        officecfg::Office::Common::Save::WorkingSet::set(
+            static_cast<const SfxBoolItem *>(pItem)->GetValue(),
+            batch);
     }
 
     // Save window settings
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 5fac07ddc4e1..55979f50e982 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -65,7 +65,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
                                         bAutoSavePrompt,
                                         bUserAutoSave,
                                         bDocInfSave,
-                                        bSaveWorkingSet,
                                         bWarnAlienFormat,
                                         bLoadDocPrinter;
 
@@ -78,7 +77,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
                                         bROAutoSavePrompt,
                                         bROUserAutoSave,
                                         bRODocInfSave,
-                                        bROSaveWorkingSet,
                                         bROWarnAlienFormat,
                                         bROLoadDocPrinter,
                                         bROODFDefaultVersion;
@@ -97,7 +95,6 @@ public:
     bool                    IsAutoSavePrompt() const            { return bAutoSavePrompt; }
     bool                    IsUserAutoSave() const              { return bUserAutoSave; }
     bool                    IsDocInfoSave() const               { return bDocInfSave; }
-    bool                    IsSaveWorkingSet() const            { return bSaveWorkingSet;         }
     bool                IsWarnAlienFormat() const           { return bWarnAlienFormat; }
     bool                IsLoadDocPrinter() const            { return bLoadDocPrinter; }
 
@@ -111,7 +108,6 @@ public:
     void                    SetAutoSavePrompt( bool b );
     void                    SetUserAutoSave( bool b );
     void                    SetDocInfoSave( bool b );
-    void                    SetSaveWorkingSet( bool b );
     void                    SetWarnAlienFormat( bool _bDoPP );
     void                    SetLoadDocPrinter( bool bNew );
     void                    SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eNew );
@@ -187,15 +183,6 @@ void SvtSaveOptions_Impl::SetDocInfoSave(bool b)
     }
 }
 
-void SvtSaveOptions_Impl::SetSaveWorkingSet( bool b )
-{
-    if (!bROSaveWorkingSet && bSaveWorkingSet!=b)
-    {
-        bSaveWorkingSet = b;
-        SetModified();
-    }
-}
-
 void SvtSaveOptions_Impl::SetWarnAlienFormat( bool _bDoPP )
 {
     if (!bROWarnAlienFormat && bWarnAlienFormat!=_bDoPP)
@@ -249,9 +236,6 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
         case SvtSaveOptions::EOption::DocInfSave :
             bReadOnly = bRODocInfSave;
             break;
-        case SvtSaveOptions::EOption::SaveWorkingSet :
-            bReadOnly = bROSaveWorkingSet;
-            break;
         case SvtSaveOptions::EOption::WarnAlienFormat :
             bReadOnly = bROWarnAlienFormat;
             break;
@@ -274,8 +258,7 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
 #define EDITPROPERTY        6
 #define WARNALIENFORMAT     7
 #define LOADDOCPRINTER      8
-#define SAVEWORKINGSET      9
-#define ODFDEFAULTVERSION   10
+#define ODFDEFAULTVERSION   9
 
 static Sequence< OUString > GetPropertyNames()
 {
@@ -290,7 +273,6 @@ static Sequence< OUString > GetPropertyNames()
         "Document/EditProperty",
         "Document/WarnAlienFormat",
         "Document/LoadPrinter",
-        "WorkingSet",
         "ODF/DefaultVersion"
     };
 
@@ -312,7 +294,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
     , bAutoSavePrompt( false )
     , bUserAutoSave( false )
     , bDocInfSave( false )
-    , bSaveWorkingSet( false )
     , bWarnAlienFormat( true )
     , bLoadDocPrinter( true )
     , eODFDefaultVersion( SvtSaveOptions::ODFVER_LATEST )
@@ -323,7 +304,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
     , bROAutoSavePrompt( CFG_READONLY_DEFAULT )
     , bROUserAutoSave( CFG_READONLY_DEFAULT )
     , bRODocInfSave( CFG_READONLY_DEFAULT )
-    , bROSaveWorkingSet( CFG_READONLY_DEFAULT )
     , bROWarnAlienFormat( CFG_READONLY_DEFAULT )
     , bROLoadDocPrinter( CFG_READONLY_DEFAULT )
     , bROODFDefaultVersion( CFG_READONLY_DEFAULT )
@@ -402,10 +382,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
                                     bDocInfSave = bTemp;
                                     bRODocInfSave = pROStates[nProp];
                                     break;
-                                case SAVEWORKINGSET :
-                                    bSaveWorkingSet = bTemp;
-                                    bROSaveWorkingSet = pROStates[nProp];
-                                    break;
 
                                 case WARNALIENFORMAT:
                                     bWarnAlienFormat = bTemp;
@@ -512,14 +488,6 @@ void SvtSaveOptions_Impl::ImplCommit()
                     ++nRealCount;
                 }
                 break;
-            case SAVEWORKINGSET :
-                if (!bROSaveWorkingSet)
-                {
-                    pValues[nRealCount] <<= bSaveWorkingSet;
-                    pNames[nRealCount] = pOrgNames[i];
-                    ++nRealCount;
-                }
-                break;
             case WARNALIENFORMAT:
                 if (!bROWarnAlienFormat)
                 {
@@ -717,16 +685,6 @@ bool SvtSaveOptions::IsDocInfoSave() const
     return pImp->pSaveOpt->IsDocInfoSave();
 }
 
-void SvtSaveOptions::SetSaveWorkingSet( bool b )
-{
-    pImp->pSaveOpt->SetSaveWorkingSet( b );
-}
-
-bool SvtSaveOptions::IsSaveWorkingSet() const
-{
-    return pImp->pSaveOpt->IsSaveWorkingSet();
-}
-
 void SvtSaveOptions::SetLoadUserSettings(bool b)
 {
     pImp->pLoadOpt->SetLoadUserSettings(b);


More information about the Libreoffice-commits mailing list