LibreOffice Module sc (master) 1
|
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 |
ScFormulaCell * | getFormula () const |
const svl::SharedString * | getSharedString () const |
EditTextObject * | getEditText () const |
EditTextObject * | releaseEditText () |
ScFormulaCell * | releaseFormula () |
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 |
ScCellValue & | operator= (const ScCellValue &r) |
ScCellValue & | operator= (ScCellValue &&r) noexcept |
ScCellValue & | operator= (const ScRefCellValue &r) |
void | swap (ScCellValue &r) |
Private Member Functions | |
void | reset_to_empty () |
Private Attributes | |
std::variant< std::monostate, double, svl::SharedString, EditTextObject *, ScFormulaCell * > | maData |
std::monostate is there to indicate CellType::NONE More... | |
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.
ScCellValue::ScCellValue | ( | ) |
Definition at line 232 of file cellvalue.cxx.
ScCellValue::ScCellValue | ( | const ScRefCellValue & | rCell | ) |
Definition at line 234 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, ScFormulaCell::Clone(), EditTextObject::Clone(), ScRefCellValue::getDouble(), ScRefCellValue::getEditText(), ScRefCellValue::getFormula(), ScRefCellValue::getSharedString(), ScRefCellValue::getType(), and maData.
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 | ) |
Definition at line 260 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, ScFormulaCell::Clone(), EditTextObject::Clone(), getDouble(), getEditText(), getFormula(), getSharedString(), getType(), and maData.
|
noexcept |
Definition at line 285 of file cellvalue.cxx.
References maData.
ScCellValue::~ScCellValue | ( | ) |
Definition at line 291 of file cellvalue.cxx.
References clear().
void ScCellValue::assign | ( | const ScCellValue & | rOther, |
ScDocument & | rDestDoc, | ||
ScCloneFlags | nCloneFlags = ScCloneFlags::Default |
||
) |
Definition at line 383 of file cellvalue.cxx.
References ScFormulaCell::aPos, CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, clear(), EditEngine::CreateTextObject(), EditEngine::GetControlWord(), ScDocument::GetEditEngine(), getEditText(), getFormula(), getType(), EditTextObject::HasOnlineSpellErrors(), maData, EditEngine::SetControlWord(), and ScEditEngineDefaulter::SetTextCurrentDefaults().
void ScCellValue::assign | ( | const ScDocument & | rDoc, |
const ScAddress & | rPos | ||
) |
Take cell value from specified position in specified document.
Definition at line 359 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, clear(), ScFormulaCell::Clone(), EditTextObject::Clone(), ScRefCellValue::getDouble(), ScRefCellValue::getEditText(), ScRefCellValue::getFormula(), ScRefCellValue::getSharedString(), ScRefCellValue::getType(), and maData.
Referenced by ScChangeTrack::AppendContent(), ScChangeTrack::Clone(), ScDocument::CompareDocument(), ScTable::CopyData(), ScViewFunc::DoThesaurus(), ScViewFunc::EnterData(), ScViewFunc::EnterValue(), ScChangeTrack::Reject(), ScChangeActionContent::Select(), ScChangeTrack::SelectContent(), ScUndoReplace::SetChangeTrack(), ScDocFunc::SetEditCell(), ScDocFunc::SetFormulaCell(), ScXMLChangeTrackingImportHelper::SetNewCell(), ScDocFunc::SetNormalString(), sc::CopyFromClipContext::setSingleCell(), ScDocFunc::SetStringCell(), ScChangeActionContent::SetValue(), ScDocFunc::SetValueCell(), ScUndoEnterData::Undo(), and ScUndoEnterValue::Undo().
|
noexcept |
Definition at line 311 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, getEditText(), getFormula(), getType(), reset_to_empty(), and suppress_fun_call_w_exception.
Referenced by assign(), XclImpChangeTrack::ReadCell(), XclImpChangeTrack::ReadChTrCellContent(), set(), sc::CopyFromClipContext::setSingleCell(), ScChangeActionContent::SetValue(), ScChangeActionContent::SetValueString(), and ~ScCellValue().
Definition at line 451 of file cellvalue.cxx.
void ScCellValue::commit | ( | ScDocument & | rDoc, |
const ScAddress & | rPos | ||
) | const |
Set cell value at specified position in specified document.
Definition at line 426 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, Clone(), getDouble(), getEditText(), getFormula(), getSharedString(), getString(), getType(), ScDocument::SetEditText(), ScDocument::SetEmptyCell(), ScDocument::SetFormulaCell(), ScDocument::SetString(), ScSetStringParam::setTextInput(), and ScDocument::SetValue().
Referenced by ScUndoThesaurus::DoChange(), ScTable::FillAutoSimple(), ScTable::FillSeriesSimple(), ScValidationData::IsDataValidCustom(), and ScChangeActionContent::PutValueToDoc().
bool ScCellValue::equalsWithoutFormat | ( | const ScCellValue & | r | ) | const |
Definition at line 524 of file cellvalue.cxx.
Referenced by ScDocument::CompareDocument(), and ScXMLChangeTrackingImportHelper::SetDependencies().
|
inline |
Definition at line 58 of file cellvalue.hxx.
References maData.
Referenced by commit(), ScColumn::CopyOneCellFromClip(), ScTable::FillAutoSimple(), ScTable::FillSeries(), XclExpChTrCellContent::GetCellData(), ScChangeActionContent::GetStringOfCell(), release(), ScCellValue(), ScDocumentImport::setAutoInput(), ScChangeActionContent::SetCell(), ScUndoSetCell::SetValue(), ScChangeActionContent::SetValue(), and ScChangeTrackingExportHelper::WriteValueCell().
|
inline |
Definition at line 61 of file cellvalue.hxx.
References maData.
Referenced by assign(), clear(), ScChangeTrackingExportHelper::CollectCellAutoStyles(), commit(), ScColumn::CopyOneCellFromClip(), ScViewFunc::DoThesaurus(), ScTable::FillAutoSimple(), ScTable::FillSeries(), XclExpChTrCellContent::GetCellData(), ScChangeActionContent::GetStringOfCell(), ScChangeActionContent::GetValueString(), release(), ScCellValue(), ScUndoSetCell::SetValue(), and ScChangeTrackingExportHelper::WriteEditCell().
|
inline |
Definition at line 59 of file cellvalue.hxx.
References maData.
Referenced by assign(), clear(), commit(), ScTable::CopyData(), ScColumn::CopyOneCellFromClip(), ScMyCellInfo::CreateCell(), ScChangeTrack::Dependencies(), ScTable::FillAutoSimple(), ScTable::FillSeries(), ScTable::FillSeriesSimple(), XclExpChTrCellContent::GetCellData(), ScChangeActionContent::GetContentCellType(), ScChangeActionContent::GetRefString(), ScChangeActionContent::GetStringOfCell(), ScChangeActionContent::GetValueString(), ScChangeTrack::IsMatrixFormulaRangeDifferent(), ScDocShell::MergeDocument(), ScChangeActionContent::PutValueToDoc(), release(), ScCellValue(), ScChangeTrack::SelectContent(), ScDocumentImport::setAutoInput(), ScChangeActionContent::SetCell(), ScXMLChangeTrackingImportHelper::SetNewCell(), sc::CopyFromClipContext::setSingleCell(), ScUndoSetCell::SetValue(), ScChangeActionContent::SetValue(), ScChangeActionContent::SetValueString(), ScChangeActionContent::UpdateReference(), and ScChangeTrackingExportHelper::WriteFormulaCell().
|
inline |
Definition at line 60 of file cellvalue.hxx.
References maData.
Referenced by commit(), ScColumn::CopyOneCellFromClip(), ScTable::FillAutoSimple(), ScTable::FillSeries(), XclExpChTrCellContent::GetCellData(), ScChangeActionContent::GetStringOfCell(), ScChangeActionContent::GetValueString(), release(), ScCellValue(), ScDocumentImport::setAutoInput(), ScUndoSetCell::SetValue(), and ScChangeTrackingExportHelper::WriteStringCell().
OUString ScCellValue::getString | ( | const ScDocument & | rDoc | ) | const |
Definition at line 514 of file cellvalue.cxx.
Referenced by commit(), ScViewFunc::DoThesaurus(), and release().
CellType ScCellValue::getType | ( | ) | const |
Definition at line 296 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_NONE, CELLTYPE_STRING, CELLTYPE_VALUE, and maData.
Referenced by assign(), clear(), ScChangeTrackingExportHelper::CollectCellAutoStyles(), commit(), ScTable::CopyData(), ScColumn::CopyOneCellFromClip(), ScViewFunc::DoThesaurus(), ScTable::FillAutoSimple(), ScTable::FillSeries(), ScTable::FillSeriesSimple(), XclExpChTrCellContent::GetCellData(), ScChangeActionContent::GetContentCellType(), ScChangeActionContent::GetStringOfCell(), ScChangeActionContent::GetValueString(), isEmpty(), ScChangeTrack::IsMatrixFormulaRangeDifferent(), ScDocShell::MergeDocument(), ScChangeActionContent::NeedsNumberFormat(), ScColumn::ParseString(), ScChangeActionContent::PutValueToDoc(), release(), ScCellValue(), ScDocumentImport::setAutoInput(), ScChangeActionContent::SetCell(), ScXMLChangeTrackingImportHelper::SetNewCell(), sc::CopyFromClipContext::setSingleCell(), ScUndoSetCell::SetValue(), ScChangeActionContent::SetValue(), ScChangeActionContent::UpdateReference(), ScChangeTrackingExportHelper::WriteCell(), ScChangeTrackingExportHelper::WriteEditCell(), ScChangeTrackingExportHelper::WriteFormulaCell(), ScChangeTrackingExportHelper::WriteStringCell(), and ScChangeTrackingExportHelper::WriteValueCell().
bool ScCellValue::isEmpty | ( | ) | const |
Definition at line 519 of file cellvalue.cxx.
References CELLTYPE_NONE, and getType().
Referenced by ScChangeTrack::Clone(), ScMyCellInfo::CreateCell(), ScXMLChangeTrackingImportHelper::CreateGeneratedActions(), ScTable::FillAutoSimple(), ScTable::FillSeries(), XclExpChTrCellContent::GetCellData(), ScChangeActionContent::PutValueToDoc(), ScChangeActionContent::ScChangeActionContent(), ScChangeActionContent::SetCell(), ScXMLChangeTrackingImportHelper::SetContentDependencies(), ScXMLChangeTrackingImportHelper::SetNewCell(), and ScChangeTrackingExportHelper::WriteCell().
ScCellValue & ScCellValue::operator= | ( | const ScCellValue & | r | ) |
Definition at line 529 of file cellvalue.cxx.
References swap().
ScCellValue & ScCellValue::operator= | ( | const ScRefCellValue & | r | ) |
Definition at line 544 of file cellvalue.cxx.
References swap().
|
noexcept |
Definition at line 536 of file cellvalue.cxx.
References maData.
void ScCellValue::release | ( | ScColumn & | rColumn, |
SCROW | nRow, | ||
sc::StartListeningType | eListenType = sc::SingleCellListening |
||
) |
Definition at line 486 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, ScColumn::DeleteContent(), getDouble(), getEditText(), getFormula(), getSharedString(), getType(), reset_to_empty(), ScColumn::SetEditText(), ScColumn::SetFormulaCell(), ScColumn::SetRawString(), and ScColumn::SetValue().
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 456 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, getDouble(), getEditText(), getFormula(), getSharedString(), getString(), getType(), reset_to_empty(), ScDocument::SetEditText(), ScDocument::SetEmptyCell(), ScDocument::SetFormulaCell(), ScDocument::SetString(), ScSetStringParam::setTextInput(), and ScDocument::SetValue().
Referenced by ScTable::CopyData(), ScColumn::SetString(), ScUndoEnterData::Undo(), and ScUndoEnterValue::Undo().
|
inline |
Definition at line 62 of file cellvalue.hxx.
Referenced by ScDocumentImport::setAutoInput().
|
inline |
Definition at line 63 of file cellvalue.hxx.
Referenced by ScDocumentImport::setAutoInput().
|
private |
Definition at line 280 of file cellvalue.cxx.
References maData, and suppress_fun_call_w_exception.
void ScCellValue::set | ( | const EditTextObject & | rEditText | ) |
Definition at line 341 of file cellvalue.cxx.
References clear(), EditTextObject::Clone(), and maData.
void ScCellValue::set | ( | const svl::SharedString & | rStr | ) |
Definition at line 335 of file cellvalue.cxx.
void ScCellValue::set | ( | double | fValue | ) |
Definition at line 329 of file cellvalue.cxx.
References clear(), and maData.
Referenced by ScMyCellInfo::CreateCell(), ScViewFunc::DoThesaurus(), ScColumn::ParseString(), XclImpChangeTrack::ReadCell(), ScXMLChangeTrackingImportHelper::SetNewCell(), sc::CopyFromClipContext::setSingleCell(), and ScChangeActionContent::SetValueString().
void ScCellValue::set | ( | ScFormulaCell * | pFormula | ) |
Definition at line 353 of file cellvalue.cxx.
void ScCellValue::set | ( | std::unique_ptr< EditTextObject > | xEditText | ) |
Definition at line 347 of file cellvalue.cxx.
void ScCellValue::swap | ( | ScCellValue & | r | ) |
|
private |
std::monostate is there to indicate CellType::NONE
Definition at line 35 of file cellvalue.hxx.
Referenced by assign(), getType(), reset_to_empty(), ScCellValue(), set(), and swap().