As stated in tdf#148111 currently LO is missing support of SDT property <w:showingPlcHdr> (which placeholder text should be displayed in SDT), so document is not displayed same as in MS Word. Moreover, this property is lost on export. See testcase in sw/qa/extras/ooxmlexport/data/tdf148111.docx
Could you be specific if this is run SDT, block SDT, cell SDT or row SDT? Run SDTs are mapped to content controls on master, and there we import this to SwContentControl::m_bShowingPlaceHolder and export this as well. I didn't change the block/cell/row cases.
Created attachment 180315 [details] Screenshot showing a problem: Word (above) vs Writer (below) In source document are only run-level SDTs. I've checked with recent master. Situation seems better than in my initial report: showingPlcHdr is written in output now. But given doc still does not display SDTs as in Word. See attached screenshot: empty value from data storage can display either placeholder or just 5 spaces.
Aha, I see: your bugdoc has <w:text/> inside <w:sdtPr>, which is not yet mapped to SwContentControl (only rich text, checkbox, dropdown and picture are mapped to that).
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/78b5195d8add0679263a5e08ba34be9b27637a65 tdf#149240 docx content controls: round-trip showingPlcHdr better It will be available in 7.5.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.
Please note that my commit is simply for retaining the property on round-trip. The bigger problem of the content control not being a true content control (or whatever is happening here) is still an issue.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/79944dae026f8f1dbb77ce0ebd13b025e7cddc50 tdf#149240 docx content controls: round-trip showingPlcHdr better It will be available in 7.5.0.0.beta2. 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.
While perhaps the greater intent of this bug report is not solved (the block SDT is imported as some compat thing before first round-trip),
This seems to be solved since 7.5 commit 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 The controls are imported as content controls (before they were fields), export also does not lose them, the <w:showingPlcHdr /> tag is also present in the exported file. Thanks Miklos!