diff options
Diffstat (limited to 'sc/inc/collect.hxx')
-rw-r--r-- | sc/inc/collect.hxx | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/sc/inc/collect.hxx b/sc/inc/collect.hxx index 08aa75630f55..2eb223b94455 100644 --- a/sc/inc/collect.hxx +++ b/sc/inc/collect.hxx @@ -42,8 +42,7 @@ #define MAXDELTA 1024 #define SCPOS_INVALID USHRT_MAX -#define SC_STRTYPE_VALUE 0 -#define SC_STRTYPE_STANDARD 1 +#include <boost/ptr_container/ptr_set.hpp> class ScDocument; @@ -113,9 +112,8 @@ public: // TypedScStrCollection: wie ScStrCollection, nur, dass Zahlen vor Strings // sortiert werden -class TypedStrData : public ScDataObject +class TypedStrData { - friend class TypedScStrCollection; public: enum StringType { Value = 0, @@ -130,39 +128,48 @@ public: TypedStrData( const TypedStrData& rCpy ); - virtual ScDataObject* Clone() const; - bool IsStrData() const; SC_DLLPUBLIC const rtl::OUString& GetString() const; double GetValue() const; + StringType GetStringType() const; -private: - rtl::OUString maStrValue; - double mfValue; - StringType meStrType; // 0 = Value -}; + struct LessCaseSensitive : std::binary_function<TypedStrData, TypedStrData, bool> + { + bool operator() (const TypedStrData& left, const TypedStrData& right) const; + }; -class SC_DLLPUBLIC TypedScStrCollection : public ScSortedCollection -{ -private: - sal_Bool bCaseSensitive; + struct LessCaseInsensitive : std::binary_function<TypedStrData, TypedStrData, bool> + { + bool operator() (const TypedStrData& left, const TypedStrData& right) const; + }; -public: - TypedScStrCollection( sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false ); + struct EqualCaseSensitive : std::binary_function<TypedStrData, TypedStrData, bool> + { + bool operator() (const TypedStrData& left, const TypedStrData& right) const; + }; - TypedScStrCollection( const TypedScStrCollection& rCpy ) - : ScSortedCollection( rCpy ) { bCaseSensitive = rCpy.bCaseSensitive; } - ~TypedScStrCollection(); + struct EqualCaseInsensitive : std::binary_function<TypedStrData, TypedStrData, bool> + { + bool operator() (const TypedStrData& left, const TypedStrData& right) const; + }; - virtual ScDataObject* Clone() const; - virtual short Compare( ScDataObject* pKey1, ScDataObject* pKey2 ) const; + bool operator== (const TypedStrData& r) const; + bool operator< (const TypedStrData& r) const; - TypedStrData* operator[]( const sal_uInt16 nIndex) const; - void SetCaseSensitive( sal_Bool bSet ); +private: + rtl::OUString maStrValue; + double mfValue; + StringType meStrType; +}; - sal_Bool FindText( const String& rStart, String& rResult, sal_uInt16& rPos, sal_Bool bBack ) const; - sal_Bool GetExactMatch( String& rString ) const; +class FindTypedStrData : std::unary_function<TypedStrData, bool> +{ + TypedStrData maVal; + bool mbCaseSens; +public: + FindTypedStrData(const TypedStrData& rVal, bool bCaseSens); + bool operator() (const TypedStrData& r) const; }; #endif |