Bug 158023 - Incorrect recognition of ")" when importing formulas from docx
Summary: Incorrect recognition of ")" when importing formulas from docx
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
7.6.2.1 release
Hardware: All All
: medium normal
Assignee: Amin Irgaliev
URL:
Whiteboard: target:24.8.0 target:24.2.5 inRelease...
Keywords: filter:docx, filter:ooxml
: 59181 68997 97166 120431 150001 (view as bug list)
Depends on:
Blocks: DOCX-Formula
  Show dependency treegraph
 
Reported: 2023-11-01 09:18 UTC by Amin Irgaliev
Modified: 2024-11-02 12:10 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
File with problematic formula (look at 3.a) (89.86 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-11-01 09:20 UTC, Amin Irgaliev
Details
tdf#158023 MSO Word 2406 vs LO7.6.5 vs LO24.2.5.png (392.42 KB, image/png)
2024-07-16 12:13 UTC, Piotr Osada
Details
tdf#158023 parenthesis cases.docx (7.99 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-16 12:27 UTC, Piotr Osada
Details
tdf#158023 parenthesis cases 1 (while editing in LO24.2.5).png (84.43 KB, image/png)
2024-07-16 12:27 UTC, Piotr Osada
Details
tdf#158023 parenthesis cases 2 (reopened DOCX).png (79.96 KB, image/png)
2024-07-16 12:28 UTC, Piotr Osada
Details
tdf#158023 parenthesis cases.docx (9.06 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-16 13:01 UTC, Piotr Osada
Details
tdf#158023 parenthesis cases 1 (while editing in LO24.2.5).png (87.84 KB, image/png)
2024-07-16 13:02 UTC, Piotr Osada
Details
tdf#158023 parenthesis cases 2 (reopened DOCX).png (87.44 KB, image/png)
2024-07-16 13:03 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amin Irgaliev 2023-11-01 09:18:35 UTC
Description:
MSO may sometimes write numbers along with closing bracket in the <m:t> tag. The MSO parser correctly recognizes formulas, while in LO a number with a bracket is wrapped on both sides in "{ }". This causes the formula to be output incorrectly (??? instead of the expected value).

Steps to Reproduce:
We were unable to identify the exact steps to reproduce this behavior in MSO. There is only a file containing the problematic markup and was created in MSO 2015.

Actual Results:
??? instead of the expected value

Expected Results:
Expected value is displayed


Reproducible: Always


User Profile Reset: No

Additional Info:
Comment 1 Amin Irgaliev 2023-11-01 09:20:48 UTC
Created attachment 190577 [details]
File with problematic formula (look at 3.a)
Comment 2 m_a_riosv 2023-11-01 19:01:54 UTC
Reproducible:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d8326f1f54b2f4644b52fbfa7106eeeae6e5bb7b
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded

Resaving with:
Microsoft® Word para Microsoft 365 MSO (versión 2310 compilación 16.0.16924.20054) de 64 bits 
does not solve the issue.
Comment 3 Roman Kuznetsov 2023-11-29 09:37:16 UTC
https://gerrit.libreoffice.org/c/core/+/158794
Comment 4 Commit Notification 2023-12-25 17:35:26 UTC
Irgaliev Amin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8148dd6ed3c61eaf5f9fe3a060ecda9d11611f39

tdf#158023 Add \ before parentheses if they are in the <t> tag.

It will be available in 24.8.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 5 Buovjaga 2024-01-07 16:25:37 UTC
Can this be closed as fixed or is there something to be done still?
Comment 6 Xisco Faulí 2024-06-18 11:03:46 UTC
Now the formulas in attachment 85283 [details] from bug 68997 are displayed instead of ?
Comment 7 Commit Notification 2024-06-18 12:06:56 UTC
Irgaliev Amin committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/57946f4262b5d548d3429723faf380eaba5ce9f8

tdf#158023 Add \ before parentheses if they are in the <t> tag.

It will be available in 24.2.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.
Comment 8 Piotr Osada 2024-07-16 12:13:06 UTC
Created attachment 195330 [details]
tdf#158023 MSO Word 2406 vs LO7.6.5 vs LO24.2.5.png
Comment 9 Piotr Osada 2024-07-16 12:27:33 UTC
Created attachment 195331 [details]
tdf#158023 parenthesis cases.docx

Table in document for the description.
Comment 10 Piotr Osada 2024-07-16 12:27:49 UTC
Created attachment 195332 [details]
tdf#158023 parenthesis cases 1 (while editing in LO24.2.5).png
Comment 11 Piotr Osada 2024-07-16 12:28:03 UTC
Created attachment 195333 [details]
tdf#158023 parenthesis cases 2 (reopened DOCX).png
Comment 12 Piotr Osada 2024-07-16 12:31:29 UTC
(In reply to Xisco Faulí from comment #6)
> Now the formulas in attachment 85283 [details] from bug 68997 are displayed
> instead of ?

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: threaded

Displays similar to MSO Word 2406.
Comment 13 Piotr Osada 2024-07-16 13:01:37 UTC
Created attachment 195334 [details]
tdf#158023 parenthesis cases.docx

File update.
Comment 14 Piotr Osada 2024-07-16 13:02:42 UTC
Created attachment 195335 [details]
tdf#158023 parenthesis cases 1 (while editing in LO24.2.5).png

File update.
Comment 15 Piotr Osada 2024-07-16 13:03:09 UTC
Created attachment 195336 [details]
tdf#158023 parenthesis cases 2 (reopened DOCX).png

File update.
Comment 16 Piotr Osada 2024-07-17 11:13:09 UTC
Also fixed in:

Version: 24.8.0.1 (X86_64) / LibreOffice Community
Build ID: 6fd6cae02baed1e82d14ed2da1f2458092354dab
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: threaded
Comment 17 Mike Kaganski 2024-11-02 05:51:50 UTC
*** Bug 59181 has been marked as a duplicate of this bug. ***
Comment 18 Mike Kaganski 2024-11-02 06:12:10 UTC
*** Bug 97166 has been marked as a duplicate of this bug. ***
Comment 19 Mike Kaganski 2024-11-02 06:44:38 UTC
*** Bug 68997 has been marked as a duplicate of this bug. ***
Comment 20 Mike Kaganski 2024-11-02 06:46:40 UTC
*** Bug 150001 has been marked as a duplicate of this bug. ***
Comment 21 Mike Kaganski 2024-11-02 06:55:11 UTC
*** Bug 120431 has been marked as a duplicate of this bug. ***