Bug 133163 - Saving DOCX document with formula cell in table removes formula
Summary: Saving DOCX document with formula cell in table removes formula
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://bugs.launchpad.net/df-libreof...
Whiteboard: target:7.1.0 target:7.0.2
Keywords:
Depends on:
Blocks: DOCX-Fields Regressions-expression-is-faulty
  Show dependency treegraph
 
Reported: 2020-05-19 10:36 UTC by Norbert X
Modified: 2020-09-08 10:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple table with formula to be saved as DOC/DOCX to demonstrate formula lose (10.22 KB, application/vnd.oasis.opendocument.text)
2020-05-19 10:37 UTC, Norbert X
Details
A DOCX with a formula in table (15.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-05-19 11:02 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norbert X 2020-05-19 10:36:46 UTC
Description:
Formula handling inside tables is broken in Microsoft Office DOC or DOCX file formats.

Steps to Reproduce:
Steps to reproduce:
1. Open LibreOffice Writer
2. Insert table of any size - for example 4x4
3. Enter some numbers in the table cells
4. Go to the last (right bottom) cell, hit "=", enter "=sum(<A1:D3>)"
5. Save the document as Microsoft Office DOC or DOCX and close document
6. Open just saved DOC/DOCX document and change some numbers in table (try pressing F9 for sure)

Actual Results:
Actual results:
* the formula in the table is not saved, the user is unable to calculate with it after saving file as DOC / DOCX


Expected Results:
Expected results:
* the formula in the table is saved, the user is able to calculate with it after saving file as DOC / DOCX



Reproducible: Always


User Profile Reset: No



Additional Info:
Notes: the same happens if original document is DOC / DOCX. Saving table with formula removes the formula on next open. Test ODT document is in attachment.

The almost latest LO 6.4.3.2 as in Ubuntu 20.04 LTS is also affected by this bug:

Version: 6.4.3.2
Build ID: 1:6.4.3-0ubuntu0.20.04.1
CPU threads: 1; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Norbert X 2020-05-19 10:37:32 UTC
Created attachment 160997 [details]
Simple table with formula to be saved as DOC/DOCX to demonstrate formula lose
Comment 2 Mike Kaganski 2020-05-19 11:02:08 UTC
Created attachment 160999 [details]
A DOCX with a formula in table

The document is created in Word 2016. The table has SUM(ABOVE) formula in the bottommost (A3) cell.

So the issue is interoperability with Word formats, which are also able to have simple formulas. Both reading is imperfect, and writing.

This is by no means HIGHEST/CRITICAL, of course.
Comment 3 Norbert X 2020-05-19 11:16:53 UTC Comment hidden (obsolete)
Comment 4 Mike Kaganski 2020-05-19 11:18:57 UTC
(In reply to Norbert X from comment #3)
> This is critical because of data loss.

No bug related to external file types is critical. Please don't start edit wars.
Comment 5 Norbert X 2020-05-19 11:22:47 UTC
Ok, no problem.
Just edited a bunch of documents, opened them and lost formulas in them.
Comment 6 Commit Notification 2020-08-14 07:14:00 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cf596c43315bb96b5e7256a82256f1ccb8c9c4d0

tdf#133163 DOCX: export formula cells

It will be available in 7.1.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.
Comment 7 László Németh 2020-08-15 13:45:00 UTC
Problem was fixed only for DOCX, because allowing field export in obsolete DOC format resulted broken formula in Word, likely missing DOC part of the previous fix for Bug 118682. Please, file a new bug for DOC (first, import) support, if needed.
Comment 8 Commit Notification 2020-09-02 13:50:22 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/e5480bff53f3bd32fc922544f7d1c15854218ffc

tdf#133163 DOCX: export formula cells

It will be available in 7.0.2.

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.
Comment 9 NISZ LibreOffice Team 2020-09-08 10:49:02 UTC
Verified in:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: a3b4831208da615789bd1e2d5660dd130807f504
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded