diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-10 19:52:52 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-02-11 17:41:53 +0100 |
commit | d387de2bbd23887c4340fa5fcd64eb5e5ed3cd58 (patch) | |
tree | fd7d013a43ce8a7092a8f9f855e9172d6d056e14 /sc | |
parent | b38f2625ef48d85ece632a951dca8db6df407049 (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/+/110683
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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; |