diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2021-05-31 10:19:42 +0200 |
---|---|---|
committer | Tünde Tóth <toth.tunde@nisz.hu> | 2021-05-31 13:14:47 +0200 |
commit | e8bba8229080f873b89b39551e924d1c8609fc07 (patch) | |
tree | e32aaf0257358d172d4efd343b919b074c5e190a /sc/source | |
parent | 1f755525189884e4b2824889a6b9dea8933402db (diff) |
Related tdf#68113 sc autofilter: clean-up for
commit: e6431d55bff7ae09c8b0708a0876c699bacca644
(tdf#68113 sc autofilter: fix not empty button unchecks all entries)
Change-Id: Id7cff40ae48dd09b44b0b553f50e379ecbb472f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116431
Tested-by: Jenkins
Reviewed-by: Tünde Tóth <toth.tunde@nisz.hu>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 635b13700b68..ca1dd4df1587 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -664,21 +664,20 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) ScQueryParam aParam; pDBData->GetQueryParam(aParam); - bool bQueryByNonEmpty = false; std::vector<ScQueryEntry*> aEntries = aParam.FindAllEntriesByField(nCol); std::unordered_set<OUString> aSelectedString; std::unordered_set<double> aSelectedValue; - for (ScQueryEntry* pEntry : aEntries) + bool bQueryByNonEmpty = aEntries.size() == 1 && aEntries[0]->IsQueryByNonEmpty(); + + if (!bQueryByNonEmpty) { - if (pEntry && pEntry->bDoQuery && pEntry->eOp == SC_EQUAL) + for (ScQueryEntry* pEntry : aEntries) { - if (!pEntry->IsQueryByNonEmpty()) + if (pEntry && pEntry->eOp == SC_EQUAL) { ScQueryEntry::QueryItemsType& rItems = pEntry->GetQueryItems(); std::for_each(rItems.begin(), rItems.end(), AddSelectedItemString(aSelectedString, aSelectedValue)); } - else - bQueryByNonEmpty = true; } } |