diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2008-11-19 16:40:06 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2008-11-19 16:40:06 +0000 |
commit | 35fadd14797672ecfa650dd6b7a50c5cc88c4d3d (patch) | |
tree | 8906a5ecc415a0a298c9fb31f2120aa0ec9d4dbd /sfx2 | |
parent | e7457a802dd7fa0b4089d461be28251e575617a9 (diff) |
CWS-TOOLING: integrate CWS oooimprovementcorefixes_DEV300
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/bindings.cxx | 27 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 32 |
2 files changed, 44 insertions, 15 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 596bcdd787..5659108c90 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -74,7 +74,9 @@ #include <sfx2/topfrm.hxx> #include <sfx2/objsh.hxx> #include <sfx2/msgpool.hxx> + #include <comphelper/uieventslogger.hxx> +#include <com/sun/star/frame/XModuleManager.hpp> using namespace ::com::sun::star; @@ -135,12 +137,6 @@ IMPL_LINK(SfxAsyncExec_Impl, TimerHdl, Timer*, pTimer) (void)pTimer; // unused aTimer.Stop(); - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<beans::PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("SfxAsyncExec")); - ::comphelper::UiEventsLogger::logDispatch(aCommand, source); - } Sequence<beans::PropertyValue> aSeq; xDisp->dispatch( aCommand, aSeq ); @@ -2839,6 +2835,25 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand ) ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = pImp->xProv->queryDispatch( aURL, ::rtl::OUString(), 0 ); if ( xDisp.is() ) { + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + { + ::rtl::OUString sAppName; + try + { + static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = + ::comphelper::getProcessServiceFactory(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager( + xServiceManager->createInstance(our_aModuleManagerName) + , ::com::sun::star::uno::UNO_QUERY_THROW); + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame( + pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY_THROW); + sAppName = xModuleManager->identify(xFrame); + } catch(::com::sun::star::uno::Exception&) {} + Sequence<beans::PropertyValue> source; + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString::createFromAscii("SfxAsyncExec")); + ::comphelper::UiEventsLogger::logDispatch(aURL, source); + } new SfxAsyncExec_Impl( aURL, xDisp ); return TRUE; } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index e3d46f744e..7058e86e27 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tbxitem.cxx,v $ - * $Revision: 1.70 $ + * $Revision: 1.70.80.2 $ * * This file is part of OpenOffice.org. * @@ -113,6 +113,7 @@ #include "imagemgr.hxx" #include <comphelper/uieventslogger.hxx> +#include <com/sun/star/frame/XModuleManager.hpp> //using namespace ::com::sun::star::awt; using namespace ::com::sun::star::beans; @@ -462,15 +463,7 @@ void SfxToolBoxControl::Dispatch( Reference < XDispatch > xDispatch = rProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); if ( xDispatch.is() ) - { - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("SfxToolBoxControl")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } xDispatch->dispatch( aTargetURL, aArgs ); - } } } @@ -491,7 +484,28 @@ void SfxToolBoxControl::Dispatch( const ::rtl::OUString& aCommand, ::com::sun::s Reference < XDispatch > xDispatch = xProvider->queryDispatch( aTargetURL, ::rtl::OUString(), 0 ); if ( xDispatch.is() ) + { + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + { + ::rtl::OUString sAppName; + try + { + static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = + ::comphelper::getProcessServiceFactory(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager( + xServiceManager->createInstance(our_aModuleManagerName) + , ::com::sun::star::uno::UNO_QUERY_THROW); + ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame( + getFrameInterface(), UNO_QUERY_THROW); + sAppName = xModuleManager->identify(xFrame); + } catch(::com::sun::star::uno::Exception&) {} + Sequence<PropertyValue> source; + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString::createFromAscii("SfxToolBoxControl")); + ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); + } xDispatch->dispatch( aTargetURL, aArgs ); + } } } |