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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 24 16:05:05 UTC 2021


 cui/source/options/optsave.cxx     |    4 +--
 include/unotools/saveopt.hxx       |    4 ---
 sc/source/filter/excel/xeroot.cxx  |    4 ++-
 sfx2/source/appl/appcfg.cxx        |    9 ++++---
 sfx2/source/doc/docfile.cxx        |    3 --
 sw/source/filter/ww8/wrtw8esh.cxx  |    5 ++--
 unotools/source/config/saveopt.cxx |   46 +------------------------------------
 7 files changed, 17 insertions(+), 58 deletions(-)

New commits:
commit 10277e2be5b132ea52a64ed987c23050ac74d18c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 23 15:38:33 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 24 18:04:26 2021 +0200

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

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index f9055cd94b2f..317d6c625b1e 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -451,8 +451,8 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
     m_xRelativeFsysCB->set_active(officecfg::Office::Common::Save::URL::FileSystem::get());
     m_xRelativeFsysCB->set_sensitive(!officecfg::Office::Common::Save::URL::FileSystem::isReadOnly());
 
-    m_xRelativeInetCB->set_active(aSaveOpt.IsSaveRelINet());
-    m_xRelativeInetCB->set_sensitive(!aSaveOpt.IsReadOnly(SvtSaveOptions::EOption::SaveRelInet));
+    m_xRelativeInetCB->set_active(officecfg::Office::Common::Save::URL::Internet::get());
+    m_xRelativeInetCB->set_sensitive(!officecfg::Office::Common::Save::URL::Internet::isReadOnly());
 
     sal_Int32 nDefaultVersion = aSaveOpt.GetODFDefaultVersion();
     m_xODFVersionLB->set_active_id(OUString::number(nDefaultVersion));
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 774fa6fe62ff..1420269f2fbf 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -38,7 +38,6 @@ public:
         AutoSavePrompt,
         DocInfSave,
         SaveWorkingSet,
-        SaveRelInet,
         WarnAlienFormat,
         LoadDocPrinter,
         OdfDefaultVersion,
@@ -112,9 +111,6 @@ public:
     void                    SetSaveWorkingSet( bool b );
     bool                IsSaveWorkingSet() const;
 
-    void                    SetSaveRelINet( bool b );
-    bool                IsSaveRelINet() const;
-
     void                    SetLoadUserSettings(bool b);
     bool                IsLoadUserSettings() const;
 
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index 3bfca778f159..88fbe1297c9f 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -59,7 +59,9 @@ XclExpRootData::XclExpRootData( XclBiff eBiff, SfxMedium& rMedium,
     XclRootData( eBiff, rMedium, xRootStrg, rDoc, eTextEnc, true )
 {
     SvtSaveOptions aSaveOpt;
-    mbRelUrl = mrMedium.IsRemote() ? aSaveOpt.IsSaveRelINet() : officecfg::Office::Common::Save::URL::FileSystem::get();
+    mbRelUrl = mrMedium.IsRemote()
+        ? officecfg::Office::Common::Save::URL::Internet::get()
+        : officecfg::Office::Common::Save::URL::FileSystem::get();
     maStringBuf.setLength(0);
 }
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index c540a6059e76..ae9b8c7a86fc 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -257,8 +257,9 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_SAVEREL_INET :
                     {
                         bRet = true;
-                        if (!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveRelInet))
-                            if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), aSaveOptions.IsSaveRelINet() )))
+                        if (!officecfg::Office::Common::Save::URL::Internet::isReadOnly())
+                            if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ),
+                                            officecfg::Office::Common::Save::URL::Internet::get() )))
                                 bRet = false;
                     }
                     break;
@@ -527,7 +528,9 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
     if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), true, &pItem))
     {
         DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr, "BoolItem expected");
-        aSaveOptions.SetSaveRelINet(static_cast<const SfxBoolItem *>(pItem)->GetValue());
+        officecfg::Office::Common::Save::URL::Internet::set(
+            static_cast<const SfxBoolItem *>(pItem)->GetValue(),
+            batch);
     }
 
     // SaveRelFSys
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 9497d3a144b0..c8d1ab4bcc63 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -640,9 +640,8 @@ OUString SfxMedium::GetBaseURL( bool bForSaving )
 
     if ( bForSaving )
     {
-        SvtSaveOptions aOpt;
         bool bIsRemote = IsRemote();
-        if( (bIsRemote && !aOpt.IsSaveRelINet())
+        if( (bIsRemote && !officecfg::Office::Common::Save::URL::Internet::get())
             || (!pImpl->m_bRemote && !officecfg::Office::Common::Save::URL::FileSystem::get()) )
             return OUString();
     }
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7c77c9d6c7ac..38e9eb2554ad 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -104,11 +104,12 @@ using ::com::sun::star::drawing::XShape;
 
 bool SwBasicEscherEx::IsRelUrl() const
 {
-    SvtSaveOptions aSaveOpt;
     bool bRelUrl = false;
     SfxMedium * pMedium = rWrt.GetWriter().GetMedia();
     if ( pMedium )
-        bRelUrl = pMedium->IsRemote() ? aSaveOpt.IsSaveRelINet() : officecfg::Office::Common::Save::URL::FileSystem::get();
+        bRelUrl = pMedium->IsRemote()
+            ? officecfg::Office::Common::Save::URL::Internet::get()
+            : officecfg::Office::Common::Save::URL::FileSystem::get();
     return bRelUrl;
 }
 
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 234299dd61fd..5fac07ddc4e1 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -66,7 +66,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
                                         bUserAutoSave,
                                         bDocInfSave,
                                         bSaveWorkingSet,
-                                        bSaveRelINet,
                                         bWarnAlienFormat,
                                         bLoadDocPrinter;
 
@@ -80,7 +79,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
                                         bROUserAutoSave,
                                         bRODocInfSave,
                                         bROSaveWorkingSet,
-                                        bROSaveRelINet,
                                         bROWarnAlienFormat,
                                         bROLoadDocPrinter,
                                         bROODFDefaultVersion;
@@ -100,7 +98,6 @@ public:
     bool                    IsUserAutoSave() const              { return bUserAutoSave; }
     bool                    IsDocInfoSave() const               { return bDocInfSave; }
     bool                    IsSaveWorkingSet() const            { return bSaveWorkingSet;         }
-    bool                    IsSaveRelINet() const               { return bSaveRelINet; }
     bool                IsWarnAlienFormat() const           { return bWarnAlienFormat; }
     bool                IsLoadDocPrinter() const            { return bLoadDocPrinter; }
 
@@ -115,7 +112,6 @@ public:
     void                    SetUserAutoSave( bool b );
     void                    SetDocInfoSave( bool b );
     void                    SetSaveWorkingSet( bool b );
-    void                    SetSaveRelINet( bool b );
     void                    SetWarnAlienFormat( bool _bDoPP );
     void                    SetLoadDocPrinter( bool bNew );
     void                    SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eNew );
@@ -200,15 +196,6 @@ void SvtSaveOptions_Impl::SetSaveWorkingSet( bool b )
     }
 }
 
-void SvtSaveOptions_Impl::SetSaveRelINet( bool b )
-{
-    if (!bROSaveRelINet && bSaveRelINet!=b)
-    {
-        bSaveRelINet = b;
-        SetModified();
-    }
-}
-
 void SvtSaveOptions_Impl::SetWarnAlienFormat( bool _bDoPP )
 {
     if (!bROWarnAlienFormat && bWarnAlienFormat!=_bDoPP)
@@ -265,9 +252,6 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
         case SvtSaveOptions::EOption::SaveWorkingSet :
             bReadOnly = bROSaveWorkingSet;
             break;
-        case SvtSaveOptions::EOption::SaveRelInet :
-            bReadOnly = bROSaveRelINet;
-            break;
         case SvtSaveOptions::EOption::WarnAlienFormat :
             bReadOnly = bROWarnAlienFormat;
             break;
@@ -290,9 +274,8 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const
 #define EDITPROPERTY        6
 #define WARNALIENFORMAT     7
 #define LOADDOCPRINTER      8
-#define INTERNET            9
-#define SAVEWORKINGSET      10
-#define ODFDEFAULTVERSION   11
+#define SAVEWORKINGSET      9
+#define ODFDEFAULTVERSION   10
 
 static Sequence< OUString > GetPropertyNames()
 {
@@ -307,7 +290,6 @@ static Sequence< OUString > GetPropertyNames()
         "Document/EditProperty",
         "Document/WarnAlienFormat",
         "Document/LoadPrinter",
-        "URL/Internet",
         "WorkingSet",
         "ODF/DefaultVersion"
     };
@@ -331,7 +313,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
     , bUserAutoSave( false )
     , bDocInfSave( false )
     , bSaveWorkingSet( false )
-    , bSaveRelINet( false )
     , bWarnAlienFormat( true )
     , bLoadDocPrinter( true )
     , eODFDefaultVersion( SvtSaveOptions::ODFVER_LATEST )
@@ -343,7 +324,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
     , bROUserAutoSave( CFG_READONLY_DEFAULT )
     , bRODocInfSave( CFG_READONLY_DEFAULT )
     , bROSaveWorkingSet( CFG_READONLY_DEFAULT )
-    , bROSaveRelINet( CFG_READONLY_DEFAULT )
     , bROWarnAlienFormat( CFG_READONLY_DEFAULT )
     , bROLoadDocPrinter( CFG_READONLY_DEFAULT )
     , bROODFDefaultVersion( CFG_READONLY_DEFAULT )
@@ -426,10 +406,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
                                     bSaveWorkingSet = bTemp;
                                     bROSaveWorkingSet = pROStates[nProp];
                                     break;
-                                case INTERNET :
-                                    bSaveRelINet = bTemp;
-                                    bROSaveRelINet = pROStates[nProp];
-                                    break;
 
                                 case WARNALIENFORMAT:
                                     bWarnAlienFormat = bTemp;
@@ -544,14 +520,6 @@ void SvtSaveOptions_Impl::ImplCommit()
                     ++nRealCount;
                 }
                 break;
-            case INTERNET :
-                if (!bROSaveRelINet)
-                {
-                    pValues[nRealCount] <<= bSaveRelINet;
-                    pNames[nRealCount] = pOrgNames[i];
-                    ++nRealCount;
-                }
-                break;
             case WARNALIENFORMAT:
                 if (!bROWarnAlienFormat)
                 {
@@ -759,16 +727,6 @@ bool SvtSaveOptions::IsSaveWorkingSet() const
     return pImp->pSaveOpt->IsSaveWorkingSet();
 }
 
-void SvtSaveOptions::SetSaveRelINet( bool b )
-{
-    pImp->pSaveOpt->SetSaveRelINet( b );
-}
-
-bool SvtSaveOptions::IsSaveRelINet() const
-{
-    return pImp->pSaveOpt->IsSaveRelINet();
-}
-
 void SvtSaveOptions::SetLoadUserSettings(bool b)
 {
     pImp->pLoadOpt->SetLoadUserSettings(b);


More information about the Libreoffice-commits mailing list