summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2018-06-07 18:02:50 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-11-28 00:42:49 +0100
commit39c5e607e99daeba145b5c4522ac4a14e9fda96c (patch)
treef3f44d8b602bb05f45981d71faf076277d0af12b
parent8f39585d87d48786ade268279060b8156526c52f (diff)
tdf#117276 filter reset: check complete data range selected
Change-Id: I5cbd515753ad606f55cedaa7023ffe88671f4702 Reviewed-on: https://gerrit.libreoffice.org/55436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rwxr-xr-x[-rw-r--r--]sc/source/ui/view/gridwin.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b2bd86673130..dde5fe8d674a 100644..100755
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -784,7 +784,6 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode)
// Remove old entries.
aParam.RemoveAllEntriesByField(rPos.Col());
- if( !(eMode == Normal && mpAutoFilterPopup->isAllSelected() ) )
{
// Try to use the existing entry for the column (if one exists).
ScQueryEntry* pEntry = aParam.FindEntryByField(rPos.Col(), true);
@@ -812,6 +811,19 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode eMode)
ScQueryEntry::QueryItemsType& rItems = pEntry->GetQueryItems();
rItems.clear();
std::for_each(aResult.begin(), aResult.end(), AddItemToEntry(rItems, rPool));
+
+ if (mpAutoFilterPopup->isAllSelected())
+ {
+ // get all strings from the column
+ std::vector<ScTypedStrData> aAllStrings; // case sensitive
+ pDoc->GetDataEntries(rPos.Col(), rPos.Row(), rPos.Tab(), aAllStrings, true);
+
+ if (rItems.size() == aAllStrings.size() || aAllStrings.empty())
+ {
+ // all selected => Remove filter entries
+ aParam.RemoveAllEntriesByField(rPos.Col());
+ }
+ }
}
break;
case Top10: