summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2021-05-18 15:41:51 +0200
committerLászló Németh <nemeth@numbertext.org>2021-05-21 18:04:20 +0200
commit45a49b7a1b552f204e7b417cfbe2d86e4b169993 (patch)
tree7f9ab725cbf43d9aec84fdda8947029b07434a67 /sc/source
parent185f3e3c382e93be4e0588ac8a927ea3140bce91 (diff)
tdf#142350 sc AutoFilter: fix (empty) entry checking
When a column was filtered for values that included 0, but not the (empty) entry, the (empty) entry also was checked in the Autofilter dropdown. Regression from commit 4fd1333ba4bb4f2311e9098291154772bd310429 "tdf#140968 tdf#140978 XLSX import: fix lost rounded filters". Change-Id: Ic2595c707bd43f1a19c86d2ee796f06d9b1af1e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115755 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/view/gridwin.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 0cd90461a37c..644feab4b654 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -684,7 +684,14 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
const double aDoubleVal = rEntry.GetValue();
bool bSelected = true;
if (!aSelectedValue.empty() || !aSelectedString.empty())
- bSelected = aSelectedValue.count(aDoubleVal) > 0 || aSelectedString.count(aStringVal) > 0;
+ {
+ if (aStringVal.isEmpty())
+ bSelected = aSelectedString.count(aStringVal) > 0;
+ else
+ bSelected
+ = aSelectedValue.count(aDoubleVal) > 0 || aSelectedString.count(aStringVal) > 0;
+ }
+
if ( rEntry.IsDate() )
rControl.addDateMember( aStringVal, rEntry.GetValue(), bSelected );
else