After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 490701 - base radio buttons initially fail
base radio buttons initially fail
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.21.x
Other Linux
: Normal normal
: ---
Assigned To: Sami Pietilä
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-27 02:26 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2007-10-28 20:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Patch from Sami to fix the problem (thanks). (963 bytes, patch)
2007-10-28 19:43 UTC, Rich Burridge
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2007-10-27 02:26:58 UTC
1. Launch gcalctool and switch to the scientific calculator.
2. Select the Bin radio button, then type "10".
3. Select the Dec radio button.

Expected results: 2 would be displayed.
Actual results: The display doesn't change.

1. Launch gcalctool and switch to the scientific calculator.
2. Select the Hex radio button, then type "a".
3. Selec the Dec radio button.

Expected results: 10 would be displayed.
Actual results: "No sane value to convert" error.

Possible regression of the fix for bug #485918? (The problem doesn't exist in revision 1754, but does beginning with r1756.)
Comment 1 Rich Burridge 2007-10-27 16:40:47 UTC
I'm not seeing the "No sane value to convert" at least not with
just doing the three steps above, but I do see that when you
press the Dec radio button, the display is not being converted
to 2. At least in arithmetic precedence mode. It seems to work
just fine in left-to-right precedence mode.
Comment 2 Joanmarie Diggs (IRC: joanie) 2007-10-27 19:57:41 UTC
Did you try it before or after Robert's latest patch for bug #485919?

Since applying that patch, I'm having a much harder time reproducing the "No sane value to convert" error.  I've gotten it a few times and am trying to find new, reliable steps to reproduce it.  On my laptop, where I have the latest trunk sans Robert's patch, I can still reproduce it reliably.
Comment 3 Joanmarie Diggs (IRC: joanie) 2007-10-27 20:10:09 UTC
Oh shoot, scratch what I just said.  I had switched to left-to-right precedence to test something else and then forgot I had done so.  In arithmetic precedence I can reliably reproduce it still.  :-( Sorry about that!

What I have noticed, patch or no patch, is that eventually the issue goes away -- and once it's gone, you have to quit and start over to get it to reappear.  The following steps always work for me.  (Some are needed per se, and using the mouse should be equally effective, but this get us both on the same page).

1. Launch gcalctool, switch to Basic mode, then quit.
2. Re-launch gcalctool.
3. Press Control S for Scientific mode.
4. Press Alt X for Hex.
5. Press a (for the digit A)
6. Press Alt D for Decimal.
Comment 4 Rich Burridge 2007-10-27 23:12:06 UTC
Sami, could you take a look at this one please?

The problem is with the code in the exprs case statement
in the do_base() routine in functions.c. In particular with:

...
        } else if (!v->ghost_zero) {
            mpstr(MP, e->ans);
            exp_replace("Ans");
            make_registers();
        }
...

Work from what is currently in SVN trunk (i.e. without the
last Glade patch for keyboard accelerators).
Comment 5 Rich Burridge 2007-10-28 19:43:21 UTC
Created attachment 98045 [details] [review]
Patch from Sami to fix the problem (thanks).

This seems to work for me. Joanie, does this fix the
problems you were seeing? If so, I'll commit it and
get it in for the GNOME 2.21.1 gcalctool tarball.
Comment 6 Joanmarie Diggs (IRC: joanie) 2007-10-28 19:56:32 UTC
Seems to, yes.  Thanks.
Comment 7 Rich Burridge 2007-10-28 20:07:03 UTC
Thanks! Patch committed. Closing as FIXED.