diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-14 13:41:57 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-12-21 13:16:17 +0100 |
commit | 9cd4cf7258e97f8ca26167bfb9dc175e92dd145d (patch) | |
tree | db1ccc9a6266057d18a838d76e3ff523e534106f /sfx2 | |
parent | 4d29e69ae1f0c4a35a6785297cdc408762228d92 (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 'sfx2')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d431a1e5f400..be8ecd062f66 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3641,6 +3641,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; @@ -3649,4 +3650,9 @@ uno::Reference< task::XInteractionHandler > SfxObjectShell::getInteractionHandle return xRet; } +OUString SfxObjectShell::getDocumentBaseURL() const +{ + return GetMedium()->GetBaseURL(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |