summaryrefslogtreecommitdiff
path: root/sfx2
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 17:44:36 +0100
commitb0fc09daf1086423a9bd457d9a2c043e7ff41451 (patch)
treeef5870338c359bb8b733588c2d1ef979afda89c7 /sfx2
parent7dfa45a62b3b942823af5ccd59897364788589c8 (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
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ea768f7ca3c9..722630f6db57 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3618,6 +3618,7 @@ bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< ta
return true;
}
+// comphelper::IEmbeddedHelper
uno::Reference< task::XInteractionHandler > SfxObjectShell::getInteractionHandler() const
{
uno::Reference< task::XInteractionHandler > xRet;
@@ -3626,4 +3627,9 @@ uno::Reference< task::XInteractionHandler > SfxObjectShell::getInteractionHandle
return xRet;
}
+OUString SfxObjectShell::getDocumentBaseURL() const
+{
+ return GetMedium()->GetBaseURL();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */