[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 11 16:42:28 UTC 2021


 sc/source/ui/view/gridwin.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit d387de2bbd23887c4340fa5fcd64eb5e5ed3cd58
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Feb 10 19:52:52 2021 +0000
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Thu Feb 11 17:41:53 2021 +0100

    tdf#140006 don't limit dropdown width to 300pixels
    
    let it use the full width of the cell. Keep that 300 pixel limit
    if we are expanding the widget width beyond its size request.
    
    Change-Id: Ifeaa9ee60e0d5649de71c960ae83270fb1afb2e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110683
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 6390343c42fe..e490b5c3dcf6 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -947,10 +947,9 @@ void ScGridWindow::ShowFilterMenu(const tools::Rectangle& rCellRect, bool bLayou
     auto nHeight = rFilterBox.get_height_rows(nEntryCount);
     rFilterBox.set_size_request(-1, nHeight);
     Size aSize(rFilterBox.get_preferred_size());
-    if (aSize.Width() < nSizeX)
-        aSize.setWidth(nSizeX);
-    if (aSize.Width() > 300)
-        aSize.setWidth(300);     // do not over do it (Pixel)
+    auto nMaxToExpandTo = std::min(nSizeX, static_cast<decltype(nSizeX)>(300));     // do not over do it (Pixel)
+    if (aSize.Width() < nMaxToExpandTo)
+        aSize.setWidth(nMaxToExpandTo);
 
     aSize.AdjustWidth(4); // add a little margin
     nSizeX += 4;


More information about the Libreoffice-commits mailing list