Bug 139255 - Paragraphs: Different indentation levels―usually from lists―"break" formatting (borders/background not continuous)
Summary: Paragraphs: Different indentation levels―usually from lists―"break" formattin...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paragraph-Indent Paragraph-Borders
  Show dependency treegraph
 
Reported: 2020-12-27 11:20 UTC by DarkTrick
Modified: 2024-07-27 22:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (11.01 KB, application/vnd.oasis.opendocument.text)
2020-12-27 11:21 UTC, DarkTrick
Details
image showing "actual" and "expected" (47.15 KB, image/png)
2020-12-27 11:22 UTC, DarkTrick
Details
Screenshot showing test case 2024-07 (6.10 KB, image/png)
2024-07-27 19:37 UTC, Philippe Cloutier
Details
Document showing testcast 2024-07 (13.44 KB, application/vnd.oasis.opendocument.text)
2024-07-27 19:44 UTC, Philippe Cloutier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DarkTrick 2020-12-27 11:20:44 UTC
TL;DR:
=====
- See attached image to quickly understand "actual" and "expected".
- See attached document, that shows the expected output

Summary
=======
If you format a paragraph to have borders, the border will not be continuous if you add a list into that paragraph. The result looks like two different paragraph formattings.

You get similar effects when setting the background color. 

Reproduce
=========
. Write three lines of text.
. Create a new paragraph style with solid borders.
. Format the text with the new style
. (Writer draws a continuous line around the whole paragraph)
. Select one a row within the paragraph and make it a bullet point (Shift+F12)
. (Line becomes a bullet point list
. EXPECTED: Border lining doesn't change. It's still one continuous line.
ACTUAL: The paragraph looks like it's ripped apart at the bullet point.

(see attached document)

Workaround
==========
Put content into a table with a single cell and format it.


Severity
========
This bug has the following effect:
- Border formatting for paragraphs containing lists look weird.
- Background color formatting for paragraphs containing lists look weird.
Comment 1 DarkTrick 2020-12-27 11:21:21 UTC
Created attachment 168507 [details]
Example document
Comment 2 DarkTrick 2020-12-27 11:22:23 UTC
Created attachment 168508 [details]
image showing "actual" and "expected"
Comment 3 Dieter 2021-01-11 08:16:34 UTC
I confirm it with

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

I'm sure, that this problem has been reported before, but I couldn't find it.
Comment 4 Justin L 2021-05-05 09:36:49 UTC
(In reply to Dieter from comment #3)
> I'm sure, that this problem has been reported before, but I couldn't find it.
There is a similar sounding bug 99330, but these two are very different bugs, and no code sharing at all between them I'm sure.

This happens already in earliest bibisect-43all LO 3.5, so probably inherited from OOo.
Comment 5 Regina Henschel 2021-12-10 22:41:28 UTC
There are related problems with background color of paragraphs in bug 39756, bug 108600, bug 106021.
Comment 6 QA Administrators 2023-12-12 03:13:52 UTC Comment hidden (obsolete)
Comment 7 Dieter 2023-12-29 10:21:08 UTC
Still present in

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 40617d867346956588ac023511f31210107217f4
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

But not related to lists. If paragraphs with list have same indent as paragraphs without a list, everything works as expected

Steps to make the problem visible
1. Open attachment 168507 [details]
2. Select third and forth paragraph -> Shift+F12 (all paragraphs within the same borders; expected)
3. Change indent of third paragraph to 1 cm

Actual result
Extra border around third paragraph

Expected result
No change in borders

=> I've changed bug summary
Comment 8 Philippe Cloutier 2024-07-27 19:31:54 UTC
Dieter: I can reproduce the behavior you describe, but if it's a problem, it should have its own ticket. This one needs to keep "list" in its summary.
Comment 9 Philippe Cloutier 2024-07-27 19:37:30 UTC
Created attachment 195555 [details]
Screenshot showing test case 2024-07

Taken on Libreoffice 24.2.5.2
Comment 10 Philippe Cloutier 2024-07-27 19:44:04 UTC
Created attachment 195556 [details]
Document showing testcast 2024-07
Comment 11 Philippe Cloutier 2024-07-27 22:07:41 UTC
As Regina mentions, the problematic behavior here is not specific to borders. It notably affects alignment, background and borders. Here is a test which better shows the scope:

1. Create a new document
2. Type "Introduction:"
3. Type Enter
4. Type "Element"
5. Make the line a list item (type F12)
6. Type Enter
7. Type "Subelement"
8. Make the line a sub-element (use the arrow pointing right)
9. Bring up the contextual menu on the "Element" line and bring up the "Paragraph" dialog
10. Set a full red border
11. Uncheck Merge with following paragraph
12. Set a green background 
13. Set alignment to center
14. Close the dialog (OK)

The result is a single centered green line with its own border, resembling what testcase 2024-07 shows.

Technically, I see 3 factors at play:
A. Newlines (Enter) are interpreted as paragraph breaks, even if they only intend to separate list items.
B. The usual way to make a list adds bullets/markers which are THEMSELVES indented (there is space on both sides around bullets, including on the left).
C. LibreOffice considers margins to draw a paragraph's box (borders and background), so it paints a narrower box when bullets are indented. From there, indeed, unless the boxes of 2 consecutive paragraphs are perfectly aligned, the first one's bottom border and the second one's upper border are drawn (if such borders are set), even if the property enables merging.

Factor B may be easy enough to fix, but that would only solve the case of first-level lists. Sub-lists have to be indented.

I suggest working on factor A, but then I realize that a list item can contain more than one paragraph, which I guess means a line can be in more than 1 paragraph―both its root paragraph and some "subparagraph". I really don't know ODT, but that may require a complexification of the document model which would require major effort.
----------------------------------------------------------------
WORKAROUND
Meanwhile, for paragraphs which contain simple lists (no nested lists), this can be worked around by creating lists with non-indented bullets. To do so, you could fake lists (by manually typing "1. ", "2. ", etc), but you can also use list styles. The following would create a trivial list that way:
1. Type "Dummy list:"
2. Type Enter
3. Type "Single element"
4. Unless the panel already shows, select "More styles..." in the styles dropdown.
5. Go to the list styles tab (fifth)
6. Double-click a style, for example "• bullet"

Note that only some of these predefined styles have no indentation at level 1. All styles for unordered lists should be fine, but those for ordered lists are either broken or indented by default. If you want an ordered list, you can either create a new list style or edit one of these which work (in the Position tab, at level 1).