[poppler] poppler/PDFDoc.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat May 28 09:32:46 PDT 2011


 poppler/PDFDoc.cc |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 66c7d0199b45bc7c81c88a9989c9515398d30d43
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat May 28 17:32:02 2011 +0100

    No need to check for NULL
    
    We probably need to free obj4 but i don't have the stamina to properly test it

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index adbaebe..a5d57f6 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 at frogmouth.net>
-// Copyright (C) 2005, 2007-2009 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2007-2009, 2011 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2008 Julien Rebetez <julienr at svn.gnome.org>
 // Copyright (C) 2008, 2010 Pino Toscano <pino at kde.org>
 // Copyright (C) 2008, 2010, 2011 Carlos Garcia Campos <carlosgc at 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


More information about the poppler mailing list