Bug 99661 - FORMATTING: Add max-denominator-value attribute to <number:fraction>
Summary: FORMATTING: Add max-denominator-value attribute to <number:fraction>
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Laurent BP
QA Contact:
Whiteboard: target:5.3.0
Depends on:
Reported: 2016-05-03 20:36 UTC by Laurent BP
Modified: 2016-10-25 18:54 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Laurent BP 2016-05-03 20:36:32 UTC
In <number:fraction> element, Gnumeric treats both attributes min-denominator-digits and max-denominator-digits (see bug 38097#c27), while LibO knows only min-denominator-digits like ODF 1.2 standard:

ODF 1.3 will include max-denominator-digits:

LibO should now also treats this attribute. As actual LibO treats "min-denominator-digits" as the maximum of denominator digits, backward compatibility should carefully checked.

IMHO, when importing:
- if both attributes (min and max-denominator-digits) are present, treat them normally (it would be great also to import gnm:max-denominator-digits as number:max-denominator-digits)
- if only min-denominator-digits is present, consider it as max-denominator-digits and set min-denominator-digits to 0
- format string should be build with n_q number of '?' and n_z number of '0', with n_z = min-denominator-digits and n_q = max-denominator-digits - min-denominator-digits

Main issue will be when exporting. As min-denominator-digits="0" is not recognized (see bug 38097#c27) with actual version of LibO, fraction format will be lost if file is opened with actual or previous version. This should be exported to specifically ODF 1.3
Comment 1 Buovjaga 2016-05-06 14:12:27 UTC
Comment 2 Eike Rathke 2016-05-26 14:38:39 UTC
We could backport the importing part to 5-1 and 5-2 so at least the fraction format will not be lost when importing such file.
Comment 3 Commit Notification 2016-05-30 12:03:11 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":


tdf#99661 Add max-denominator-value attribute to number:fraction

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.