summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-03-14 15:51:07 +0100
committerAndras Timar <andras.timar@collabora.com>2019-03-18 09:59:57 +0100
commit0b2d434106c50785b1c0317d49368c0dc6d084b0 (patch)
treea60566f85a0c9f74969b7cea8d32b0bd1be86670
parent397200422594f71eec4012ecd625d1467984f485 (diff)
DOCX autotext import: speed up handling of large amount of blocks
WW8Glossary::Load() does the same for the DOC autotext import. Old cost for a document with 2508 document parts: 843842 ms. New cost for the same document: 46572 ms (5% of baseline). (cherry picked from commit 87670fa998a26ab059e40bbe8f5e0acf0ad6ea04) Change-Id: If0ff183315cb7465dd2b32c1a4fc856b50611265 Reviewed-on: https://gerrit.libreoffice.org/69381 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sw/source/filter/docx/swdocxreader.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx
index 4386de8fdc3e..1924e13dbf86 100644
--- a/sw/source/filter/docx/swdocxreader.cxx
+++ b/sw/source/filter/docx/swdocxreader.cxx
@@ -127,7 +127,14 @@ bool SwDOCXReader::ReadGlossaries( SwTextBlocks& rBlocks, bool /* bSaveRelFiles
}));
if( xFilter->filter( aDescriptor ) )
- return MakeEntries( static_cast<SwDocShell*>( &xDocSh )->GetDoc(), rBlocks );
+ {
+ if (rBlocks.StartPutMuchBlockEntries())
+ {
+ bool bRet = MakeEntries(static_cast<SwDocShell*>(&xDocSh)->GetDoc(), rBlocks);
+ rBlocks.EndPutMuchBlockEntries();
+ return bRet;
+ }
+ }
}
return false;