Kaydet (Commit) 4c4c5baa authored tarafından Luboš Luňák's avatar Luboš Luňák

cache mdds position in ScTable::InvalidateTextWidth (tdf#108298)

Again, normally starts container search from the beginning, so without
caching this is quadratic.

Change-Id: I3bb1ff40a326eb46780e45d3e3934773a7b77d06
Reviewed-on: https://gerrit.libreoffice.org/72406
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 8e719005
...@@ -1205,12 +1205,14 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p ...@@ -1205,12 +1205,14 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p
for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
{ {
ScColumnTextWidthIterator aIter(aCol[nCol], nRow1, nRow2); ScColumnTextWidthIterator aIter(aCol[nCol], nRow1, nRow2);
sc::ColumnBlockPosition blockPos; // cache mdds position
InitColumnBlockPosition( blockPos, nCol );
for (; aIter.hasCell(); aIter.next()) for (; aIter.hasCell(); aIter.next())
{ {
SCROW nRow = aIter.getPos(); SCROW nRow = aIter.getPos();
aIter.setValue(TEXTWIDTH_DIRTY); aIter.setValue(TEXTWIDTH_DIRTY);
ScRefCellValue aCell = aCol[nCol].GetCellValue(nRow); ScRefCellValue aCell = aCol[nCol].GetCellValue(blockPos, nRow);
if (aCell.isEmpty()) if (aCell.isEmpty())
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment