summaryrefslogtreecommitdiff
path: root/sc/inc/dptabres.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-03 23:59:15 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-01-04 09:45:18 -0500
commit3b4f995cfd153e4d45d09f5f0fc54d1bb9c11889 (patch)
tree73fee2389bc77a6464bc65901ba55a91a0ee2ad1 /sc/inc/dptabres.hxx
parent4cc17f3b959110f1eb0c616847c0a821ce384186 (diff)
Remove SC_DP_MAX_FIELDS from ScDPRunningTotalState too.
Change-Id: I60bf45fd5148692adafb050189247f211293a3d1
Diffstat (limited to 'sc/inc/dptabres.hxx')
-rw-r--r--sc/inc/dptabres.hxx48
1 files changed, 25 insertions, 23 deletions
diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index 97cb230cd515..edef1b342aa6 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -96,41 +96,43 @@ struct ScDPSubTotalState
{}
};
-//
-// indexes when calculating running totals
-// Col/RowVisible: simple counts from 0 - without sort order applied - visible index
-// (only used for running total / relative index)
-// Col/RowIndexes: with sort order applied - member index
-// (used otherwise - so other members' children can be accessed)
-//
-
+/**
+ * indexes when calculating running totals
+ *
+ * Col/RowVisible: simple counts from 0 - without sort order applied
+ * - visible index (only used for running total / relative index)
+ *
+ * Col/RowSorted: with sort order applied - member index (used otherwise -
+ * so other members' children can be accessed).
+ */
class ScDPRunningTotalState
{
- ScDPResultMember* pColResRoot;
- ScDPResultMember* pRowResRoot;
- long* pColVisible;
- long* pColIndexes;
- long* pRowVisible;
- long* pRowIndexes;
- long nColIndexPos;
- long nRowIndexPos;
-
public:
- ScDPRunningTotalState( ScDPResultMember* pColRoot, ScDPResultMember* pRowRoot );
- ~ScDPRunningTotalState();
+ typedef std::vector<long> IndexArray; /// array of long integers terminated by -1.
+
+ ScDPRunningTotalState( ScDPResultMember* pColRoot, ScDPResultMember* pRowRoot );
ScDPResultMember* GetColResRoot() const { return pColResRoot; }
ScDPResultMember* GetRowResRoot() const { return pRowResRoot; }
- const long* GetColVisible() const { return pColVisible; }
- const long* GetColIndexes() const { return pColIndexes; }
- const long* GetRowVisible() const { return pRowVisible; }
- const long* GetRowIndexes() const { return pRowIndexes; }
+ const IndexArray& GetColVisible() const;
+ const IndexArray& GetColSorted() const;
+ const IndexArray& GetRowVisible() const;
+ const IndexArray& GetRowSorted() const;
void AddColIndex( long nVisible, long nSorted );
void AddRowIndex( long nVisible, long nSorted );
void RemoveColIndex();
void RemoveRowIndex();
+
+private:
+ ScDPResultMember* pColResRoot;
+ ScDPResultMember* pRowResRoot;
+
+ mutable IndexArray maColVisible;
+ mutable IndexArray maColSorted;
+ mutable IndexArray maRowVisible;
+ mutable IndexArray maRowSorted;
};
struct ScDPRelativePos