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

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


 vcl/source/treelist/treelistbox.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0f7a09cda38c08d79ef94dcadcb83e038dbebcb1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 5 12:16:28 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 5 15:57:48 2021 +0200

    the border size SvTreeListBox uses is not StyleSettings::GetBorderSize
    
    so use the actual border sizes in use
    
    Change-Id: If6d1032936565c199332522a31a1bc984f126547
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115139
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index b19118346b76..94dfbb8629fd 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -3109,8 +3109,10 @@ Size SvTreeListBox::GetOptimalSize() const
         aRet.AdjustWidth(aWidth );
     if (GetStyle() & WB_BORDER)
     {
-        aRet.AdjustWidth(StyleSettings::GetBorderSize() * 2 );
-        aRet.AdjustHeight(StyleSettings::GetBorderSize() * 2 );
+        sal_Int32 nLeftBorder(0), nTopBorder(0), nRightBorder(0), nBottomBorder(0);
+        GetBorder(nLeftBorder, nTopBorder, nRightBorder, nBottomBorder);
+        aRet.AdjustWidth(nLeftBorder + nRightBorder);
+        aRet.AdjustHeight(nTopBorder + nBottomBorder);
     }
     tools::Long nMinWidth = nMinWidthInChars * approximate_char_width();
     aRet.setWidth( std::max(aRet.Width(), nMinWidth) );


More information about the Libreoffice-commits mailing list