diff options
Diffstat (limited to 'connectivity/source/drivers/jdbc/JStatement.cxx')
-rw-r--r-- | connectivity/source/drivers/jdbc/JStatement.cxx | 111 |
1 files changed, 76 insertions, 35 deletions
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index 147e09c0f362..1d5326ca6302 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -31,7 +31,7 @@ #include <comphelper/sequence.hxx> #include <TConnection.hxx> #include <comphelper/types.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> @@ -124,9 +124,10 @@ Sequence< Type > SAL_CALL java_sql_Statement_Base::getTypes( ) Sequence< Type > aOldTypes = java_sql_Statement_BASE::getTypes(); if ( m_pConnection.is() && !m_pConnection->isAutoRetrievingEnabled() ) { - auto newEnd = std::remove(aOldTypes.begin(), aOldTypes.end(), + auto [begin, end] = asNonConstRange(aOldTypes); + auto newEnd = std::remove(begin, end, cppu::UnoType<XGeneratedResultSet>::get()); - aOldTypes.realloc(std::distance(aOldTypes.begin(), newEnd)); + aOldTypes.realloc(std::distance(begin, newEnd)); } return ::comphelper::concatSequences(aTypes.getTypes(),aOldTypes); @@ -279,7 +280,7 @@ Reference< XConnection > SAL_CALL java_sql_Statement_Base::getConnection( ) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); - return Reference< XConnection >(m_pConnection.get()); + return m_pConnection; } @@ -377,9 +378,9 @@ Any SAL_CALL java_sql_Statement_Base::getWarnings( ) if( out ) { java_sql_SQLWarning_BASE warn_base( t.pEnv, out ); - return makeAny( + return Any( static_cast< css::sdbc::SQLException >( - java_sql_SQLWarning(warn_base,*static_cast<cppu::OWeakObject*>(this)))); + java_sql_SQLWarning(warn_base,getXWeak()))); } return Any(); @@ -575,31 +576,71 @@ void java_sql_Statement_Base::setCursorName(const OUString &_par0) ::cppu::IPropertyArrayHelper* java_sql_Statement_Base::createArrayHelper( ) const { - Sequence< Property > aProps(10); - Property* pProperties = aProps.getArray(); - sal_Int32 nPos = 0; - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME), - PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ESCAPEPROCESSING), - PROPERTY_ID_ESCAPEPROCESSING, cppu::UnoType<bool>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION), - PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE), - PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXFIELDSIZE), - PROPERTY_ID_MAXFIELDSIZE, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXROWS), - PROPERTY_ID_MAXROWS, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_QUERYTIMEOUT), - PROPERTY_ID_QUERYTIMEOUT, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY), - PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE), - PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), 0); - pProperties[nPos++] = css::beans::Property(::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_USEBOOKMARKS), - PROPERTY_ID_USEBOOKMARKS, cppu::UnoType<bool>::get(), 0); - - return new ::cppu::OPropertyArrayHelper(aProps); + return new ::cppu::OPropertyArrayHelper + { + { + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_CURSORNAME), + PROPERTY_ID_CURSORNAME, + cppu::UnoType<OUString>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ESCAPEPROCESSING), + PROPERTY_ID_ESCAPEPROCESSING, + cppu::UnoType<bool>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHDIRECTION), + PROPERTY_ID_FETCHDIRECTION, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FETCHSIZE), + PROPERTY_ID_FETCHSIZE, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXFIELDSIZE), + PROPERTY_ID_MAXFIELDSIZE, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MAXROWS), + PROPERTY_ID_MAXROWS, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_QUERYTIMEOUT), + PROPERTY_ID_QUERYTIMEOUT, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETCONCURRENCY), + PROPERTY_ID_RESULTSETCONCURRENCY, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_RESULTSETTYPE), + PROPERTY_ID_RESULTSETTYPE, + cppu::UnoType<sal_Int32>::get(), + 0 + }, + { + ::connectivity::OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_USEBOOKMARKS), + PROPERTY_ID_USEBOOKMARKS, + cppu::UnoType<bool>::get(), + 0 + } + } + }; } @@ -794,22 +835,22 @@ void java_sql_Statement::createStatement(JNIEnv* _pEnv) IMPLEMENT_SERVICE_INFO(java_sql_Statement,"com.sun.star.sdbcx.JStatement","com.sun.star.sdbc.Statement"); -void SAL_CALL java_sql_Statement_Base::acquire() throw() +void SAL_CALL java_sql_Statement_Base::acquire() noexcept { java_sql_Statement_BASE::acquire(); } -void SAL_CALL java_sql_Statement_Base::release() throw() +void SAL_CALL java_sql_Statement_Base::release() noexcept { java_sql_Statement_BASE::release(); } -void SAL_CALL java_sql_Statement::acquire() throw() +void SAL_CALL java_sql_Statement::acquire() noexcept { OStatement_BASE2::acquire(); } -void SAL_CALL java_sql_Statement::release() throw() +void SAL_CALL java_sql_Statement::release() noexcept { OStatement_BASE2::release(); } |