summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-07-11 17:56:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-13 13:37:52 +0200
commit68cf76917e342aa5f47deb7e3ef3f7706f8f5a5a (patch)
treeaf904dcaef425e001d1b7406a4ddb34e8e3a9f84 /sw
parent647382f52351a7586459201203e399956b763527 (diff)
Show document title for embedded documents
Embedded documents had "Untitled" name. This patch shows "<root document> (Embedded document)" string in the title bar. Change-Id: I6283240415f9e0c07c4c69672732a7c14eea9f5d Reviewed-on: https://gerrit.libreoffice.org/39835 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoframe.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index a10893f9a8c4..e666726b06dc 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/embed/XComponentSupplier.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <o3tl/any.hxx>
@@ -2964,6 +2965,12 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
::svt::EmbeddedObjectRef xObjRef( xIPObj, m_nDrawAspect);
pFormat2 = pDoc->getIDocumentContentOperations().InsertEmbObject(
aPam, xObjRef, &aFrameSet );
+
+ // store main document name to show in the title bar
+ uno::Reference< frame::XTitle > xModelTitle( pDoc->GetDocShell()->GetModel(), css::uno::UNO_QUERY );
+ if( xModelTitle.is() )
+ xIPObj->setContainerName( xModelTitle->getTitle() );
+
assert(pFormat2 && "Doc->Insert(notxt) failed.");
pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);