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