1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef __SC_DPITEMDATA_HXX__
11 #define __SC_DPITEMDATA_HXX__
14 #include "address.hxx"
16 #include "sal/types.h"
17 #include "tools/solar.h"
18 #include "rtl/ustring.hxx"
19 #include "calcmacros.hxx"
20 #include "dpglobal.hxx"
23 * When assigning a string value, you can also assign an interned string
24 * whose life-cycle is managed by the pivot cache that it belongs to. Those
25 * methods that take a string pointer assume that the string is interned.
27 * <p>Do make sure that an item with an interned string won't persist after
28 * the pivot cache has been destroyed or reloaded.</p>
30 class SC_DLLPUBLIC ScDPItemData
32 friend class ScDPCache
;
35 enum Type
{ GroupValue
= 0, RangeStart
= 1, Value
= 2, String
= 3, Error
= 4, Empty
= 5 };
37 static const sal_Int32 DateFirst
;
38 static const sal_Int32 DateLast
;
42 sal_Int32 mnGroupType
;
48 size_t operator() (const ScDPItemData
& rVal
) const;
54 const OUString
* mpString
;
55 GroupValueAttr maGroupValue
;
60 bool mbStringInterned
:1;
65 // case insensitive equality
66 static sal_Int32
Compare(const ScDPItemData
& rA
, const ScDPItemData
& rB
);
69 ScDPItemData(const ScDPItemData
& r
);
70 ScDPItemData(const OUString
& rStr
);
71 ScDPItemData(sal_Int32 nGroupType
, sal_Int32 nValue
);
76 void SetString(const OUString
& rS
);
77 void SetString(const OUString
* pS
);
78 void SetValue(double fVal
);
79 void SetRangeStart(double fVal
);
82 void SetErrorString(const OUString
* pS
);
83 bool IsCaseInsEqual(const ScDPItemData
& r
) const;
86 bool operator==(const ScDPItemData
& r
) const;
87 bool operator!=(const ScDPItemData
& r
) const;
88 bool operator< (const ScDPItemData
& r
) const;
90 ScDPItemData
& operator= (const ScDPItemData
& r
);
94 OUString
GetString() const;
95 double GetValue() const;
96 GroupValueAttr
GetGroupValue() const;
97 bool HasStringData() const ;
99 ScDPValue::Type
GetCellType() const;
101 #if DEBUG_PIVOT_TABLE
102 void Dump(const char* msg
) const;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */