LibreOffice Module sc (master)
1
|
Store arbitrary cell value of any kind. More...
#include <cellvalue.hxx>
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, EditTextObject::Clone(), ScFormulaCell::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, EditTextObject::Clone(), ScFormulaCell::Clone(), getDouble(), getEditText(), getFormula(), getSharedString(), getType(), and maData.
|
noexcept |
Definition at line 280 of file cellvalue.cxx.
ScCellValue::~ScCellValue | ( | ) |
Definition at line 286 of file cellvalue.cxx.
References clear().
void ScCellValue::assign | ( | const ScDocument & | rDoc, |
const ScAddress & | rPos | ||
) |
Take cell value from specified position in specified document.
Definition at line 354 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, clear(), EditTextObject::Clone(), ScFormulaCell::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().
void ScCellValue::assign | ( | const ScCellValue & | rOther, |
ScDocument & | rDestDoc, | ||
ScCloneFlags | nCloneFlags = ScCloneFlags::Default |
||
) |
Definition at line 378 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().
|
noexcept |
Definition at line 306 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, getEditText(), getFormula(), getType(), and maData.
Referenced by assign(), operator=(), XclImpChangeTrack::ReadCell(), XclImpChangeTrack::ReadChTrCellContent(), set(), sc::CopyFromClipContext::setSingleCell(), ScChangeActionContent::SetValue(), ScChangeActionContent::SetValueString(), and ~ScCellValue().
void ScCellValue::commit | ( | ScDocument & | rDoc, |
const ScAddress & | rPos | ||
) | const |
Set cell value at specified position in specified document.
Definition at line 421 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().
Definition at line 446 of file cellvalue.cxx.
bool ScCellValue::equalsWithoutFormat | ( | const ScCellValue & | r | ) | const |
Definition at line 519 of file cellvalue.cxx.
Referenced by ScDocument::CompareDocument(), and ScXMLChangeTrackingImportHelper::SetDependencies().
|
inline |
Definition at line 56 of file cellvalue.hxx.
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 59 of file cellvalue.hxx.
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 57 of file cellvalue.hxx.
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 58 of file cellvalue.hxx.
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 509 of file cellvalue.cxx.
Referenced by commit(), ScViewFunc::DoThesaurus(), and release().
CellType ScCellValue::getType | ( | ) | const |
Definition at line 291 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 514 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 524 of file cellvalue.cxx.
References swap().
|
noexcept |
Definition at line 531 of file cellvalue.cxx.
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 |
||
) |
Definition at line 481 of file cellvalue.cxx.
References CELLTYPE_EDIT, CELLTYPE_FORMULA, CELLTYPE_STRING, CELLTYPE_VALUE, ScColumn::DeleteContent(), getDouble(), getEditText(), getFormula(), getSharedString(), getType(), maData, ScColumn::SetEditText(), ScColumn::SetFormulaCell(), ScColumn::SetRawString(), and ScColumn::SetValue().
|
inline |
Definition at line 60 of file cellvalue.hxx.
References p.
Referenced by ScDocumentImport::setAutoInput().
|
inline |
Definition at line 61 of file cellvalue.hxx.
References p.
Referenced by ScDocumentImport::setAutoInput().
void ScCellValue::set | ( | double | fValue | ) |
Definition at line 324 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 | ( | const svl::SharedString & | rStr | ) |
Definition at line 330 of file cellvalue.cxx.
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.
void ScCellValue::set | ( | ScFormulaCell * | pFormula | ) |
Definition at line 348 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(), clear(), getType(), operator=(), release(), ScCellValue(), set(), and swap().