summaryrefslogtreecommitdiff
path: root/sw/inc/doc.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-31 10:22:28 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-11-14 13:26:01 +0100
commita6b78999adc23f70071de811d36c19ce01aee013 (patch)
tree83f1effefca682d25dba758536458a215ee06e21 /sw/inc/doc.hxx
parent5b09df234f11e4d964170e8872897552cdf71021 (diff)
SwDBManager::MergeMailFiles: set unique fly names at the end of the merge
When generating a unique fly name, we have to iterate over all the existing flys to find out what's the first not used one, so doing this for every new fly inserted by mail merge is O(n^2). During import, we already skip this and only do it once at the end of the import, which is O(n). Fix the performance problem by skipping the unique fly name generating when we produce a combined mail merge document as well, and just generate them once the mail merge is complete. For a test document having 12 text frames and 2000 mail merge records, the times for css::text::MailMerge::execute() is 9m37.330s -> 8m18.811s. Conflicts: sw/inc/doc.hxx sw/source/core/doc/DocumentLayoutManager.cxx sw/source/uibase/dbui/dbmgr.cxx Change-Id: Idfa8e9fe3acc93f1138f5bb12c2419c1492f8ff1
Diffstat (limited to 'sw/inc/doc.hxx')
-rw-r--r--sw/inc/doc.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 86aae2817d6c..c7d7af8de5ef 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -436,6 +436,7 @@ private:
bool mbCopyIsMove : 1; ///< TRUE: Copy is a hidden Move.
bool mbVisibleLinks : 1; ///< TRUE: Links are inserted visibly.
bool mbInReading : 1; ///< TRUE: Document is in the process of being read.
+ bool mbInMailMerge : 1; //< TRUE: Document is in the process of being written by mail merge.
bool mbInXMLImport : 1; ///< TRUE: During xml import, attribute portion building is not necessary.
bool mbUpdateTOX : 1; ///< TRUE: After loading document, update TOX.
bool mbInLoadAsynchron : 1; ///< TRUE: Document is in the process of being loaded asynchronously.
@@ -1428,6 +1429,9 @@ public:
bool IsInReading() const { return mbInReading; }
void SetInReading( bool bNew ) { mbInReading = bNew; }
+ bool IsInMailMerge() const { return mbInMailMerge; }
+ void SetInMailMerge( bool bNew ) { mbInMailMerge = bNew; }
+
bool IsClipBoard() const { return mbClipBoard; }
/// N.B.: must be called right after constructor! (@see GetXmlIdRegistry)
void SetClipBoard( bool bNew ) { mbClipBoard = bNew; }