fdo#54938 Convert framework to cppu::supportsService
Change-Id: Id0c7c845d128920ba278de4208f5c32dcf83ecb1 Reviewed-on: https://gerrit.libreoffice.org/7754 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Marcos Souza <marcos.souza.org@gmail.com> Tested-by: Marcos Souza <marcos.souza.org@gmail.com>
This commit is contained in:
committed by
Marcos Souza
parent
22d80c90c8
commit
a91de8efc9
@@ -35,12 +35,12 @@
|
||||
#include <cppuhelper/factory.hxx>
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <comphelper/sequence.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
namespace framework{
|
||||
|
||||
/*_________________________________________________________________________________________________________________
|
||||
|
||||
/*
|
||||
macros for declaration and definition of XServiceInfo
|
||||
Please use follow public macros only!
|
||||
|
||||
@@ -48,65 +48,43 @@ namespace framework{
|
||||
2) DEFINE_XSERVICEINFO_MULTISERVICE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) => use it to define XServiceInfo for multi service mode
|
||||
3) DEFINE_XSERVICEINFO_ONEINSTANCESERVICE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) => use it to define XServiceInfo for one instance service mode
|
||||
4) DEFINE_INIT_SERVICE( CLASS ) => use it to implement your own impl_initService() method, which is necessary for initializeing object by using his own reference!
|
||||
*/
|
||||
|
||||
_________________________________________________________________________________________________________________*/
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// private
|
||||
// implementation of XServiceInfo and helper functions
|
||||
//*****************************************************************************************************************
|
||||
#define PRIVATE_DEFINE_XSERVICEINFO_BASE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
/*===========================================================================================================*/ \
|
||||
/* XServiceInfo */ \
|
||||
/*===========================================================================================================*/ \
|
||||
OUString SAL_CALL CLASS::getImplementationName() throw( css::uno::RuntimeException ) \
|
||||
\
|
||||
OUString SAL_CALL CLASS::getImplementationName() throw( css::uno::RuntimeException ) \
|
||||
{ \
|
||||
return impl_getStaticImplementationName(); \
|
||||
} \
|
||||
\
|
||||
/*===========================================================================================================*/ \
|
||||
/* XServiceInfo */ \
|
||||
/*===========================================================================================================*/ \
|
||||
sal_Bool SAL_CALL CLASS::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ) \
|
||||
sal_Bool SAL_CALL CLASS::supportsService( const OUString& sServiceName ) throw( css::uno::RuntimeException ) \
|
||||
{ \
|
||||
return ::comphelper::findValue(getSupportedServiceNames(), sServiceName, sal_True).getLength() != 0; \
|
||||
return cppu::supportsService(this, sServiceName); \
|
||||
} \
|
||||
\
|
||||
/*===========================================================================================================*/ \
|
||||
/* XServiceInfo */ \
|
||||
/*===========================================================================================================*/ \
|
||||
css::uno::Sequence< OUString > SAL_CALL CLASS::getSupportedServiceNames() throw( css::uno::RuntimeException ) \
|
||||
css::uno::Sequence< OUString > SAL_CALL CLASS::getSupportedServiceNames() throw( css::uno::RuntimeException ) \
|
||||
{ \
|
||||
return impl_getStaticSupportedServiceNames(); \
|
||||
} \
|
||||
\
|
||||
/*===========================================================================================================*/ \
|
||||
/* Helper for XServiceInfo */ \
|
||||
/*===========================================================================================================*/ \
|
||||
css::uno::Sequence< OUString > CLASS::impl_getStaticSupportedServiceNames() \
|
||||
css::uno::Sequence< OUString > CLASS::impl_getStaticSupportedServiceNames() \
|
||||
{ \
|
||||
css::uno::Sequence< OUString > seqServiceNames( 1 ); \
|
||||
css::uno::Sequence< OUString > seqServiceNames( 1 ); \
|
||||
seqServiceNames.getArray() [0] = SERVICENAME ; \
|
||||
return seqServiceNames; \
|
||||
} \
|
||||
\
|
||||
/*===========================================================================================================*/ \
|
||||
/* Helper for XServiceInfo */ \
|
||||
/*===========================================================================================================*/ \
|
||||
OUString CLASS::impl_getStaticImplementationName() \
|
||||
OUString CLASS::impl_getStaticImplementationName() \
|
||||
{ \
|
||||
return IMPLEMENTATIONNAME ; \
|
||||
}
|
||||
|
||||
#define PRIVATE_DEFINE_XSERVICEINFO_OLDSTYLE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_XSERVICEINFO_BASE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
/*===========================================================================================================*/ \
|
||||
/* Helper for registry */ \
|
||||
/* Attention: To avoid against wrong ref counts during our own initialize procedure, we must */ \
|
||||
/* use right EXTERNAL handling of them. That's why you should do nothing in your ctor, which could*/ \
|
||||
/* work on your ref count! All other things are allowed. Do work with your own reference - please */ \
|
||||
/* use "impl_initService()" method. */ \
|
||||
/*===========================================================================================================*/ \
|
||||
css::uno::Reference< css::uno::XInterface > SAL_CALL CLASS::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception ) \
|
||||
{ \
|
||||
/* create new instance of service */ \
|
||||
@@ -121,13 +99,10 @@ ________________________________________________________________________________
|
||||
|
||||
#define PRIVATE_DEFINE_XSERVICEINFO_NEWSTYLE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_XSERVICEINFO_BASE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
/*===========================================================================================================*/ \
|
||||
/* Helper for registry */ \
|
||||
/* Attention: To avoid against wrong ref counts during our own initialize procedure, we must */ \
|
||||
/* use right EXTERNAL handling of them. That's why you should do nothing in your ctor, which could*/ \
|
||||
/* work on your ref count! All other things are allowed. Do work with your own reference - please */ \
|
||||
/* use "impl_initService()" method. */ \
|
||||
/*===========================================================================================================*/ \
|
||||
css::uno::Reference< css::uno::XInterface > SAL_CALL CLASS::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager )\
|
||||
throw( css::uno::Exception ) \
|
||||
{ \
|
||||
@@ -144,10 +119,6 @@ ________________________________________________________________________________
|
||||
return xService; \
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// private
|
||||
// definition of helper function createFactory() for multiple services
|
||||
//*****************************************************************************************************************
|
||||
#define PRIVATE_DEFINE_SINGLEFACTORY( CLASS ) \
|
||||
css::uno::Reference< css::lang::XSingleServiceFactory > CLASS::impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) \
|
||||
{ \
|
||||
@@ -160,10 +131,6 @@ ________________________________________________________________________________
|
||||
return xReturn; \
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// private
|
||||
// definition of helper function createFactory() for one instance services
|
||||
//*****************************************************************************************************************
|
||||
#define PRIVATE_DEFINE_ONEINSTANCEFACTORY( CLASS ) \
|
||||
css::uno::Reference< css::lang::XSingleServiceFactory > CLASS::impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) \
|
||||
{ \
|
||||
@@ -176,11 +143,6 @@ ________________________________________________________________________________
|
||||
return xReturn; \
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// public
|
||||
// declaration of XServiceInfo and helper functions
|
||||
//*****************************************************************************************************************
|
||||
|
||||
#define DECLARE_XSERVICEINFO_NOFACTORY \
|
||||
/* interface XServiceInfo */ \
|
||||
virtual OUString SAL_CALL getImplementationName ( ) throw( css::uno::RuntimeException ); \
|
||||
@@ -198,10 +160,6 @@ ________________________________________________________________________________
|
||||
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception ); \
|
||||
static css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); \
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// public
|
||||
// implementation of XServiceInfo
|
||||
//*****************************************************************************************************************
|
||||
#define DEFINE_XSERVICEINFO_MULTISERVICE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_XSERVICEINFO_OLDSTYLE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_SINGLEFACTORY( CLASS )
|
||||
@@ -214,11 +172,10 @@ ________________________________________________________________________________
|
||||
PRIVATE_DEFINE_XSERVICEINFO_NEWSTYLE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_SINGLEFACTORY( CLASS )
|
||||
|
||||
#define DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
#define DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_XSERVICEINFO_NEWSTYLE( CLASS, XINTERFACECAST, SERVICENAME, IMPLEMENTATIONNAME ) \
|
||||
PRIVATE_DEFINE_ONEINSTANCEFACTORY( CLASS )
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// public
|
||||
// implementation of service initialize!
|
||||
// example of using: DEFINE_INIT_SERVICE( MyClassName,
|
||||
@@ -229,7 +186,6 @@ ________________________________________________________________________________
|
||||
// ...
|
||||
// }
|
||||
// )
|
||||
//*****************************************************************************************************************
|
||||
#define DEFINE_INIT_SERVICE( CLASS, FUNCTIONBODY ) \
|
||||
void SAL_CALL CLASS::impl_initService() \
|
||||
{ \
|
||||
|
@@ -40,9 +40,10 @@
|
||||
#include <com/sun/star/uri/UriReferenceFactory.hpp>
|
||||
#include <com/sun/star/ui/XUIElement.hpp>
|
||||
|
||||
#include <ucbhelper/content.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <rtl/ustrbuf.hxx>
|
||||
#include <ucbhelper/content.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
namespace framework{
|
||||
@@ -59,9 +60,6 @@ using namespace ::cppu ;
|
||||
using namespace ::osl ;
|
||||
using namespace ::rtl ;
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// constructor
|
||||
//*****************************************************************************************************************
|
||||
PopupMenuDispatcher::PopupMenuDispatcher(
|
||||
const uno::Reference< XComponentContext >& xContext )
|
||||
// Init baseclasses first
|
||||
@@ -74,9 +72,6 @@ PopupMenuDispatcher::PopupMenuDispatcher(
|
||||
{
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// destructor
|
||||
//*****************************************************************************************************************
|
||||
PopupMenuDispatcher::~PopupMenuDispatcher()
|
||||
{
|
||||
// Warn programmer if he forgot to dispose this instance.
|
||||
@@ -92,7 +87,7 @@ OUString SAL_CALL PopupMenuDispatcher::getImplementationName() throw( css::uno::
|
||||
sal_Bool SAL_CALL PopupMenuDispatcher::supportsService( const OUString& sServiceName )
|
||||
throw( css::uno::RuntimeException )
|
||||
{
|
||||
return ::comphelper::findValue(getSupportedServiceNames(), sServiceName, sal_True).getLength() != 0;
|
||||
return cppu::supportsService(this, sServiceName);
|
||||
}
|
||||
|
||||
css::uno::Sequence< OUString > SAL_CALL PopupMenuDispatcher::getSupportedServiceNames()
|
||||
@@ -149,11 +144,7 @@ DEFINE_INIT_SERVICE(PopupMenuDispatcher,
|
||||
}
|
||||
)
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XInitialization
|
||||
//*****************************************************************************************************************
|
||||
void SAL_CALL PopupMenuDispatcher::initialize(
|
||||
const css::uno::Sequence< css::uno::Any >& lArguments )
|
||||
void SAL_CALL PopupMenuDispatcher::initialize( const css::uno::Sequence< css::uno::Any >& lArguments )
|
||||
throw( css::uno::Exception, css::uno::RuntimeException)
|
||||
{
|
||||
css::uno::Reference< css::frame::XFrame > xFrame;
|
||||
@@ -179,9 +170,6 @@ throw( css::uno::Exception, css::uno::RuntimeException)
|
||||
/* } SAFE */
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XDispatchProvider
|
||||
//*****************************************************************************************************************
|
||||
css::uno::Reference< css::frame::XDispatch >
|
||||
SAL_CALL PopupMenuDispatcher::queryDispatch(
|
||||
const css::util::URL& rURL ,
|
||||
@@ -263,24 +251,13 @@ throw( css::uno::RuntimeException )
|
||||
return lDispatcher;
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XDispatch
|
||||
//*****************************************************************************************************************
|
||||
void
|
||||
SAL_CALL PopupMenuDispatcher::dispatch(
|
||||
const URL& /*aURL*/ ,
|
||||
const Sequence< PropertyValue >& /*seqProperties*/ )
|
||||
void SAL_CALL PopupMenuDispatcher::dispatch( const URL& /*aURL*/, const Sequence< PropertyValue >& /*seqProperties*/ )
|
||||
throw( RuntimeException )
|
||||
{
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XDispatch
|
||||
//*****************************************************************************************************************
|
||||
void
|
||||
SAL_CALL PopupMenuDispatcher::addStatusListener(
|
||||
const uno::Reference< XStatusListener >& xControl,
|
||||
const URL& aURL )
|
||||
void SAL_CALL PopupMenuDispatcher::addStatusListener( const uno::Reference< XStatusListener >& xControl,
|
||||
const URL& aURL )
|
||||
throw( RuntimeException )
|
||||
{
|
||||
// Ready for multithreading
|
||||
@@ -290,13 +267,8 @@ throw( RuntimeException )
|
||||
m_aListenerContainer.addInterface( aURL.Complete, xControl );
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XDispatch
|
||||
//*****************************************************************************************************************
|
||||
void
|
||||
SAL_CALL PopupMenuDispatcher::removeStatusListener(
|
||||
const uno::Reference< XStatusListener >& xControl,
|
||||
const URL& aURL )
|
||||
void SAL_CALL PopupMenuDispatcher::removeStatusListener( const uno::Reference< XStatusListener >& xControl,
|
||||
const URL& aURL )
|
||||
throw( RuntimeException )
|
||||
{
|
||||
// Ready for multithreading
|
||||
@@ -306,13 +278,7 @@ throw( RuntimeException )
|
||||
m_aListenerContainer.removeInterface( aURL.Complete, xControl );
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XFrameActionListener
|
||||
//*****************************************************************************************************************
|
||||
|
||||
void
|
||||
SAL_CALL PopupMenuDispatcher::frameAction(
|
||||
const FrameActionEvent& aEvent )
|
||||
void SAL_CALL PopupMenuDispatcher::frameAction( const FrameActionEvent& aEvent )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
ResetableGuard aGuard( m_aLock );
|
||||
@@ -325,11 +291,7 @@ throw ( RuntimeException )
|
||||
}
|
||||
}
|
||||
|
||||
//*****************************************************************************************************************
|
||||
// XEventListener
|
||||
//*****************************************************************************************************************
|
||||
void
|
||||
SAL_CALL PopupMenuDispatcher::disposing( const EventObject& ) throw( RuntimeException )
|
||||
void SAL_CALL PopupMenuDispatcher::disposing( const EventObject& ) throw( RuntimeException )
|
||||
{
|
||||
// Ready for multithreading
|
||||
ResetableGuard aGuard( m_aLock );
|
||||
@@ -401,6 +363,6 @@ void PopupMenuDispatcher::impl_CreateUriRefFactory()
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace framework
|
||||
} // namespace framework
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <classes/actiontriggercontainer.hxx>
|
||||
#include <cppuhelper/typeprovider.hxx>
|
||||
|
||||
#include <classes/actiontriggerpropertyset.hxx>
|
||||
#include <classes/actiontriggerseparatorpropertyset.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <cppuhelper/typeprovider.hxx>
|
||||
|
||||
using namespace cppu;
|
||||
using namespace com::sun::star::uno;
|
||||
@@ -69,7 +69,6 @@ void ActionTriggerContainer::release() throw()
|
||||
PropertySetContainer::release();
|
||||
}
|
||||
|
||||
|
||||
// XMultiServiceFactory
|
||||
Reference< XInterface > SAL_CALL ActionTriggerContainer::createInstance( const OUString& aServiceSpecifier )
|
||||
throw ( ::com::sun::star::uno::Exception, RuntimeException)
|
||||
@@ -84,14 +83,12 @@ throw ( ::com::sun::star::uno::Exception, RuntimeException)
|
||||
throw com::sun::star::uno::RuntimeException("Unknown service specifier!", (OWeakObject *)this );
|
||||
}
|
||||
|
||||
|
||||
Reference< XInterface > SAL_CALL ActionTriggerContainer::createInstanceWithArguments( const OUString& ServiceSpecifier, const Sequence< Any >& /*Arguments*/ )
|
||||
throw ( Exception, RuntimeException)
|
||||
{
|
||||
return createInstance( ServiceSpecifier );
|
||||
}
|
||||
|
||||
|
||||
Sequence< OUString > SAL_CALL ActionTriggerContainer::getAvailableServiceNames()
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
@@ -114,10 +111,7 @@ throw ( RuntimeException )
|
||||
sal_Bool SAL_CALL ActionTriggerContainer::supportsService( const OUString& ServiceName )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
if ( ServiceName.equalsAscii( SERVICENAME_ACTIONTRIGGERCONTAINER ))
|
||||
return sal_True;
|
||||
|
||||
return sal_False;
|
||||
return cppu::supportsService(this, ServiceName);
|
||||
}
|
||||
|
||||
Sequence< OUString > SAL_CALL ActionTriggerContainer::getSupportedServiceNames()
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <classes/actiontriggerpropertyset.hxx>
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
#include <cppuhelper/proptypehlp.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <cppuhelper/typeprovider.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
@@ -97,7 +98,6 @@ void SAL_CALL ActionTriggerPropertySet::release() throw ()
|
||||
OWeakObject::release();
|
||||
}
|
||||
|
||||
|
||||
// XServiceInfo
|
||||
OUString SAL_CALL ActionTriggerPropertySet::getImplementationName()
|
||||
throw ( RuntimeException )
|
||||
@@ -108,10 +108,7 @@ throw ( RuntimeException )
|
||||
sal_Bool SAL_CALL ActionTriggerPropertySet::supportsService( const OUString& ServiceName )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
if ( ServiceName.equalsAscii( SERVICENAME_ACTIONTRIGGER ))
|
||||
return sal_True;
|
||||
|
||||
return sal_False;
|
||||
return cppu::supportsService(this, ServiceName);
|
||||
}
|
||||
|
||||
Sequence< OUString > SAL_CALL ActionTriggerPropertySet::getSupportedServiceNames()
|
||||
@@ -182,10 +179,6 @@ Sequence< sal_Int8 > SAL_CALL ActionTriggerPropertySet::getImplementationId() th
|
||||
return pID->getImplementationId() ;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
// OPropertySetHelper implementation
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
sal_Bool SAL_CALL ActionTriggerPropertySet::convertFastPropertyValue(
|
||||
Any& aConvertedValue,
|
||||
Any& aOldValue,
|
||||
@@ -227,7 +220,6 @@ throw( IllegalArgumentException )
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
|
||||
void SAL_CALL ActionTriggerPropertySet::setFastPropertyValue_NoBroadcast(
|
||||
sal_Int32 nHandle, const Any& aValue )
|
||||
throw( Exception )
|
||||
@@ -357,10 +349,6 @@ const Sequence< Property > ActionTriggerPropertySet::impl_getStaticPropertyDescr
|
||||
return seqActionTriggerPropertyDescriptor ;
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************************************************************
|
||||
// private method
|
||||
//******************************************************************************************************************************
|
||||
sal_Bool ActionTriggerPropertySet::impl_tryToChangeProperty(
|
||||
const OUString& sCurrentValue ,
|
||||
const Any& aNewValue ,
|
||||
@@ -396,7 +384,6 @@ throw( IllegalArgumentException )
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
|
||||
sal_Bool ActionTriggerPropertySet::impl_tryToChangeProperty(
|
||||
const Reference< XBitmap > aCurrentValue ,
|
||||
const Any& aNewValue ,
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <classes/actiontriggerseparatorpropertyset.hxx>
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
#include <cppuhelper/proptypehlp.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <cppuhelper/typeprovider.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
@@ -48,7 +49,7 @@ namespace framework
|
||||
ActionTriggerSeparatorPropertySet::ActionTriggerSeparatorPropertySet()
|
||||
: ThreadHelpBase ( &Application::GetSolarMutex() )
|
||||
, OBroadcastHelper ( m_aLock.getShareableOslMutex() )
|
||||
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)) )
|
||||
, OPropertySetHelper ( *(static_cast< OBroadcastHelper * >(this)) )
|
||||
, OWeakObject ( )
|
||||
, m_nSeparatorType( 0 )
|
||||
{
|
||||
@@ -100,10 +101,7 @@ throw ( RuntimeException )
|
||||
sal_Bool SAL_CALL ActionTriggerSeparatorPropertySet::supportsService( const OUString& ServiceName )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
if ( ServiceName.equalsAscii( SERVICENAME_ACTIONTRIGGERSEPARATOR ))
|
||||
return sal_True;
|
||||
|
||||
return sal_False;
|
||||
return cppu::supportsService(this, ServiceName);
|
||||
}
|
||||
|
||||
Sequence< OUString > SAL_CALL ActionTriggerSeparatorPropertySet::getSupportedServiceNames()
|
||||
@@ -174,10 +172,6 @@ Sequence< sal_Int8 > SAL_CALL ActionTriggerSeparatorPropertySet::getImplementati
|
||||
return pID->getImplementationId() ;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
// OPropertySetHelper implementation
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
sal_Bool SAL_CALL ActionTriggerSeparatorPropertySet::convertFastPropertyValue(
|
||||
Any& aConvertedValue,
|
||||
Any& aOldValue,
|
||||
@@ -203,7 +197,6 @@ throw( IllegalArgumentException )
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
|
||||
void SAL_CALL ActionTriggerSeparatorPropertySet::setFastPropertyValue_NoBroadcast(
|
||||
sal_Int32 nHandle, const Any& aValue )
|
||||
throw( Exception )
|
||||
@@ -297,10 +290,6 @@ const Sequence< Property > ActionTriggerSeparatorPropertySet::impl_getStaticProp
|
||||
return seqActionTriggerPropertyDescriptor ;
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************************************************************
|
||||
// private method
|
||||
//******************************************************************************************************************************
|
||||
sal_Bool ActionTriggerSeparatorPropertySet::impl_tryToChangeProperty(
|
||||
sal_Int16 aCurrentValue ,
|
||||
const Any& aNewValue ,
|
||||
|
@@ -22,12 +22,12 @@
|
||||
#include <classes/actiontriggercontainer.hxx>
|
||||
#include <classes/actiontriggerpropertyset.hxx>
|
||||
#include <classes/actiontriggerseparatorpropertyset.hxx>
|
||||
#include <framework/actiontriggerhelper.hxx>
|
||||
#include <threadhelp/resetableguard.hxx>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <cppuhelper/typeprovider.hxx>
|
||||
|
||||
#include <framework/actiontriggerhelper.hxx>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <threadhelp/resetableguard.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
using namespace cppu;
|
||||
using namespace com::sun::star::uno;
|
||||
@@ -46,7 +46,6 @@ static Sequence< sal_Int8 > impl_getStaticIdentifier()
|
||||
return seqID ;
|
||||
}
|
||||
|
||||
|
||||
RootActionTriggerContainer::RootActionTriggerContainer( const Menu* pMenu, const OUString* pMenuIdentifier ) :
|
||||
PropertySetContainer()
|
||||
, m_bContainerCreated( sal_False )
|
||||
@@ -123,7 +122,6 @@ throw ( RuntimeException )
|
||||
return aSeq;
|
||||
}
|
||||
|
||||
|
||||
// XIndexContainer
|
||||
void SAL_CALL RootActionTriggerContainer::insertByIndex( sal_Int32 Index, const Any& Element )
|
||||
throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
|
||||
@@ -151,7 +149,6 @@ throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
|
||||
PropertySetContainer::removeByIndex( Index );
|
||||
}
|
||||
|
||||
|
||||
// XIndexReplace
|
||||
void SAL_CALL RootActionTriggerContainer::replaceByIndex( sal_Int32 Index, const Any& Element )
|
||||
throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
|
||||
@@ -166,7 +163,6 @@ throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetExcept
|
||||
PropertySetContainer::replaceByIndex( Index, Element );
|
||||
}
|
||||
|
||||
|
||||
// XIndexAccess
|
||||
sal_Int32 SAL_CALL RootActionTriggerContainer::getCount()
|
||||
throw ( RuntimeException )
|
||||
@@ -200,7 +196,6 @@ throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
|
||||
return PropertySetContainer::getByIndex( Index );
|
||||
}
|
||||
|
||||
|
||||
// XElementAccess
|
||||
Type SAL_CALL RootActionTriggerContainer::getElementType()
|
||||
throw (::com::sun::star::uno::RuntimeException)
|
||||
@@ -220,7 +215,6 @@ throw (::com::sun::star::uno::RuntimeException)
|
||||
return sal_False;
|
||||
}
|
||||
|
||||
|
||||
// XServiceInfo
|
||||
OUString SAL_CALL RootActionTriggerContainer::getImplementationName()
|
||||
throw ( RuntimeException )
|
||||
@@ -231,10 +225,7 @@ throw ( RuntimeException )
|
||||
sal_Bool SAL_CALL RootActionTriggerContainer::supportsService( const OUString& ServiceName )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
if ( ServiceName.equalsAscii( SERVICENAME_ACTIONTRIGGERCONTAINER ))
|
||||
return sal_True;
|
||||
|
||||
return sal_False;
|
||||
return cppu::supportsService(this, ServiceName);
|
||||
}
|
||||
|
||||
Sequence< OUString > SAL_CALL RootActionTriggerContainer::getSupportedServiceNames()
|
||||
|
@@ -16,8 +16,10 @@
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include "services/ContextChangeEventMultiplexer.hxx"
|
||||
#include "services.h"
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
|
||||
using ::rtl::OUString;
|
||||
|
||||
@@ -36,16 +38,10 @@ ContextChangeEventMultiplexer::ContextChangeEventMultiplexer (
|
||||
(void)rxContext;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ContextChangeEventMultiplexer::~ContextChangeEventMultiplexer (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SAL_CALL ContextChangeEventMultiplexer::disposing (void)
|
||||
{
|
||||
ListenerMap aListeners;
|
||||
@@ -75,11 +71,7 @@ void SAL_CALL ContextChangeEventMultiplexer::disposing (void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// XContextChangeEventMultiplexer
|
||||
|
||||
void SAL_CALL ContextChangeEventMultiplexer::addContextChangeEventListener (
|
||||
const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener,
|
||||
const cssu::Reference<cssu::XInterface>& rxEventFocus)
|
||||
@@ -117,9 +109,6 @@ void SAL_CALL ContextChangeEventMultiplexer::addContextChangeEventListener (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SAL_CALL ContextChangeEventMultiplexer::removeContextChangeEventListener (
|
||||
const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener,
|
||||
const cssu::Reference<cssu::XInterface>& rxEventFocus)
|
||||
@@ -147,9 +136,6 @@ void SAL_CALL ContextChangeEventMultiplexer::removeContextChangeEventListener (
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SAL_CALL ContextChangeEventMultiplexer::removeAllContextChangeEventListeners (
|
||||
const cssu::Reference<css::ui::XContextChangeEventListener>& rxListener)
|
||||
throw(cssu::RuntimeException,cssl::IllegalArgumentException)
|
||||
@@ -177,9 +163,6 @@ void SAL_CALL ContextChangeEventMultiplexer::removeAllContextChangeEventListener
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SAL_CALL ContextChangeEventMultiplexer::broadcastContextChangeEvent (
|
||||
const css::ui::ContextChangeEventObject& rEventObject,
|
||||
const cssu::Reference<cssu::XInterface>& rxEventFocus)
|
||||
@@ -201,9 +184,6 @@ void SAL_CALL ContextChangeEventMultiplexer::broadcastContextChangeEvent (
|
||||
BroadcastEventToSingleContainer(rEventObject, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ContextChangeEventMultiplexer::BroadcastEventToSingleContainer (
|
||||
const css::ui::ContextChangeEventObject& rEventObject,
|
||||
const cssu::Reference<cssu::XInterface>& rxEventFocus)
|
||||
@@ -225,9 +205,6 @@ void ContextChangeEventMultiplexer::BroadcastEventToSingleContainer (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ContextChangeEventMultiplexer::FocusDescriptor* ContextChangeEventMultiplexer::GetFocusDescriptor (
|
||||
const cssu::Reference<cssu::XInterface>& rxEventFocus,
|
||||
const bool bCreateWhenMissing)
|
||||
@@ -252,11 +229,7 @@ ContextChangeEventMultiplexer::FocusDescriptor* ContextChangeEventMultiplexer::G
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// XSingleComponentFactory
|
||||
|
||||
cssu::Reference<cssu::XInterface> SAL_CALL ContextChangeEventMultiplexer::createInstanceWithContext (
|
||||
const cssu::Reference<cssu::XComponentContext>& rxContext)
|
||||
throw (cssu::Exception, cssu::RuntimeException)
|
||||
@@ -265,9 +238,6 @@ cssu::Reference<cssu::XInterface> SAL_CALL ContextChangeEventMultiplexer::create
|
||||
return cssu::Reference<cssu::XInterface>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cssu::Reference<cssu::XInterface > SAL_CALL ContextChangeEventMultiplexer::createInstanceWithArgumentsAndContext (
|
||||
const cssu::Sequence<cssu::Any>& rArguments,
|
||||
const cssu::Reference<cssu::XComponentContext>& rxContext)
|
||||
@@ -278,42 +248,26 @@ cssu::Reference<cssu::XInterface > SAL_CALL ContextChangeEventMultiplexer::creat
|
||||
return cssu::Reference<cssu::XInterface>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// XServiceInfo
|
||||
|
||||
::rtl::OUString SAL_CALL ContextChangeEventMultiplexer::getImplementationName (void)
|
||||
throw(cssu::RuntimeException)
|
||||
{
|
||||
return impl_getStaticImplementationName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sal_Bool SAL_CALL ContextChangeEventMultiplexer::supportsService (
|
||||
const ::rtl::OUString& rsServiceName)
|
||||
sal_Bool SAL_CALL ContextChangeEventMultiplexer::supportsService ( const ::rtl::OUString& rsServiceName)
|
||||
throw (cssu::RuntimeException)
|
||||
{
|
||||
return ::comphelper::findValue(static_GetSupportedServiceNames(), rsServiceName, sal_True).getLength() != 0;
|
||||
return cppu::supportsService(this, rsServiceName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cssu::Sequence<OUString> SAL_CALL ContextChangeEventMultiplexer::getSupportedServiceNames (void)
|
||||
throw (cssu::RuntimeException)
|
||||
{
|
||||
return static_GetSupportedServiceNames();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SAL_CALL ContextChangeEventMultiplexer::disposing (
|
||||
const css::lang::EventObject& rEvent)
|
||||
void SAL_CALL ContextChangeEventMultiplexer::disposing ( const css::lang::EventObject& rEvent)
|
||||
throw (cssu::RuntimeException)
|
||||
{
|
||||
ListenerMap::iterator iDescriptor (maListeners.find(rEvent.Source));
|
||||
@@ -329,19 +283,12 @@ void SAL_CALL ContextChangeEventMultiplexer::disposing (
|
||||
maListeners.erase(iDescriptor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Local and static methods.
|
||||
|
||||
OUString SAL_CALL ContextChangeEventMultiplexer::impl_getStaticImplementationName (void)
|
||||
{
|
||||
return OUString(IMPLEMENTATION_NAME);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cssu::Sequence<OUString> SAL_CALL ContextChangeEventMultiplexer::static_GetSupportedServiceNames (void)
|
||||
{
|
||||
return css::uno::Sequence<OUString>();
|
||||
@@ -358,9 +305,6 @@ cssu::Reference<cssu::XInterface> ContextChangeEventMultiplexer::impl_createFact
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cssu::Reference<cssu::XInterface> SAL_CALL ContextChangeEventMultiplexer::static_CreateInstance (
|
||||
const cssu::Reference<cssu::XComponentContext>& rxComponentContext)
|
||||
throw (cssu::Exception)
|
||||
|
@@ -16,14 +16,14 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <framework/menuconfiguration.hxx>
|
||||
#include <toolkit/awt/vclxmenu.hxx>
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <cppuhelper/implbase1.hxx>
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <framework/menuconfiguration.hxx>
|
||||
#include <rtl/ref.hxx>
|
||||
#include <svtools/imagemgr.hxx>
|
||||
#include <svtools/miscopt.hxx>
|
||||
#include <svtools/toolboxcontroller.hxx>
|
||||
#include <toolkit/awt/vclxmenu.hxx>
|
||||
#include <toolkit/helper/vclunohelper.hxx>
|
||||
#include <tools/urlobj.hxx>
|
||||
#include <unotools/moduleoptions.hxx>
|
||||
@@ -154,9 +154,7 @@ throw ( css::uno::Exception, css::uno::RuntimeException )
|
||||
|
||||
}
|
||||
|
||||
void SAL_CALL
|
||||
PopupMenuToolbarController::statusChanged(
|
||||
const css::frame::FeatureStateEvent& rEvent )
|
||||
void SAL_CALL PopupMenuToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
|
||||
throw ( css::uno::RuntimeException )
|
||||
{
|
||||
// TODO move to base class
|
||||
@@ -390,9 +388,7 @@ css::uno::Sequence<OUString> NewToolbarController::getSupportedServiceNames()
|
||||
return aRet;
|
||||
}
|
||||
|
||||
void SAL_CALL
|
||||
NewToolbarController::initialize(
|
||||
const css::uno::Sequence< css::uno::Any >& aArguments )
|
||||
void SAL_CALL NewToolbarController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
|
||||
throw ( css::uno::Exception, css::uno::RuntimeException )
|
||||
{
|
||||
PopupMenuToolbarController::initialize( aArguments );
|
||||
@@ -401,10 +397,8 @@ throw ( css::uno::Exception, css::uno::RuntimeException )
|
||||
createPopupMenuController();
|
||||
}
|
||||
|
||||
void SAL_CALL
|
||||
NewToolbarController::statusChanged(
|
||||
const css::frame::FeatureStateEvent& rEvent )
|
||||
throw ( css::uno::RuntimeException )
|
||||
void SAL_CALL NewToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
|
||||
throw ( css::uno::RuntimeException )
|
||||
{
|
||||
if ( rEvent.IsEnabled )
|
||||
{
|
||||
@@ -418,9 +412,8 @@ NewToolbarController::statusChanged(
|
||||
enable( rEvent.IsEnabled );
|
||||
}
|
||||
|
||||
void SAL_CALL
|
||||
NewToolbarController::execute( sal_Int16 /*KeyModifier*/ )
|
||||
throw ( css::uno::RuntimeException )
|
||||
void SAL_CALL NewToolbarController::execute( sal_Int16 /*KeyModifier*/ )
|
||||
throw ( css::uno::RuntimeException )
|
||||
{
|
||||
osl::MutexGuard aGuard( m_aMutex );
|
||||
if ( !m_aLastURL.getLength() )
|
||||
|
Reference in New Issue
Block a user