[Libreoffice-commits] core.git: cui/source cui/uiconfig include/unotools officecfg/registry sfx2/source sw/qa unotools/source uui/source xmlsecurity/qa xmlsecurity/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Mon May 18 16:19:48 UTC 2020


 cui/source/options/optsave.cxx                             |   10 ++++++----
 cui/uiconfig/ui/optsavepage.ui                             |    6 ++++--
 include/unotools/saveopt.hxx                               |    6 ++++--
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   10 ++++++++++
 sfx2/source/doc/objstor.cxx                                |    2 +-
 sw/qa/extras/fodfexport/fodfexport.cxx                     |    8 ++++----
 sw/qa/extras/odfexport/odfexport.cxx                       |    2 +-
 unotools/source/config/saveopt.cxx                         |    4 ++++
 uui/source/iahndl.cxx                                      |    2 +-
 xmlsecurity/qa/unit/signing/signing.cxx                    |   10 +++++-----
 xmlsecurity/source/component/documentdigitalsignatures.cxx |    2 +-
 11 files changed, 41 insertions(+), 21 deletions(-)

New commits:
commit a541cd91951eca15e40764244b34c72b347f9f26
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Apr 28 18:04:14 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon May 18 18:19:03 2020 +0200

    officecfg,unotools,cui: add ODF 1.2 Extended / ODF 1.3 versions
    
    ... to configuration and UI.
    
    The new default is ODF 1.3 Extended, which is now ODFVER_LATEST and
    stored as value "3" in configuration.
    
    Adapt a few places related to DocumentDigitalSignatures etc. to new
    default.
    
    Change-Id: I420da4f7787cc864c6bd88470d61b146b9399aa1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93177
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index c165a3f9478b..564fabb730f6 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -87,10 +87,12 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
     , m_xODFWarningFI(m_xBuilder->weld_widget("odfwarning_image"))
     , m_xODFWarningFT(m_xBuilder->weld_label("odfwarning_label"))
 {
-    m_xODFVersionLB->set_id(0, OUString::number(2         )); // 1.0/1.1
-    m_xODFVersionLB->set_id(1, OUString::number(4         )); // 1.2
-    m_xODFVersionLB->set_id(2, OUString::number(8         )); // 1.2 Extended (compatibility mode)
-    m_xODFVersionLB->set_id(3, OUString::number(0x7fffffff)); // 1.2 Extended (recommended)
+    m_xODFVersionLB->set_id(0, OUString::number(SvtSaveOptions::ODFVER_011)); // 1.0/1.1
+    m_xODFVersionLB->set_id(1, OUString::number(SvtSaveOptions::ODFVER_012)); // 1.2
+    m_xODFVersionLB->set_id(2, OUString::number(SvtSaveOptions::ODFVER_012_EXT_COMPAT)); // 1.2 Extended (compatibility mode)
+    m_xODFVersionLB->set_id(3, OUString::number(SvtSaveOptions::ODFVER_012_EXTENDED)); // 1.2 Extended
+    m_xODFVersionLB->set_id(4, OUString::number(SvtSaveOptions::ODFVER_013)); // 1.3
+    m_xODFVersionLB->set_id(5, OUString::number(SvtSaveOptions::ODFVER_LATEST)); // 1.3 Extended (recommended)
 
     m_xDocTypeLB->set_id(0, OUString::number(APP_WRITER)       );
     m_xDocTypeLB->set_id(1, OUString::number(APP_WRITER_WEB)   );
diff --git a/cui/uiconfig/ui/optsavepage.ui b/cui/uiconfig/ui/optsavepage.ui
index e9a090d45091..dccf9d948eba 100644
--- a/cui/uiconfig/ui/optsavepage.ui
+++ b/cui/uiconfig/ui/optsavepage.ui
@@ -288,7 +288,7 @@
                       <object class="GtkLabel" id="odfwarning_label">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes" context="optsavepage|odfwarning_label" comments="EN-US, the term 'extended' must not be translated.">Not using ODF 1.2 Extended may cause information to be lost.</property>
+                        <property name="label" translatable="yes" context="optsavepage|odfwarning_label" comments="EN-US, the term 'extended' must not be translated.">Not using ODF 1.3 Extended may cause information to be lost.</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -321,7 +321,9 @@
                       <item translatable="yes" context="optsavepage|odfversion">1.0/1.1</item>
                       <item translatable="yes" context="optsavepage|odfversion">1.2</item>
                       <item translatable="yes" context="optsavepage|odfversion">1.2 Extended (compatibility mode)</item>
-                      <item translatable="yes" context="optsavepage|odfversion">1.2 Extended (recommended)</item>
+                      <item translatable="yes" context="optsavepage|odfversion">1.2 Extended</item>
+                      <item translatable="yes" context="optsavepage|odfversion">1.3</item>
+                      <item translatable="yes" context="optsavepage|odfversion">1.3 Extended (recommended)</item>
                     </items>
                   </object>
                   <packing>
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 2f0460e21fbc..d1e8f32af12b 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -64,6 +64,8 @@ public:
         DO_NOT_USE = 3,         // Do not use this, only here for compatibility with pre OOo 3.2 configuration
         ODFVER_012 = 4,         // ODF 1.2
         ODFVER_012_EXT_COMPAT = 8, // ODF 1.2 extended, but with compatibility fallbacks
+        ODFVER_012_EXTENDED = 9, // ODF 1.2 extended
+        ODFVER_013 = 10,        // ODF 1.3
 
         ODFVER_LATEST = SAL_MAX_ENUM,      // ODF latest version with enhancements
     };
@@ -82,8 +84,8 @@ public:
         ODFSVER_FUTURE_EXTENDED = 1000 | ODFSVER_EXTENDED, ///< current extension, unknown future ODF version
 
         // The latest defined standard. Adapt when a new one is published.
-        ODFSVER_LATEST = ODFSVER_012,                   ///< @internal DO NOT USE in comparisons
-        ODFSVER_LATEST_EXTENDED = ODFSVER_012_EXTENDED  ///< @internal DO NOT USE in comparisons
+        ODFSVER_LATEST = ODFSVER_013,                   ///< @internal DO NOT USE in comparisons
+        ODFSVER_LATEST_EXTENDED = ODFSVER_013_EXTENDED  ///< @internal DO NOT USE in comparisons
     };
 
     SvtSaveOptions();
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 3f16090e118c..bbd4b89c176c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2499,6 +2499,16 @@
                 <desc>ODFVER_012_EXT_COMPAT</desc>
               </info>
             </enumeration>
+            <enumeration oor:value="9">
+              <info>
+                <desc>ODFVER_012_EXTENDED</desc>
+              </info>
+            </enumeration>
+            <enumeration oor:value="10">
+              <info>
+                <desc>ODFVER_013</desc>
+              </info>
+            </enumeration>
             <enumeration oor:value="3">
               <info>
                 <desc>ODFVER_LATEST</desc>
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 8e04639905ef..846e68700814 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -315,7 +315,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
         const_cast<SfxObjectShell*>( this )->SetError(ERRCODE_IO_GENERAL);
     }
 
-    SvtSaveOptions::ODFSaneDefaultVersion nDefVersion = SvtSaveOptions::ODFSVER_012;
+    SvtSaveOptions::ODFSaneDefaultVersion nDefVersion = SvtSaveOptions::ODFSVER_013;
     if (!utl::ConfigManager::IsFuzzing())
     {
         SvtSaveOptions aSaveOpt;
diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx
index 7e0e57ffb160..bdf7c679ea76 100644
--- a/sw/qa/extras/fodfexport/fodfexport.cxx
+++ b/sw/qa/extras/fodfexport/fodfexport.cxx
@@ -36,9 +36,9 @@ DECLARE_FODFEXPORT_TEST(testTdf113696, "tdf113696.odt")
     if (xmlDocUniquePtr pXmlDoc = parseExportedFile())
     {
         assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
-                             "draw:image[@loext:mime-type='image/x-vclgraphic']");
+                             "draw:image[@draw:mime-type='image/x-vclgraphic']");
         assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
-                             "draw:image[@loext:mime-type='image/png']");
+                             "draw:image[@draw:mime-type='image/png']");
     }
 }
 
@@ -51,9 +51,9 @@ DECLARE_FODFEXPORT_TEST(testTdf113696WriterImage, "tdf113696-writerimage.odt")
     if (xmlDocUniquePtr pXmlDoc = parseExportedFile())
     {
         assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
-                             "draw:image[@loext:mime-type='image/x-vclgraphic']");
+                             "draw:image[@draw:mime-type='image/x-vclgraphic']");
         assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/"
-                             "draw:image[@loext:mime-type='image/png']");
+                             "draw:image[@draw:mime-type='image/png']");
     }
 }
 
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 8c0cae715428..bc7780e8f742 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2113,7 +2113,7 @@ DECLARE_ODFEXPORT_TEST(testImageMimetype, "image-mimetype.odt")
     if (xmlDocUniquePtr pXmlDoc = parseExport("content.xml"))
     {
         // Original image (svg)
-        assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@loext:mime-type='image/svg+xml']");
+        assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p/draw:frame/draw:image[@draw:mime-type='image/svg+xml']");
     }
 }
 
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 6d6b39743eb9..d8f4d37dd790 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -955,6 +955,10 @@ SvtSaveOptions::ODFSaneDefaultVersion SvtSaveOptions::GetODFSaneDefaultVersion()
             return ODFSVER_012;
         case ODFVER_012_EXT_COMPAT:
             return ODFSVER_012_EXT_COMPAT;
+        case ODFVER_012_EXTENDED:
+            return ODFSVER_012_EXTENDED;
+        case ODFVER_013:
+            return ODFSVER_013;
     }
     return ODFSVER_LATEST_EXTENDED;
 }
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index f65a225558bc..14615bc9ca54 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -821,7 +821,7 @@ UUIInteractionHelper::handleRequest_impl(
                 handleMacroConfirmRequest(
                     aMacroConfirmRequest.DocumentURL,
                     aMacroConfirmRequest.DocumentStorage,
-                    !aMacroConfirmRequest.DocumentVersion.isEmpty() ? aMacroConfirmRequest.DocumentVersion : ODFVER_012_TEXT,
+                    !aMacroConfirmRequest.DocumentVersion.isEmpty() ? aMacroConfirmRequest.DocumentVersion : ODFVER_013_TEXT,
                     aMacroConfirmRequest.DocumentSignatureInformation,
                     rRequest->getContinuations());
                 return true;
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index f47f2c12da33..ed6e55e829d4 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -1076,14 +1076,14 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF)
 
     // the loaded document is a OTT with a valid macro signature
     assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES,
-                   SignatureState::OK, ODFVER_012_TEXT);
+                   SignatureState::OK, ODFVER_013_TEXT);
 
     // load saved ODT document
     createDoc(aTempFileSaveAsODT.GetURL());
 
     // the loaded document is a ODT with a macro signature
     assertDocument(CPPUNIT_SOURCELINE(), "writer8", SignatureState::NOSIGNATURES,
-                   SignatureState::OK, ODFVER_012_TEXT);
+                   SignatureState::OK, ODFVER_013_TEXT);
 
     // save as new OTT template
     utl::TempFile aTempFileSaveAsODT_OTT;
@@ -1110,7 +1110,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF)
 
     // the loaded document is a OTT with a valid macro signature
     assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES,
-                   SignatureState::OK, ODFVER_012_TEXT);
+                   SignatureState::OK, ODFVER_013_TEXT);
 }
 
 /// Test if a macro signature from an OTT 1.0 is dropped for ODT 1.2
@@ -1160,7 +1160,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature)
 
     // the loaded document is a 1.2 ODT without any signatures
     assertDocument(CPPUNIT_SOURCELINE(), "writer8", SignatureState::NOSIGNATURES,
-                   SignatureState::NOSIGNATURES, ODFVER_012_TEXT);
+                   SignatureState::NOSIGNATURES, ODFVER_013_TEXT);
 
     // load the template as-is to validate signatures
     mxComponent->dispose();
@@ -1198,7 +1198,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature)
 
     // the loaded document is a 1.2 OTT without any signatures
     assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES,
-                   SignatureState::NOSIGNATURES, ODFVER_012_TEXT);
+                   SignatureState::NOSIGNATURES, ODFVER_013_TEXT);
 }
 
 namespace
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 9a697d1f15f0..d149bf5e30b2 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -211,7 +211,7 @@ private:
 
 DocumentDigitalSignatures::DocumentDigitalSignatures( const Reference< XComponentContext >& rxCtx ):
     mxCtx(rxCtx),
-    m_sODFVersion(ODFVER_012_TEXT),
+    m_sODFVersion(ODFVER_013_TEXT),
     m_nArgumentsCount(0),
     m_bHasDocumentSignature(false)
 {


More information about the Libreoffice-commits mailing list