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

Stephan Bergmann sbergman at redhat.com
Tue Dec 19 20:58:13 UTC 2017


 configure.ac                       |    2 
 include/unotools/saveopt.hxx       |    6 --
 sfx2/source/doc/objstor.cxx        |    6 +-
 unotools/source/config/saveopt.cxx |   94 +++----------------------------------
 4 files changed, 14 insertions(+), 94 deletions(-)

New commits:
commit b74da08e556b7b001943f0288a61da53791d4dcf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 19 16:16:36 2017 +0100

    Read some configuration items directly
    
    ...removing them from SvtSaveOptions
    
    Change-Id: I922ec0f88872b1f2d99c6a55faad00143d944473
    Reviewed-on: https://gerrit.libreoffice.org/46797
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

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);
commit 0b63b751b1cd29bb6d092ded9d864b4088e948fa
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 19 15:08:11 2017 +0100

    Remove unnecessary -Wunknown-pragmas
    
    ...which was added with 92dfa82d2d25f2acdee0a538bf15f1fac36c0ecf "adjust for
    upstreaming of warn_unused attribute" but appears to be unnecessary cargo-copy
    from bdb87236dcbc1187b15e1a457e130ff997b0949b "Fix pragma GCC diagnostic
    checks".  Both old GCC (e.g., 4.8.5) and Clang (e.g., 3.4.2) emit a -Wattributes
    warning/error here by default.
    
    Change-Id: I2fd81ac411000c4b851a77de432bf14eb1bc0d61
    Reviewed-on: https://gerrit.libreoffice.org/46796
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/configure.ac b/configure.ac
index 5addbb4a5319..0689111ae700 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5926,7 +5926,7 @@ if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
     AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
     AC_LANG_PUSH([C++])
     save_CXXFLAGS=$CXXFLAGS
-    CXXFLAGS="$CXXFLAGS -Werror -Wunknown-pragmas"
+    CXXFLAGS="$CXXFLAGS -Werror"
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
             struct __attribute__((warn_unused)) dummy {};
         ])], [


More information about the Libreoffice-commits mailing list