summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-02-15 17:50:38 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-03-13 16:59:06 +0100
commit98b99ef61c6d725962cdbaa05ff90c9d1aa72d57 (patch)
tree4c7b7b36d89e34f38057b6175ff58b4ed66389f9 /sc
parentb2bb05fc4fddbdcb191f993ba58adab08adbc99b (diff)
tdf#123293 sfx2: fix metadata loss when loading from stream
The problem is that when loading from a stream, there is no BaseURL and also no storage for the document. Due to the lack of BaseURL, the sfx2::createBaseURI() throws and loading RDF metadata fails, which also pops up an annoying warning dialog. Try to handle this in a similar way than a newly created document (see GetDMA()), by using the vnd.sun.star.tdoc scheme URL for the document; this however currently requires that the document has a XStorage, which is also not the case here. So add another UNO method to tdoc UCP's tdoc_ucp::ContentProvider, to split out the creation of the tdoc schema URL from the creation of the ucb Content, to get rid of the XStorage requirement. Change-Id: Ica62743f9d21db0b1464b70db1a62ebc61989ef8 Reviewed-on: https://gerrit.libreoffice.org/67882 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 0a5ca5768f56db481dd3b947b3dddaab7ed96450) Reviewed-on: https://gerrit.libreoffice.org/69101 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index a81f7fb6475e..3120a999e811 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -37,6 +37,7 @@
#include <sfx2/sfxsids.hrc>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/frame/XTransientDocumentsDocumentContentFactory.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp>
@@ -76,6 +77,7 @@
#include <unonames.hxx>
using namespace com::sun::star;
+using namespace css::uno;
ScXMLImportWrapper::ScXMLImportWrapper( ScDocShell& rDocSh, SfxMedium* pM, const uno::Reference < embed::XStorage >& xStor ) :
mrDocShell(rDocSh),
@@ -395,7 +397,7 @@ bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCode& rError )
const uno::Reference< rdf::XDocumentMetadataAccess > xDMA(
xModel, uno::UNO_QUERY_THROW );
const uno::Reference< rdf::XURI > xBaseURI(
- ::sfx2::createBaseURI( xContext, xStorage, aBaseURL, aName ) );
+ ::sfx2::createBaseURI( xContext, xModel, aBaseURL, aName ) );
uno::Reference<task::XInteractionHandler> xHandler =
mrDocShell.GetMedium()->GetInteractionHandler();
xDMA->loadMetadataFromStorage( xStorage, xBaseURI, xHandler );