summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-10 19:52:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-10 22:01:30 +0100
commitac4e8e8ad407c9a0da808d9f11fd5108048c5d05 (patch)
tree40108f67f039a076ad18bd0b8b1ed116ad3fb707
parent3f8347d466ac8803b1a019491907e73e4aa63e38 (diff)
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/+/110725 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/view/gridwin.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index abbfe91e0780..1e5c0f6df86e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -959,10 +959,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;