diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-19 14:38:32 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-02-21 01:40:19 +0200 |
commit | b6994cb75fb7e34574d933dff58fcec3bb1ab922 (patch) | |
tree | b4ed563012a53742131ba72705bcadde04f99d9a /sfx2 | |
parent | 8c5a3b448a50981b41b2860c64a3039265398cf9 (diff) |
Use module name when getting labels
Change-Id: I1d5196e1ca888dfb11d5bd6ef4676937dce49fdc
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index a8dce9d2f0a8..2fa709a4c098 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -259,13 +259,6 @@ OUString getDefaultModule_Impl() return sDefaultModule; } -Reference< XFrame > getCurrentFrame() -{ - Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference < XDesktop2 > xDesktop = Desktop::create(xContext); - return xDesktop->getCurrentFrame(); -} - OUString getCurrentModuleIdentifier_Impl() { OUString sIdentifier; @@ -446,7 +439,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* pWindow ) { OUString sModuleName = GetHelpModuleName_Impl(); - OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( aCommandURL, getCurrentFrame() ); + OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( aCommandURL, getCurrentModuleIdentifier_Impl() ); OUString sHelpText = SfxHelp_Impl::GetHelpText( sRealCommand.isEmpty() ? aCommandURL : sRealCommand, sModuleName ); OString aNewHelpId; @@ -564,7 +557,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const if ( nProtocol == INetProtocol::Uno ) // Command can be just an alias to another command. - aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( rURL, getCurrentFrame() ); + aRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand( rURL, getCurrentModuleIdentifier_Impl() ); // no URL, just a HelpID (maybe empty in case of keyword search) aHelpURL = CreateHelpURL_Impl( aRealCommand.isEmpty() ? rURL : aRealCommand, aHelpModuleName ); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 7e84a768bb01..071d6e1ceed2 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -720,7 +720,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) OUStringBuffer aBuffer( 60 ); aBuffer.append( vcl::CommandInfoProvider::GetLabelForCommand( ".uno:PrintDefault", - xFrame )); + vcl::CommandInfoProvider::GetModuleIdentifier( xFrame ) ) ); aBuffer.append( " (" ); aBuffer.append( aPrinterName ); aBuffer.append(')'); |