LibreOffice Module sc (master) 1
Public Member Functions | Private Attributes | List of all members
XclPCItem Class Reference

Represents a data item of any type in a pivot cache. More...

#include <xlpivot.hxx>

Inheritance diagram for XclPCItem:
[legend]
Collaboration diagram for XclPCItem:
[legend]

Public Member Functions

 XclPCItem ()
 
virtual ~XclPCItem ()
 
 XclPCItem (XclPCItem const &)=default
 
 XclPCItem (XclPCItem &&)=default
 
XclPCItemoperator= (XclPCItem const &)=default
 
XclPCItemoperator= (XclPCItem &&)=default
 
void SetEmpty ()
 Sets the item to 'empty' type. More...
 
void SetText (const OUString &rText)
 Sets the item to 'text' type and adds the passed text. More...
 
void SetDouble (double fValue, const OUString &rText=OUString())
 Sets the item to 'double' type and adds the passed value. More...
 
void SetDateTime (const DateTime &rDateTime, const OUString &rText=OUString())
 Sets the item to 'date/time' type and adds the passed date. More...
 
void SetInteger (sal_Int16 nValue)
 Sets the item to 'integer' type and adds the passed value. More...
 
void SetError (sal_uInt16 nError)
 Sets the item to 'error' type and adds the passed Excel error code. More...
 
void SetBool (bool bValue, const OUString &rText=OUString())
 Sets the item to 'boolean' type and adds the passed Boolean value. More...
 
const OUString & ConvertToText () const
 Returns the text representation of the item. More...
 
bool IsEqual (const XclPCItem &rItem) const
 Returns true, if the passed term equals this item. More...
 
bool IsEmpty () const
 Returns true, if the item type is 'empty'. More...
 
const OUString * GetText () const
 Returns pointer to text, if the item type is 'text', otherwise 0. More...
 
const double * GetDouble () const
 Returns pointer to value, if the item type is 'double', otherwise 0. More...
 
const DateTimeGetDateTime () const
 Returns pointer to date, if the item type is 'date/time', otherwise 0. More...
 
const sal_Int16 * GetInteger () const
 Returns pointer to integer, if the item type is 'integer', otherwise 0. More...
 
const sal_uInt16 * GetError () const
 Returns pointer to error code, if the item type is 'error', otherwise 0. More...
 
const bool * GetBool () const
 Returns pointer to Boolean value, if the item type is 'boolean', otherwise 0. More...
 
XclPCItemType GetType () const
 Returns the type of the item. More...
 

Private Attributes

XclPCItemType meType
 
OUString maText
 Type of the item. More...
 
DateTime maDateTime
 Text representation of the item. More...
 
union {
   double   mfValue
 
   sal_Int16   mnValue
 Value of a floating-point item. More...
 
   sal_uInt16   mnError
 Value of an integer item. More...
 
   bool   mbValue
 Error code of an error item. More...
 
}; 
 Value of a date/time item. More...
 

Detailed Description

Represents a data item of any type in a pivot cache.

Supposed as base class for import and export.

Definition at line 366 of file xlpivot.hxx.

Constructor & Destructor Documentation

◆ XclPCItem() [1/3]

XclPCItem::XclPCItem ( )
explicit

Definition at line 45 of file xlpivot.cxx.

References EMPTY, and meType.

◆ ~XclPCItem()

XclPCItem::~XclPCItem ( )
virtual

Definition at line 51 of file xlpivot.cxx.

◆ XclPCItem() [2/3]

XclPCItem::XclPCItem ( XclPCItem const &  )
default

◆ XclPCItem() [3/3]

XclPCItem::XclPCItem ( XclPCItem &&  )
default

Member Function Documentation

◆ ConvertToText()

const OUString & XclPCItem::ConvertToText ( ) const
inline

Returns the text representation of the item.

Definition at line 393 of file xlpivot.hxx.

References maText.

Referenced by XclExpPCField::GetItemIndex(), and XclExpPTItem::GetItemName().

◆ GetBool()

const bool * XclPCItem::GetBool ( ) const

Returns pointer to Boolean value, if the item type is 'boolean', otherwise 0.

Definition at line 160 of file xlpivot.cxx.

References EXC_PCITEM_BOOL, mbValue, and meType.

Referenced by XclExpPCItem::EqualsBool(), XclImpPTItem::GetItemName(), XclExpPCItem::WriteBody(), and XclImpPCItem::WriteToSource().

◆ GetDateTime()

const DateTime * XclPCItem::GetDateTime ( ) const

Returns pointer to date, if the item type is 'date/time', otherwise 0.

Definition at line 145 of file xlpivot.cxx.

References EXC_PCITEM_DATETIME, maDateTime, and meType.

Referenced by XclExpPCItem::EqualsDateTime(), XclImpPTItem::GetItemName(), XclExpPCItem::WriteBody(), and XclImpPCItem::WriteToSource().

◆ GetDouble()

const double * XclPCItem::GetDouble ( ) const

Returns pointer to value, if the item type is 'double', otherwise 0.

Definition at line 140 of file xlpivot.cxx.

References EXC_PCITEM_DOUBLE, meType, and mfValue.

Referenced by XclExpPCItem::EqualsDouble(), XclImpPTItem::GetItemName(), XclExpPCItem::WriteBody(), and XclImpPCItem::WriteToSource().

◆ GetError()

const sal_uInt16 * XclPCItem::GetError ( ) const

Returns pointer to error code, if the item type is 'error', otherwise 0.

Definition at line 155 of file xlpivot.cxx.

References EXC_PCITEM_ERROR, meType, and mnError.

Referenced by XclImpPCItem::WriteToSource().

◆ GetInteger()

const sal_Int16 * XclPCItem::GetInteger ( ) const

Returns pointer to integer, if the item type is 'integer', otherwise 0.

Definition at line 150 of file xlpivot.cxx.

References EXC_PCITEM_INTEGER, meType, and mnValue.

Referenced by XclImpPTItem::GetItemName(), XclExpPCItem::WriteBody(), and XclImpPCItem::WriteToSource().

◆ GetText()

const OUString * XclPCItem::GetText ( ) const

Returns pointer to text, if the item type is 'text', otherwise 0.

Definition at line 135 of file xlpivot.cxx.

References EXC_PCITEM_ERROR, EXC_PCITEM_TEXT, maText, and meType.

Referenced by XclExpPCItem::EqualsText(), XclImpPTItem::GetItemName(), XclExpPCItem::WriteBody(), and XclImpPCItem::WriteToSource().

◆ GetType()

XclPCItemType XclPCItem::GetType ( ) const

Returns the type of the item.

Definition at line 165 of file xlpivot.cxx.

References meType.

Referenced by XclImpPTItem::GetItemName().

◆ IsEmpty()

bool XclPCItem::IsEmpty ( ) const

Returns true, if the item type is 'empty'.

Definition at line 130 of file xlpivot.cxx.

References EXC_PCITEM_EMPTY, and meType.

Referenced by XclExpPCItem::EqualsText(), and XclExpPCItem::WriteBody().

◆ IsEqual()

bool XclPCItem::IsEqual ( const XclPCItem rItem) const

Returns true, if the passed term equals this item.

Definition at line 113 of file xlpivot.cxx.

References EXC_PCITEM_BOOL, EXC_PCITEM_DATETIME, EXC_PCITEM_DOUBLE, EXC_PCITEM_EMPTY, EXC_PCITEM_ERROR, EXC_PCITEM_INTEGER, EXC_PCITEM_INVALID, EXC_PCITEM_TEXT, maDateTime, maText, mbValue, meType, mfValue, mnError, and mnValue.

Referenced by operator==().

◆ operator=() [1/2]

XclPCItem & XclPCItem::operator= ( XclPCItem &&  )
default

◆ operator=() [2/2]

XclPCItem & XclPCItem::operator= ( XclPCItem const &  )
default

◆ SetBool()

void XclPCItem::SetBool ( bool  bValue,
const OUString &  rText = OUString() 
)

Sets the item to 'boolean' type and adds the passed Boolean value.

Definition at line 106 of file xlpivot.cxx.

References EXC_PCITEM_BOOL, maText, mbValue, and meType.

Referenced by XclImpPCItem::ReadSxboolean(), and XclExpPCItem::XclExpPCItem().

◆ SetDateTime()

void XclPCItem::SetDateTime ( const DateTime rDateTime,
const OUString &  rText = OUString() 
)

Sets the item to 'date/time' type and adds the passed date.

Definition at line 74 of file xlpivot.cxx.

References EXC_PCITEM_DATETIME, maDateTime, maText, and meType.

Referenced by XclImpPCItem::ReadSxdatetime(), and XclExpPCItem::XclExpPCItem().

◆ SetDouble()

void XclPCItem::SetDouble ( double  fValue,
const OUString &  rText = OUString() 
)

Sets the item to 'double' type and adds the passed value.

Definition at line 67 of file xlpivot.cxx.

References EXC_PCITEM_DOUBLE, maText, meType, and mfValue.

Referenced by XclImpPCItem::ReadSxdouble(), and XclExpPCItem::XclExpPCItem().

◆ SetEmpty()

void XclPCItem::SetEmpty ( )

Sets the item to 'empty' type.

Definition at line 55 of file xlpivot.cxx.

References EXC_PCITEM_EMPTY, maText, and meType.

Referenced by XclImpPCItem::ReadSxempty(), and XclExpPCItem::XclExpPCItem().

◆ SetError()

void XclPCItem::SetError ( sal_uInt16  nError)

Sets the item to 'error' type and adds the passed Excel error code.

Definition at line 88 of file xlpivot.cxx.

References EXC_PCITEM_ERROR, maText, meType, and mnError.

Referenced by XclImpPCItem::ReadSxerror().

◆ SetInteger()

void XclPCItem::SetInteger ( sal_Int16  nValue)

Sets the item to 'integer' type and adds the passed value.

Definition at line 81 of file xlpivot.cxx.

References EXC_PCITEM_INTEGER, maText, meType, mnValue, and nValue.

Referenced by XclImpPCItem::ReadSxinteger(), and XclExpPCItem::XclExpPCItem().

◆ SetText()

void XclPCItem::SetText ( const OUString &  rText)

Sets the item to 'text' type and adds the passed text.

Definition at line 61 of file xlpivot.cxx.

References EXC_PCITEM_TEXT, maText, and meType.

Referenced by XclImpPCItem::ReadSxstring(), and XclExpPCItem::XclExpPCItem().

Member Data Documentation

◆ 

union { ... } XclPCItem::@5

Value of a date/time item.

◆ maDateTime

DateTime XclPCItem::maDateTime
private

Text representation of the item.

Definition at line 419 of file xlpivot.hxx.

Referenced by GetDateTime(), IsEqual(), and SetDateTime().

◆ maText

OUString XclPCItem::maText
private

Type of the item.

Definition at line 418 of file xlpivot.hxx.

Referenced by ConvertToText(), GetText(), IsEqual(), SetBool(), SetDateTime(), SetDouble(), SetEmpty(), SetError(), SetInteger(), and SetText().

◆ mbValue

bool XclPCItem::mbValue

Error code of an error item.

Definition at line 425 of file xlpivot.hxx.

Referenced by GetBool(), IsEqual(), and SetBool().

◆ meType

XclPCItemType XclPCItem::meType
private

◆ mfValue

double XclPCItem::mfValue

Definition at line 422 of file xlpivot.hxx.

Referenced by GetDouble(), IsEqual(), and SetDouble().

◆ mnError

sal_uInt16 XclPCItem::mnError

Value of an integer item.

Definition at line 424 of file xlpivot.hxx.

Referenced by GetError(), IsEqual(), and SetError().

◆ mnValue

sal_Int16 XclPCItem::mnValue

Value of a floating-point item.

Definition at line 423 of file xlpivot.hxx.

Referenced by GetInteger(), IsEqual(), and SetInteger().


The documentation for this class was generated from the following files: