Issue 127001 - Paragraph spacing variables loose numbers after floating points during measurement units change
Summary: Paragraph spacing variables loose numbers after floating points during measur...
Status: CLOSED WONT_FIX
Alias: None
Product: Writer
Classification: Application
Component: formatting (show other issues)
Version: 4.1.2
Hardware: PC Windows 8, 8.1
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: needhelp
Depends on:
Blocks:
 
Reported: 2016-06-17 15:32 UTC by Julia Balashova
Modified: 2019-10-12 17:22 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Julia Balashova 2016-06-17 15:32:46 UTC
1. Set measurement units to mm
("Tools" => "Options" and then "OpenOffice.org Writer" => "General" => "Settings")
2. Set ‘Above paragraph spacing’ variable for this paragraph to 10.09 mm
3. Change measurement units to cm
-> value is transformed into 1.01cm
4. Change measurement units back to mm


Actual result:
Variable for this paragraph is set to 10.00 mm; 0.09 value is lost
Comment 1 Kay 2016-06-17 15:37:40 UTC
Changing hardware spec based on OS used.
Comment 2 Venkatesh A.I.S. 2016-10-13 03:29:05 UTC
Configuration:
Windows 8.1, 64 bit, RAM: 8GB, Open Office version 4.1.2
The measurement unit is changed to mm and tested with different values

Scenario 1:
When the "Above paragraph value" is set to 15.01 mm, and when the unit is converted to cm the spacing is 1.51 cm.
Observed result: A difference of 0.01 is observed
Scenario 2:
When the "Above paragraph value" is set to 5.10 mm, and when the unit is converted to 0.51 cm. Writer is not allowing to enter the value 5.09 and it automatically changes to 5.10 mm.
Scenario 4:
When the "Above paragraph value" is set to 1.01 mm, and when the unit is converted to 0.10 cm.
Scenario 3:
When the "Above paragraph value" is set to either 6.00 mm or 7.00 mm the unit remains unchanged when converted to cm.
Observed result: value remains unchanged.
Comment 3 Caroline Newman 2016-10-17 18:51:21 UTC
This bug also fails on windows 10. 
I attempted to reproduce the bug several ways.  
My computer is 64 bit, Windows 10 machine

Attempt 1: I tried to reproduce the bug exactly as it was done in the original, and I got the same results

Attempt 2: I did the same process but used the number 15.25
entered 15.25, and changed it to cm, the result was 1.53 in cm, then I changed it back to mm and the result was 15.29, an incorrect number.  

Attempt 3: I tried the same process but used the number 15.34, in cm it displayed at 1.53, and then I changed it back to mm where it displayed 15.29.  


Attempt 4:I tried to change from 10.09 mm to inches, and back to mm. I got .4in and 10.16 mm

Attempt 5: I tried to change from 10.09 mm to pica and back, got 10.16. Same result changing to point and back

Attempt 6: I changed it to 10.09 mm, then pushed ok and exited the dialogue.  Then I opened the options again, changed it to cm, got 1.01, then i changed it to mm and got 10.09.  It worked with all of the other units to.

This problem only occurs when a new number is put into the number box and the units are changed before pushing ok.  


I believe there is an error when rounding numbers, and significant digits.
Comment 4 Rares Fetean 2016-10-26 19:46:03 UTC
I investigated more on this bug and I found the following:

Environment: I managed to reproduce it partially on both Windows 7 x64 and on Windows 10 x64, on both running Open Office 4.1.3 (Build 9783 - Rev. 1761381).

Note1: I managed to reproduce the bug as mentioned in the steps in Julia's comment (first comment) only the first time after opening a document and putting a different paragraph spacing and then converting to/from mm to cm. The following times for the same document I did not manage to reproduce it anymore. 

I managed to reproduce the bag partially, following the next steps:
1. Open a new document with text in it (and paragraphs) or add text to a new created text file
2. With the measurement units set to mm, select an entire paragraph and put a value in the 'above paragraph spacing' - for example: 12.49. 
3. Leave the paragraph selected and set the measurement units to cm (note that the value is rounded to 1.25cm from 12.49mm)
4. With the paragraph still selected, set the measurement units back to mm

Result: The value displayed is 10.00mm. If the user unselects the paragraph, the value is then correctly displayed as 12.49. In my first note in this comment I mentioned that I managed to reproduce the bug as initially described by Julia only for the first time; in this case, the value was 12.50mm, and not 12.49mm as expected. 

The noticed result is reproducible for any initial value put in the spacing field, considering that it's reproducible for other switches, too (from mm to in, for example). 

While doing tests, I also noticed a particular other problem that could be reported as a bug - When entering from keyboard the value in the spacing field, some particular values always showed the same issue - when entering values that had, for example, XY.59 (.59 as digits), the 59 after the floating point always converted automatically to a .58. I tried for values like "XY.79" and they converted to "XY.80". So, there definetly is a problem when entering by keyboard values that end in "9" and have the format of "XY.Z9". 

Finally, I looked in the Bug database for Open Office and found a bug that looked similar to this one, so I'll add it here for future reference - https://bz.apache.org/ooo/show_bug.cgi?id=124886
Comment 5 Keith N. McKenna 2016-10-27 17:34:54 UTC
This appears to be the result of normal rounding errors rather than an actual bug. Need a developer with knowledge of the code to check this.
Comment 6 Keith N. McKenna 2018-11-26 19:13:11 UTC
As this does appear to be the result of normal rounding errors I am closing it as wont fix