[poppler] 2 commits - poppler/FileSpec.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Wed Jul 8 11:13:55 PDT 2009


 poppler/FileSpec.cc |   27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

New commits:
commit f8d93eae3c7b9388feabac71f2380d0b42a855e7
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Wed Jul 8 20:14:35 2009 +0200

    Lookup UF and F entries before Unix, MAC and DOS in getFileSpec

diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index 7bc3795..a788cd8 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -32,27 +32,27 @@ GBool getFileSpecName (Object *fileSpec, Object *fileName)
   }
   
   if (fileSpec->isDict()) {
-    fileSpec->dictLookup("DOS", fileName);
+    fileSpec->dictLookup("UF", fileName);
     if (fileName->isString()) {
       return gTrue;
     }
     fileName->free();
-    fileSpec->dictLookup("Mac", fileName);
+    fileSpec->dictLookup("F", fileName);
     if (fileName->isString()) {
       return gTrue;
     }
     fileName->free();
-    fileSpec->dictLookup("Unix", fileName);
+    fileSpec->dictLookup("DOS", fileName);
     if (fileName->isString()) {
       return gTrue;
     }
     fileName->free();
-    fileSpec->dictLookup("UF", fileName);
+    fileSpec->dictLookup("Mac", fileName);
     if (fileName->isString()) {
       return gTrue;
     }
     fileName->free();
-    fileSpec->dictLookup("F", fileName);
+    fileSpec->dictLookup("Unix", fileName);
     if (fileName->isString()) {
       return gTrue;
     }
@@ -69,16 +69,16 @@ GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName)
   }
 
   if (fileSpec->isDict()) {
+    if (!fileSpec->dictLookup("UF", fileName)->isString ()) {
+      fileName->free();
+      if (!fileSpec->dictLookup("F", fileName)->isString ()) {
+        fileName->free();
 #ifdef WIN32
-    fileSpec->dictLookup("DOS", fileName);
+	char *platform = "DOS";
 #else
-    fileSpec->dictLookup("Unix", fileName);
+	char *platform = "Unix";
 #endif
-    if (!fileName->isString()) {
-      fileName->free();
-      if (!fileSpec->dictLookup("UF", fileName)->isString ()) {
-        fileName->free();
-        if (!fileSpec->dictLookup("F", fileName)->isString ()) {
+	if (!fileSpec->dictLookup(platform, fileName)->isString ()) {
 	  fileName->free();
 	  error(-1, "Illegal file spec");
 	  return gFalse;
commit 767c534f5fdf6ccbccfd85a0086d72c215c278f1
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Wed Jul 8 19:13:54 2009 +0200

    Use UF entry when present in dict in getFileSpecName() too

diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index 9ec4857..7bc3795 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -47,6 +47,11 @@ GBool getFileSpecName (Object *fileSpec, Object *fileName)
       return gTrue;
     }
     fileName->free();
+    fileSpec->dictLookup("UF", fileName);
+    if (fileName->isString()) {
+      return gTrue;
+    }
+    fileName->free();
     fileSpec->dictLookup("F", fileName);
     if (fileName->isString()) {
       return gTrue;


More information about the poppler mailing list