summaryrefslogtreecommitdiff
path: root/poppler/PDFDoc.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2011-05-28 17:32:02 +0100
committerAlbert Astals Cid <aacid@kde.org>2011-05-28 17:32:02 +0100
commit66c7d0199b45bc7c81c88a9989c9515398d30d43 (patch)
treec736128143d48cd16e92354562841fce88a3d164 /poppler/PDFDoc.cc
parent450934619a1c5b2a58f65649f567274af8d24ea7 (diff)
No need to check for NULL
We probably need to free obj4 but i don't have the stamina to properly test it
Diffstat (limited to 'poppler/PDFDoc.cc')
-rw-r--r--poppler/PDFDoc.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index adbaebea..a5d57f6e 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -14,7 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@frogmouth.net>
-// Copyright (C) 2005, 2007-2009 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2005, 2007-2009, 2011 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008 Julien Rebetez <julienr@svn.gnome.org>
// Copyright (C) 2008, 2010 Pino Toscano <pino@kde.org>
// Copyright (C) 2008, 2010, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
@@ -989,17 +989,16 @@ void PDFDoc::writeTrailer (Guint uxrefOffset, int uxrefSize, OutStream* outStr,
if (incrUpdate) {
//only update the second part of the array
- if(xref->getTrailerDict()->getDict()->lookup("ID", &obj4) != NULL) {
- if (!obj4.isArray()) {
- error(-1, "PDFDoc::writeTrailer original file's ID entry isn't an array. Trying to continue");
- } else {
- //Get the first part of the ID
- obj4.arrayGet(0,&obj3);
+ xref->getTrailerDict()->getDict()->lookup("ID", &obj4);
+ if (!obj4.isArray()) {
+ error(-1, "PDFDoc::writeTrailer original file's ID entry isn't an array. Trying to continue");
+ } else {
+ //Get the first part of the ID
+ obj4.arrayGet(0,&obj3);
- obj2.arrayAdd(&obj3);
- obj2.arrayAdd(&obj1);
- trailerDict->set("ID", &obj2);
- }
+ obj2.arrayAdd(&obj3);
+ obj2.arrayAdd(&obj1);
+ trailerDict->set("ID", &obj2);
}
} else {
//new file => same values for the two identifiers