]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormPreferences.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / xforms / FormPreferences.C
index c3273f57fa1f226949045d9470f7b9594b26c47f..e03fed575347184260f7e18f234c44daa438e5df 100644 (file)
@@ -342,10 +342,10 @@ void FormPreferences::feedback(FL_OBJECT * ob)
                str = spellchecker_.feedback(ob);
        }
 
-       str = formatted(str, dialog_->text_warning->w-10,
+       str = formatted(_(str), dialog_->text_warning->w-10,
                        FL_SMALL_SIZE, FL_NORMAL_STYLE);
 
-       fl_set_object_label(dialog_->text_warning, _(str.c_str()));
+       fl_set_object_label(dialog_->text_warning, str.c_str());
        fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
 }
 
@@ -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,
@@ -1185,7 +1185,7 @@ bool FormPreferences::Converters::Input()
 string const FormPreferences::Converters::GetFrom() const
 {
        int const i = fl_get_choice(dialog_->choice_from);
-       if (i > 0)
+       if (i > 0 && i <= local_formats.size())
                return local_formats.Get(i-1).name();
        else {
                lyxerr << "FormPreferences::Converters::GetFrom: No choice!"
@@ -1198,7 +1198,7 @@ string const FormPreferences::Converters::GetFrom() const
 string const FormPreferences::Converters::GetTo() const
 {
        int const i = fl_get_choice(dialog_->choice_to);
-       if (i > 0)
+       if (i > 0 && i <= local_formats.size())
                return local_formats.Get(i-1).name();
        else {
                lyxerr << "FormPreferences::Converters::GetTo: No choice!"
@@ -3005,11 +3005,11 @@ void FormPreferences::printWarning(string const & warning)
 {
        warningPosted = true;
 
-       string str = N_("WARNING!") + string(" ") + warning;
+       string str = _("WARNING!") + string(" ") + warning;
        str = formatted(str, dialog_->text_warning->w-10,
                         FL_SMALL_SIZE, FL_NORMAL_STYLE);
 
-       fl_set_object_label(dialog_->text_warning, _(str.c_str()));
+       fl_set_object_label(dialog_->text_warning, str.c_str());
        fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
 }