diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-01 23:08:14 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-02 13:19:32 -0400 |
commit | cfb2ce587b097b407eb15699cff7ce9fb6844123 (patch) | |
tree | 9ca222bdaf03e11ae3c3951ac84d0b3a2ce92aeb /sc/inc/columnspanset.hxx | |
parent | gtk3: Clearlooks theme paints scrollbar buttons depending on the style class (diff) | |
download | core-cfb2ce587b097b407eb15699cff7ce9fb6844123.tar.gz core-cfb2ce587b097b407eb15699cff7ce9fb6844123.zip |
Re-implement the COUNT function for efficiency.
By taking advantage of the block structure of the new cell storage.
Change-Id: Ib953c14d364ccdff7df5caf70d57cec86189e3be
Diffstat (limited to 'sc/inc/columnspanset.hxx')
-rw-r--r-- | sc/inc/columnspanset.hxx | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx index 55c3f57507e9..98533e240f37 100644 --- a/sc/inc/columnspanset.hxx +++ b/sc/inc/columnspanset.hxx @@ -16,8 +16,10 @@ #include <mdds/flat_segment_tree.hpp> #include <boost/noncopyable.hpp> +class ScDocument; class ScColumn; class ScMarkData; +class ScRange; namespace sc { @@ -30,12 +32,22 @@ struct ColumnBlockConstPosition; class ColumnSpanSet : boost::noncopyable { typedef mdds::flat_segment_tree<SCROW, bool> ColumnSpansType; - typedef std::vector<ColumnSpansType*> TableType; + + struct ColumnType + { + ColumnSpansType maSpans; + ColumnSpansType::const_iterator miPos; + + ColumnType(SCROW nStart, SCROW nEnd, bool bInit); + }; + + typedef std::vector<ColumnType*> TableType; typedef std::vector<TableType*> DocType; DocType maDoc; + bool mbInit; - ColumnSpansType& getColumnSpans(SCTAB nTab, SCCOL nCol); + ColumnType& getColumn(SCTAB nTab, SCCOL nCol); public: class Action @@ -46,12 +58,23 @@ public: virtual void execute(const ScAddress& rPos, SCROW nLength, bool bVal) = 0; }; + class ColumnAction + { + public: + virtual ~ColumnAction() = 0; + virtual void startColumn(ScColumn* pCol) = 0; + virtual void execute(SCROW nRow1, SCROW nRow2, bool bVal) = 0; + }; + + ColumnSpanSet(bool bInit); ~ColumnSpanSet(); void set(SCTAB nTab, SCCOL nCol, SCROW nRow, bool bVal); void set(SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, bool bVal); + void set(const ScRange& rRange, bool bVal); - void executeFromTop(Action& ac) const; + void executeAction(Action& ac) const; + void executeColumnAction(ScDocument& rDoc, ColumnAction& ac) const; }; /** |