diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-04-29 12:28:30 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-01-06 11:14:25 +0100 |
commit | a8fac83b0719f2bc70d5a68a6db570af78017916 (patch) | |
tree | bffda43f968c7c1f33158d1f1270530160ccb208 /xmloff | |
parent | ed58d457d58cc95a931037f4f574588ab50d22b7 (diff) |
xmloff: ODF import: wrong Storage in SvXMLImport::IsODFVersionConsistent()
The XModel's storage is a temporary one created in
SfxObjectShell::GetStorage(), with the latest ODF version;
the check must use the source Storage that is being imported.
Change-Id: I3d2ce92d6193deefac852edb7078fb5bf41bb957
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93173
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108740
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index fc0b407da3f2..87400560aa37 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1710,9 +1710,8 @@ bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion ) // check the consistency only for the ODF1.2 and later ( according to content.xml ) // manifest.xml might have no version, it should be checked here and the correct version should be set try - { - uno::Reference< document::XStorageBasedDocument > xDoc( mxModel, uno::UNO_QUERY_THROW ); - uno::Reference< embed::XStorage > xStor = xDoc->getDocumentStorage(); + { // don't use getDocumentStorage(), it's temporary and latest version + uno::Reference<embed::XStorage> const xStor(GetSourceStorage()); uno::Reference< beans::XPropertySet > xStorProps( xStor, uno::UNO_QUERY_THROW ); // the check should be done only for OASIS format |