diff options
Diffstat (limited to 'connectivity/source/drivers/postgresql')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_connection.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_statement.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_xbase.cxx | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index fd1b9fd1297d..66c30c893aed 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -397,12 +397,12 @@ static void properties2arrays( const Sequence< PropertyValue > & args, "requiressl" }; - for( int i = 0; i < args.getLength() ; ++i ) + for( PropertyValue const & prop : args ) { bool append = false; for(const char* j : keyword_list) { - if( args[i].Name.equalsIgnoreAsciiCaseAscii( j )) + if( prop.Name.equalsIgnoreAsciiCaseAscii( j )) { keywords.push_back( j, SAL_NO_ACQUIRE ); append = true; @@ -413,14 +413,14 @@ static void properties2arrays( const Sequence< PropertyValue > & args, if( append ) { OUString value; - tc->convertTo( args[i].Value, cppu::UnoType<decltype(value)>::get() ) >>= value; + tc->convertTo( prop.Value, cppu::UnoType<decltype(value)>::get() ) >>= value; char *v = strdup(OUStringToOString(value, enc).getStr()); values.push_back ( v ); } else { // ignore for now - SAL_WARN("connectivity.postgresql", "sdbc-postgresql: unknown argument '" << args[i].Name << "' having value: " << args[i].Value ); + SAL_WARN("connectivity.postgresql", "sdbc-postgresql: unknown argument '" << prop.Name << "' having value: " << prop.Value ); } } } diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 6c2deef8fe0f..dd7ab576b37f 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -637,7 +637,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( // TODO: make also unqualified tables names work here. Have a look at 2.8.3. The Schema Search Path // in postgresql doc - Sequence< OUString > keyColumnNames = getPrimaryKeyColumnNames( connection, schemaName, tableName ); + const Sequence< OUString > keyColumnNames = getPrimaryKeyColumnNames( connection, schemaName, tableName ); if( keyColumnNames.hasElements() ) { OUStringBuffer buf( 128 ); @@ -646,10 +646,10 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( buf.append( " WHERE " ); bool bAdditionalCondition = false; String2StringMap autoValues; - for( int i = 0 ; i < keyColumnNames.getLength() ; i ++ ) + for( OUString const & columnNameUnicode : keyColumnNames ) { OUString value; - OString columnName = OUStringToOString( keyColumnNames[i], ConnectionSettings::encoding ); + OString columnName = OUStringToOString( columnNameUnicode, ConnectionSettings::encoding ); bool bColumnMatchNamedValue = false; for (auto const& namedValue : namedValues) { @@ -701,7 +701,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( if( bAdditionalCondition ) buf.append( " AND " ); - bufferQuoteIdentifier( buf, keyColumnNames[i], pConnectionSettings ); + bufferQuoteIdentifier( buf, columnNameUnicode, pConnectionSettings ); buf.append( " = " ); buf.append( value ); bAdditionalCondition = true; diff --git a/connectivity/source/drivers/postgresql/pq_xbase.cxx b/connectivity/source/drivers/postgresql/pq_xbase.cxx index 377b3dd4b99b..1fec4130a9db 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.cxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.cxx @@ -178,12 +178,12 @@ void ReflectionBase::copyValuesFrom( const Reference< XPropertySet > & set ) { Reference< XPropertySetInfo > myPropInfo = getPropertySetInfo(); - Sequence< Property > props = info->getProperties(); - for( int i = 0 ; i < props.getLength() ; i ++ ) + const Sequence< Property > props = info->getProperties(); + for( Property const & prop : props ) { - if( myPropInfo->hasPropertyByName( props[i].Name ) ) + if( myPropInfo->hasPropertyByName( prop.Name ) ) setPropertyValue_NoBroadcast_public( - props[i].Name, set->getPropertyValue( props[i].Name ) ); + prop.Name, set->getPropertyValue( prop.Name ) ); } } } |