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>
This commit is contained in:
Szymon Kłos
2017-07-17 19:45:16 +02:00
parent c932e26138
commit 00b506ff03
3 changed files with 12 additions and 4 deletions

View File

@@ -973,8 +973,11 @@ bool DocumentHolder::LoadDocToFrame( bool bInPlace )
{ {
LanguageTag aLocale( Application::GetSettings().GetUILanguageTag() ); LanguageTag aLocale( Application::GetSettings().GetUILanguageTag() );
ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "sfx", aLocale ); ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "sfx", aLocale );
OUString nTitle = ResId( STR_EMBEDDED_TITLE, *pResMgr ); OUString sEmbedded = ResId( STR_EMBEDDED_TITLE, *pResMgr );
xModelTitle->setTitle( m_pEmbedObj->getContainerName() + nTitle ); xModelTitle->setTitle( m_pEmbedObj->getContainerName() + sEmbedded);
m_aContainerName = m_pEmbedObj->getContainerName();
// TODO: get real m_aDocumentNamePart
m_aDocumentNamePart = sEmbedded;
} }
if ( bInPlace ) if ( bInPlace )

View File

@@ -155,7 +155,7 @@ Interceptor::addStatusListener(
aStateEvent.FeatureDescriptor = "Close and Return"; aStateEvent.FeatureDescriptor = "Close and Return";
aStateEvent.IsEnabled = true; aStateEvent.IsEnabled = true;
aStateEvent.Requery = false; aStateEvent.Requery = false;
aStateEvent.State <<= ( "($2) " + m_pDocHolder->GetTitle() ); aStateEvent.State <<= ( "($2)" + m_pDocHolder->GetContainerName() );
Control->statusChanged(aStateEvent); Control->statusChanged(aStateEvent);

View File

@@ -128,7 +128,12 @@ public:
OUString GetTitle() const 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 ) void SetOutplaceFrameProperties( const css::uno::Sequence< css::uno::Any >& aProps )