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 707061 - Can make calculator window to exit the screen
Can make calculator window to exit the screen
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-29 14:52 UTC by Marie.KOWALCZYK
Modified: 2013-11-12 13:04 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
Replaces '\n' chars by ' ' chars in strings before pasting them in gnome-calcutaor. (1.03 KB, patch)
2013-10-28 14:23 UTC, Kévin THIERRY
committed Details | Review
Removes the wrap feature in the input/display widget. (1.00 KB, patch)
2013-10-29 14:27 UTC, Kévin THIERRY
committed Details | Review

Description Marie.KOWALCZYK 2013-08-29 14:52:00 UTC
User can notice that copying a string with a space and pasting it in calculator will make the calculator window exit the screen in some circumstances. Please note this was tested on ubuntu and it does not have the same problem.

Steps :
1. Boot system
2. Open gedit, type a string, press enter and copy the string with the EOL
3. Open calculator and paste this
4. Paste 15 times, observe calculator exists the screen
5. Reopen calculator and try to press enter to add EOL (end of line)
6. Observe you can't

Expected outcome
You cannot paste EOL in calculator, it gets trimmed

Actual outcome
You can paste EOL in calculator, making the app exit the screen
Comment 1 Kévin THIERRY 2013-10-16 12:38:31 UTC
This bug is still present in gnome-calculator 3.10.0 r1, tested on Fedora 20.
Comment 2 Kévin THIERRY 2013-10-28 14:23:13 UTC
Created attachment 258308 [details] [review]
Replaces '\n' chars by ' ' chars in strings before pasting them in gnome-calcutaor.

This patch prevents '\n' chars from being entered in the calculator by replacing them by ' ' chars before pasting the text.

Note that this patch does not prevent the gnome-calculator window from being longer than the display since it can be reproduced without using the copy/paste feature by entering a long string with spaces. Since the string is very long, gnome-calculator will display it on several lines using some of the spaces as new lines. Eventually, if the string is long enough, gnome-calculator's window will exit the screen.

I see two ways of correcting that :
- add a vertical scroll bar in the input window;
- limit the number of lines.

IMO the first one is better since it doesn't restrict the user from using as many lines as he wants.
Comment 3 Kévin THIERRY 2013-10-29 14:27:53 UTC
Created attachment 258446 [details] [review]
Removes the wrap feature in the input/display widget.

Here is a simple way to correct the bug by removing the wrap feature in the input widget.

This patch removes the possibility to get a more-than-one-line expression. If this was a feature then a better way to correct this bug would be to add a vertical scroll bar when a defined number of lines is reached.

Note that this patch does not contain the modification made in the previous patch since they both correct a different problem.
Comment 4 PioneerAxon 2013-11-09 21:22:47 UTC
Review of attachment 258308 [details] [review]:

Committed.

Thank you for the patch. :)
Comment 5 PioneerAxon 2013-11-09 21:23:54 UTC
Review of attachment 258446 [details] [review]:

Committed.
Had to update the patch, as it wouldn't rebase properly.

Thank you for the patch. :)
Comment 6 Kévin THIERRY 2013-11-12 13:04:36 UTC
commits:
76e7f0a65c76cc9d88679f8a2b24bf631ca97abb
a09ebdba22d3c19167f39e518f4995e15a490b09