diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-01-10 17:59:52 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-10 20:33:08 +0000 |
commit | 634a5950920e82384993f1d88e2dd054d814d175 (patch) | |
tree | 6bed74be54aa3393ab0851aea8854f1ef86f09da /dbaccess | |
parent | 123a5a7079426d7d4cb6b980b384339d6150a0a8 (diff) |
dbaccess: ODF export: set "Version" property on target Storage
... like SfxObjectShell::SetupStorage() does, and not on the property
set that is passed to the XML export filters where it probably does
nothing.
(cherry picked from commit f60b61b2cf87e89938c760877a56bc4dd5c577a9)
Conflicts:
dbaccess/source/core/dataaccess/databasedocument.cxx
Change-Id: I21da1b92fc921eb47e492169e69ef15ac2f0e19d
Reviewed-on: https://gerrit.libreoffice.org/7381
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.cxx | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 0b7dd0afa964..9fd49c486f44 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1624,31 +1624,33 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r if ( aSaveOpt.IsSaveRelFSys() ) xInfoSet->setPropertyValue("BaseURI", uno::makeAny(_rMediaDescriptor.getOrDefault("URL",OUString()))); - OUString aVersion; - SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion(); + sal_Int32 nArgsLen = aDelegatorArguments.getLength(); + aDelegatorArguments.realloc(nArgsLen+1); + aDelegatorArguments[nArgsLen++] <<= xInfoSet; - // older versions can not have this property set, it exists only starting from ODF1.2 - if ( nDefVersion >= SvtSaveOptions::ODFVER_012 ) + Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW ); + xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( (OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) ); + + OUString aVersion; + SvtSaveOptions::ODFDefaultVersion const nDefVersion = + aSaveOpt.GetODFDefaultVersion(); + // older versions can not have this property set, + // it exists only starting from ODF1.2 + if (nDefVersion >= SvtSaveOptions::ODFVER_012) aVersion = ODFVER_012_TEXT; - if ( !aVersion.isEmpty() ) + if (!aVersion.isEmpty()) { try { - xInfoSet->setPropertyValue( "Version" , uno::makeAny( aVersion ) ); + xProp->setPropertyValue("Version" , uno::makeAny(aVersion)); } - catch( const uno::Exception& ) + catch (const uno::Exception& e) { + SAL_WARN("dbaccess", "exception setting Version: " << e.Message); } } - sal_Int32 nArgsLen = aDelegatorArguments.getLength(); - aDelegatorArguments.realloc(nArgsLen+1); - aDelegatorArguments[nArgsLen++] <<= xInfoSet; - - Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW ); - xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( (OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) ); - Reference< XComponent > xComponent( *const_cast< ODatabaseDocument* >( this ), UNO_QUERY_THROW ); Sequence< PropertyValue > aMediaDescriptor; |