summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-09-02 14:45:27 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-09-02 15:52:35 -0400
commit69b6d6cfd29c2cfee92eef3faba03a78c671aac3 (patch)
treecc22913a61541b5b0dd5d664c0bfc8c3538f8ab0 /sc/inc
parent07d1d39fccbfef1638b7f3aaaed063f0d6f4ffa7 (diff)
Speed up range name lookup by index.
This should speed up formula calculations considerably during xls import since shared formulas are also stored in ScRangeName and they are looked up by index. (bnc#715104)
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/rangenam.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index 7b5036216851..a82b97887ebd 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -36,6 +36,7 @@
#include "scdllapi.h"
#include <map>
+#include <vector>
#include <boost/ptr_container/ptr_set.hpp>
#include <boost/ptr_container/ptr_map.hpp>
@@ -181,8 +182,10 @@ bool operator< (const ScRangeData& left, const ScRangeData& right);
class ScRangeName
{
private:
+ typedef std::vector<ScRangeData*> IndexDataType;
typedef ::boost::ptr_set<ScRangeData> DataType;
DataType maData;
+ IndexDataType maIndexToData;
public:
/// Map that manages stored ScRangeName instances.
@@ -230,6 +233,12 @@ public:
SC_DLLPUBLIC bool insert(ScRangeData* p);
void erase(const ScRangeData& r);
+
+ /**
+ * Erase by iterator position. Note that this method doesn't check for
+ * iterator's validity. The caller must make sure that the iterator is
+ * valid.
+ */
void erase(const iterator& itr);
void clear();
bool operator== (const ScRangeName& r) const;