https://bugs.documentfoundation.org/show_bug.cgi?id=158314

--- Comment #9 from Kevin Suo <[email protected]> ---
Below is a patch which works for me. However, I may not submit to gerrit
because it's better to include a test case but I am not familiar with the test
case code.

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index a0b0c639a003..79027226387e 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2584,7 +2584,7 @@ class FilterEntriesHandler
         {
             if (!mrFilterEntries.mbHasEmpties)
             {
-                mrFilterEntries.push_back(ScTypedStrData(OUString()));
+                mrFilterEntries.push_back(ScTypedStrData(OUString(), 0.0, 0.0,
ScTypedStrData::Standard, false, mbFilteredRow));
                 mrFilterEntries.mbHasEmpties = true;
             }
             return;
@@ -2614,7 +2614,7 @@ class FilterEntriesHandler
                     OUString aErr = ScGlobal::GetErrorString(nErr);
                     if (!aErr.isEmpty())
                     {
-                       
mrFilterEntries.push_back(ScTypedStrData(std::move(aErr)));
+                       
mrFilterEntries.push_back(ScTypedStrData(std::move(aErr), 0.0, 0.0,
ScTypedStrData::Standard, false, mbFilteredRow));
                         return;
                     }
                 }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 3f4f6b219c67..9e8224adf911 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1049,7 +1049,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW
nRow)
             bool bSelected = true;
             if (!aSelectedValue.empty() || !aSelectedString.empty())
                 bSelected = aSelectedString.count(aStringVal) > 0;
-            else if (bQueryByNonEmpty)
+            else if (bQueryByNonEmpty or it->IsHiddenByFilter())
                 bSelected = false;
             mpAutoFilterPopup->addMember(aStringVal, aDoubleVal, bSelected,
it->IsHiddenByFilter());
             aFilterEntries.maStrData.erase(it);

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to