[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-1' - sc/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 2 12:10:38 UTC 2021


 sc/source/ui/view/gridwin.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit a2db1b6c24fe8d3791e8ccdeecb2fc6d282ab333
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Mon May 31 10:19:42 2021 +0200
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Fri Jul 2 14:10:01 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.tunde at nisz.hu>
    (cherry picked from commit e8bba8229080f873b89b39551e924d1c8609fc07)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118271
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ada6714e406f..410fdbc8b4eb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -684,21 +684,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;
         }
     }
 


More information about the Libreoffice-commits mailing list