Kaydet (Commit) 8ef77fc6 authored tarafından Alexandre Vicenzi's avatar Alexandre Vicenzi Kaydeden (comit) Marcos Souza

fdo#54938 Convert extensions to cppu::supportsService

Change-Id: If3675c28a204168d7385b1421dbb70b2a9b719e2
Reviewed-on: https://gerrit.libreoffice.org/7648Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
Tested-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
üst cd20baf4
......@@ -28,19 +28,17 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/logging/XLoggerPool.hpp>
#include <boost/bind.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weakref.hxx>
#include <boost/bind.hpp>
#include <map>
//........................................................................
namespace logging
{
//........................................................................
using ::com::sun::star::logging::XLogger;
using ::com::sun::star::uno::Reference;
......@@ -59,27 +57,6 @@ namespace logging
namespace LogLevel = ::com::sun::star::logging::LogLevel;
//====================================================================
//= helper
//====================================================================
namespace
{
sal_Bool lcl_supportsService_nothrow( XServiceInfo& _rSI, const OUString& _rServiceName )
{
const Sequence< OUString > aServiceNames( _rSI.getSupportedServiceNames() );
for ( const OUString* pServiceNames = aServiceNames.getConstArray();
pServiceNames != aServiceNames.getConstArray() + aServiceNames.getLength();
++pServiceNames
)
if ( _rServiceName == *pServiceNames )
return sal_True;
return sal_False;
}
}
//====================================================================
//= EventLogger - declaration
//====================================================================
typedef ::cppu::WeakImplHelper2 < XLogger
, XServiceInfo
> EventLogger_Base;
......@@ -126,9 +103,6 @@ namespace logging
bool impl_nts_isLoggable_nothrow( ::sal_Int32 _nLevel );
};
//====================================================================
//= LoggerPool - declaration
//====================================================================
typedef ::cppu::WeakImplHelper2 < XLoggerPool
, XServiceInfo
> LoggerPool_Base;
......@@ -164,10 +138,6 @@ namespace logging
virtual Reference< XLogger > SAL_CALL getDefaultLogger( ) throw (RuntimeException);
};
//====================================================================
//= EventLogger - implementation
//====================================================================
//--------------------------------------------------------------------
EventLogger::EventLogger( const Reference< XComponentContext >& _rxContext, const OUString& _rName )
:m_aHandlers( m_aMutex )
,m_nEventNumber( 0 )
......@@ -181,12 +151,10 @@ namespace logging
osl_atomic_decrement( &m_refCount );
}
//--------------------------------------------------------------------
EventLogger::~EventLogger()
{
}
//--------------------------------------------------------------------
bool EventLogger::impl_nts_isLoggable_nothrow( ::sal_Int32 _nLevel )
{
if ( _nLevel < m_nLogLevel )
......@@ -198,7 +166,6 @@ namespace logging
return true;
}
//--------------------------------------------------------------------
void EventLogger::impl_ts_logEvent_nothrow( const LogRecord& _rRecord )
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -212,48 +179,41 @@ namespace logging
::boost::bind( &XLogHandler::flush, _1 ) );
}
//--------------------------------------------------------------------
OUString SAL_CALL EventLogger::getName() throw (RuntimeException)
{
return m_sName;
}
//--------------------------------------------------------------------
::sal_Int32 SAL_CALL EventLogger::getLevel() throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return m_nLogLevel;
}
//--------------------------------------------------------------------
void SAL_CALL EventLogger::setLevel( ::sal_Int32 _level ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
m_nLogLevel = _level;
}
//--------------------------------------------------------------------
void SAL_CALL EventLogger::addLogHandler( const Reference< XLogHandler >& _rxLogHandler ) throw (RuntimeException)
{
if ( _rxLogHandler.is() )
m_aHandlers.addInterface( _rxLogHandler );
}
//--------------------------------------------------------------------
void SAL_CALL EventLogger::removeLogHandler( const Reference< XLogHandler >& _rxLogHandler ) throw (RuntimeException)
{
if ( _rxLogHandler.is() )
m_aHandlers.removeInterface( _rxLogHandler );
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL EventLogger::isLoggable( ::sal_Int32 _nLevel ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return impl_nts_isLoggable_nothrow( _nLevel );
}
//--------------------------------------------------------------------
void SAL_CALL EventLogger::log( ::sal_Int32 _nLevel, const OUString& _rMessage ) throw (RuntimeException)
{
impl_ts_logEvent_nothrow( createLogRecord(
......@@ -264,7 +224,6 @@ namespace logging
) );
}
//--------------------------------------------------------------------
void SAL_CALL EventLogger::logp( ::sal_Int32 _nLevel, const OUString& _rSourceClass, const OUString& _rSourceMethod, const OUString& _rMessage ) throw (RuntimeException)
{
impl_ts_logEvent_nothrow( createLogRecord(
......@@ -277,19 +236,16 @@ namespace logging
) );
}
//--------------------------------------------------------------------
OUString SAL_CALL EventLogger::getImplementationName() throw(RuntimeException)
{
return OUString( "com.sun.star.comp.extensions.EventLogger" );
}
//--------------------------------------------------------------------
::sal_Bool EventLogger::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
{
return lcl_supportsService_nothrow( *this, _rServiceName );
return cppu::supportsService(this, _rServiceName);
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL EventLogger::getSupportedServiceNames() throw(RuntimeException)
{
Sequence< OUString > aServiceNames(1);
......@@ -297,40 +253,31 @@ namespace logging
return aServiceNames;
}
//====================================================================
//= LoggerPool - implementation
//====================================================================
//--------------------------------------------------------------------
LoggerPool::LoggerPool( const Reference< XComponentContext >& _rxContext )
:m_xContext( _rxContext )
{
}
//--------------------------------------------------------------------
OUString SAL_CALL LoggerPool::getImplementationName() throw(RuntimeException)
{
return getImplementationName_static();
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL LoggerPool::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
{
return lcl_supportsService_nothrow( *this, _rServiceName );
return cppu::supportsService(this, _rServiceName);
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL LoggerPool::getSupportedServiceNames() throw(RuntimeException)
{
return getSupportedServiceNames_static();
}
//--------------------------------------------------------------------
OUString SAL_CALL LoggerPool::getImplementationName_static()
{
return OUString( "com.sun.star.comp.extensions.LoggerPool" );
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL LoggerPool::getSupportedServiceNames_static()
{
Sequence< OUString > aServiceNames(1);
......@@ -338,19 +285,16 @@ namespace logging
return aServiceNames;
}
//--------------------------------------------------------------------
OUString LoggerPool::getSingletonName_static()
{
return OUString( "com.sun.star.logging.LoggerPool" );
}
//--------------------------------------------------------------------
Reference< XInterface > SAL_CALL LoggerPool::Create( const Reference< XComponentContext >& _rxContext )
{
return *( new LoggerPool( _rxContext ) );
}
//--------------------------------------------------------------------
Reference< XLogger > SAL_CALL LoggerPool::getNamedLogger( const OUString& _rName ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -367,20 +311,16 @@ namespace logging
return xLogger;
}
//--------------------------------------------------------------------
Reference< XLogger > SAL_CALL LoggerPool::getDefaultLogger( ) throw (RuntimeException)
{
return getNamedLogger( OUString( "org.openoffice.logging.DefaultLogger" ) );
}
//--------------------------------------------------------------------
void createRegistryInfo_LoggerPool()
{
static OSingletonRegistration< LoggerPool > aAutoRegistration;
}
//........................................................................
} // namespace logging
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -54,6 +54,7 @@
#include <comphelper/evtmethodhelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <sfx2/app.hxx>
......@@ -68,16 +69,13 @@
#include <algorithm>
#include <o3tl/compat_functional.hxx>
//------------------------------------------------------------------------
extern "C" void SAL_CALL createRegistryInfo_EventHandler()
{
::pcr::OAutoRegistration< ::pcr::EventHandler > aAutoRegistration;
}
//........................................................................
namespace pcr
{
//........................................................................
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XComponentContext;
......@@ -138,9 +136,6 @@ namespace pcr
namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
namespace FormComponentType = ::com::sun::star::form::FormComponentType;
//====================================================================
//= EventDescription
//====================================================================
EventDescription::EventDescription( EventId _nId, const sal_Char* _pListenerNamespaceAscii, const sal_Char* _pListenerClassAsciiName,
const sal_Char* _pListenerMethodAsciiName, sal_uInt16 _nDisplayNameResId, const OString& _sHelpId, const OString& _sUniqueBrowseId )
:sDisplayName(PcrRes( _nDisplayNameResId ).toString())
......@@ -157,18 +152,13 @@ namespace pcr
sListenerClassName = aQualifiedListenerClass.makeStringAndClear();
}
//========================================================================
//= helper
//========================================================================
namespace
{
//....................................................................
#define DESCRIBE_EVENT( asciinamespace, asciilistener, asciimethod, id_postfix ) \
s_aKnownEvents.insert( EventMap::value_type( \
OUString::createFromAscii( asciimethod ), \
EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) ) )
//....................................................................
bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, EventDescription& _out_rDescription )
{
static EventMap s_aKnownEvents;
......@@ -223,7 +213,6 @@ namespace pcr
return true;
}
//....................................................................
OUString lcl_getEventPropertyName( const OUString& _rListenerClassName, const OUString& _rMethodName )
{
OUStringBuffer aPropertyName;
......@@ -233,7 +222,6 @@ namespace pcr
return aPropertyName.makeStringAndClear();
}
//................................................................
ScriptEventDescriptor lcl_getAssignedScriptEvent( const EventDescription& _rEvent, const Sequence< ScriptEventDescriptor >& _rAllAssignedMacros )
{
ScriptEventDescriptor aScriptEvent;
......@@ -288,7 +276,6 @@ namespace pcr
return aScriptEvent;
}
//................................................................
OUString lcl_getQualifiedKnownListenerName( const ScriptEventDescriptor& _rFormComponentEventDescriptor )
{
EventDescription aKnownEvent;
......@@ -302,10 +289,8 @@ namespace pcr
return _rFormComponentEventDescriptor.ListenerType;
}
//................................................................
typedef ::std::set< Type, TypeLessByName > TypeBag;
//................................................................
void lcl_addListenerTypesFor_throw( const Reference< XInterface >& _rxComponent,
const Reference< XIntrospection >& _rxIntrospection, TypeBag& _out_rTypes )
{
......@@ -322,7 +307,6 @@ namespace pcr
::std::insert_iterator< TypeBag >( _out_rTypes, _out_rTypes.begin() ) );
}
//................................................................
bool operator ==( const ScriptEventDescriptor _lhs, const ScriptEventDescriptor _rhs )
{
return ( ( _lhs.ListenerType == _rhs.ListenerType )
......@@ -334,13 +318,9 @@ namespace pcr
}
}
//====================================================================
//= EventHandler
//====================================================================
typedef ::cppu::WeakImplHelper1 < ::com::sun::star::container::XNameReplace
> EventHolder_Base;
/** a UNO component holding assigned event descriptions, for use with a SvxMacroAssignDlg
*/
/* An UNO component holding assigned event descriptions, for use with a SvxMacroAssignDlg */
class EventHolder : public EventHolder_Base
{
private:
......@@ -376,13 +356,12 @@ namespace pcr
};
DBG_NAME( EventHolder )
//------------------------------------------------------------------------
EventHolder::EventHolder()
{
DBG_CTOR( EventHolder, NULL );
}
//------------------------------------------------------------------------
EventHolder::~EventHolder()
{
m_aEventNameAccess.clear();
......@@ -390,7 +369,6 @@ namespace pcr
DBG_DTOR( EventHolder, NULL );
}
//------------------------------------------------------------------------
void EventHolder::addEvent( EventId _nId, const OUString& _rEventName, const ScriptEventDescriptor& _rScriptEvent )
{
::std::pair< EventMap::iterator, bool > insertionResult =
......@@ -399,13 +377,11 @@ namespace pcr
m_aEventIndexAccess[ _nId ] = insertionResult.first;
}
//------------------------------------------------------------------------
ScriptEventDescriptor EventHolder::getNormalizedDescriptorByName( const OUString& _rEventName ) const
{
return impl_getDescriptor_throw( _rEventName );
}
//------------------------------------------------------------------------
ScriptEventDescriptor EventHolder::impl_getDescriptor_throw( const OUString& _rEventName ) const
{
EventMap::const_iterator pos = m_aEventNameAccess.find( _rEventName );
......@@ -414,7 +390,6 @@ namespace pcr
return pos->second;
}
//------------------------------------------------------------------------
void SAL_CALL EventHolder::replaceByName( const OUString& _rName, const Any& _rElement ) throw (IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
{
EventMap::iterator pos = m_aEventNameAccess.find( _rName );
......@@ -430,7 +405,6 @@ namespace pcr
pos->second.ScriptCode = aExtractor.getOrDefault( "Script", OUString() );
}
//------------------------------------------------------------------------
Any SAL_CALL EventHolder::getByName( const OUString& _rName ) throw (NoSuchElementException, WrappedTargetException, RuntimeException)
{
ScriptEventDescriptor aDescriptor( impl_getDescriptor_throw( _rName ) );
......@@ -444,7 +418,6 @@ namespace pcr
return makeAny( aScriptDescriptor );
}
//------------------------------------------------------------------------
Sequence< OUString > SAL_CALL EventHolder::getElementNames( ) throw (RuntimeException)
{
Sequence< OUString > aReturn( m_aEventIndexAccess.size() );
......@@ -467,31 +440,24 @@ namespace pcr
return aReturn;
}
//------------------------------------------------------------------------
sal_Bool SAL_CALL EventHolder::hasByName( const OUString& _rName ) throw (RuntimeException)
{
EventMap::const_iterator pos = m_aEventNameAccess.find( _rName );
return pos != m_aEventNameAccess.end();
}
//------------------------------------------------------------------------
Type SAL_CALL EventHolder::getElementType( ) throw (RuntimeException)
{
return ::getCppuType( static_cast< Sequence< PropertyValue >* >( NULL ) );
}
//------------------------------------------------------------------------
sal_Bool SAL_CALL EventHolder::hasElements( ) throw (RuntimeException)
{
return !m_aEventNameAccess.empty();
}
//====================================================================
//= EventHandler
//====================================================================
DBG_NAME( EventHandler )
//--------------------------------------------------------------------
EventHandler::EventHandler( const Reference< XComponentContext >& _rxContext )
:EventHandler_Base( m_aMutex )
,m_xContext( _rxContext )
......@@ -503,38 +469,31 @@ namespace pcr
DBG_CTOR( EventHandler, NULL );
}
//--------------------------------------------------------------------
EventHandler::~EventHandler()
{
DBG_DTOR( EventHandler, NULL );
}
//--------------------------------------------------------------------
OUString SAL_CALL EventHandler::getImplementationName( ) throw (RuntimeException)
{
return getImplementationName_static();
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL EventHandler::supportsService( const OUString& ServiceName ) throw (RuntimeException)
{
StlSyntaxSequence< OUString > aAllServices( getSupportedServiceNames() );
return ::std::find( aAllServices.begin(), aAllServices.end(), ServiceName ) != aAllServices.end();
return cppu::supportsService(this, ServiceName);
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL EventHandler::getSupportedServiceNames( ) throw (RuntimeException)
{
return getSupportedServiceNames_static();
}
//--------------------------------------------------------------------
OUString SAL_CALL EventHandler::getImplementationName_static( ) throw (RuntimeException)
{
return OUString( "com.sun.star.comp.extensions.EventHandler" );
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL EventHandler::getSupportedServiceNames_static( ) throw (RuntimeException)
{
Sequence< OUString > aSupported( 1 );
......@@ -542,13 +501,11 @@ namespace pcr
return aSupported;
}
//--------------------------------------------------------------------
Reference< XInterface > SAL_CALL EventHandler::Create( const Reference< XComponentContext >& _rxContext )
{
return *( new EventHandler( _rxContext ) );
}
//--------------------------------------------------------------------
void SAL_CALL EventHandler::inspect( const Reference< XInterface >& _rxIntrospectee ) throw (RuntimeException, NullPointerException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -588,7 +545,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
Any SAL_CALL EventHandler::getPropertyValue( const OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -616,7 +572,6 @@ namespace pcr
return makeAny( aPropertyValue );
}
//--------------------------------------------------------------------
void SAL_CALL EventHandler::setPropertyValue( const OUString& _rPropertyName, const Any& _rValue ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -647,7 +602,6 @@ namespace pcr
m_aPropertyListeners.notify( aEvent, &XPropertyChangeListener::propertyChange );
}
//--------------------------------------------------------------------
Any SAL_CALL EventHandler::convertToPropertyValue( const OUString& _rPropertyName, const Any& _rControlValue ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -675,7 +629,6 @@ namespace pcr
return makeAny( aAssignedScript );
}
//--------------------------------------------------------------------
Any SAL_CALL EventHandler::convertToControlValue( const OUString& /*_rPropertyName*/, const Any& _rPropertyValue, const Type& _rControlValueType ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -740,13 +693,11 @@ namespace pcr
return makeAny( sScript );
}
//--------------------------------------------------------------------
PropertyState SAL_CALL EventHandler::getPropertyState( const OUString& /*_rPropertyName*/ ) throw (UnknownPropertyException, RuntimeException)
{
return PropertyState_DIRECT_VALUE;
}
//--------------------------------------------------------------------
void SAL_CALL EventHandler::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -755,14 +706,12 @@ namespace pcr
m_aPropertyListeners.addListener( _rxListener );
}
//--------------------------------------------------------------------
void SAL_CALL EventHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
m_aPropertyListeners.removeListener( _rxListener );
}
//--------------------------------------------------------------------
Sequence< Property > SAL_CALL EventHandler::getSupportedProperties() throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -836,21 +785,18 @@ namespace pcr
return aReturn;
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL EventHandler::getSupersededProperties( ) throw (RuntimeException)
{
// none
return Sequence< OUString >( );
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL EventHandler::getActuatingProperties( ) throw (RuntimeException)
{
// none
return Sequence< OUString >( );
}
//--------------------------------------------------------------------
LineDescriptor SAL_CALL EventHandler::describePropertyLine( const OUString& _rPropertyName,
const Reference< XPropertyControlFactory >& _rxControlFactory )
throw (UnknownPropertyException, NullPointerException, RuntimeException)
......@@ -874,13 +820,11 @@ namespace pcr
return aDescriptor;
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL EventHandler::isComposable( const OUString& /*_rPropertyName*/ ) throw (UnknownPropertyException, RuntimeException)
{
return sal_False;
}
//--------------------------------------------------------------------
InteractiveSelectionResult SAL_CALL EventHandler::onInteractivePropertySelection( const OUString& _rPropertyName, sal_Bool /*_bPrimary*/, Any& /*_rData*/, const Reference< XObjectInspectorUI >& _rxInspectorUI ) throw (UnknownPropertyException, NullPointerException, RuntimeException)
{
if ( !_rxInspectorUI.is() )
......@@ -955,16 +899,13 @@ namespace pcr
return InteractiveSelectionResult_Success;
}
//--------------------------------------------------------------------
void SAL_CALL EventHandler::actuatingPropertyChanged( const OUString& /*_rActuatingPropertyName*/, const Any& /*_rNewValue*/, const Any& /*_rOldValue*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/, sal_Bool /*_bFirstTimeInit*/ ) throw (NullPointerException, RuntimeException)
{
OSL_FAIL( "EventHandler::actuatingPropertyChanged: no actuating properties -> no callback (well, this is how it *should* be!)" );
}
//--------------------------------------------------------------------
IMPLEMENT_FORWARD_XCOMPONENT( EventHandler, EventHandler_Base )
//--------------------------------------------------------------------
void SAL_CALL EventHandler::disposing()
{
EventMap aEmpty;
......@@ -972,13 +913,11 @@ namespace pcr
m_xComponent.clear();
}
//--------------------------------------------------------------------
sal_Bool SAL_CALL EventHandler::suspend( sal_Bool /*_bSuspend*/ ) throw (RuntimeException)
{
return sal_True;
}
//------------------------------------------------------------------------
Reference< XFrame > EventHandler::impl_getContextFrame_nothrow() const
{
Reference< XFrame > xContextFrame;
......@@ -997,7 +936,6 @@ namespace pcr
return xContextFrame;
}
//--------------------------------------------------------------------
sal_Int32 EventHandler::impl_getComponentIndexInParent_throw() const
{
Reference< XChild > xChild( m_xComponent, UNO_QUERY_THROW );
......@@ -1014,7 +952,6 @@ namespace pcr
throw NoSuchElementException();
}
//--------------------------------------------------------------------
void EventHandler::impl_getFormComponentScriptEvents_nothrow( Sequence < ScriptEventDescriptor >& _out_rEvents ) const
{
_out_rEvents = Sequence < ScriptEventDescriptor >();
......@@ -1040,7 +977,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
void EventHandler::impl_getCopmonentListenerTypes_nothrow( Sequence< Type >& _out_rTypes ) const
{
_out_rTypes.realloc( 0 );
......@@ -1072,7 +1008,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
void EventHandler::impl_getDialogElementScriptEvents_nothrow( Sequence < ScriptEventDescriptor >& _out_rEvents ) const
{
_out_rEvents = Sequence < ScriptEventDescriptor >();
......@@ -1097,7 +1032,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
Reference< XInterface > EventHandler::impl_getSecondaryComponentForEventInspection_throw( ) const
{
Reference< XInterface > xReturn;
......@@ -1122,7 +1056,6 @@ namespace pcr
return xReturn;
}
//--------------------------------------------------------------------
const EventDescription& EventHandler::impl_getEventForName_throw( const OUString& _rPropertyName ) const
{
EventMap::const_iterator pos = m_aEvents.find( _rPropertyName );
......@@ -1131,7 +1064,6 @@ namespace pcr
return pos->second;
}
//--------------------------------------------------------------------
namespace
{
static bool lcl_endsWith( const OUString& _rText, const OUString& _rCheck )
......@@ -1144,7 +1076,7 @@ namespace pcr
return _rText.indexOf( _rCheck ) == ( nTextLen - nCheckLen );
}
}
//--------------------------------------------------------------------
void EventHandler::impl_setFormComponentScriptEvent_nothrow( const ScriptEventDescriptor& _rScriptEvent )
{
try
......@@ -1203,7 +1135,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
void EventHandler::impl_setDialogElementScriptEvent_nothrow( const ScriptEventDescriptor& _rScriptEvent )
{
try
......@@ -1243,7 +1174,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
bool EventHandler::impl_filterMethod_nothrow( const EventDescription& _rEvent ) const
{
// some (control-triggered) events do not make sense for certain grid control columns. However,
......@@ -1266,8 +1196,6 @@ namespace pcr
return true;
}
//........................................................................
} // namespace pcr
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -32,22 +32,21 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <tools/debug.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/extract.hxx>
#include <tools/debug.hxx>
#include <algorithm>
#include <o3tl/compat_functional.hxx>
//------------------------------------------------------------------------
extern "C" void SAL_CALL createRegistryInfo_GenericPropertyHandler()
{
::pcr::OAutoRegistration< ::pcr::GenericPropertyHandler > aAutoRegistration;
}
//........................................................................
namespace pcr
{
//........................................................................
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
......@@ -61,9 +60,6 @@ namespace pcr
using ::com::sun::star::awt::XActionListener;
using ::com::sun::star::awt::ActionEvent;
//====================================================================
//= EnumRepresentation
//====================================================================
class EnumRepresentation : public IPropertyEnumRepresentation
{
private:
......@@ -93,7 +89,6 @@ namespace pcr
EnumRepresentation& operator=( const EnumRepresentation& ); // never implemented
};
//--------------------------------------------------------------------
EnumRepresentation::EnumRepresentation( const Reference< XComponentContext >& _rxContext, const Type& _rEnumType )
:m_refCount( 0 )
,m_aEnumType( _rEnumType )
......@@ -115,7 +110,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
::std::vector< OUString > EnumRepresentation::getDescriptions() const
{
Sequence< OUString > aNames;
......@@ -132,7 +126,6 @@ namespace pcr
return ::std::vector< OUString >( aNames.getConstArray(), aNames.getConstArray() + aNames.getLength() );
}
//--------------------------------------------------------------------
void EnumRepresentation::impl_getValues( Sequence< sal_Int32 >& _out_rValues ) const
{
_out_rValues.realloc( 0 );
......@@ -147,7 +140,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
void EnumRepresentation::getValueFromDescription( const OUString& _rDescription, Any& _out_rValue ) const
{
::std::vector< OUString > aDescriptions( getDescriptions() );
......@@ -167,7 +159,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
OUString EnumRepresentation::getDescriptionForValue( const Any& _rEnumValue ) const
{
OUString sDescription;
......@@ -191,13 +182,11 @@ namespace pcr
return sDescription;
}
//--------------------------------------------------------------------
oslInterlockedCount SAL_CALL EnumRepresentation::acquire()
{
return osl_atomic_increment( &m_refCount );
}
//--------------------------------------------------------------------
oslInterlockedCount SAL_CALL EnumRepresentation::release()
{
if ( 0 == osl_atomic_decrement( &m_refCount ) )
......@@ -208,9 +197,6 @@ namespace pcr
return m_refCount;
}
//====================================================================
//= UrlClickHandler
//====================================================================
typedef ::cppu::WeakImplHelper1 < XActionListener
> UrlClickHandler_Base;
class UrlClickHandler : public UrlClickHandler_Base
......@@ -232,9 +218,8 @@ namespace pcr
void impl_dispatch_throw( const OUString& _rURL );
};
//--------------------------------------------------------------------
DBG_NAME( UrlClickHandler )
//--------------------------------------------------------------------
UrlClickHandler::UrlClickHandler( const Reference<XComponentContext>& _rContext, const Reference< XHyperlinkControl >& _rxControl )
:m_xContext( _rContext )
{
......@@ -251,13 +236,11 @@ namespace pcr
DBG_CTOR( UrlClickHandler, NULL );
}
//--------------------------------------------------------------------
UrlClickHandler::~UrlClickHandler()
{
DBG_DTOR( UrlClickHandler, NULL );
}
//--------------------------------------------------------------------
void SAL_CALL UrlClickHandler::actionPerformed( const ActionEvent& rEvent ) throw (RuntimeException)
{
Reference< XPropertyControl > xControl( rEvent.Source, UNO_QUERY_THROW );
......@@ -273,13 +256,11 @@ namespace pcr
impl_dispatch_throw( sURL );
}
//--------------------------------------------------------------------
void SAL_CALL UrlClickHandler::disposing( const EventObject& /*Source*/ ) throw (RuntimeException)
{
// not interested in
}
//--------------------------------------------------------------------
void UrlClickHandler::impl_dispatch_throw( const OUString& _rURL )
{
Reference< XURLTransformer > xTransformer( URLTransformer::create(m_xContext) );
......@@ -296,11 +277,8 @@ namespace pcr
xDispatch->dispatch( aURL, aDispatchArgs );
}
//====================================================================
//= GenericPropertyHandler
//====================================================================
DBG_NAME( GenericPropertyHandler )
//--------------------------------------------------------------------
GenericPropertyHandler::GenericPropertyHandler( const Reference< XComponentContext >& _rxContext )
:GenericPropertyHandler_Base( m_aMutex )
,m_xContext( _rxContext )
......@@ -312,38 +290,31 @@ namespace pcr
m_xTypeConverter = Converter::create(_rxContext);
}
//--------------------------------------------------------------------
GenericPropertyHandler::~GenericPropertyHandler()
{
DBG_DTOR( GenericPropertyHandler, NULL );
}
//--------------------------------------------------------------------
OUString SAL_CALL GenericPropertyHandler::getImplementationName( ) throw (RuntimeException)
{
return getImplementationName_static();
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL GenericPropertyHandler::supportsService( const OUString& ServiceName ) throw (RuntimeException)
{
StlSyntaxSequence< OUString > aAllServices( getSupportedServiceNames() );
return ::std::find( aAllServices.begin(), aAllServices.end(), ServiceName ) != aAllServices.end();
return cppu::supportsService(this, ServiceName);
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL GenericPropertyHandler::getSupportedServiceNames( ) throw (RuntimeException)
{
return getSupportedServiceNames_static();
}
//--------------------------------------------------------------------
OUString SAL_CALL GenericPropertyHandler::getImplementationName_static( ) throw (RuntimeException)
{
return OUString( "com.sun.star.comp.extensions.GenericPropertyHandler" );
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL GenericPropertyHandler::getSupportedServiceNames_static( ) throw (RuntimeException)
{
Sequence< OUString > aSupported( 1 );
......@@ -351,13 +322,11 @@ namespace pcr
return aSupported;
}
//--------------------------------------------------------------------
Reference< XInterface > SAL_CALL GenericPropertyHandler::Create( const Reference< XComponentContext >& _rxContext )
{
return *( new GenericPropertyHandler( _rxContext ) );
}
//--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::inspect( const Reference< XInterface >& _rxIntrospectee ) throw (RuntimeException, NullPointerException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -395,7 +364,6 @@ namespace pcr
m_xComponent->addPropertyChangeListener( OUString(), static_cast< XPropertyChangeListener* >( iterReAdd.next() ) );
}
//--------------------------------------------------------------------
Any SAL_CALL GenericPropertyHandler::getPropertyValue( const OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -405,7 +373,6 @@ namespace pcr
return m_xComponent->getPropertyValue( _rPropertyName );
}
//--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::setPropertyValue( const OUString& _rPropertyName, const Any& _rValue ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -415,7 +382,6 @@ namespace pcr
m_xComponent->setPropertyValue( _rPropertyName, _rValue );
}
//--------------------------------------------------------------------
::rtl::Reference< IPropertyEnumRepresentation > GenericPropertyHandler::impl_getEnumConverter( const Type& _rEnumType )
{
::rtl::Reference< IPropertyEnumRepresentation >& rConverter = m_aEnumConverters[ _rEnumType ];
......@@ -424,7 +390,6 @@ namespace pcr
return rConverter;
}
//--------------------------------------------------------------------
Any SAL_CALL GenericPropertyHandler::convertToPropertyValue( const OUString& _rPropertyName, const Any& _rControlValue ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -451,7 +416,6 @@ namespace pcr
return aPropertyValue;
}
//--------------------------------------------------------------------
Any SAL_CALL GenericPropertyHandler::convertToControlValue( const OUString& _rPropertyName, const Any& _rPropertyValue, const Type& _rControlValueType ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -475,7 +439,6 @@ namespace pcr
return aControlValue;
}
//--------------------------------------------------------------------
PropertyState SAL_CALL GenericPropertyHandler::getPropertyState( const OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -485,7 +448,6 @@ namespace pcr
return eState;
}
//--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException)
{
if ( !_rxListener.is() )
......@@ -506,7 +468,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -524,7 +485,6 @@ namespace pcr
m_aPropertyListeners.removeInterface( _rxListener );
}
//--------------------------------------------------------------------
void GenericPropertyHandler::impl_ensurePropertyMap()
{
if ( !m_bPropertyMapInitialized )
......@@ -592,7 +552,6 @@ namespace pcr
}
}
//--------------------------------------------------------------------
Sequence< Property > SAL_CALL GenericPropertyHandler::getSupportedProperties() throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -604,7 +563,6 @@ namespace pcr
return aReturn;
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL GenericPropertyHandler::getSupersededProperties( ) throw (RuntimeException)
{
// no superseded properties at all. This handler offers the very basic PropertyHandler
......@@ -613,7 +571,6 @@ namespace pcr
return Sequence< OUString >( );
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL GenericPropertyHandler::getActuatingProperties( ) throw (RuntimeException)
{
// This basic PropertyHandler implementation is too dumb^Wgeneric to know
......@@ -621,7 +578,6 @@ namespace pcr
return Sequence< OUString >( );
}
//--------------------------------------------------------------------
LineDescriptor SAL_CALL GenericPropertyHandler::describePropertyLine( const OUString& _rPropertyName,
const Reference< XPropertyControlFactory >& _rxControlFactory )
throw (UnknownPropertyException, NullPointerException, RuntimeException)
......@@ -671,32 +627,27 @@ namespace pcr
return aDescriptor;
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL GenericPropertyHandler::isComposable( const OUString& /*_rPropertyName*/ ) throw (UnknownPropertyException, RuntimeException)
{
return sal_False;
}
//--------------------------------------------------------------------
InteractiveSelectionResult SAL_CALL GenericPropertyHandler::onInteractivePropertySelection( const OUString& /*_rPropertyName*/, sal_Bool /*_bPrimary*/, Any& /*_rData*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/ ) throw (UnknownPropertyException, NullPointerException, RuntimeException)
{
OSL_FAIL( "GenericPropertyHandler::onInteractivePropertySelection: I'm too dumb to know anything about property browse buttons!" );
return InteractiveSelectionResult_Cancelled;
}
//--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::actuatingPropertyChanged( const OUString& /*_rActuatingPropertyName*/, const Any& /*_rNewValue*/, const Any& /*_rOldValue*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/, sal_Bool /*_bFirstTimeInit*/ ) throw (NullPointerException, RuntimeException)
{
OSL_FAIL( "GenericPropertyHandler::actuatingPropertyChanged: no no no, I did not register for any actuating properties!" );
}
//--------------------------------------------------------------------
sal_Bool SAL_CALL GenericPropertyHandler::suspend( sal_Bool /*_bSuspend*/ ) throw (RuntimeException)
{
return sal_True;
}
//--------------------------------------------------------------------
void SAL_CALL GenericPropertyHandler::disposing()
{
m_aPropertyListeners.clear();
......@@ -704,11 +655,8 @@ namespace pcr
// at this handler instance
}
//--------------------------------------------------------------------
IMPLEMENT_FORWARD_XCOMPONENT( GenericPropertyHandler, GenericPropertyHandler_Base );
//........................................................................
} // namespace pcr
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -28,6 +28,7 @@
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/script/Converter.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <tools/debug.hxx>
#include <unotools/confignode.hxx>
#include <unotools/localedatawrapper.hxx>
......@@ -36,10 +37,8 @@
#include <algorithm>
//........................................................................
namespace pcr
{
//........................................................................
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
......@@ -51,11 +50,8 @@ namespace pcr
using namespace ::com::sun::star::inspection;
using namespace ::comphelper;
//====================================================================
//= PropertyHandler
//====================================================================
DBG_NAME( PropertyHandler )
//--------------------------------------------------------------------
PropertyHandler::PropertyHandler( const Reference< XComponentContext >& _rxContext )
:PropertyHandler_Base( m_aMutex )
,m_bSupportedPropertiesAreKnown( false )
......@@ -68,13 +64,11 @@ namespace pcr
m_xTypeConverter = Converter::create(_rxContext);
}
//--------------------------------------------------------------------
PropertyHandler::~PropertyHandler()
{
DBG_DTOR( PropertyHandler, NULL );
}
//--------------------------------------------------------------------
void SAL_CALL PropertyHandler::inspect( const Reference< XInterface >& _rxIntrospectee ) throw (RuntimeException, NullPointerException)
{
if ( !_rxIntrospectee.is() )
......@@ -104,7 +98,6 @@ namespace pcr
addPropertyChangeListener( static_cast< XPropertyChangeListener* >( readdListener->next() ) );
}
//--------------------------------------------------------------------
void PropertyHandler::onNewComponent()
{
if ( m_xComponent.is() )
......@@ -116,7 +109,6 @@ namespace pcr
m_aSupportedProperties.realloc( 0 );
}
//--------------------------------------------------------------------
Sequence< Property > SAL_CALL PropertyHandler::getSupportedProperties() throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -128,19 +120,16 @@ namespace pcr
return (Sequence< Property >)m_aSupportedProperties;
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL PropertyHandler::getSupersededProperties( ) throw (RuntimeException)
{
return Sequence< OUString >();
}
//--------------------------------------------------------------------
Sequence< OUString > SAL_CALL PropertyHandler::getActuatingProperties( ) throw (RuntimeException)
{
return Sequence< OUString >();
}
//--------------------------------------------------------------------
Any SAL_CALL PropertyHandler::convertToPropertyValue( const OUString& _rPropertyName, const Any& _rControlValue ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -167,7 +156,6 @@ namespace pcr
return aPropertyValue;
}
//--------------------------------------------------------------------
Any SAL_CALL PropertyHandler::convertToControlValue( const OUString& _rPropertyName, const Any& _rPropertyValue, const Type& _rControlValueType ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -187,13 +175,11 @@ namespace pcr
m_xContext, m_xTypeConverter, _rPropertyValue, _rControlValueType );
}
//--------------------------------------------------------------------
PropertyState SAL_CALL PropertyHandler::getPropertyState( const OUString& /*_rPropertyName*/ ) throw (UnknownPropertyException, RuntimeException)
{
return PropertyState_DIRECT_VALUE;
}
//--------------------------------------------------------------------
LineDescriptor SAL_CALL PropertyHandler::describePropertyLine( const OUString& _rPropertyName,
const Reference< XPropertyControlFactory >& _rxControlFactory )
throw (UnknownPropertyException, NullPointerException, RuntimeException)
......@@ -225,27 +211,23 @@ namespace pcr
return aDescriptor;
}
//--------------------------------------------------------------------
::sal_Bool SAL_CALL PropertyHandler::isComposable( const OUString& _rPropertyName ) throw (UnknownPropertyException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return m_pInfoService->isComposeable( _rPropertyName );
}
//--------------------------------------------------------------------
InteractiveSelectionResult SAL_CALL PropertyHandler::onInteractivePropertySelection( const OUString& /*_rPropertyName*/, sal_Bool /*_bPrimary*/, Any& /*_rData*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/ ) throw (UnknownPropertyException, NullPointerException, RuntimeException)
{
OSL_FAIL( "PropertyHandler::onInteractivePropertySelection: not implemented!" );
return InteractiveSelectionResult_Cancelled;
}
//--------------------------------------------------------------------
void SAL_CALL PropertyHandler::actuatingPropertyChanged( const OUString& /*_rActuatingPropertyName*/, const Any& /*_rNewValue*/, const Any& /*_rOldValue*/, const Reference< XObjectInspectorUI >& /*_rxInspectorUI*/, sal_Bool /*_bFirstTimeInit*/ ) throw (NullPointerException, RuntimeException)
{
OSL_FAIL( "PropertyHandler::actuatingPropertyChanged: not implemented!" );
}
//--------------------------------------------------------------------
void SAL_CALL PropertyHandler::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
......@@ -254,22 +236,19 @@ namespace pcr
m_aPropertyListeners.addListener( _rxListener );
}
//--------------------------------------------------------------------
void SAL_CALL PropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener ) throw (RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
m_aPropertyListeners.removeListener( _rxListener );
}
//--------------------------------------------------------------------
sal_Bool SAL_CALL PropertyHandler::suspend( sal_Bool /*_bSuspend*/ ) throw (RuntimeException)
{
return sal_True;
}
//--------------------------------------------------------------------
IMPLEMENT_FORWARD_XCOMPONENT( PropertyHandler, PropertyHandler_Base )
//--------------------------------------------------------------------
void SAL_CALL PropertyHandler::disposing()
{
m_xComponent.clear();
......@@ -278,7 +257,6 @@ namespace pcr
m_aSupportedProperties.realloc( 0 );
}
//--------------------------------------------------------------------
void PropertyHandler::firePropertyChange( const OUString& _rPropName, PropertyId _nPropId, const Any& _rOldValue, const Any& _rNewValue ) SAL_THROW(())
{
PropertyChangeEvent aEvent;
......@@ -290,7 +268,6 @@ namespace pcr
m_aPropertyListeners.notify( aEvent, &XPropertyChangeListener::propertyChange );
}
//--------------------------------------------------------------------
const Property* PropertyHandler::impl_getPropertyFromId_nothrow( PropertyId _nPropId ) const
{
const_cast< PropertyHandler* >( this )->getSupportedProperties();
......@@ -302,7 +279,6 @@ namespace pcr
return NULL;
}
//--------------------------------------------------------------------
const Property& PropertyHandler::impl_getPropertyFromId_throw( PropertyId _nPropId ) const
{
const Property* pProperty = impl_getPropertyFromId_nothrow( _nPropId );
......@@ -312,7 +288,6 @@ namespace pcr
return *pProperty;
}
//--------------------------------------------------------------------
const Property& PropertyHandler::impl_getPropertyFromName_throw( const OUString& _rPropertyName ) const
{
const_cast< PropertyHandler* >( this )->getSupportedProperties();
......@@ -325,7 +300,6 @@ namespace pcr
return *pFound;
}
//--------------------------------------------------------------------
void PropertyHandler::implAddPropertyDescription( ::std::vector< Property >& _rProperties, const OUString& _rPropertyName, const Type& _rType, sal_Int16 _nAttribs ) const
{
_rProperties.push_back( Property(
......@@ -336,13 +310,11 @@ namespace pcr
) );
}
//------------------------------------------------------------------------
Window* PropertyHandler::impl_getDefaultDialogParent_nothrow() const
{
return PropertyHandlerHelper::getDialogParentWindow( m_xContext );
}
//------------------------------------------------------------------------
PropertyId PropertyHandler::impl_getPropertyId_throw( const OUString& _rPropertyName ) const
{
PropertyId nPropId = m_pInfoService->getPropertyId( _rPropertyName );
......@@ -351,7 +323,6 @@ namespace pcr
return nPropId;
}
//------------------------------------------------------------------------
void PropertyHandler::impl_setContextDocumentModified_nothrow() const
{
Reference< XModifiable > xModifiable( impl_getContextDocument_nothrow(), UNO_QUERY );
......@@ -359,13 +330,11 @@ namespace pcr
xModifiable->setModified( sal_True );
}
//------------------------------------------------------------------------
bool PropertyHandler::impl_componentHasProperty_throw( const OUString& _rPropName ) const
{
return m_xComponentPropertyInfo.is() && m_xComponentPropertyInfo->hasPropertyByName( _rPropName );
}
//--------------------------------------------------------------------
sal_Int16 PropertyHandler::impl_getDocumentMeasurementUnit_throw() const
{
FieldUnit eUnit = FUNIT_NONE;
......@@ -426,28 +395,19 @@ namespace pcr
return VCLUnoHelper::ConvertToMeasurementUnit( eUnit, 1 );
}
//====================================================================
//= PropertyHandlerComponent
//====================================================================
//------------------------------------------------------------------------
PropertyHandlerComponent::PropertyHandlerComponent( const Reference< XComponentContext >& _rxContext )
:PropertyHandler( _rxContext )
{
}
//--------------------------------------------------------------------
IMPLEMENT_FORWARD_XINTERFACE2( PropertyHandlerComponent, PropertyHandler, PropertyHandlerComponent_Base )
IMPLEMENT_FORWARD_XTYPEPROVIDER2( PropertyHandlerComponent, PropertyHandler, PropertyHandlerComponent_Base )
//--------------------------------------------------------------------
::sal_Bool SAL_CALL PropertyHandlerComponent::supportsService( const OUString& ServiceName ) throw (RuntimeException)
{
StlSyntaxSequence< OUString > aAllServices( getSupportedServiceNames() );
return ::std::find( aAllServices.begin(), aAllServices.end(), ServiceName ) != aAllServices.end();
return cppu::supportsService(this, ServiceName);
}
//........................................................................
} // namespace pcr
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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