summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/xpdf/Parser.cc
authorsandman <sandman>2002-05-23 23:51:52 (UTC)
committer sandman <sandman>2002-05-23 23:51:52 (UTC)
commit2f3bb7b07f833273d966d41813e68bfe8b9d8d76 (patch) (unidiff)
tree00beb1bd9e7f4ba79e22334a0d258269b28f4564 /noncore/unsupported/qpdf/xpdf/Parser.cc
parent6e82b45dd416ceeba78765717b700e853c96a137 (diff)
downloadopie-2f3bb7b07f833273d966d41813e68bfe8b9d8d76.zip
opie-2f3bb7b07f833273d966d41813e68bfe8b9d8d76.tar.gz
opie-2f3bb7b07f833273d966d41813e68bfe8b9d8d76.tar.bz2
Port to xpdf 1.01
Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/Parser.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/xpdf/Parser.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/Parser.cc b/noncore/unsupported/qpdf/xpdf/Parser.cc
index a98753d..4df53c9 100644
--- a/noncore/unsupported/qpdf/xpdf/Parser.cc
+++ b/noncore/unsupported/qpdf/xpdf/Parser.cc
@@ -2,7 +2,7 @@
2// 2//
3// Parser.cc 3// Parser.cc
4// 4//
5// Copyright 1996 Derek B. Noonburg 5// Copyright 1996-2002 Glyph & Cog, LLC
6// 6//
7//======================================================================== 7//========================================================================
8 8
@@ -155,7 +155,7 @@ Object *Parser::getObj(Object *obj) {
155Stream *Parser::makeStream(Object *dict) { 155Stream *Parser::makeStream(Object *dict) {
156 Object obj; 156 Object obj;
157 Stream *str; 157 Stream *str;
158 int pos, endPos, length; 158 Guint pos, endPos, length;
159 159
160 // get stream start position 160 // get stream start position
161 lexer->skipToNextLine(); 161 lexer->skipToNextLine();
@@ -164,7 +164,7 @@ Stream *Parser::makeStream(Object *dict) {
164 // get length 164 // get length
165 dict->dictLookup("Length", &obj); 165 dict->dictLookup("Length", &obj);
166 if (obj.isInt()) { 166 if (obj.isInt()) {
167 length = obj.getInt(); 167 length = (Guint)obj.getInt();
168 obj.free(); 168 obj.free();
169 } else { 169 } else {
170 error(getPos(), "Bad 'Length' attribute in stream"); 170 error(getPos(), "Bad 'Length' attribute in stream");
@@ -173,12 +173,13 @@ Stream *Parser::makeStream(Object *dict) {
173 } 173 }
174 174
175 // check for length in damaged file 175 // check for length in damaged file
176 if ((endPos = xref->getStreamEnd(pos)) >= 0) { 176 if (xref->getStreamEnd(pos, &endPos)) {
177 length = endPos - pos; 177 length = endPos - pos;
178 } 178 }
179 179
180 // make base stream 180 // make base stream
181 str = lexer->getStream()->getBaseStream()->makeSubStream(pos, length, dict); 181 str = lexer->getStream()->getBaseStream()->makeSubStream(pos, gTrue,
182 length, dict);
182 183
183 // get filters 184 // get filters
184 str = str->addFilters(dict); 185 str = str->addFilters(dict);