sc/source/ui/view/gridwin.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
New commits: commit e8bba8229080f873b89b39551e924d1c8609fc07 Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Mon May 31 10:19:42 2021 +0200 Commit: Tünde Tóth <toth.tu...@nisz.hu> CommitDate: Mon May 31 13:14:47 2021 +0200 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.tu...@nisz.hu> 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; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits