fdo#54938: Convert svtools to cppu::supportsService...
...final part Conflicts: svtools/source/filter/SvFilterOptionsDialog.cxx Change-Id: Ie4a0a7ea8ec65b3e632d06627bba40a26c9a7a91
This commit is contained in:
parent
881c3dfaef
commit
cf51afb026
@ -23,6 +23,7 @@
|
||||
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
|
||||
#include <com/sun/star/awt/XWindow.hpp>
|
||||
#include <comphelper/accessibleeventnotifier.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <cppuhelper/typeprovider.hxx>
|
||||
#include <toolkit/helper/vclunohelper.hxx>
|
||||
#include <toolkit/helper/convert.hxx>
|
||||
@ -362,7 +363,6 @@ sal_Int32 SvtRulerAccessible::getBackground( )
|
||||
}
|
||||
|
||||
//===== XServiceInfo ========================================================
|
||||
|
||||
OUString SAL_CALL SvtRulerAccessible::getImplementationName( void ) throw( RuntimeException )
|
||||
{
|
||||
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.ui.SvtRulerAccessible" ) );
|
||||
@ -370,20 +370,7 @@ OUString SAL_CALL SvtRulerAccessible::getImplementationName( void ) throw( Runti
|
||||
|
||||
sal_Bool SAL_CALL SvtRulerAccessible::supportsService( const OUString& sServiceName ) throw( RuntimeException )
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
// Iterate over all supported service names and return true if on of them
|
||||
// matches the given name.
|
||||
Sequence< OUString > aSupportedServices( getSupportedServiceNames() );
|
||||
int nLength = aSupportedServices.getLength();
|
||||
const OUString* pStr = aSupportedServices.getConstArray();
|
||||
|
||||
for( int i = nLength ; i ; --i, ++pStr )
|
||||
{
|
||||
if( sServiceName == *pStr )
|
||||
return sal_True;
|
||||
}
|
||||
|
||||
return sal_False;
|
||||
return cppu::supportsService( this, sServiceName );
|
||||
}
|
||||
|
||||
Sequence< OUString > SAL_CALL SvtRulerAccessible::getSupportedServiceNames( void ) throw( RuntimeException )
|
||||
@ -393,15 +380,12 @@ Sequence< OUString > SAL_CALL SvtRulerAccessible::getSupportedServiceNames( void
|
||||
}
|
||||
|
||||
//===== XTypeProvider =======================================================
|
||||
|
||||
Sequence< sal_Int8 > SAL_CALL SvtRulerAccessible::getImplementationId( void ) throw( RuntimeException )
|
||||
{
|
||||
return getUniqueId();
|
||||
}
|
||||
|
||||
|
||||
//===== internals ========================================================
|
||||
|
||||
void SvtRulerAccessible::setName( const OUString& rName )
|
||||
{
|
||||
msName = rName;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
|
||||
#include <com/sun/star/accessibility/AccessibleRole.hpp>
|
||||
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
|
||||
#include <unotools/accessiblestatesethelper.hxx>
|
||||
#include <unotools/accessiblerelationsethelper.hxx>
|
||||
@ -143,30 +144,17 @@ void VCLXAccessibleHeaderBarItem::disposing()
|
||||
AccessibleExtendedComponentHelper_BASE::disposing();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// XServiceInfo
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
OUString VCLXAccessibleHeaderBarItem::getImplementationName() throw (RuntimeException)
|
||||
{
|
||||
return OUString("com.sun.star.comp.svtools.AccessibleHeaderBarItem");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
sal_Bool VCLXAccessibleHeaderBarItem::supportsService( const OUString& rServiceName ) throw (RuntimeException)
|
||||
{
|
||||
Sequence< OUString > aNames( getSupportedServiceNames() );
|
||||
const OUString* pNames = aNames.getConstArray();
|
||||
const OUString* pEnd = pNames + aNames.getLength();
|
||||
for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames )
|
||||
;
|
||||
|
||||
return pNames != pEnd;
|
||||
return cppu::supportsService( this, rServiceName );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Sequence< OUString > VCLXAccessibleHeaderBarItem::getSupportedServiceNames() throw (RuntimeException)
|
||||
{
|
||||
Sequence< OUString > aNames(1);
|
||||
@ -174,10 +162,7 @@ Sequence< OUString > VCLXAccessibleHeaderBarItem::getSupportedServiceNames() thr
|
||||
return aNames;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// XAccessible
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Reference< XAccessibleContext > VCLXAccessibleHeaderBarItem::getAccessibleContext() throw (RuntimeException)
|
||||
{
|
||||
OExternalLockGuard aGuard( this );
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <vcl/graph.hxx>
|
||||
#include "graphic.hxx"
|
||||
#include <comphelper/servicehelper.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <string.h>
|
||||
|
||||
using namespace com::sun::star;
|
||||
@ -131,36 +132,18 @@ uno::Sequence< OUString > Graphic::getSupportedServiceNames_Static()
|
||||
return aSeq;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
OUString SAL_CALL Graphic::getImplementationName()
|
||||
throw( uno::RuntimeException )
|
||||
{
|
||||
return getImplementationName_Static();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
sal_Bool SAL_CALL Graphic::supportsService( const OUString& rServiceName )
|
||||
throw( uno::RuntimeException )
|
||||
{
|
||||
if( ::unographic::GraphicDescriptor::supportsService( rServiceName ) )
|
||||
return true;
|
||||
else
|
||||
{
|
||||
uno::Sequence< OUString > aSNL( getSupportedServiceNames() );
|
||||
const OUString* pArray = aSNL.getConstArray();
|
||||
|
||||
for( int i = 0; i < aSNL.getLength(); i++ )
|
||||
if( pArray[i] == rServiceName )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
return cppu::supportsService( this, rServiceName );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
uno::Sequence< OUString > SAL_CALL Graphic::getSupportedServiceNames()
|
||||
throw( uno::RuntimeException )
|
||||
{
|
||||
@ -176,8 +159,6 @@ uno::Sequence< OUString > SAL_CALL Graphic::getSupportedServiceNames()
|
||||
return aRet;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
uno::Sequence< uno::Type > SAL_CALL Graphic::getTypes()
|
||||
throw(uno::RuntimeException)
|
||||
{
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <com/sun/star/io/XStream.hpp>
|
||||
#include <com/sun/star/text/GraphicCrop.hpp>
|
||||
#include <comphelper/servicehelper.hxx>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
|
||||
#include "descriptor.hxx"
|
||||
#include "graphic.hxx"
|
||||
@ -51,37 +52,22 @@ GraphicProvider::GraphicProvider()
|
||||
{
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
GraphicProvider::~GraphicProvider()
|
||||
{
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
OUString SAL_CALL GraphicProvider::getImplementationName()
|
||||
throw( uno::RuntimeException )
|
||||
{
|
||||
return OUString( "com.sun.star.comp.graphic.GraphicProvider" );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
sal_Bool SAL_CALL GraphicProvider::supportsService( const OUString& ServiceName )
|
||||
throw( uno::RuntimeException )
|
||||
{
|
||||
uno::Sequence< OUString > aSNL( getSupportedServiceNames() );
|
||||
const OUString* pArray = aSNL.getConstArray();
|
||||
|
||||
for( int i = 0; i < aSNL.getLength(); i++ )
|
||||
if( pArray[i] == ServiceName )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return cppu::supportsService( this, ServiceName );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
uno::Sequence< OUString > SAL_CALL GraphicProvider::getSupportedServiceNames()
|
||||
throw( uno::RuntimeException )
|
||||
{
|
||||
@ -90,8 +76,6 @@ uno::Sequence< OUString > SAL_CALL GraphicProvider::getSupportedServiceNames()
|
||||
return aSeq;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
uno::Sequence< uno::Type > SAL_CALL GraphicProvider::getTypes()
|
||||
throw(uno::RuntimeException)
|
||||
{
|
||||
|
@ -20,14 +20,15 @@
|
||||
#ifndef INCLUDED_SVTOOLS_SOURCE_INC_PROVIDER_HXX
|
||||
#define INCLUDED_SVTOOLS_SOURCE_INC_PROVIDER_HXX
|
||||
|
||||
#include <cppuhelper/implbase1.hxx>
|
||||
#include <cppuhelper/implbase2.hxx>
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include <com/sun/star/graphic/XGraphicProvider.hpp>
|
||||
#include <com/sun/star/awt/XBitmap.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
class GraphicProvider : public ::cppu::WeakImplHelper1< ::com::sun::star::graphic::XGraphicProvider >
|
||||
class GraphicProvider : public ::cppu::WeakImplHelper2< ::com::sun::star::graphic::XGraphicProvider,
|
||||
::com::sun::star::lang::XServiceInfo >
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
|
||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <rtl/ustrbuf.hxx>
|
||||
#include <tools/rtti.hxx>
|
||||
#include <tools/solar.h>
|
||||
@ -151,7 +151,7 @@ sal_Bool SvBaseEventDescriptor::hasElements()
|
||||
sal_Bool SvBaseEventDescriptor::supportsService(const OUString& rServiceName)
|
||||
throw(RuntimeException)
|
||||
{
|
||||
return sServiceName.equals(rServiceName);
|
||||
return cppu::supportsService(this, rServiceName);
|
||||
}
|
||||
|
||||
Sequence<OUString> SvBaseEventDescriptor::getSupportedServiceNames(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user