summaryrefslogtreecommitdiff
path: root/sc/inc/refupdatecontext.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-05-16 17:50:09 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-05-20 10:04:13 +0200
commitb81004e95638da19cbcaa7a61f9edd094a9eac31 (patch)
tree339cf686771522d70f60e0696ec16630da6e78f2 /sc/inc/refupdatecontext.hxx
parent5d5e308331e7166726264c43545798b5fb833c8a (diff)
cache mdds positions during ScDocument::CopyBlockFromClip() (tdf#112000)
Make RefUpdateContext and ScColumn::UpdateReferenceOnCopy() use the same sc::ColumnBlockPositionSet that CopyFromClipContext uses. Without it pathological cases like in tdf#112000 trigger quadratic cost because of repeated mdds searches from the start. Includes also an mdds patch that allows it to search backwards from a position hint. Without it, this would be very difficult to fix otherwise, as CopyFromClip() in ScDocument::CopyBlockFromClip() moves the position hint past the area that UpdateReferenceOnCopy() would use. It also just plain makes sense to try to go backwards in an std::vector. Change-Id: I985e3a40e4abf1a824e55c76d82579882fa75cc2 Reviewed-on: https://gerrit.libreoffice.org/72424 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc/refupdatecontext.hxx')
-rw-r--r--sc/inc/refupdatecontext.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/inc/refupdatecontext.hxx b/sc/inc/refupdatecontext.hxx
index 7b5afe926e1a..bc86cb9e1afe 100644
--- a/sc/inc/refupdatecontext.hxx
+++ b/sc/inc/refupdatecontext.hxx
@@ -21,6 +21,9 @@ class ScDocument;
namespace sc {
+struct ColumnBlockPosition;
+class ColumnBlockPositionSet;
+
/**
* Keep track of all named expressions that have been updated during
* reference update.
@@ -76,10 +79,15 @@ struct RefUpdateContext
UpdatedRangeNames maUpdatedNames;
ColumnSet maRegroupCols;
+ ColumnBlockPositionSet* mpBlockPos; // not owning
+
RefUpdateContext(ScDocument& rDoc);
bool isInserted() const;
bool isDeleted() const;
+
+ void setBlockPositionReference( ColumnBlockPositionSet* blockPos );
+ ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
};
struct RefUpdateResult