diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-20 11:12:49 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-20 20:19:28 -0400 |
commit | d5b4cb00bedd08ad72885defbc35c971b573ecd8 (patch) | |
tree | 42f0bd375c5f1b23120359b140b8cfbfecb220b1 /sc/inc/listenercontext.hxx | |
parent | fc470416281b92e6b481885b64d59bc01ea4c3a6 (diff) |
Keep track of column block positions when mass-pasting formula cells.
This speeds up the following scenario:
1) type =B1 in A1. Leave A2 empty.
2) Select A1:A2 and Ctrl-C to copy.
3) Select A3:A50000 (or longer if you so wish), and ctrl-V to paste.
This causes the broadcaster storage array in column B to be heavily
partitioned due to the empty cells interspersed between formula cells
in column A. Without tracking the column position this would cause a
O(n^2) complexity algorithm.
Change-Id: Ic2f23c2c2bea3353c517faa73fe5412c7528bd95
Diffstat (limited to 'sc/inc/listenercontext.hxx')
-rw-r--r-- | sc/inc/listenercontext.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/inc/listenercontext.hxx b/sc/inc/listenercontext.hxx index 36f26d82871e..2503e726408c 100644 --- a/sc/inc/listenercontext.hxx +++ b/sc/inc/listenercontext.hxx @@ -12,6 +12,7 @@ #include "address.hxx" #include "columnspanset.hxx" +#include "mtvelements.hxx" #include <boost/noncopyable.hpp> @@ -19,6 +20,17 @@ class ScDocument; namespace sc { +class StartListeningContext : boost::noncopyable +{ + ScDocument& mrDoc; + ColumnBlockPositionSet maSet; +public: + StartListeningContext(ScDocument& rDoc); + ScDocument& getDoc(); + + ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol); +}; + class EndListeningContext : boost::noncopyable { ScDocument& mrDoc; |