[Libreoffice-commits] core.git: sc/source

Serge Krot Serge.Krot at cib.de
Tue Jun 12 14:09:56 UTC 2018


 sc/source/ui/view/gridwin.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit c8a739a2c84f45f878d2ae75eaf16a2f814d1c6e
Author: Serge Krot <Serge.Krot at cib.de>
Date:   Thu Jun 7 18:02:50 2018 +0200

    tdf#117276 filter reset: check complete data range selected
    
    Change-Id: I5cbd515753ad606f55cedaa7023ffe88671f4702
    Reviewed-on: https://gerrit.libreoffice.org/55436
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
old mode 100644
new mode 100755
index 018367bfdb51..d0769177b395
--- 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:


More information about the Libreoffice-commits mailing list