Bug Hunting Session
Bug 75915 - Rounding issues when working with metric units
Summary: Rounding issues when working with metric units
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: lowest trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Measurement-Units
  Show dependency treegraph
 
Reported: 2014-03-08 18:17 UTC by sergio.callegari
Modified: 2019-09-10 20:15 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sergio.callegari 2014-03-08 18:17:05 UTC
There are some rounding issues when working with metric units. These are also present in Openoffice, hence I thing they were imported from there.

To reproduce:
-------------

1) Open Libreoffice impress (or draw)
2) Open the Tools->Options dialog
3) Go to the Libreoffice Impress -> General tab
4) Set the unit of measurement to centimeters
5) Set the tab stops to 1.25 cm
6) Set the unit of measurements to millimiters
7) See how the tab stop now is 12.51 mm instead of 12.50 (!)
8) Set the tab stop to 12.50 mm
9) Set the unit of measurement to centimeters
10) Set the unit of measurement back to millimiters
11) See how the tab stop now is again at 12.51 mm (!)
Comment 1 Jean-Baptiste Faure 2014-03-08 21:48:48 UTC
Indeed I see that since ages. That said not sure if you can distinguish 0.01 mm on your screen.

Best regards. JBF
Comment 2 Joel Madero 2015-05-02 15:42:58 UTC Comment hidden (obsolete)
Comment 3 Jean-Baptiste Faure 2015-05-05 05:00:24 UTC
Still reproducible with LibreOffice 5.0.0.0.alpha1.
Maybe I am wrong, but I guess the root cause of the problem is that the base unit in the code would be the inch. If you set the tab size to 0,5 inch, then change the unit to cm and mm, you will get consistent values. Idem if you change to pica and pt.

Best regards. JBF
Comment 4 QA Administrators 2016-09-20 09:36:55 UTC Comment hidden (obsolete)
Comment 5 sergio.callegari 2016-09-21 08:50:05 UTC
Bug still present as of 5.2.2.1.

@ comment 1.

> not sure if you can distinguish 0.01 mm on your screen

The problem exists with lines that are meant to be perfectly horizontal or perfectly vertical. It is particularly visible with connectors. Even a minimal skew between the y (or x) coordinate of the end points and you will see a "step" in the line at some zooming level. This is not just slightly disturbing during the editing of an image, more important it looks unprofessional if it happens in a presentation (as if you had not dedicated enough care in its preparation).

@ comment 3

> Maybe I am wrong, but I guess the root cause of the problem is that the base unit in the code would be the inch.

Unlikely. I believe that the internal drawing layer should work using 1/100th mm in 32-bit integer. So, the issue /might/ due to the fact that unneeded conversions back and forth imperial and metric units happen at some time.

Note that a related issue had been reported for OO back in 2005 (https://bz.apache.org/ooo/show_bug.cgi?id=45593 and also https://bz.apache.org/ooo/show_bug.cgi?id=126372) remaining open. Comment https://bz.apache.org/ooo/show_bug.cgi?id=45593#c22 seems particularly interesting in showing that the ODF specification provides space to address the matter (i.e., the limitation does not come from there).
Comment 6 Xisco Faulí 2017-09-29 08:51:29 UTC Comment hidden (obsolete)
Comment 7 Jean-Baptiste Faure 2017-10-29 06:53:21 UTC
Still reproducible with current master built at home under Ubuntu 16.04.

Best regards. JBF
Comment 8 QA Administrators 2018-10-30 03:57:00 UTC Comment hidden (obsolete)
Comment 9 sergio.callegari 2018-10-30 11:52:58 UTC
Issue still present as of 6.1.x.
Most likely inherited from OOo, but I cannot be 100% sure.
See also bug 44267