Commit 3c1ed68b authored by Albert Astals Cid's avatar Albert Astals Cid

* poppler/Lexer.cc:

        * poppler/Lexer.h: Patch to fix regression introduced by optimizations
        in bugzilla issue 7808
parent 67240883
2007-01-31 Albert Astals Cid <aacid@kde.org>
* poppler/Lexer.cc:
* poppler/Lexer.h: Patch to fix regression introduced by optimizations
in bugzilla issue 7808
2007-01-31 Albert Astals Cid <aacid@kde.org>
* qt4/src/poppler-page.cc:
......
......@@ -92,7 +92,7 @@ Lexer::~Lexer() {
}
}
int inline Lexer::getChar() {
int Lexer::getChar(GBool comesFromLook) {
int c;
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
......@@ -103,23 +103,33 @@ int inline Lexer::getChar() {
c = EOF;
while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
curStr.streamClose();
curStr.free();
++strPtr;
if (strPtr < streams->getLength()) {
streams->get(strPtr, &curStr);
curStr.streamReset();
if (comesFromLook == gTrue) {
return EOF;
} else {
curStr.streamClose();
curStr.free();
++strPtr;
if (strPtr < streams->getLength()) {
streams->get(strPtr, &curStr);
curStr.streamReset();
}
}
}
return c;
}
int inline Lexer::lookChar() {
int Lexer::lookChar() {
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
return lookCharLastValueCached;
}
lookCharLastValueCached = getChar();
return lookCharLastValueCached;
lookCharLastValueCached = getChar(gTrue);
if (lookCharLastValueCached == EOF) {
lookCharLastValueCached = LOOK_VALUE_NOT_CACHED;
return EOF;
} else {
return lookCharLastValueCached;
}
}
Object *Lexer::getObj(Object *obj, int objNum) {
......
......@@ -75,7 +75,7 @@ public:
private:
int getChar();
int getChar(GBool comesFromLook = gFalse);
int lookChar();
Array *streams; // array of input streams
......
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