Created attachment 194823 [details] Sample DOCX file LibreOffice has now support for comment styles, which is great. However, when importing DOCX files, LO shouldn't try to "import" or "guess" the comment style from the DOCX file. The problem occurs when we have line spacing in the DOCX file, so the comment will now have line spacing as well, which is bad because the comment box is usually small and spacing between lines is not desired. We should either: 1) Not import line spacing attributes for comment styles of DOCX files, or... 2) When the file is DOCX, assume a default style created by LO on the fly, maybe only using the same font from the standard style in the DOCX file Steps to reproduce: 1) Open the attached DOCX file (this was created in Word) 2) Insert a comment 3) Write a comment that has multiple lines 4) Notice the spacing between the lines Expected results: There should be no spacing between the lines in de default imported comment style This is especially problematic when reading scientific papers and dissertations, in which the default style almost always uses 1.5 line spacing, and then the comments start having these 1.5 line spacings as well, which is annoying because now in every DOCX I receive, I have to fix the comment style. System info: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 6b2aaaa6be71b1289521bd2ffd2d4abacecabb87 CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Calc: CL threaded
I confirm it with Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: ccc3996cfcbebe14e9d5f3511906cfc64ddf3452 CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL threaded > We should either: > 1) Not import line spacing attributes for comment styles of DOCX files, or... > 2) When the file is DOCX, assume a default style created by LO on the fly, > maybe only using the same font from the standard style in the DOCX file I think, a general decision should be taken by design-team
The comment styling is not necessarily as bad as in your sample document. And changing the style is pretty simple. I would not mess with the import filter. (You may also use the comments sidebar soon, bug 106316.) However, if someone changes the Default PS, the Comment PS follows. We could solve this by adding the single-line attribute so it wont be overwritten. Perhaps indentation and spacing too.
TBH, I've always been of two minds about "fully-styleable" comments, with paragraph styles and such. One extreme of how to consider comments is as something which is basically just textual, and the document viewer or editor can choose to put them anywhere, in different layouts (boxes near the page, sidebar, comment area with one line per comment etc) and the comment author should not make any assumptions regarding how they're going to look. The other extreme is of the comment being a sort of a mini-document in a box. I believe this contradiction or duality is reflected also in this bug: > ... when we have line spacing in the DOCX file... so, the thing is, we _always_ have line spacing in our comments - because they are made up of paragraphs, with paragraph styles, which include line spacing. What if it were an ODT with a comment paragraph style which included a line spacing other than the default? How do we distinguish between a "legitimate" decision to use 1.5x spacing - which we support - from an "illegitimate" decision? It's problematic to use the fact that the input file is DOCX as the criterion.
We discussed the topic in the design meeting. To ensure the comments being readable we should define the attributes on the Comments style * line spacing = single * indents = all 0, * spacing = 0 * font color = COL_AUTO * highlight = none Code pointer: Attribuites need to be added at DocumentStylePoolManager::GetTextCollFromPool() in sw/source/core/doc/DocumentStylePoolManager.cxx under "case RES_POOLCOLL_COMMENT:"
(In reply to Heiko Tietze from comment #4) > We discussed the topic in the design meeting. > > To ensure the comments being readable we should define the attributes on the > Comments style What happens when you: 1. Style your comments (e.g. change line spacing and font color) 2. Save as DOCX. 3. Close. 4. Open the DOCX. Will the comments lose their styling? If so, why is it legitimate for them to have styling in the first place? And why should they not lose it when saving to ODT?
(In reply to Eyal Rozenberg from comment #5) > If so, why is it legitimate for them to have styling in the first place? And > why should they not lose it when saving to ODT? Better to ask questions for developers at the respective mailing list.
I do not see why this is worded in this way. It's not "we shouldn't import comment styles from Word files", it's "we should do it properly" - our "default comment style" in the sample file is different from Word's.
Created attachment 196502 [details] Attachment 194823 [details], opened in Word and added a comment Inspect the two attachment: the original one, and the one in this comment. The original one has no "comment" occurrences in its styles.xml; the one I add here has them. So it's just the wrong behavior of defining default values *in the absence of the information in the source document*; and we definitely must import the information when it's there - but the defaults for Word documents must be corrected. Please don't do "fixes" that do not align with this. This is a bug, nothing to do with UX and design.
And by the way, LibreOffice does *not* import the style from DOCX at all - even when it's there.
Kira Tubo committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9286ac87abe4eeaf878585bdc5bb4fee40f950cc Related tdf#161657 Define default Comments style attributes It will be available in 25.2.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.
Kira's patch applies a couple of meaningful default settings to the Comments PS. It does not touch import/export filters.
Switching back to UNCONFIRMED since I've set the NEW state.