11 #include <document.hxx>
18 #include <tokenarray.hxx>
41 return rVal.mpString->getString();
46 sal_Int32
n = rVal.mpEditText->GetParagraphCount();
47 for (sal_Int32 i = 0;
i < n; ++
i)
51 aRet.append(rVal.mpEditText->GetText(i));
53 return aRet.makeStringAndClear();
70 sal_uInt16 n = pCode1->
GetLen();
73 for (sal_uInt16 i = 0;
i < n; ++
i)
75 if (!ppToken1[i]->TextEqual(*(ppToken2[i])))
83 bool equalsWithoutFormatImpl(
const T& left,
const T& right )
85 CellType eType1 = adjustCellType(left.meType);
86 CellType eType2 = adjustCellType(right.meType);
95 return left.mfValue == right.mfValue;
100 return aStr1 == aStr2;
103 return equalsFormulaCells(left.mpFormula, right.mpFormula);
161 template<
typename CellT>
162 OUString getStringImpl(
const CellT& rCell,
const ScDocument* pDoc )
164 switch (rCell.meType)
167 return OUString::number(rCell.mfValue);
169 return rCell.mpString->getString();
171 if (rCell.mpEditText)
175 return rCell.mpFormula->GetString().getString();
182 template<
typename CellT>
183 OUString getRawStringImpl(
const CellT& rCell,
const ScDocument& rDoc )
185 switch (rCell.meType)
188 return OUString::number(rCell.mfValue);
190 return rCell.mpString->getString();
192 if (rCell.mpEditText)
196 return rCell.mpFormula->GetRawString().getString();
374 const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS;
375 bool bNewControl = ((nControl & nSpellControl) != nSpellControl);
429 commitToColumn(*
this, rColumn, nRow);
496 return getStringImpl(*
this, &rDoc);
506 return equalsWithoutFormatImpl(*
this, r);
522 switch (rCell.meType)
572 assign( rDoc, rPos, rBlockPos );
662 return getStringImpl(*
this, pDoc);
667 return getRawStringImpl(*
this, rDoc);
688 return equalsWithoutFormatImpl(*
this, r);
EEControlBits GetControlWord() const
bool equalsWithoutFormat(const ScCellValue &r) const
OUString getString() const
Store parameters used in the ScDocument::SetString() method.
ScCellValue & operator=(const ScCellValue &r)
OUString getRawString(const ScDocument &rDoc) const
Retrieve a string value without modifying the states of any objects in the referenced document store...
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
void setTextInput()
Call this whenever you need to unconditionally set input as text, no matter what the input is...
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
Store position data for column array storage.
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
void swap(ScCellValue &r)
This is very similar to ScCellValue, except that it references the original value instead of copying ...
bool equalsWithoutFormat(const ScRefCellValue &r) const
Store arbitrary cell value of any kind.
ScFormulaCell * SetFormulaCell(SCROW nRow, ScFormulaCell *pCell, sc::StartListeningType eListenType=sc::SingleCellListening, bool bInheritNumFormatIfNeeded=true)
Takes ownership of pCell.
OUString getString(const ScDocument &rDoc) const
const EditTextObject * mpEditText
ScFormulaCell * mpFormula
void SetControlWord(EEControlBits nWord)
ScFormulaCell * mpFormula
void release(ScDocument &rDoc, const ScAddress &rPos)
Set cell value at specified position in specified document.
void DeleteContent(SCROW nRow, bool bBroadcast=true)
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
ScRefCellValue GetRefCellValue(const ScAddress &rPos)
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
double getRawValue() const
Retrieve a numeric value without modifying the states of any objects in the referenced document store...
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
void SetRawString(SCROW nRow, const OUString &rStr)
const svl::SharedString * mpString
std::shared_ptr< ExpressionNode > mpFormula
svl::SharedString * mpString
std::unique_ptr< EditTextObject > CreateTextObject()
ScDocument & GetDoc() const
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
void assign(ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
virtual std::unique_ptr< EditTextObject > Clone() const =0
These need to be in global namespace just like their respective types are.
EditTextObject * mpEditText
void SetEmptyCell(const ScAddress &rPos)
virtual bool HasOnlineSpellErrors() const =0
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
static std::unique_ptr< EditTextObject > Clone(const EditTextObject &rSrc, ScDocument &rDestDoc)
void SetValue(SCROW nRow, double fVal)
OUString getString(const Any &_rAny)
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()