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

fdo#54938 Convert sfx2, xmloff and connec.. to cppu::supportsService

Change-Id: Ib5d3aabf8aa88ec24e44584047d0405a09fa44ed
Reviewed-on: https://gerrit.libreoffice.org/7864Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
üst 6a6a51ed
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <osl/interlck.h> #include <osl/interlck.h>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <connectivity/dbtoolsdllapi.hxx> #include <connectivity/dbtoolsdllapi.hxx>
#include <cppuhelper/supportsservice.hxx>
namespace com { namespace sun { namespace star { namespace util { namespace com { namespace sun { namespace star { namespace util {
struct Date; struct Date;
...@@ -50,7 +51,6 @@ namespace jvmaccess { class VirtualMachine; } ...@@ -50,7 +51,6 @@ namespace jvmaccess { class VirtualMachine; }
namespace connectivity namespace connectivity
{ {
//------------------------------------------------------------------------------
OOO_DLLPUBLIC_DBTOOLS sal_Bool match(const sal_Unicode* pWild, const sal_Unicode* pStr, const sal_Unicode cEscape); OOO_DLLPUBLIC_DBTOOLS sal_Bool match(const sal_Unicode* pWild, const sal_Unicode* pStr, const sal_Unicode cEscape);
inline sal_Bool match(const OUString &rWild, const OUString &rStr, const sal_Unicode cEscape) inline sal_Bool match(const OUString &rWild, const OUString &rStr, const sal_Unicode cEscape)
{ {
...@@ -62,9 +62,7 @@ namespace connectivity ...@@ -62,9 +62,7 @@ namespace connectivity
typedef std::map<OUString,OSQLTable,comphelper::UStringMixLess> OSQLTables; typedef std::map<OUString,OSQLTable,comphelper::UStringMixLess> OSQLTables;
// -------------------------------------------------------------------------
// class ORefVector allows reference counting on a std::vector // class ORefVector allows reference counting on a std::vector
// -------------------------------------------------------------------------
template< class VectorVal > class ORefVector template< class VectorVal > class ORefVector
{ {
std::vector< VectorVal > m_vector; std::vector< VectorVal > m_vector;
...@@ -112,11 +110,10 @@ namespace connectivity ...@@ -112,11 +110,10 @@ namespace connectivity
} }
}; };
// -------------------------------------------------------------------------
// class ORowVector incudes refcounting and initialze himself // class ORowVector incudes refcounting and initialze himself
// with at least one element. This first element is reserved for // with at least one element. This first element is reserved for
// the bookmark // the bookmark
// -------------------------------------------------------------------------
template< class VectorVal > class ORowVector : public ORefVector< VectorVal > template< class VectorVal > class ORowVector : public ORefVector< VectorVal >
{ {
public: public:
...@@ -127,7 +124,6 @@ namespace connectivity ...@@ -127,7 +124,6 @@ namespace connectivity
typedef ORefVector< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> > OSQLColumns; typedef ORefVector< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> > OSQLColumns;
// =======================================================================================
// search from __first to __last the column with the name _rVal // search from __first to __last the column with the name _rVal
// when no such column exist __last is returned // when no such column exist __last is returned
OOO_DLLPUBLIC_DBTOOLS OOO_DLLPUBLIC_DBTOOLS
...@@ -135,7 +131,7 @@ namespace connectivity ...@@ -135,7 +131,7 @@ namespace connectivity
OSQLColumns::Vector::const_iterator __last, OSQLColumns::Vector::const_iterator __last,
const OUString& _rVal, const OUString& _rVal,
const ::comphelper::UStringMixEqual& _rCase); const ::comphelper::UStringMixEqual& _rCase);
// =======================================================================================
// search from __first to __last the column with the realname _rVal // search from __first to __last the column with the realname _rVal
// when no such column exist __last is returned // when no such column exist __last is returned
OOO_DLLPUBLIC_DBTOOLS OOO_DLLPUBLIC_DBTOOLS
...@@ -144,9 +140,7 @@ namespace connectivity ...@@ -144,9 +140,7 @@ namespace connectivity
const OUString& _rVal, const OUString& _rVal,
const ::comphelper::UStringMixEqual& _rCase); const ::comphelper::UStringMixEqual& _rCase);
// =======================================================================================
// the first two find methods are much faster than the one below // the first two find methods are much faster than the one below
// =======================================================================================
// search from __first to __last the column with the property _rProp equals the value _rVal // search from __first to __last the column with the property _rProp equals the value _rVal
// when no such column exist __last is returned // when no such column exist __last is returned
OOO_DLLPUBLIC_DBTOOLS OOO_DLLPUBLIC_DBTOOLS
...@@ -177,8 +171,6 @@ namespace connectivity ...@@ -177,8 +171,6 @@ namespace connectivity
#endif #endif
} }
//==================================================================================
#define DECLARE_SERVICE_INFO() \ #define DECLARE_SERVICE_INFO() \
virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \ 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 sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); \
...@@ -197,17 +189,9 @@ namespace connectivity ...@@ -197,17 +189,9 @@ namespace connectivity
} \ } \
sal_Bool SAL_CALL classname::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \ sal_Bool SAL_CALL classname::supportsService( const OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \
{ \ { \
Sequence< OUString > aSupported(getSupportedServiceNames()); \ return cppu::supportsService(this, _rServiceName); \
const OUString* pSupported = aSupported.getConstArray(); \
const OUString* pEnd = pSupported + aSupported.getLength(); \
for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \
; \
\
return pSupported != pEnd; \
} \ } \
//==================================================================================
#endif // INCLUDED_CONNECTIVITY_COMMONTOOLS_HXX #endif // INCLUDED_CONNECTIVITY_COMMONTOOLS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include <xmloff/XMLEmbeddedObjectExportFilter.hxx> #include <xmloff/XMLEmbeddedObjectExportFilter.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::xml::sax;
...@@ -35,7 +35,6 @@ XMLEmbeddedObjectExportFilter::~XMLEmbeddedObjectExportFilter () throw() ...@@ -35,7 +35,6 @@ XMLEmbeddedObjectExportFilter::~XMLEmbeddedObjectExportFilter () throw()
{ {
} }
void SAL_CALL XMLEmbeddedObjectExportFilter::startDocument( void ) void SAL_CALL XMLEmbeddedObjectExportFilter::startDocument( void )
throw( SAXException, RuntimeException ) throw( SAXException, RuntimeException )
{ {
...@@ -153,10 +152,10 @@ OUString SAL_CALL XMLEmbeddedObjectExportFilter::getImplementationName() ...@@ -153,10 +152,10 @@ OUString SAL_CALL XMLEmbeddedObjectExportFilter::getImplementationName()
return aStr; return aStr;
} }
sal_Bool SAL_CALL XMLEmbeddedObjectExportFilter::supportsService( const OUString& ) sal_Bool SAL_CALL XMLEmbeddedObjectExportFilter::supportsService( const OUString& ServiceName )
throw(RuntimeException) throw(RuntimeException)
{ {
return sal_False; return cppu::supportsService(this, ServiceName);
} }
Sequence< OUString > SAL_CALL XMLEmbeddedObjectExportFilter::getSupportedServiceNames( ) Sequence< OUString > SAL_CALL XMLEmbeddedObjectExportFilter::getSupportedServiceNames( )
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "PropertyActionsOOo.hxx" #include "PropertyActionsOOo.hxx"
#include "TransformerActions.hxx" #include "TransformerActions.hxx"
#include "OOo2Oasis.hxx" #include "OOo2Oasis.hxx"
#include <cppuhelper/supportsservice.hxx>
using namespace ::xmloff::token; using namespace ::xmloff::token;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -2019,10 +2020,10 @@ OUString SAL_CALL OOo2OasisTransformer::getImplementationName() ...@@ -2019,10 +2020,10 @@ OUString SAL_CALL OOo2OasisTransformer::getImplementationName()
return m_aImplName; return m_aImplName;
} }
sal_Bool SAL_CALL OOo2OasisTransformer::supportsService( const OUString& ) sal_Bool SAL_CALL OOo2OasisTransformer::supportsService( const OUString& ServiceName )
throw(RuntimeException) throw(RuntimeException)
{ {
return sal_False; return cppu::supportsService(this, ServiceName);
} }
Sequence< OUString > SAL_CALL OOo2OasisTransformer::getSupportedServiceNames( ) Sequence< OUString > SAL_CALL OOo2OasisTransformer::getSupportedServiceNames( )
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "FamilyType.hxx" #include "FamilyType.hxx"
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include "Oasis2OOo.hxx" #include "Oasis2OOo.hxx"
#include <cppuhelper/supportsservice.hxx>
using namespace ::osl; using namespace ::osl;
using namespace ::xmloff::token; using namespace ::xmloff::token;
...@@ -2007,10 +2008,10 @@ OUString SAL_CALL Oasis2OOoTransformer::getImplementationName() ...@@ -2007,10 +2008,10 @@ OUString SAL_CALL Oasis2OOoTransformer::getImplementationName()
return Oasis2OOoTransformer_getImplementationName(); return Oasis2OOoTransformer_getImplementationName();
} }
sal_Bool SAL_CALL Oasis2OOoTransformer::supportsService( const OUString& ) sal_Bool SAL_CALL Oasis2OOoTransformer::supportsService( const OUString& ServiceName )
throw(RuntimeException) throw(RuntimeException)
{ {
return sal_False; return cppu::supportsService(this, ServiceName);
} }
Sequence< OUString > SAL_CALL Oasis2OOoTransformer::getSupportedServiceNames( ) Sequence< OUString > SAL_CALL Oasis2OOoTransformer::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