LibreOffice Module sc (master) 1
dpitemdata.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 */
9
10#pragma once
11
12#include "scdllapi.h"
13
14#include <sal/types.h>
15#include <rtl/ustring.h>
16#include <rtl/ustring.hxx>
17#include "calcmacros.hxx"
18#include "dpglobal.hxx"
19
29{
30 friend class ScDPCache;
31
32public:
33 enum Type { GroupValue = 0, RangeStart = 1, Value = 2, String = 3, Error = 4, Empty = 5 };
34
35 static const sal_Int32 DateFirst;
36 static const sal_Int32 DateLast;
37
39 {
40 sal_Int32 mnGroupType;
41 sal_Int32 mnValue;
42 };
43
44private:
45
46 union {
47 rtl_uString* mpString;
49 double mfValue;
50 };
51
54
55 void DisposeString();
56
57public:
58 // case insensitive equality
59 static sal_Int32 Compare(const ScDPItemData& rA, const ScDPItemData& rB);
60
62 ScDPItemData(const ScDPItemData& r);
63 ScDPItemData(const OUString& rStr);
64 ScDPItemData(sal_Int32 nGroupType, sal_Int32 nValue);
66
67 Type GetType() const { return static_cast<Type>(meType); }
68 void SetEmpty();
69 void SetString(const OUString& rS);
70 void SetStringInterned( rtl_uString* pS );
71 void SetValue(double fVal);
72 void SetRangeStart(double fVal);
73 void SetRangeFirst();
74 void SetRangeLast();
75 void SetErrorStringInterned( rtl_uString* pS );
76 bool IsCaseInsEqual(const ScDPItemData& r) const;
77
78 // exact equality
79 bool operator==(const ScDPItemData& r) const;
80 bool operator< (const ScDPItemData& r) const;
81
82 ScDPItemData& operator= (const ScDPItemData& r);
83
84 bool IsEmpty() const;
85 bool IsValue() const;
86 OUString GetString() const;
87 double GetValue() const;
88 GroupValueAttr GetGroupValue() const;
89 bool HasStringData() const ;
90
91 ScDPValue::Type GetCellType() const;
92
93#if DEBUG_PIVOT_TABLE
94 void Dump(const char* msg) const;
95#endif
96};
97
98/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class represents the cached data part of the datapilot cache table implementation.
Definition: dpcache.hxx:48
When assigning a string value, you can also assign an interned string whose life-cycle is managed by ...
Definition: dpitemdata.hxx:29
sal_uInt8 meType
Definition: dpitemdata.hxx:52
rtl_uString * mpString
Definition: dpitemdata.hxx:47
Type GetType() const
Definition: dpitemdata.hxx:67
double mfValue
Definition: dpitemdata.hxx:49
GroupValueAttr maGroupValue
Definition: dpitemdata.hxx:48
static const sal_Int32 DateFirst
Definition: dpitemdata.hxx:35
bool mbStringInterned
Definition: dpitemdata.hxx:53
static const sal_Int32 DateLast
Definition: dpitemdata.hxx:36
virtual void SetValue(tools::Long nNew) override
bool operator<(const ScDPCollection::DBType &left, const ScDPCollection::DBType &right)
Definition: dpobject.cxx:3941
OUString GetString(int nId)
void SetString(SwCursor &rCursor, const OUString &rString)
Error
Value
static short Compare(const OUString &sInput1, const OUString &sInput2, const bool bCaseSens, const ScUserListData *pData, const CollatorWrapper *pCW)
Naturally compares two given strings.
Definition: table3.cxx:162
Empty
std::string GetValue
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
unsigned char sal_uInt8
RedlineType meType
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:519