diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-03 17:41:53 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-03 23:43:33 +0100 |
commit | 131ebdeb2f26a697029d2e561743345ddc8a8b32 (patch) | |
tree | 9154334da39495e6e5d5e9c6e880b6e0dce3f1dc /reportdesign/source | |
parent | 0fadfd3c17a4ec9bd3e51deb22074422e1b4c330 (diff) |
reportdesign: try harder in getDocumentBaseURL()
OReportDefinition is always an embedded object, and may contain embedded
objects itself. Try to get a base URL for loading the nested embedded
objects from the parent. We actually need it before setParent() is
called, so search the media descriptor too.
Change-Id: I319127cd5938d4a79778345fce65a4d58bd54877
Diffstat (limited to 'reportdesign/source')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 648f163843a1..1cbc19131bbe 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -2549,7 +2549,23 @@ bool OReportDefinition::isEnableSetModified() const OUString OReportDefinition::getDocumentBaseURL() const { - return const_cast<OReportDefinition*>(this)->getURL(); + // TODO: should this be in getURL()? not sure... + uno::Reference<frame::XModel> const xParent( + const_cast<OReportDefinition*>(this)->getParent(), uno::UNO_QUERY); + if (xParent.is()) + { + return xParent->getURL(); + } + + ::osl::MutexGuard aGuard(m_aMutex); + ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); + for (beans::PropertyValue const& it : m_pImpl->m_aArgs) + { + if (it.Name == "DocumentBaseURL") + return it.Value.get<OUString>(); + } + + return OUString(); } uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw() |