Kaydet (Commit) 61eed5f1 authored tarafından Noel Grandin's avatar Noel Grandin

convert sfx2 UNO services to WeakImplHelper

...removing the SFX_ UNO-related macros as a result.

Change-Id: I56542885847ff0adc604f309ed7e2582b7529f3f
üst 376d5a6a
......@@ -39,21 +39,20 @@
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase5.hxx>
#include <tools/errcode.hxx>
#include <sfx2/sfxuno.hxx>
class SfxObjectShell;
class SfxMacroLoader : public ::com::sun::star::frame::XDispatchProvider,
public ::com::sun::star::frame::XNotifyingDispatch,
public ::com::sun::star::frame::XSynchronousDispatch,
public ::com::sun::star::lang::XTypeProvider,
public ::com::sun::star::lang::XServiceInfo,
public ::com::sun::star::lang::XInitialization,
public ::cppu::OWeakObject
class SfxMacroLoader : public ::cppu::WeakImplHelper5<
css::frame::XDispatchProvider,
css::frame::XNotifyingDispatch,
css::frame::XSynchronousDispatch,
css::lang::XServiceInfo,
css::lang::XInitialization >
{
::com::sun::star::uno::WeakReference < ::com::sun::star::frame::XFrame > m_xFrame;
......@@ -61,7 +60,7 @@ class SfxMacroLoader : public ::com::sun::star::frame::XDispatchProvider,
public:
// XInterface, XTypeProvider, XServiceInfo
SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO
SFX_DECL_XSERVICEINFO
SfxMacroLoader( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
{}
......
......@@ -30,7 +30,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <sfx2/sfxuno.hxx>
#include <cppuhelper/implbase2.hxx>
// Interface for implementations which needs to get notifications about state changes
class SfxStatusListenerInterface
......@@ -42,14 +42,11 @@ class SfxStatusListenerInterface
~SfxStatusListenerInterface() {}
};
class SFX2_DLLPUBLIC SfxStatusListener :
public ::com::sun::star::frame::XStatusListener ,
public ::com::sun::star::lang::XTypeProvider ,
public ::com::sun::star::lang::XComponent ,
public ::cppu::OWeakObject
class SFX2_DLLPUBLIC SfxStatusListener : public ::cppu::WeakImplHelper2<
css::frame::XStatusListener,
css::lang::XComponent>
{
public:
SFX_DECL_XINTERFACE_XTYPEPROVIDER
SfxStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
virtual ~SfxStatusListener();
......
This diff is collapsed.
......@@ -33,10 +33,9 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/ctrlitem.hxx>
#include <osl/mutex.hxx>
......@@ -44,9 +43,7 @@ class SfxBindings;
class SfxFrame;
class SfxDispatcher;
class SfxUnoControllerItem : public ::com::sun::star::frame::XStatusListener ,
public ::com::sun::star::lang::XTypeProvider ,
public ::cppu::OWeakObject
class SfxUnoControllerItem : public ::cppu::WeakImplHelper1< css::frame::XStatusListener >
{
::com::sun::star::util::URL aCommand;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
......@@ -56,8 +53,6 @@ class SfxUnoControllerItem : public ::com::sun::star::frame::XStatusListener
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > TryGetDispatch( SfxFrame* pFrame );
public:
SFX_DECL_XINTERFACE_XTYPEPROVIDER
SfxUnoControllerItem( SfxControllerItem*, SfxBindings&, const String& );
~SfxUnoControllerItem();
......@@ -84,15 +79,12 @@ struct SfxStatusDispatcher_Impl_hashType
typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< OUString, SfxStatusDispatcher_Impl_hashType, std::equal_to< OUString > > SfxStatusDispatcher_Impl_ListenerContainer ;
class SfxStatusDispatcher : public ::com::sun::star::frame::XNotifyingDispatch,
public ::com::sun::star::lang::XTypeProvider,
public ::cppu::OWeakObject
class SfxStatusDispatcher : public ::cppu::WeakImplHelper1< css::frame::XNotifyingDispatch >
{
::osl::Mutex aMutex;
SfxStatusDispatcher_Impl_ListenerContainer aListeners;
public:
SFX_DECL_XINTERFACE_XTYPEPROVIDER
SfxStatusDispatcher();
......@@ -112,8 +104,7 @@ public:
class SfxSlotServer;
class SfxDispatchController_Impl;
class SfxOfficeDispatch : public SfxStatusDispatcher
, public ::com::sun::star::lang::XUnoTunnel
class SfxOfficeDispatch : public ::cppu::ImplInheritanceHelper1< SfxStatusDispatcher, css::lang::XUnoTunnel >
{
friend class SfxDispatchController_Impl;
SfxDispatchController_Impl* pControllerItem;
......@@ -127,8 +118,6 @@ public:
const ::com::sun::star::util::URL& rURL );
~SfxOfficeDispatch();
SFX_DECL_XINTERFACE_XTYPEPROVIDER
virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener )
......
......@@ -1714,8 +1714,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
rArgs = aSequ;
}
SFX_IMPL_XINTERFACE_5( SfxMacroLoader, OWeakObject, frame::XDispatchProvider, frame::XNotifyingDispatch, frame::XDispatch, frame::XSynchronousDispatch,lang::XInitialization )
SFX_IMPL_XTYPEPROVIDER_5( SfxMacroLoader, frame::XDispatchProvider, frame::XNotifyingDispatch, frame::XDispatch, frame::XSynchronousDispatch,lang::XInitialization )
SFX_IMPL_XSERVICEINFO( SfxMacroLoader, PROTOCOLHANDLER_SERVICENAME, "com.sun.star.comp.sfx2.SfxMacroLoader" )
SFX_IMPL_SINGLEFACTORY( SfxMacroLoader )
......
......@@ -152,9 +152,6 @@ DBG_NAME(SfxWorkWindow)
// Help to make changes to the alignment compatible!
SFX_IMPL_XINTERFACE_3( LayoutManagerListener, OWeakObject, ::com::sun::star::frame::XLayoutManagerListener, ::com::sun::star::lang::XEventListener, ::com::sun::star::lang::XComponent )
SFX_IMPL_XTYPEPROVIDER_3( LayoutManagerListener, ::com::sun::star::frame::XLayoutManagerListener, ::com::sun::star::lang::XEventListener, ::com::sun::star::lang::XComponent )
LayoutManagerListener::LayoutManagerListener(
SfxWorkWindow* pWrkWin ) :
m_bHasFrame( sal_False ),
......
......@@ -25,7 +25,7 @@
#include <svl/itemset.hxx>
#include <svtools/itemdel.hxx>
#include <svl/visitem.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
......@@ -42,12 +42,9 @@ using namespace ::com::sun::star::frame::status;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
class SfxQueryStatus_Impl : public ::com::sun::star::frame::XStatusListener ,
public ::com::sun::star::lang::XTypeProvider ,
public ::cppu::OWeakObject
class SfxQueryStatus_Impl : public ::cppu::WeakImplHelper1< css::frame::XStatusListener >
{
public:
SFX_DECL_XINTERFACE_XTYPEPROVIDER
SfxQueryStatus_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
virtual ~SfxQueryStatus_Impl();
......@@ -75,11 +72,7 @@ class SfxQueryStatus_Impl : public ::com::sun::star::frame::XStatusListener ,
com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > m_xDispatch;
};
SFX_IMPL_XINTERFACE_2( SfxQueryStatus_Impl, OWeakObject, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SFX_IMPL_XTYPEPROVIDER_2( SfxQueryStatus_Impl, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand ) :
cppu::OWeakObject(),
m_bQueryInProgress( sal_False ),
m_eState( SFX_ITEM_DISABLED ),
m_pItem( 0 ),
......
......@@ -48,11 +48,7 @@ using namespace ::com::sun::star::frame::status;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
SFX_IMPL_XINTERFACE_3( SfxStatusListener, OWeakObject, ::com::sun::star::lang::XComponent, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SFX_IMPL_XTYPEPROVIDER_3( SfxStatusListener, ::com::sun::star::lang::XComponent, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SfxStatusListener::SfxStatusListener( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand ) :
cppu::OWeakObject(),
m_nSlotID( nSlotId ),
m_xDispatchProvider( rDispatchProvider )
{
......
......@@ -59,9 +59,6 @@ using namespace ::com::sun::star::util;
DBG_NAME(SfxStateCache)
DBG_NAME(SfxStateCacheSetState)
SFX_IMPL_XINTERFACE_2( BindDispatch_Impl, OWeakObject, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SFX_IMPL_XTYPEPROVIDER_2( BindDispatch_Impl, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
//-----------------------------------------------------------------------------
BindDispatch_Impl::BindDispatch_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > & rDisp, const ::com::sun::star::util::URL& rURL, SfxStateCache *pStateCache, const SfxSlot* pS )
: xDisp( rDisp )
......
......@@ -89,9 +89,6 @@ const char* URLTypeNames[URLType_COUNT] =
"double"
};
SFX_IMPL_XINTERFACE_2( SfxUnoControllerItem, OWeakObject, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SFX_IMPL_XTYPEPROVIDER_2( SfxUnoControllerItem, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBindings& rBind, const String& rCmd )
: pCtrlItem( pItem )
, pBindings( &rBind )
......@@ -277,10 +274,6 @@ void SAL_CALL SfxStatusDispatcher::dispatchWithNotification(
{
}
SFX_IMPL_XINTERFACE_2( SfxStatusDispatcher, OWeakObject, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::frame::XDispatch )
SFX_IMPL_XTYPEPROVIDER_2( SfxStatusDispatcher, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::frame::XDispatch )
//IMPLNAME "com.sun.star.comp.sfx2.StatusDispatcher",
SfxStatusDispatcher::SfxStatusDispatcher()
: aListeners( aMutex )
{
......@@ -305,10 +298,6 @@ void SAL_CALL SfxStatusDispatcher::removeStatusListener( const ::com::sun::star:
aListeners.removeInterface( aURL.Complete, aListener );
}
SFX_IMPL_XINTERFACE_1( SfxOfficeDispatch, SfxStatusDispatcher, ::com::sun::star::lang::XUnoTunnel )
SFX_IMPL_XTYPEPROVIDER_2( SfxOfficeDispatch, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::lang::XUnoTunnel )
//-------------------------------------------------------------------------
// XUnoTunnel
sal_Int64 SAL_CALL SfxOfficeDispatch::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException)
......
......@@ -28,19 +28,15 @@
#include <com/sun/star/frame/FeatureStateEvent.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase1.hxx>
#include <sfx2/bindings.hxx>
#include "slotserv.hxx"
#include <sfx2/sfxuno.hxx>
class SfxControllerItem;
class SfxDispatcher;
class BindDispatch_Impl : public ::com::sun::star::frame::XStatusListener ,
public ::com::sun::star::lang::XTypeProvider ,
public ::cppu::OWeakObject
class BindDispatch_Impl : public ::cppu::WeakImplHelper1< css::frame::XStatusListener >
{
friend class SfxStateCache;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp;
......@@ -55,8 +51,6 @@ public:
const ::com::sun::star::util::URL& rURL,
SfxStateCache* pStateCache, const SfxSlot* pSlot );
SFX_DECL_XINTERFACE_XTYPEPROVIDER
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
......
......@@ -26,7 +26,7 @@
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/frame/XLayoutManagerListener.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/propshlp.hxx>
#include <rtl/ustring.hxx>
......@@ -172,17 +172,14 @@ struct SfxObjectBarList_Impl
//--------------------------------------------------------------------
class LayoutManagerListener : public ::com::sun::star::frame::XLayoutManagerListener,
public ::com::sun::star::lang::XTypeProvider,
public ::com::sun::star::lang::XComponent,
public ::cppu::OWeakObject
class LayoutManagerListener : public ::cppu::WeakImplHelper2<
css::frame::XLayoutManagerListener,
css::lang::XComponent >
{
public:
LayoutManagerListener( SfxWorkWindow* pWrkWin );
virtual ~LayoutManagerListener();
SFX_DECL_XINTERFACE_XTYPEPROVIDER
void setFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
//---------------------------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment