11#include <document.hxx>
18#include <tokenarray.hxx>
41 return rVal.getSharedString()->getString();
46 sal_Int32
n = rVal.getEditText()->GetParagraphCount();
47 for (sal_Int32 i = 0;
i <
n; ++
i)
51 aRet.append(rVal.getEditText()->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])))
83bool equalsWithoutFormatImpl(
const T& left,
const T& right )
95 return left.getDouble() ==
right.getDouble();
100 return aStr1 == aStr2;
103 return equalsFormulaCells(
left.getFormula(),
right.getFormula());
114 if (eType1 != eType2)
122 return left.getDouble() ==
right.getDouble();
127 return aStr1 == aStr2;
130 return equalsFormulaCells(
left.getFormula(),
right.getFormula());
189OUString getStringImpl(
const T& rCell,
const ScDocument* pDoc )
191 switch (rCell.getType())
194 return OUString::number(rCell.getDouble());
196 return rCell.getSharedString()->getString();
198 if (rCell.getEditText())
202 return rCell.getFormula()->GetString().getString();
209template<
typename CellT>
210OUString getRawStringImpl(
const CellT& rCell,
const ScDocument& rDoc )
212 switch (rCell.getType())
215 return OUString::number(rCell.getDouble());
217 return rCell.getSharedString()->getString();
219 if (rCell.getEditText())
223 return rCell.getFormula()->GetRawString().getString();
286 :
maData(std::move(r.maData))
350 maData = xEditText.release();
399 const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS;
400 bool bNewControl = ((nControl & nSpellControl) != nSpellControl);
453 commitToColumn(*
this, rColumn, nRow);
516 return getStringImpl(*
this, &rDoc);
526 return equalsWithoutFormatImpl(*
this, r);
539 maData = std::move(rCell.maData);
540 rCell.reset_to_empty();
569 assign( rDoc, rPos, rBlockPos );
659 return getStringImpl(*
this, pDoc);
664 return getRawStringImpl(*
this, rDoc);
685 return equalsWithoutFormatImpl(*
this, r);
std::shared_ptr< ExpressionNode > mpFormula
std::unique_ptr< EditTextObject > CreateTextObject()
EEControlBits GetControlWord() const
void SetControlWord(EEControlBits nWord)
virtual bool HasOnlineSpellErrors() const=0
virtual std::unique_ptr< EditTextObject > Clone() const=0
void SetValue(SCROW nRow, double fVal)
ScFormulaCell * SetFormulaCell(SCROW nRow, ScFormulaCell *pCell, sc::StartListeningType eListenType=sc::SingleCellListening, bool bInheritNumFormatIfNeeded=true)
Takes ownership of pCell.
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
void DeleteContent(SCROW nRow, bool bBroadcast=true)
void SetRawString(SCROW nRow, const OUString &rStr)
ScDocument & GetDoc() const
void SetEmptyCell(const ScAddress &rPos)
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
ScRefCellValue GetRefCellValue(const ScAddress &rPos)
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
static std::unique_ptr< EditTextObject > Clone(const EditTextObject &rSrc, ScDocument &rDestDoc)
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
const OUString & getString() const
#define suppress_fun_call_w_exception(expr)
std::vector< sal_Int8, boost::noinit_adaptor< std::allocator< sal_Int8 > > > maData
OUString getString(const Any &_rAny)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
Store arbitrary cell value of any kind.
OUString getString(const ScDocument &rDoc) const
void swap(ScCellValue &r)
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
bool equalsWithoutFormat(const ScCellValue &r) const
const svl::SharedString * getSharedString() const
std::variant< std::monostate, double, svl::SharedString, EditTextObject *, ScFormulaCell * > maData
std::monostate is there to indicate CellType::NONE
ScCellValue & operator=(const ScCellValue &r)
ScFormulaCell * getFormula() const
EditTextObject * getEditText() const
void release(ScDocument &rDoc, const ScAddress &rPos)
Set cell value at specified position in specified document.
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
ScFormulaCell * getFormula() const
double getRawValue() const
Retrieve a numeric value without modifying the states of any objects in the referenced document store...
const EditTextObject * getEditText() const
OUString getRawString(const ScDocument &rDoc) const
Retrieve a string value without modifying the states of any objects in the referenced document store.
const EditTextObject * mpEditText
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
const svl::SharedString * mpString
ScFormulaCell * mpFormula
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
void assign(ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
bool equalsWithoutFormat(const ScRefCellValue &r) const
const svl::SharedString * getSharedString() const
Store parameters used in the ScDocument::SetString() method.
void setTextInput()
Call this whenever you need to unconditionally set input as text, no matter what the input is.
Store position data for column array storage.