diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-07-11 17:56:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-13 13:37:52 +0200 |
commit | 68cf76917e342aa5f47deb7e3ef3f7706f8f5a5a (patch) | |
tree | af904dcaef425e001d1b7406a4ddb34e8e3a9f84 /embeddedobj/source/general/docholder.cxx | |
parent | 647382f52351a7586459201203e399956b763527 (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 'embeddedobj/source/general/docholder.cxx')
-rw-r--r-- | embeddedobj/source/general/docholder.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 1bef54e7741f..60ac61682ae1 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/frame/TaskCreator.hpp> +#include <com/sun/star/frame/XTitle.hpp> #include <com/sun/star/frame/TerminationVetoException.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XSynchronousFrameLoader.hpp> @@ -65,6 +66,9 @@ #include <rtl/process.h> #include <vcl/svapp.hxx> #include <svtools/embedhlp.hxx> +#include <tools/resmgr.hxx> +#include <vcl/settings.hxx> +#include <sfx2/sfx.hrc> #include <comphelper/processfactory.hxx> #include <comphelper/namedvaluecollection.hxx> @@ -962,6 +966,17 @@ bool DocumentHolder::LoadDocToFrame( bool bInPlace ) ::comphelper::NamedValueCollection aArgs; aArgs.put( "Model", m_xComponent ); aArgs.put( "ReadOnly", m_bReadOnly ); + + // set document title to show in the title bar + css::uno::Reference< css::frame::XTitle > xModelTitle( xDoc, css::uno::UNO_QUERY ); + if( xModelTitle.is() ) + { + LanguageTag aLocale( Application::GetSettings().GetUILanguageTag() ); + ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "sfx", aLocale ); + OUString nTitle = ResId( STR_EMBEDDED_TITLE, *pResMgr ); + xModelTitle->setTitle( m_pEmbedObj->getContainerName() + nTitle ); + } + if ( bInPlace ) aArgs.put( "PluginMode", sal_Int16(1) ); OUString sUrl; |