[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 5 13:59:18 UTC 2021


 vcl/source/app/salvtables.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bb9a3f1cd2912b836deb9f73c2010bf03a1438c9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 5 12:19:30 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 5 15:58:30 2021 +0200

    factor in treeview borders for get_height_rows
    
    as seen in tdf#142049 for format chart type where the scrollbar
    appears in gen when that's something it tries to avoid
    
    Change-Id: I494114078603797b0450363816823e5898a3ef01
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115141
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e3541057da60..a74e14120058 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4739,7 +4739,13 @@ int SalInstanceTreeView::count_selected_rows() const { return m_xTreeView->GetSe
 
 int SalInstanceTreeView::get_height_rows(int nRows) const
 {
-    return m_xTreeView->GetEntryHeight() * nRows;
+    int nHeight = m_xTreeView->GetEntryHeight() * nRows;
+
+    sal_Int32 nLeftBorder(0), nTopBorder(0), nRightBorder(0), nBottomBorder(0);
+    m_xTreeView->GetBorder(nLeftBorder, nTopBorder, nRightBorder, nBottomBorder);
+    nHeight += nTopBorder + nBottomBorder;
+
+    return nHeight;
 }
 
 void SalInstanceTreeView::make_sorted()


More information about the Libreoffice-commits mailing list