diff options
Diffstat (limited to 'cui/source/customize/acccfg.cxx')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 158 |
1 files changed, 0 insertions, 158 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 50e22f9a8..f96adaf6d 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -1366,133 +1366,6 @@ IMPL_LINK( SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, EMPTYARG return 0; } -::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL ) -{ - ::rtl::OUString aLabel; - if ( aCmdURL.getLength() ) - { - try - { - uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY ); - if ( xNameAccess.is() ) - { - uno::Reference< container::XNameAccess > xUICommandLabels; - const ::rtl::OUString aModule( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ); - uno::Any a = xNameAccess->getByName( aModule ); - uno::Reference< container::XNameAccess > xUICommands; - a >>= xUICommandLabels; - rtl::OUString aStr; - uno::Sequence< beans::PropertyValue > aPropSeq; - a = xUICommandLabels->getByName( aCmdURL ); - if ( a >>= aPropSeq ) - { - for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ ) - { - if ( aPropSeq[i].Name.equalsAscii( "Name" )) - { - aPropSeq[i].Value >>= aStr; - break; - } - } - } - aLabel = aStr; - } - } - catch ( uno::Exception& ) - { - } - } - - return aLabel; -} - - -//----------------------------------------------- -String SfxAcceleratorConfigPage::GetFunctionName(KeyFuncType eType) const -{ - ::rtl::OUStringBuffer sName(256); - sName.appendAscii("\""); - switch(eType) - { - case KEYFUNC_NEW : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:NewDoc") ) ); - break; - - case KEYFUNC_OPEN : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Open") ) ); - break; - - case KEYFUNC_SAVE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Save") ) ); - break; - - case KEYFUNC_SAVEAS : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:SaveAs") ) ); - break; - - case KEYFUNC_PRINT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Print") ) ); - break; - - case KEYFUNC_CLOSE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Close") ) ); - break; - - case KEYFUNC_QUIT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Quit") ) ); - break; - - case KEYFUNC_CUT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Cut") ) ); - break; - - case KEYFUNC_COPY : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Copy") ) ); - break; - - case KEYFUNC_PASTE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Paste") ) ); - break; - - case KEYFUNC_UNDO : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Undo") ) ); - break; - - case KEYFUNC_REDO : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Redo") ) ); - break; - - case KEYFUNC_DELETE : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Delete") ) ); - break; - - case KEYFUNC_REPEAT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Repeat") ) ); - break; - - case KEYFUNC_FIND : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Search") ) ); - break; - - case KEYFUNC_FINDBACKWARD : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:SearchBackwards") ) ); - break; - - case KEYFUNC_PROPERTIES : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:Options") ) ); - break; - - case KEYFUNC_FRONT : - sName.append( RetrieveLabelFromCommand( ::rtl::OUString::createFromAscii(".uno:ToFront") ) ); - break; - - default: - break; - } - sName.appendAscii("\""); - return String(sName.makeStringAndClear()); -} - //----------------------------------------------- void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle ) { @@ -1575,37 +1448,6 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet ) } //----------------------------------------------- -void SfxAcceleratorConfigPage::SelectMacro(const SfxMacroInfoItem *pItem) -{ - m_pMacroInfoItem = pItem; - pGroupLBox->SelectMacro( pItem ); -} - -//----------------------------------------------- -void SfxAcceleratorConfigPage::CopySource2Target(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xSourceAccMgr, - const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xTargetAccMgr) -{ - const css::uno::Sequence< css::awt::KeyEvent > lKeys = xSourceAccMgr->getAllKeyEvents(); - sal_Int32 c = lKeys.getLength(); - sal_Int32 i = 0; - for (i=0; i<c; ++i) - { - const css::awt::KeyEvent& rKey = lKeys[i]; - ::rtl::OUString sCommand = xSourceAccMgr->getCommandByKeyEvent(rKey); - xTargetAccMgr->setKeyEvent(rKey, sCommand); - } -} - -//----------------------------------------------- -KeyCode SfxAcceleratorConfigPage::MapPosToKeyCode(USHORT nPos) const -{ - TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData(); - KeyCode aCode(KEYCODE_ARRAY[pEntry->m_nKeyPos] & 0xFFF , - KEYCODE_ARRAY[pEntry->m_nKeyPos] & (KEY_SHIFT | KEY_MOD2)); - return aCode; -} - -//----------------------------------------------- USHORT SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const { USHORT nCode1 = aKey.GetCode()+aKey.GetModifier(); |