Kaydet (Commit) 396248a6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Get rid of macros

Change-Id: Ic43441201309c3b466ed3dc7a5e85d0d006c0e44
üst ed69dd79
...@@ -221,10 +221,24 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue > ...@@ -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 css::uno::Sequence<OUString> OConnection::getSupportedServiceNames()
IMPLEMENT_SERVICE_INFO(OConnection, "com.sun.star.sdbc.drivers.mysqlc.OConnection", "com.sun.star.sdbc.Connection") 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- */ /* {{{ OConnection::createStatement() -I- */
Reference< XStatement > SAL_CALL OConnection::createStatement() Reference< XStatement > SAL_CALL OConnection::createStatement()
......
...@@ -147,7 +147,17 @@ namespace connectivity ...@@ -147,7 +147,17 @@ namespace connectivity
virtual void SAL_CALL release() throw(); virtual void SAL_CALL release() throw();
// XServiceInfo // 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 // XConnection
my_XStatementRef SAL_CALL createStatement() my_XStatementRef SAL_CALL createStatement()
throw(SQLException, RuntimeException); throw(SQLException, RuntimeException);
......
...@@ -59,9 +59,25 @@ static inline char * my_i_to_a(char * buf, size_t buf_size, int a) ...@@ -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() -I- */
OPreparedStatement::OPreparedStatement(OConnection* _pConnection, sql::PreparedStatement * _cppPrepStmt) OPreparedStatement::OPreparedStatement(OConnection* _pConnection, sql::PreparedStatement * _cppPrepStmt)
......
...@@ -62,7 +62,17 @@ namespace connectivity ...@@ -62,7 +62,17 @@ namespace connectivity
throw (::com::sun::star::uno::Exception); throw (::com::sun::star::uno::Exception);
virtual ~OPreparedStatement(); virtual ~OPreparedStatement();
public: 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); OPreparedStatement(OConnection* _pConnection, sql::PreparedStatement * cppPrepStmt);
//XInterface //XInterface
......
...@@ -49,7 +49,6 @@ using ::osl::MutexGuard; ...@@ -49,7 +49,6 @@ using ::osl::MutexGuard;
#include <stdio.h> #include <stdio.h>
// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
/* {{{ OResultSet::getImplementationName() -I- */ /* {{{ OResultSet::getImplementationName() -I- */
OUString SAL_CALL OResultSet::getImplementationName() OUString SAL_CALL OResultSet::getImplementationName()
throw (RuntimeException) throw (RuntimeException)
......
...@@ -93,7 +93,16 @@ namespace connectivity ...@@ -93,7 +93,16 @@ namespace connectivity
virtual ~OResultSet(); virtual ~OResultSet();
public: 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 ); OResultSet( OCommonStatement* pStmt, sql::ResultSet *result, rtl_TextEncoding _encoding );
......
...@@ -457,7 +457,24 @@ void OCommonStatement::getFastPropertyValue(Any& _rValue, sal_Int32 nHandle) con ...@@ -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- */ /* {{{ OCommonStatement::acquire() -I- */
void SAL_CALL OCommonStatement::acquire() void SAL_CALL OCommonStatement::acquire()
......
...@@ -173,7 +173,17 @@ namespace connectivity ...@@ -173,7 +173,17 @@ namespace connectivity
public: public:
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird: // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
OStatement(OConnection* _pConnection, sql::Statement *_cppStatement) : OCommonStatement(_pConnection, _cppStatement) {} 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 ) Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
throw(RuntimeException); throw(RuntimeException);
......
...@@ -194,29 +194,8 @@ namespace connectivity ...@@ -194,29 +194,8 @@ namespace connectivity
return aReturn; 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_ #endif // _CONNECTIVITY_OSUBCOMPONENT_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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