added comment to endPage()
[swftools.git] / lib / pdf / GFXOutputDev.cc
index a61aebc..27042b8 100644 (file)
@@ -1026,6 +1026,8 @@ void GFXOutputDev::endPage()
        device->endclip(device);
        outer_clip_box = 0;
     }
+    /* notice: we're not fully done yet with this page- there might still be 
+       a few calls to drawLink() yet to come */
 }
 
 #define STROKE_FILL 1
@@ -1812,14 +1814,14 @@ void GFXOutputDev::updateStrokeColor(GfxState *state)
 }
 
 
-gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src, double config_fontquality)
+static gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src, double config_fontquality)
 {
     gfxfont_t*font = (gfxfont_t*)malloc(sizeof(gfxfont_t));
     memset(font, 0, sizeof(gfxfont_t));
 
     font->glyphs = (gfxglyph_t*)malloc(sizeof(gfxglyph_t)*src->num_glyphs);
     memset(font->glyphs, 0, sizeof(gfxglyph_t)*src->num_glyphs);
-    font->id = strdup(getFontID(xpdffont));
+    font->id = 0;
     int t;
     
     double quality = (INTERNAL_FONT_SIZE * 200 / config_fontquality) / src->max_size;
@@ -2175,7 +2177,7 @@ void GFXOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str,
 
          width = realwidth;
          height = realheight;
-         free(pic);
+         delete[] pic;
          pic = pic2;
          
          /* make a black/white palette */
@@ -2197,8 +2199,8 @@ void GFXOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str,
        }
       }
       drawimagelossless(device, pic2, width, height, x1,y1,x2,y2,x3,y3,x4,y4);
-      free(pic2);
-      free(pic);
+      delete[] pic2;
+      delete[] pic;
       delete imgStr;
       if(maskbitmap) free(maskbitmap);
       return;
@@ -2661,7 +2663,7 @@ void GFXOutputDev::clearSoftMask(GfxState *state)
     }
   
     gfxresult_t*mask = states[statepos].softmaskrecording;
-    gfxresult_t*below = this->device->finish(this->device);
+    gfxresult_t*below = this->device->finish(this->device);free(this->device);
     this->device = states[statepos].olddevice;
 
     /* get outline of all objects below the soft mask */