]> git.lyx.org Git - lyx.git/blobdiff - src/bmtable.c
Hopefully fix the problem with stateText() in lyxfont.C
[lyx.git] / src / bmtable.c
index 9d97965ddb5b445870e930f58ac84bdcb17a0aeb..df5878d35b7104a00f00503d7dd7d99e6c8c2c60 100644 (file)
@@ -68,7 +68,8 @@ FL_OBJECT *fl_add_bmtable(int type, FL_Coord x, FL_Coord y,
 }
 
 
-static void draw_bitmaptable(FL_OBJECT *ob)
+static
+void draw_bitmaptable(FL_OBJECT *ob)
 {
        int i, j, lx;
        FL_Coord mx, my;
@@ -253,15 +254,9 @@ void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
                        char ** pdata)
 {
        BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
-       extern Colormap color_map;
        if (sp) {
                Pixmap dummy_shapemask = 0;
-#if 0
-               // I can't see why this initalization is needed. (Lgb)
-               XpmAttributes dumb_attributes = {0};
-#else
-               XpmAttributes dumb_attributes;
-#endif
+               XpmAttributes dumb_attributes = { 0 };
                sp->nx = nx;
                sp->ny = ny; 
                sp->bx = FL_abs(ob->bw);
@@ -271,7 +266,7 @@ void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
                sp->i = -1;
                sp->maxi = sp->nx * sp->ny;
                sp->bdata = 0;
-               dumb_attributes.colormap = color_map;
+               dumb_attributes.colormap = fl_state[fl_get_vclass()].colormap;
                dumb_attributes.closeness = 30000;
                dumb_attributes.valuemask = XpmColormap | XpmCloseness;
                if (XCreatePixmapFromData(fl_display, fl_winget(), pdata,
@@ -284,7 +279,6 @@ void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
                                XFreePixmap(fl_display, dummy_shapemask);
                        }
                }
-               XFlush(fl_display);
        }
 }
 
@@ -320,15 +314,11 @@ void fl_set_bmtable_file(FL_OBJECT * ob, int nx, int ny, char const * filename)
 
 void fl_set_bmtable_pixmap_file(FL_OBJECT *ob, int nx, int ny, char const *filename)
 {      
-       extern Colormap color_map;
+  //extern Colormap color_map;
        BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
        if (sp) {
                Pixmap dummy_shapemask = 0;
-#if 0
-               XpmAttributes dumb_attributes = {0};
-#else
-               XpmAttributes dumb_attributes;
-#endif
+               XpmAttributes dumb_attributes = { 0 };
                sp->nx = nx;
                sp->ny = ny; 
                sp->bx = FL_abs(ob->bw);
@@ -339,7 +329,7 @@ void fl_set_bmtable_pixmap_file(FL_OBJECT *ob, int nx, int ny, char const *filen
                sp->maxi = sp->nx * sp->ny;
                sp->bdata = 0;
 
-               dumb_attributes.colormap = color_map;
+               dumb_attributes.colormap = fl_state[fl_get_vclass()].colormap;
                dumb_attributes.closeness = 30000;
                dumb_attributes.valuemask = XpmColormap | XpmCloseness;
    
@@ -353,7 +343,7 @@ void fl_set_bmtable_pixmap_file(FL_OBJECT *ob, int nx, int ny, char const *filen
                                XFreePixmap(fl_display, dummy_shapemask);
                        }
                }
-               XFlush(fl_display);
+               //XFlush(fl_display);
        }
 }