From 2f2c7c3dadda7a20c8d49e6ea044887a94d2d46e Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 2 Dec 2017 20:14:52 +0100 Subject: Replace list by vector in XMLEventImportHelper (xmloff) Change-Id: I5c8ac0a1cad628bd80550d7d0f5cec46d0f66dae Reviewed-on: https://gerrit.libreoffice.org/45724 Tested-by: Jenkins Reviewed-by: Julien Nabet --- xmloff/inc/XMLEventImportHelper.hxx | 4 ++-- xmloff/source/script/XMLEventImportHelper.cxx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'xmloff') diff --git a/xmloff/inc/XMLEventImportHelper.hxx b/xmloff/inc/XMLEventImportHelper.hxx index 23b7358834f6..0ad45da644ca 100644 --- a/xmloff/inc/XMLEventImportHelper.hxx +++ b/xmloff/inc/XMLEventImportHelper.hxx @@ -24,7 +24,7 @@ #include #include -#include +#include namespace com { namespace sun { namespace star { @@ -60,7 +60,7 @@ class XMLEventImportHelper NameMap* pEventNameMap; /// stack of previous aEventNameMap - std::list< NameMap* > aEventNameMapList; + std::vector< NameMap* > aEventNameMapVector; public: XMLEventImportHelper(); diff --git a/xmloff/source/script/XMLEventImportHelper.cxx b/xmloff/source/script/XMLEventImportHelper.cxx index 7210c339ebbd..84bcd8eb1d16 100644 --- a/xmloff/source/script/XMLEventImportHelper.cxx +++ b/xmloff/source/script/XMLEventImportHelper.cxx @@ -32,7 +32,7 @@ using ::com::sun::star::uno::Sequence; XMLEventImportHelper::XMLEventImportHelper() : aFactoryMap(), pEventNameMap(new NameMap), - aEventNameMapList() + aEventNameMapVector() { } @@ -91,20 +91,20 @@ void XMLEventImportHelper::AddTranslationTable( void XMLEventImportHelper::PushTranslationTable() { // save old map and install new one - aEventNameMapList.push_back(pEventNameMap); + aEventNameMapVector.push_back(pEventNameMap); pEventNameMap = new NameMap; } void XMLEventImportHelper::PopTranslationTable() { - DBG_ASSERT(aEventNameMapList.size() > 0, + DBG_ASSERT(aEventNameMapVector.size() > 0, "no translation tables left to pop"); - if ( !aEventNameMapList.empty() ) + if ( !aEventNameMapVector.empty() ) { // delete current and install old map delete pEventNameMap; - pEventNameMap = aEventNameMapList.back(); - aEventNameMapList.pop_back(); + pEventNameMap = aEventNameMapVector.back(); + aEventNameMapVector.pop_back(); } } -- cgit