[Libreoffice-commits] core.git: xmloff/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Thu May 7 17:13:49 UTC 2020
xmloff/source/core/xmlimp.cxx | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit d4d88774c505d3c6c6668dd06b941fb268e5a22b
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Apr 29 12:28:30 2020 +0200
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu May 7 19:13:12 2020 +0200
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 at cib.de>
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index cc515c645a23..78c967fa72fc 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1705,9 +1705,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
More information about the Libreoffice-commits
mailing list