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

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

commit 3d286ec867d09ce78135eb0d3037cbc3b707bf12
Author: Jim Jagielski <[email protected]>
AuthorDate: Wed Oct 28 08:17:12 2026 -0400

    sfx2, dbaccess: write manifest:version for non-own filters and Base
---
 main/dbaccess/source/core/dataaccess/databasedocument.cxx | 11 +++++++++++
 main/sfx2/source/doc/objstor.cxx                          | 13 +++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/main/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/main/dbaccess/source/core/dataaccess/databasedocument.cxx
index 9931e1dced..340241062d 100644
--- a/main/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/main/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1644,6 +1644,17 @@ void ODatabaseDocument::impl_writeStorage_throw( const 
Reference< XStorage >& _r
 
        Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW );
     xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( 
(rtl::OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) );
+    // manifest:version is taken from the storage's Version property
+    if ( aVersion.getLength() )
+    {
+        try
+        {
+            xProp->setPropertyValue( 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Version" )), uno::makeAny( aVersion 
) );
+        }
+        catch( uno::Exception& )
+        {
+        }
+    }
 
        Reference< XComponent > xComponent( *const_cast< ODatabaseDocument* >( 
this ), UNO_QUERY_THROW );
 
diff --git a/main/sfx2/source/doc/objstor.cxx b/main/sfx2/source/doc/objstor.cxx
index 6edfb970b6..f7c05dbfea 100644
--- a/main/sfx2/source/doc/objstor.cxx
+++ b/main/sfx2/source/doc/objstor.cxx
@@ -1392,6 +1392,19 @@ sal_Bool SfxObjectShell::SaveTo_Impl
 
                     xProps->setPropertyValue( 
::rtl::OUString::createFromAscii( "MediaType" ),
                                             uno::makeAny( aDataFlavor.MimeType 
) );
+
+                    // manifest:version is taken from the storage; 
SetupStorage is not called on this path
+                    SvtSaveOptions aSaveOpt;
+                    if ( aSaveOpt.GetODFDefaultVersion() >= 
SvtSaveOptions::ODFVER_012 )
+                    {
+                        try
+                        {
+                            xProps->setPropertyValue( 
::rtl::OUString::createFromAscii( "Version" ), uno::makeAny( ODFVER_012_TEXT ) 
);
+                        }
+                        catch( uno::Exception& )
+                        {
+                        }
+                    }
                 }
                 catch( uno::Exception& )
                 {

Reply via email to