summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2018-06-07 18:02:50 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-06-12 16:09:33 +0200
commitc8a739a2c84f45f878d2ae75eaf16a2f814d1c6e (patch)
tree034a7a24a6eb90d7a9e9e3c3523bf068092621ec
parentdf652aa70869f42ada2f4d8e7d1cacf55c6e6e96 (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 018367bfdb51..d0769177b395 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: