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

fdo#54938 Convert to cppu::supportsService

Change-Id: I512c525029ebd63d261560d27e9f38bbe94f7e10
Reviewed-on: https://gerrit.libreoffice.org/7649Tested-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 326bec33
......@@ -31,16 +31,16 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/animations/AnimationNodeType.hpp>
#include <com/sun/star/animations/XAnimate.hpp>
#include <animations/animationnodehelper.hxx>
#include <boost/unordered_map.hpp>
#include <cppuhelper/compbase3.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/sequence.hxx>
#include <animations/animationnodehelper.hxx>
#include <vector>
#include <boost/unordered_map.hpp>
using namespace ::com::sun::star;
......@@ -88,8 +88,6 @@ namespace animcore
TargetPropertiesCreator( const uno::Reference< uno::XComponentContext >& rxContext );
};
// --------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL createInstance_TargetPropertiesCreator( const uno::Reference< uno::XComponentContext > & rSMgr ) throw (uno::Exception)
{
return TargetPropertiesCreator::createInstance( rSMgr );
......@@ -107,8 +105,6 @@ namespace animcore
return aRet;
}
// --------------------------------------------------------------------
namespace
{
// Vector containing all properties for a given shape
......@@ -201,7 +197,6 @@ namespace animcore
{
// extract target shape from iterate node
// (will override the target for all children)
// --------------------------------------------------
uno::Reference< animations::XIterateContainer > xIterNode( xNode,
uno::UNO_QUERY );
......@@ -395,8 +390,6 @@ namespace animcore
};
}
// --------------------------------------------------------------------
TargetPropertiesCreator::TargetPropertiesCreator( const uno::Reference< uno::XComponentContext >& ) :
TargetPropertiesCreator_Base( m_aMutex )
{
......@@ -433,10 +426,7 @@ namespace animcore
// it actually does right now, for the slideshow implementation).
aFunctor( xRootNode );
// output to result sequence
// ----------------------------------------------------------------------
uno::Sequence< animations::TargetProperties > aRes( aShapeHash.size() );
::std::size_t nCurrIndex(0);
......@@ -474,7 +464,7 @@ namespace animcore
sal_Bool SAL_CALL TargetPropertiesCreator::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName.equalsIgnoreAsciiCase(SERVICE_NAME);
return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL TargetPropertiesCreator::getSupportedServiceNames() throw( uno::RuntimeException )
......
......@@ -32,6 +32,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/tools/unopolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star;
......@@ -443,7 +444,7 @@ namespace unotools
sal_Bool SAL_CALL UnoPolyPolygon::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName == SERVICE_NAME;
return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL UnoPolyPolygon::getSupportedServiceNames() throw( uno::RuntimeException )
......
......@@ -954,8 +954,7 @@ OUString OFactoryProxyHelper::getImplementationName()
sal_Bool OFactoryProxyHelper::supportsService(const OUString& ServiceName)
throw(::com::sun::star::uno::RuntimeException)
{
Reference<XServiceInfo > xInfo( xFactory, UNO_QUERY );
return xInfo.is() && xInfo->supportsService( ServiceName );
return cppu::supportsService(this, ServiceName);
}
// XServiceInfo
......
......@@ -35,7 +35,6 @@
using namespace ::com::sun::star;
//-------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetSupportedServiceNames()
{
uno::Sequence< OUString > aRet(2);
......@@ -44,20 +43,17 @@ uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetSuppo
return aRet;
}
//-------------------------------------------------------------------------
OUString SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetImplementationName()
{
return OUString("com.sun.star.comp.embed.OOoEmbeddedObjectFactory");
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::impl_staticCreateSelfInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
{
return uno::Reference< uno::XInterface >( *new OOoEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) );
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitFromEntry(
const uno::Reference< embed::XStorage >& xStorage,
const OUString& sEntName,
......@@ -149,7 +145,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
return xResult;
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor(
const uno::Reference< embed::XStorage >& xStorage,
const OUString& sEntName,
......@@ -213,7 +208,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
return xResult;
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitNew(
const uno::Sequence< sal_Int8 >& aClassID,
const OUString& /*aClassName*/,
......@@ -264,7 +258,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
return xResult;
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceUserInit(
const uno::Sequence< sal_Int8 >& aClassID,
const OUString& /*aClassName*/,
......@@ -326,8 +319,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
return xResult;
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceLink(
const uno::Reference< embed::XStorage >& /*xStorage*/,
const OUString& /*sEntName*/,
......@@ -381,7 +372,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
return xResult;
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceLinkUserInit(
const uno::Sequence< sal_Int8 >& aClassID,
const OUString& /*aClassName*/,
......@@ -447,7 +437,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
return xResult;
}
//-------------------------------------------------------------------------
OUString SAL_CALL OOoEmbeddedObjectFactory::getImplementationName()
throw ( uno::RuntimeException )
{
......@@ -460,14 +449,12 @@ sal_Bool SAL_CALL OOoEmbeddedObjectFactory::supportsService( const OUString& Ser
return cppu::supportsService(this, ServiceName);
}
//-------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::getSupportedServiceNames()
throw ( uno::RuntimeException )
{
return impl_staticGetSupportedServiceNames();
}
//-------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticGetSupportedServiceNames()
{
uno::Sequence< OUString > aRet(2);
......@@ -476,20 +463,17 @@ uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticG
return aRet;
}
//-------------------------------------------------------------------------
OUString SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticGetImplementationName()
{
return OUString("com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory");
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticCreateSelfInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
{
return uno::Reference< uno::XInterface >( *new OOoSpecialEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) );
}
//-------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::createInstanceUserInit(
const uno::Sequence< sal_Int8 >& aClassID,
const OUString& /*aClassName*/,
......@@ -515,32 +499,22 @@ uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::crea
return xResult;
}
//-------------------------------------------------------------------------
OUString SAL_CALL OOoSpecialEmbeddedObjectFactory::getImplementationName()
throw ( uno::RuntimeException )
{
return impl_staticGetImplementationName();
}
//-------------------------------------------------------------------------
sal_Bool SAL_CALL OOoSpecialEmbeddedObjectFactory::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
if ( ServiceName == aSeq[nInd] )
return sal_True;
return sal_False;
return cppu::supportsService(this, ServiceName);
}
//-------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::getSupportedServiceNames()
throw ( uno::RuntimeException )
{
return impl_staticGetSupportedServiceNames();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,14 +20,14 @@
#include "FormattedFieldWrapper.hxx"
#include "Edit.hxx"
#include "FormattedField.hxx"
#include <tools/debug.hxx>
#include "EditBase.hxx"
#include "services.hxx"
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <connectivity/dbtools.hxx>
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
//.........................................................................
namespace frm
{
using namespace ::com::sun::star::uno;
......@@ -42,9 +42,6 @@ using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
//==================================================================
// OFormattedFieldWrapper
//==================================================================
Reference<XInterface> SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const Reference<XMultiServiceFactory>& _rxFactory)
{
......@@ -138,7 +135,6 @@ OFormattedFieldWrapper::~OFormattedFieldWrapper()
}
//------------------------------------------------------------------
Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw (RuntimeException)
{
Any aReturn;
......@@ -183,29 +179,22 @@ Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw
return aReturn;
}
//------------------------------------------------------------------
OUString SAL_CALL OFormattedFieldWrapper::getServiceName() throw(RuntimeException)
{
// return the old compatibility name for an EditModel
return OUString(FRM_COMPONENT_EDIT);
}
//------------------------------------------------------------------
OUString SAL_CALL OFormattedFieldWrapper::getImplementationName( ) throw (RuntimeException)
{
return OUString("com.sun.star.comp.forms.OFormattedFieldWrapper");
}
//------------------------------------------------------------------
sal_Bool SAL_CALL OFormattedFieldWrapper::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::supportsService: should never have made it 'til here without an aggregate!");
Reference< XServiceInfo > xSI;
m_xAggregate->queryAggregation(::getCppuType(static_cast< Reference< XServiceInfo >* >(NULL))) >>= xSI;
return xSI->supportsService(_rServiceName);
return cppu::supportsService(this, _rServiceName);
}
//------------------------------------------------------------------
Sequence< OUString > SAL_CALL OFormattedFieldWrapper::getSupportedServiceNames( ) throw (RuntimeException)
{
DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::getSupportedServiceNames: should never have made it 'til here without an aggregate!");
......@@ -214,7 +203,6 @@ Sequence< OUString > SAL_CALL OFormattedFieldWrapper::getSupportedServiceNames(
return xSI->getSupportedServiceNames();
}
//------------------------------------------------------------------
void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream>& _rxOutStream) throw( IOException, RuntimeException )
{
// can't write myself
......@@ -254,7 +242,6 @@ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream>
m_xFormattedPart->write(_rxOutStream);
}
//------------------------------------------------------------------
void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>& _rxInStream) throw( IOException, RuntimeException )
{
SolarMutexGuard g;
......@@ -327,7 +314,6 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>&
decrement(m_refCount);
}
//------------------------------------------------------------------
void OFormattedFieldWrapper::ensureAggregate()
{
if (m_xAggregate.is())
......@@ -365,9 +351,7 @@ void OFormattedFieldWrapper::ensureAggregate()
decrement(m_refCount);
}
//.........................................................................
}
//.........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1596,11 +1596,6 @@ Sequence< OUString > ZipPackage::static_getSupportedServiceNames()
return aNames;
}
sal_Bool SAL_CALL ZipPackage::static_supportsService( OUString const & rServiceName )
{
return cppu::supportsService(this, rServiceName);
}
OUString ZipPackage::getImplementationName()
throw ( RuntimeException )
{
......@@ -1616,7 +1611,7 @@ Sequence< OUString > ZipPackage::getSupportedServiceNames()
sal_Bool SAL_CALL ZipPackage::supportsService( OUString const & rServiceName )
throw ( RuntimeException )
{
return static_supportsService ( rServiceName );
return cppu::supportsService(this, rServiceName);
}
uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno::Reference < XMultiServiceFactory > const & rServiceFactory )
......
......@@ -16,12 +16,14 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <XTempFile.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <unotools/tempfile.hxx>
#include <osl/file.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/tempfile.hxx>
#include <XTempFile.hxx>
OTempFileService::OTempFileService(css::uno::Reference< css::uno::XComponentContext > const & context)
: ::cppu::PropertySetMixin< css::io::XTempFile >(
......@@ -432,8 +434,7 @@ throw ( css::uno::RuntimeException )
sal_Bool SAL_CALL OTempFileService::supportsService( OUString const & rServiceName )
throw ( css::uno::RuntimeException )
{
css::uno::Sequence< OUString > aServices(getSupportedServiceNames_Static());
return rServiceName == aServices[0];
return cppu::supportsService(this, rServiceName);
}
css::uno::Sequence < OUString > SAL_CALL OTempFileService::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