Bug 99661 - FORMATTING: Add max-denominator-value attribute to <number:fraction>
Summary: FORMATTING: Add max-denominator-value attribute to <number:fraction>
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Laurent BP
QA Contact:
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
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:


Attachments

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
Description: 
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:
http://docs.oasis-open.org/office/v1.2/cs01/OpenDocument-v1.2-cs01-part1.html#element-number_fraction

ODF 1.3 will include max-denominator-digits:
https://issues.oasis-open.org/browse/OFFICE-3695

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
NEW.
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":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1544a26ac9f7dd60605dd21e9cbe29d490aafdce

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

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