summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/view/gridwin.cxx11
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;
}
}