summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-02-25 22:56:00 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-02-26 07:59:11 +0100
commit4a896078a332c0270276e9a89b01f415e2238b27 (patch)
tree59d2a63cb4d51514c35761bd8d612c5a9d799602 /sc
parent6819ff8549d0a247e9e16f98eddbb7abd287d123 (diff)
lock paint when VBA sets value for a number of Calc cells
VBAMacroTest::testVba() spends the majority of time repeatedly repainting. Change-Id: Iea69221834b80b0fbe484ee3ec5f64ba9e28e37d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130569 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbarange.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 0c0e5f256e02..fb72699ea98b 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1477,6 +1477,11 @@ uno::Reference< XCollection >& ScVbaRange::getBorders()
void
ScVbaRange::visitArray( ArrayVisitor& visitor )
{
+ ScDocShell* pDocSh = nullptr;
+ if(ScCellRangeObj* range = dynamic_cast<ScCellRangeObj*>(mxRange.get()))
+ pDocSh = range->GetDocShell();
+ if ( pDocSh )
+ pDocSh->LockPaint();
table::CellRangeAddress aRangeAddr = lclGetRangeAddress( mxRange );
sal_Int32 nRowCount = aRangeAddr.EndRow - aRangeAddr.StartRow + 1;
sal_Int32 nColCount = aRangeAddr.EndColumn - aRangeAddr.StartColumn + 1;
@@ -1489,6 +1494,8 @@ ScVbaRange::visitArray( ArrayVisitor& visitor )
visitor.visitNode( i, j, xCell );
}
}
+ if ( pDocSh )
+ pDocSh->UnlockPaint();
}
uno::Any