Apache OpenOffice (AOO) Bugzilla – Issue 69080
Can't change value of cm spinfields in RTL
Last modified: 2006-10-18 09:29:10 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.
Reassigned to SBA.
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.
SBA->Reassigned to OS.
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.
Created attachment 39204 [details] Allows Hebrew chars in unit strings
Issue type changed to patch, reassigned to pl
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.
committed in CWS vcl66
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.
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.
verified in CWS vcl66
created issue 69708 as followup for a more general solution
seen in 680m188