summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-12-14 13:41:57 +0100
committerAndras Timar <andras.timar@collabora.com>2015-12-21 13:16:17 +0100
commit9cd4cf7258e97f8ca26167bfb9dc175e92dd145d (patch)
treedb1ccc9a6266057d18a838d76e3ff523e534106f /reportdesign
parent4d29e69ae1f0c4a35a6785297cdc408762228d92 (diff)
fix missing BaseURL when loading embedded objects
When the object is edited in the UI, the m_xClient is set to a SfxInPlaceClient and the DocumentBaseURL is retrieved from it. But if the object is not edited, it will be loaded during export via the API and without a m_xClient; in this case the DocumentBaseURL must have been set previously to be available during import. There appears to be no way to get the URL of the document via the API while it is being imported; SfxBaseModel's m_sURL is unfortunately only initialized from SfxObjectShell::FinishedLoading(). During ODF import, the SvXMLEmbeddedObjectHelper creates the embedded object, so let's make it pass in the parent's BaseURL. The "DefaultParentBaseURL" parameter already exists but was unused previously. (cherry picked from commit b0fc09daf1086423a9bd457d9a2c043e7ff41451) (cherry picked from commit 4118f8f4c20ae711b95ab3052656bde673aa8852) sw: loading embedded ODF objects requires unordf component (cherry picked from commit b3b7982f4690f4ac0f0e9680970ba544157c36dc) Change-Id: I3d1ed29b3a2c0e77ec606a1d09f7bc07e7860733 Reviewed-on: https://gerrit.libreoffice.org/20761 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit fe4c7f20c272cf7a984d0db79199fe74bd31fc86)
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/inc/ReportDefinition.hxx1
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx5
2 files changed, 6 insertions, 0 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index 18ac1b88ce6f..cf3da36b63a3 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -407,6 +407,7 @@ namespace reportdesign
virtual ::comphelper::EmbeddedObjectContainer& getEmbeddedObjectContainer() const SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > getInteractionHandler() const SAL_OVERRIDE;
virtual bool isEnableSetModified() const SAL_OVERRIDE;
+ virtual OUString getDocumentBaseURL() const SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const;
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 42b0baf010a3..a3f46637c0af 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2521,6 +2521,11 @@ bool OReportDefinition::isEnableSetModified() const
return true;
}
+OUString OReportDefinition::getDocumentBaseURL() const
+{
+ return const_cast<OReportDefinition*>(this)->getURL();
+}
+
uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw()
{
SolarMutexGuard aSolarGuard;