From 9c1826d98065c30411cbf2e731560165ca2b7668 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 8 Sep 2017 19:06:41 +0200 Subject: 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 Reviewed-by: Eike Rathke --- sc/source/ui/view/gridwin.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sc/source/ui/view/gridwin.cxx') 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 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::const_iterator it = aStrings.begin(), itEnd = aStrings.end(); + mpAutoFilterPopup->setHasDates(aFilterEntries.mbHasDates); + mpAutoFilterPopup->setMemberSize(aFilterEntries.size()); + std::vector::const_iterator it = aFilterEntries.begin(), itEnd = aFilterEntries.end(); for (; it != itEnd; ++it) { const OUString& aVal = it->GetString(); -- cgit