]> git.lyx.org Git - lyx.git/commitdiff
fix loading of colors bug in FormPreferences
authorAngus Leeming <leeming@lyx.org>
Tue, 23 Jan 2001 13:36:23 +0000 (13:36 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 23 Jan 2001 13:36:23 +0000 (13:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1371 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/forms/.cvsignore
src/frontends/xforms/forms/makefile

index 9280cfb33d0e0b03047c331ff1094f88357eeb43..f1090fdafbb82d6564d6693649edf6e8910f0d22 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * FormPreferences.C (LoadBrowserLyX): convert unsigned short to
+       unsigned char correctly and so fix 2 bugs loading/changing colors.
+
 2001-01-21  Dekel Tsur  <dekelts@tau.ac.il>
 
        * FormRef.C (update): Do not update dialog_->{ref,name,type}
index c92a65177eda9a1a3654122191ecc63aaff9105d..219f606809b2b766a6df886dfd042fdd4c934ae3 100644 (file)
@@ -806,9 +806,9 @@ void FormPreferences::Colors::LoadBrowserLyX()
                // Note that X stores the RGB values in the range 0 - 65535
                // whilst we require them in the range 0 - 255.
                RGBColor col;
-               col.r = static_cast<unsigned char>(xcol.red);
-               col.g = static_cast<unsigned char>(xcol.green);
-               col.b = static_cast<unsigned char>(xcol.blue);
+               col.r = xcol.red   / 256;
+               col.g = xcol.green / 256;
+               col.b = xcol.blue  / 256;
 
                // Create a valid X11 name of the form "#rrggbb" and change the
                // LColor X11name to this. Don't want to trigger a redraw,
index 4e654d87f329cc7638ae7968f4873c2b4e8573ff..f4169bd8d84697ab274407043486aacfc3013d5c 100644 (file)
@@ -1,3 +1,4 @@
+makefile
 *.c
 *.h
 *.C
index 02ef562811438bfb0a1c6244589ceb72d0e20924..f7472e557bec12d48cc80e7d5996e6b32be50b79 100644 (file)
@@ -42,15 +42,14 @@ all:
 test: clean $(OBJS)
 
 updatesrc: test
-       for fil in *.C *.h; \
-               do cmp -s $$fil ../$$fil || mv $$fil ..; \
-       done
+       for fil in *.C *.h; do cmp -s $$fil ../$$fil || mv $$fil ..; done
+       rm -f *.[hHcC] *.bak
 
 .fd.C:
        ${SHELL} ./fdfix.sh $<
 
 clean:
-       rm -f *.[hHcC] *.bak
+       rm -f *.[hHcC] *.bak fdfixc_modified.sed
 
 distclean: clean
        rm -f *.orig *.rej *~