connectivity/source/commontools/DateConversion.cxx | 26 ++----- connectivity/source/commontools/TColumnsHelper.cxx | 4 - connectivity/source/commontools/TIndexes.cxx | 2 connectivity/source/commontools/TKeys.cxx | 4 - connectivity/source/commontools/dbexception.cxx | 4 - connectivity/source/commontools/dbtools.cxx | 18 ++--- connectivity/source/commontools/dbtools2.cxx | 4 - connectivity/source/drivers/hsqldb/HTables.cxx | 2 connectivity/source/drivers/hsqldb/HViews.cxx | 6 - connectivity/source/drivers/jdbc/DatabaseMetaData.cxx | 16 ++-- connectivity/source/drivers/jdbc/tools.cxx | 5 - connectivity/source/drivers/mysql/YTables.cxx | 2 connectivity/source/drivers/mysql/YViews.cxx | 6 - connectivity/source/inc/java/tools.hxx | 7 -- dbaccess/source/core/api/FilteredContainer.cxx | 2 dbaccess/source/core/api/KeySet.cxx | 2 dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 17 ++-- dbaccess/source/core/api/column.cxx | 4 - dbaccess/source/core/api/definitioncolumn.cxx | 2 dbaccess/source/core/api/tablecontainer.cxx | 2 dbaccess/source/core/api/viewcontainer.cxx | 2 dbaccess/source/core/dataaccess/ContentHelper.cxx | 2 dbaccess/source/core/inc/sdbcoretools.hxx | 2 dbaccess/source/core/misc/sdbcoretools.cxx | 4 - dbaccess/source/ui/app/AppController.cxx | 4 - dbaccess/source/ui/browser/sbagrid.cxx | 2 dbaccess/source/ui/control/SqlNameEdit.cxx | 6 - dbaccess/source/ui/dlg/adminpages.cxx | 4 - dbaccess/source/ui/dlg/adminpages.hxx | 7 -- dbaccess/source/ui/dlg/generalpage.cxx | 2 dbaccess/source/ui/misc/DExport.cxx | 2 dbaccess/source/ui/misc/WCopyTable.cxx | 4 - dbaccess/source/ui/querydesign/QueryDesignView.cxx | 2 dbaccess/source/ui/querydesign/querycontroller.cxx | 2 dbaccess/source/ui/relationdesign/RelationController.cxx | 2 dbaccess/source/ui/tabledesign/TableController.cxx | 4 - dbaccess/source/ui/uno/copytablewizard.cxx | 2 desktop/source/deployment/inc/dp_registry.hxx | 2 desktop/source/deployment/manager/dp_manager.cxx | 2 desktop/source/deployment/registry/dp_registry.cxx | 4 - drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx | 11 +-- drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx | 2 drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx | 2 extensions/source/dbpilots/controlwizard.cxx | 2 extensions/source/propctrlr/formcomponenthandler.cxx | 2 extensions/source/propctrlr/formlinkdialog.cxx | 2 forms/source/component/DatabaseForm.cxx | 3 include/connectivity/dbconversion.hxx | 2 include/connectivity/dbexception.hxx | 3 include/connectivity/dbtools.hxx | 42 ++++-------- include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx | 1 svx/source/form/tabwin.cxx | 2 52 files changed, 115 insertions(+), 155 deletions(-)
New commits: commit 8c9b5a901dcbb430bbf225ed0a2d7a286b1d5185 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Oct 31 12:57:08 2017 +0200 loplugin:constantparam in connectivity Change-Id: Ia13d0931bbdf642fe04119ea1112788fb143eba8 Reviewed-on: https://gerrit.libreoffice.org/44110 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index e51339378526..39acab5c1092 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -44,7 +44,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::util; using namespace ::com::sun::star::uno; -OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool bQuote, +OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, const Reference< XTypeConverter >& _rxTypeConverter) { OUStringBuffer aRet; @@ -76,8 +76,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: - if (bQuote) - aRet.append("'"); + aRet.append("'"); { OUString aTemp; _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aTemp; @@ -93,8 +92,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b aRet.append(aTemp); } - if (bQuote) - aRet.append("'"); + aRet.append("'"); break; case DataType::REAL: case DataType::DOUBLE: @@ -133,11 +131,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b // check if this is really a timestamp or only a date if ( bOk ) { - if (bQuote) - aRet.append("{ts '"); + aRet.append("{ts '"); aRet.append(DBTypeConversion::toDateTimeString(aDateTime)); - if (bQuote) - aRet.append("'}"); + aRet.append("'}"); break; } break; @@ -163,11 +159,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b else bOk = _rVal >>= aDate; OSL_ENSURE( bOk, "DBTypeConversion::toSQLString: _rVal is not date!"); - if (bQuote) - aRet.append("{d '"); + aRet.append("{d '"); aRet.append(DBTypeConversion::toDateString(aDate)); - if (bQuote) - aRet.append("'}"); + aRet.append("'}"); } break; case DataType::TIME: { @@ -190,11 +184,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b else bOk = _rVal >>= aTime; OSL_ENSURE( bOk,"DBTypeConversion::toSQLString: _rVal is not time!"); - if (bQuote) - aRet.append("{t '"); + aRet.append("{t '"); aRet.append(DBTypeConversion::toTimeString(aTime)); - if (bQuote) - aRet.append("'}"); + aRet.append("'}"); } break; } } diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx index 2f347da63946..ff585a6e4993 100644 --- a/connectivity/source/commontools/TColumnsHelper.cxx +++ b/connectivity/source/commontools/TColumnsHelper.cxx @@ -175,7 +175,7 @@ sdbcx::ObjectType OColumnsHelper::appendObject( const OUString& _rForName, const Reference<XDatabaseMetaData> xMetaData = m_pTable->getConnection()->getMetaData(); OUString aSql = "ALTER TABLE " + - ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ) + + ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::EComposeRule::InTableDefinitions, true ) + " ADD " + ::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),nullptr,m_pTable->getTypeCreatePattern()); @@ -197,7 +197,7 @@ void OColumnsHelper::dropObject(sal_Int32 /*_nPos*/, const OUString& _sElementNa Reference<XDatabaseMetaData> xMetaData = m_pTable->getConnection()->getMetaData(); OUString aQuote = xMetaData->getIdentifierQuoteString( ); OUString aSql = "ALTER TABLE " + - ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ) + + ::dbtools::composeTableName( xMetaData, m_pTable, ::dbtools::EComposeRule::InTableDefinitions, true ) + " DROP " + ::dbtools::quoteName( aQuote,_sElementName); diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index 85e90bd94ddc..33dabdd76a23 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -227,7 +227,7 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const OUString& _sElementNam OUString aSql( "DROP INDEX " ); - OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::EComposeRule::InIndexDefinitions, false, false, true ); + OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::EComposeRule::InIndexDefinitions, true ); OUString sIndexName; sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), OUString(), aSchema, aName, true, ::dbtools::EComposeRule::InIndexDefinitions ); diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index c7419c47c7cf..6b3b8dae0e7a 100644 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx @@ -159,7 +159,7 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re aSql.append("ALTER TABLE "); OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); - aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::EComposeRule::InTableDefinitions, false, false, true )); + aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::EComposeRule::InTableDefinitions, true )); aSql.append(" ADD "); if ( nKeyType == KeyType::PRIMARY ) @@ -274,7 +274,7 @@ void OKeysHelper::dropObject(sal_Int32 _nPos, const OUString& _sElementName) OUStringBuffer aSql; aSql.append("ALTER TABLE "); - aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::EComposeRule::InTableDefinitions, false, false, true )); + aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::EComposeRule::InTableDefinitions, true )); sal_Int32 nKeyType = KeyType::PRIMARY; if ( xKey.is() ) diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx index da88206cc7d8..961720f4bc59 100644 --- a/connectivity/source/commontools/dbexception.cxx +++ b/connectivity/source/commontools/dbexception.cxx @@ -446,14 +446,14 @@ void throwInvalidColumnException( const OUString& _rColumnName, const Reference< } void throwSQLException( const OUString& _rMessage, const OUString& _rSQLState, - const Reference< XInterface >& _rxContext, const sal_Int32 _nErrorCode, const Any* _pNextException ) + const Reference< XInterface >& _rxContext, const sal_Int32 _nErrorCode ) { throw SQLException( _rMessage, _rxContext, _rSQLState, _nErrorCode, - _pNextException ? *_pNextException : Any() + Any() ); } diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 547aea048041..861419a5c283 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -450,17 +450,15 @@ SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet, const R return xConnection; } -Reference< XConnection> connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext, - bool _bSetAsActiveConnection ) +Reference< XConnection> connectRowset(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext >& _rxContext ) { - SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxContext, _bSetAsActiveConnection, true ); + SharedConnection xConnection = lcl_connectRowSet( _rxRowSet, _rxContext, true/*bSetAsActiveConnection*/, true ); return xConnection.getTyped(); } -SharedConnection ensureRowSetConnection(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext>& _rxContext, - bool _bUseAutoConnectionDisposer ) +SharedConnection ensureRowSetConnection(const Reference< XRowSet>& _rxRowSet, const Reference< XComponentContext>& _rxContext ) { - return lcl_connectRowSet( _rxRowSet, _rxContext, true, _bUseAutoConnectionDisposer ); + return lcl_connectRowSet( _rxRowSet, _rxContext, true, false/*bUseAutoConnectionDisposer*/ ); } Reference< XNameAccess> getTableFields(const Reference< XConnection>& _rxConn,const OUString& _rName) @@ -1210,7 +1208,7 @@ Reference< XSingleSelectQueryComposer > getComposedRowSetStatement( const Refere Reference< XSingleSelectQueryComposer > xComposer; try { - Reference< XConnection> xConn = connectRowset( Reference< XRowSet >( _rxRowSet, UNO_QUERY ), _rxContext, true ); + Reference< XConnection> xConn = connectRowset( Reference< XRowSet >( _rxRowSet, UNO_QUERY ), _rxContext ); if ( xConn.is() ) // implies _rxRowSet.is() { // build the statement the row set is based on (can't use the ActiveCommand property of the set @@ -1335,8 +1333,6 @@ OUString composeTableNameForSelect( const Reference< XConnection >& _rxConnectio OUString composeTableName(const Reference<XDatabaseMetaData>& _xMetaData, const Reference<XPropertySet>& _xTable, EComposeRule _eComposeRule, - bool _bSuppressCatalog, - bool _bSuppressSchema, bool _bQuote ) { OUString sCatalog, sSchema, sName; @@ -1344,8 +1340,8 @@ OUString composeTableName(const Reference<XDatabaseMetaData>& _xMetaData, return impl_doComposeTableName( _xMetaData, - _bSuppressCatalog ? OUString() : sCatalog, - _bSuppressSchema ? OUString() : sSchema, + sCatalog, + sSchema, sName, _bQuote, _eComposeRule diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 942d9ac60278..efff523d800d 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -987,7 +987,7 @@ OUString getDefaultReportEngineServiceName(const Reference< XComponentContext >& return OUString(); } -bool isAggregateColumn(const Reference< XSingleSelectQueryComposer > &_xParser, const Reference< XPropertySet > &_xField, bool whenNotFound) +bool isAggregateColumn(const Reference< XSingleSelectQueryComposer > &_xParser, const Reference< XPropertySet > &_xField) { OUString sName; _xField->getPropertyValue("Name") >>= sName; @@ -996,7 +996,7 @@ bool isAggregateColumn(const Reference< XSingleSelectQueryComposer > &_xParser, if (xColumnsSupplier.is()) xCols = xColumnsSupplier->getColumns(); - return isAggregateColumn(xCols, sName, whenNotFound); + return isAggregateColumn(xCols, sName, false/*whenNotFound*/); } bool isAggregateColumn(const Reference< XNameAccess > &_xColumns, const OUString &_sName, bool whenNotFound) diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx index c3b76a8355a9..bde5866b9d92 100644 --- a/connectivity/source/drivers/hsqldb/HTables.cxx +++ b/connectivity/source/drivers/hsqldb/HTables.cxx @@ -179,7 +179,7 @@ void OTables::appendNew(const OUString& _rsNewTable) OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject) { OSL_ENSURE(_xObject.is(),"OTables::getNameForObject: Object is NULL!"); - return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::EComposeRule::InDataManipulation, false ); } diff --git a/connectivity/source/drivers/hsqldb/HViews.cxx b/connectivity/source/drivers/hsqldb/HViews.cxx index e7ff80db0038..d254ed16f541 100644 --- a/connectivity/source/drivers/hsqldb/HViews.cxx +++ b/connectivity/source/drivers/hsqldb/HViews.cxx @@ -111,7 +111,7 @@ void HViews::dropObject(sal_Int32 _nPos,const OUString& /*_sElementName*/) OUString aSql( "DROP VIEW" ); Reference<XPropertySet> xProp(xObject,UNO_QUERY); - aSql += ::dbtools::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ); + aSql += ::dbtools::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InTableDefinitions, true ); Reference<XConnection> xConnection = static_cast<OHCatalog&>(m_rParent).getConnection(); Reference< XStatement > xStmt = xConnection->createStatement( ); @@ -135,7 +135,7 @@ void HViews::createView( const Reference< XPropertySet >& descriptor ) descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand; OUString aSql = "CREATE VIEW " + - ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ) + + ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InTableDefinitions, true ) + " AS " + sCommand; Reference< XStatement > xStmt = xConnection->createStatement( ); @@ -149,7 +149,7 @@ void HViews::createView( const Reference< XPropertySet >& descriptor ) OTables* pTables = static_cast<OTables*>(static_cast<OHCatalog&>(m_rParent).getPrivateTables()); if ( pTables ) { - OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InDataManipulation, false ); pTables->appendNew(sName); } } diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx index fb13acb5e534..ccef2260e8b0 100644 --- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx @@ -117,7 +117,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( // execute Java-Call static jmethodID mID(nullptr); obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID); - OSL_VERIFY( !isExceptionOccurred(t.pEnv, true) ); + OSL_VERIFY( !isExceptionOccurred(t.pEnv) ); jvalue args[4]; args[3].l = nullptr; @@ -125,7 +125,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( if ( typeFilterCount ) { jobjectArray pObjArray = t.pEnv->NewObjectArray( (jsize)typeFilterCount, java_lang_String::st_getMyClass(), nullptr ); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); const OUString* typeFilter = _types.getConstArray(); bool bIncludeAllTypes = false; for ( sal_Int32 i=0; i<typeFilterCount; ++i, ++typeFilter ) @@ -137,7 +137,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( } jstring aT = convertwchar_tToJavaString( t.pEnv, *typeFilter ); t.pEnv->SetObjectArrayElement( pObjArray, (jsize)i, aT ); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); } if ( bIncludeAllTypes ) @@ -145,7 +145,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( // the SDBC API allows to pass "%" as table type filter, but in JDBC, "all table types" // is represented by the table type being <null/> t.pEnv->DeleteLocalRef( pObjArray ); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); } else { @@ -173,23 +173,23 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTables( if ( aCatalogFilter.hasValue() ) { t.pEnv->DeleteLocalRef(static_cast<jstring>(args[0].l)); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); } if(args[1].l) { t.pEnv->DeleteLocalRef(static_cast<jstring>(args[1].l)); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); } if(!tableNamePattern.isEmpty()) { t.pEnv->DeleteLocalRef(static_cast<jstring>(args[2].l)); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); } //for(INT16 i=0;i<len;i++) if ( args[3].l ) { t.pEnv->DeleteLocalRef( static_cast<jobjectArray>(args[3].l) ); - OSL_VERIFY( !isExceptionOccurred( t.pEnv, true ) ); + OSL_VERIFY( !isExceptionOccurred( t.pEnv ) ); } if ( jThrow ) diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx index 7625f3eb5a1e..7b651b68fe72 100644 --- a/connectivity/source/drivers/jdbc/tools.cxx +++ b/connectivity/source/drivers/jdbc/tools.cxx @@ -184,7 +184,7 @@ jobject connectivity::convertTypeMapToJavaMap(const Reference< css::container::X return nullptr; } -bool connectivity::isExceptionOccurred(JNIEnv *pEnv,bool _bClear) +bool connectivity::isExceptionOccurred(JNIEnv *pEnv) { if ( !pEnv ) return false; @@ -193,8 +193,7 @@ bool connectivity::isExceptionOccurred(JNIEnv *pEnv,bool _bClear) bool bRet = pThrowable != nullptr; if ( pThrowable ) { - if ( _bClear ) - pEnv->ExceptionClear(); + pEnv->ExceptionClear(); pEnv->DeleteLocalRef(pThrowable); } diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx index 988016796b7c..be47c7c7a116 100644 --- a/connectivity/source/drivers/mysql/YTables.cxx +++ b/connectivity/source/drivers/mysql/YTables.cxx @@ -199,7 +199,7 @@ void OTables::appendNew(const OUString& _rsNewTable) OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject) { OSL_ENSURE(_xObject.is(),"OTables::getNameForObject: Object is NULL!"); - return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::EComposeRule::InDataManipulation, false ); } void OTables::addComment(const Reference< XPropertySet >& descriptor,OUStringBuffer& _rOut) diff --git a/connectivity/source/drivers/mysql/YViews.cxx b/connectivity/source/drivers/mysql/YViews.cxx index 874f8ce33ee8..2f4f123285b3 100644 --- a/connectivity/source/drivers/mysql/YViews.cxx +++ b/connectivity/source/drivers/mysql/YViews.cxx @@ -104,7 +104,7 @@ void OViews::dropObject(sal_Int32 _nPos,const OUString& /*_sElementName*/) OUString aSql( "DROP VIEW" ); Reference<XPropertySet> xProp(xObject,UNO_QUERY); - aSql += ::dbtools::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ); + aSql += ::dbtools::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InTableDefinitions, true ); Reference<XConnection> xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection(); Reference< XStatement > xStmt = xConnection->createStatement( ); @@ -127,7 +127,7 @@ void OViews::createView( const Reference< XPropertySet >& descriptor ) OUString aSql( "CREATE VIEW " ); OUString sCommand; - aSql += ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ); + aSql += ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InTableDefinitions, true ); aSql += " AS "; descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)) >>= sCommand; @@ -144,7 +144,7 @@ void OViews::createView( const Reference< XPropertySet >& descriptor ) OTables* pTables = static_cast<OTables*>(static_cast<OMySQLCatalog&>(m_rParent).getPrivateTables()); if ( pTables ) { - OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InDataManipulation, false ); pTables->appendNew(sName); } } diff --git a/connectivity/source/inc/java/tools.hxx b/connectivity/source/inc/java/tools.hxx index 31647fe57fc8..c181a1b2f940 100644 --- a/connectivity/source/inc/java/tools.hxx +++ b/connectivity/source/inc/java/tools.hxx @@ -48,14 +48,11 @@ namespace connectivity jobject convertTypeMapToJavaMap(const css::uno::Reference< css::container::XNameAccess > & _rMap); /** return if a exception occurred + the exception will be cleared. @param pEnv The native java env - @param _bClear - <TRUE/> if the exception should be cleared - @return - <TRUE/> if an exception is occurred */ - bool isExceptionOccurred(JNIEnv *pEnv,bool _bClear); + bool isExceptionOccurred(JNIEnv *pEnv); jobject createByteInputStream(const css::uno::Reference< css::io::XInputStream >& x,sal_Int32 length); jobject createCharArrayReader(const css::uno::Reference< css::io::XInputStream >& x,sal_Int32 length); diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index ab3894ff3b11..b9d734e4c242 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -403,7 +403,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::vector< OUString OFilteredContainer::getNameForObject(const ObjectType& _xObject) { OSL_ENSURE( _xObject.is(), "OFilteredContainer::getNameForObject: Object is NULL!" ); - return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + return ::dbtools::composeTableName( m_xMetaData, _xObject, ::dbtools::EComposeRule::InDataManipulation, false ); } // multiple to obtain all tables from XDatabaseMetaData::getTables, via passing a particular diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 69c5ca5b1a2c..6c9bc6964d45 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -310,7 +310,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin { connectivity::OSQLTable xSelColSup(xSelectTables->getByName(*pIter),uno::UNO_QUERY); Reference<XPropertySet> xProp(xSelColSup,uno::UNO_QUERY); - OUString sSelectTableName = ::dbtools::composeTableName( xMeta, xProp, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + OUString sSelectTableName = ::dbtools::composeTableName( xMeta, xProp, ::dbtools::EComposeRule::InDataManipulation, false ); ::dbaccess::getColumnPositions(xQueryColumns, xSelColSup->getColumns()->getElementNames(), sSelectTableName, (*m_pForeignColumnNames), true); diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 915c13e75808..61859ffd1cca 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1607,7 +1607,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert case DataType::VARCHAR: case DataType::CHAR: case DataType::LONGVARCHAR: - aSQL.append( DBTypeConversion::toSQLString( nType, aValue, true, m_xTypeConverter ) ); + aSQL.append( DBTypeConversion::toSQLString( nType, aValue, m_xTypeConverter ) ); break; case DataType::CLOB: { @@ -1622,7 +1622,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert } else { - aSQL.append( DBTypeConversion::toSQLString( nType, aValue, true, m_xTypeConverter ) ); + aSQL.append( DBTypeConversion::toSQLString( nType, aValue, m_xTypeConverter ) ); } } break; @@ -1659,7 +1659,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert } break; default: - aSQL.append( DBTypeConversion::toSQLString( nType, aValue, true, m_xTypeConverter ) ); + aSQL.append( DBTypeConversion::toSQLString( nType, aValue, m_xTypeConverter ) ); break; } } diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index 4e64e1aa0d61..d14de81b1a19 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -133,7 +133,7 @@ ObjectType OViewContainer::appendObject( const OUString& _rForName, const Refere } else { - OUString sComposedName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InTableDefinitions, false, false, true ); + OUString sComposedName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InTableDefinitions, true ); if(sComposedName.isEmpty()) ::dbtools::throwFunctionSequenceException(static_cast<XTypeProvider*>(static_cast<OFilteredContainer*>(this))); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index c30874a66fb6..951664a736d6 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1590,7 +1590,7 @@ void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rE { ensureConnection(); if ( xProp.is() && m_xMetaData.is() ) - sNewName = ::dbaui::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + sNewName = ::dbaui::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InDataManipulation, false ); } break; case E_FORM: @@ -2122,7 +2122,7 @@ void OApplicationController::renameEntry() if ( eType == E_TABLE ) { Reference<XPropertySet> xProp(xRename,UNO_QUERY); - sNewName = ::dbaui::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + sNewName = ::dbaui::composeTableName( m_xMetaData, xProp, ::dbtools::EComposeRule::InDataManipulation, false ); } getContainer()->elementReplaced( eType , sOldName, sNewName ); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index b2920d018d68..b97bcaa239fd 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -982,7 +982,7 @@ bool SbaGridControl::IsReadOnlyDB() const if (xColumns.is()) { Reference< XRowSet > xDataSource(xColumns->getParent(), UNO_QUERY); - ::dbtools::ensureRowSetConnection( xDataSource, getContext(), false ); // NOT SURE ABOUT FALSE + ::dbtools::ensureRowSetConnection( xDataSource, getContext() ); Reference< XChild > xConn(::dbtools::getConnection(xDataSource),UNO_QUERY); if (xConn.is()) { diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index 6b5493a39ec1..d83f0f74ff85 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -803,7 +803,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R ,const Reference<XPropertySet>& _xDestTable ,const TPositions& _rvColumns) { - OUString sComposedTableName = ::dbtools::composeTableName( _xMetaData, _xDestTable, ::dbtools::EComposeRule::InDataManipulation, false, false, true ); + OUString sComposedTableName = ::dbtools::composeTableName( _xMetaData, _xDestTable, ::dbtools::EComposeRule::InDataManipulation, true ); OUString aSql = "INSERT INTO " + sComposedTableName diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 355c19bbd40d..abc1205d998b 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -114,7 +114,7 @@ OUString ObjectCopySource::getQualifiedObjectName() const OUString sName; if ( !m_xObjectPSI->hasPropertyByName( PROPERTY_COMMAND ) ) - sName = ::dbtools::composeTableName( m_xMetaData, m_xObject, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + sName = ::dbtools::composeTableName( m_xMetaData, m_xObject, ::dbtools::EComposeRule::InDataManipulation, false ); else m_xObject->getPropertyValue( PROPERTY_NAME ) >>= sName; return sName; @@ -1239,7 +1239,7 @@ Reference< XPropertySet > OCopyTableWizard::createTable() else { OUString sComposedName( - ::dbtools::composeTableName( m_xDestConnection->getMetaData(), xTable, ::dbtools::EComposeRule::InDataManipulation, false, false, false ) ); + ::dbtools::composeTableName( m_xDestConnection->getMetaData(), xTable, ::dbtools::EComposeRule::InDataManipulation, false ) ); if(xTables->hasByName(sComposedName)) { xTables->getByName(sComposedName) >>= xTable; diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 87e18ae5d924..b3e71892e671 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -1973,7 +1973,7 @@ namespace OSL_VERIFY( xTableProps->getPropertyValue( PROPERTY_NAME ) >>= sComposedName ); else { - sComposedName = ::dbtools::composeTableName( xMetaData, xTableProps, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + sComposedName = ::dbtools::composeTableName( xMetaData, xTableProps, ::dbtools::EComposeRule::InDataManipulation, false ); // if the alias is the complete (composed) table, then shorten it if ( aKeyComp( sComposedName, aIter->first ) ) diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 1375ac8ba17a..ea6e5777297f 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1489,7 +1489,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs) xViewProps.set( xElements->getByName( m_sName ), UNO_QUERY ); if ( !xViewProps.is() ) // correct name and try again - m_sName = ::dbtools::composeTableName( getMetaData(), xQuery, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + m_sName = ::dbtools::composeTableName( getMetaData(), xQuery, ::dbtools::EComposeRule::InDataManipulation, false ); OSL_ENSURE( xElements->hasByName( m_sName ), "OQueryController::doSaveAsDoc: newly created view does not exist!" ); diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 2197c4654bc8..bfba6567223a 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -353,7 +353,7 @@ namespace void RelationLoader::loadTableData(const Any& _aTable) { Reference<XPropertySet> xTableProp(_aTable,UNO_QUERY); - const OUString sSourceName = ::dbtools::composeTableName( m_xMetaData, xTableProp, ::dbtools::EComposeRule::InTableDefinitions, false, false, false ); + const OUString sSourceName = ::dbtools::composeTableName( m_xMetaData, xTableProp, ::dbtools::EComposeRule::InTableDefinitions, false ); TTableDataHelper::const_iterator aFind = m_aTableData.find(sSourceName); if ( aFind == m_aTableData.end() ) { diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 3fd564ab50bf..6f0ec5edb670 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -367,7 +367,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) if(!m_xTable.is()) // correct name and try again { // it can be that someone inserted new data for us - m_sName = ::dbtools::composeTableName( getConnection()->getMetaData(), xTable, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + m_sName = ::dbtools::composeTableName( getConnection()->getMetaData(), xTable, ::dbtools::EComposeRule::InDataManipulation, false ); assignTable(); } // now check if our datasource has set a tablefilter and if append the new table name to it @@ -1483,7 +1483,7 @@ OUString OTableController::getPrivateTitle() const if ( !m_sName.isEmpty() && getConnection().is() ) { if ( m_xTable.is() ) - sTitle = ::dbtools::composeTableName( getConnection()->getMetaData(), m_xTable, ::dbtools::EComposeRule::InDataManipulation, false, false, false ); + sTitle = ::dbtools::composeTableName( getConnection()->getMetaData(), m_xTable, ::dbtools::EComposeRule::InDataManipulation, false ); else sTitle = m_sName; } diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index d95deabafc01..a1b141a919ba 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1444,7 +1444,7 @@ OUString CopyTableWizard::impl_getServerSideCopyStatement_throw(const Reference< sColumns.append(sQuote + aDestColumnNames[aPosIter->second - 1] + sQuote); } } - const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, _xTable, ::dbtools::EComposeRule::InDataManipulation, false, false, true ); + const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, _xTable, ::dbtools::EComposeRule::InDataManipulation, true ); OUString sSql("INSERT INTO " + sComposedTableName + " ( " + sColumns.makeStringAndClear() + " ) ( " + m_pSourceObject->getSelectStatement() + " )"); return sSql; diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 5f14c6760b39..496b52dd0e58 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -522,7 +522,7 @@ namespace dbp Reference< XConnection > xConnection; m_aContext.bEmbedded = ::dbtools::isEmbeddedInDatabase( m_aContext.xForm, xConnection ); if ( !m_aContext.bEmbedded ) - xConnection = ::dbtools::connectRowset( m_aContext.xRowSet, m_xContext, true ); + xConnection = ::dbtools::connectRowset( m_aContext.xRowSet, m_xContext ); // get the fields if (xConnection.is()) diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 799a1d5545d7..da9ad725451d 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2359,7 +2359,7 @@ namespace pcr if ( xRowSetProps.is() ) { WaitCursor aWaitCursor( impl_getDefaultDialogParent_nothrow() ); - m_xRowSetConnection = ::dbtools::ensureRowSetConnection( xRowSet, m_xContext, false ); + m_xRowSetConnection = ::dbtools::ensureRowSetConnection( xRowSet, m_xContext ); } } catch ( const SQLException& ) { aError = SQLExceptionInfo( ::cppu::getCaughtException() ); } diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 7ee0a03ed111..2d332470449f 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -471,7 +471,7 @@ namespace pcr _rxConnection.set(_rxFormProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY); if ( !_rxConnection.is() ) - _rxConnection = ::dbtools::connectRowset( Reference< XRowSet >( _rxFormProps, UNO_QUERY ), m_xContext, true ); + _rxConnection = ::dbtools::connectRowset( Reference< XRowSet >( _rxFormProps, UNO_QUERY ), m_xContext ); } diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 9112c9e3ad40..5f8fe4d15c88 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2788,8 +2788,7 @@ bool ODatabaseForm::implEnsureConnection() { Reference< XConnection > xConnection = connectRowset( Reference<XRowSet> (m_xAggregate, UNO_QUERY), - m_xContext, - true // set a calculated connection as ActiveConnection + m_xContext ); return xConnection.is(); } diff --git a/include/connectivity/dbconversion.hxx b/include/connectivity/dbconversion.hxx index 2e67931cb3ad..270aea7b86da 100644 --- a/include/connectivity/dbconversion.hxx +++ b/include/connectivity/dbconversion.hxx @@ -135,7 +135,7 @@ namespace dbtools // return the DateTime in the format %04d-%02d-%02d %02d:%02d:%02d.%09d OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString(const css::util::DateTime& _rDateTime); // return the any in an sql standard format - OOO_DLLPUBLIC_DBTOOLS OUString toSQLString(sal_Int32 eType, const css::uno::Any& _rVal, bool bQuote, + OOO_DLLPUBLIC_DBTOOLS OUString toSQLString(sal_Int32 eType, const css::uno::Any& _rVal, const css::uno::Reference< css::script::XTypeConverter >& _rxTypeConverter); /** converts a Unicode string into a 8-bit string, using the given encoding diff --git a/include/connectivity/dbexception.hxx b/include/connectivity/dbexception.hxx index 0742d5b69224..16c499954ad2 100644 --- a/include/connectivity/dbexception.hxx +++ b/include/connectivity/dbexception.hxx @@ -310,8 +310,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwSQLException( const OUString& _rMessage, const OUString& _rSQLState, const css::uno::Reference< css::uno::XInterface >& _rxContext, - const sal_Int32 _nErrorCode = 0, - const css::uno::Any* _pNextException = nullptr + const sal_Int32 _nErrorCode = 0 ); diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx index e0bf5ca8f022..885cf82e50b9 100644 --- a/include/connectivity/dbtools.hxx +++ b/include/connectivity/dbtools.hxx @@ -127,28 +127,27 @@ namespace dbtools retrieved from the driver manager. </nl> + The calculated connection is set as ActiveConnection property on the rowset. + + If the connection was newly created by the method, then + the ownership of the connection is delivered to a temporary object, which observes the + row set: As soon as a connection-relevant property of the row set changes, or as soon + as somebody else sets another ActiveConnection at the row set, the original + connection (the one which this function calculated) is disposed and discarded. At this + very moment, also the temporary observer object dies. This way, it is ensured that + there's no resource leak from an un-owned connection object. + @param _rxRowSet the row set @param _rxFactory a service factory, which can be used to create data sources, interaction handler etc (the usual stuff) - @param _bSetAsActiveConnection - If <TRUE/>, the calculated connection is set as ActiveConnection property on the rowset. - - If the connection was newly created by the method, and this parameter is <TRUE/>, then - the ownership of the connection is delivered to a temporary object, which observes the - row set: As soon as a connection-relevant property of the row set changes, or as soon - as somebody else sets another ActiveConnection at the row set, the original - connection (the one which this function calculated) is disposed and discarded. At this - very moment, also the temporary observer object dies. This way, it is ensured that - there's no resource leak from an un-owned connection object. */ OOO_DLLPUBLIC_DBTOOLS css::uno::Reference< css::sdbc::XConnection> connectRowset( const css::uno::Reference< css::sdbc::XRowSet>& _rxRowSet, - const css::uno::Reference< css::uno::XComponentContext>& _rxContext, - bool _bSetAsActiveConnection + const css::uno::Reference< css::uno::XComponentContext>& _rxContext ); /** ensures that a row set has a valid ActiveConnection, if possible @@ -163,21 +162,15 @@ namespace dbtools <ul><li>If the connection was not newly created, the returned ->SharedConnection instance will not have the ownership, since in this case it's assumed that there already is an instance which has the ownership.</li> - <li>If the connection was newly created, and ->_bUseAutoConnectionDisposer - is <TRUE/>, then the returned SharedConnection instance will <em>not</em> - be the owner of the connection. Instead, the ownership will be delivered - to a temporary object as described for connectRowset.</li> - <li>If the connection was newly created, and ->_bUseAutoConnectionDisposer - is <FALSE/>, then the returned SharedConnection instance will have the - ownership of the XConnection.</li> + <li>If the connection was newly created, then the returned SharedConnection + instance will have the ownership of the XConnection.</li> </ul> </li> </ul> */ OOO_DLLPUBLIC_DBTOOLS SharedConnection ensureRowSetConnection( const css::uno::Reference< css::sdbc::XRowSet>& _rxRowSet, - const css::uno::Reference< css::uno::XComponentContext>& _rxContext, - bool _bUseAutoConnectionDisposer + const css::uno::Reference< css::uno::XComponentContext>& _rxContext ); /** returns the connection the RowSet is currently working with (which is the ActiveConnection property) @@ -482,8 +475,6 @@ namespace dbtools const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData, const css::uno::Reference< css::beans::XPropertySet>& _xTable, EComposeRule _eComposeRule, - bool _bSuppressCatalogName, - bool _bSuppressSchemaName, bool _bQuote); @@ -794,13 +785,10 @@ namespace dbtools a query composer that knows the field by name @param _xField the field - @param whenNotFound - value returned when _sName is not known by _xComposer */ OOO_DLLPUBLIC_DBTOOLS bool isAggregateColumn( const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > &_xComposer, - const css::uno::Reference< css::beans::XPropertySet > &_xField, - bool whenNotFound = false + const css::uno::Reference< css::beans::XPropertySet > &_xField ); /** is this column an aggregate? diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index a7258b6bd459..3f3a99fc0efb 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -313,7 +313,7 @@ void FmFieldWin::UpdateContent(const css::uno::Reference< css::form::XForm > & x // get the connection of the form m_aConnection.reset( - connectRowset( Reference< XRowSet >( xForm, UNO_QUERY ), ::comphelper::getProcessComponentContext(), true ), + connectRowset( Reference< XRowSet >( xForm, UNO_QUERY ), ::comphelper::getProcessComponentContext() ), SharedConnection::NoTakeOwnership ); // TODO: When incompatible changes (such as extending the "virtualdbtools" interface by ensureRowSetConnection) commit c45a3488af6455a3b307f9e64bed41d23b3bae53 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Oct 31 11:37:17 2017 +0200 loplugin:constantparam in d* Change-Id: I65c395157d2b68a549a6fecf9abf1fd46446d960 Reviewed-on: https://gerrit.libreoffice.org/44109 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index ea4169f58d00..915c13e75808 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -164,15 +164,14 @@ namespace return sSQL; } - /** resets an SQL iterator, including deletion of the parse tree, and disposal if desired + /** resets an SQL iterator, including deletion of the parse tree, and dispose */ - void resetIterator( OSQLParseTreeIterator& _rIterator, bool _bDispose ) + void resetIterator( OSQLParseTreeIterator& _rIterator ) { const OSQLParseNode* pSqlParseNode = _rIterator.getParseTree(); _rIterator.setParseTree(nullptr); delete pSqlParseNode; - if ( _bDispose ) - _rIterator.dispose(); + _rIterator.dispose(); } void lcl_addFilterCriteria_throw(sal_Int32 i_nFilterOperator,const OUString& i_sValue,OUStringBuffer& o_sRet) { @@ -283,8 +282,8 @@ void SAL_CALL OSingleSelectQueryComposer::disposing() MutexGuard aGuard(m_aMutex); - resetIterator( m_aSqlIterator, true ); - resetIterator( m_aAdditiveIterator, true ); + resetIterator( m_aSqlIterator ); + resetIterator( m_aAdditiveIterator ); m_xConnectionTables = nullptr; m_xConnection = nullptr; diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx index 66569a5e0f14..ee2df90ae9cb 100644 --- a/dbaccess/source/core/api/column.cxx +++ b/dbaccess/source/core/api/column.cxx @@ -379,7 +379,7 @@ sdbcx::ObjectType OColumns::appendObject( const OUString& _rForName, const Refer if ( m_pColFactoryImpl ) m_pColFactoryImpl->columnAppended( descriptor ); - ::dbaccess::notifyDataSourceModified(m_xParent,true); + ::dbaccess::notifyDataSourceModified(m_xParent); return xReturn; } @@ -409,7 +409,7 @@ void OColumns::dropObject(sal_Int32 _nPos, const OUString& _sElementName) if ( m_pColFactoryImpl ) m_pColFactoryImpl->columnDropped(_sElementName); - ::dbaccess::notifyDataSourceModified(m_xParent,true); + ::dbaccess::notifyDataSourceModified(m_xParent); } Reference< XInterface > SAL_CALL OColumns::getParent( ) diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx index 147d97d37c82..b99b7b199b81 100644 --- a/dbaccess/source/core/api/definitioncolumn.cxx +++ b/dbaccess/source/core/api/definitioncolumn.cxx @@ -114,7 +114,7 @@ Sequence< OUString > OTableColumnDescriptor::getSupportedServiceNames( ) void OTableColumnDescriptor::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) { OColumn::setFastPropertyValue_NoBroadcast( nHandle, rValue ); - ::dbaccess::notifyDataSourceModified( m_xParent, true ); + ::dbaccess::notifyDataSourceModified( m_xParent ); } Reference< XInterface > SAL_CALL OTableColumnDescriptor::getParent( ) diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 0eb6fbe79c43..f797ff9aaa48 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -330,7 +330,7 @@ ObjectType OTableContainer::appendObject( const OUString& _rForName, const Refer PROPERTY_ROW_HEIGHT, PROPERTY_TEXTCOLOR, PROPERTY_TEXTLINECOLOR, PROPERTY_TEXTEMPHASIS, PROPERTY_TEXTRELIEF}; if ( bModified || !lcl_isPropertySetDefaulted(aNames,xTableDefinition) ) - ::dbaccess::notifyDataSourceModified(m_xTableDefinitions,true); + ::dbaccess::notifyDataSourceModified(m_xTableDefinitions); return createObject( _rForName ); } diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index eec6d82b0cab..18db105b95d9 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -620,7 +620,7 @@ void SAL_CALL OContentHelper::rename( const OUString& newName ) void OContentHelper::notifyDataSourceModified() { - ::dbaccess::notifyDataSourceModified(m_xParentContainer,true); + ::dbaccess::notifyDataSourceModified(m_xParentContainer); } } // namespace dbaccess diff --git a/dbaccess/source/core/inc/sdbcoretools.hxx b/dbaccess/source/core/inc/sdbcoretools.hxx index 13afbb86c909..72f62194144f 100644 --- a/dbaccess/source/core/inc/sdbcoretools.hxx +++ b/dbaccess/source/core/inc/sdbcoretools.hxx @@ -31,7 +31,7 @@ namespace dbaccess { - void notifyDataSourceModified(const css::uno::Reference< css::uno::XInterface >& _rxObject,bool _bModified); + void notifyDataSourceModified(const css::uno::Reference< css::uno::XInterface >& _rxObject); css::uno::Reference< css::uno::XInterface > getDataSource( const css::uno::Reference< css::uno::XInterface >& _rxDependentObject ); diff --git a/dbaccess/source/core/misc/sdbcoretools.cxx b/dbaccess/source/core/misc/sdbcoretools.cxx index edf8d2b9f214..96570276f6f9 100644 --- a/dbaccess/source/core/misc/sdbcoretools.cxx +++ b/dbaccess/source/core/misc/sdbcoretools.cxx @@ -49,7 +49,7 @@ namespace dbaccess using namespace ::com::sun::star::embed; using namespace ::com::sun::star::container; - void notifyDataSourceModified(const css::uno::Reference< css::uno::XInterface >& _rxObject,bool _bModified) + void notifyDataSourceModified(const css::uno::Reference< css::uno::XInterface >& _rxObject) { Reference< XInterface > xDs = getDataSource( _rxObject ); Reference<XDocumentDataSource> xDocumentDataSource(xDs,UNO_QUERY); @@ -57,7 +57,7 @@ namespace dbaccess xDs = xDocumentDataSource->getDatabaseDocument(); Reference< XModifiable > xModi( xDs, UNO_QUERY ); if ( xModi.is() ) - xModi->setModified(_bModified); + xModi->setModified(true); } Reference< XInterface > getDataSource( const Reference< XInterface >& _rxDependentObject ) diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx index 27827a631bb4..585c4398d1b1 100644 --- a/dbaccess/source/ui/control/SqlNameEdit.cxx +++ b/dbaccess/source/ui/control/SqlNameEdit.cxx @@ -22,14 +22,14 @@ namespace dbaui { - bool isCharOk(sal_Unicode _cChar,bool _bFirstChar,bool _bUpperCase,const OUString& _sAllowedChars) + bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, const OUString& _sAllowedChars) { return ( (_cChar >= 'A' && _cChar <= 'Z') || _cChar == '_' || _sAllowedChars.indexOf(_cChar) != -1 || (!_bFirstChar && (_cChar >= '0' && _cChar <= '9')) || - (!_bUpperCase && (_cChar >= 'a' && _cChar <= 'z')) + (_cChar >= 'a' && _cChar <= 'z') ); } bool OSQLNameChecker::checkString(const OUString& _sToCheck, @@ -41,7 +41,7 @@ namespace dbaui sal_Int32 nMatch = 0; for (sal_Int32 i = nMatch; i < _sToCheck.getLength(); ++i) { - if ( !isCharOk( _sToCheck[i], i == 0, false/*bOnlyUpperCase*/, m_sAllowedChars ) ) + if ( !isCharOk( _sToCheck[i], i == 0, m_sAllowedChars ) ) { _rsCorrected += _sToCheck.copy(nMatch, i - nMatch); bCorrected = true; diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 92d62b0fcf1c..bf1caccd2417 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -272,14 +272,14 @@ namespace dbaui } // LayoutHelper - void LayoutHelper::positionBelow( const Control& _rReference, Control& _rControl, const ControlRelation _eRelation, + void LayoutHelper::positionBelow( const Control& _rReference, Control& _rControl, const long _nIndentAppFont ) { Point aReference = _rReference.GetPosPixel(); aReference.Y() += _rReference.GetSizePixel().Height(); const vcl::Window* pConverter = _rControl.GetParent(); - Size aOffset = pConverter->LogicToPixel(Size(_nIndentAppFont, (_eRelation == RelatedControls ? 3 : 6)), MapMode(MapUnit::MapAppFont)); + Size aOffset = pConverter->LogicToPixel(Size(_nIndentAppFont, 3), MapMode(MapUnit::MapAppFont)); Point aControlPos( aReference.X() + aOffset.Width(), aReference.Y() + aOffset.Height() ); _rControl.SetPosPixel( aControlPos ); diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 0c5d7452e309..65025ba24ef1 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -214,12 +214,6 @@ namespace dbaui DECL_LINK(OnTestConnectionClickHdl, Button*, void); }; - // ControlRelation - enum ControlRelation - { - RelatedControls, UnrelatedControls - }; - // LayoutHelper class LayoutHelper { @@ -227,7 +221,6 @@ namespace dbaui static void positionBelow( const Control& _rReference, Control& _rControl, - const ControlRelation _eRelation, const long _nIndentAppFont ); /** fits the button size to be large enough to contain the buttons text diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 90fc389215eb..28a79c048981 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -578,7 +578,7 @@ namespace dbaui SetText( OUString() ); - LayoutHelper::positionBelow( *m_pRB_ConnectDatabase, *m_pDatasourceType, RelatedControls, INDENT_BELOW_RADIO ); + LayoutHelper::positionBelow( *m_pRB_ConnectDatabase, *m_pDatasourceType, INDENT_BELOW_RADIO ); if ( !bValid || bReadonly ) { diff --git a/desktop/source/deployment/inc/dp_registry.hxx b/desktop/source/deployment/inc/dp_registry.hxx index 347359e47921..43746ddfc642 100644 --- a/desktop/source/deployment/inc/dp_registry.hxx +++ b/desktop/source/deployment/inc/dp_registry.hxx @@ -33,7 +33,7 @@ namespace com { namespace sun { namespace star { namespace dp_registry { css::uno::Reference<css::deployment::XPackageRegistry> create( - OUString const & context, OUString const & cachePath, bool readOnly, + OUString const & context, OUString const & cachePath, css::uno::Reference<css::uno::XComponentContext> const & xComponentContext); } diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 64d3debe423e..6bb8e3e659b7 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -281,7 +281,7 @@ void PackageManagerImpl::initRegistryBackends() create_folder( nullptr, m_registryCache, Reference<XCommandEnvironment>(), false); m_xRegistry.set( ::dp_registry::create( - m_context, m_registryCache, false, + m_context, m_registryCache, m_xComponentContext ) ); } diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index 1350ba9dff72..a14b0fe6bbf2 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -530,11 +530,11 @@ PackageRegistryImpl::getSupportedPackageTypes() Reference<deployment::XPackageRegistry> SAL_CALL create( OUString const & context, - OUString const & cachePath, bool readOnly, + OUString const & cachePath, Reference<XComponentContext> const & xComponentContext ) { return PackageRegistryImpl::create( - context, cachePath, readOnly, xComponentContext ); + context, cachePath, false/*readOnly*/, xComponentContext ); } } // namespace dp_registry diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx index be8fc6d91368..9f740ee742e0 100644 --- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx @@ -575,7 +575,6 @@ namespace drawinglayer std::vector< basegfx::B3DPolyPolygon >& rFill, const Slice3DVector& rSliceVector, bool bCreateNormals, - bool bSmoothHorizontalNormals, bool bSmoothNormals, bool bSmoothLids, bool bClosed, @@ -647,7 +646,7 @@ namespace drawinglayer { if(bCreateNormals) { - impCreateInBetweenNormals(aPolB, aPolA, bSmoothHorizontalNormals); + impCreateInBetweenNormals(aPolB, aPolA, true/*bSmoothHorizontalNormals*/); } { @@ -679,7 +678,7 @@ namespace drawinglayer if(bHasSlant) { - impCreateInBetweenNormals(aPolAA, aPrev, bSmoothHorizontalNormals); + impCreateInBetweenNormals(aPolAA, aPrev, true/*bSmoothHorizontalNormals*/); if(bSmoothNormals) { @@ -742,7 +741,7 @@ namespace drawinglayer { if(bCreateNormals && bSmoothNormals && (nIndPrev != a + 1)) { - impCreateInBetweenNormals(aPolAA, aPrev, bSmoothHorizontalNormals); + impCreateInBetweenNormals(aPolAA, aPrev, true/*bSmoothHorizontalNormals*/); impMixNormals(aPolA, aPolAA, 0.5); } } @@ -771,7 +770,7 @@ namespace drawinglayer if(bHasSlant) { - impCreateInBetweenNormals(aNext, aPolBB, bSmoothHorizontalNormals); + impCreateInBetweenNormals(aNext, aPolBB, true/*bSmoothHorizontalNormals*/); if(bSmoothNormals) { @@ -833,7 +832,7 @@ namespace drawinglayer { if(bCreateNormals && bSmoothNormals && (nIndNext != a)) { - impCreateInBetweenNormals(aNext, aPolBB, bSmoothHorizontalNormals); + impCreateInBetweenNormals(aNext, aPolBB, true/*bSmoothHorizontalNormals*/); impMixNormals(aPolB, aPolBB, 0.5); } } diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index 246894d0eab1..22120e40f10c 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -78,7 +78,7 @@ namespace drawinglayer // create geometry std::vector< basegfx::B3DPolyPolygon > aFill; extractPlanesFromSlice(aFill, rSliceVector, - bCreateNormals, true/*smoothHorizontalNormals*/, getSmoothNormals(), getSmoothLids(), false, + bCreateNormals, getSmoothNormals(), getSmoothLids(), false, 0.5, 0.6, bCreateTextureCoordinatesX || bCreateTextureCoordinatesY, aTexTransform); // get full range diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx index a63a7886e4b3..6d0f88f7b14e 100644 --- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx @@ -73,7 +73,7 @@ namespace drawinglayer // create geometry std::vector< basegfx::B3DPolyPolygon > aFill; extractPlanesFromSlice(aFill, rSliceVector, - bCreateNormals, true/*smoothHorizontalNormals*/, getSmoothNormals(), getSmoothLids(), bClosedRotation, + bCreateNormals, getSmoothNormals(), getSmoothLids(), bClosedRotation, 0.85, 0.6, bCreateTextureCoordinatesX || bCreateTextureCoordinatesY, aTexTransform); // get full range diff --git a/include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx b/include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx index 34b0feb4c8b1..fc7a9e9bd4ff 100644 --- a/include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx +++ b/include/drawinglayer/primitive3d/sdrextrudelathetools3d.hxx @@ -102,7 +102,6 @@ namespace drawinglayer ::std::vector< basegfx::B3DPolyPolygon >& rFill, const Slice3DVector& rSliceVector, bool bCreateNormals, - bool bSmoothHorizontalNormals, bool bSmoothNormals, bool bSmoothLids, bool bClosed, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits