diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-03-14 15:51:07 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-03-14 21:47:05 +0100 |
commit | 87670fa998a26ab059e40bbe8f5e0acf0ad6ea04 (patch) | |
tree | fc5f6271e9fe29ed0da3aa56da101ba287a0cba7 | |
parent | 8badaf19f78ef5641ba6074208fd85405453b2da (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).
Change-Id: If0ff183315cb7465dd2b32c1a4fc856b50611265
Reviewed-on: https://gerrit.libreoffice.org/69271
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/filter/docx/swdocxreader.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx index dd130751bac4..3a5edd2fd41f 100644 --- a/sw/source/filter/docx/swdocxreader.cxx +++ b/sw/source/filter/docx/swdocxreader.cxx @@ -137,7 +137,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; |