Description: The formula field is incorrect in the table, when we change the number format. Steps to Reproduce: 1. Create a new document in Microsoft Word 2016. 2. Insert a table and click in the first cell. 3. On the Insert tab, click Quick Parts > Field. 4. In the Field dialog box, click on Formula button. 5. In the Formula dialog box, type a formula and change the number format. 6. Click on OK button. 7. Save the file as DOCX. 8. Open the same file in LibreOffice Writer. Actual Results: The value of the field is incorrect: ** Expression is faulty **. Expected Results: The formula field should have the same value as in the original file when the document is opened in Microsoft Word 2016. Reproducible: Always User Profile Reset: No Additional Info:
Created attachment 147699 [details] Screenshot of the original document side by side in Word and Writer.
Created attachment 147700 [details] Example file from Word
I confirm it with Version: 6.3.0.0.alpha0+ (x64) Build ID: ffa5b8a82eab18041bbee4d6914892b82c7801d3 CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; TinderBox: Win-x86_64@42, Branch:master, Time: 2018-12-19_03:24:54 Locale: en-US (de_DE); UI-Language: en-US Calc: threaded If you display the field codes you can see, that the equal signs are missing in the odt-file.
No repro with Versie: 4.4.7.2 Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600 Locale: nl_NL
Created attachment 148074 [details] bibisect in bibisect-linux-64-5.4, tail of terminal output Working on debian-buster in bibisect-linux-64-5.4 repository, I looked only at the displayed result when LibreOffice opened the attached .docx. The bad commit is : commit 009e5f66, source hash c568eb7d, 2017-03-30. The commit message for the source commit is: commit c568eb7d3bb4584867f0a1f0a7965f73097f009b Author: Jean-Sebastien Bevilacqua <realitix@gmail.com> Date: Thu Feb 16 10:54:33 2017 +0100 tdf#105975 Add Formula field parsing (docx) in SWriter Introduction ------------ In MSWord, you can create a formula field (starting with =). When you save your file as `docx`, this `FORMULA` field is registered in you file (a field starting with `=`). In its current state, LibreOffice can't parse the `FORMULA` field in `docx` file. Context of this fix ------------------- This fix is entirely located in the `DomainMapper_Impl.cxx` file because it's where the parsing is done. How this fix works ------------------ First, we add `FORMULA` support by adding it to the `aFields[]` variable. Next, to handle the `FORMULA` constant, we add a condition (swith case) in `DomainMapper_Impl::CloseFieldCommand()` to call `handleFieldFormula`. Note ---- In function `lcl_ExtractToken`, if command starts with `=`, it's a `FORMULA` field. Change-Id: If7d25de5413aa3133b22523d8a3f34ab6961adfc Reviewed-on: https://gerrit.libreoffice.org/34334 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> I am removing keyword bibisectRequest and adding bisected, bibisected; and I am adding the author and Michael Stahl to cc.
Thanks for bibisecting this. I checked in 5.3 and while the formatted formula results appear correctly, they are just plain text and not fields as they were in Word. I guess importing and exporting field formatting codes here can be considered a feature request and not a regression.
Proposed workaround: https://gerrit.libreoffice.org/#/c/65945/ This fix the bug (syntax error), but not the enhancement (support custom number format code). Gábor: Indeed, it's not a true regression, especially if the working formulas are important. Note: It has to fix the DOCX export of the formula fields, too.
Hello László, bug 107410 is a similar issue but for RTF format. Does your commit fix it as well ?
László Németh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/7209feef41c3c858476a2ae9795a7d2264c0ffc0%5E%21 tdf#122224 DOCX import: fix formula field syntax It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Xisco Faulí from comment #8) > Hello László, > bug 107410 is a similar issue but for RTF format. > Does your commit fix it as well ? Hello Xisco. Unfortunately, it doesn't, because that is related to the unknown function "abs".
(In reply to László Németh from comment #10) > (In reply to Xisco Faulí from comment #8) > > Hello László, > > bug 107410 is a similar issue but for RTF format. > > Does your commit fix it as well ? > > Hello Xisco. Unfortunately, it doesn't, because that is related to the > unknown function "abs". Xisco, more precisely, this commit has been fixed most of those syntax problems, too, except the "abs" related ones. :)
I don't see this bug fixed in Version: 6.3.0.0.alpha0+ Build ID: 54515a6a01a372729bf8a7f9e992c51f214ec9a6 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded
Created attachment 148168 [details] How the document looks after RT in LibreOffice 6.3 master
(In reply to Xisco Faulí from comment #13) > Created attachment 148168 [details] > How the document looks after RT in LibreOffice 6.3 master Xisco: sorry, I've closed this issue only according to the "FILEOPEN" in the commit description, and because of the bigger set of missing features, planned to fix by the following set of commits/maybe new issues in the future: – field DOCX export – style DOCX import – style DOCX export – add table reference and ABS support (closing the related RTF issue) – add export of the previous I started to work on them, but unfortunately, there are other issues with higher priority, yet. In fact, first we need a basic field export, too, so we can wait for it to close this issue. @Gábor, what is your opinion? Note: it may need to press F9 to see the update of the fields.
Created attachment 148169 [details] Example compared MSO LO62 LO63+ I'll set to verified. Format is another issue.
In case when a single issue is fixed, we close and open another bug. That's why I intended to set Verified for Fileopen. But if a dev is willing to pursue other obvious issue, it's surely better to do in the same bug.
oh, wait a minute, I thought it was a FILESAVE problem. Rereading it, I see it's not. my bad. Closing as VERIFIED FIXED. Indeed, it's fixed in Version: 6.1.4.2 Build ID: 1:6.1.4-0ubuntu0.16.04.1~lo2 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded @László Németh, Thanks for fixing this!!!
László Németh committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/b095e8f3b27331f0d646b1d33e51e17c37e43e2c%5E%21 tdf#122224 DOCX import: fix formula field syntax It will be available in 6.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
László Németh committed a patch related to this issue. It has been pushed to "libreoffice-6-1": https://git.libreoffice.org/core/+/7798ce2e8c938b9d05a3f39e50a2737e64957197%5E%21 tdf#122224 DOCX import: fix formula field syntax It will be available in 6.1.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.