summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-12-14 13:41:57 +0100
committerMichael Stahl <mstahl@redhat.com>2015-12-15 19:55:55 +0100
commit4118f8f4c20ae711b95ab3052656bde673aa8852 (patch)
tree377259e53a41af549dcf059ada20a666eebed247 /reportdesign
parent88cd3f3f33233d93f3f1b13c184282882210c6b6 (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. Change-Id: I3d1ed29b3a2c0e77ec606a1d09f7bc07e7860733 (cherry picked from commit b0fc09daf1086423a9bd457d9a2c043e7ff41451)
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 36d325f2e339..9e582ea235c8 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -392,6 +392,7 @@ namespace reportdesign
virtual ::comphelper::EmbeddedObjectContainer& getEmbeddedObjectContainer() const override;
virtual css::uno::Reference< css::task::XInteractionHandler > getInteractionHandler() const override;
virtual bool isEnableSetModified() const override;
+ virtual OUString getDocumentBaseURL() const override;
css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2( ) throw (css::uno::RuntimeException);
};
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 3355055e776c..c5d3f9cea857 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2512,6 +2512,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;