diff options
author | Eike Rathke <erack@redhat.com> | 2017-09-08 19:06:41 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-09-08 21:53:46 +0200 |
commit | 9c1826d98065c30411cbf2e731560165ca2b7668 (patch) | |
tree | 06de32ee651e03fce5f9e5497ed4af7218caeced /sc/source/ui/view/gridwin.cxx | |
parent | 276536fc10368dbe7e16cf859b6da903cec6b8aa (diff) |
sc-perf: do not add a million empty filter entries just to sort and discard
Which can happen if an (anonymous) database range as filter range was selected
to span an entire column of which most (the tail) is empty cells. The entries
are processed to be unique anyway. This significantly shortens the time to
display the filter dialog.
Happened with attachment
http://bugs.documentfoundation.org/attachment.cgi?id=136074 of bug
https://bugs.documentfoundation.org/show_bug.cgi?id=112258
Change-Id: Ia169911d6f23611a3b3ecbf291757465f1998210
Reviewed-on: https://gerrit.libreoffice.org/42118
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 329ba7a85d7d..683a9ec915ed 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -659,13 +659,12 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) } // Populate the check box list. - bool bHasDates = false; - std::vector<ScTypedStrData> aStrings; - pDoc->GetFilterEntries(nCol, nRow, nTab, aStrings, bHasDates); + ScFilterEntries aFilterEntries; + pDoc->GetFilterEntries(nCol, nRow, nTab, aFilterEntries); - mpAutoFilterPopup->setHasDates(bHasDates); - mpAutoFilterPopup->setMemberSize(aStrings.size()); - std::vector<ScTypedStrData>::const_iterator it = aStrings.begin(), itEnd = aStrings.end(); + mpAutoFilterPopup->setHasDates(aFilterEntries.mbHasDates); + mpAutoFilterPopup->setMemberSize(aFilterEntries.size()); + std::vector<ScTypedStrData>::const_iterator it = aFilterEntries.begin(), itEnd = aFilterEntries.end(); for (; it != itEnd; ++it) { const OUString& aVal = it->GetString(); |