Darren Freeman wrote:
On Fri, 2002-11-01 at 03:44, Rob Lahaye wrote:

Darren Freeman wrote:

I just ran a spellcheck and noticed that when it hit 100% that it
actually has some garbage characters between 100 and %.
Is that Qt or Xforms frontend?
Xforms

If it's Xforms, I'm very much curious, since my Spellcheck
dialog patch went in recently. Since when did you see this
behaviour? I myself cannot reproduce this though.

Just saw it the minute I sent the email. I normally don't run a
spellcheck to 100% so I can't say more than that =)

It's definitely reproducible on my machine as I only have to create a
document with one word and spellcheck it.

I now see that it's not limited to 100% - 0% does it too. I suppose it's
there all the time but I'm in a hurry so I'll do more checking later if
you want.
I still have a patch to FormSpellchecker.C dangling here, which may or may not
solve the problem. It slightly modifies the condition when the slider is updated,
and uses a string constant to construct the label (that's what Darren is
complaining about).

I would appreciate if somebody applies this to CVS.

Regards,
Rob.

Index: src/frontends/xforms/FormSpellchecker.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormSpellchecker.C,v
retrieving revision 1.25
diff -u -r1.25 FormSpellchecker.C
--- src/frontends/xforms/FormSpellchecker.C      2002/10/28 12:53:23     1.25
+++ src/frontends/xforms/FormSpellchecker.C      2002/11/03 05:53:17
@@ -161,15 +161,15 @@
         }

         // update slider with word count and progress
-        double const wordcount = controller().getCount();
         int const progress = controller().getProgress();
-        if (wordcount > 0.0 && progress > 0) {
+        if (progress > 0) {
+                int const wordcount = controller().getCount();
                 double const total = 100.0 * wordcount / progress;
+                string const label = tostr(progress) + " %";

                 fl_set_slider_bounds(dialog_->slider_progress, 0.0, total);
                 fl_set_slider_value(dialog_->slider_progress, wordcount);
-                fl_set_object_label(dialog_->slider_progress,
-                                        (tostr(progress) + " %").c_str());
+                fl_set_object_label(dialog_->slider_progress, label.c_str());
         }

         return ButtonPolicy::SMI_VALID;
@@ -184,6 +184,7 @@
                 string w = controller().getWord();
                 fl_set_input(dialog_->input_replacement, w.c_str());
                 fl_set_object_label(dialog_->text_unknown, w.c_str());
+
                 fl_clear_browser(dialog_->browser_suggestions);
                 while (!(w = controller().getSuggestion()).empty()) {
                         fl_add_browser_line(dialog_->browser_suggestions, w.c_str());


Reply via email to