Created attachment 185748 [details] columnMargin_combined.pdf: output from Word 2019 and LO master The heart of the problem appears to be this: a <w:br> can occur either between some character runs, or at the very beginning. In LO, we split this into a "new paragraph" and thus the top margin applies to both parts. There are several problems all related to this one concept. And that is because even in MS Word it acts rather strangely. For example, while working in compatibility mode, the margin of the new column might change when I hit the save button (using Word 2019). In Compat15 mode, this is never appropriate - the part after the break must have a zero top margin. In Compat14 mode the top margin should apply only if the break was the first (visible) run in the paragraph (complicated by the fact that anchored shapes before the break are not considered visible character runs for example). In LO we have a few things to fix then: -in compat14 mode with break as first run: we seem to be doubling up the top margin after the page break. Regression in LO 6.0 by me with the unlikely sounding commit afc96d263959d10e457b54a574f0829d20e99df4 tdf#112352 ooxmlimport: ALWAYS treat 1st nextpage w/cols as cont [There is also the problem where the following section OUGHT to intrude into this section's space, but I submit that we should not try to do that any more, since anything less than compat15 is effectively obsolete, and looks like an MS bug which is not worth emulating.) -in all compat modes, when the break is not the first run, then do not apply the top margin to the portion after the break. -in compat15 mode, when the break is the first run, then do not apply the top margin at all, neither before nor after the break. -and a bonus related problem: the (blue) paragraph background colour isn't applying to both split paragraphs (neither the empty first paragraph, nor the second split paragraph. Not bibisectable, but in 4.3 the split column break started working.) It is probably worth noting here the significant distinction between a section page break and a regular page break. By definition, the section page break is a paragraph property - and thus the following paragraph always applies it's margin spacing. The same applies to a section column break. On the other hand, a regular column/page break always splits a paragraph in two, with compat14 causing a dilemma about whether to apply the spacing before or after the break.
Created attachment 185749 [details] columnMargin15.docx: from Word 2019 looks very different when opened by Word 2010.
Confirmed in LO 7.6.0.0.alpha0+ (4e6ab75c1a907398d24768d19cf097a4892d374c) / Ubuntu.
Created attachment 185821 [details] TopMarginNotAppliedTest15.docx: a nasty unit test, trying to cover all 4 cases
Created attachment 185823 [details] sectionStart.odt: demonstrating a fundamental LO difference for start of section. In the previous examples, we can see that the "top" of the column seems to match the starting column. For DOCX/RTF, that started in LO 4.2 with DOCX import: fix default section break type inside multiple columns. The reason is that columns are being added to a section instead of a page. As the document attached here shows, LO doesn't consider the section to "start" until AFTER the top margin, whereas MS logically starts the section immediately. (Already true in LO 3.6).
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/96a502b3756a1c100b40235f50ef2122d5b543f9 tdf#153964 writerfilter compat15: top margin after break split 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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/80e8763036f36afd482a06fbf0f3ffe1ebbe2b46 tdf#153964 writerfilter: column break split should inherit most properties 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.
(In reply to Justin L from comment #0) > In LO we have a few things to fix then: > -in compat14 mode with break as first run: we seem to be doubling up the top > margin after the page break. Same as comment 4: a major difference between LO and MS Word. I didn't attempt to create a compat flag/layout handling for this. Since this was the main observation, I'll leave the bug report open to deal with this "the section starts after the first paragraph's top margin" problem that affects both compat14 and compat15. > -in all compat modes, when the break is not the first run, then do not apply > the top margin to the portion after the break. Fixed. > -in compat15 mode, when the break is the first run, then do not apply the > top margin at all, neither before nor after the break. -fixed > -and a bonus related problem: the (blue) paragraph background colour isn't > applying to both split paragraphs (neither the empty first paragraph, nor > the second split paragraph. Fixed. We don't create every empty paragraph, so we miss a few coloured areas, but that isn't a big deal.
Actually, let me close it since the description is all over the place. I'll open a new ticket to deal specifically with the section difference. bug 154082
*** Bug 134257 has been marked as a duplicate of this bug. ***