1*6d739b60SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6d739b60SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6d739b60SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6d739b60SAndrew Rist * distributed with this work for additional information 6*6d739b60SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6d739b60SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6d739b60SAndrew Rist * "License"); you may not use this file except in compliance 9*6d739b60SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*6d739b60SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*6d739b60SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6d739b60SAndrew Rist * software distributed under the License is distributed on an 15*6d739b60SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6d739b60SAndrew Rist * KIND, either express or implied. See the License for the 17*6d739b60SAndrew Rist * specific language governing permissions and limitations 18*6d739b60SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*6d739b60SAndrew Rist *************************************************************/ 21*6d739b60SAndrew Rist 22*6d739b60SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_framework.hxx" 26cdf0e10cSrcweir #include "acceleratorexecute.hxx" 27cdf0e10cSrcweir 28cdf0e10cSrcweir //=============================================== 29cdf0e10cSrcweir // includes 30cdf0e10cSrcweir 31cdf0e10cSrcweir #ifndef __COM_SUN_STAR_FRAME_XMODULEMANAGER_HPP_ 32cdf0e10cSrcweir #include <com/sun/star/frame/XModuleManager.hpp> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir #ifndef __COM_SUN_STAR_UI_XUICONFIGURATIONMANAGER_HPP_ 36cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp> 37cdf0e10cSrcweir #endif 38cdf0e10cSrcweir 39cdf0e10cSrcweir #ifndef __COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGERSUPPLIER_HPP_ 40cdf0e10cSrcweir #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> 41cdf0e10cSrcweir #endif 42cdf0e10cSrcweir 43cdf0e10cSrcweir #ifndef __COM_SUN_STAR_UI_XUICONFIGURATIONMANAGERSUPPLIER_HPP_ 44cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> 45cdf0e10cSrcweir #endif 46cdf0e10cSrcweir 47cdf0e10cSrcweir #ifndef __COM_SUN_STAR_AWT_KEYMODIFIER_HPP_ 48cdf0e10cSrcweir #include <com/sun/star/awt/KeyModifier.hpp> 49cdf0e10cSrcweir #endif 50cdf0e10cSrcweir 51cdf0e10cSrcweir #ifndef __COM_SUN_STAR_UNO_SEQUENCE_HXX_ 52cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 53cdf0e10cSrcweir #endif 54cdf0e10cSrcweir 55cdf0e10cSrcweir #ifndef __COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ 56cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 57cdf0e10cSrcweir #endif 58cdf0e10cSrcweir 59cdf0e10cSrcweir //=============================================== 60cdf0e10cSrcweir // namespace 61cdf0e10cSrcweir 62cdf0e10cSrcweir namespace svt 63cdf0e10cSrcweir { 64cdf0e10cSrcweir 65cdf0e10cSrcweir namespace css = ::com::sun::star; 66cdf0e10cSrcweir 67cdf0e10cSrcweir //=============================================== 68cdf0e10cSrcweir // definitions 69cdf0e10cSrcweir 70cdf0e10cSrcweir //----------------------------------------------- 71cdf0e10cSrcweir AcceleratorExecute::AcceleratorExecute() 72cdf0e10cSrcweir : TMutexInit ( ) 73cdf0e10cSrcweir , m_aAsyncCallback(LINK(this, AcceleratorExecute, impl_ts_asyncCallback)) 74cdf0e10cSrcweir { 75cdf0e10cSrcweir } 76cdf0e10cSrcweir 77cdf0e10cSrcweir //----------------------------------------------- 78cdf0e10cSrcweir AcceleratorExecute::AcceleratorExecute(const AcceleratorExecute& rCopy) 79cdf0e10cSrcweir : TMutexInit ( ) 80cdf0e10cSrcweir , m_aAsyncCallback(LINK(this, AcceleratorExecute, impl_ts_asyncCallback)) 81cdf0e10cSrcweir { 82cdf0e10cSrcweir // copy construction sint supported in real ... 83cdf0e10cSrcweir // but we need this ctor to init our async callback ... 84cdf0e10cSrcweir } 85cdf0e10cSrcweir 86cdf0e10cSrcweir //----------------------------------------------- 87cdf0e10cSrcweir AcceleratorExecute::~AcceleratorExecute() 88cdf0e10cSrcweir { 89cdf0e10cSrcweir // does nothing real 90cdf0e10cSrcweir } 91cdf0e10cSrcweir 92cdf0e10cSrcweir //----------------------------------------------- 93cdf0e10cSrcweir AcceleratorExecute* AcceleratorExecute::createAcceleratorHelper() 94cdf0e10cSrcweir { 95cdf0e10cSrcweir AcceleratorExecute* pNew = new AcceleratorExecute(); 96cdf0e10cSrcweir return pNew; 97cdf0e10cSrcweir } 98cdf0e10cSrcweir 99cdf0e10cSrcweir //----------------------------------------------- 100cdf0e10cSrcweir void AcceleratorExecute::init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR, 101cdf0e10cSrcweir const css::uno::Reference< css::frame::XFrame >& xEnv ) 102cdf0e10cSrcweir { 103cdf0e10cSrcweir // SAFE -> ---------------------------------- 104cdf0e10cSrcweir ::osl::ResettableMutexGuard aLock(m_aLock); 105cdf0e10cSrcweir 106cdf0e10cSrcweir // take over the uno service manager 107cdf0e10cSrcweir m_xSMGR = xSMGR; 108cdf0e10cSrcweir 109cdf0e10cSrcweir // specify our internal dispatch provider 110cdf0e10cSrcweir // frame or desktop?! => document or global config. 111cdf0e10cSrcweir sal_Bool bDesktopIsUsed = sal_False; 112cdf0e10cSrcweir m_xDispatcher = css::uno::Reference< css::frame::XDispatchProvider >(xEnv, css::uno::UNO_QUERY); 113cdf0e10cSrcweir if (!m_xDispatcher.is()) 114cdf0e10cSrcweir { 115cdf0e10cSrcweir aLock.clear(); 116cdf0e10cSrcweir // <- SAFE ------------------------------ 117cdf0e10cSrcweir 118cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatchProvider > xDispatcher( 119cdf0e10cSrcweir xSMGR->createInstance(SERVICENAME_DESKTOP), 120cdf0e10cSrcweir css::uno::UNO_QUERY_THROW); 121cdf0e10cSrcweir 122cdf0e10cSrcweir // SAFE -> ------------------------------ 123cdf0e10cSrcweir aLock.reset(); 124cdf0e10cSrcweir 125cdf0e10cSrcweir m_xDispatcher = xDispatcher; 126cdf0e10cSrcweir bDesktopIsUsed = sal_True; 127cdf0e10cSrcweir } 128cdf0e10cSrcweir 129cdf0e10cSrcweir aLock.clear(); 130cdf0e10cSrcweir // <- SAFE ---------------------------------- 131cdf0e10cSrcweir 132cdf0e10cSrcweir // open all needed configuration objects 133cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg; 134cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xModuleCfg; 135cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg ; 136cdf0e10cSrcweir 137cdf0e10cSrcweir // global cfg 138cdf0e10cSrcweir xGlobalCfg = AcceleratorExecute::impl_st_openGlobalConfig(xSMGR); 139cdf0e10cSrcweir if (!bDesktopIsUsed) 140cdf0e10cSrcweir { 141cdf0e10cSrcweir // module cfg 142cdf0e10cSrcweir xModuleCfg = AcceleratorExecute::impl_st_openModuleConfig(xSMGR, xEnv); 143cdf0e10cSrcweir 144cdf0e10cSrcweir // doc cfg 145cdf0e10cSrcweir css::uno::Reference< css::frame::XController > xController; 146cdf0e10cSrcweir css::uno::Reference< css::frame::XModel > xModel; 147cdf0e10cSrcweir xController = xEnv->getController(); 148cdf0e10cSrcweir if (xController.is()) 149cdf0e10cSrcweir xModel = xController->getModel(); 150cdf0e10cSrcweir if (xModel.is()) 151cdf0e10cSrcweir xDocCfg = AcceleratorExecute::impl_st_openDocConfig(xModel); 152cdf0e10cSrcweir } 153cdf0e10cSrcweir 154cdf0e10cSrcweir // SAFE -> ------------------------------ 155cdf0e10cSrcweir aLock.reset(); 156cdf0e10cSrcweir 157cdf0e10cSrcweir m_xGlobalCfg = xGlobalCfg; 158cdf0e10cSrcweir m_xModuleCfg = xModuleCfg; 159cdf0e10cSrcweir m_xDocCfg = xDocCfg ; 160cdf0e10cSrcweir 161cdf0e10cSrcweir aLock.clear(); 162cdf0e10cSrcweir // <- SAFE ---------------------------------- 163cdf0e10cSrcweir } 164cdf0e10cSrcweir 165cdf0e10cSrcweir //----------------------------------------------- 166cdf0e10cSrcweir void AcceleratorExecute::execute(const KeyCode& aVCLKey) 167cdf0e10cSrcweir { 168cdf0e10cSrcweir css::awt::KeyEvent aAWTKey = AcceleratorExecute::st_VCLKey2AWTKey(aVCLKey); 169cdf0e10cSrcweir execute(aAWTKey); 170cdf0e10cSrcweir } 171cdf0e10cSrcweir 172cdf0e10cSrcweir //----------------------------------------------- 173cdf0e10cSrcweir void AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey) 174cdf0e10cSrcweir { 175cdf0e10cSrcweir ::rtl::OUString sCommand = impl_ts_findCommand(aAWTKey); 176cdf0e10cSrcweir 177cdf0e10cSrcweir // No Command found? Do nothing! User isnt interested on any error handling .-) 178cdf0e10cSrcweir if (!sCommand.getLength()) 179cdf0e10cSrcweir return; 180cdf0e10cSrcweir 181cdf0e10cSrcweir // SAFE -> ---------------------------------- 182cdf0e10cSrcweir ::osl::ResettableMutexGuard aLock(m_aLock); 183cdf0e10cSrcweir 184cdf0e10cSrcweir m_lCommandQueue.push_back(sCommand); 185cdf0e10cSrcweir m_aAsyncCallback.Post(0); 186cdf0e10cSrcweir 187cdf0e10cSrcweir aLock.clear(); 188cdf0e10cSrcweir // <- SAFE ---------------------------------- 189cdf0e10cSrcweir } 190cdf0e10cSrcweir 191cdf0e10cSrcweir //----------------------------------------------- 192cdf0e10cSrcweir css::awt::KeyEvent AcceleratorExecute::st_VCLKey2AWTKey(const KeyCode& aVCLKey) 193cdf0e10cSrcweir { 194cdf0e10cSrcweir css::awt::KeyEvent aAWTKey; 195cdf0e10cSrcweir aAWTKey.Modifiers = 0; 196cdf0e10cSrcweir aAWTKey.KeyCode = (sal_Int16)aVCLKey.GetCode(); 197cdf0e10cSrcweir 198cdf0e10cSrcweir if (aVCLKey.IsShift()) 199cdf0e10cSrcweir aAWTKey.Modifiers |= css::awt::KeyModifier::SHIFT; 200cdf0e10cSrcweir if (aVCLKey.IsMod1()) 201cdf0e10cSrcweir aAWTKey.Modifiers |= css::awt::KeyModifier::MOD1; 202cdf0e10cSrcweir if (aVCLKey.IsMod2()) 203cdf0e10cSrcweir aAWTKey.Modifiers |= css::awt::KeyModifier::MOD2; 204cdf0e10cSrcweir if (aVCLKey.IsMod3()) 205cdf0e10cSrcweir aAWTKey.Modifiers |= css::awt::KeyModifier::MOD3; 206cdf0e10cSrcweir 207cdf0e10cSrcweir return aAWTKey; 208cdf0e10cSrcweir } 209cdf0e10cSrcweir 210cdf0e10cSrcweir /* 211cdf0e10cSrcweir ViewFrame->GetObjectShell 212cdf0e10cSrcweir ObjectShell->GetStyleSheetPool 213cdf0e10cSrcweir */ 214cdf0e10cSrcweir 215cdf0e10cSrcweir //----------------------------------------------- 216cdf0e10cSrcweir KeyCode AcceleratorExecute::st_AWTKey2VCLKey(const css::awt::KeyEvent& aAWTKey) 217cdf0e10cSrcweir { 218cdf0e10cSrcweir sal_Bool bShift = ((aAWTKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT ); 219cdf0e10cSrcweir sal_Bool bMod1 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD1 ) == css::awt::KeyModifier::MOD1 ); 220cdf0e10cSrcweir sal_Bool bMod2 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD2 ) == css::awt::KeyModifier::MOD2 ); 221cdf0e10cSrcweir sal_Bool bMod3 = ((aAWTKey.Modifiers & css::awt::KeyModifier::MOD3 ) == css::awt::KeyModifier::MOD3 ); 222cdf0e10cSrcweir sal_uInt16 nKey = (sal_uInt16)aAWTKey.KeyCode; 223cdf0e10cSrcweir 224cdf0e10cSrcweir return KeyCode(nKey, bShift, bMod1, bMod2, bMod3); 225cdf0e10cSrcweir } 226cdf0e10cSrcweir 227cdf0e10cSrcweir //----------------------------------------------- 228cdf0e10cSrcweir ::rtl::OUString AcceleratorExecute::impl_ts_findCommand(const css::awt::KeyEvent& aKey) 229cdf0e10cSrcweir { 230cdf0e10cSrcweir // SAFE -> ---------------------------------- 231cdf0e10cSrcweir ::osl::ResettableMutexGuard aLock(m_aLock); 232cdf0e10cSrcweir 233cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = m_xGlobalCfg; 234cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xModuleCfg = m_xModuleCfg; 235cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xDocCfg = m_xDocCfg ; 236cdf0e10cSrcweir 237cdf0e10cSrcweir aLock.clear(); 238cdf0e10cSrcweir // <- SAFE ---------------------------------- 239cdf0e10cSrcweir 240cdf0e10cSrcweir ::rtl::OUString sCommand; 241cdf0e10cSrcweir try 242cdf0e10cSrcweir { 243cdf0e10cSrcweir if (xDocCfg.is()) 244cdf0e10cSrcweir sCommand = xDocCfg->getCommandByKeyEvent(aKey); 245cdf0e10cSrcweir } 246cdf0e10cSrcweir catch(const css::container::NoSuchElementException&) 247cdf0e10cSrcweir { 248cdf0e10cSrcweir try 249cdf0e10cSrcweir { 250cdf0e10cSrcweir if (xModuleCfg.is()) 251cdf0e10cSrcweir sCommand = xModuleCfg->getCommandByKeyEvent(aKey); 252cdf0e10cSrcweir } 253cdf0e10cSrcweir catch(const css::container::NoSuchElementException&) 254cdf0e10cSrcweir { 255cdf0e10cSrcweir try 256cdf0e10cSrcweir { 257cdf0e10cSrcweir if (xGlobalCfg.is()) 258cdf0e10cSrcweir sCommand = xGlobalCfg->getCommandByKeyEvent(aKey); 259cdf0e10cSrcweir } 260cdf0e10cSrcweir catch(const css::container::NoSuchElementException&) 261cdf0e10cSrcweir {} 262cdf0e10cSrcweir } 263cdf0e10cSrcweir } 264cdf0e10cSrcweir 265cdf0e10cSrcweir return sCommand; 266cdf0e10cSrcweir } 267cdf0e10cSrcweir 268cdf0e10cSrcweir //----------------------------------------------- 269cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::impl_st_openGlobalConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) 270cdf0e10cSrcweir { 271cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg( 272cdf0e10cSrcweir xSMGR->createInstance(SERVICENAME_GLOBALACCELERATORCONFIGURATION), 273cdf0e10cSrcweir css::uno::UNO_QUERY_THROW); 274cdf0e10cSrcweir return xAccCfg; 275cdf0e10cSrcweir } 276cdf0e10cSrcweir 277cdf0e10cSrcweir //----------------------------------------------- 278cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::impl_st_openModuleConfig(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , 279cdf0e10cSrcweir const css::uno::Reference< css::frame::XFrame >& xFrame) 280cdf0e10cSrcweir { 281cdf0e10cSrcweir css::uno::Reference< css::frame::XModuleManager > xModuleDetection( 282cdf0e10cSrcweir xSMGR->createInstance(SERVICENAME_MODULEMANAGER), 283cdf0e10cSrcweir css::uno::UNO_QUERY_THROW); 284cdf0e10cSrcweir 285cdf0e10cSrcweir ::rtl::OUString sModule; 286cdf0e10cSrcweir try 287cdf0e10cSrcweir { 288cdf0e10cSrcweir sModule = xModuleDetection->identify(xFrame); 289cdf0e10cSrcweir } 290cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRuntime) 291cdf0e10cSrcweir { throw exRuntime; } 292cdf0e10cSrcweir catch(const css::uno::Exception&) 293cdf0e10cSrcweir { return css::uno::Reference< css::ui::XAcceleratorConfiguration >(); } 294cdf0e10cSrcweir 295cdf0e10cSrcweir css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUISupplier( 296cdf0e10cSrcweir xSMGR->createInstance(SERVICENAME_MODULEUICONFIGURATIONMANAGERSUPPLIER), 297cdf0e10cSrcweir css::uno::UNO_QUERY_THROW); 298cdf0e10cSrcweir 299cdf0e10cSrcweir css::uno::Reference< css::ui::XUIConfigurationManager > xUIManager = xUISupplier->getUIConfigurationManager(sModule); 300cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg (xUIManager->getShortCutManager(), css::uno::UNO_QUERY_THROW); 301cdf0e10cSrcweir return xAccCfg; 302cdf0e10cSrcweir } 303cdf0e10cSrcweir 304cdf0e10cSrcweir //----------------------------------------------- 305cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > AcceleratorExecute::impl_st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel) 306cdf0e10cSrcweir { 307cdf0e10cSrcweir css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xUISupplier(xModel, css::uno::UNO_QUERY_THROW); 308cdf0e10cSrcweir css::uno::Reference< css::ui::XUIConfigurationManager > xUIManager = xUISupplier->getUIConfigurationManager(); 309cdf0e10cSrcweir css::uno::Reference< css::ui::XAcceleratorConfiguration > xAccCfg (xUIManager->getShortCutManager(), css::uno::UNO_QUERY_THROW); 310cdf0e10cSrcweir return xAccCfg; 311cdf0e10cSrcweir } 312cdf0e10cSrcweir 313cdf0e10cSrcweir //----------------------------------------------- 314cdf0e10cSrcweir css::uno::Reference< css::util::XURLTransformer > AcceleratorExecute::impl_ts_getURLParser() 315cdf0e10cSrcweir { 316cdf0e10cSrcweir // SAFE -> ---------------------------------- 317cdf0e10cSrcweir ::osl::ResettableMutexGuard aLock(m_aLock); 318cdf0e10cSrcweir 319cdf0e10cSrcweir if (m_xURLParser.is()) 320cdf0e10cSrcweir return m_xURLParser; 321cdf0e10cSrcweir css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR; 322cdf0e10cSrcweir 323cdf0e10cSrcweir aLock.clear(); 324cdf0e10cSrcweir // <- SAFE ---------------------------------- 325cdf0e10cSrcweir 326cdf0e10cSrcweir css::uno::Reference< css::util::XURLTransformer > xParser( 327cdf0e10cSrcweir xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), 328cdf0e10cSrcweir css::uno::UNO_QUERY_THROW); 329cdf0e10cSrcweir 330cdf0e10cSrcweir // SAFE -> ---------------------------------- 331cdf0e10cSrcweir aLock.reset(); 332cdf0e10cSrcweir m_xURLParser = xParser; 333cdf0e10cSrcweir aLock.clear(); 334cdf0e10cSrcweir // <- SAFE ---------------------------------- 335cdf0e10cSrcweir 336cdf0e10cSrcweir return xParser; 337cdf0e10cSrcweir } 338cdf0e10cSrcweir 339cdf0e10cSrcweir //----------------------------------------------- 340cdf0e10cSrcweir IMPL_LINK(AcceleratorExecute, impl_ts_asyncCallback, void*, pVoid) 341cdf0e10cSrcweir { 342cdf0e10cSrcweir // SAFE -> ---------------------------------- 343cdf0e10cSrcweir ::osl::ResettableMutexGuard aLock(m_aLock); 344cdf0e10cSrcweir 345cdf0e10cSrcweir TCommandQueue::iterator pIt = m_lCommandQueue.begin(); 346cdf0e10cSrcweir if (pIt == m_lCommandQueue.end()) 347cdf0e10cSrcweir return 0; 348cdf0e10cSrcweir ::rtl::OUString sCommand = *pIt; 349cdf0e10cSrcweir m_lCommandQueue.erase(pIt); 350cdf0e10cSrcweir 351cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatchProvider > xProvider = m_xDispatcher; 352cdf0e10cSrcweir 353cdf0e10cSrcweir aLock.clear(); 354cdf0e10cSrcweir // <- SAFE ---------------------------------- 355cdf0e10cSrcweir 356cdf0e10cSrcweir // convert command in URL structure 357cdf0e10cSrcweir css::uno::Reference< css::util::XURLTransformer > xParser = impl_ts_getURLParser(); 358cdf0e10cSrcweir css::util::URL aURL; 359cdf0e10cSrcweir aURL.Complete = sCommand; 360cdf0e10cSrcweir xParser->parseStrict(aURL); 361cdf0e10cSrcweir 362cdf0e10cSrcweir // ask for dispatch object 363cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatch > xDispatch = xProvider->queryDispatch(aURL, ::rtl::OUString(), 0); 364cdf0e10cSrcweir css::uno::Sequence< css::beans::PropertyValue> aArgs; 365cdf0e10cSrcweir if (xDispatch.is()) 366cdf0e10cSrcweir { 367cdf0e10cSrcweir if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# 368cdf0e10cSrcweir { 369cdf0e10cSrcweir Sequence<css::beans::PropertyValue> source; 370cdf0e10cSrcweir ::comphelper::UiEventsLogger::appendDispatchOrigin(OUString::createFromAscii("AcceleratorExecute")); 371cdf0e10cSrcweir ::comphelper::UiEventsLogger::logDispatch(aURL, source); 372cdf0e10cSrcweir } 373cdf0e10cSrcweir xDispatch->dispatch(aURL, css::uno::Sequence< css::beans::PropertyValue >()); 374cdf0e10cSrcweir } 375cdf0e10cSrcweir return 0; 376cdf0e10cSrcweir } 377cdf0e10cSrcweir 378cdf0e10cSrcweir } // namespace svt 379