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

fdo#54938 Convert basctl, mysqlc, sdext, svgio, writerp. to cppu::supportsSer.

Change-Id: I60128dbb5bf83f25eea847fe655d7126c9077414
Reviewed-on: https://gerrit.libreoffice.org/7756Tested-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 018500a7
......@@ -18,15 +18,15 @@
*/
#include "unomodel.hxx"
#include <basdoc.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <iderdll.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/objsh.hxx>
#include <vcl/svapp.hxx>
#include <iderdll.hxx>
#include <basdoc.hxx>
#include "unomodel.hxx"
namespace basctl
{
......@@ -93,7 +93,7 @@ OUString SIDEModel::getImplementationName_Static()
sal_Bool SIDEModel::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName == "com.sun.star.script.BasicIDE";
return cppu::supportsService(this, rServiceName);
}
uno::Sequence< OUString > SIDEModel::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
......
......@@ -32,6 +32,8 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
using namespace connectivity::mysqlc;
#include <cppuhelper/supportsservice.hxx>
#include <stdio.h>
#include <cppconn/exception.h>
......@@ -39,7 +41,6 @@ using namespace connectivity::mysqlc;
#include <mysql_driver.h>
#endif
/* {{{ MysqlCDriver::MysqlCDriver() -I- */
MysqlCDriver::MysqlCDriver(const Reference< XMultiServiceFactory >& _rxFactory)
: ODriver_BASE(m_aMutex)
......@@ -54,7 +55,6 @@ MysqlCDriver::MysqlCDriver(const Reference< XMultiServiceFactory >& _rxFactory)
}
/* }}} */
/* {{{ MysqlCDriver::disposing() -I- */
void MysqlCDriver::disposing()
{
......@@ -75,7 +75,6 @@ void MysqlCDriver::disposing()
}
/* }}} */
// static ServiceInfo
/* {{{ MysqlCDriver::getImplementationName_Static() -I- */
OUString MysqlCDriver::getImplementationName_Static()
......@@ -86,7 +85,6 @@ OUString MysqlCDriver::getImplementationName_Static()
}
/* }}} */
/* {{{ MysqlCDriver::getSupportedServiceNames_Static() -I- */
Sequence< OUString > MysqlCDriver::getSupportedServiceNames_Static()
throw(RuntimeException)
......@@ -110,22 +108,15 @@ OUString SAL_CALL MysqlCDriver::getImplementationName()
}
/* }}} */
/* {{{ MysqlCDriver::supportsService() -I- */
sal_Bool SAL_CALL MysqlCDriver::supportsService(const OUString& _rServiceName)
throw(RuntimeException)
{
OSL_TRACE("MysqlCDriver::supportsService");
Sequence< OUString > aSupported(getSupportedServiceNames());
const OUString* pSupported = aSupported.getConstArray();
const OUString* pEnd = pSupported + aSupported.getLength();
for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported){}
return (pSupported != pEnd);
return cppu::supportsService(this, _rServiceName);
}
/* }}} */
/* {{{ MysqlCDriver::getSupportedServiceNames() -I- */
Sequence< OUString > SAL_CALL MysqlCDriver::getSupportedServiceNames()
throw(RuntimeException)
......@@ -135,7 +126,6 @@ Sequence< OUString > SAL_CALL MysqlCDriver::getSupportedServiceNames()
}
/* }}} */
extern "C" { static void SAL_CALL thisModule() {} }
void MysqlCDriver::impl_initCppConn_lck_throw()
......@@ -251,7 +241,6 @@ Reference< XConnection > SAL_CALL MysqlCDriver::connect(const OUString& url, con
}
/* }}} */
/* {{{ MysqlCDriver::acceptsURL() -I- */
sal_Bool SAL_CALL MysqlCDriver::acceptsURL(const OUString& url)
throw(SQLException, RuntimeException)
......@@ -261,7 +250,6 @@ sal_Bool SAL_CALL MysqlCDriver::acceptsURL(const OUString& url)
}
/* }}} */
/* {{{ MysqlCDriver::getPropertyInfo() -I- */
Sequence< DriverPropertyInfo > SAL_CALL MysqlCDriver::getPropertyInfo(const OUString& url, const Sequence< PropertyValue >& /* info */)
throw(SQLException, RuntimeException)
......@@ -291,7 +279,6 @@ Sequence< DriverPropertyInfo > SAL_CALL MysqlCDriver::getPropertyInfo(const OUSt
}
/* }}} */
/* {{{ MysqlCDriver::getMajorVersion() -I- */
sal_Int32 SAL_CALL MysqlCDriver::getMajorVersion()
throw(RuntimeException)
......@@ -301,7 +288,6 @@ sal_Int32 SAL_CALL MysqlCDriver::getMajorVersion()
}
/* }}} */
/* {{{ MysqlCDriver::getMinorVersion() -I- */
sal_Int32 SAL_CALL MysqlCDriver::getMinorVersion()
throw(RuntimeException)
......@@ -311,7 +297,6 @@ sal_Int32 SAL_CALL MysqlCDriver::getMinorVersion()
}
/* }}} */
namespace connectivity
{
namespace mysqlc
......@@ -359,8 +344,6 @@ void release(oslInterlockedCount& _refCount,
}
/* }}} */
/* {{{ connectivity::mysqlc::checkDisposed() -I- */
void checkDisposed(sal_Bool _bThrow)
throw (DisposedException)
......
......@@ -20,12 +20,13 @@
#ifndef _CONNECTIVITY_OSUBCOMPONENT_HXX_
#define _CONNECTIVITY_OSUBCOMPONENT_HXX_
#include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <com/sun/star/lang/DisposedException.hpp>
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/propshlp.hxx>
#include <osl/mutex.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
namespace cppu {
class IPropertyArrayHelper;
......@@ -44,9 +45,9 @@ namespace com
}
}
}
namespace connectivity
{
namespace mysqlc
{
void release(oslInterlockedCount& _refCount,
......@@ -55,9 +56,7 @@ namespace connectivity
::com::sun::star::lang::XComponent* _pObject);
void checkDisposed(sal_Bool _bThrow) throw (::com::sun::star::lang::DisposedException);
//************************************************************
// OSubComponent
//************************************************************
template <class SELF, class WEAK> class OSubComponent
{
protected:
......@@ -91,7 +90,6 @@ namespace connectivity
}
};
template <class TYPE>
class OPropertyArrayUsageHelper
{
......@@ -141,7 +139,6 @@ namespace connectivity
template<class TYPE>
::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex;
//------------------------------------------------------------------
template <class TYPE>
OPropertyArrayUsageHelper<TYPE>::OPropertyArrayUsageHelper()
{
......@@ -149,7 +146,6 @@ namespace connectivity
++s_nRefCount;
}
//------------------------------------------------------------------
template <class TYPE>
::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
{
......@@ -164,7 +160,6 @@ namespace connectivity
return s_pProps;
}
class OBase_Mutex
{
public:
......@@ -180,7 +175,7 @@ namespace connectivity
*_pDest = *_pSource;
}
}
//-------------------------------------------------------------------------
/// concat two sequences
template <class T>
::com::sun::star::uno::Sequence<T> concatSequences(const ::com::sun::star::uno::Sequence<T>& _rLeft, const ::com::sun::star::uno::Sequence<T>& _rRight)
......@@ -199,34 +194,26 @@ namespace connectivity
return aReturn;
}
#define DECLARE_SERVICE_INFO() \
virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); \
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException); \
#define DECLARE_SERVICE_INFO() \
virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); \
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException); \
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) \
#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \
#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \
OUString SAL_CALL classname::getImplementationName() throw (::com::sun::star::uno::RuntimeException) \
{ \
return OUString::createFromAscii(implasciiname); \
} \
{ \
return OUString::createFromAscii(implasciiname); \
} \
::com::sun::star::uno::Sequence< OUString > SAL_CALL classname::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) \
{ \
::com::sun::star::uno::Sequence< OUString > aSupported(1); \
aSupported[0] = OUString::createFromAscii(serviceasciiname); \
return aSupported; \
} \
{ \
::com::sun::star::uno::Sequence< OUString > aSupported(1); \
aSupported[0] = OUString::createFromAscii(serviceasciiname); \
return aSupported; \
} \
sal_Bool SAL_CALL classname::supportsService(const OUString& _rServiceName) throw(::com::sun::star::uno::RuntimeException) \
{ \
Sequence< OUString > aSupported(getSupportedServiceNames()); \
const OUString* pSupported = aSupported.getConstArray(); \
const OUString* pEnd = pSupported + aSupported.getLength(); \
for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \
; \
return pSupported != pEnd; \
} \
{ \
return cppu::supportsService(this, ServiceName); \
} \
}
}
#endif // _CONNECTIVITY_OSUBCOMPONENT_HXX_
......
......@@ -29,28 +29,19 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
#define SERVICE_NAME "com.sun.star.comp.PresentationMinimizer"
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ustrbuf.hxx>
// ----------------------
// - PPPOptimizerDialog -
// ----------------------
PPPOptimizerDialog::PPPOptimizerDialog( const Reference< XComponentContext > &xContext ) :
mxContext( xContext ),
mpOptimizerDialog( NULL )
{
}
// -----------------------------------------------------------------------------
PPPOptimizerDialog::~PPPOptimizerDialog()
{
}
// -----------------------------------------------------------------------------
// XInitialization
// -----------------------------------------------------------------------------
void SAL_CALL PPPOptimizerDialog::initialize( const Sequence< Any >& aArguments )
throw ( Exception, RuntimeException )
{
......@@ -62,10 +53,6 @@ void SAL_CALL PPPOptimizerDialog::initialize( const Sequence< Any >& aArguments
mxController = mxFrame->getController();
}
// -----------------------------------------------------------------------------
// XServiceInfo
// -----------------------------------------------------------------------------
OUString SAL_CALL PPPOptimizerDialog::getImplementationName()
throw (RuntimeException)
{
......@@ -75,7 +62,7 @@ OUString SAL_CALL PPPOptimizerDialog::getImplementationName()
sal_Bool SAL_CALL PPPOptimizerDialog::supportsService( const OUString& ServiceName )
throw ( RuntimeException )
{
return ServiceName == SERVICE_NAME;
return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL PPPOptimizerDialog::getSupportedServiceNames()
......@@ -84,10 +71,6 @@ Sequence< OUString > SAL_CALL PPPOptimizerDialog::getSupportedServiceNames()
return PPPOptimizerDialog_getSupportedServiceNames();
}
// -----------------------------------------------------------------------------
// XDispatchProvider
// -----------------------------------------------------------------------------
Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::queryDispatch(
const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
{
......@@ -98,8 +81,6 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::query
return xRet;
}
//------------------------------------------------------------------------------
Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizerDialog::queryDispatches(
const Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( RuntimeException )
{
......@@ -113,10 +94,6 @@ Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizerD
return aReturn;
}
// -----------------------------------------------------------------------------
// XDispatch
// -----------------------------------------------------------------------------
void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
const Sequence< PropertyValue >& rArguments )
throw( RuntimeException )
......@@ -165,7 +142,6 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
}
}
//===============================================
void SAL_CALL PPPOptimizerDialog::addStatusListener( const Reference< XStatusListener >&, const URL& )
throw( RuntimeException )
{
......@@ -173,7 +149,6 @@ void SAL_CALL PPPOptimizerDialog::addStatusListener( const Reference< XStatusLis
// OSL_FAIL( "PPPOptimizerDialog::addStatusListener()\nNot implemented yet!" );
}
//===============================================
void SAL_CALL PPPOptimizerDialog::removeStatusListener( const Reference< XStatusListener >&, const URL& )
throw( RuntimeException )
{
......@@ -181,8 +156,6 @@ void SAL_CALL PPPOptimizerDialog::removeStatusListener( const Reference< XStatus
// OSL_FAIL( "PPPOptimizerDialog::removeStatusListener()\nNot implemented yet!" );
}
// -----------------------------------------------------------------------------
OUString PPPOptimizerDialog_getImplementationName()
{
return OUString( "com.sun.star.comp.PresentationMinimizerImp" );
......@@ -202,6 +175,4 @@ Reference< XInterface > PPPOptimizerDialog_createInstance( const Reference< XCom
return (cppu::OWeakObject*) new PPPOptimizerDialog( rSMgr );
}
// -----------------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -23,20 +23,17 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <cppuhelper/implbase2.hxx>
#include <svgio/svgreader/svgdocumenthandler.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <svgio/svgreader/svgdocumenthandler.hxx>
#include "xsvgparser.hxx"
//////////////////////////////////////////////////////////////////////////////
using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////////////
namespace svgio
{
namespace svgreader
......@@ -68,9 +65,7 @@ namespace svgio
} // end of namespace svgreader
} // end of namespace svgio
//////////////////////////////////////////////////////////////////////////////
// uno functions
namespace svgio
{
namespace svgreader
......@@ -95,8 +90,6 @@ namespace svgio
} // end of namespace svgreader
} // end of namespace svgio
//////////////////////////////////////////////////////////////////////////////
namespace svgio
{
namespace svgreader
......@@ -185,17 +178,7 @@ namespace svgio
sal_Bool SAL_CALL XSvgParser::supportsService(const OUString& rServiceName) throw(uno::RuntimeException)
{
const uno::Sequence< OUString > aServices(XSvgParser_getSupportedServiceNames());
for(sal_Int32 nService(0); nService < aServices.getLength(); nService++)
{
if(rServiceName == aServices[nService])
{
return sal_True;
}
}
return sal_False;
return cppu::supportsService(this, rServiceName);
}
uno::Sequence< OUString > SAL_CALL XSvgParser::getSupportedServiceNames() throw(uno::RuntimeException)
......@@ -206,7 +189,4 @@ namespace svgio
} // end of namespace svgreader
} // end of namespace svgio
//////////////////////////////////////////////////////////////////////////////
// eof
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -8,13 +8,6 @@
*/
#include <boost/shared_ptr.hpp>
#include <osl/diagnose.h>
#include <rtl/tencinfo.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/io/XInputStream.hpp>
......@@ -26,21 +19,22 @@
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/uno/Reference.h>
#include <ucbhelper/content.hxx>
#include <xmloff/attrlist.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <iostream>
#include <libetonyek/libetonyek.h>
#include <libodfgen/libodfgen.hxx>
#include <osl/diagnose.h>
#include <rtl/tencinfo.h>
#include <ucbhelper/content.hxx>
#include <xmloff/attrlist.hxx>
#include "common/DirectoryStream.hxx"
#include "common/DocumentHandler.hxx"
#include "common/WPXSvStream.hxx"
#include "KeynoteImportFilter.hxx"
#include <iostream>
using boost::shared_ptr;
using namespace ::com::sun::star::uno;
......@@ -100,7 +94,6 @@ sal_Bool lcl_isPackage( const Any &rComponentData )
return false;
}
}
sal_Bool SAL_CALL KeynoteImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
......@@ -329,7 +322,6 @@ throw( com::sun::star::uno::RuntimeException )
return sTypeName;
}
// XInitialization
void SAL_CALL KeynoteImportFilter::initialize( const Sequence< Any >& aArguments )
throw (Exception, RuntimeException)
......@@ -351,6 +343,7 @@ throw (Exception, RuntimeException)
}
}
}
OUString KeynoteImportFilter_getImplementationName ()
throw (RuntimeException)
{
......@@ -360,12 +353,7 @@ throw (RuntimeException)
#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
sal_Bool SAL_CALL KeynoteImportFilter_supportsService( const OUString &ServiceName )
throw (RuntimeException)
{
SAL_INFO("writerperfect", "KeynoteImportFilter_supportsService");
return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
}
Sequence< OUString > SAL_CALL KeynoteImportFilter_getSupportedServiceNames( )
throw (RuntimeException)
{
......@@ -376,6 +364,7 @@ throw (RuntimeException)
pArray[1] = OUString ( SERVICE_NAME2 );
return aRet;
}
#undef SERVICE_NAME2
#undef SERVICE_NAME1
......@@ -393,12 +382,14 @@ throw (RuntimeException)
SAL_INFO("writerperfect", "KeynoteImportFilter::getImplementationName");
return KeynoteImportFilter_getImplementationName();
}
sal_Bool SAL_CALL KeynoteImportFilter::supportsService( const OUString &rServiceName )
throw (RuntimeException)
{
SAL_INFO("writerperfect", "KeynoteImportFilter::supportsService");
return KeynoteImportFilter_supportsService( rServiceName );
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL KeynoteImportFilter::getSupportedServiceNames( )
throw (RuntimeException)
{
......
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