diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-03 10:06:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-03 11:15:55 +0100 |
commit | 396248a6bf276693619b319ee0efe5f21cde1d3e (patch) | |
tree | f19566e2797502a3c5eec97df46281b3e21a8558 /mysqlc/source | |
parent | ed69dd79ffbd51417caefda48cf5ef6c3e396eea (diff) |
Get rid of macros
Change-Id: Ic43441201309c3b466ed3dc7a5e85d0d006c0e44
Diffstat (limited to 'mysqlc/source')
-rw-r--r-- | mysqlc/source/mysqlc_connection.cxx | 18 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_connection.hxx | 12 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_preparedstatement.cxx | 18 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_preparedstatement.hxx | 12 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_resultset.cxx | 1 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_resultset.hxx | 11 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_statement.cxx | 19 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_statement.hxx | 12 | ||||
-rw-r--r-- | mysqlc/source/mysqlc_subcomponent.hxx | 23 |
9 files changed, 95 insertions, 31 deletions
diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx index 8816cb28f225..e7f9ef817870 100644 --- a/mysqlc/source/mysqlc_connection.cxx +++ b/mysqlc/source/mysqlc_connection.cxx @@ -221,10 +221,24 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue > } /* }}} */ +OUString OConnection::getImplementationName() throw (css::uno::RuntimeException) +{ + return OUString("com.sun.star.sdbc.drivers.mysqlc.OConnection"); +} -// XServiceInfo -IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.mysqlc.OConnection", "com.sun.star.sdbc.Connection") +css::uno::Sequence<OUString> OConnection::getSupportedServiceNames() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence<OUString> s(1); + s[0] = "com.sun.star.sdbc.Connection"; + return s; +} +sal_Bool OConnection::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) +{ + return cppu::supportsService(this, ServiceName); +} /* {{{ OConnection::createStatement() -I- */ Reference< XStatement > SAL_CALL OConnection::createStatement() diff --git a/mysqlc/source/mysqlc_connection.hxx b/mysqlc/source/mysqlc_connection.hxx index e9619e9f94dc..0bd1b827538c 100644 --- a/mysqlc/source/mysqlc_connection.hxx +++ b/mysqlc/source/mysqlc_connection.hxx @@ -147,7 +147,17 @@ namespace connectivity virtual void SAL_CALL release() throw(); // XServiceInfo - DECLARE_SERVICE_INFO(); + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) SAL_OVERRIDE; + + virtual sal_Bool SAL_CALL supportsService( + OUString const & ServiceName) throw (css::uno::RuntimeException) + SAL_OVERRIDE; + + virtual css::uno::Sequence<OUString> SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + SAL_OVERRIDE; + // XConnection my_XStatementRef SAL_CALL createStatement() throw(SQLException, RuntimeException); diff --git a/mysqlc/source/mysqlc_preparedstatement.cxx b/mysqlc/source/mysqlc_preparedstatement.cxx index 31c0f8240ab3..d495ed403fa0 100644 --- a/mysqlc/source/mysqlc_preparedstatement.cxx +++ b/mysqlc/source/mysqlc_preparedstatement.cxx @@ -59,9 +59,25 @@ static inline char * my_i_to_a(char * buf, size_t buf_size, int a) } /* }}} */ +OUString OPreparedStatement::getImplementationName() + throw (css::uno::RuntimeException) +{ + return OUString("com.sun.star.sdbcx.mysqlc.PreparedStatement"); +} -IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.mysqlc.PreparedStatement","com.sun.star.sdbc.PreparedStatement"); +css::uno::Sequence<OUString> OPreparedStatement::getSupportedServiceNames() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence<OUString> s(1); + s[0] = "com.sun.star.sdbc.PreparedStatement"; + return s; +} +sal_Bool OPreparedStatement::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) +{ + return cppu::supportsService(this, ServiceName); +} /* {{{ OPreparedStatement::OPreparedStatement() -I- */ OPreparedStatement::OPreparedStatement(OConnection* _pConnection, sql::PreparedStatement * _cppPrepStmt) diff --git a/mysqlc/source/mysqlc_preparedstatement.hxx b/mysqlc/source/mysqlc_preparedstatement.hxx index 8e167e40db5b..9acd6322f56b 100644 --- a/mysqlc/source/mysqlc_preparedstatement.hxx +++ b/mysqlc/source/mysqlc_preparedstatement.hxx @@ -62,7 +62,17 @@ namespace connectivity throw (::com::sun::star::uno::Exception); virtual ~OPreparedStatement(); public: - DECLARE_SERVICE_INFO(); + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) SAL_OVERRIDE; + + virtual sal_Bool SAL_CALL supportsService( + OUString const & ServiceName) throw (css::uno::RuntimeException) + SAL_OVERRIDE; + + virtual css::uno::Sequence<OUString> SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + SAL_OVERRIDE; + OPreparedStatement(OConnection* _pConnection, sql::PreparedStatement * cppPrepStmt); //XInterface diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx index 56033482696e..1ad625dc3c08 100644 --- a/mysqlc/source/mysqlc_resultset.cxx +++ b/mysqlc/source/mysqlc_resultset.cxx @@ -49,7 +49,6 @@ using ::osl::MutexGuard; #include <stdio.h> -// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet"); /* {{{ OResultSet::getImplementationName() -I- */ OUString SAL_CALL OResultSet::getImplementationName() throw (RuntimeException) diff --git a/mysqlc/source/mysqlc_resultset.hxx b/mysqlc/source/mysqlc_resultset.hxx index fd22c99441c2..465e81c3dce6 100644 --- a/mysqlc/source/mysqlc_resultset.hxx +++ b/mysqlc/source/mysqlc_resultset.hxx @@ -93,7 +93,16 @@ namespace connectivity virtual ~OResultSet(); public: - DECLARE_SERVICE_INFO(); + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) SAL_OVERRIDE; + + virtual sal_Bool SAL_CALL supportsService( + OUString const & ServiceName) throw (css::uno::RuntimeException) + SAL_OVERRIDE; + + virtual css::uno::Sequence<OUString> SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + SAL_OVERRIDE; OResultSet( OCommonStatement* pStmt, sql::ResultSet *result, rtl_TextEncoding _encoding ); diff --git a/mysqlc/source/mysqlc_statement.cxx b/mysqlc/source/mysqlc_statement.cxx index ddfe5f6e4910..ed8826e9571f 100644 --- a/mysqlc/source/mysqlc_statement.cxx +++ b/mysqlc/source/mysqlc_statement.cxx @@ -457,7 +457,24 @@ void OCommonStatement::getFastPropertyValue(Any& _rValue, sal_Int32 nHandle) con } /* }}} */ -IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.OStatement","com.sun.star.sdbc.Statement"); +OUString OStatement::getImplementationName() throw (css::uno::RuntimeException) +{ + return OUString("com.sun.star.sdbcx.OStatement"); +} + +css::uno::Sequence<OUString> OStatement::getSupportedServiceNames() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence<OUString> s(1); + s[0] = "com.sun.star.sdbc.Statement"; + return s; +} + +sal_Bool OStatement::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) +{ + return cppu::supportsService(this, ServiceName); +} /* {{{ OCommonStatement::acquire() -I- */ void SAL_CALL OCommonStatement::acquire() diff --git a/mysqlc/source/mysqlc_statement.hxx b/mysqlc/source/mysqlc_statement.hxx index a58a9c598aa3..a8fa0cc997be 100644 --- a/mysqlc/source/mysqlc_statement.hxx +++ b/mysqlc/source/mysqlc_statement.hxx @@ -173,7 +173,17 @@ namespace connectivity public: // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird: OStatement(OConnection* _pConnection, sql::Statement *_cppStatement) : OCommonStatement(_pConnection, _cppStatement) {} - DECLARE_SERVICE_INFO(); + + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) SAL_OVERRIDE; + + virtual sal_Bool SAL_CALL supportsService( + OUString const & ServiceName) throw (css::uno::RuntimeException) + SAL_OVERRIDE; + + virtual css::uno::Sequence<OUString> SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + SAL_OVERRIDE; Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(RuntimeException); diff --git a/mysqlc/source/mysqlc_subcomponent.hxx b/mysqlc/source/mysqlc_subcomponent.hxx index 5aaf5e9b5f85..2c7bfa578c10 100644 --- a/mysqlc/source/mysqlc_subcomponent.hxx +++ b/mysqlc/source/mysqlc_subcomponent.hxx @@ -194,29 +194,8 @@ 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); \ - virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) - -#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \ - OUString SAL_CALL classname::getImplementationName() throw (::com::sun::star::uno::RuntimeException) \ - { \ - 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; \ - } \ - sal_Bool SAL_CALL classname::supportsService(const OUString& _rServiceName) throw(::com::sun::star::uno::RuntimeException) \ - { \ - return cppu::supportsService(this, _rServiceName); \ - } - } + #endif // _CONNECTIVITY_OSUBCOMPONENT_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |