From b0fc09daf1086423a9bd457d9a2c043e7ff41451 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 14 Dec 2015 13:41:57 +0100 Subject: 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 --- svx/source/xml/xmleohlp.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'svx') diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index ec40121adcaf..f75376abac07 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -445,7 +445,8 @@ bool SvXMLEmbeddedObjectHelper::ImplReadObject( // server that was used to create the object. pClassId could be used to specify the server that should // be used for the next opening, but this information seems to be out of the file format responsibility // area. - rContainer.GetEmbeddedObject( aName ); + OUString const baseURL(mpDocPersist->getDocumentBaseURL()); + rContainer.GetEmbeddedObject(aName, &baseURL); return true; } -- cgit