Bug 131004 - Unstable paint of writer consecutive section frames
Summary: Unstable paint of writer consecutive section frames
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.6.3 release
Hardware: All All
: medium normal
Assignee: Serge Krot (CIB)
URL:
Whiteboard: target:7.0.0 target:6.4.4
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-28 08:56 UTC by Jan-Marek Glogowski
Modified: 2020-04-09 10:14 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Document with three consecutive sections. (11.52 KB, application/vnd.oasis.opendocument.text)
2020-02-28 08:56 UTC, Jan-Marek Glogowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan-Marek Glogowski 2020-02-28 08:56:09 UTC
Created attachment 158250 [details]
Document with three consecutive sections.

Open the attached document. It contains the explaining text and three consecutive sections with minimal content, so it's easier to test. What can be observed is the following. As far as I can say, this doesn't depend on zooming. The only stable behavior is: remove the 2nd section and the top border of the 3rd section moves by a pixel, or sometimes vanishes completely.

Sometimes you have a double / two pixel border on load. This is sometimes even triggered by a reload.

Change the 2nd section in any of the following ways:
    • add a line
    • remove a line
    • remove the whole 2nd section via Format > Sections… „Bereich 2“

Results can be one of the following:
    • 3rd section top border moves by a pixel
(always happens when the  2nd section is removed – best observed via undo + redo)
    • 3rd section top border isn‘t painted at all, until refresh like scrolling out of view (seldom)
    • 1st section bottom border / 2nd section top border result in two lines (seldom)

Eventually some merging of borders is happening.

From the layout definition, they don't take any space, which IMHO makes sense. These frames just act as a visible hint and don't affect the layout. So maybe all sections should simply draw their frames, so for consecutive sections, these are always doubled? But probably we still need some extra handling, if the device pixels match to the same line.

The worst problem, and the origin of this report, is the missing top border of the 3rd section on delete, which should never happen. That looks like a refresh problem, but it isn't. The border is simply not painted, because Writer doesn't realize the upper border needs repaint. In the debugger I can see, that no painting for this line happens at all, but happens in the correct case in SwSubsRects::PaintSubsidiary. If the user triggers a new paint of the section (scroll the section out of view, minimize+restore, ...), the border becomes visible.

I think, this is basically all the same bug.
Comment 1 Michael Weghorn 2020-02-28 09:07:51 UTC
(In reply to Jan-Marek Glogowski from comment #0)
> [...]
> Results can be one of the following:
>     • 3rd section top border moves by a pixel
> (always happens when the  2nd section is removed – best observed via undo +
> redo)

This behaviour reliably reproducible for me with

Version: 7.0.0.0.alpha0+
Build ID: e5f81b90629c5f3bd733f862d17a57c251acc291
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-GB (en_GB.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 Commit Notification 2020-04-03 09:12:20 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8666dfecbaac69b9dc9a9c23a05654d847608907

tdf#131004 fix unstable paint of writer consecutive section frames

It will be available in 7.0.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.
Comment 3 Commit Notification 2020-04-04 22:24:56 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/27b775647e8fd557d5581b6416f3f35f5ae02b4d

tdf#131004 fix unstable paint of writer consecutive section frames

It will be available in 6.4.4.

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.