diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-05-16 15:59:58 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-05-17 14:46:26 +0200 |
commit | 390bd27d92971d9f523b20510554334e30ae9b9d (patch) | |
tree | b1ff3daafabf9ae1765866b3a74747ec104df242 | |
parent | 8a35ae3e6c5c45aa1426cfd81472b309d02a1b48 (diff) |
cache mdds position in ScAttrArray::RemoveCellCharAttribs() (tdf#108298)
Once more, mdds normally starts a container search from the beginning,
so this is quadratic. Doesn't happen with the bugdoc after Ctrl+A,
ScAttrArray::SetPatternAreaImpl() special-cases that, but with explicitly
giving a range this triggers.
Change-Id: Ic1177c1a115ffde23d7e11a90156ae05e02d067d
Reviewed-on: https://gerrit.libreoffice.org/72416
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | sc/source/core/data/attarray.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 3805ad4fa662..9431c468bfe6 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -42,6 +42,7 @@ #include <editdataarray.hxx> #include <cellvalue.hxx> #include <editutil.hxx> +#include <mtvelements.hxx> #include <memory> using ::editeng::SvxBorderLine; @@ -397,10 +398,13 @@ void ScAttrArray::RemoveCellCharAttribs( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr* pPattern, ScEditDataArray* pDataArray ) { assert( nCol != -1 ); + // cache mdds position, this doesn't modify the mdds container, just EditTextObject's + sc::ColumnBlockPosition blockPos; + pDocument->InitColumnBlockPosition( blockPos, nTab, nCol ); for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow) { ScAddress aPos(nCol, nRow, nTab); - ScRefCellValue aCell(*pDocument, aPos); + ScRefCellValue aCell(*pDocument, aPos, blockPos); if (aCell.meType != CELLTYPE_EDIT || !aCell.mpEditText) continue; |