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

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: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 8a35ae3e
......@@ -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;
......
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