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 @@
#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 );
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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();
......
......@@ -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);
......
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