Created attachment 120387 [details] ODF file without sign in exponent for a scientific number Description: Scientific format may skip sign in exponent (for positive exponent) with format such as "0.00E00". This format can be save in ODF from LibO 5.0. See bug 90133. However, Excel is not able to manage such format. So export to Excel should forced format to show sign in exponent even for positive exponent with "0.00E+00". Steps to reproduce: 1. enter a value (>= 1.0) in a cell, for instance 5 2. Format > Cells > Numbers. Change format code to 0.00E00 (without sign in exponent) 3. OK => display correctly 5.00E00 instead of 5.00E+00 with default scientific format 4. File > Save in ODF format (see attached document) 5. File > Reload => display is correctly 5.00E00 (from LibO 5.0) 6. File > Save in XLS format 7. open file with Excel 2003 Actual behavior A warning message appears: "File Error. Some number format may be lost." and cell is formated as Standard. Expected behavior No warning message, cell should be formated to the nearest supported format: 0.00E+00 It is worth if you export to XLSX: - Excel 2003 (with compatibility module) refuses to open the file - Excel 2010 can open file with a warning about number format repaired
Actually, the bug is present from origin. The difference is that before LibO 5.0 should can not do step 5 (reload of ODF document) as it was not saved in XML code, only correctly displayed.
Identify function void XclExpNumFmtBuffer::WriteFormatRecord http://opengrok.libreoffice.org/xref/core/sc/source/filter/excel/xestyle.cxx#1428 where rFormatStr should be modified
No, the change should be done deeper at the number formatter level, otherwise you'd have to do the same change for the binary Excel format and Word formats. svl/source/numbers/zformat.cxx SvNumberformat::GetMappedFormatstring() looks like the place to go.
Laurent Balland-Poirier committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=96ff6372e15fa17211650ec6f0da13771a572a42 tdf#95677 Force sign to exponent for Excel export It will be available in 5.1.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-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=bad71e69bae0dbfbf4bfabcd5e53e0feafd65d90&h=libreoffice-5-0 tdf#95677 Force sign to exponent for Excel export It will be available in 5.0.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.