diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-03-31 17:38:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-03-31 18:19:44 +0200 |
commit | d893a40c81357a25a4a89a62f6cf6122046068d5 (patch) | |
tree | 79ee8ed83816469984cef4c5e839dca0941786db /sw/inc | |
parent | 60bb7f3afe4fd8bb3ebb75a77f31f7ba5091eac4 (diff) |
tdf#154486: Use known name when inserting the table into the document
... instead of assinging a unique name at insertion time, then changing
to the final value.
As discussed in commit 1dd71d79e15bd8098e7c17c8fcea3748592a902f (tdf#154486:
use importer-local map to deduplicate table names, 2023-03-31), the lookup
for a unique table name has an O(n^2) complexity, and can make loading of
thousands tables impossible.
This changes import time from 23 s to ~2.5 s, and the time now depends on the
number of tables linearly (e.g., 200 000 tables load in ~45 s).
Change-Id: I0f2b5e37db2d370bccbc8c3430f895c864d9a4c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149840
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/doc.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 17d130a51be4..df07fbae0043 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1178,7 +1178,8 @@ public: const SwTableAutoFormat* pTAFormat = nullptr, const std::vector<sal_uInt16> *pColArr = nullptr, bool bCalledFromShell = false, - bool bNewModel = true ); + bool bNewModel = true, + const OUString& rTableName = {} ); // If index is in a table, return TableNode, else 0. static SwTableNode* IsIdxInTable( const SwNodeIndex& rIdx ); |