diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-02-15 17:50:38 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-08-13 11:06:55 +0200 |
commit | de6355afa4bf89199c7281ddb43a141e192d43d6 (patch) | |
tree | 7c349d3e4249c8fa82e4d7b1374f1403507dc221 /include | |
parent | 44a40b38d881fd2b9cfbedfc630290d1927fd72f (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>
(cherry picked from commit 98b99ef61c6d725962cdbaa05ff90c9d1aa72d57)
Reviewed-on: https://gerrit.libreoffice.org/75963
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/DocumentMetadataAccess.hxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/sfx2/DocumentMetadataAccess.hxx b/include/sfx2/DocumentMetadataAccess.hxx index 31a61adebb01..cf5a2ddbcbac 100644 --- a/include/sfx2/DocumentMetadataAccess.hxx +++ b/include/sfx2/DocumentMetadataAccess.hxx @@ -44,6 +44,9 @@ namespace com { namespace sun { namespace star { namespace embed { class XStorage; } } } } +namespace com { namespace sun { namespace star { namespace frame { + class XModel; +} } } } class SfxObjectShell; namespace sfx2 { @@ -52,7 +55,7 @@ namespace sfx2 { /** create a base URI for loading metadata from an ODF (sub)document. @param i_xContext component context - @param i_xStorage storage for the document; FileSystemStorage is allowed + @param i_xModel model of the document (required if no URI is provided) @param i_rPkgURI the URI for the package @param i_rSubDocument (optional) path of the subdocument in package @@ -60,8 +63,8 @@ namespace sfx2 { */ css::uno::Reference< css::rdf::XURI> SFX2_DLLPUBLIC createBaseURI( - css::uno::Reference< css::uno::XComponentContext> const & i_xContext, - css::uno::Reference< css::embed::XStorage> const & i_xStorage, + css::uno::Reference<css::uno::XComponentContext> const & i_xContext, + css::uno::Reference<css::frame::XModel> const & i_xModel, OUString const & i_rPkgURI, OUString const & i_rSubDocument = OUString()); |