removed parameter_t
[swftools.git] / lib / pdf / xpdf-changes.patch
index d2459d5..47720ae 100644 (file)
@@ -134,6 +134,17 @@ diff -u -r1.10 -r1.12
                                           sizeof(GfxColorComp));
        for (i = 0; i <= maxPixel; ++i) {
        lookup[k][i] = dblToCol(decodeLow[k] +
+@@ -3754,7 +3769,10 @@
+ }
+ void GfxState::setPath(GfxPath *pathA) {
++  if(pathA) {
++      if(path)
+   delete path;
++  }
+   path = pathA;
+ }
+
 Index: GlobalParams.cc
 ===================================================================
 RCS file: /home/kramm/cvs/swftools.cache.cvsroot/swftools.cache/pdf2swf/xpdf/GlobalParams.cc,v
@@ -172,16 +183,26 @@ diff -u -r1.4 -r1.7
    line = 1;
    while (getLine(buf, sizeof(buf) - 1, f)) {
  
-@@ -659,6 +682,32 @@
-   }
+@@ -1142,6 +1165,42 @@
+   deleteGList(tokens, GString);
  }
  
++static char is_absolute(char*filename)
++{
++    int l = strlen(filename);
++    if(filename[0] == '/' || filename[0] == '\\') 
++      return 1;
++    if(l>2 && filename[1]==':' && (filename[2]=='\\' || filename[2]=='/'))
++      return 1;
++    return 0;
++}
++
 +static GString* qualify_filename(GString*path, GString*filename)
 +{
 +  GString*fullpath = 0;
 +  char*prefix = "/usr/local/share/xpdf/";
 +
-+  if (filename->getChar(0) != '\\' && filename->getChar(0) != '/') {
++  if (!is_absolute(filename->getCString())) {
 +    /* relative path */
 +    fullpath = path->copy();
 +    fullpath->append(filename);
@@ -205,15 +226,20 @@ diff -u -r1.4 -r1.7
  void GlobalParams::parseNameToUnicode(GList *tokens, GString *fileName,
                                         int line) {
    GString *name;
-@@ -673,7 +722,7 @@
+@@ -1156,10 +1215,10 @@
          fileName->getCString(), line);
      return;
    }
 -  name = (GString *)tokens->get(1);
 +  name = qualify_filename(this->path, (GString *)tokens->get(1));
    if (!(f = fopen(name->getCString(), "r"))) {
-     error(-1, "Couldn't open 'nameToUnicode' file '%s'",
-         name->getCString());
+-    error(-1, "Couldn't open 'nameToUnicode' file '%s'",
+-        name->getCString());
++    error(-1, "Couldn't open 'nameToUnicode' file '%s' using path '%s'",
++        name->getCString(), path->getCString());
+     return;
+   }
+   line2 = 1;
 @@ -705,10 +754,12 @@
    }
    collection = (GString *)tokens->get(1);
@@ -821,3 +847,22 @@ diff -u -r1.5 -r1.6
  
    void setBaseDir(char *dir);
    void setupBaseFonts(char *dir);
+--- xpdf/SplashOutputDev.h.orig        2007-10-21 17:43:29.000000000 +0200
++++ xpdf/SplashOutputDev.h     2007-11-19 10:07:27.000000000 +0100
+@@ -197,6 +197,8 @@
+ #endif
+   void doUpdateFont(GfxState *state);
++  
++  SplashPath *convertPath(GfxState *state, GfxPath *path);
+ private:
+   void setupScreenParams(double hDPI, double vDPI);
+@@ -205,7 +207,6 @@
+ #else
+   SplashPattern *getColor(GfxGray gray, GfxRGB *rgb);
+ #endif
+-  SplashPath *convertPath(GfxState *state, GfxPath *path);
+   void drawType3Glyph(T3FontCache *t3Font,
+                     T3FontCacheTag *tag, Guchar *data);
+   static GBool imageMaskSrc(void *data, SplashColorPtr line);