LibreOffice Module sc (master)  1
Public Member Functions | Public Attributes | List of all members
ScCellValue Struct Reference

Store arbitrary cell value of any kind. More...

#include <cellvalue.hxx>

Collaboration diagram for ScCellValue:
[legend]

Public Member Functions

 ScCellValue ()
 
 ScCellValue (const ScRefCellValue &rCell)
 
 ScCellValue (double fValue)
 
 ScCellValue (const svl::SharedString &rString)
 
 ScCellValue (const ScCellValue &r)
 
 ScCellValue (ScCellValue &&r) noexcept
 
 ~ScCellValue ()
 
void clear () noexcept
 
void set (double fValue)
 
void set (const svl::SharedString &rStr)
 
void set (const EditTextObject &rEditText)
 
void set (EditTextObject *pEditText)
 
void set (ScFormulaCell *pFormula)
 
void assign (const ScDocument &rDoc, const ScAddress &rPos)
 Take cell value from specified position in specified document. More...
 
void assign (const ScCellValue &rOther, ScDocument &rDestDoc, ScCloneFlags nCloneFlags=ScCloneFlags::Default)
 
void commit (ScDocument &rDoc, const ScAddress &rPos) const
 Set cell value at specified position in specified document. More...
 
void commit (ScColumn &rColumn, SCROW nRow) const
 
void release (ScDocument &rDoc, const ScAddress &rPos)
 Set cell value at specified position in specified document. More...
 
void release (ScColumn &rColumn, SCROW nRow, sc::StartListeningType eListenType=sc::SingleCellListening)
 
OUString getString (const ScDocument &rDoc) const
 
bool isEmpty () const
 
bool equalsWithoutFormat (const ScCellValue &r) const
 
ScCellValueoperator= (const ScCellValue &r)
 
ScCellValueoperator= (ScCellValue &&r) noexcept
 
ScCellValueoperator= (const ScRefCellValue &r)
 
void swap (ScCellValue &r)
 

Public Attributes

CellType meType
 
union {
   double   mfValue
 
   svl::SharedString *   mpString
 
   EditTextObject *   mpEditText
 
   ScFormulaCell *   mpFormula
 
}; 
 

Detailed Description

Store arbitrary cell value of any kind.

It only stores cell value and nothing else. It creates a copy of the original cell value, and manages the life cycle of the copied value.

Definition at line 36 of file cellvalue.hxx.

Constructor & Destructor Documentation

ScCellValue::ScCellValue ( )

Definition at line 205 of file cellvalue.cxx.

References meType.

ScCellValue::ScCellValue ( const ScRefCellValue rCell)
ScCellValue::ScCellValue ( double  fValue)

Definition at line 225 of file cellvalue.cxx.

References meType.

ScCellValue::ScCellValue ( const svl::SharedString rString)

Definition at line 227 of file cellvalue.cxx.

References meType.

ScCellValue::ScCellValue ( const ScCellValue r)
ScCellValue::ScCellValue ( ScCellValue &&  r)
noexcept
ScCellValue::~ScCellValue ( )

Definition at line 268 of file cellvalue.cxx.

References clear().

Member Function Documentation

void ScCellValue::assign ( const ScDocument rDoc,
const ScAddress rPos 
)
void ScCellValue::assign ( const ScCellValue rOther,
ScDocument rDestDoc,
ScCloneFlags  nCloneFlags = ScCloneFlags::Default 
)
void ScCellValue::clear ( )
noexcept
void ScCellValue::commit ( ScDocument rDoc,
const ScAddress rPos 
) const
void ScCellValue::commit ( ScColumn rColumn,
SCROW  nRow 
) const

Definition at line 427 of file cellvalue.cxx.

bool ScCellValue::equalsWithoutFormat ( const ScCellValue r) const
OUString ScCellValue::getString ( const ScDocument rDoc) const

Definition at line 494 of file cellvalue.cxx.

Referenced by ScViewFunc::DoThesaurus().

bool ScCellValue::isEmpty ( ) const
ScCellValue & ScCellValue::operator= ( const ScCellValue r)

Definition at line 509 of file cellvalue.cxx.

References swap().

ScCellValue & ScCellValue::operator= ( ScCellValue &&  r)
noexcept
ScCellValue & ScCellValue::operator= ( const ScRefCellValue r)

Definition at line 543 of file cellvalue.cxx.

References swap().

void ScCellValue::release ( ScDocument rDoc,
const ScAddress rPos 
)

Set cell value at specified position in specified document.

But unlike commit(), this method sets the original value to the document without copying. After this call, the value gets cleared.

Definition at line 432 of file cellvalue.cxx.

References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_NONE, CELLTYPE_STRING, CELLTYPE_VALUE, svl::SharedString::getString(), meType, mfValue, mpEditText, mpFormula, mpString, ScDocument::SetEditText(), ScDocument::SetEmptyCell(), ScDocument::SetFormulaCell(), ScDocument::SetString(), ScSetStringParam::setTextInput(), and ScDocument::SetValue().

Referenced by ScTable::CopyData(), ScColumn::SetString(), ScUndoEnterData::Undo(), and ScUndoEnterValue::Undo().

void ScCellValue::release ( ScColumn rColumn,
SCROW  nRow,
sc::StartListeningType  eListenType = sc::SingleCellListening 
)
void ScCellValue::set ( double  fValue)
void ScCellValue::set ( const svl::SharedString rStr)

Definition at line 302 of file cellvalue.cxx.

References CELLTYPE_STRING, clear(), meType, and mpString.

void ScCellValue::set ( const EditTextObject rEditText)

Definition at line 309 of file cellvalue.cxx.

References CELLTYPE_EDIT, clear(), EditTextObject::Clone(), meType, and mpEditText.

void ScCellValue::set ( EditTextObject pEditText)

Definition at line 316 of file cellvalue.cxx.

References CELLTYPE_EDIT, clear(), meType, and mpEditText.

void ScCellValue::set ( ScFormulaCell pFormula)

Definition at line 323 of file cellvalue.cxx.

References CELLTYPE_FORMULA, clear(), meType, and mpFormula.

void ScCellValue::swap ( ScCellValue r)

Definition at line 550 of file cellvalue.cxx.

References meType, and mfValue.

Referenced by operator=().

Member Data Documentation

union { ... }
CellType ScCellValue::meType
double ScCellValue::mfValue
EditTextObject* ScCellValue::mpEditText
ScFormulaCell* ScCellValue::mpFormula
svl::SharedString* ScCellValue::mpString

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