Kaydet (Commit) 4c99b8a9 authored tarafından Julien Nabet's avatar Julien Nabet

Replace some lists by vectors (+rename vars)

Change-Id: Iad4e3cc13f7908840ef45a04ea4b551d3b0fc487
Reviewed-on: https://gerrit.libreoffice.org/41771Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 1007e74d
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <unotools/confignode.hxx> #include <unotools/confignode.hxx>
#include "strings.hxx" #include "strings.hxx"
#include <list> #include <vector>
#include <memory> #include <memory>
using namespace connectivity; using namespace connectivity;
...@@ -70,7 +70,7 @@ struct ClassMapEntry { ...@@ -70,7 +70,7 @@ struct ClassMapEntry {
jweak classObject; jweak classObject;
}; };
typedef std::list< ClassMapEntry > ClassMap; typedef std::vector< ClassMapEntry > ClassMap;
struct ClassMapData { struct ClassMapData {
osl::Mutex mutex; osl::Mutex mutex;
...@@ -177,8 +177,8 @@ bool loadClass( ...@@ -177,8 +177,8 @@ bool loadClass(
// JVM that are not easily undone). If the pushed ClassMapEntry is // JVM that are not easily undone). If the pushed ClassMapEntry is
// not used after all (return false, etc.) it will be pruned on next // not used after all (return false, etc.) it will be pruned on next
// call because its classLoader/classObject are null: // call because its classLoader/classObject are null:
d->map.push_front( ClassMapEntry( classPath, name ) ); d->map.push_back( ClassMapEntry( classPath, name ) );
i = d->map.begin(); i = std::prev(d->map.end());
} }
LocalRef< jclass > clClass( environment ); LocalRef< jclass > clClass( environment );
......
...@@ -63,7 +63,7 @@ IniParser::IniParser(OUString const & rIniName) ...@@ -63,7 +63,7 @@ IniParser::IniParser(OUString const & rIniName)
nameValue.sValue = OStringToOUString( nameValue.sValue = OStringToOUString(
line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
aSection->lList.push_back(nameValue); aSection->vVector.push_back(nameValue);
} }
else else
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <osl/process.h> #include <osl/process.h>
#include <map> #include <map>
#include <list> #include <vector>
struct ini_NameValue struct ini_NameValue
{ {
...@@ -32,14 +32,14 @@ struct ini_NameValue ...@@ -32,14 +32,14 @@ struct ini_NameValue
OUString sValue; OUString sValue;
}; };
typedef std::list< typedef std::vector<
ini_NameValue ini_NameValue
> NameValueList; > NameValueVector;
struct ini_Section struct ini_Section
{ {
OUString sName; OUString sName;
NameValueList lList; NameValueVector vVector;
}; };
typedef std::map<OUString, typedef std::map<OUString,
ini_Section ini_Section
......
...@@ -85,8 +85,8 @@ namespace connectivity ...@@ -85,8 +85,8 @@ namespace connectivity
OUString sIsRelative; OUString sIsRelative;
OUString sIsDefault; OUString sIsDefault;
for(NameValueList::iterator itor=aSection->lList.begin(); for(NameValueVector::iterator itor=aSection->vVector.begin();
itor != aSection->lList.end(); itor != aSection->vVector.end();
++itor) ++itor)
{ {
struct ini_NameValue * aValue = &(*itor); struct ini_NameValue * aValue = &(*itor);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* *
************************************************************************/ ************************************************************************/
#include <list> #include <vector>
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
...@@ -196,14 +196,14 @@ Connection::~Connection() ...@@ -196,14 +196,14 @@ Connection::~Connection()
m_settings.logFile = nullptr; 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() void Connection::close()
{ {
CloseableList lst; CloseableVector vectorCloseable;
DisposeableList lstDispose; DisposeableVector vectorDispose;
{ {
MutexGuard guard( m_xMutex->GetMutex() ); MutexGuard guard( m_xMutex->GetMutex() );
// silently ignore, if the connection has been closed already // silently ignore, if the connection has been closed already
...@@ -214,9 +214,9 @@ void Connection::close() ...@@ -214,9 +214,9 @@ void Connection::close()
m_settings.pConnection = nullptr; m_settings.pConnection = nullptr;
} }
lstDispose.push_back( Reference< XComponent > ( m_settings.users, UNO_QUERY ) ); vectorDispose.push_back( Reference< XComponent > ( m_settings.users, UNO_QUERY ) );
lstDispose.push_back( Reference< XComponent > ( m_settings.tables , UNO_QUERY ) ); vectorDispose.push_back( Reference< XComponent > ( m_settings.tables , UNO_QUERY ) );
lstDispose.push_back( Reference< XComponent > ( m_meta, UNO_QUERY ) ); vectorDispose.push_back( Reference< XComponent > ( m_meta, UNO_QUERY ) );
m_meta.clear(); m_meta.clear();
m_settings.tables.clear(); m_settings.tables.clear();
m_settings.users.clear(); m_settings.users.clear();
...@@ -227,17 +227,17 @@ void Connection::close() ...@@ -227,17 +227,17 @@ void Connection::close()
{ {
Reference< XCloseable > r = ii->second; Reference< XCloseable > r = ii->second;
if( r.is() ) if( r.is() )
lst.push_back( r ); vectorCloseable.push_back( r );
} }
} }
// close all created statements // 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(); ii->get()->close();
// close all created statements // close all created statements
for( DisposeableList::iterator iiDispose = lstDispose.begin(); for( DisposeableVector::iterator iiDispose = vectorDispose.begin();
iiDispose != lstDispose.end() ; ++iiDispose ) iiDispose != vectorDispose.end() ; ++iiDispose )
{ {
if( iiDispose->is() ) if( iiDispose->is() )
iiDispose->get()->dispose(); iiDispose->get()->dispose();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <osl/process.h> #include <osl/process.h>
#include <map> #include <map>
#include <list> #include <vector>
struct ini_NameValue struct ini_NameValue
...@@ -39,14 +39,14 @@ struct ini_NameValue ...@@ -39,14 +39,14 @@ struct ini_NameValue
{} {}
}; };
typedef std::list< typedef std::vector<
ini_NameValue ini_NameValue
> NameValueList; > NameValueVector;
struct ini_Section struct ini_Section
{ {
OUString sName; OUString sName;
NameValueList lList; NameValueVector vVector;
}; };
typedef std::map<OUString, typedef std::map<OUString,
ini_Section ini_Section
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
nameValue.sValue = OStringToOUString( nameValue.sValue = OStringToOUString(
line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
aSection->lList.push_back(nameValue); aSection->vVector.push_back(nameValue);
} }
else else
...@@ -137,8 +137,8 @@ public: ...@@ -137,8 +137,8 @@ public:
for(;iBegin != iEnd;iBegin++) for(;iBegin != iEnd;iBegin++)
{ {
ini_Section *aSection = &(*iBegin).second; ini_Section *aSection = &(*iBegin).second;
for(NameValueList::iterator itor=aSection->lList.begin(); for(NameValueVector::iterator itor=aSection->vVector.begin();
itor != aSection->lList.end(); itor != aSection->vVector.end();
itor++) itor++)
{ {
struct ini_NameValue * aValue = &(*itor); struct ini_NameValue * aValue = &(*itor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment