tdf#150308 sw: fix missing top table border after hidden table rows
First visible line of a table with preceding hidden deleted rows
hid also the top border of the table, if the inner horizontal row
borders drawn only by bottom-only borders (like in the default table
style).
Note: re-use an existing workaround to show the missing line,
see commit 3a4b7c3555f2ffb4e89502bb04ff063d8c08f628
"fdo#39415: sw: fix collapsing border painting more:"
Note: layout testing doesn't work, because of the missing calculation
with the width of the enabled border of the row frame. Also there is
a problem with metafile testing (empty meta file?).
Change-Id: Ia8476a2ec592be1dc36e0ea71c10a71c257c29e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154595
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 379acb934164e673b708d0f3ec6b3ec046c8d73f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154612
Tested-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit bd392b1f7a7378e571e67858cb4bff3161ef07c1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154626
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index dbb1272e..e86ad990 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2798,6 +2798,8 @@ void SwTabFramePainter::FindStylesForLine( Point& rStartPoint,
/**
* Special case: #i9860#
* first line in follow table without repeated headlines
* Special case: tdf#150308
* first visible line of a table with preceding hidden deleted rows
*/
static bool lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines(
SwTabFrame const& rTabFrame, SwFrame const& rFrame, SvxBoxItem const& rBoxItem)
@@ -2806,7 +2808,11 @@ static bool lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines(
dynamic_cast<const SwRowFrame*>(rFrame.GetUpper());
return (pThisRowFrame
&& (pThisRowFrame->GetUpper() == &rTabFrame)
&& rTabFrame.IsFollow()
&& ( rTabFrame.IsFollow()
// tdf#150308 first table row isn't equal to the table row of the first
// row frame of the first table frame: there are invisible deleted rows
// in Hide Changes mode before the first visible table row
|| rTabFrame.GetTable()->GetTabLines().front() != pThisRowFrame->GetTabLine() )
&& !rTabFrame.GetTable()->GetRowsToRepeat()
&& ( !pThisRowFrame->GetPrev()
|| static_cast<const SwRowFrame*>(pThisRowFrame->GetPrev())