5
5
// This file is licensed under the GPLv2 or later
7
7
// Copyright 2010, 2012 Hib Eris <hib@hiberis.nl>
8
// Copyright 2010, 2011, 2013, 2014, 2016 Albert Astals Cid <aacid@kde.org>
8
// Copyright 2010, 2011, 2013, 2014, 2016, 2017 Albert Astals Cid <aacid@kde.org>
9
9
// Copyright 2010, 2013 Pino Toscano <pino@kde.org>
10
10
// Copyright 2013 Adrian Johnson <ajohnson@redneon.com>
11
11
// Copyright 2014 Fabio D'Urso <fabiodurso@hotmail.it>
181
181
hintsLength2 = linearization->getHintsLength2();
186
185
int bufLength = hintsLength + hintsLength2;
188
187
std::vector<char> buf(bufLength);
189
188
char *p = &buf[0];
192
Stream *s = str->makeSubStream(hintsOffset, gFalse, hintsLength, &obj);
190
Stream *s = str->makeSubStream(hintsOffset, gFalse, hintsLength, Object(objNull));
194
192
for (Guint i=0; i < hintsLength; i++) { *p++ = s->getChar(); }
197
195
if (hintsOffset2 && hintsLength2) {
199
s = str->makeSubStream(hintsOffset2, gFalse, hintsLength2, &obj);
196
s = str->makeSubStream(hintsOffset2, gFalse, hintsLength2, Object(objNull));
201
198
for (Guint i=0; i < hintsLength2; i++) { *p++ = s->getChar(); }
206
MemStream *memStream = new MemStream (&buf[0], 0, bufLength, &obj);
202
MemStream *memStream = new MemStream (&buf[0], 0, bufLength, Object(objNull));
209
204
parser = new Parser(xref, new Lexer(xref, memStream), gTrue);
212
if (parser->getObj(&obj)->isInt() &&
213
(num = obj.getInt(), obj.free(), parser->getObj(&obj)->isInt()) &&
214
(gen = obj.getInt(), obj.free(), parser->getObj(&obj)->isCmd("obj")) &&
215
(obj.free(), parser->getObj(&obj, gFalse,
208
if ((obj = parser->getObj(), obj.isInt()) &&
209
(num = obj.getInt(), obj = parser->getObj(), obj.isInt()) &&
210
(gen = obj.getInt(), obj = parser->getObj(), obj.isCmd("obj")) &&
211
(obj = parser->getObj(gFalse,
216
212
secHdlr ? secHdlr->getFileKey() : (Guchar *)NULL,
217
213
secHdlr ? secHdlr->getEncAlgorithm() : cryptRC4,
218
214
secHdlr ? secHdlr->getFileKeyLength() : 0,
219
num, gen, 0, gTrue)->isStream())) {
215
num, gen, 0, gTrue), obj.isStream())) {
220
216
Stream *hintsStream = obj.getStream();
221
217
Dict *hintsDict = obj.streamGetDict();