sc/source/ui/view/gridwin.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit adf10bae8aecd8b765a21660b31056292276bdb2
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Sun Apr 26 05:38:01 2020 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Tue Apr 28 14:18:58 2020 +0200

    lokit: trim validation dropdown height to content
    
    The validation dropdown looks ugly for lists with small number of
    items as its height is hardcoded to
    
    SC_FILTERLISTBOX_LINES(=12) * TextHeight
    
    Instead lets use the number of entries in the list to determine
    the height if this count is less than SC_FILTERLISTBOX_LINES
    
    Change-Id: If026140044e6665159cd616c13a2eb57356ae53f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92914
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 495c74db0522..2b2590918b71 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1127,9 +1127,13 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, 
SCROW nRow )
 
         // minimum width in pixel
         const long nMinLOKWinWidth = static_cast<long>(1.3 * STD_COL_WIDTH * 
pViewData->GetPPTX());
-        if (comphelper::LibreOfficeKit::isActive() && nSizeX < nMinLOKWinWidth)
+        bool bLOKActive = comphelper::LibreOfficeKit::isActive();
+        if (bLOKActive && nSizeX < nMinLOKWinWidth)
             nSizeX = nMinLOKWinWidth;
 
+        if (bLOKActive && aStrings.size() < SC_FILTERLISTBOX_LINES)
+            nHeight = nHeight * (aStrings.size() + 1) / SC_FILTERLISTBOX_LINES;
+
         Size aParentSize = GetParent()->GetOutputSizePixel();
         Size aSize( nSizeX, nHeight );
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to