summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-07 14:58:19 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-02-08 18:33:18 -0500
commitd261c7cf961f83bea51ca36b53affd95c24ee044 (patch)
tree1add94e4ded1fce7ded58e2dc16f9e225b129cef
parent1d3124675ae5a33afe2c417a198557f20dc689e0 (diff)
TypedStrData to hold rtl::OUString.
-rw-r--r--sc/inc/collect.hxx30
-rw-r--r--sc/source/core/tool/collect.cxx30
2 files changed, 39 insertions, 21 deletions
diff --git a/sc/inc/collect.hxx b/sc/inc/collect.hxx
index e0d4f8f8cfc2..8a58ded63e90 100644
--- a/sc/inc/collect.hxx
+++ b/sc/inc/collect.hxx
@@ -115,31 +115,23 @@ public:
class TypedStrData : public ScDataObject
{
+ friend class TypedScStrCollection;
public:
- TypedStrData( const String& rStr, double nVal = 0.0,
- sal_uInt16 nType = SC_STRTYPE_STANDARD )
- : aStrValue(rStr),
- nValue(nVal),
- nStrType(nType) {}
-
- TypedStrData( const TypedStrData& rCpy )
- : ScDataObject(),
- aStrValue(rCpy.aStrValue),
- nValue(rCpy.nValue),
- nStrType(rCpy.nStrType) {}
+ TypedStrData( const rtl::OUString& rStr, double nVal = 0.0,
+ sal_uInt16 nType = SC_STRTYPE_STANDARD );
+
+ TypedStrData( const TypedStrData& rCpy );
virtual ScDataObject* Clone() const;
- sal_Bool IsStrData() const { return nStrType != 0; }
- const String& GetString() const { return aStrValue; }
- double GetValue () const { return nValue; }
+ bool IsStrData() const;
+ SC_DLLPUBLIC const rtl::OUString& GetString() const;
+ double GetValue() const;
private:
- friend class TypedScStrCollection;
-
- String aStrValue;
- double nValue;
- sal_uInt16 nStrType; // 0 = Value
+ rtl::OUString aStrValue;
+ double nValue;
+ sal_uInt16 nStrType; // 0 = Value
};
class SC_DLLPUBLIC TypedScStrCollection : public ScSortedCollection
diff --git a/sc/source/core/tool/collect.cxx b/sc/source/core/tool/collect.cxx
index f0ba17837782..1234cd760d6d 100644
--- a/sc/source/core/tool/collect.cxx
+++ b/sc/source/core/tool/collect.cxx
@@ -306,12 +306,38 @@ sal_Bool ScSortedCollection::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) c
// TypedScStrCollection
//------------------------------------------------------------------------
-
-ScDataObject* TypedStrData::Clone() const
+TypedStrData::TypedStrData(
+ const rtl::OUString& rStr, double nVal, sal_uInt16 nType ) :
+ aStrValue(rStr),
+ nValue(nVal),
+ nStrType(nType) {}
+
+TypedStrData::TypedStrData( const TypedStrData& rCpy ) :
+ ScDataObject(),
+ aStrValue(rCpy.aStrValue),
+ nValue(rCpy.nValue),
+ nStrType(rCpy.nStrType) {}
+
+ScDataObject* TypedStrData::Clone() const
{
return new TypedStrData(*this);
}
+bool TypedStrData::IsStrData() const
+{
+ return nStrType != 0;
+}
+
+const rtl::OUString& TypedStrData::GetString() const
+{
+ return aStrValue;
+}
+
+double TypedStrData::GetValue () const
+{
+ return nValue;
+}
+
TypedScStrCollection::TypedScStrCollection( sal_uInt16 nLim , sal_uInt16 nDel , sal_Bool bDup )
: ScSortedCollection( nLim, nDel, bDup )
{