[poppler] goo/GooString.cc goo/GooString.h

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Dec 27 16:46:02 PST 2008


 goo/GooString.cc |    9 +++++----
 goo/GooString.h  |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 0f10561f3b1c90acc030d973399316bfca5f495e
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Dec 28 01:44:25 2008 +0100

    Fix my last commit, copy&paste is really evil

diff --git a/goo/GooString.cc b/goo/GooString.cc
index 74645aa..3cff060 100644
--- a/goo/GooString.cc
+++ b/goo/GooString.cc
@@ -744,7 +744,7 @@ GBool GooString::hasUnicodeMarker(void)
     return (s[0] & 0xff) == 0xfe && (s[1] & 0xff) == 0xff;
 }
 
-GooString *GooString::sanitizedName(GBool psmode) const
+GooString *GooString::sanitizedName(GBool psmode)
 {
   GooString *name;
   char buf[8];
@@ -758,15 +758,16 @@ GooString *GooString::sanitizedName(GBool psmode) const
     // ghostscript chokes on names that begin with out-of-limits
     // numbers, e.g., 1e4foo is handled correctly (as a name), but
     // 1e999foo generates a limitcheck error
-    c = name->getChar(0);
+    c = getChar(0);
     if (c >= '0' && c <= '9') {
       name->append('f');
     }
   }
 
-  for (i = 0; i < name->getLength(); ++i) {
-    c = name->getChar(i);
+  for (i = 0; i < getLength(); ++i) {
+    c = getChar(i);
     if ((psmode && (c <= (char)0x20 || c >= (char)0x7f)) ||
+	c == ' ' ||
 	c == '(' || c == ')' || c == '<' || c == '>' ||
 	c == '[' || c == ']' || c == '{' || c == '}' ||
 	c == '/' || c == '%') {
diff --git a/goo/GooString.h b/goo/GooString.h
index bd7b1ff..6194555 100644
--- a/goo/GooString.h
+++ b/goo/GooString.h
@@ -142,7 +142,7 @@ public:
   // not contain any ( ) < > [ ] { } / %
   // The postscript mode also has some more strict checks
   // The caller owns the return value
-  GooString *sanitizedName(GBool psmode) const;
+  GooString *sanitizedName(GBool psmode);
 
 private:
   // you can tweak this number for a different speed/memory usage tradeoffs.


More information about the poppler mailing list