summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-29 12:28:30 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-07 19:13:12 +0200
commitd4d88774c505d3c6c6668dd06b941fb268e5a22b (patch)
tree4a593fffca7ab92d6c20a837bb13a78187103dfd /xmloff
parent45f2e81c98a5b7fe6f021923fd93d20b3c5f3815 (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>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlimp.cxx5
1 files changed, 2 insertions, 3 deletions
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