Bug 158023

Summary: Incorrect recognition of ")" when importing formulas from docx
Product: LibreOffice Reporter: Amin Irgaliev <irgaliev01>
Component: Formula EditorAssignee: Amin Irgaliev <irgaliev01>
Status: RESOLVED FIXED    
Severity: normal CC: ilmari.lauhakangas, miguelangelrv, vladislav.tarakanov, xiscofauli
Priority: medium Keywords: filter:docx
Version: 7.6.2.1 release   
Hardware: All   
OS: All   
Whiteboard: target:24.8.0 target:24.2.5
Crash report or crash signature: Regression By:
Attachments: File with problematic formula (look at 3.a)

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.