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

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

#include <cellvalue.hxx>

Public Member Functions

 ScCellValue ()
 
 ScCellValue (const ScRefCellValue &rCell)
 
 ScCellValue (double fValue)
 
 ScCellValue (const svl::SharedString &rString)
 
 ScCellValue (std::unique_ptr< EditTextObject >)
 
 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 (std::unique_ptr< EditTextObject >)
 
void set (ScFormulaCell *pFormula)
 
CellType getType () const
 
double getDouble () const
 
ScFormulaCellgetFormula () const
 
const svl::SharedStringgetSharedString () const
 
EditTextObjectgetEditText () const
 
EditTextObjectreleaseEditText ()
 
ScFormulaCellreleaseFormula ()
 
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)
 

Private Attributes

std::variant< std::monostate, double, svl::SharedString, EditTextObject *, ScFormulaCell * > maData
 std::monostate is there to indicate CellType::NONE More...
 

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 31 of file cellvalue.hxx.

Constructor & Destructor Documentation

ScCellValue::ScCellValue ( )

Definition at line 232 of file cellvalue.cxx.

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

Definition at line 254 of file cellvalue.cxx.

References maData.

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

Definition at line 256 of file cellvalue.cxx.

References maData.

ScCellValue::ScCellValue ( std::unique_ptr< EditTextObject xEdit)

Definition at line 258 of file cellvalue.cxx.

References maData.

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

Definition at line 280 of file cellvalue.cxx.

ScCellValue::~ScCellValue ( )

Definition at line 286 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 446 of file cellvalue.cxx.

bool ScCellValue::equalsWithoutFormat ( const ScCellValue r) const
double ScCellValue::getDouble ( ) const
inline
EditTextObject* ScCellValue::getEditText ( ) const
inline
ScFormulaCell* ScCellValue::getFormula ( ) const
inline
const svl::SharedString* ScCellValue::getSharedString ( ) const
inline
OUString ScCellValue::getString ( const ScDocument rDoc) const

Definition at line 509 of file cellvalue.cxx.

Referenced by commit(), ScViewFunc::DoThesaurus(), and release().

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

Definition at line 524 of file cellvalue.cxx.

References swap().

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

Definition at line 531 of file cellvalue.cxx.

References clear(), and maData.

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

Definition at line 539 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 451 of file cellvalue.cxx.

References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, getDouble(), getEditText(), getFormula(), getSharedString(), getString(), getType(), maData, 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 
)
EditTextObject* ScCellValue::releaseEditText ( )
inline

Definition at line 60 of file cellvalue.hxx.

References p.

Referenced by ScDocumentImport::setAutoInput().

ScFormulaCell* ScCellValue::releaseFormula ( )
inline

Definition at line 61 of file cellvalue.hxx.

References p.

Referenced by ScDocumentImport::setAutoInput().

void ScCellValue::set ( double  fValue)
void ScCellValue::set ( const svl::SharedString rStr)

Definition at line 330 of file cellvalue.cxx.

References clear(), and maData.

void ScCellValue::set ( const EditTextObject rEditText)

Definition at line 336 of file cellvalue.cxx.

References clear(), EditTextObject::Clone(), and maData.

void ScCellValue::set ( std::unique_ptr< EditTextObject xEditText)

Definition at line 342 of file cellvalue.cxx.

References clear(), and maData.

void ScCellValue::set ( ScFormulaCell pFormula)

Definition at line 348 of file cellvalue.cxx.

References clear(), and maData.

void ScCellValue::swap ( ScCellValue r)

Definition at line 546 of file cellvalue.cxx.

References maData.

Referenced by operator=().

Member Data Documentation

std::variant<std::monostate, double, svl::SharedString, EditTextObject*, ScFormulaCell*> ScCellValue::maData
private

std::monostate is there to indicate CellType::NONE

Definition at line 35 of file cellvalue.hxx.

Referenced by assign(), clear(), getType(), operator=(), release(), ScCellValue(), set(), and swap().


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