From 81ff7cfddb8e6786529f0a878007e9d399d4908a Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Tue, 17 Nov 2015 12:08:30 +0100 Subject: tdf#95845 Add methods for menu labels to CommandInfoProvider Change-Id: Ibf6a26940ec194f540255584776f8ebcefbb94ae --- framework/source/fwi/helper/mischelper.cxx | 71 ------------------------------ 1 file changed, 71 deletions(-) (limited to 'framework/source/fwi/helper') diff --git a/framework/source/fwi/helper/mischelper.cxx b/framework/source/fwi/helper/mischelper.cxx index 7201de053ba9..f8a1f753aafc 100644 --- a/framework/source/fwi/helper/mischelper.cxx +++ b/framework/source/fwi/helper/mischelper.cxx @@ -59,77 +59,6 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues return m_xLanguageGuesser; } -OUString RetrieveLabelFromCommand( - const OUString& aCmdURL, - const uno::Reference< uno::XComponentContext >& _xContext, - uno::Reference< container::XNameAccess >& _xUICommandLabels, - const uno::Reference< frame::XFrame >& _xFrame, - OUString& _rModuleIdentifier, - bool& _rIni, - const sal_Char* _pName) -{ - OUString aLabel; - - // Retrieve popup menu labels - if ( !_xUICommandLabels.is() ) - { - try - { - if ( !_rIni ) - { - _rIni = true; - Reference< XModuleManager2 > xModuleManager = ModuleManager::create( _xContext ); - - try - { - _rModuleIdentifier = xModuleManager->identify( _xFrame ); - } - catch( const Exception& ) - { - } - } - - Reference< XNameAccess > xNameAccess = frame::theUICommandDescription::get( _xContext ); - xNameAccess->getByName( _rModuleIdentifier ) >>= _xUICommandLabels; - } - catch ( const Exception& ) - { - } - } - - if ( _xUICommandLabels.is() ) - { - try - { - if ( !aCmdURL.isEmpty() ) - { - OUString aStr; - Sequence< PropertyValue > aPropSeq; - if( _xUICommandLabels->hasByName( aCmdURL ) ) - { - if ( _xUICommandLabels->getByName( aCmdURL ) >>= aPropSeq ) - { - for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) - { - if ( aPropSeq[i].Name.equalsAscii( _pName/*"Label"*/ )) - { - aPropSeq[i].Value >>= aStr; - break; - } - } - } - } - aLabel = aStr; - } - } - catch ( const css::uno::Exception& ) - { - } - } - - return aLabel; -} - void FillLangItems( std::set< OUString > &rLangItems, const uno::Reference< frame::XFrame > & rxFrame, const LanguageGuessingHelper & rLangGuessHelper, -- cgit