diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-05-14 15:59:29 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-05-14 22:06:44 +0200 |
commit | fce7c123203c91f62b45447f45e1d1f1b45d5b48 (patch) | |
tree | 0a5e4973d4d2a208b4b1722fe94c072a5d4db0d2 /sc/source/core/data/column3.cxx | |
parent | aa446591b7feb5bb667533ef7acdfc636105f9d9 (diff) |
cache cell positions when searching in calc (tdf#108347)
The document has a large number of rows, and mdds normally always searches
from the first item when looking up the container position, which leads
to a quadratic cost when searching the entire sheet. GetCellValue()
already has a variant that caches the last position, so just use it
(and make sure to invalidate if it's search&replace and something changes).
Change-Id: I26da60cebf641e10ed92e548fe5f9016900d3cf0
Reviewed-on: https://gerrit.libreoffice.org/72290
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r-- | sc/source/core/data/column3.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index a760f1428336..26847a3a6126 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2822,10 +2822,8 @@ void ScColumn::SetValue( BroadcastNewCell(nRow); } -void ScColumn::GetString( SCROW nRow, OUString& rString, const ScInterpreterContext* pContext ) const +void ScColumn::GetString( const ScRefCellValue& aCell, SCROW nRow, OUString& rString, const ScInterpreterContext* pContext ) const { - ScRefCellValue aCell = GetCellValue(nRow); - // ugly hack for ordering problem with GetNumberFormat and missing inherited formats if (aCell.meType == CELLTYPE_FORMULA) aCell.mpFormula->MaybeInterpret(); @@ -2849,9 +2847,8 @@ double* ScColumn::GetValueCell( SCROW nRow ) return &sc::numeric_block::at(*it->data, aPos.second); } -void ScColumn::GetInputString( SCROW nRow, OUString& rString ) const +void ScColumn::GetInputString( const ScRefCellValue& aCell, SCROW nRow, OUString& rString ) const { - ScRefCellValue aCell = GetCellValue(nRow); sal_uLong nFormat = GetNumberFormat(GetDoc()->GetNonThreadedContext(), nRow); ScCellFormat::GetInputString(aCell, nFormat, rString, *(GetDoc()->GetFormatTable()), GetDoc()); } |