diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-03-16 21:44:55 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-03-16 23:24:46 -0400 |
commit | f81d15c3bab32938b5b475e16ae2a746a7a32ea9 (patch) | |
tree | 46b789f7e751c451c84ec3b57c8fc0b8cb0473cb /sc/inc/dpitemdata.hxx | |
parent | gb_JavaClassSet_add_package_dependency: order only is not enough (diff) | |
download | core-f81d15c3bab32938b5b475e16ae2a746a7a32ea9.tar.gz core-f81d15c3bab32938b5b475e16ae2a746a7a32ea9.zip |
Use shared string pool to share string instances among string item values.
This brings down the reload time from 22 seconds to 4.3 seconds with
my test document. This is what I've been looking for!
Diffstat (limited to 'sc/inc/dpitemdata.hxx')
-rw-r--r-- | sc/inc/dpitemdata.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx index e30eae3c156c..20535a8afb80 100644 --- a/sc/inc/dpitemdata.hxx +++ b/sc/inc/dpitemdata.hxx @@ -49,7 +49,7 @@ class SC_DLLPUBLIC ScDPItemData friend class ScDPCache; public: - enum Type { GroupValue = 0, RangeStart, Value, String, Error, Empty }; + enum Type { GroupValue = 0, RangeStart = 1, Value = 2, String = 3, Error = 4, Empty = 5 }; static const sal_Int32 DateFirst; static const sal_Int32 DateLast; @@ -63,12 +63,13 @@ public: private: union { - rtl::OUString* mpString; + const rtl::OUString* mpString; GroupValueAttr maGroupValue; double mfValue; }; - Type meType; + sal_uInt8 meType:3; + bool mbStringInterned:1; void DisposeString(); @@ -79,16 +80,19 @@ public: ScDPItemData(); ScDPItemData(const ScDPItemData& r); ScDPItemData(const rtl::OUString& rStr); + ScDPItemData(const rtl::OUString* pStr); ScDPItemData(sal_Int32 nGroupType, sal_Int32 nValue); ~ScDPItemData(); Type GetType() const; void SetString(const rtl::OUString& rS); + void SetString(const rtl::OUString* pS); void SetValue(double fVal); void SetRangeStart(double fVal); void SetRangeFirst(); void SetRangeLast(); void SetErrorString(const rtl::OUString& rS); + void SetErrorString(const rtl::OUString* pS); bool IsCaseInsEqual(const ScDPItemData& r) const; // exact equality |