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

fdo#54938 Convert oox, sc, vcl, svtools... to cppu::supportsService

Change-Id: I6268bc57417d53b9810c81071fbcd604e2a19507
Reviewed-on: https://gerrit.libreoffice.org/7886Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
üst 61e28e86
......@@ -30,6 +30,7 @@
#include <com/sun/star/test/performance/XPerformanceTest.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::test;
using namespace ::com::sun::star::uno;
......@@ -252,10 +253,10 @@ OUString ServiceImpl::getImplementationName()
return OUString( );
}
sal_Bool ServiceImpl::supportsService( const OUString & /* rServiceName */)
sal_Bool ServiceImpl::supportsService( const OUString & rServiceName )
throw (RuntimeException)
{
return sal_False;
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > ServiceImpl::getSupportedServiceNames()
......@@ -610,7 +611,6 @@ void testAllTypes( const Reference < XCallMe > & rRCallMe )
OSL_ASSERT( types.Interface == retTypes.Interface );
OSL_ASSERT( types.Any == retTypes.Any );
}
}
void testRemote( const Reference< XInterface > &rRemote )
......@@ -636,9 +636,7 @@ void testRemote( const Reference< XInterface > &rRemote )
printf( "Testing exception remote ...\n" );
testException( rRCallMe );
//--------------------
// Test attributes
//----------------------
OUString ow( "dum didel dum dideldei" );
rLCallMe->setsAttribute( ow );
OSL_ASSERT( rLCallMe->getsAttribute() == ow );
......@@ -646,15 +644,11 @@ void testRemote( const Reference< XInterface > &rRemote )
rRCallMe->setsAttribute( ow );
OSL_ASSERT( rRCallMe->getsAttribute() == ow );
//-------------------
// Performance test
//-------------------
testPerformance( rRCallMe , rLCallMe );
testOnewayPerformanceOnTwoInterfaces( rRFact->createCallMe(), rRCallMe );
//----------------
// Test sequence
//----------------
testSequenceOfCalls( rRCallMe );
......@@ -704,9 +698,7 @@ void testRemote( const Reference< XInterface > &rRemote )
// test empty references
rRTest->setIn( Reference < XCallMe > () );
//--------------------------------
// test thread deadlocking
//--------------------------------
rLCallMe->callAgain( rRCallMe, 20 );
}
......
......@@ -28,6 +28,7 @@
#include "oox/vml/vmlshape.hxx"
#include "oox/drawingml/themefragmenthandler.hxx"
#include <boost/scoped_ptr.hpp>
#include <cppuhelper/supportsservice.hxx>
namespace oox { namespace shape {
......@@ -547,8 +548,7 @@ OUString SAL_CALL ShapeContextHandler::getRelationFragmentPath()
return msRelationFragmentPath;
}
void SAL_CALL ShapeContextHandler::setRelationFragmentPath
(const OUString & the_value)
void SAL_CALL ShapeContextHandler::setRelationFragmentPath(const OUString & the_value)
throw (uno::RuntimeException)
{
msRelationFragmentPath = the_value;
......@@ -562,8 +562,6 @@ void SAL_CALL ShapeContextHandler::setRelationFragmentPath
void SAL_CALL ShapeContextHandler::setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException)
{
mnStartToken = _starttoken;
}
awt::Point SAL_CALL ShapeContextHandler::getPosition() throw (uno::RuntimeException)
......@@ -588,15 +586,10 @@ uno::Sequence< OUString > ShapeContextHandler::getSupportedServiceNames()
return ShapeContextHandler_getSupportedServiceNames();
}
::sal_Bool SAL_CALL ShapeContextHandler::supportsService
(const OUString & ServiceName) throw (css::uno::RuntimeException)
::sal_Bool SAL_CALL ShapeContextHandler::supportsService(const OUString & ServiceName)
throw (css::uno::RuntimeException)
{
uno::Sequence< OUString > aSeq = getSupportedServiceNames();
if (aSeq[0].equals(ServiceName))
return sal_True;
return sal_False;
return cppu::supportsService(this, ServiceName);
}
}}
......
......@@ -21,7 +21,7 @@
#include <boost/shared_ptr.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp>
#include "oox/drawingml/graphicshapecontext.hxx"
#include "oox/drawingml/shape.hxx"
......@@ -29,6 +29,7 @@
#include "oox/core/fragmenthandler2.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "ShapeFilterBase.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
namespace oox { namespace shape {
......@@ -45,8 +46,8 @@ public:
};
class ShapeContextHandler:
public ::cppu::WeakImplHelper1<
css::xml::sax::XFastShapeContextHandler>
public ::cppu::WeakImplHelper2< css::xml::sax::XFastShapeContextHandler,
css::lang::XServiceInfo >
{
public:
explicit ShapeContextHandler
......
......@@ -27,6 +27,7 @@
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "scdllapi.h"
#define SC_SIMPLE_SERVICE_INFO( ClassName, ClassNameAscii, ServiceAscii ) \
......@@ -38,7 +39,7 @@ OUString SAL_CALL ClassName::getImplementationName() \
sal_Bool SAL_CALL ClassName::supportsService( const OUString& ServiceName ) \
throw(::com::sun::star::uno::RuntimeException) \
{ \
return !ServiceName.compareToAscii(ServiceAscii); \
return cppu::supportsService(this, ServiceName); \
} \
::com::sun::star::uno::Sequence< OUString > \
SAL_CALL ClassName::getSupportedServiceNames(void) \
......
......@@ -707,15 +707,7 @@ OUString SAL_CALL SvUnoImageMap::getImplementationName( )
sal_Bool SAL_CALL SvUnoImageMap::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
const Sequence< OUString > aSNL( getSupportedServiceNames() );
const OUString * pArray = aSNL.getConstArray();
const sal_Int32 nCount = aSNL.getLength();
for( sal_Int32 i = 0; i < nCount; i++ )
if( pArray[i] == ServiceName )
return sal_True;
return sal_False;
return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL SvUnoImageMap::getSupportedServiceNames( )
......
......@@ -334,9 +334,9 @@ OUString SAL_CALL AquaClipboard::getImplementationName() throw( RuntimeException
return clipboard_getImplementationName();
}
sal_Bool SAL_CALL AquaClipboard::supportsService( const OUString& /*ServiceName*/ ) throw( RuntimeException )
sal_Bool SAL_CALL AquaClipboard::supportsService( const OUString& ServiceName ) throw( RuntimeException )
{
return sal_False;
return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL AquaClipboard::getSupportedServiceNames() throw( RuntimeException )
......
......@@ -22,12 +22,12 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/xml/input/XAttributes.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <vector>
#include <boost/unordered_map.hpp>
......@@ -91,9 +91,10 @@ struct MGuard
};
class DocumentHandlerImpl :
public ::cppu::WeakImplHelper3< xml::sax::XDocumentHandler,
public ::cppu::WeakImplHelper4< xml::sax::XDocumentHandler,
xml::input::XNamespaceMapping,
lang::XInitialization >
lang::XInitialization,
com::sun::star::lang::XServiceInfo >
{
friend class ExtendedAttributes;
......@@ -413,17 +414,10 @@ OUString DocumentHandlerImpl::getImplementationName()
return getImplementationName_DocumentHandlerImpl();
}
sal_Bool DocumentHandlerImpl::supportsService(
OUString const & servicename )
sal_Bool DocumentHandlerImpl::supportsService( OUString const & servicename )
throw (RuntimeException)
{
Sequence< OUString > names( getSupportedServiceNames_DocumentHandlerImpl() );
for ( sal_Int32 nPos = names.getLength(); nPos--; )
{
if (names[ nPos ].equals( servicename ))
return sal_True;
}
return sal_False;
return cppu::supportsService(this, servicename);
}
Sequence< OUString > DocumentHandlerImpl::getSupportedServiceNames()
......
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