diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-12-19 16:16:36 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-12-19 21:58:02 +0100 |
commit | b74da08e556b7b001943f0288a61da53791d4dcf (patch) | |
tree | f49ba706cf30979eb90b91dfc9b56314595bbb63 | |
parent | 0b63b751b1cd29bb6d092ded9d864b4088e948fa (diff) |
Read some configuration items directly
...removing them from SvtSaveOptions
Change-Id: I922ec0f88872b1f2d99c6a55faad00143d944473
Reviewed-on: https://gerrit.libreoffice.org/46797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | include/unotools/saveopt.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/saveopt.cxx | 94 |
3 files changed, 13 insertions, 93 deletions
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx index 9b8a361b8f04..865ec73835cc 100644 --- a/include/unotools/saveopt.hxx +++ b/include/unotools/saveopt.hxx @@ -121,8 +121,6 @@ public: void SetSaveRelFSys( bool b ); bool IsSaveRelFSys() const; - bool IsSaveUnpacked() const; - void SetLoadUserSettings(bool b); bool IsLoadUserSettings() const; @@ -139,10 +137,6 @@ public: ODFDefaultVersion GetODFDefaultVersion() const; ODFSaneDefaultVersion GetODFSaneDefaultVersion() const; - bool IsUseSHA1InODF12() const; - - bool IsUseBlowfishInODF12() const; - bool IsReadOnly( EOption eOption ) const; }; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 5547c7ac51cc..68730d317740 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -368,8 +368,8 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { SvtSaveOptions aSaveOpt; nDefVersion = aSaveOpt.GetODFDefaultVersion(); - bUseSHA1InODF12 = aSaveOpt.IsUseSHA1InODF12(); - bUseBlowfishInODF12 = aSaveOpt.IsUseBlowfishInODF12(); + bUseSHA1InODF12 = officecfg::Office::Common::Save::ODF::UseSHA1InODF12::get(); + bUseBlowfishInODF12 = officecfg::Office::Common::Save::ODF::UseBlowfishInODF12::get(); } // the default values, that should be used for ODF1.1 and older formats @@ -2631,7 +2631,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const INetURLObject& aURL, const OUString return false; } - if (SfxItemState::SET != rItemSet.GetItemState(SID_UNPACK) && SvtSaveOptions().IsSaveUnpacked()) + if (SfxItemState::SET != rItemSet.GetItemState(SID_UNPACK) && officecfg::Office::Common::Save::Document::Unpacked::get()) rItemSet.Put(SfxBoolItem(SID_UNPACK, false)); OUString aTempFileURL; diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 657eb6563488..26608c5b0f04 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -64,12 +64,9 @@ class SvtSaveOptions_Impl : public utl::ConfigItem bSaveDocView, bSaveRelINet, bSaveRelFSys, - bSaveUnpacked, bDoPrettyPrinting, bWarnAlienFormat, - bLoadDocPrinter, - bUseSHA1InODF12, - bUseBlowfishInODF12; + bLoadDocPrinter; SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion; @@ -84,13 +81,10 @@ class SvtSaveOptions_Impl : public utl::ConfigItem bROSaveDocView, bROSaveRelINet, bROSaveRelFSys, - bROSaveUnpacked, bROWarnAlienFormat, bRODoPrettyPrinting, bROLoadDocPrinter, - bROODFDefaultVersion, - bROUseSHA1InODF12, - bROUseBlowfishInODF12; + bROODFDefaultVersion; virtual void ImplCommit() override; @@ -110,12 +104,9 @@ public: bool IsSaveDocView() const { return bSaveDocView; } bool IsSaveRelINet() const { return bSaveRelINet; } bool IsSaveRelFSys() const { return bSaveRelFSys; } - bool IsSaveUnpacked() const { return bSaveUnpacked; } bool IsPrettyPrintingEnabled( ) const { return bDoPrettyPrinting; } bool IsWarnAlienFormat() const { return bWarnAlienFormat; } bool IsLoadDocPrinter() const { return bLoadDocPrinter; } - bool IsUseSHA1InODF12() const { return bUseSHA1InODF12; } - bool IsUseBlowfishInODF12() const { return bUseBlowfishInODF12; } SvtSaveOptions::ODFDefaultVersion GetODFDefaultVersion() const { return eODFDefaultVersion; } @@ -339,16 +330,13 @@ bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) const #define PROMPT 5 #define EDITPROPERTY 6 #define SAVEVIEWINFO 7 -#define UNPACKED 8 -#define PRETTYPRINTING 9 -#define WARNALIENFORMAT 10 -#define LOADDOCPRINTER 11 -#define FILESYSTEM 12 -#define INTERNET 13 -#define SAVEWORKINGSET 14 -#define ODFDEFAULTVERSION 15 -#define USESHA1INODF12 16 -#define USEBLOWFISHINODF12 17 +#define PRETTYPRINTING 8 +#define WARNALIENFORMAT 9 +#define LOADDOCPRINTER 10 +#define FILESYSTEM 11 +#define INTERNET 12 +#define SAVEWORKINGSET 13 +#define ODFDEFAULTVERSION 14 Sequence< OUString > GetPropertyNames() { @@ -362,16 +350,13 @@ Sequence< OUString > GetPropertyNames() "Document/AutoSavePrompt", "Document/EditProperty", "Document/ViewInfo", - "Document/Unpacked", "Document/PrettyPrinting", "Document/WarnAlienFormat", "Document/LoadPrinter", "URL/FileSystem", "URL/Internet", "WorkingSet", - "ODF/DefaultVersion", - "ODF/UseSHA1InODF12", - "ODF/UseBlowfishInODF12" + "ODF/DefaultVersion" }; const int nCount = SAL_N_ELEMENTS( aPropNames ); @@ -396,12 +381,9 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() , bSaveDocView( false ) , bSaveRelINet( false ) , bSaveRelFSys( false ) - , bSaveUnpacked( false ) , bDoPrettyPrinting( false ) , bWarnAlienFormat( true ) , bLoadDocPrinter( true ) - , bUseSHA1InODF12( false ) - , bUseBlowfishInODF12( false ) , eODFDefaultVersion( SvtSaveOptions::ODFVER_LATEST ) , bROAutoSaveTime( CFG_READONLY_DEFAULT ) , bROUseUserData( CFG_READONLY_DEFAULT ) @@ -414,13 +396,10 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() , bROSaveDocView( CFG_READONLY_DEFAULT ) , bROSaveRelINet( CFG_READONLY_DEFAULT ) , bROSaveRelFSys( CFG_READONLY_DEFAULT ) - , bROSaveUnpacked( CFG_READONLY_DEFAULT ) , bROWarnAlienFormat( CFG_READONLY_DEFAULT ) , bRODoPrettyPrinting( CFG_READONLY_DEFAULT ) , bROLoadDocPrinter( CFG_READONLY_DEFAULT ) , bROODFDefaultVersion( CFG_READONLY_DEFAULT ) - , bROUseSHA1InODF12( CFG_READONLY_DEFAULT ) - , bROUseBlowfishInODF12( CFG_READONLY_DEFAULT ) { Sequence< OUString > aNames = GetPropertyNames(); Sequence< Any > aValues = GetProperties( aNames ); @@ -512,10 +491,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() bSaveRelINet = bTemp; bROSaveRelINet = pROStates[nProp]; break; - case UNPACKED : - bSaveUnpacked = bTemp; - bROSaveUnpacked = pROStates[nProp]; - break; case PRETTYPRINTING: bDoPrettyPrinting = bTemp; @@ -532,16 +507,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() bROLoadDocPrinter = pROStates[nProp]; break; - case USESHA1INODF12: - bUseSHA1InODF12 = bTemp; - bROUseSHA1InODF12 = pROStates[nProp]; - break; - - case USEBLOWFISHINODF12: - bUseBlowfishInODF12 = bTemp; - bROUseBlowfishInODF12 = pROStates[nProp]; - break; - default : SAL_WARN( "unotools.config", "invalid index to load a path" ); } @@ -669,14 +634,6 @@ void SvtSaveOptions_Impl::ImplCommit() ++nRealCount; } break; - case UNPACKED : - if (!bROSaveUnpacked) - { - pValues[nRealCount] <<= bSaveUnpacked; - pNames[nRealCount] = pOrgNames[i]; - ++nRealCount; - } - break; case PRETTYPRINTING: if (!bRODoPrettyPrinting) { @@ -709,22 +666,6 @@ void SvtSaveOptions_Impl::ImplCommit() ++nRealCount; } break; - case USESHA1INODF12: - if (!bROUseSHA1InODF12) - { - pValues[nRealCount] <<= bUseSHA1InODF12; - pNames[nRealCount] = pOrgNames[i]; - ++nRealCount; - } - break; - case USEBLOWFISHINODF12: - if (!bROUseBlowfishInODF12) - { - pValues[nRealCount] <<= bUseBlowfishInODF12; - pNames[nRealCount] = pOrgNames[i]; - ++nRealCount; - } - break; default: SAL_WARN( "unotools.config", "invalid index to save a path" ); @@ -934,11 +875,6 @@ bool SvtSaveOptions::IsSaveRelFSys() const return pImp->pSaveOpt->IsSaveRelFSys(); } -bool SvtSaveOptions::IsSaveUnpacked() const -{ - return pImp->pSaveOpt->IsSaveUnpacked(); -} - void SvtSaveOptions::SetLoadUserSettings(bool b) { pImp->pLoadOpt->SetLoadUserSettings(b); @@ -1011,16 +947,6 @@ SvtSaveOptions::ODFSaneDefaultVersion SvtSaveOptions::GetODFSaneDefaultVersion() return ODFSVER_LATEST_EXTENDED; } -bool SvtSaveOptions::IsUseSHA1InODF12() const -{ - return pImp->pSaveOpt->IsUseSHA1InODF12(); -} - -bool SvtSaveOptions::IsUseBlowfishInODF12() const -{ - return pImp->pSaveOpt->IsUseBlowfishInODF12(); -} - bool SvtSaveOptions::IsReadOnly( SvtSaveOptions::EOption eOption ) const { return pImp->pSaveOpt->IsReadOnly(eOption); |