cui/source/options/optsave.cxx                             |    4 ++-
 cui/uiconfig/ui/optsavepage.ui                             |    8 ++++--
 include/unotools/saveopt.hxx                               |    8 ++++--
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   14 +++++++++--
 sfx2/source/doc/objstor.cxx                                |    2 -
 unotools/source/config/saveopt.cxx                         |    2 +
 xmloff/qa/unit/draw.cxx                                    |   16 ++++++-------
 xmloff/source/core/xmlexp.cxx                              |    1 
 xmlsecurity/qa/unit/signing/signing.cxx                    |    8 +++---
 xmlsecurity/qa/unit/signing/signing2.cxx                   |   10 ++++----
 xmlsecurity/source/component/documentdigitalsignatures.cxx |    2 -
 11 files changed, 47 insertions(+), 28 deletions(-)

New commits:
commit c6f9d381d395a7573fc0c1eba4b73b0fdf50f047
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Oct 1 13:10:49 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Oct 2 08:57:38 2024 +0200

    Add ODF 1.3 Extended / ODF 1.4 versions to configuration and UI
    
    The new default is ODF 1.4 Extended
    
    Change-Id: I50f60cccde81b5ea320478314482cc67a7bcc2e4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174343
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 63106cb923ef..77397dcefc6b 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -117,7 +117,9 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, 
weld::DialogController* p
     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_xODFVersionLB->set_id(5, 
OUString::number(SvtSaveOptions::ODFVER_013_EXTENDED)); // 1.3 Extended
+    m_xODFVersionLB->set_id(6, OUString::number(SvtSaveOptions::ODFVER_014)); 
// 1.4
+    m_xODFVersionLB->set_id(7, 
OUString::number(SvtSaveOptions::ODFVER_LATEST)); // 1.4 Extended (recommended)
 
     auto aFilterClassesNode = 
utl::OConfigurationTreeRoot::createWithComponentContext(
             comphelper::getProcessComponentContext(),
diff --git a/cui/uiconfig/ui/optsavepage.ui b/cui/uiconfig/ui/optsavepage.ui
index 37378b17e141..fe1f858f1fbe 100644
--- a/cui/uiconfig/ui/optsavepage.ui
+++ b/cui/uiconfig/ui/optsavepage.ui
@@ -486,7 +486,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.3 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.4 Extended may cause information to be 
lost.</property>
                   </object>
                   <packing>
                     <property name="left-attach">1</property>
@@ -521,11 +521,13 @@
                   <item translatable="yes" 
context="optsavepage|odfversion">1.2 Extended (compatibility mode)</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>
+                  <item translatable="yes" 
context="optsavepage|odfversion">1.3 Extended</item>
+                  <item translatable="yes" 
context="optsavepage|odfversion">1.4</item>
+                  <item translatable="yes" 
context="optsavepage|odfversion">1.4 Extended (recommended)</item>
                 </items>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="odfversion-atkobject">
-                    <property name="AtkObject::accessible-description" 
translatable="yes" context="odfversion">Some companies or organizations may 
require ODF documents in the ODF 1.0/1.1, or ODF 1.2 format. You can select 
these format to save in the listbox. These older formats cannot store all new 
features, so the new format ODF 1.3 (Extended) is recommended where 
possible.</property>
+                      <property name="AtkObject::accessible-description" 
translatable="yes" context="odfversion">Some companies or organizations may 
require ODF documents in the ODF 1.0/1.1/1.2 or ODF 1.3 format. You can select 
these format to save in the listbox. These older formats cannot store all new 
features, so the new format ODF 1.4 (Extended) is recommended where 
possible.</property>
                   </object>
                 </child>
               </object>
diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 222b4b78fe9f..39b5db38b21a 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -44,7 +44,8 @@ namespace SvtSaveOptions
         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_014 = 11,        // ODF 1.4
+        ODFVER_013_EXTENDED = 11, // ODF 1.3 extended
+        ODFVER_014 = 12,        // ODF 1.4
 
         ODFVER_LATEST = SAL_MAX_ENUM,      // ODF latest version with 
enhancements
     };
@@ -61,11 +62,12 @@ namespace SvtSaveOptions
         ODFSVER_013 = 12,           ///< ODF 1.3
         ODFSVER_013_EXTENDED = 13,  ///< ODF 1.3 extended
         ODFSVER_014 = 14,           ///< ODF 1.4
+        ODFSVER_014_EXTENDED = 15,  ///< ODF 1.4 extended
         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_013,                   ///< @internal DO NOT 
USE in comparisons
-        ODFSVER_LATEST_EXTENDED = ODFSVER_013_EXTENDED  ///< @internal DO NOT 
USE in comparisons
+        ODFSVER_LATEST = ODFSVER_014,                   ///< @internal DO NOT 
USE in comparisons
+        ODFSVER_LATEST_EXTENDED = ODFSVER_014_EXTENDED  ///< @internal DO NOT 
USE in comparisons
     };
 
 };
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index cd6f9de818d1..74d4be9d1d2d 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2235,6 +2235,16 @@
                 <desc>ODFVER_013</desc>
               </info>
             </enumeration>
+            <enumeration oor:value="11">
+              <info>
+                <desc>ODFVER_013_EXTENDED</desc>
+              </info>
+            </enumeration>
+            <enumeration oor:value="12">
+              <info>
+                <desc>ODFVER_014</desc>
+              </info>
+            </enumeration>
             <enumeration oor:value="3">
               <info>
                 <desc>ODFVER_LATEST</desc>
@@ -6094,9 +6104,9 @@
       <prop oor:name="AllowAnimatedOthers" oor:type="xs:short" 
oor:nillable="false">
         <!-- UIHints: Tools - Options - Accessibility Options -->
         <info>
-          <desc>Indicates whether to allow certain others animations 
+          <desc>Indicates whether to allow certain others animations
           (like "marching ants" animation when copying a cell in Calc)
-          in all SO/OO applications. 
+          in all SO/OO applications.
           Disabling animations makes a lot of sense on remote connections
           (VNC), where animations increase the (always limited) amount of
           bandwidth needed.</desc>
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index d4d39b03573c..17f34ec5ad88 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -327,7 +327,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< 
embed::XStorage >& xSto
         const_cast<SfxObjectShell*>( this )->SetError(ERRCODE_IO_GENERAL);
     }
 
-    SvtSaveOptions::ODFSaneDefaultVersion nDefVersion = 
SvtSaveOptions::ODFSVER_013;
+    SvtSaveOptions::ODFSaneDefaultVersion nDefVersion = 
SvtSaveOptions::ODFSVER_014;
     if (!comphelper::IsFuzzing())
     {
         nDefVersion = GetODFSaneDefaultVersion();
diff --git a/unotools/source/config/saveopt.cxx 
b/unotools/source/config/saveopt.cxx
index 7623d8acca35..1b63985b2ea4 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -84,6 +84,8 @@ SvtSaveOptions::ODFSaneDefaultVersion 
GetODFSaneDefaultVersion(SvtSaveOptions::O
             return SvtSaveOptions::ODFSVER_012_EXTENDED;
         case SvtSaveOptions::ODFVER_013:
             return SvtSaveOptions::ODFSVER_013;
+        case SvtSaveOptions::ODFVER_013_EXTENDED:
+            return SvtSaveOptions::ODFSVER_013_EXTENDED;
         case SvtSaveOptions::ODFVER_014:
             return SvtSaveOptions::ODFSVER_014;
     }
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index 1fa27f9789e3..ee1b59161587 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -530,6 +530,8 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionMetalTypeExtended)
     lcl_assertMetalProperties("from doc", xShape);
 
     // Test, that new attribute is written with loext namespace. Adapt when 
attribute is added to ODF.
+    const SvtSaveOptions::ODFDefaultVersion 
nCurrentODFVersion(GetODFDefaultVersion());
+    SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED);
     saveAndReload(u"writer8"_ustr);
 
     // assert XML.
@@ -542,6 +544,8 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionMetalTypeExtended)
     // verify properties
     uno::Reference<drawing::XShape> xShapeReload(getShape(0));
     lcl_assertMetalProperties("from ODF 1.3 extended", xShapeReload);
+
+    SetODFDefaultVersion(nCurrentODFVersion);
 }
 
 CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeStrict)
@@ -549,16 +553,12 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionMetalTypeStrict)
     loadFromFile(u"tdf145700_3D_metal_type_MSCompatible.doc");
 
     // save ODF 1.4 strict and test that new attribute is written.
-    const SvtSaveOptions::ODFDefaultVersion 
nCurrentODFVersion(GetODFDefaultVersion());
-    SetODFDefaultVersion(SvtSaveOptions::ODFVER_014);
     save(u"writer8"_ustr);
 
     // assert XML.
     xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr);
     assertXPath(pXmlDoc, "//draw:enhanced-geometry"_ostr, 
"extrusion-metal"_ostr, u"true"_ustr);
     assertXPath(pXmlDoc, 
"//draw:enhanced-geometry[@draw:extrusion-metal-type]"_ostr, 1);
-
-    SetODFDefaultVersion(nCurrentODFVersion);
 }
 
 namespace
@@ -589,6 +589,8 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionSpecularityExtended)
 
     // Test, that attribute is written in draw namespace with value 100% and 
in loext namespace with
     // value 122.0703125%.
+    const SvtSaveOptions::ODFDefaultVersion 
nCurrentODFVersion(GetODFDefaultVersion());
+    SetODFDefaultVersion(SvtSaveOptions::ODFVER_013_EXTENDED);
     saveAndReload(u"writer8"_ustr);
 
     // assert XML.
@@ -600,6 +602,8 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionSpecularityExtended)
     // verify properties
     uno::Reference<drawing::XShape> xShapeReload(getShape(0));
     lcl_assertSpecularityProperty("from ODF 1.3 extended", xShapeReload);
+
+    SetODFDefaultVersion(nCurrentODFVersion);
 }
 
 CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityStrict)
@@ -609,8 +613,6 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionSpecularityStrict)
     uno::Reference<drawing::XShape> xShape(getShape(0));
     lcl_assertSpecularityProperty("from doc", xShape);
 
-    const SvtSaveOptions::ODFDefaultVersion 
nCurrentODFVersion(GetODFDefaultVersion());
-    SetODFDefaultVersion(SvtSaveOptions::ODFVER_014);
     saveAndReload(u"writer8"_ustr);
 
     // assert XML.
@@ -621,8 +623,6 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, 
testExtrusionSpecularityStrict)
     // verify properties
     uno::Reference<drawing::XShape> xShapeReload(getShape(0));
     lcl_assertSpecularityProperty("from ODF 1.4", xShapeReload);
-
-    SetODFDefaultVersion(nCurrentODFVersion);
 }
 
 CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularity)
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index aecf57d1b9a9..d7defe3052be 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1212,6 +1212,7 @@ auto SvXMLExport::GetODFVersionAttributeValue() const -> 
char const*
     char const* pVersion(nullptr);
     switch (getSaneDefaultVersion())
     {
+    case SvtSaveOptions::ODFSVER_014_EXTENDED: [[fallthrough]];
     case SvtSaveOptions::ODFSVER_014: pVersion = "1.4"; break;
     case SvtSaveOptions::ODFSVER_013_EXTENDED: [[fallthrough]];
     case SvtSaveOptions::ODFSVER_013: pVersion = "1.3"; break;
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index e8b4a2f9653c..8aa2eb52d5ee 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -1399,7 +1399,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, 
testPreserveMacroTemplateSignature12_ODF)
 
         // the loaded document is a OTT/ODT with a macro signature
         assertDocument(CPPUNIT_SOURCELINE(), sFormat, 
SignatureState::NOSIGNATURES,
-                       SignatureState::OK, ODFVER_013_TEXT);
+                       SignatureState::OK, ODFVER_014_TEXT);
 
         // save as new OTT template
         save(u"writer8_template"_ustr);
@@ -1410,7 +1410,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, 
testPreserveMacroTemplateSignature12_ODF)
 
         // the loaded document is a OTT with a valid macro signature
         assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, 
SignatureState::NOSIGNATURES,
-                       SignatureState::OK, ODFVER_013_TEXT);
+                       SignatureState::OK, ODFVER_014_TEXT);
     }
 }
 
@@ -1441,7 +1441,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, 
testDropMacroTemplateSignature)
 
     // the loaded document is a 1.2 ODT without any signatures
     assertDocument(CPPUNIT_SOURCELINE(), u"writer8"_ustr, 
SignatureState::NOSIGNATURES,
-                   SignatureState::NOSIGNATURES, ODFVER_013_TEXT);
+                   SignatureState::NOSIGNATURES, ODFVER_014_TEXT);
 
     // load the template as-is to validate signatures
     loadWithParams(aURL, comphelper::InitPropertySequence({ { "AsTemplate", 
uno::Any(false) } }));
@@ -1459,7 +1459,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, 
testDropMacroTemplateSignature)
 
     // the loaded document is a 1.2 OTT without any signatures
     assertDocument(CPPUNIT_SOURCELINE(), u"writer8_template"_ustr, 
SignatureState::NOSIGNATURES,
-                   SignatureState::NOSIGNATURES, ODFVER_013_TEXT);
+                   SignatureState::NOSIGNATURES, ODFVER_014_TEXT);
 }
 
 /// Test if a macro signature from a OTT 1.0 template is preserved for ODT 1.0
diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx 
b/xmlsecurity/qa/unit/signing/signing2.cxx
index e4b7aa89f881..1fd6d19a32b1 100644
--- a/xmlsecurity/qa/unit/signing/signing2.cxx
+++ b/xmlsecurity/qa/unit/signing/signing2.cxx
@@ -176,7 +176,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODF13)
         // using Zip Storage means the encrypted streams are signed, so
         // after encrypting again the signature didn't match and was dropped
         //        assertDocument(CPPUNIT_SOURCELINE(), "writer8", 
SignatureState::NOSIGNATURES,
-        //                       SignatureState::OK, ODFVER_013_TEXT);
+        //                       SignatureState::OK, ODFVER_014_TEXT);
     }
 
     {
@@ -185,7 +185,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODF13)
 
         // test wholesome ODF extended encryption
         xmlDocUniquePtr pXmlDoc = parseExport(u"META-INF/manifest.xml"_ustr);
-        assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, 
u"1.3"_ustr);
+        assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, 
u"1.4"_ustr);
         assertXPath(pXmlDoc, "/manifest:manifest/manifest:file-entry"_ostr, 1);
         assertXPath(pXmlDoc, "/manifest:manifest/manifest:file-entry"_ostr, 
"full-path"_ostr,
                     u"encrypted-package"_ustr);
@@ -253,7 +253,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODFWholesom
 
         // test wholesome ODF extended encryption
         xmlDocUniquePtr pXmlDoc = parseExport(u"META-INF/manifest.xml"_ustr);
-        assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, 
u"1.3"_ustr);
+        assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, 
u"1.4"_ustr);
         assertXPath(pXmlDoc, "/manifest:manifest/manifest:file-entry"_ostr, 1);
         assertXPath(pXmlDoc, "/manifest:manifest/manifest:file-entry"_ostr, 
"full-path"_ostr,
                     u"encrypted-package"_ustr);
@@ -300,7 +300,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODFWholesom
         SfxObjectShell* pObjectShell(pBaseModel->GetObjectShell());
         uno::Reference<beans::XPropertySet> 
xPropSet(pObjectShell->GetStorage(),
                                                      uno::UNO_QUERY_THROW);
-        CPPUNIT_ASSERT_EQUAL(ODFVER_013_TEXT,
+        CPPUNIT_ASSERT_EQUAL(ODFVER_014_TEXT,
                              
xPropSet->getPropertyValue(u"Version"_ustr).get<OUString>());
         CPPUNIT_ASSERT_EQUAL(SignatureState::OK, 
pObjectShell->GetScriptingSignatureState());
     }
@@ -359,7 +359,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODFWholesom
         // using Zip Storage means the encrypted streams are signed, so
         // after encrypting again the signature didn't match and was dropped
         //        assertDocument(CPPUNIT_SOURCELINE(), "writer8", 
SignatureState::NOSIGNATURES,
-        //                       SignatureState::OK, ODFVER_013_TEXT);
+        //                       SignatureState::OK, ODFVER_014_TEXT);
     }
 }
 
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx 
b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index a44b496aa52d..f5fe24e518e2 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -212,7 +212,7 @@ public:
 
 DocumentDigitalSignatures::DocumentDigitalSignatures( const Reference< 
XComponentContext >& rxCtx ):
     mxCtx(rxCtx),
-    m_sODFVersion(ODFVER_013_TEXT),
+    m_sODFVersion(ODFVER_014_TEXT),
     m_nArgumentsCount(0),
     m_bHasDocumentSignature(false)
 {

Reply via email to