Bug 118521 - FILEOPEN DOCX Using direct formatting on a paragraph replaces non-modified attributes of the paragraph style with the settings of the base style.
Summary: FILEOPEN DOCX Using direct formatting on a paragraph replaces non-modified at...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.5.2 release
Hardware: All All
: medium normal
Assignee: László Németh
URL:
Whiteboard: target:6.2.0
Keywords: filter:docx
: 82348 104348 (view as bug list)
Depends on:
Blocks: DOCX-Paragraph
  Show dependency treegraph
 
Reported: 2018-07-03 10:35 UTC by Gabor Kelemen (allotropia)
Modified: 2020-07-14 10:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document from Word 2010 (1.65 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-03 10:35 UTC, Gabor Kelemen (allotropia)
Details
Screenshot in current 6.2 master and Word 2010 (314.75 KB, image/png)
2018-07-03 10:36 UTC, Gabor Kelemen (allotropia)
Details
Simplified test document (13.32 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-17 15:36 UTC, László Németh
Details
Workaround for the problem (13.34 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-17 15:39 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-07-03 10:35:52 UTC
Created attachment 143285 [details]
Example document from Word 2010

Attached document contains text in frames with spacing before and after the paragraphs set to 0 in Word 2010. In current Writer master the spacing after the paragraph becomes 0.35 cm.
Comment 1 Gabor Kelemen (allotropia) 2018-07-03 10:36:53 UTC
Created attachment 143286 [details]
Screenshot in current 6.2 master and Word 2010

Properties of paragraph "Projekt megnevezése".
Comment 2 Dieter 2018-07-03 15:15:14 UTC
I confirm, that the paragraph spacing of style "közcím1" is 0,35cm

Version: 6.2.0.0.alpha0+ (x64)
Build ID: b0e291a7efcd3af2a72d0b622b1f1b84723f011f
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-30_23:43:40
Locale: en-US (de_DE); Calc: CL

Same result in LO 6.0.5
Comment 3 László Németh 2018-07-17 15:36:05 UTC
Created attachment 143599 [details]
Simplified test document
Comment 4 László Németh 2018-07-17 15:39:13 UTC
Created attachment 143600 [details]
Workaround for the problem

Removing direct formatting is a workaround for templates.
Comment 5 László Németh 2018-07-17 15:45:34 UTC
The problem:

Base paragraph style has got 8pt bottom margin.

The paragraph styles "közcím1"/"MyStyle" of the attached test documents have got 0pt bottom margin.

When the paragraph contains direct formatting neutral for bottom margin, LibreOffice uses the setting of the base paragraph style instead of the paragraph style.
Comment 6 László Németh 2018-07-17 17:58:51 UTC
Proposed fix: https://gerrit.libreoffice.org/#/c/57585/
Comment 7 Gabor Kelemen (allotropia) 2018-07-17 20:22:07 UTC
(In reply to László Németh from comment #4)
> Created attachment 143600 [details]
> Workaround for the problem
> 
> Removing direct formatting is a workaround for templates.

Thanks, but it's not the goal, this document is from an obsolete set of templates. 
And even then, the organization that created this is kinda out of our reach :).
But actually fixing the display of the magic they did would be rather nice.
Comment 8 Commit Notification 2018-07-18 06:56:18 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dc0300eac3b755bc207cd1fe87217f4ebaeb9f58

tdf#118521 DOCX import: fix paragraph margin from paragraph style

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-07-18 10:22:25 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=480ac84f2f5049fb4337b36f12fd6796e005761b

tdf#118521 unit test for DOCX import: fix paragraph margin from style

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Justin L 2018-07-19 17:49:37 UTC
similar fix for left/right/hanging group: https://gerrit.libreoffice.org/57742 which interestingly is NOT marked as a non-inheriting attribute.

Other no-inherit potential grouping in LO:
-widow/orphan: no control in word - just on or off.
-fo:text-align and style:justify-single-word: didn't see how to set that in word.
-fo:color - seems to inherit from style, so not sure
-some fo:font stuff that sounded likely to be similar to color.

So, I'm not seeing any other groupings to handle pre-emptively. Perhaps some knows from the writer side some other groupings that might cause similar problems.
Comment 11 Commit Notification 2018-07-20 08:44:45 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eab67995d7056682c250efa3c903b1fffd812700

tdf#118521 DOCX import: style sets unset left/right/hanging margin

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Justin L 2018-07-24 18:14:46 UTC
*** Bug 104348 has been marked as a duplicate of this bug. ***
Comment 13 Commit Notification 2018-08-01 09:34:18 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=07266e2314fd19dcbf777dadd52d7b826b23c207

tdf#118521 writerfilter: ContextMargin grouped with Top/Bottom

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Dieter 2019-09-15 12:48:59 UTC
Spacing above and below paragraph is 0.00 cm, but in paragraph style "közcím1" spacing above is 0.9 cm

Version: 6.4.0.0.alpha0+ (x64)
Build ID: f0c832acb53326ccc9a8c1a47401fbc9e1081feb
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-11_05:46:53
Locale: en-GB (de_DE); UI-Language: en-US
Calc: threaded
Comment 15 NISZ LibreOffice Team 2020-05-19 07:38:55 UTC
*** Bug 82348 has been marked as a duplicate of this bug. ***
Comment 16 Dieter 2020-06-01 15:21:14 UTC
(In reply to Dieter from comment #14)
> Spacing above and below paragraph is 0.00 cm, but in paragraph style
> "közcím1" spacing above is 0.9 cm

VERIFIED FIXED with

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 41d8b41767032681a9897b7551f011d450e3725e
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded