diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-07-17 19:45:16 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-07-18 11:27:46 +0200 |
commit | 00b506ff03708e30daa7c2f3df89bb5c06a9cdde (patch) | |
tree | a7741e0fcfbb83ffeea8ceddc8e188e874256da4 /embeddedobj/source | |
parent | c932e26138d9dda1d3dad5e2472a79d42c0a816c (diff) |
Embedded documents: show title in menu entries
Change-Id: I478d81798e6f1e2d96e570cb6788a438c6a0be62
Reviewed-on: https://gerrit.libreoffice.org/40079
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'embeddedobj/source')
-rw-r--r-- | embeddedobj/source/general/docholder.cxx | 7 | ||||
-rw-r--r-- | embeddedobj/source/general/intercept.cxx | 2 | ||||
-rw-r--r-- | embeddedobj/source/inc/docholder.hxx | 7 |
3 files changed, 12 insertions, 4 deletions
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 13fb5335d4d1..f85414f7c43b 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -973,8 +973,11 @@ bool DocumentHolder::LoadDocToFrame( bool bInPlace ) { LanguageTag aLocale( Application::GetSettings().GetUILanguageTag() ); ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "sfx", aLocale ); - OUString nTitle = ResId( STR_EMBEDDED_TITLE, *pResMgr ); - xModelTitle->setTitle( m_pEmbedObj->getContainerName() + nTitle ); + OUString sEmbedded = ResId( STR_EMBEDDED_TITLE, *pResMgr ); + xModelTitle->setTitle( m_pEmbedObj->getContainerName() + sEmbedded); + m_aContainerName = m_pEmbedObj->getContainerName(); + // TODO: get real m_aDocumentNamePart + m_aDocumentNamePart = sEmbedded; } if ( bInPlace ) diff --git a/embeddedobj/source/general/intercept.cxx b/embeddedobj/source/general/intercept.cxx index 1a8cce8212c0..4aeb9d1ab560 100644 --- a/embeddedobj/source/general/intercept.cxx +++ b/embeddedobj/source/general/intercept.cxx @@ -155,7 +155,7 @@ Interceptor::addStatusListener( aStateEvent.FeatureDescriptor = "Close and Return"; aStateEvent.IsEnabled = true; aStateEvent.Requery = false; - aStateEvent.State <<= ( "($2) " + m_pDocHolder->GetTitle() ); + aStateEvent.State <<= ( "($2)" + m_pDocHolder->GetContainerName() ); Control->statusChanged(aStateEvent); diff --git a/embeddedobj/source/inc/docholder.hxx b/embeddedobj/source/inc/docholder.hxx index efbb664c6659..410b9f73161e 100644 --- a/embeddedobj/source/inc/docholder.hxx +++ b/embeddedobj/source/inc/docholder.hxx @@ -128,7 +128,12 @@ public: OUString GetTitle() const { - return m_aContainerName + " - " + m_aDocumentNamePart; + return m_aContainerName + ( m_aDocumentNamePart.isEmpty() ? OUString() : ( " - " + m_aDocumentNamePart ) ); + } + + OUString GetContainerName() const + { + return m_aContainerName; } void SetOutplaceFrameProperties( const css::uno::Sequence< css::uno::Any >& aProps ) |