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/dbgui/pfiltdlg.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/dbgui/pfiltdlg.cxx')
-rw-r--r-- | sc/source/ui/dbgui/pfiltdlg.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index 4b28bd0c202d..37da46a92b63 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -29,7 +29,7 @@ #include "dbdata.hxx" #include "scresid.hxx" #include "queryentry.hxx" -#include "typedstrdata.hxx" +#include "filterentries.hxx" #include "sc.hrc" #include "strings.hrc" @@ -309,14 +309,13 @@ void ScPivotFilterDlg::UpdateValueList( sal_uInt16 nList ) SCROW nFirstRow = theQueryData.nRow1; SCROW nLastRow = theQueryData.nRow2; nFirstRow++; - bool bHasDates = false; bool bCaseSens = m_pBtnCase->IsChecked(); - m_pEntryLists[nColumn].reset( new std::vector<ScTypedStrData> ); + m_pEntryLists[nColumn].reset( new ScFilterEntries); pDoc->GetFilterEntriesArea( - nColumn, nFirstRow, nLastRow, nTab, bCaseSens, *m_pEntryLists[nColumn], bHasDates); + nColumn, nFirstRow, nLastRow, nTab, bCaseSens, *m_pEntryLists[nColumn]); } - std::vector<ScTypedStrData>* pColl = m_pEntryLists[nColumn].get(); + const ScFilterEntries* pColl = m_pEntryLists[nColumn].get(); std::vector<ScTypedStrData>::const_iterator it = pColl->begin(), itEnd = pColl->end(); for (; it != itEnd; ++it) { |