[inx] min/max float values ignored with locale using comma as decimal separator

Bug #647744 reported by su_v
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
jazzynico

Bug Description

Follow-up to Bug #442642 “Inkscape crashes on Effects: render: grid without default”

Reported on #inkscape irc channel:
Miraceti wrote:
> I have noticed a bug in 0.47 and 0.48. When running
> Extension->Render->Grid, it is possible to enter horizontal
> and/or vertical spaces = 0 which causes 100% CPU usage in
> apparently neverending loop.

> Well, experiencing problems with small values could be unpleasant
> but zero should not definitely be tried to render at all.

> Division by zero is much worse than just consuming a lot of memory.

> I guess, zero should be filtered out already on UI level.

The lower limit to '0.1' doesn't seem to be in effect with certain locale setting (LC_NUMERIC): a comma as decimal separator apparently allows to enter '0,0' into the dialog:

Reported on irc by Miraceti with
Linux jiri1 2.6.35-gentoo-r4 #1 Sat Sep 4 13:26:57 EEST 2010 i686 AMD Athlon(tm) XP 1800+ AuthenticAMD GNU/Linux
LC_NUMERIC=cs_CZ.UTF-8
gentoo package media-gfx/inkscape-0.48.0 (marked unstable in Gentoo now)

Also confirmed by sanguivor (on irc) for the bzr version:
Locale is a mixture of en_DK.UTF-8 and fi_FI.UTF-8.

Reproduced with Inkscape 0.48+devel r9785 on OS X 10.5.8: If I change the language ($LANG) for the Inkscape process so that comma is used as decimal separator, the lower limit for x/y spacing (0.1) no longer applies.

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

The min/max values are defined in the extension definition file:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/annotate/head%3A/src/extension/internal/grid.cpp#L194>

            "<param name=\"xspacing\" gui-text=\"" N_("Horizontal Spacing:") "\" type=\"float\" min=\"0.1\" max=\"1000\">10.0</param>\n"
            "<param name=\"yspacing\" gui-text=\"" N_("Vertical Spacing:") "\" type=\"float\" min=\"0.1\" max=\"1000\">10.0</param>\n"

Ignoring the min/max float values depending on decimal separator is possibly a similar issue as reported in bug #571196.

Revision history for this message
Alvin Penner (apenner) wrote :

confirmed in Windows XP using Render->Grid
If I use Control Panel->Regional Options->Customize and set the decimal symbol to be 'comma', then the Render Grid spinbox allows me to choose a spacing of 0,0. If I type manually the value 0, then this gets converted to 0,0 on loss of focus, instead of the expected value of 0,1

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico)
tags: added: i18n
Revision history for this message
jazzynico (jazzynico) wrote :

Since I can lead to crashes, setting Importance to High.

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → High
milestone: none → 0.48.1
status: Confirmed → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Patch attached, please test.

Revision history for this message
Craig Marshall (craig9-deactivatedaccount) wrote :

This patch works for me using win7 and rev9788

Revision history for this message
su_v (suv-lp) wrote :

Fix confirmed with Inkscape 0.48+devel r9788 + InxFloatMinMax.diff on OS X 10.5.8
(tested with 'export LANG="de_DE.UTF-8"' in the shell script launching inkscape-bin)

Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk (revision 9791) and 0.48.x branch (revision 9674).

Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.