summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-15 21:06:36 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-16 23:01:18 +0100
commit05fc30e38899348fb58548adb7a72e4fa2874d62 (patch)
tree5ce45fea9ead6084456a7db2c56f4cb9705179b0 /xmloff
parent3e1b9212ad4f8d82b6110a525811482a99f6e112 (diff)
Replace some lists by vectors (xmloff)
Change-Id: Ide0270ae0b6a17d7c48c0a9ff7901145e00dca6b Reviewed-on: https://gerrit.libreoffice.org/44792 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/animationimport.cxx10
-rw-r--r--xmloff/source/text/XMLRedlineExport.cxx16
-rw-r--r--xmloff/source/text/XMLRedlineExport.hxx10
3 files changed, 15 insertions, 21 deletions
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 6820c7ba8694..8134fd671499 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -51,7 +51,7 @@
#include <sax/tools/converter.hxx>
-#include <list>
+#include <vector>
#include <o3tl/make_unique.hxx>
@@ -741,7 +741,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax:
Reference< XTransitionFilter > xTransitionFilter( mxNode, UNO_QUERY );
Reference< XIterateContainer > xIter( mxNode, UNO_QUERY );
- std::list< NamedValue > aUserData;
+ std::vector< NamedValue > aUserData;
XMLTokenEnum meAttributeName = XML_TOKEN_INVALID;
OUString aFrom, aBy, aTo, aValues;
bool bHaveXmlId( false );
@@ -1201,10 +1201,8 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax:
{
Sequence< NamedValue > aUnoUserData( nUserDataCount );
NamedValue* pData = aUnoUserData.getArray();
- std::list< NamedValue >::iterator aIter( aUserData.begin() );
- const std::list< NamedValue >::iterator aEnd( aUserData.end() );
- while( aIter != aEnd )
- *pData++ = (*aIter++);
+ for (auto const& item : aUserData)
+ *pData++ = item;
mxNode->setUserData( aUnoUserData );
}
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 557f131aca87..f8bcf62dd228 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -71,11 +71,9 @@ XMLRedlineExport::XMLRedlineExport(SvXMLExport& rExp)
XMLRedlineExport::~XMLRedlineExport()
{
// delete changes lists
- for( ChangesMapType::iterator aIter = aChangeMap.begin();
- aIter != aChangeMap.end();
- ++aIter )
+ for (auto const& change : aChangeMap)
{
- delete aIter->second;
+ delete change.second;
}
aChangeMap.clear();
}
@@ -130,7 +128,7 @@ void XMLRedlineExport::ExportChangesList(
ChangesMapType::iterator aFind = aChangeMap.find(rText);
if (aFind != aChangeMap.end())
{
- ChangesListType* pChangesList = aFind->second;
+ ChangesVectorType* pChangesList = aFind->second;
// export only if changes are found
if (pChangesList->size() > 0)
@@ -141,11 +139,9 @@ void XMLRedlineExport::ExportChangesList(
true, true);
// iterate over changes list
- for( ChangesListType::iterator aIter = pChangesList->begin();
- aIter != pChangesList->end();
- ++aIter )
+ for (auto const& change : *pChangesList)
{
- ExportChangedRegion( *aIter );
+ ExportChangedRegion(change);
}
}
// else: changes list empty -> ignore
@@ -162,7 +158,7 @@ void XMLRedlineExport::SetCurrentXText(
ChangesMapType::iterator aIter = aChangeMap.find(rText);
if (aIter == aChangeMap.end())
{
- ChangesListType* pList = new ChangesListType;
+ ChangesVectorType* pList = new ChangesVectorType;
aChangeMap[rText] = pList;
pCurrentChangesList = pList;
}
diff --git a/xmloff/source/text/XMLRedlineExport.hxx b/xmloff/source/text/XMLRedlineExport.hxx
index c5b234ee67e7..0d7ab3114401 100644
--- a/xmloff/source/text/XMLRedlineExport.hxx
+++ b/xmloff/source/text/XMLRedlineExport.hxx
@@ -24,7 +24,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
-#include <list>
+#include <vector>
#include <map>
class SvXMLExport;
@@ -37,13 +37,13 @@ namespace com { namespace sun { namespace star {
} } }
// store a list of redline properties
-typedef ::std::list<
- css::uno::Reference<css::beans::XPropertySet> > ChangesListType;
+typedef ::std::vector<
+ css::uno::Reference<css::beans::XPropertySet> > ChangesVectorType;
// store a list of redline properties for each XText
typedef ::std::map<
css::uno::Reference< css::text::XText>,
- ChangesListType* > ChangesMapType;
+ ChangesVectorType* > ChangesMapType;
/**
@@ -70,7 +70,7 @@ class XMLRedlineExport
ChangesMapType aChangeMap; /// map of recorded changes
/// list of current changes; is NULL or points to member of aChangeMap
- ChangesListType* pCurrentChangesList;
+ ChangesVectorType* pCurrentChangesList;
public: