Created attachment 152622 [details] sample source file In CALC, when printing, previewing, and creating PDF, diagonal lines are sticking out. Please refer to the attached file.
Created attachment 152623 [details] sample pdf
Confirmed on Windows 10 Pro 64-bit en-US (1803) with Version: 6.2.5.2 (x64) Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159 CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; Locale: en-US (en_US); UI-Language: en-US Calc: threaded An old 5.1.6. build on hand lays out columns & rows correctly matching the Print Ranges as set.
Bibisected with win32-6.2 to https://git.libreoffice.org/core/+/07609f3ae2890ace29c249fac2fb60b0f0332af6%5E!/ BorderlineFix: Fixed visual updates when scrolling Adding Cc: to Armin Le Grand Note: the callout shape marking the bottom range is in the wrong position, so I just looked at the right side.
Taking a look. Happens as described, have to debug into Array::SetClipRange stuff probably...
Digged into it. Main problem are merged cells, not directly mentioned here. For 'simple' cells it will be not too hard to repair. Problem with merged cells is the creation principle of the borderlines itself: It loops over Array cell by cell, collecting the needed geometry info. Cell by cell means for merged cells that e.g. hor lines are made up of as many snippets as the merged cell has. This does not show due to these being 'merged' in a later step. For diagonals this is not possible - these cannot be directly associated with a single cell e.g. when merged NxM with N!=M. The diagonals *have* to be created in one run, so will by principle *stick out* when crossing line borders. I had added code to this in the mentioned commit, but will need to refine that further. Hard stuff due to working against the principle cell repaint. Need to think about this deeply...
Created attachment 177122 [details] Simplified sample showing more problems
1st fix on gerrit (https://gerrit.libreoffice.org/c/core/+/127431), this works for non-merged cells and thus for the orig bugdoc for this task. I will try to add needed geometry clipping for diagonal borderlines in merged cells that span page borders next.
Armin Le Grand (Allotropia) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e038ef76c1ef205143c853a3666fb56ca831750d tdf#126269 Handle diagonal borderline better for merged cells It will be available in 7.4.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.
Checking now how to create needed clipping. (1) On the one hand LO creates only visible segments of the cell borders (except diagonal on merged cells - argh - where this is not possible as described). That is in principle a good idea, adding clipping to visualization may be unknown expensive & weird e.g. for vector target data. (2) On the other hand adding visualization clipping to created geometry as a whole maybe problematic since that 'group of connected edges with BorderStyle' as a whole may be clipped against page bounds, but maybe way bigger than needed (processing cost again). When just clipping diagonal lines that may prevent good 'merge' of associated edges with other borderlines. Thus will try 1st to get in direction (1) and clip to page bounds directly. This is already not easy and unclear how that can influence the edge processing of associated CellBorder associated connections.
Armin Le Grand (Allotropia) committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/487b2db4dffcc7894bd76fd2d77fe8051f89016e tdf#126269 Handle diagonal borderline better for merged cells It will be available in 7.3.0.2. 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.
Getting closer but wrangling with inconsistencies - the borderline stuff uses massively CoordinateSystem/vector stuff. So to clip I first wanted to 'clip' the Cell coordine system, look for aOrigin/aX/aY stuff. These are the column vectors of the cell CS and thus define it. Based on these TLBR and BLTR are created, plus connected vectors defined. But when doing this the cretated geometry is not clipped against the visible part of the merged cell, but always ceated according to the reduced coordinate system -> that changes slope, start and end point. To do it correct I will need to clip the prepared line geometry. Then I will have to think about if I also need to 'clip/correct' the vectors involved, connected to start/end of that geometry, if these also need to be corrected. These are the pre-requirement for correct borderLine creation/matcing of the line start/end parts...
Created attachment 177199 [details] Another bugdoc with merged cells containing diagonal lines reaching over full pages
Armin Le Grand (Allotropia) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/11dd4c918749839867568651f0c62db30fdda297 tdf#126269 Add clipping to diagonal border lines It will be available in 7.4.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.
Armin Le Grand (Allotropia) committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/446ade2ac0023a322cd464911c62df440b6663af tdf#126269 Add clipping to diagonal border lines It will be available in 7.3.0.2. 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.
Verified Arch Linux 64-bit Version: 7.4.0.0.alpha0+ / LibreOffice Community Build ID: f0d42a5120b35981abed85185530ae4f966c2de6 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 4 January 2022
*** Bug 124496 has been marked as a duplicate of this bug. ***