Created attachment 96115 [details] "content.xml" sample outputs showing the difference bewteen 4.1 and 4.2 versions Problem description: "content.xml" file contains different data from one LO version to the other Steps to reproduce: 1. Create a new ods file with a number value on it (eg., "46,236589998745") and give the cell a format to fit your locale (mine "es_ES") so that it displays as "46,24". 2. Save the file and rename it as .zip to get the raw data 3. Now tag "<text:p>" contains "46,236589998745" instead "46,24" as it hapenned on older LO versions. Current behavior: "<text:p>" contains the raw/unformatted data (see attached file) Expected behavior: "<text:p>" should contains the formatted data (see attached file) Operating System: All Version: 4.2.0.4 release Last worked in: 4.1.1.2 release
Hola Camaleón, thanks for reporting. Cell format never changes cell value, maybe in the older version you have activate the option Menu/Tools/Options/LibreOffice calc/Calculate - Precision as show.
I don't think I had enabled (at least on purpose) any option for that, in fact, it was disabled when I tried on 4.1.1.2. Anyway, I have checked that option in 4.2.0.4, then saved the ods file and renamed as zip but it makes no difference in the resulting "content.xml", still shows the raw value but maybe I am missing something or doing it in the wrong way. Can you reproduce my results?
As I have commented, doesn't matter how you change the cell format, the raw values remains inalterable. For me in the <text:p> tag both versions (416 and 402) have "46,236589998745", the correct value.
Well, that's weird. 1/ Can you please, given the steps I provided above, create a new ODS file at your end and test with both LO releases (4.1.x and 4.2.x)? 2/ Is there any chance to get formatted data inside the <text:p> tag in "content.xml" instead raw data ?
Sorry Camaleón, I had not format the cell with two decimal positions. I have added another cell with a date for comparison and haven't clear what is the right. 4.1.6 <office:spreadsheet> <table:calculation-settings table:case-sensitive="false" table:automatic-find-labels="false"/> <table:table table:name="Sheet1" table:style-name="ta1"> <table:table-column table:style-name="co1" table:default-cell-style-name="ce1"/> <table:table-row table:style-name="ro1"> <table:table-cell office:value-type="float" office:value="46.236589998745" calcext:value-type="float"> <text:p>46,24</text:p> </table:table-cell> </table:table-row> <table:table-row table:style-name="ro1"> <table:table-cell table:style-name="ce2" office:value-type="date" office:date-value="2014-12-31" calcext:value-type="date"> <text:p>31/12/14</text:p> </table:table-cell> </table:table-row> </table:table> <table:named-expressions/> </office:spreadsheet> 4.2.0 <office:spreadsheet> <table:table table:name="Sheet1" table:style-name="ta1"> <table:table-column table:style-name="co1" table:default-cell-style-name="ce1"/> <table:table-row table:style-name="ro1"> <table:table-cell office:value-type="float" office:value="46.236589998745" calcext:value-type="float"> <text:p>46.236589998745</text:p> </table:table-cell> </table:table-row><table:table-row table:style-name="ro2"> <table:table-cell table:style-name="ce2" office:value-type="date" office:date-value="2014-12-31" calcext:value-type="date"> <text:p>42004</text:p> </table:table-cell> </table:table-row> </table:table> <table:named-expressions/> </office:spreadsheet> Master save as 4.2.0 Aoo 4.0.1 save as 4.1.6 Not too much clear in ODF specification what content must be. http://docs.oasis-open.org/office/v1.2/cs01/OpenDocument-v1.2-cs01-part1.html#element-table_table-cell http://docs.oasis-open.org/office/v1.2/cs01/OpenDocument-v1.2-cs01-part1.html#element-text_p Seems a bug, difficult to see because the cell format is applied immediately after open the file.
What would be the real world use case where this change causes any impact?
AFAIK, ODF is very vague about what should be in the <text:p> element. It's mostly for "informational purpose" and it doesn't have much strict requirement.
(In reply to comment #6) > What would be the real world use case where this change causes any impact? Well, having both values available (short and long numbers) saves me a lot of work. In my case, I get/download a MS Excel (.xlsx) file and then open it with LO to save it as ODT in order to extract the raw xml data (content.xml) that I then use inside html page with a stylesheet (xsl). If the resulting xml file contains both values (short and long numbers) I don't need to make additional formatting work to have the proper number displayed on the html page which is what it used to be. Now, in order to get readable numbers I have to use xsl formatting functions so the value is displayed as it should. All in all, I consider an advantage to have both values (short and long numbers) in the xml file, because it allows a more flexible approach.
Fair enough. I'll fix it. Looks like it was changed unintentionally anyway. FYI, this bug has zero impact as far as loading ods in LibreOffice goes. This one benefits for postprocessing of ODS documents via 3rd party ODF processing tools.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a0752fa4246dc71b64907c679657a1af3cb617e1 fdo#76409: Write output cell string to <text:p> element when saving to ods. 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.
4.2 backport: https://gerrit.libreoffice.org/9014
Kohei Yoshida committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=eec62f3d823048c9b3b767cb7de72650a40b73cd&h=libreoffice-4-2 fdo#76409: Write output cell string to <text:p> element when saving to ods. It will be available in LibreOffice 4.2.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.
Fixed.
Migrating Whiteboard tags to Keywords: (PossibleRegression) [NinjaEdit]