Bug 150932 - FILESAVE DOCX New files (but not existing ones!) should always be saved with ulTrailSpace, so Word shows trailing spaces underlined
Summary: FILESAVE DOCX New files (but not existing ones!) should always be saved with ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.3.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: Writer-Enhancements
  Show dependency treegraph
 
Reported: 2022-09-13 16:19 UTC by Matthew Kogan
Modified: 2023-08-18 17:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test file (4.20 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-02-03 18:34 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Kogan 2022-09-13 16:19:46 UTC
Description:
Underlined spaces at the end of a paragraph are not shown underlined in Word after exporting to docx.

Steps to Reproduce:
1. Type "abc       "
2. Underline all
3. Export to docx
4. Open docx in Word

Actual Results:
"abc" is underlined but the spaces after it are not.

Expected Results:
"abc" and the spaces after it should all be underlined.


Reproducible: Always


User Profile Reset: No



Additional Info:
There is an option in Word (Options, Advanced, Layout) called "Draw underline on trailing spaces". Checking this option fixes the problem. Writer should be setting this option on export, to match its own behaviour.
Comment 1 Rafael Lima 2022-09-13 18:14:57 UTC
Hi Mathew, try checking the compatibility flag "Word-compatible trailing blanks" in LibreOffice, which is found under Tools - Options - LibreOffice Writer - Compatibility.

Does it fix your problem?
Comment 2 Matthew Kogan 2022-09-13 19:50:54 UTC
No, it doesn't seem to make any difference.
Comment 3 Buovjaga 2023-02-03 14:37:43 UTC
Without trying any special options, I exported both from 7.3 and latest unstable and office.com shows the underline just fine.

Which version of MSO did you use to open the DOCX?

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 52ebc632b3cfa122dcb178cf28d8dbc7c7c57007
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 3 February 2023
Comment 4 Matthew Kogan 2023-02-03 14:47:38 UTC
Reproduced in MS Word Version 2301 (Build 16026.20146 Click-to-Run) just now.
Comment 5 raal 2023-02-03 18:34:32 UTC
Created attachment 185093 [details]
test file

test file created in LO 7.6.
This file is without underlined trailing spaces in word 2010, but with Underlined trailing spaces in office.com => looks like word's problem.
Comment 6 Matthew Kogan 2023-02-08 11:04:01 UTC
Thanks. As I said in the Additional Info section of my original report, Word *can* be made to underline the trailing spaces, by enabling the "Draw underline on trailing spaces" option, so my opinion is that Writer should be setting this option on export.
Comment 7 Buovjaga 2023-02-08 11:18:16 UTC
(In reply to Matthew Kogan from comment #6)
> Thanks. As I said in the Additional Info section of my original report, Word
> *can* be made to underline the trailing spaces, by enabling the "Draw
> underline on trailing spaces" option, so my opinion is that Writer should be
> setting this option on export.

But why are we seeing the expected result, if Writer is not setting this option? Is the option really per document or global? Can you investigate this and provide a source on MSO's side?
Comment 9 Buovjaga 2023-02-08 11:42:02 UTC
(In reply to Matthew Kogan from comment #8)
> Yes, it is a per-document option.
> https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.
> wordprocessing.underlinetrailingspaces?view=openxml-2.8.1

Thanks. ulTrailSpace exists in the annotated schema writerfilter/source/ooxml/model.xml but it is not used anywhere in the code.

I'll set to NEW tentatively and show this to developers.
Comment 10 Matthew Kogan 2023-02-08 13:09:46 UTC
Thank you.
Comment 11 Buovjaga 2023-02-08 13:31:51 UTC
No objection from devs, adjusting summary to reflect that this should not be done for existing documents.