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

Replace list by vector for nodelist var (hwpfilter)

Change-Id: I693d01f63b8bd8b2c78bfd98e1f9310c965f65b2
Reviewed-on: https://gerrit.libreoffice.org/43262Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst af7b62ea
......@@ -613,12 +613,9 @@ void Formula::parse()
if( res ){
makeMathML( res );
}
int count = nodelist.size();
for( i = 0 ; i < count ; i++ ){
const Node *tmpNode = nodelist.front();
nodelist.pop_front();
delete tmpNode;
}
for (const auto &node : nodelist)
delete node;
nodelist.clear();
}
void Formula::trim()
......
......@@ -28,7 +28,7 @@
#define YYMAXDEPTH 0
#endif
#include <list>
#include <vector>
#include <stdlib.h>
#include <string.h>
......@@ -40,7 +40,7 @@ extern "C" {
#include "grammar.h"
}
std::list<Node*> nodelist;
std::vector<Node*> nodelist;
void yyerror(const char *);
......@@ -1191,12 +1191,9 @@ void yyerror(const char * /*err*/)
{
// printf("REALKING ERR[%s]\n",err);
// if error, delete all nodes.
int ncount = nodelist.size();
for( int i = 0 ; i < ncount ; i++){
Node *pNode = nodelist.front();
nodelist.pop_front();
delete pNode;
}
for (const auto &node : nodelist)
delete node;
nodelist.clear();
top = nullptr;
}
......
......@@ -22,7 +22,7 @@
#include <sal/config.h>
#include <list>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <osl/diagnose.h>
......@@ -94,8 +94,7 @@ public:
Node *child;
Node *next;
};
extern std::list<Node *> nodelist;
extern std::vector<Node *> nodelist;
#endif
......
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