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 /framework | |
parent | e7457a802dd7fa0b4089d461be28251e575617a9 (diff) |
CWS-TOOLING: integrate CWS oooimprovementcorefixes_DEV300
Diffstat (limited to 'framework')
19 files changed, 145 insertions, 426 deletions
diff --git a/framework/inc/dispatch/dispatchlogging.hxx b/framework/inc/dispatch/dispatchlogging.hxx deleted file mode 100644 index 1da8767bd2..0000000000 --- a/framework/inc/dispatch/dispatchlogging.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2008 by Sun Microsystems, Inc. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* $RCSfile: dispatchlogging.hxx,v $ -* -* $Revision: 1.2 $ -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* <http://www.openoffice.org/license.html> -* for a copy of the LGPLv3 License. -************************************************************************/ - -#ifndef __FRAMEWORK_HELPER_DISPATCHLOGGING_HXX_ -#define __FRAMEWORK_HELPER_DISPATCHLOGGING_HXX_ - -#include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XDispatchProviderInterception.hpp> -#include <com/sun/star/frame/XDispatch.hpp> -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/frame/DispatchDescriptor.hpp> - -#include <cppuhelper/weak.hxx> -#include <cppuhelper/weakref.hxx> - -namespace framework { - class DispatchLogging : - public ::com::sun::star::frame::XDispatchProvider, - public ::com::sun::star::frame::XDispatchProviderInterception, - public ::com::sun::star::lang::XEventListener, - public ::cppu::OWeakObject - { - public: - static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > createInstance( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider>& slave); - protected: - DispatchLogging() {}; - }; -} - -#endif // #ifndef __FRAMEWORK_HELPER_DISPATCHLOGGING_HXX_ diff --git a/framework/source/dispatch/dispatchlogging.cxx b/framework/source/dispatch/dispatchlogging.cxx deleted file mode 100644 index 6adb6f6173..0000000000 --- a/framework/source/dispatch/dispatchlogging.cxx +++ /dev/null @@ -1,252 +0,0 @@ -/************************************************************************* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2008 by Sun Microsystems, Inc. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* $RCSfile: dispatchlogging.cxx,v $ -* -* $Revision: 1.2 $ -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* <http://www.openoffice.org/license.html> -* for a copy of the LGPLv3 License. -************************************************************************/ - -#include <dispatch/dispatchlogging.hxx> - -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/frame/XSynchronousDispatch.hpp> -#include <com/sun/star/frame/XNotifyingDispatch.hpp> -#include <com/sun/star/frame/DispatchResultState.hpp> -#include <comphelper/uieventslogger.hxx> -#include <macros/debug/assertion.hxx> -#include <macros/xinterface.hxx> - -using namespace ::com::sun::star; -using namespace ::com::sun::star::frame; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; - -namespace { - /** - * @short a decorator around a XDispatch object that logs when dispatch() gets called - * @see http://en.wikipedia.org/wiki/Decorator_pattern - */ - class LoggingDispatcher : //public XDispatch, - public XSynchronousDispatch, - public XNotifyingDispatch, - public ::cppu::OWeakObject - { - public: - LoggingDispatcher(const Reference<XDispatch> slave); - FWK_DECLARE_XINTERFACE - virtual void SAL_CALL dispatch( - const util::URL& url, - const Sequence<PropertyValue>& args) - throw(RuntimeException); - virtual void SAL_CALL addStatusListener( - const Reference<XStatusListener>& control, - const util::URL& url) - throw(RuntimeException); - virtual void SAL_CALL removeStatusListener( - const Reference<XStatusListener>& control, - const util::URL& url) - throw(RuntimeException); - virtual void SAL_CALL dispatchWithNotification( - const util::URL& url, - const Sequence<PropertyValue>& args, - const Reference<XDispatchResultListener>& listener) - throw(RuntimeException); - virtual Any SAL_CALL dispatchWithReturnValue( - const util::URL& url, - const Sequence<PropertyValue>& args) - throw(RuntimeException); - private: - Reference<XDispatch> m_Slave; - }; - - /** - * @short a decorator around a XDispatchProvider object that logs when queried and - * returns XDispatch objects decorated with LoggingDispatcher - * (we are missing an explicit Decorator class, but the idea is the same) - * @see http://en.wikipedia.org/wiki/Decorator_pattern - */ - class DispatchLogging_Impl : public ::framework::DispatchLogging - { - public: - DispatchLogging_Impl(const Reference<XDispatchProvider>& slave); - FWK_DECLARE_XINTERFACE - virtual Reference<XDispatch> SAL_CALL queryDispatch( - const util::URL& url, - const ::rtl::OUString& target_frame_name, - sal_Int32 search_flags) - throw(RuntimeException); - virtual Sequence<Reference<XDispatch> > SAL_CALL queryDispatches( - const Sequence<DispatchDescriptor>& descriptor) - throw(RuntimeException); - virtual void SAL_CALL registerDispatchProviderInterceptor( - const Reference<XDispatchProviderInterceptor>& xInterceptor) - throw(RuntimeException); - virtual void SAL_CALL releaseDispatchProviderInterceptor( - const Reference<XDispatchProviderInterceptor>& xInterceptor) - throw(RuntimeException); - virtual void SAL_CALL disposing( - const lang::EventObject& event) - throw(RuntimeException); - - private: - const Reference<XDispatchProvider> m_Slave; - void checkSlave(); - }; - - // LoggingDispatcher implementation - LoggingDispatcher::LoggingDispatcher( - const Reference<XDispatch> slave) - : m_Slave(slave) - {} - - DEFINE_XINTERFACE_3(LoggingDispatcher, - ::cppu::OWeakObject, - DERIVED_INTERFACE(XDispatch, XNotifyingDispatch), - DIRECT_INTERFACE(XSynchronousDispatch), - DIRECT_INTERFACE(XNotifyingDispatch)) - - void LoggingDispatcher::dispatch( - const util::URL& url, - const Sequence<PropertyValue>& args) - throw(RuntimeException) - { - ::comphelper::UiEventsLogger::logDispatch(url, args); - m_Slave->dispatch(url, ::comphelper::UiEventsLogger::purgeDispatchOrigin(args)); - } - - void SAL_CALL LoggingDispatcher::dispatchWithNotification( - const util::URL& url, - const Sequence<PropertyValue>& args, - const Reference<XDispatchResultListener>& listener) - throw(RuntimeException) - { - ::comphelper::UiEventsLogger::logDispatch(url, args); - Reference<XNotifyingDispatch> ref(m_Slave, UNO_QUERY); - if(ref.is()) - ref->dispatchWithNotification(url, args, listener); - else - if(listener.is()) - { - DispatchResultEvent event; - event.State = DispatchResultState::FAILURE; - listener->dispatchFinished(event); - } - } - - Any SAL_CALL LoggingDispatcher::dispatchWithReturnValue( - const util::URL& url, - const Sequence<PropertyValue>& args) - throw(RuntimeException) - { - ::comphelper::UiEventsLogger::logDispatch(url, args); - Reference<XSynchronousDispatch> ref(m_Slave, UNO_QUERY); - if(ref.is()) - return ref->dispatchWithReturnValue(url, args); - else - return Any(); - } - - void LoggingDispatcher::addStatusListener( - const Reference<XStatusListener>& control, - const util::URL& url) - throw(RuntimeException) - { m_Slave->addStatusListener(control, url); } - - void LoggingDispatcher::removeStatusListener( - const Reference<XStatusListener>& control, - const util::URL& url) - throw(RuntimeException) - { m_Slave->removeStatusListener(control, url); } - - - // DispatchLogging implementation - DispatchLogging_Impl::DispatchLogging_Impl(const Reference<XDispatchProvider>& slave) - : m_Slave(slave) - { checkSlave(); } - - DEFINE_XINTERFACE_3(DispatchLogging_Impl, - ::cppu::OWeakObject, - DIRECT_INTERFACE(XDispatchProvider), - DIRECT_INTERFACE(XDispatchProviderInterception), - DIRECT_INTERFACE(lang::XEventListener)) - - Reference<XDispatch> DispatchLogging_Impl::queryDispatch( - const util::URL& url, - const ::rtl::OUString& target_frame_name, - sal_Int32 search_flags) - throw(RuntimeException) - { - Reference<XDispatch> slave_result = m_Slave->queryDispatch(url, target_frame_name, search_flags); - if(slave_result.is()) - return Reference<XDispatch>(new LoggingDispatcher(slave_result)); - return slave_result; - } - - Sequence<Reference<XDispatch> > DispatchLogging_Impl::queryDispatches( - const Sequence<DispatchDescriptor>& descriptors) - throw(RuntimeException) - { return m_Slave->queryDispatches(descriptors); } - - void DispatchLogging_Impl::registerDispatchProviderInterceptor( - const Reference<XDispatchProviderInterceptor>& interceptor) - throw(RuntimeException) - { - Reference<XDispatchProviderInterception> slave_as_inter(m_Slave, UNO_QUERY); - slave_as_inter->registerDispatchProviderInterceptor(interceptor); - } - - void DispatchLogging_Impl::releaseDispatchProviderInterceptor( - const Reference<XDispatchProviderInterceptor>& interceptor) - throw(RuntimeException) - { - Reference<XDispatchProviderInterception> slave_as_inter(m_Slave, UNO_QUERY); - slave_as_inter->releaseDispatchProviderInterceptor(interceptor); } - - void DispatchLogging_Impl::disposing( - const lang::EventObject& event) - throw(RuntimeException) - { - Reference<XEventListener> slave_as_el(m_Slave, UNO_QUERY); - slave_as_el->disposing(event); - } - - // a cleaner way would be a new interface for the slave inheriting from - // XDispatchProvider, XEventListener and XDispatchProviderInterceptor ... - void DispatchLogging_Impl::checkSlave() - { - Reference<XDispatchProviderInterception> slave_as_inter(m_Slave, UNO_QUERY); - Reference<XEventListener> slave_as_el(m_Slave, UNO_QUERY); - LOG_ASSERT2(!slave_as_inter.is(), - "DispatchLogging", "Slave does not support XDispatchProviderInterception, but should."); - LOG_ASSERT2(!slave_as_el.is(), - "DispatchLogging", "Slave does not support XEventListener, but should."); - } -} - -namespace framework { - Reference<XDispatchProvider> DispatchLogging::createInstance(const Reference<XDispatchProvider>& slave) - { - return Reference<XDispatchProvider>(new DispatchLogging_Impl(slave)); - } -} diff --git a/framework/source/inc/dispatch/uieventloghelper.hxx b/framework/source/inc/dispatch/uieventloghelper.hxx new file mode 100644 index 0000000000..8725454481 --- /dev/null +++ b/framework/source/inc/dispatch/uieventloghelper.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: uieventloghelper.hxx,v $ + * $Revision: 1.1.2.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __FRAMEWORK_DISPATCH_UIEVENTLOGHELPER_HXX_ +#define __FRAMEWORK_DISPATCH_UIEVENTLOGHELPER_HXX_ + +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/util/URL.hpp> +#include <comphelper/uieventslogger.hxx> +#include <rtl/ustring.hxx> + +namespace framework +{ + class UiEventLogHelper + { + public: + UiEventLogHelper(const ::rtl::OUString& aWidgetname) + : m_aWidgetName(aWidgetname) + , m_hasAppName(false) + { } + + void log(const ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager, + const ::com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& rModel, + const ::com::sun::star::util::URL& rUrl, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs) + { + + if(!m_hasAppName && rServiceManager.is() && rModel.is()) + { + try + { + static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager"); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager( + rServiceManager->createInstance(our_aModuleManagerName) + , ::com::sun::star::uno::UNO_QUERY_THROW); + m_aAppName = xModuleManager->identify(rModel); + m_hasAppName = true; + } catch(::com::sun::star::uno::Exception&) {} + } + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> aArgsWithOrigin(rArgs); + ::comphelper::UiEventsLogger::appendDispatchOrigin(aArgsWithOrigin, m_aAppName, m_aWidgetName); + ::comphelper::UiEventsLogger::logDispatch(rUrl, aArgsWithOrigin); + } + + private: + const ::rtl::OUString m_aWidgetName; + bool m_hasAppName; + ::rtl::OUString m_aAppName; + }; +} + +#endif // __FRAMEWORK_DISPATCH_UIEVENTLOGHELPER_HXX_ diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx index 353e6a81d1..8072c8f805 100644 --- a/framework/source/uielement/buttontoolbarcontroller.cxx +++ b/framework/source/uielement/buttontoolbarcontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: buttontoolbarcontroller.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.40.1 $ * * This file is part of OpenOffice.org. * @@ -70,7 +70,7 @@ #include <vcl/bitmap.hxx> #include <svtools/filter.hxx> #include <svtools/miscopt.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::awt; @@ -288,11 +288,7 @@ throw (::com::sun::star::uno::RuntimeException) aArgs[0].Value = makeAny( KeyModifier ); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("ButtonToolbarController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("ButtonToolbarController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); } catch ( DisposedException& ) diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index 806fb49cd3..a1bdb08e1f 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -65,7 +65,7 @@ #include <vcl/mnemonic.hxx> #endif #include <tools/urlobj.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::awt; @@ -159,6 +159,12 @@ throw ( RuntimeException ) pExecuteInfo->xDispatch = xDispatch; pExecuteInfo->aTargetURL = aTargetURL; pExecuteInfo->aArgs = aArgs; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + UiEventLogHelper(::rtl::OUString::createFromAscii("ComplexToolbarController")).log( + m_xServiceManager, + m_xFrame, + aTargetURL, + aArgs); Application::PostUserEvent( STATIC_LINK(0, ComplexToolbarController , ExecuteHdl_Impl), pExecuteInfo ); } } @@ -240,12 +246,6 @@ IMPL_STATIC_LINK_NOINSTANCE( ComplexToolbarController, ExecuteHdl_Impl, ExecuteI const sal_uInt32 nRef = Application::ReleaseSolarMutex(); try { - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("ComplexToolbarController")); - ::comphelper::UiEventsLogger::logDispatch(pExecuteInfo->aTargetURL, source); - } // Asynchronous execution as this can lead to our own destruction! // Framework can recycle our current frame and the layout manager disposes all user interface // elements if a component gets detached from its frame! diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index b0bb29c68c..f2402899c1 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: controlmenucontroller.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.40.1 $ * * This file is part of OpenOffice.org. * @@ -68,7 +68,7 @@ #include <tools/rcid.h> #include <vcl/image.hxx> #include <svtools/menuoptions.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> // Copied from svx // Function-Id's @@ -333,7 +333,7 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve break; } - if ( MENU_ITEM_NOTFOUND == nPrevInConversion ) + if ( MENU_ITEM_NOTFOUND == nPrevInConversion ) // none of the items which precede the nSID-slot in the source menu are present in our conversion menu nPrevInConversion = sal::static_int_cast< sal_uInt16 >(-1); // put the item at the first position @@ -385,11 +385,7 @@ void SAL_CALL ControlMenuController::select( const css::awt::MenuEvent& rEvent ) { Reference< XDispatch > xDispatch = pIter->second; if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<css::beans::PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("ControlMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("ControlMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); if ( xDispatch.is() ) xDispatch->dispatch( aTargetURL, aArgs ); } diff --git a/framework/source/uielement/fontmenucontroller.cxx b/framework/source/uielement/fontmenucontroller.cxx index f7c02b2930..eb23ac5c35 100644 --- a/framework/source/uielement/fontmenucontroller.cxx +++ b/framework/source/uielement/fontmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: fontmenucontroller.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.40.1 $ * * This file is part of OpenOffice.org. * @@ -62,7 +62,7 @@ #ifndef _VCL_MNEMONIC_HXX_ #include <vcl/mnemonic.hxx> #endif -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -215,11 +215,11 @@ void SAL_CALL FontMenuController::select( const css::awt::MenuEvent& rEvent ) th xURLTransformer->parseStrict( aTargetURL ); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("FontMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("FontMenuController")).log( + m_xServiceManager, + m_xFrame, + aTargetURL, + Sequence<PropertyValue>()); xDispatch->dispatch( aTargetURL, aArgs ); } } diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx index f593c0a1d5..6a2b967dcc 100644 --- a/framework/source/uielement/fontsizemenucontroller.cxx +++ b/framework/source/uielement/fontsizemenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: fontsizemenucontroller.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.40.1 $ * * This file is part of OpenOffice.org. * @@ -67,7 +67,7 @@ #ifndef _SVTOOLS_CTRLTOOL_HXX_ #include <svtools/ctrltool.hxx> #endif -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -360,11 +360,7 @@ void SAL_CALL FontSizeMenuController::select( const css::awt::MenuEvent& rEvent xURLTransformer->parseStrict( aTargetURL ); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("FontSizeMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("FontSizeMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); } } diff --git a/framework/source/uielement/footermenucontroller.cxx b/framework/source/uielement/footermenucontroller.cxx index 4e101c4906..454da1ca03 100644 --- a/framework/source/uielement/footermenucontroller.cxx +++ b/framework/source/uielement/footermenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: footermenucontroller.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.40.1 $ * * This file is part of OpenOffice.org. * @@ -65,7 +65,7 @@ #include <vcl/i18nhelp.hxx> #include <tools/urlobj.hxx> #include <rtl/ustrbuf.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -275,11 +275,7 @@ void SAL_CALL FooterMenuController::select( const css::awt::MenuEvent& rEvent ) xURLTransformer->parseStrict( aTargetURL ); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source(1); - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("FooterMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("FooterMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); } } diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 8cdf1ddea5..2a2d13d49c 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -66,7 +66,7 @@ #include <tools/urlobj.hxx> #include <classes/resource.hrc> #include <classes/fwkresid.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventslogger.hxx> using namespace ::com::sun::star::awt; using namespace ::com::sun::star::uno; @@ -203,6 +203,8 @@ throw ( RuntimeException ) pExecuteInfo->xDispatch = xDispatch; pExecuteInfo->aTargetURL = aTargetURL; pExecuteInfo->aArgs = aArgs; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + UiEventLogHelper(::rtl::OUString::createFromAscii("GenericToolbarController")).log( m_xServiceManager, m_xFrame, aTargetURL, aArgs); Application::PostUserEvent( STATIC_LINK(0, GenericToolbarController , ExecuteHdl_Impl), pExecuteInfo ); } } @@ -310,12 +312,6 @@ IMPL_STATIC_LINK_NOINSTANCE( GenericToolbarController, ExecuteHdl_Impl, ExecuteI const sal_uInt32 nRef = Application::ReleaseSolarMutex(); try { - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("GenericToolbarController")); - ::comphelper::UiEventsLogger::logDispatch(pExecuteInfo->aTargetURL, source); - } // Asynchronous execution as this can lead to our own destruction! // Framework can recycle our current frame and the layout manager disposes all user interface // elements if a component gets detached from its frame! diff --git a/framework/source/uielement/headermenucontroller.cxx b/framework/source/uielement/headermenucontroller.cxx index 59c1a4aff1..ac4f1f9728 100644 --- a/framework/source/uielement/headermenucontroller.cxx +++ b/framework/source/uielement/headermenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: headermenucontroller.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.40.1 $ * * This file is part of OpenOffice.org. * @@ -67,7 +67,7 @@ #include <tools/urlobj.hxx> #include <rtl/ustrbuf.hxx> //#include <tools/solar.hrc> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -283,11 +283,7 @@ void SAL_CALL HeaderMenuController::select( const css::awt::MenuEvent& rEvent ) xURLTransformer->parseStrict( aTargetURL ); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("HeaderMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("HeaderMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); } } diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx index 06b831e392..ca11f7a208 100644 --- a/framework/source/uielement/langselectionmenucontroller.cxx +++ b/framework/source/uielement/langselectionmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: langselectionmenucontroller.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.40.1 $ * * This file is part of OpenOffice.org. * @@ -77,7 +77,7 @@ #ifndef __FRAMEWORK_CLASSES_RESOURCE_HRC_ #include <classes/resource.hrc> #endif -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -235,11 +235,7 @@ void SAL_CALL LanguageSelectionMenuController::select( const css::awt::MenuEvent if ( xDispatch.is() ) { if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("LanguageSelectionMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("LanguageSelectionMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); } } diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index a01889ef09..041e92f986 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: langselectionstatusbarcontroller.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.40.1 $ * * This file is part of OpenOffice.org. * @@ -73,7 +73,7 @@ #include <com/sun/star/awt/Command.hpp> #include <svtools/languageoptions.hxx> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> using namespace ::cppu; using namespace ::com::sun::star; @@ -395,11 +395,7 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R { uno::Sequence< beans::PropertyValue > aPV; if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - uno::Sequence<beans::PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("LangSelectionStatusbarController")); - ::comphelper::UiEventsLogger::logDispatch(aURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("ButtonToolbarController")).log(m_xServiceManager, m_xFrame, aURL, aPV); xDispatch->dispatch( aURL, aPV); } } diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index db0d8fda27..eed8455db6 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: macrosmenucontroller.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.40.1 $ * * This file is part of OpenOffice.org. * @@ -49,7 +49,7 @@ #include <vcl/i18nhelp.hxx> #include <tools/urlobj.hxx> #include <rtl/ustrbuf.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -181,6 +181,8 @@ void SAL_CALL MacrosMenuController::select( const css::awt::MenuEvent& rEvent ) pExecuteInfo->xDispatch = xDispatch; pExecuteInfo->aTargetURL = aTargetURL; pExecuteInfo->aArgs = aArgs; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + UiEventLogHelper(::rtl::OUString::createFromAscii("MacrosMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); // xDispatch->dispatch( aTargetURL, aArgs ); Application::PostUserEvent( STATIC_LINK(0, MacrosMenuController , ExecuteHdl_Impl), pExecuteInfo ); } @@ -199,12 +201,6 @@ IMPL_STATIC_LINK_NOINSTANCE( MacrosMenuController, ExecuteHdl_Impl, ExecuteInfo* // Asynchronous execution as this can lead to our own destruction! // Framework can recycle our current frame and the layout manager disposes all user interface // elements if a component gets detached from its frame! - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("MacrosMenuController")); - ::comphelper::UiEventsLogger::logDispatch(pExecuteInfo->aTargetURL, source); - } pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs ); } catch ( Exception& ) diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 538ad61caf..f3d75d60e6 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: menubarmanager.cxx,v $ - * $Revision: 1.52 $ + * $Revision: 1.52.40.1 $ * * This file is part of OpenOffice.org. * @@ -99,7 +99,7 @@ #include "svtools/miscopt.hxx" #include <classes/addonmenu.hxx> #include <uielement/menubarmerger.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // namespace @@ -1399,11 +1399,7 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu ) { const sal_uInt32 nRef = Application::ReleaseSolarMutex(); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("MenuBarManager")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("MenuBarManager")).log(getServiceFactory(), m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); Application::AcquireSolarMutex( nRef ); } diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index c7e737acf1..5b06fa59ca 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: newmenucontroller.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.40.1 $ * * This file is part of OpenOffice.org. * @@ -69,7 +69,7 @@ #include <svtools/menuoptions.hxx> #include <svtools/acceleratorexecute.hxx> #include <svtools/moduleoptions.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -476,6 +476,8 @@ void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) thr pNewDocument->xDispatch = xDispatch; pNewDocument->aTargetURL = aTargetURL; pNewDocument->aArgSeq = aArgsList; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + UiEventLogHelper(::rtl::OUString::createFromAscii("NewMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgsList); Application::PostUserEvent( STATIC_LINK(0, NewMenuController, ExecuteHdl_Impl), pNewDocument ); } } @@ -634,12 +636,6 @@ IMPL_STATIC_LINK_NOINSTANCE( NewMenuController, ExecuteHdl_Impl, NewDocument*, p // Asynchronous execution as this can lead to our own destruction! // Framework can recycle our current frame and the layout manager disposes all user interface // elements if a component gets detached from its frame! - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("NewMenuController")); - ::comphelper::UiEventsLogger::logDispatch(pNewDocument->aTargetURL, source); - } pNewDocument->xDispatch->dispatch( pNewDocument->aTargetURL, pNewDocument->aArgSeq ); /* } diff --git a/framework/source/uielement/objectmenucontroller.cxx b/framework/source/uielement/objectmenucontroller.cxx index 2bc6b3a70f..3ed7cbb08c 100644 --- a/framework/source/uielement/objectmenucontroller.cxx +++ b/framework/source/uielement/objectmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: objectmenucontroller.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.40.1 $ * * This file is part of OpenOffice.org. * @@ -62,7 +62,7 @@ #include <vcl/i18nhelp.hxx> #include <tools/urlobj.hxx> #include <rtl/ustrbuf.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -192,11 +192,7 @@ void SAL_CALL ObjectMenuController::select( const css::awt::MenuEvent& rEvent ) xURLTransformer->parseStrict( aTargetURL ); if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("ObjectMenuController")); - ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); - } + UiEventLogHelper(::rtl::OUString::createFromAscii("ObjectMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); xDispatch->dispatch( aTargetURL, aArgs ); } } diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index f19f634278..15b267e8f4 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: recentfilesmenucontroller.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.40.1 $ * * This file is part of OpenOffice.org. * @@ -67,7 +67,7 @@ #include <cppuhelper/implbase1.hxx> #include <osl/file.hxx> //#include <tools/solar.hrc> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -308,6 +308,8 @@ void RecentFilesMenuController::executeEntry( sal_Int32 nIndex ) pLoadRecentFile->xDispatch = xDispatch; pLoadRecentFile->aTargetURL = aTargetURL; pLoadRecentFile->aArgSeq = aArgsList; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + UiEventLogHelper(::rtl::OUString::createFromAscii("RecentFilesMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgsList); Application::PostUserEvent( STATIC_LINK(0, RecentFilesMenuController, ExecuteHdl_Impl), pLoadRecentFile ); } } @@ -531,12 +533,6 @@ IMPL_STATIC_LINK_NOINSTANCE( RecentFilesMenuController, ExecuteHdl_Impl, LoadRec // Asynchronous execution as this can lead to our own destruction! // Framework can recycle our current frame and the layout manager disposes all user interface // elements if a component gets detached from its frame! - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("RecentFilesMenuController")); - ::comphelper::UiEventsLogger::logDispatch(pLoadRecentFile->aTargetURL, source); - } pLoadRecentFile->xDispatch->dispatch( pLoadRecentFile->aTargetURL, pLoadRecentFile->aArgSeq ); } catch ( Exception& ) diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index b43efd890a..4519b817c0 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: toolbarsmenucontroller.cxx,v $ - * $Revision: 1.21 $ + * $Revision: 1.21.40.1 $ * * This file is part of OpenOffice.org. * @@ -84,7 +84,7 @@ #include <vcl/window.hxx> #include <svtools/menuoptions.hxx> #include <svtools/cmdoptions.hxx> -#include <comphelper/uieventslogger.hxx> +#include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ // Defines @@ -760,6 +760,8 @@ void SAL_CALL ToolbarsMenuController::select( const css::awt::MenuEvent& rEvent pExecuteInfo->xDispatch = xDispatch; pExecuteInfo->aTargetURL = aTargetURL; pExecuteInfo->aArgs = aArgs; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + UiEventLogHelper(::rtl::OUString::createFromAscii("ToolbarsMenuController")).log(m_xServiceManager, m_xFrame, aTargetURL, aArgs); Application::PostUserEvent( STATIC_LINK(0, ToolbarsMenuController, ExecuteHdl_Impl), pExecuteInfo ); } } @@ -948,12 +950,6 @@ IMPL_STATIC_LINK_NOINSTANCE( ToolbarsMenuController, ExecuteHdl_Impl, ExecuteInf // elements if a component gets detached from its frame! if ( pExecuteInfo->xDispatch.is() ) { - if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# - { - Sequence<PropertyValue> source; - ::comphelper::UiEventsLogger::appendDispatchOrigin(source, rtl::OUString::createFromAscii("ToolbarsMenuController")); - ::comphelper::UiEventsLogger::logDispatch(pExecuteInfo->aTargetURL, source); - } pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs ); } } |