Issue 69080 - Can't change value of cm spinfields in RTL
Summary: Can't change value of cm spinfields in RTL
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 2.0.3
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.1
Assignee: philipp.lohmann
QA Contact: issues@gsl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-30 08:20 UTC by alan
Modified: 2006-10-18 09:29 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Allows Hebrew chars in unit strings (668 bytes, patch)
2006-09-18 08:47 UTC, alan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description alan 2006-08-30 08:20:09 UTC
If the unit measure in Writer (RTL version) is set to "Centimeters", it becomes
impossible to set the value of spinfields with cm values. If I go to Format/Page
and set "Format" to "User", the default for "Width" is 119.00 cm. If I click
arrow-up or arrow-down on the "Width" spinfield, the value does not change. If I
manually change the value to 100, then press Tab, the value reverts to 119. If
the unit measure is inches or the language is LTR, the behavior is ok. Might
this be because OOo can't handle the Hebrew for "cm" which is to the left of the
value in the spinfield?

This is a regression, since it was working in 2.0.1. We can't release 2.0.3
Hebrew with this bug, so could you give it high priority? Thanks.
Comment 1 michael.ruess 2006-08-30 08:39:51 UTC
Reassigned to SBA.
Comment 2 alan 2006-08-30 12:34:09 UTC
Correction: this is not a regression, since it did not work in 2.0.1 either. We
got around the bug by not translating the unit measurements such as "cm" in
vcl/source/src/units.src. The bug should still should be fixed, though.
Comment 3 stefan.baltzer 2006-08-31 15:42:16 UTC
SBA->Reassigned to OS.
Comment 4 alan 2006-09-18 08:45:10 UTC
The problem is in ImplMetricGetUnitText in vcl/source/control field.cxx. The
function assumes that the string for metric units contains either Latin chars,
single quotes, double-quotes, or percent signs. It takes no other chars into
account. In order to get the function to work for Hebrew, I had to add the line
in the attached patch.

I see that in the function there is commented-out code which is meant to be a
preparation for translated strings. Currently it doesn't compile. 
Comment 5 alan 2006-09-18 08:47:26 UTC
Created attachment 39204 [details]
Allows Hebrew chars in unit strings
Comment 6 Oliver Specht 2006-09-18 09:02:44 UTC
Issue type changed to patch, reassigned to pl
Comment 7 philipp.lohmann 2006-09-18 17:33:24 UTC
until a more general solution comes up i'll commit this patch; I'm currently not
sure about a general solution for all languages. Perhaps one should implement a
negative check that checks for numbers and decimal sign.
Comment 8 philipp.lohmann 2006-09-18 17:39:47 UTC
committed in CWS vcl66
Comment 9 alan 2006-09-18 17:45:09 UTC
I was also considering a negative check for numbers and a decimal sign, but I
couldn't be sure that it would work for all languages. Checking for >='0' and
<='9' won't do for Arabic, and other languages may may be other forms of digits
that I'm not aware of. Since I couldn't come up with a reliable universal patch,
I just submitted this simple patch for Hebrew.
Comment 10 philipp.lohmann 2006-09-18 18:04:25 UTC
Yes, one would have to check for all possible numeric signs; also e.g. the
decimal separator needs to be taken into account. Looks like a more general
solution, though; at least it would probably not be worse than the current
unpatched solution. I'll think a little more on it.
Comment 11 philipp.lohmann 2006-09-20 18:04:10 UTC
verified in CWS vcl66
Comment 12 philipp.lohmann 2006-09-20 18:08:03 UTC
created issue 69708 as followup for a more general solution
Comment 13 philipp.lohmann 2006-10-18 09:29:10 UTC
seen in 680m188