summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-09 15:14:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-10 06:51:53 +0000
commit5c2c2d8dc4449c9d4ac9d645f634772ba93373af (patch)
tree9aaa3ab74dcc23b8a5d188c1b7b5d1c7cac3a024 /connectivity
parent76c8336eec82862732d3a26be84b5e8a52efe022 (diff)
loplugin:expandablemethods in comphelper..cppuhelper
Change-Id: I9d5487af4729bd3ee4f6450092e4b77f74a12e6d Reviewed-on: https://gerrit.libreoffice.org/30717 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/DriversConfig.cxx3
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx8
-rw-r--r--connectivity/source/commontools/sqlerror.cxx9
-rw-r--r--connectivity/source/cpool/ZPoolCollection.cxx11
-rw-r--r--connectivity/source/cpool/ZPoolCollection.hxx1
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx7
-rw-r--r--connectivity/source/drivers/jdbc/ContextClassLoader.cxx2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx23
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx3
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx7
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx4
-rw-r--r--connectivity/source/inc/file/FStatement.hxx2
-rw-r--r--connectivity/source/inc/java/ContextClassLoader.hxx4
-rw-r--r--connectivity/source/inc/odbc/OConnection.hxx2
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx2
-rw-r--r--connectivity/source/parse/sqliterator.cxx4
16 files changed, 20 insertions, 72 deletions
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index c40ed479177b..2da9b4dc4953 100644
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -91,7 +91,7 @@ DriversConfigImpl::DriversConfigImpl()
{
}
-void DriversConfigImpl::Load(const uno::Reference< uno::XComponentContext >& _rxORB) const
+const TInstalledDrivers& DriversConfigImpl::getInstalledDrivers(const uno::Reference< uno::XComponentContext >& _rxORB) const
{
if ( m_aDrivers.empty() )
{
@@ -119,6 +119,7 @@ void DriversConfigImpl::Load(const uno::Reference< uno::XComponentContext >& _rx
}
} // if ( m_aInstalled.isValid() )
}
+ return m_aDrivers;
}
DriversConfig::DriversConfig(const uno::Reference< uno::XComponentContext >& _rxORB)
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index 8a75af3c3cde..bd582dbc82e4 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -220,15 +220,9 @@ namespace dbtools
}
- void FormattedColumnValue::clear()
- {
- lcl_clear_nothrow( *m_pData );
- }
-
-
FormattedColumnValue::~FormattedColumnValue()
{
- clear();
+ lcl_clear_nothrow( *m_pData );
}
sal_Int16 FormattedColumnValue::getKeyType() const
diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx
index 1febff0a796a..f074257e2e80 100644
--- a/connectivity/source/commontools/sqlerror.cxx
+++ b/connectivity/source/commontools/sqlerror.cxx
@@ -57,7 +57,6 @@ namespace connectivity
// versions of the public SQLError methods which are just delegated to this impl-class
static const OUString& getMessagePrefix();
OUString getErrorMessage( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
- OUString getSQLState( const ErrorCondition _eCondition );
static ErrorCode getErrorCode( const ErrorCondition _eCondition );
void raiseException( const ErrorCondition _eCondition, const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
void raiseException( const ErrorCondition _eCondition, const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
@@ -148,12 +147,6 @@ namespace connectivity
}
- OUString SQLError_Impl::getSQLState( const ErrorCondition _eCondition )
- {
- return impl_getSQLState( _eCondition );
- }
-
-
ErrorCode SQLError_Impl::getErrorCode( const ErrorCondition _eCondition )
{
return 0 - ::sal::static_int_cast< ErrorCode, ErrorCondition >( _eCondition );
@@ -217,7 +210,7 @@ namespace connectivity
return SQLException(
getErrorMessage( _eCondition, _rParamValue1, _rParamValue2, _rParamValue3 ),
_rxContext,
- getSQLState( _eCondition ),
+ impl_getSQLState( _eCondition ),
getErrorCode( _eCondition ),
Any()
);
diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx
index ad462ea596b6..f502b5fdb2eb 100644
--- a/connectivity/source/cpool/ZPoolCollection.cxx
+++ b/connectivity/source/cpool/ZPoolCollection.cxx
@@ -252,7 +252,9 @@ bool OPoolCollection::isPoolingEnabled()
Reference<XInterface> const & OPoolCollection::getConfigPoolRoot()
{
if(!m_xConfigNode.is())
- m_xConfigNode = createWithServiceFactory(getConnectionPoolNodeName());
+ m_xConfigNode = createWithProvider(
+ css::configuration::theDefaultProvider::get(m_xContext),
+ getConnectionPoolNodeName());
return m_xConfigNode;
}
@@ -312,13 +314,6 @@ OConnectionPool* OPoolCollection::getConnectionPool(const OUString& _sImplName,
return pRet;
}
-Reference< XInterface > OPoolCollection::createWithServiceFactory(const OUString& _rPath) const
-{
- return createWithProvider(
- css::configuration::theDefaultProvider::get(m_xContext),
- _rPath);
-}
-
Reference< XInterface > OPoolCollection::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider,
const OUString& _rPath)
{
diff --git a/connectivity/source/cpool/ZPoolCollection.hxx b/connectivity/source/cpool/ZPoolCollection.hxx
index ea5e2d307f38..316fb7a227c0 100644
--- a/connectivity/source/cpool/ZPoolCollection.hxx
+++ b/connectivity/source/cpool/ZPoolCollection.hxx
@@ -85,7 +85,6 @@ namespace connectivity
const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
// some configuration helper methods
- css::uno::Reference< css::uno::XInterface > createWithServiceFactory(const OUString& _rPath) const;
css::uno::Reference< css::uno::XInterface > const & getConfigPoolRoot();
static css::uno::Reference< css::uno::XInterface > createWithProvider( const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxConfProvider,
const OUString& _rPath);
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 2db04098760f..36cf31411a0b 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -308,11 +308,6 @@ Any SAL_CALL OStatement::queryInterface( const Type & rType ) throw(RuntimeExcep
return aRet.hasValue() ? aRet : OStatement_BASE2::queryInterface( rType);
}
-OSQLAnalyzer* OStatement_Base::createAnalyzer()
-{
- return new OSQLAnalyzer(m_pConnection.get());
-}
-
void OStatement_Base::anylizeSQL()
{
OSL_ENSURE(m_pSQLAnalyzer,"OResultSet::anylizeSQL: Analyzer isn't set!");
@@ -436,7 +431,7 @@ void OStatement_Base::construct(const OUString& sql) throw(SQLException, Runtim
// create the column mapping
createColumnMapping();
- m_pSQLAnalyzer = createAnalyzer();
+ m_pSQLAnalyzer = new OSQLAnalyzer(m_pConnection.get());
Reference<XIndexesSupplier> xIndexSup(xTunnel,UNO_QUERY);
if(xIndexSup.is())
diff --git a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
index c45b5aeb87e4..6c2d37122e5a 100644
--- a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
+++ b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx
@@ -92,7 +92,7 @@ namespace connectivity { namespace jdbc
}
- void ContextClassLoaderScope::pop()
+ ContextClassLoaderScope::~ContextClassLoaderScope()
{
if ( isActive() )
{
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
index 82cc40e56b9c..a1f073dd7dbb 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
@@ -70,25 +70,9 @@ void MozillaBootstrap::disposing()
OMozillaBootstrap_BASE::disposing();
}
-// static ServiceInfo
-
-OUString MozillaBootstrap::getImplementationName_Static( ) throw(RuntimeException)
-{
- return OUString(MOZAB_MozillaBootstrap_IMPL_NAME);
-}
-
-Sequence< OUString > MozillaBootstrap::getSupportedServiceNames_Static( ) throw (RuntimeException)
-{
- // which service is supported
- // for more information @see com.sun.star.mozilla.MozillaBootstrap
- Sequence<OUString> aSNS { "com.sun.star.mozilla.MozillaBootstrap" };
- return aSNS;
-}
-
-
OUString SAL_CALL MozillaBootstrap::getImplementationName( ) throw(RuntimeException, std::exception)
{
- return getImplementationName_Static();
+ return OUString(MOZAB_MozillaBootstrap_IMPL_NAME);
}
sal_Bool SAL_CALL MozillaBootstrap::supportsService( const OUString& _rServiceName ) throw(RuntimeException, std::exception)
@@ -96,10 +80,11 @@ sal_Bool SAL_CALL MozillaBootstrap::supportsService( const OUString& _rServiceNa
return cppu::supportsService(this, _rServiceName);
}
-
Sequence< OUString > SAL_CALL MozillaBootstrap::getSupportedServiceNames( ) throw(RuntimeException, std::exception)
{
- return getSupportedServiceNames_Static();
+ // which service is supported
+ // for more information @see com.sun.star.mozilla.MozillaBootstrap
+ return { "com.sun.star.mozilla.MozillaBootstrap" };
}
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx
index 9b1b9cb4dc89..2a61d88d760b 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.hxx
@@ -49,9 +49,6 @@ namespace connectivity
// OComponentHelper
virtual void SAL_CALL disposing() override;
- // XInterface
- static OUString getImplementationName_Static( ) throw(css::uno::RuntimeException);
- static css::uno::Sequence< OUString > getSupportedServiceNames_Static( ) throw (css::uno::RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override;
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 4eca0ab340ea..66f31461ba29 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -505,11 +505,6 @@ void OConnection::disposing()
dispose_ChildImpl();
}
-OConnection* OConnection::cloneConnection()
-{
- return new OConnection(m_pDriverHandleCopy,m_pDriver);
-}
-
SQLHANDLE OConnection::createStatementHandle()
{
OConnection* pConnectionTemp = this;
@@ -519,7 +514,7 @@ SQLHANDLE OConnection::createStatementHandle()
sal_Int32 nMaxStatements = getMetaData()->getMaxStatements();
if(nMaxStatements && nMaxStatements <= m_nStatementCount)
{
- OConnection* pConnection = cloneConnection();
+ OConnection* pConnection = new OConnection(m_pDriverHandleCopy,m_pDriver);
pConnection->acquire();
pConnection->Construct(m_sURL,getConnectionInfo());
pConnectionTemp = pConnection;
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 1d29d68a963e..1b8549888057 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -778,10 +778,10 @@ void ODatabaseMetaDataResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nH
rValue <<= getCursorName();
break;
case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= getResultSetConcurrency();
+ rValue <<= sal_Int32(css::sdbc::ResultSetConcurrency::READ_ONLY);
break;
case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= getResultSetType();
+ rValue <<= sal_Int32(css::sdbc::ResultSetType::FORWARD_ONLY);
break;
case PROPERTY_ID_FETCHDIRECTION:
rValue <<= getFetchDirection();
diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx
index ffdc75150dfd..50059b8eb80c 100644
--- a/connectivity/source/inc/file/FStatement.hxx
+++ b/connectivity/source/inc/file/FStatement.hxx
@@ -106,8 +106,6 @@ namespace connectivity
connectivity::OSQLParseNode* pAscendingDescending);
virtual void initializeResultSet(OResultSet* _pResult);
- // create the analyzer
- OSQLAnalyzer* createAnalyzer();
void closeResultSet() throw (css::sdbc::SQLException, css::uno::RuntimeException, std::exception);
diff --git a/connectivity/source/inc/java/ContextClassLoader.hxx b/connectivity/source/inc/java/ContextClassLoader.hxx
index 01c4ed55c330..174c3e9377ea 100644
--- a/connectivity/source/inc/java/ContextClassLoader.hxx
+++ b/connectivity/source/inc/java/ContextClassLoader.hxx
@@ -55,7 +55,7 @@ namespace connectivity { namespace jdbc
const css::uno::Reference< css::uno::XInterface >& _rxErrorContext
);
- ~ContextClassLoaderScope() { pop(); }
+ ~ContextClassLoaderScope();
bool isActive() const
{
@@ -67,8 +67,6 @@ namespace connectivity { namespace jdbc
ContextClassLoaderScope(ContextClassLoaderScope &) = delete;
void operator =(ContextClassLoaderScope &) = delete;
- void pop();
-
JNIEnv& m_environment;
LocalRef< jobject > m_currentThread;
LocalRef< jobject > m_oldContextClassLoader;
diff --git a/connectivity/source/inc/odbc/OConnection.hxx b/connectivity/source/inc/odbc/OConnection.hxx
index 2dc2df43468b..a3c0067e4a07 100644
--- a/connectivity/source/inc/odbc/OConnection.hxx
+++ b/connectivity/source/inc/odbc/OConnection.hxx
@@ -76,8 +76,6 @@ namespace connectivity
SQLRETURN OpenConnection(const OUString& aConnectStr,sal_Int32 nTimeOut, bool bSilent);
- OConnection* cloneConnection(); // creates a new connection
-
public:
oslGenericFunction getOdbcFunction(ODBC3SQLFunctionId _nIndex) const;
SQLRETURN Construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info) throw(css::sdbc::SQLException, std::exception);
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index 1ca0f69eba99..5ab546e4d888 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -83,8 +83,6 @@ namespace connectivity
// set the columncount of the driver
void checkColumnCount();
- static sal_Int32 getResultSetConcurrency() { return css::sdbc::ResultSetConcurrency::READ_ONLY; }
- static sal_Int32 getResultSetType() { return css::sdbc::ResultSetType::FORWARD_ONLY; }
static sal_Int32 getFetchDirection() { return css::sdbc::FetchDirection::FORWARD; }
static sal_Int32 getFetchSize() throw(css::sdbc::SQLException, css::uno::RuntimeException);
static OUString getCursorName() throw(css::sdbc::SQLException, css::uno::RuntimeException);
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 0f0e0d3cc1de..1534d793c362 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1546,7 +1546,9 @@ void OSQLParseTreeIterator::traverseAll()
void OSQLParseTreeIterator::impl_traverse( TraversalParts _nIncludeMask )
{
- impl_resetErrors();
+ // resets our errors
+ m_aErrors = css::sdbc::SQLException();
+
m_pImpl->m_nIncludeMask = _nIncludeMask;
if ( !traverseTableNames( *m_pImpl->m_pTables ) )