Kaydet (Commit) 19049550 authored tarafından Eike Rathke's avatar Eike Rathke

sc-perf: lock drawing layer during creation of captions for Save

This gives an extra boost compared to commit
451c4ccc (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
üst 4c46c304
......@@ -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);
......
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