Bug 147258 - The style for placeholders is applied to the display text, when opening a docx file with libreoffice
Summary: The style for placeholders is applied to the display text, when opening a doc...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.6.0 target:7.5.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Content_Control
  Show dependency treegraph
 
Reported: 2022-02-07 15:41 UTC by Martin
Modified: 2023-03-05 12:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
reproduction example (21.11 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-02-07 15:42 UTC, Martin
Details
The example file in Word 2016 and 7.6 master (208.94 KB, image/png)
2023-01-31 12:44 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2022-02-07 15:41:59 UTC
Description:
When opening the attached docx document with libreoffice, the text "ABC" will de displayed in red, when i opening the same document with microsoft word, the text will be displayed in black.

"ABC" is the text, contained in a content control and should appear in black. This content control has a placeholder text. The defined style for placeholder texts in this document is set to red. 

The style for the text is thus taken from the Placeholder style and not from the actual color.

The Word document is prepared in Microsoft Word and the content of the content control is added via a databinding. 

<?xml version="1.0" encoding="UTF-8" standalone="true"?><w:document mc:Ignorable="w14 w15 w16se w16cid wp14" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"><w:body><w:p w:rsidRDefault="00E25B35" w:rsidR="00A85448" w14:textId="54C8B3B6" w14:paraId="3E8C3F23"><w:r><w:t xml:space="preserve">Placeholder -> </w:t></w:r><w:sdt><w:sdtPr><w:alias w:val="Betreff"/><w:tag w:val="objsubject"/><w:id w:val="84812256"/><w:placeholder><w:docPart w:val="5D2DAE3567864F2E92FC60F0A15E929B"/></w:placeholder><w:showingPlcHdr/><w:dataBinding w:storeItemID="{4E8A9591-F074-446B-902F-511FF79C122F}" w:xpath="/*[name()='f:fields']/*[name()='f:record']/*[name()='f:field' and @ref='objsubject']/@text" w:prefixMappings="xmlns:f='http://schemas.fabasoft.com/folio/2007/fields'"/><w:text/></w:sdtPr><w:sdtEndPr/><w:sdtContent><w:r w:rsidRPr="000843E2"><w:rPr><w:t>ABC</w:t></w:r></w:sdtContent></w:sdt><w:bookmarkStart w:name="_GoBack" w:id="0"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="00A85448"><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:gutter="0" w:footer="708" w:header="708" w:left="1417" w:bottom="1134" w:right="1417" w:top="1417"/><w:cols w:space="708"/><w:docGrid w:linePitch="360"/></w:sectPr></w:body></w:document>


Steps to Reproduce:
1. Opening the attached Word Document



Actual Results:
2. "ABC" is displayed in red

Expected Results:
2. "ABC" should displayed in black, like in Microsoft Word


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.2.5.2 (x64) / LibreOffice Community
Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-AT (de_AT); UI: en-US
Calc: threaded
Comment 1 Martin 2022-02-07 15:42:39 UTC
Created attachment 178127 [details]
reproduction example
Comment 2 Martin 2022-02-07 15:45:08 UTC
In Addition using LibreOffice 7.3.0 the whole data binding will be ignored and the old text in the document will be used. Should i wrote therefore a separate bug?
Comment 3 Dieter 2022-02-23 07:06:38 UTC
I can't confirm the original reported problem with

Version: 7.3.0.3 (x64) / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Actual result
Text is black in Word 2016 and in LO

Martin, if you get the same result, please close report as RESOLVED WORKSFORME.
Comment 4 Dieter 2022-02-23 07:08:21 UTC
(In reply to Martin from comment #2)
> In Addition using LibreOffice 7.3.0 the whole data binding will be ignored
> and the old text in the document will be used. Should i wrote therefore a
> separate bug?

Seems to be a different problem. So, yes, please open a new report for that. I'm not familiar with input fields, but bug 78470 might be related to the problem.
Comment 5 Dieter 2022-02-23 07:10:07 UTC
You might also have a look at meta bug 79435.
Comment 6 Martin 2022-03-02 08:58:15 UTC
(In reply to Dieter from comment #3)
> I can't confirm the original reported problem with
> 
> Version: 7.3.0.3 (x64) / LibreOffice Community
> Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
> CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL:
> win
> Locale: de-DE (de_DE); UI: en-GB
> Calc: CL
> 
> Actual result
> Text is black in Word 2016 and in LO
> 
> Martin, if you get the same result, please close report as RESOLVED
> WORKSFORME.

Is there any need for further investigation?
Comment 7 Martin 2022-03-02 09:00:14 UTC
(In reply to Dieter from comment #5)
> You might also have a look at meta bug 79435.

These bugs are about word fields not about "content controls".

https://docs.microsoft.com/en-us/office/vba/word/concepts/working-with-word/working-with-content-controls
Comment 8 Martin 2022-03-02 09:53:32 UTC
(In reply to Dieter from comment #4)
> (In reply to Martin from comment #2)
> > In Addition using LibreOffice 7.3.0 the whole data binding will be ignored
> > and the old text in the document will be used. Should i wrote therefore a
> > separate bug?
> 
> Seems to be a different problem. So, yes, please open a new report for that.
> I'm not familiar with input fields, but bug 78470 might be related to the
> problem.

https://bugs.documentfoundation.org/show_bug.cgi?id=147724
Comment 9 Dieter 2022-03-02 09:55:29 UTC
(In reply to Martin from comment #6)
> Is there any need for further investigation?

Yes, please retest with LO 7.3
Comment 10 Martin 2022-03-02 09:57:18 UTC
(In reply to Dieter from comment #9)
> (In reply to Martin from comment #6)
> > Is there any need for further investigation?
> 
> Yes, please retest with LO 7.3

i filled another bug report, as u mentioned in comment 4
Comment 11 Dieter 2022-03-02 10:03:04 UTC
(In reply to Martin from comment #10)
> i filled another bug report, as u mentioned in comment 4

Yes, but what about the red text you've mentioned in bug description?
Comment 12 Martin 2022-03-02 10:06:50 UTC
(In reply to Dieter from comment #11)
> (In reply to Martin from comment #10)
> > i filled another bug report, as u mentioned in comment 4
> 
> Yes, but what about the red text you've mentioned in bug description?

Since it doesn't update the text, it doesn't even get to the actual problem of this bug yet ... when the problem is fixed, I can take a look.
Comment 13 Justin L 2022-09-06 00:39:52 UTC
In LO 7.3.0.2 this changed from red ABC to black HERUNTERLADEN
with commit b5c616d10bff3213840d4893d13b4493de71fa56
Author: Vasily Melenchuk on Wed Nov 24 14:50:12 2021 +0300
    tdf#104823: support for sdt plain text fields

Please review whether this bug has been properly resolved.
Comment 14 Gabor Kelemen (allotropia) 2023-01-31 12:44:50 UTC
Created attachment 185025 [details]
The example file in Word 2016 and 7.6 master

The red ABC is back in 7.5+. It is red since:

https://git.libreoffice.org/core/+/de90c192cb8f1f03a4028493d8bfe9a127a76b2a

author	Miklos Vajna <vmiklos@collabora.com>	Mon Sep 19 10:01:36 2022 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	Mon Sep 19 11:31:05 2022 +0200

sw content controls, plain text: enable DOCX filter with data binding

At this point the text was still HERUNTERLADEN, that was fixed later.
There is a character style "Placeholder Text" that is applied since this commit, before there was the "No Character Style" selected in the Navigator.
Comment 15 Gabor Kelemen (allotropia) 2023-01-31 12:46:06 UTC
Setting to new.
Adding CC to: Miklos Vajna
Comment 16 Buovjaga 2023-01-31 12:51:56 UTC
(In reply to Martin from comment #0)
> Actual Results:
> 2. "ABC" is displayed in red
> 
> Expected Results:
> 2. "ABC" should displayed in black, like in Microsoft Word

office.com displays the text in red, just like LibreOffice. So everything seems to be in line.

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a345952daf3238066ecb1a9c67bb6a3640a6299a
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 31 January 2023
Comment 17 Miklos Vajna 2023-02-14 14:19:31 UTC
> office.com displays the text in red, just like LibreOffice. So everything
> seems to be in line.

Looks like that's specific to the web version. Desktop Word 2021 (with updates installed, version 2301) still renders it with the default character style.
Comment 18 Commit Notification 2023-02-15 16:05:18 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1c45e1971cdd88f54a3cfb89622fdfa6fa8fcf31

tdf#147258 DOCX import: fix bad char format w/ inline <w:sdt> and data binding

It will be available in 7.6.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 19 Commit Notification 2023-02-16 09:25:09 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/4b46aa3a20205eed7500545c79a7e8b92c488583

tdf#147258 DOCX import: fix bad char format w/ inline <w:sdt> and data binding

It will be available in 7.5.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.