This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit ee366e9e8b4eb60255c9136b2b9fe875b1e11938
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Nov 3 04:13:22 2026 -0500

    Add ODF 1.4 and 1.4 Extended save formats
---
 main/comphelper/inc/comphelper/documentconstants.hxx         |  2 ++
 main/cui/source/options/optsave.src                          |  2 ++
 main/dbaccess/source/core/dataaccess/databasedocument.cxx    |  4 +++-
 main/embeddedobj/source/commonembedding/persistence.cxx      |  4 ++--
 .../registry/schema/org/openoffice/Office/Common.xcs         | 10 ++++++++++
 main/sfx2/source/doc/objstor.cxx                             |  8 ++++----
 main/unotools/inc/unotools/saveopt.hxx                       |  2 ++
 main/unotools/source/config/saveopt.cxx                      | 12 ++++++++++--
 main/xmloff/source/core/xmlexp.cxx                           |  3 +++
 main/xmloff/source/meta/MetaExportComponent.cxx              |  2 ++
 10 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/main/comphelper/inc/comphelper/documentconstants.hxx 
b/main/comphelper/inc/comphelper/documentconstants.hxx
index f0c897bfd4..4232d6d94e 100644
--- a/main/comphelper/inc/comphelper/documentconstants.hxx
+++ b/main/comphelper/inc/comphelper/documentconstants.hxx
@@ -102,11 +102,13 @@
 #define ODFVER_011_TEXT_ASCII   "1.1"
 #define ODFVER_012_TEXT_ASCII   "1.2"
 #define ODFVER_013_TEXT_ASCII   "1.3"
+#define ODFVER_014_TEXT_ASCII   "1.4"
 
 #define ODFVER_010_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ODFVER_010_TEXT_ASCII ) )
 #define ODFVER_011_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ODFVER_011_TEXT_ASCII ) )
 #define ODFVER_012_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ODFVER_012_TEXT_ASCII ) )
 #define ODFVER_013_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ODFVER_013_TEXT_ASCII ) )
+#define ODFVER_014_TEXT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ODFVER_014_TEXT_ASCII ) )
 #endif
 
 // filter flags
diff --git a/main/cui/source/options/optsave.src 
b/main/cui/source/options/optsave.src
index c2b58e4d02..c3205b9b91 100644
--- a/main/cui/source/options/optsave.src
+++ b/main/cui/source/options/optsave.src
@@ -154,6 +154,8 @@ TabPage RID_SFXPAGE_SAVE
                        < "1.2 Extended (recommended)" ;        5 ; > ;
                        < "1.3" ;                                               
        6 ; > ;
                        < "1.3 Extended" ;                                      
7 ; > ;
+                       < "1.4" ;                                               
        8 ; > ;
+                       < "1.4 Extended" ;                                      
9 ; > ;
                };
        };
        CheckBox BTN_ODFENCRYPTION
diff --git a/main/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/main/dbaccess/source/core/dataaccess/databasedocument.cxx
index fc846f25eb..d6ece3b745 100644
--- a/main/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/main/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1624,7 +1624,9 @@ void ODatabaseDocument::impl_writeStorage_throw( const 
Reference< XStorage >& _r
     SvtSaveOptions::ODFDefaultVersion nDefVersion = 
aSaveOpt.GetODFDefaultVersion();
 
     // older versions can not have this property set, it exists only starting 
from ODF1.2
-    if ( nDefVersion >= SvtSaveOptions::ODFVER_013 )
+    if ( nDefVersion >= SvtSaveOptions::ODFVER_014 )
+        aVersion = ODFVER_014_TEXT;
+    else if ( nDefVersion >= SvtSaveOptions::ODFVER_013 )
         aVersion = ODFVER_013_TEXT;
     else if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
         aVersion = ODFVER_012_TEXT;
diff --git a/main/embeddedobj/source/commonembedding/persistence.cxx 
b/main/embeddedobj/source/commonembedding/persistence.cxx
index 7ece4f1668..8733b9445e 100644
--- a/main/embeddedobj/source/commonembedding/persistence.cxx
+++ b/main/embeddedobj/source/commonembedding/persistence.cxx
@@ -69,7 +69,7 @@ using namespace ::com::sun::star;
 
 
 //------------------------------------------------------
-// the values of Save/ODF/DefaultVersion that select strict ODF 1.2 and 1.3 
(SvtSaveOptions::ODFVER_012, ODFVER_013)
+// the values of Save/ODF/DefaultVersion that select strict ODF 1.2, 1.3 and 
1.4 (SvtSaveOptions::ODFVER_012, ODFVER_013, ODFVER_014)
 static sal_Bool IsStrictODF12_Impl( const uno::Reference< 
lang::XMultiServiceFactory >& xFactory )
 {
        try
@@ -81,7 +81,7 @@ static sal_Bool IsStrictODF12_Impl( const uno::Reference< 
lang::XMultiServiceFac
                                ::rtl::OUString::createFromAscii( "Save/ODF" ),
                                ::rtl::OUString::createFromAscii( 
"DefaultVersion" ),
                                ::comphelper::ConfigurationHelper::E_READONLY ) 
>>= nVersion;
-               return nVersion == 4 || nVersion == 5;
+               return nVersion == 4 || nVersion == 5 || nVersion == 7;
        }
        catch ( uno::Exception& )
        {
diff --git a/main/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/main/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 824f2e9ca6..451c5bb83a 100644
--- a/main/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/main/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2231,6 +2231,16 @@
                                                                
<desc>ODFVER_013_EXT</desc>
                                                        </info>
                                                </enumeration>
+                                               <enumeration oor:value="7">
+                                                       <info>
+                                                               
<desc>ODFVER_014</desc>
+                                                       </info>
+                                               </enumeration>
+                                               <enumeration oor:value="8">
+                                                       <info>
+                                                               
<desc>ODFVER_014_EXT</desc>
+                                                       </info>
+                                               </enumeration>
                                        </constraints>
                                        <value>3</value>
                                </prop>
diff --git a/main/sfx2/source/doc/objstor.cxx b/main/sfx2/source/doc/objstor.cxx
index 8b40be38b8..05ef352f95 100644
--- a/main/sfx2/source/doc/objstor.cxx
+++ b/main/sfx2/source/doc/objstor.cxx
@@ -375,7 +375,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< 
embed::XStorage >& xSto
                     {
                         // older versions can not have this property set, it 
exists only starting from ODF1.2
                         xProps->setPropertyValue( 
::rtl::OUString::createFromAscii( "Version" ),
-                            nDefVersion >= SvtSaveOptions::ODFVER_013 ? 
uno::makeAny( ODFVER_013_TEXT ) : uno::makeAny( ODFVER_012_TEXT ) );
+                            nDefVersion >= SvtSaveOptions::ODFVER_014 ? 
uno::makeAny( ODFVER_014_TEXT ) : nDefVersion >= SvtSaveOptions::ODFVER_013 ? 
uno::makeAny( ODFVER_013_TEXT ) : uno::makeAny( ODFVER_012_TEXT ) );
                     }
                     catch( uno::Exception& )
                     {
@@ -857,8 +857,8 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
                 if ( sVersion.getLength() )
                 {
                     double nVersion = sVersion.toDouble();
-                    if ( nVersion > 1.30001  && 
SfxObjectShell_Impl::NeedsOfficeUpdateDialog() )
-                        // ODF version greater than 1.3 - added some decimal 
places to be safe against floating point conversion errors (hack)
+                    if ( nVersion > 1.40001  && 
SfxObjectShell_Impl::NeedsOfficeUpdateDialog() )
+                        // ODF version greater than 1.4 - added some decimal 
places to be safe against floating point conversion errors (hack)
                     {
                         ::rtl::OUString sDocumentURL( pMedium->GetOrigURL() );
                         ::rtl::OUString aSystemFileURL;
@@ -1401,7 +1401,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
                         try
                         {
                             xProps->setPropertyValue( 
::rtl::OUString::createFromAscii( "Version" ),
-                                aSaveOpt.GetODFDefaultVersion() >= 
SvtSaveOptions::ODFVER_013 ? uno::makeAny( ODFVER_013_TEXT ) : uno::makeAny( 
ODFVER_012_TEXT ) );
+                                aSaveOpt.GetODFDefaultVersion() >= 
SvtSaveOptions::ODFVER_014 ? uno::makeAny( ODFVER_014_TEXT ) : 
aSaveOpt.GetODFDefaultVersion() >= SvtSaveOptions::ODFVER_013 ? uno::makeAny( 
ODFVER_013_TEXT ) : uno::makeAny( ODFVER_012_TEXT ) );
                         }
                         catch( uno::Exception& )
                         {
diff --git a/main/unotools/inc/unotools/saveopt.hxx 
b/main/unotools/inc/unotools/saveopt.hxx
index d23b8c29b7..86067a2210 100644
--- a/main/unotools/inc/unotools/saveopt.hxx
+++ b/main/unotools/inc/unotools/saveopt.hxx
@@ -65,6 +65,8 @@ public:
         ODFVER_012_EXT = 5,     // ODF 1.2 with extensions
         ODFVER_013 = 6,         // ODF 1.3
         ODFVER_013_EXT = 7,     // ODF 1.3 with extensions
+        ODFVER_014 = 8,         // ODF 1.4
+        ODFVER_014_EXT = 9,     // ODF 1.4 with extensions
 
         ODFVER_EXTENSION = SAL_MAX_ENUM,   // only in property map tables: 
export in the extended modes only
         ODFVER_EXTENSION_PRE_013 = SAL_MAX_ENUM - 1,   // only in property map 
tables: export in the extended modes below ODF 1.3
diff --git a/main/unotools/source/config/saveopt.cxx 
b/main/unotools/source/config/saveopt.cxx
index b87e914388..00cd6c24c7 100644
--- a/main/unotools/source/config/saveopt.cxx
+++ b/main/unotools/source/config/saveopt.cxx
@@ -495,6 +495,10 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
                                 eODFDefaultVersion = 
SvtSaveOptions::ODFVER_013;
                             else if( nTmp == 6 )
                                 eODFDefaultVersion = 
SvtSaveOptions::ODFVER_013_EXT;
+                            else if( nTmp == 7 )
+                                eODFDefaultVersion = 
SvtSaveOptions::ODFVER_014;
+                            else if( nTmp == 8 )
+                                eODFDefaultVersion = 
SvtSaveOptions::ODFVER_014_EXT;
                             else if( nTmp >= 0 && nTmp <= 4 )
                                 eODFDefaultVersion = 
SvtSaveOptions::ODFDefaultVersion( nTmp );
                         }
@@ -757,6 +761,10 @@ void SvtSaveOptions_Impl::Commit()
                         nODFVersion = 5;
                     else if( eODFDefaultVersion == 
SvtSaveOptions::ODFVER_013_EXT )
                         nODFVersion = 6;
+                    else if( eODFDefaultVersion == SvtSaveOptions::ODFVER_014 )
+                        nODFVersion = 7;
+                    else if( eODFDefaultVersion == 
SvtSaveOptions::ODFVER_014_EXT )
+                        nODFVersion = 8;
                     pValues[nRealCount] <<= nODFVersion;
                     pNames[nRealCount] = pOrgNames[i];
                     ++nRealCount;
@@ -1067,12 +1075,12 @@ void SvtSaveOptions::SetODFDefaultVersion( 
SvtSaveOptions::ODFDefaultVersion eVe
 
 sal_Bool SvtSaveOptions::IsODFExtended( ODFDefaultVersion eVersion )
 {
-    return eVersion == ODFVER_012_EXT || eVersion == ODFVER_013_EXT;
+    return eVersion == ODFVER_012_EXT || eVersion == ODFVER_013_EXT || 
eVersion == ODFVER_014_EXT;
 }
 
 sal_Bool SvtSaveOptions::IsODFStrict( ODFDefaultVersion eVersion )
 {
-    return eVersion == ODFVER_012 || eVersion == ODFVER_013;
+    return eVersion == ODFVER_012 || eVersion == ODFVER_013 || eVersion == 
ODFVER_014;
 }
 
 SvtSaveOptions::ODFDefaultVersion SvtSaveOptions::GetODFDefaultVersion() const
diff --git a/main/xmloff/source/core/xmlexp.cxx 
b/main/xmloff/source/core/xmlexp.cxx
index 2823c0e500..c4d2078cd5 100644
--- a/main/xmloff/source/core/xmlexp.cxx
+++ b/main/xmloff/source/core/xmlexp.cxx
@@ -109,6 +109,7 @@ using namespace ::xmloff::token;
 sal_Char __READONLY_DATA sXML_1_1[] = "1.1";
 sal_Char __READONLY_DATA sXML_1_2[] = "1.2";
 sal_Char __READONLY_DATA sXML_1_3[] = "1.3";
+sal_Char __READONLY_DATA sXML_1_4[] = "1.4";
 
 const sal_Char *sOpenOfficeOrgProject ="OpenOffice.org_project";
 
@@ -1446,6 +1447,8 @@ sal_uInt32 SvXMLExport::exportDoc( enum 
::xmloff::token::XMLTokenEnum eClass )
         const sal_Char* pVersion = 0;
         switch( getDefaultVersion() )
         {
+        case SvtSaveOptions::ODFVER_014_EXT: pVersion = sXML_1_4; break;
+        case SvtSaveOptions::ODFVER_014: pVersion = sXML_1_4; break;
         case SvtSaveOptions::ODFVER_013_EXT: pVersion = sXML_1_3; break;
         case SvtSaveOptions::ODFVER_013: pVersion = sXML_1_3; break;
         case SvtSaveOptions::ODFVER_012_EXT: pVersion = sXML_1_2; break;
diff --git a/main/xmloff/source/meta/MetaExportComponent.cxx 
b/main/xmloff/source/meta/MetaExportComponent.cxx
index 544ca61b8a..4e0a200052 100644
--- a/main/xmloff/source/meta/MetaExportComponent.cxx
+++ b/main/xmloff/source/meta/MetaExportComponent.cxx
@@ -163,6 +163,8 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum 
XMLTokenEnum )
         const sal_Char* pVersion = 0;
         switch( getDefaultVersion() )
         {
+        case SvtSaveOptions::ODFVER_014_EXT: pVersion = "1.4"; break;
+        case SvtSaveOptions::ODFVER_014: pVersion = "1.4"; break;
         case SvtSaveOptions::ODFVER_013_EXT: pVersion = "1.3"; break;
         case SvtSaveOptions::ODFVER_013: pVersion = "1.3"; break;
         case SvtSaveOptions::ODFVER_012_EXT: pVersion = "1.2"; break;

Reply via email to