[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - xmloff/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 6 10:14:58 UTC 2021


 xmloff/source/core/xmlimp.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a8fac83b0719f2bc70d5a68a6db570af78017916
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Apr 29 12:28:30 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jan 6 11:14:25 2021 +0100

    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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108740
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

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


More information about the Libreoffice-commits mailing list