summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-09-17 16:07:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-17 17:54:05 +0200
commite1e63bc2280f7964930cd6363bfc389226836937 (patch)
treebfe860efe4e695e565815cbe682b288eb14bd3e3 /dbaccess
parentba5b65e21b7e38504d23963ebe265af33cd6ba9e (diff)
Replace some lists by vectors in dbaccess
Change-Id: Ibf75bec826661fcff7d71e9e2f11884e498a299b Reviewed-on: https://gerrit.libreoffice.org/42382 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx15
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx2
-rw-r--r--dbaccess/source/ext/macromigration/migrationlog.cxx4
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx10
-rw-r--r--dbaccess/source/ui/control/RelationControl.cxx5
5 files changed, 20 insertions, 16 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 4d2305a6b9cf..d065fff224a5 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -67,7 +67,7 @@
#include <unotools/confignode.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/sharedunocomponent.hxx>
-#include <list>
+#include <vector>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdb;
@@ -99,16 +99,21 @@ namespace dbaccess
{
private:
Reference< XDesktop2 > m_xDesktop;
- std::list< const ODatabaseModelImpl* > m_aDatabaseDocuments;
+ std::vector< const ODatabaseModelImpl* > m_aDatabaseDocuments;
public:
explicit DatabaseDocumentLoader( const Reference<XComponentContext> & rxContext);
void append(const ODatabaseModelImpl& _rModelImpl )
{
- m_aDatabaseDocuments.push_back(&_rModelImpl);
+ m_aDatabaseDocuments.emplace_back(&_rModelImpl);
}
- void remove(const ODatabaseModelImpl& _rModelImpl) { m_aDatabaseDocuments.remove(&_rModelImpl); }
+
+ void remove(const ODatabaseModelImpl& _rModelImpl)
+ {
+ m_aDatabaseDocuments.erase(std::find(m_aDatabaseDocuments.begin(), m_aDatabaseDocuments.end(), &_rModelImpl));
+ }
+
private:
// XTerminateListener
@@ -134,7 +139,7 @@ namespace dbaccess
void SAL_CALL DatabaseDocumentLoader::queryTermination( const lang::EventObject& /*Event*/ )
{
- std::list< const ODatabaseModelImpl* > aCpy(m_aDatabaseDocuments);
+ std::vector< const ODatabaseModelImpl* > aCpy(m_aDatabaseDocuments);
for( const auto& pCopy : aCpy )
{
try
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index cad3cfb231b1..75b3b4f65189 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1786,7 +1786,7 @@ void ODatabaseDocument::disposing()
// case they will be deleted - if they're C++ implementations, that is :).
// Some of those implementations are offending enough to require the SolarMutex, which
// means we should not release the last reference while our own mutex is locked ...
- std::list< Reference< XInterface > > aKeepAlive;
+ std::vector< Reference< XInterface > > aKeepAlive;
// SYNCHRONIZED ->
::osl::ClearableMutexGuard aGuard( m_aMutex );
diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx
index 65bd539236b8..caa8f5125e0e 100644
--- a/dbaccess/source/ext/macromigration/migrationlog.cxx
+++ b/dbaccess/source/ext/macromigration/migrationlog.cxx
@@ -28,7 +28,7 @@
#include <vector>
#include <map>
-#include <list>
+#include <vector>
#include <algorithm>
namespace dbmm
@@ -73,7 +73,7 @@ namespace dbmm
typedef std::map< DocumentID, DocumentEntry > DocumentLogs;
// ErrorLog
- typedef std::list< MigrationError > ErrorLog;
+ typedef std::vector< MigrationError > ErrorLog;
// MigrationLog_Data
struct MigrationLog_Data
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 70d99d28a3da..03922795454b 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -1261,7 +1261,7 @@ namespace
Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableDispatchInformation( ::sal_Int16 CommandGroup )
{
- std::list< DispatchInformation > aInformationList;
+ std::vector< DispatchInformation > aInformationVector;
DispatchInformation aDispatchInfo;
for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin();
aIter != m_aSupportedFeatures.end();
@@ -1271,13 +1271,13 @@ Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableD
if ( sal_Int16( aIter->second.GroupId ) == CommandGroup )
{
aDispatchInfo = aIter->second;
- aInformationList.push_back( aDispatchInfo );
+ aInformationVector.push_back( aDispatchInfo );
}
}
- Sequence< DispatchInformation > aInformation( aInformationList.size() );
- std::transform( aInformationList.begin(),
- aInformationList.end(),
+ Sequence< DispatchInformation > aInformation( aInformationVector.size() );
+ std::transform( aInformationVector.begin(),
+ aInformationVector.end(),
aInformation.getArray(),
SGI_identity< DispatchInformation >()
);
diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx
index 6214f73aaf43..57a5e79f4064 100644
--- a/dbaccess/source/ui/control/RelationControl.cxx
+++ b/dbaccess/source/ui/control/RelationControl.cxx
@@ -35,8 +35,7 @@
#include "helpids.h"
#include <osl/diagnose.h>
-#include <list>
-using std::list;
+#include <vector>
#include <utility>
using std::pair;
using std::make_pair;
@@ -65,7 +64,7 @@ namespace dbaui
Reference< XPropertySet> m_xSourceDef;
Reference< XPropertySet> m_xDestDef;
enum opcode { DELETE, INSERT, MODIFY };
- typedef list< pair < opcode, pair < OConnectionLineDataVec::size_type, OConnectionLineDataVec::size_type> > > ops_type;
+ typedef std::vector< pair < opcode, pair < OConnectionLineDataVec::size_type, OConnectionLineDataVec::size_type> > > ops_type;
ops_type m_ops;
void fillListBox(const Reference< XPropertySet>& _xDest);