Bad input logic in Spacing between lines combo box

Bug #966979 reported by Yevgeny Lezhnin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
In Progress
Low
Yevgeny Lezhnin

Bug Description

There are 2 combo box for setting text spacing between lines: one in toolbox and one in the Text and Font dialog.
The one in toolbox works fine, but it ignores '%' symbol.
The one in the dialog has a problem: then trying to set a real number text, text spacing becomes normal, but combo box contents becomes a garbage. For example: if I set 1.5 spacing, combo box contents becomes "4%".

Tags: text ui
Changed in inkscape:
assignee: nobody → Yevgeny Lezhnin (z-lezhnin)
Changed in inkscape:
status: New → In Progress
Revision history for this message
Yevgeny Lezhnin (z-lezhnin) wrote :

I replace text, then there is no '%' symbol to "{number*100}%"

Changed in inkscape:
status: In Progress → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

<off-topic>
Reverting bug status to 'In Progress': 'Fix committed' in the bug tracker refers to changes actually committed to current trunk (or the stable branch), not to patches attached to bug reports.

See also
<http://wiki.inkscape.org/wiki/index.php/Bug_management#Bug_status>
</off-topic>

Changed in inkscape:
status: Fix Committed → In Progress
Changed in inkscape:
status: In Progress → New
Revision history for this message
jazzynico (jazzynico) wrote :

Thanks for your patch, Yevgeny.

Tested on Windows XP, Inkscape revision 11141.
Works almost as expected. Two issues regarding the T&F dialog:
1. Rounding errors (2.1 gives 209%).
2. The box doesn't convert the point decimal mark to a localized decimal separator. If the local separator is a coma and I use a point, the right part is not taken into account (1.96 gives 100%).

Maybe point 2 is out of the scope of your patch, but since the toolbox entries correctly convert to localized values, it would be great to have it here too.

Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.49
status: New → In Progress
Revision history for this message
Yevgeny Lezhnin (z-lezhnin) wrote :

I make some universal solution for second issue using strtod() function, also I use floor() function to fix rounding errors. Maybe it is better to use some round function, but I don't know is there any crossplatform variant. Also I folowed Tav advice about c++ strings, now I use c++ string's find() function.

Revision history for this message
jazzynico (jazzynico) wrote :

The rounding fix looks good.

As for the localization issue, I'd rather fix it by reusing a widget that supports it, instead of adding specific code here. UI::Widget::Scalar and UI::Widget::ScalarUnit may be good candidates (usage example in ui/dialog/transformation.cpp).

su_v (suv-lp)
Changed in inkscape:
milestone: 0.91 → 0.92
jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.92 → 0.93
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.