Example of the issue: 1. Open calc and type in A1 cell "=0.2", in A2 type "=1.2". Then select these cells, go to Format-Cells, on the tab "Numbers" in the list "Category" select "User-defined" and in "Format string" type "#/#" (without quotes). 2. Now you can see "1/5" in A1 and "6/5" in A2. 3. Save document. Close LO. 4. Open document again. And now you can see "1/5" in A1 and "1 1/5" in A2. The cell's format changed to "# ?/?"
Confirmed. I'm taking this.
Looks like the next significant release will be 3.4, not 3.3.1. Resetting the target accordingly.
Ah, this may be an ODF number format mapping issue. Saving it as xls preserves the format just fine. The relevant code to look at is SvXMLNumFmtExport::ExportPart_Impl() in xmloff.
I don't know what '#/#' is supposed to mean exactly, but it gets only saved as <number:fraction number:min-integer-digits="0" number:min-numerator-digits="1" number:min-denominator-digits="1"/> when saved as ods. And I guess the number format code gets re-created on import from that above xml element data, which gets mapped to "# ?/?".
I guess this has been a long-standing issue not something new. And unfortunately, fixing this will involve making changes to the ODF specification. So we cannot do that in a hurry. I'll punt this for later.
'#/#' represent digit as improper fraction and '# ?/?' represent digit as proper fraction. If I understood you correctly, at the present time, two different formats generate the same xml. Is it possible to use number:max-integer-digits="0" (instead of|together with) min-integer-digits? I think this can solve the problem. Or it is not in odf specification?
(In reply to comment #6) > Is it possible to use number:max-integer-digits="0" (instead of|together with) > min-integer-digits? I think this can solve the problem. Or it is not in odf > specification? That attribute is not in the specification yet. But we may be able to propose something like that as amendment to the current spec.
This is a Calc issue, therefore changed the 'Component' field accordingly.
This one is for Eike.
Damn, someone discovered an undocumented feature of the number formatter ;-) Ok, I think we can solve this only by enhancing the ODF spec, the number:fraction element doesn't provide means to store this, see http://docs.oasis-open.org/office/v1.2/cs01/OpenDocument-v1.2-cs01-part1.html#element-number_fraction
May I complete the confusion. Excel keeps the "#/#" format even it is sort of illegal. Why not just change the "#/#" to the correct "?/?" and problem solved.
Eike, are you still on this?
Please read this message in its entirety before responding. Your bug was confirmed at least 1 year ago and has not had any activity on it for over a year. Your bug is still set to NEW which means that it is open and confirmed. It would be nice to have the bug confirmed on a newer version than the version reported in the original report to know that the bug is still present -- sometimes a bug is inadvertently fixed over time and just never closed. If you have time please do the following: 1) Test to see if the bug is still present on a currently supported version of LibreOffice (preferably 4.2 or newer). 2) If it is present please leave a comment telling us what version of LibreOffice and your operating system. 3) If it is NOT present please set the bug to RESOLVED-WORKSFORME and leave a short comment telling us your version and Operating System Please DO NOT 1) Update the version field 2) Reply via email (please reply directly on the bug tracker) 3) Set the bug to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link: https://wiki.documentfoundation.org/QA/BugTriage There are also other ways to get involved including with marketing, UX, documentation, and of course developing - http://www.libreoffice.org/get-help/mailing-lists/. Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
There's no loss of data involved per se, it's just a feature that ODF itself doesn't support yet. I think it's appropriate to label this as an enhancement. -> Severity: enhancement
As a first fix, I think there is no need for ODF specification modification. LibO should read #/# as ?/? and there will be no integer part. Code is here: http://opengrok.libreoffice.org/xref/core/xmloff/source/style/xmlnumfe.cxx#1456 if ( pElemStr && (*pElemStr)[0] == '?' ) may be replaced with if ( pElemStr && ( (*pElemStr)[0] == '?' || (*pElemStr)[0] == '#' ) ) to take into account both cases where format has no integer part.
(In reply to Laurent BP from comment #15) > if ( pElemStr && (*pElemStr)[0] == '?' ) > > may be replaced with > > if ( pElemStr && ( (*pElemStr)[0] == '?' || (*pElemStr)[0] == '#' ) ) > > to take into account both cases where format has no integer part. I was wrong. Test must be rewritten, as it tests format "? ??/??" as true. New proposition: https://gerrit.libreoffice.org/24540/
Laurent Balland-Poirier committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3beb146b34fa931e2d63f4738a3ae69fe286545f tdf#31449 Correctly test if fraction has no integer part It will be available in 5.2.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.
Laurent Balland-Poirier committed a patch related to this issue. It has been pushed to "libreoffice-5-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f3de0caba189ff7d17a2f37495147673e68c2e7f&h=libreoffice-5-1 tdf#31449 Correctly test if fraction has no integer part It will be available in 5.1.4. 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.
Notes for unit test writers: At the moment requires a (trivial) manual revert for svl/source/numbers/zformat.cxx A bit similar is the test for bug 70565 in 9b9bcef5ef1858c63c8708bfae2ecea3d398eeb8 (XLSX import) The functioning of formats themselves is tested in svl/qa/unit/svl.cxx Test::testUserDefinedNumberFormats()