Simplify OPreparedStatement

Change-Id: I1c36ec85d1acafc5c6ef33ea250ac6027d604da7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178053
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski 2024-12-07 01:55:39 +05:00
parent ec0a49ecc7
commit 75f5c610de
2 changed files with 6 additions and 41 deletions

View file

@ -55,7 +55,7 @@ using namespace com::sun::star::util;
IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.APreparedStatement","com.sun.star.sdbc.PreparedStatement");
OPreparedStatement::OPreparedStatement( OConnection* _pConnection, const OUString& sql)
: OStatement_Base( _pConnection )
: OPreparedStatement_BASE(_pConnection)
{
osl_atomic_increment( &m_refCount );
@ -92,24 +92,6 @@ OPreparedStatement::~OPreparedStatement()
}
}
Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType )
{
Any aRet = OStatement_Base::queryInterface(rType);
return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
static_cast< XPreparedStatement*>(this),
static_cast< XParameters*>(this),
static_cast< XResultSetMetaDataSupplier*>(this));
}
css::uno::Sequence< css::uno::Type > SAL_CALL OPreparedStatement::getTypes( )
{
::cppu::OTypeCollection aTypes( cppu::UnoType<XPreparedStatement>::get(),
cppu::UnoType<XParameters>::get(),
cppu::UnoType<XResultSetMetaDataSupplier>::get());
return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_Base::getTypes());
}
Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( )
{
if(!m_xMetaData.is() && m_RecordSet.IsValid())
@ -421,16 +403,6 @@ void SAL_CALL OPreparedStatement::clearParameters( )
}
}
void SAL_CALL OPreparedStatement::acquire() noexcept
{
OStatement_Base::acquire();
}
void SAL_CALL OPreparedStatement::release() noexcept
{
OStatement_Base::release();
}
void OPreparedStatement::replaceParameterNodeName(OSQLParseNode const * _pNode,
const OUString& _sDefaultName,
sal_Int32& _rParameterCount)

View file

@ -34,13 +34,12 @@ namespace connectivity
class OSQLParseNode;
namespace ado
{
using OPreparedStatement_BASE
= cppu::ImplInheritanceHelper<OStatement_Base, css::sdbc::XPreparedStatement,
css::sdbc::XParameters, css::sdbc::XResultSetMetaDataSupplier,
css::lang::XServiceInfo>;
class OPreparedStatement : public OStatement_Base,
public css::sdbc::XPreparedStatement,
public css::sdbc::XParameters,
public css::sdbc::XResultSetMetaDataSupplier,
public css::lang::XServiceInfo
class OPreparedStatement : public OPreparedStatement_BASE
{
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
@ -62,12 +61,6 @@ namespace connectivity
// a Constructor, that is needed for when Returning the Object is needed:
OPreparedStatement( OConnection* _pConnection, const OUString& sql);
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPreparedStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( ) override;
using OStatement_Base::executeQuery;