]> www.fi.muni.cz Git - evince.git/commitdiff
[dvi] Test glyph->data for MDVI_GLYPH_EMPTY
authorMarek Kasik <mkasik@redhat.com>
Tue, 3 Aug 2010 07:27:42 +0000 (09:27 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 3 Aug 2010 07:47:40 +0000 (09:47 +0200)
MDVI marks empty glyphs by setting its data pointer to 0x1
(MDVI_GLYPH_EMPTY constant) but it doesn't check for the
emptiness sometimes. Fixes bug #600552.

backend/dvi/cairo-device.c
backend/dvi/mdvi-lib/font.c

index 9a8ca0ea2fae4f8d679eaec972c0adb4952dd51c..47425cad7e0be21a503a449c8fff618f525c35bb 100644 (file)
@@ -55,7 +55,9 @@ dvi_cairo_draw_glyph (DviContext  *dvi,
 
        glyph = &ch->grey;
 
-       isbox = (glyph->data == NULL || (dvi->params.flags & MDVI_PARAM_CHARBOXES));
+       isbox = (glyph->data == NULL ||
+                (dvi->params.flags & MDVI_PARAM_CHARBOXES) ||
+                MDVI_GLYPH_ISEMPTY (glyph->data));
 
        x = - glyph->x + x0 + cairo_device->xmargin;
        y = - glyph->y + y0 + cairo_device->ymargin;
index 2d488d625d8847e6bb447fdb8bf1bb57dda4d6f3..2f655df0b70b7684fa91d8eaa0bbdc1fb587ed93 100644 (file)
@@ -379,10 +379,12 @@ again:
                return ch;
        } else if(MDVI_ENABLED(dvi, MDVI_PARAM_ANTIALIASED)) {
                if(ch->grey.data && 
+                  !MDVI_GLYPH_ISEMPTY(ch->grey.data) &&
                   ch->fg == dvi->curr_fg && 
                   ch->bg == dvi->curr_bg)
                        return ch;
-               if(ch->grey.data) {
+               if(ch->grey.data &&
+                  !MDVI_GLYPH_ISEMPTY(ch->grey.data)) {
                        if(dvi->device.free_image)
                                dvi->device.free_image(ch->grey.data);
                        ch->grey.data = NULL;