[Libreoffice-commits] core.git: connectivity/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 8 15:15:17 UTC 2018


 connectivity/source/drivers/postgresql/pq_statement.cxx |    3 +--
 connectivity/source/drivers/postgresql/pq_tools.cxx     |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit a53e9b1d626a9f973d3bfc93a7d3e9341b0072ad
Author:     Jochen Nitschke <j.nitschke+logerrit at ok.de>
AuthorDate: Mon Oct 8 13:16:41 2018 +0200
Commit:     Jochen Nitschke <j.nitschke+logerrit at ok.de>
CommitDate: Mon Oct 8 17:14:53 2018 +0200

    cppcheck: variableScope
    
    Change-Id: I56b06b4c69bdb501535a43780b6a10d5ceb0c7da
    Reviewed-on: https://gerrit.libreoffice.org/61524
    Tested-by: Jenkins
    Reviewed-by: Jochen Nitschke <j.nitschke+logerrit at ok.de>

diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index b50f9008c720..d22e2b7a0433 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -465,7 +465,6 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
         // belonging to the primary key are in the result set, allow updateable result sets
         // otherwise, don't
         OUString table, schema;
-        std::vector< OUString > sourceTableKeys;
         std::vector< OString > vec;
         tokenizeSQL( cmd, vec );
         OUString sourceTable =
@@ -478,7 +477,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
             OString aReason;
             if( sourceTable.getLength() )
             {
-                sourceTableKeys = lookupKeys(
+                std::vector< OUString > sourceTableKeys = lookupKeys(
                     pSettings->tables.is() ?
                            pSettings->tables : data->tableSupplier->getTables() ,
                     sourceTable,
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index ca1211eaa438..fc602926e0ef 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -1084,10 +1084,10 @@ void extractNameValuePairsFromInsert( String2StringMap & map, const OString & la
             n +=2;
         }
 
-        std::vector< OString > names;
         n ++;
         if( vec[n].equalsIgnoreAsciiCase( "(" ) )
         {
+            std::vector< OString> names;
 //             printf( "2\n" );
             // extract names
             n++;


More information about the Libreoffice-commits mailing list