]> git.lyx.org Git - lyx.git/blobdiff - src/ColorHandler.C
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / ColorHandler.C
index 48aea3a9ca8aa1eedacd34128d2ef061adb3cf27..43ec7f4606d403c71b866520133f08cbd3c9aa69 100644 (file)
 #include "debug.h"
 
 #include "ColorHandler.h"
+#include "LColor.h"
 #include "gettext.h"
 
 using std::endl;
 
 LyXColorHandler::LyXColorHandler() 
 {
-       display = fl_display;
+       display = fl_get_display();
        drawable = XCreatePixmap(display, fl_root, 10, 10,
                                 fl_get_visual_depth());
        
@@ -105,7 +106,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
 
                XColor * cmap = new XColor[vi->map_entries];
 
-               for(int i = 0; i < vi->map_entries; ++i) {
+               for (int i = 0; i < vi->map_entries; ++i) {
                        cmap[i].pixel = i;
                }
                XQueryColors(display, colormap, cmap, vi->map_entries);
@@ -114,7 +115,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
                int closest_pixel = 0;
                double closest_distance = 1e20; // we want to minimize this
                double distance = 0;
-               for(int t = 0; t < vi->map_entries; ++t) {
+               for (int t = 0; t < vi->map_entries; ++t) {
                        // The Euclidean distance between two points in 
                        // a three-dimensional space, the RGB color-cube,
                        // is used as the distance measurement between two
@@ -195,6 +196,7 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
                          GCCapStyle | GCJoinStyle | GCFunction, &val);
 }
 
+
 // update GC cache after color redefinition
 void LyXColorHandler::updateColor (LColor::color c)
 {