Bug 161626 - Math equations using "it" as subscript are not opening correctly
Summary: Math equations using "it" as subscript are not opening correctly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Formula-Object
  Show dependency treegraph
 
Reported: 2024-06-17 23:25 UTC by Rafael Lima
Modified: 2024-07-26 05:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX file with equations (18.10 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-06-17 23:25 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2024-06-17 23:25:44 UTC
Created attachment 194786 [details]
DOCX file with equations

In Math, some combinations of letters are being recognized as reserved words and are not being imported/rendered correctly.

For instance, open the attached DOCX document and scroll down to find some equations with "?" errors. These equations open fine in MS Word and OnlyOffice, but they fail in LibreOffice.

After a lot of thinking, I noticed that all errors occur when "it" is used as subscript... all other subscripts work fine.

This should not happen... and I'm pretty sure that way back in 6.4 it worked fine.

System info

Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.3-0ubuntu0.24.04.2
Calc: threaded
Comment 1 Rafael Lima 2024-06-17 23:36:10 UTC
Code pointer:

Commenting out the following line in /core/starmath/source/parse5.cxx fixes the issue.

{ u"it"_ustr, TIT, '\0', TG::Product, 0 },

However... commenting out this line is not a proper fix for the issue. This line has a purpose (I don't know which or why it was added, but it certainly was added for a reason), but the underlying problem is how DOCX files are imported... somehow some or all of these strings should be imported as pure text, and not as reserved words.
Comment 2 Stéphane Guillou (stragu) 2024-07-03 02:54:07 UTC
Started with Dante's 7e2c35324c54646f53f0fa14b7bce07e1da73c0b for bug 109338 (line was added to starmath/source/parse.cxx, but most of its contents were moved to parse5.cxx later on).

That's build [8df71520b47158dcd10006208ddcc92ed7949501] in linux-64-7.1 bibisect repo.