summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-11-19 19:28:14 +0100
committerEike Rathke <erack@redhat.com>2016-11-19 19:33:33 +0100
commit190495509e7830a5df12d002c56222209edc348d (patch)
tree1ed3d0c19db042f4cfeb8ef9eb52767632f7cf07 /sc/source/filter/xml
parent4c46c3046fb922f65b562e893e59d6b67ea5b2c2 (diff)
sc-perf: lock drawing layer during creation of captions for Save
This gives an extra boost compared to commit 451c4cccc7e3ec3f1e046d3232cb52f6fc443f59 (see there for further details) as it eliminates broadcasts to accessibility and thus obtaining text forwarders and what not. ScPostIt::CreateCaptionFromInitData() compared to that commit from 145,055,889,118 to 63,386,691,509 Overall ScDocShell::SaveXML() from original state before that commit Before: 370,433,720,090 After: 107,468,180,524 Reduced to 29% or speed-up by factor 3.45 Change-Id: Ife86476c9654739ed9adf25e775f7568ea9934c2
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 7aa54c029138..f170f31f1b33 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -719,8 +719,22 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC
bool ScXMLImportWrapper::Export(bool bStylesOnly)
{
+ // Prevent all broadcasting and repaints and notification of accessibility
+ // during mass creation of captions, which is a major bottleneck and not
+ // needed during Save.
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
+ bool bOldLock = bool();
+ if (pDrawLayer)
+ {
+ bOldLock = pDrawLayer->isLocked();
+ pDrawLayer->setLock(true);
+ }
+
rDoc.CreateAllNoteCaptions();
+ if (pDrawLayer)
+ pDrawLayer->setLock(bOldLock);
+
uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
uno::Reference<xml::sax::XWriter> xWriter = xml::sax::Writer::create(xContext);