Bug 149660 - FILEOPEN DOCX IF field conditions not read
Summary: FILEOPEN DOCX IF field conditions not read
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: filter:docx
Depends on:
Blocks: 69686 100516 DOCX-Fields 149672 149675
  Show dependency treegraph
Reported: 2022-06-21 14:42 UTC by Gabor Kelemen (allotropia)
Modified: 2023-01-19 20:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:

attachment 56010 saved in Word2016 to docx (10.63 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-06-21 14:42 UTC, Gabor Kelemen (allotropia)
The example file in Word 2016 and Writer master (84.43 KB, image/png)
2022-06-21 14:43 UTC, Gabor Kelemen (allotropia)

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2022-06-21 14:42:32 UTC
Created attachment 180873 [details]
attachment 56010 [details] saved in Word2016 to docx

This is related to bug 114537

When the attached file - a docx saved from doc attachment 56010 [details] of bug 43569 - is opened in Writer, the conditional field is recognized, but its Condition, Then and Else parameters are not, as seen in its Edit dialog. 
Consequently, it does not work either.

1, Open attached file in Writer
2, Double click on the test1 field

In the dialog the Condition, Then and Else boxes are empty, but should have the condition as 1=1, Then as test1 and Else as test2.

Word shows it as: IF 1 = 1 "test1" "test2" \* MERGEFORMAT 

Version: (x64) / LibreOffice Community
Build ID: 3b852f274696a5e2a44bb4107c37cea9d291758e
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

This was never good, tested in 7.0, 6.0, 5.0, 4.0 and 3.5.
Comment 1 Gabor Kelemen (allotropia) 2022-06-21 14:43:00 UTC
Created attachment 180874 [details]
The example file in Word 2016 and Writer master
Comment 2 Cor Nouws 2022-06-21 18:58:37 UTC
confirmed in Version: / LibreOffice Community
Build ID: fc2716740bd513154ae4ab5404d9c575678172e0
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: nl-NL (en_US.UTF-8); UI: nl-NL
Calc: threaded
Comment 3 Justin L 2023-01-19 16:39:52 UTC
Fixing this is a bit dangerous because there are some fundamental differences between LO IF fields and MS Word. Specifically, Word allows nested if statements in the true/false results. Additionally, in MS Word the field content can be manually edited and need to be manually refreshed for the condition to re-apply.

So the field might contain contents that neither match the true or false result-strings. LO has no such ability - which is generally a good thing.