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

kowther kowtherh at gmail.com
Fri Apr 6 23:43:55 UTC 2018


 connectivity/source/drivers/postgresql/pq_connection.hxx        |    1 
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx |    6 ++--
 connectivity/source/drivers/postgresql/pq_preparedstatement.hxx |    4 +-
 connectivity/source/drivers/postgresql/pq_statement.cxx         |    2 -
 connectivity/source/drivers/postgresql/pq_tools.cxx             |   14 +++++-----
 connectivity/source/drivers/postgresql/pq_tools.hxx             |    6 ++--
 6 files changed, 16 insertions(+), 17 deletions(-)

New commits:
commit 3ec490fc757d9a8e395d5e11f138062d86738ff2
Author: kowther <kowtherh at gmail.com>
Date:   Fri Apr 6 13:36:50 2018 -0600

    tdf#96099: replaced trivial typedef OStringVector
    
    Change-Id: Id6f9fff6b0c4c2c8cd3528d86b58ee39cee47364
    Reviewed-on: https://gerrit.libreoffice.org/52524
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx
index c49cc8938454..507e59349146 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.hxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.hxx
@@ -138,7 +138,6 @@ typedef std::unordered_map<
     ::rtl::ByteSequence,
     css::uno::WeakReference< css::sdbc::XCloseable >,
     HashByteSequence > WeakHashMap;
-typedef std::vector< OString > OStringVector;
 
 
 typedef std::unordered_map
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index 7e84c5fe1612..b9032c7bb5ab 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -201,7 +201,7 @@ PreparedStatement::PreparedStatement(
             }
         }
     }
-    m_vars = OStringVector ( elements );
+    m_vars = std::vector< OString >( elements );
 }
 
 PreparedStatement::~PreparedStatement()
@@ -322,7 +322,7 @@ sal_Bool PreparedStatement::execute( )
 
     OStringBuffer buf( m_stmt.getLength() *2 );
 
-    OStringVector::size_type vars = 0;
+    std::vector< OString >::size_type vars = 0;
     for(OString & str : m_splittedStatement)
     {
         // LEM TODO: instead of this manual mucking with SQL
@@ -654,7 +654,7 @@ void PreparedStatement::setArray(
 void PreparedStatement::clearParameters(  )
 {
     MutexGuard guard(m_xMutex->GetMutex() );
-    m_vars = OStringVector ( m_vars.size() );
+    m_vars = std::vector< OString >( m_vars.size() );
 }
 
 Any PreparedStatement::getWarnings(  )
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx
index 97491bafe964..fb05ce85d409 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx
@@ -83,8 +83,8 @@ private:
     OString m_stmt;
     OString m_executedStatement;
     ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
-    OStringVector m_vars;
-    OStringVector m_splittedStatement;
+    std::vector< OString > m_vars;
+    std::vector< OString > m_splittedStatement;
     bool  m_multipleResultAvailable;
     sal_Int32 m_multipleResultUpdateCount;
     sal_Int32 m_lastOidInserted;
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 6dd1d1d42cba..5a3beca846c0 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -483,7 +483,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data )
         // otherwise, don't
         OUString table, schema;
         std::vector< OUString > sourceTableKeys;
-        OStringVector vec;
+        std::vector< OString > vec;
         tokenizeSQL( cmd, vec );
         OUString sourceTable =
             OStringToOUString(
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index eafda8369cfe..59377fe26324 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -403,7 +403,7 @@ static bool isOperator( char c )
     return ret;
 }
 
-void splitSQL( const OString & sql, OStringVector &vec )
+void splitSQL( const OString & sql, std::vector< OString > &vec )
 {
     int length = sql.getLength();
 
@@ -463,7 +463,7 @@ void splitSQL( const OString & sql, OStringVector &vec )
 
 }
 
-void tokenizeSQL( const OString & sql, OStringVector &vec  )
+void tokenizeSQL( const OString & sql, std::vector< OString > &vec  )
 {
     int length = sql.getLength();
 
@@ -549,7 +549,7 @@ void tokenizeSQL( const OString & sql, OStringVector &vec  )
 
 void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUString *second)
 {
-    OStringVector vec;
+    std::vector< OString > vec;
     tokenizeSQL( OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
     switch (vec.size())
     {
@@ -731,7 +731,7 @@ void fillAttnum2attnameMap(
     }
 }
 
-OString extractSingleTableFromSelect( const OStringVector &vec )
+OString extractSingleTableFromSelect( const std::vector< OString > &vec )
 {
     OString ret;
 
@@ -1065,7 +1065,7 @@ void bufferKey2TableConstraint(
 
 void extractNameValuePairsFromInsert( String2StringMap & map, const OString & lastQuery )
 {
-    OStringVector vec;
+    std::vector< OString > vec;
     tokenizeSQL( lastQuery, vec  );
 
     int nSize = vec.size();
@@ -1091,7 +1091,7 @@ void extractNameValuePairsFromInsert( String2StringMap & map, const OString & la
             tableName = vec[n];
         }
 
-        OStringVector names;
+        std::vector< OString > names;
         n ++;
         if( vec[n].equalsIgnoreAsciiCase( "(" ) )
         {
@@ -1115,7 +1115,7 @@ void extractNameValuePairsFromInsert( String2StringMap & map, const OString & la
             {
                 n +=2;
 //                 printf( "3\n" );
-                for ( OStringVector::size_type i = 0 ; i < names.size() && nSize > n ; i ++ )
+                for (std::vector< OString >::size_type i = 0 ; i < names.size() && nSize > n ; i ++ )
                 {
                     map[names[i]] = vec[n];
                     if( nSize > n+1 && vec[n+1].equalsIgnoreAsciiCase(",") )
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx b/connectivity/source/drivers/postgresql/pq_tools.hxx
index 6fadbbe199fa..9d4e2349fcfb 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -98,10 +98,10 @@ void disposeNoThrow( const css::uno::Reference< css::uno::XInterface > & r );
 void disposeObject( const css::uno::Reference< css::uno::XInterface > & r );
 
 OUString extractTableFromInsert( const OUString & sql );
-OString extractSingleTableFromSelect( const OStringVector &vec );
+OString extractSingleTableFromSelect( const std::vector< OString > &vec );
 
-void tokenizeSQL( const OString & sql, OStringVector &vec  );
-void splitSQL( const OString & sql, OStringVector &vec  );
+void tokenizeSQL( const OString & sql, std::vector< OString > &vec  );
+void splitSQL( const OString & sql, std::vector< OString > &vec  );
 std::vector< sal_Int32 > parseIntArray( const OUString & str );
 /// @throws css::sdbc::SQLException
 std::vector< css::uno::Any > parseArray( const OUString & str );


More information about the Libreoffice-commits mailing list