summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-08-31 21:42:24 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-08-31 22:31:32 +0200
commit4c99b8a9de59f3c5280ff2944d9f828822897f4a (patch)
tree3753d944ff63dc74689b60c92a9c0df6df4e3650 /connectivity
parent1007e74d0564c393f88edd4df003e4c9a4524dae (diff)
Replace some lists by vectors (+rename vars)
Change-Id: Iad4e3cc13f7908840ef45a04ea4b551d3b0fc487 Reviewed-on: https://gerrit.libreoffice.org/41771 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/jdbc/JConnection.cxx8
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx8
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.cxx24
-rw-r--r--connectivity/workben/iniParser/main.cxx14
6 files changed, 30 insertions, 30 deletions
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx
index ecd265d3f5dd..60d974079b6a 100644
--- a/connectivity/source/drivers/jdbc/JConnection.cxx
+++ b/connectivity/source/drivers/jdbc/JConnection.cxx
@@ -45,7 +45,7 @@
#include <unotools/confignode.hxx>
#include "strings.hxx"
-#include <list>
+#include <vector>
#include <memory>
using namespace connectivity;
@@ -70,7 +70,7 @@ struct ClassMapEntry {
jweak classObject;
};
-typedef std::list< ClassMapEntry > ClassMap;
+typedef std::vector< ClassMapEntry > ClassMap;
struct ClassMapData {
osl::Mutex mutex;
@@ -177,8 +177,8 @@ bool loadClass(
// JVM that are not easily undone). If the pushed ClassMapEntry is
// not used after all (return false, etc.) it will be pruned on next
// call because its classLoader/classObject are null:
- d->map.push_front( ClassMapEntry( classPath, name ) );
- i = d->map.begin();
+ d->map.push_back( ClassMapEntry( classPath, name ) );
+ i = std::prev(d->map.end());
}
LocalRef< jclass > clClass( environment );
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index ebd6ac016c68..178a2f794636 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -63,7 +63,7 @@ IniParser::IniParser(OUString const & rIniName)
nameValue.sValue = OStringToOUString(
line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
- aSection->lList.push_back(nameValue);
+ aSection->vVector.push_back(nameValue);
}
else
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
index 120f47121915..95ca6d748cf5 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
@@ -24,7 +24,7 @@
#include <osl/process.h>
#include <map>
-#include <list>
+#include <vector>
struct ini_NameValue
{
@@ -32,14 +32,14 @@ struct ini_NameValue
OUString sValue;
};
-typedef std::list<
+typedef std::vector<
ini_NameValue
-> NameValueList;
+> NameValueVector;
struct ini_Section
{
OUString sName;
- NameValueList lList;
+ NameValueVector vVector;
};
typedef std::map<OUString,
ini_Section
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index f3e80833b6f5..ac0cca926bbb 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -85,8 +85,8 @@ namespace connectivity
OUString sIsRelative;
OUString sIsDefault;
- for(NameValueList::iterator itor=aSection->lList.begin();
- itor != aSection->lList.end();
+ for(NameValueVector::iterator itor=aSection->vVector.begin();
+ itor != aSection->vVector.end();
++itor)
{
struct ini_NameValue * aValue = &(*itor);
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index bd2b7e236524..76ac4de02d57 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -34,7 +34,7 @@
*
************************************************************************/
-#include <list>
+#include <vector>
#include <time.h>
#include <string.h>
@@ -196,14 +196,14 @@ Connection::~Connection()
m_settings.logFile = nullptr;
}
}
-typedef std::list< css::uno::Reference< css::sdbc::XCloseable > > CloseableList;
+typedef std::vector< css::uno::Reference< css::sdbc::XCloseable > > CloseableVector;
-typedef std::list< css::uno::Reference< css::lang::XComponent > > DisposeableList;
+typedef std::vector< css::uno::Reference< css::lang::XComponent > > DisposeableVector;
void Connection::close()
{
- CloseableList lst;
- DisposeableList lstDispose;
+ CloseableVector vectorCloseable;
+ DisposeableVector vectorDispose;
{
MutexGuard guard( m_xMutex->GetMutex() );
// silently ignore, if the connection has been closed already
@@ -214,9 +214,9 @@ void Connection::close()
m_settings.pConnection = nullptr;
}
- lstDispose.push_back( Reference< XComponent > ( m_settings.users, UNO_QUERY ) );
- lstDispose.push_back( Reference< XComponent > ( m_settings.tables , UNO_QUERY ) );
- lstDispose.push_back( Reference< XComponent > ( m_meta, UNO_QUERY ) );
+ vectorDispose.push_back( Reference< XComponent > ( m_settings.users, UNO_QUERY ) );
+ vectorDispose.push_back( Reference< XComponent > ( m_settings.tables , UNO_QUERY ) );
+ vectorDispose.push_back( Reference< XComponent > ( m_meta, UNO_QUERY ) );
m_meta.clear();
m_settings.tables.clear();
m_settings.users.clear();
@@ -227,17 +227,17 @@ void Connection::close()
{
Reference< XCloseable > r = ii->second;
if( r.is() )
- lst.push_back( r );
+ vectorCloseable.push_back( r );
}
}
// close all created statements
- for( CloseableList::iterator ii = lst.begin(); ii != lst.end() ; ++ii )
+ for( CloseableVector::iterator ii = vectorCloseable.begin(); ii != vectorCloseable.end() ; ++ii )
ii->get()->close();
// close all created statements
- for( DisposeableList::iterator iiDispose = lstDispose.begin();
- iiDispose != lstDispose.end() ; ++iiDispose )
+ for( DisposeableVector::iterator iiDispose = vectorDispose.begin();
+ iiDispose != vectorDispose.end() ; ++iiDispose )
{
if( iiDispose->is() )
iiDispose->get()->dispose();
diff --git a/connectivity/workben/iniParser/main.cxx b/connectivity/workben/iniParser/main.cxx
index dacc8bae337e..2667d957e605 100644
--- a/connectivity/workben/iniParser/main.cxx
+++ b/connectivity/workben/iniParser/main.cxx
@@ -22,7 +22,7 @@
#include <osl/process.h>
#include <map>
-#include <list>
+#include <vector>
struct ini_NameValue
@@ -39,14 +39,14 @@ struct ini_NameValue
{}
};
-typedef std::list<
+typedef std::vector<
ini_NameValue
-> NameValueList;
+> NameValueVector;
struct ini_Section
{
OUString sName;
- NameValueList lList;
+ NameValueVector vVector;
};
typedef std::map<OUString,
ini_Section
@@ -100,7 +100,7 @@ public:
nameValue.sValue = OStringToOUString(
line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
- aSection->lList.push_back(nameValue);
+ aSection->vVector.push_back(nameValue);
}
else
@@ -137,8 +137,8 @@ public:
for(;iBegin != iEnd;iBegin++)
{
ini_Section *aSection = &(*iBegin).second;
- for(NameValueList::iterator itor=aSection->lList.begin();
- itor != aSection->lList.end();
+ for(NameValueVector::iterator itor=aSection->vVector.begin();
+ itor != aSection->vVector.end();
itor++)
{
struct ini_NameValue * aValue = &(*itor);