LibreOffice Module sc (master) 1
cellvalue.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <cellvalue.hxx>
11#include <document.hxx>
12#include <column.hxx>
13#include <formulacell.hxx>
14#include <editeng/editobj.hxx>
15#include <editeng/editstat.hxx>
16#include <stringutil.hxx>
17#include <editutil.hxx>
18#include <tokenarray.hxx>
19#include <formula/token.hxx>
21#include <svl/sharedstring.hxx>
22
23namespace {
24
25CellType adjustCellType( CellType eOrig )
26{
27 switch (eOrig)
28 {
29 case CELLTYPE_EDIT:
30 return CELLTYPE_STRING;
31 default:
32 ;
33 }
34 return eOrig;
35}
36
37template<typename T>
38OUString getString( const T& rVal )
39{
40 if (rVal.getType() == CELLTYPE_STRING)
41 return rVal.getSharedString()->getString();
42
43 if (rVal.getType() == CELLTYPE_EDIT)
44 {
45 OUStringBuffer aRet;
46 sal_Int32 n = rVal.getEditText()->GetParagraphCount();
47 for (sal_Int32 i = 0; i < n; ++i)
48 {
49 if (i > 0)
50 aRet.append('\n');
51 aRet.append(rVal.getEditText()->GetText(i));
52 }
53 return aRet.makeStringAndClear();
54 }
55
56 return OUString();
57}
58
59bool equalsFormulaCells( const ScFormulaCell* p1, const ScFormulaCell* p2 )
60{
61 const ScTokenArray* pCode1 = p1->GetCode();
62 const ScTokenArray* pCode2 = p2->GetCode();
63
64 if (pCode1->GetLen() != pCode2->GetLen())
65 return false;
66
67 if (pCode1->GetCodeError() != pCode2->GetCodeError())
68 return false;
69
70 sal_uInt16 n = pCode1->GetLen();
71 formula::FormulaToken** ppToken1 = pCode1->GetArray();
72 formula::FormulaToken** ppToken2 = pCode2->GetArray();
73 for (sal_uInt16 i = 0; i < n; ++i)
74 {
75 if (!ppToken1[i]->TextEqual(*(ppToken2[i])))
76 return false;
77 }
78
79 return true;
80}
81
82template<typename T>
83bool equalsWithoutFormatImpl( const T& left, const T& right )
84{
85 CellType eType1 = adjustCellType(left.getType());
86 CellType eType2 = adjustCellType(right.getType());
87 if (eType1 != eType2)
88 return false;
89
90 switch (eType1)
91 {
92 case CELLTYPE_NONE:
93 return true;
94 case CELLTYPE_VALUE:
95 return left.getDouble() == right.getDouble();
96 case CELLTYPE_STRING:
97 {
98 OUString aStr1 = getString(left);
99 OUString aStr2 = getString(right);
100 return aStr1 == aStr2;
101 }
102 case CELLTYPE_FORMULA:
103 return equalsFormulaCells(left.getFormula(), right.getFormula());
104 default:
105 ;
106 }
107 return false;
108}
109
110bool equalsWithoutFormatImpl( const ScCellValue& left, const ScCellValue& right )
111{
112 CellType eType1 = adjustCellType(left.getType());
113 CellType eType2 = adjustCellType(right.getType());
114 if (eType1 != eType2)
115 return false;
116
117 switch (eType1)
118 {
119 case CELLTYPE_NONE:
120 return true;
121 case CELLTYPE_VALUE:
122 return left.getDouble() == right.getDouble();
123 case CELLTYPE_STRING:
124 {
125 OUString aStr1 = getString(left);
126 OUString aStr2 = getString(right);
127 return aStr1 == aStr2;
128 }
129 case CELLTYPE_FORMULA:
130 return equalsFormulaCells(left.getFormula(), right.getFormula());
131 default:
132 ;
133 }
134 return false;
135}
136
137void commitToColumn( const ScCellValue& rCell, ScColumn& rColumn, SCROW nRow )
138{
139 switch (rCell.getType())
140 {
141 case CELLTYPE_STRING:
142 rColumn.SetRawString(nRow, *rCell.getSharedString());
143 break;
144 case CELLTYPE_EDIT:
145 rColumn.SetEditText(nRow, ScEditUtil::Clone(*rCell.getEditText(), rColumn.GetDoc()));
146 break;
147 case CELLTYPE_VALUE:
148 rColumn.SetValue(nRow, rCell.getDouble());
149 break;
150 case CELLTYPE_FORMULA:
151 {
152 ScAddress aDestPos(rColumn.GetCol(), nRow, rColumn.GetTab());
153 rColumn.SetFormulaCell(nRow, new ScFormulaCell(*rCell.getFormula(), rColumn.GetDoc(), aDestPos));
154 }
155 break;
156 default:
157 rColumn.DeleteContent(nRow);
158 }
159}
160
161bool hasStringImpl( CellType eType, ScFormulaCell* pFormula )
162{
163 switch (eType)
164 {
165 case CELLTYPE_STRING:
166 case CELLTYPE_EDIT:
167 return true;
168 case CELLTYPE_FORMULA:
169 return !pFormula->IsValue();
170 default:
171 return false;
172 }
173}
174
175bool hasNumericImpl( CellType eType, ScFormulaCell* pFormula )
176{
177 switch (eType)
178 {
179 case CELLTYPE_VALUE:
180 return true;
181 case CELLTYPE_FORMULA:
182 return pFormula->IsValue();
183 default:
184 return false;
185 }
186}
187
188template <typename T>
189OUString getStringImpl( const T& rCell, const ScDocument* pDoc )
190{
191 switch (rCell.getType())
192 {
193 case CELLTYPE_VALUE:
194 return OUString::number(rCell.getDouble());
195 case CELLTYPE_STRING:
196 return rCell.getSharedString()->getString();
197 case CELLTYPE_EDIT:
198 if (rCell.getEditText())
199 return ScEditUtil::GetString(*rCell.getEditText(), pDoc);
200 break;
201 case CELLTYPE_FORMULA:
202 return rCell.getFormula()->GetString().getString();
203 default:
204 ;
205 }
206 return OUString();
207}
208
209template<typename CellT>
210OUString getRawStringImpl( const CellT& rCell, const ScDocument& rDoc )
211{
212 switch (rCell.getType())
213 {
214 case CELLTYPE_VALUE:
215 return OUString::number(rCell.getDouble());
216 case CELLTYPE_STRING:
217 return rCell.getSharedString()->getString();
218 case CELLTYPE_EDIT:
219 if (rCell.getEditText())
220 return ScEditUtil::GetString(*rCell.getEditText(), &rDoc);
221 break;
222 case CELLTYPE_FORMULA:
223 return rCell.getFormula()->GetRawString().getString();
224 default:
225 ;
226 }
227 return OUString();
228}
229
230}
231
233
235{
236 switch (rCell.getType())
237 {
238 case CELLTYPE_STRING:
239 maData = *rCell.getSharedString();
240 break;
241 case CELLTYPE_EDIT:
242 maData = rCell.getEditText()->Clone().release();
243 break;
244 case CELLTYPE_FORMULA:
245 maData = rCell.getFormula()->Clone();
246 break;
247 case CELLTYPE_VALUE:
248 maData = rCell.getDouble();
249 break;
250 default: ;
251 }
252}
253
254ScCellValue::ScCellValue( double fValue ) : maData(fValue) {}
255
256ScCellValue::ScCellValue( const svl::SharedString& rString ) : maData(rString) {}
257
258ScCellValue::ScCellValue( std::unique_ptr<EditTextObject> xEdit ) : maData(xEdit.release()) {}
259
261{
262 switch (r.getType())
263 {
264 case CELLTYPE_STRING:
265 maData = *r.getSharedString();
266 break;
267 case CELLTYPE_EDIT:
268 maData = r.getEditText()->Clone().release();
269 break;
270 case CELLTYPE_FORMULA:
271 maData = r.getFormula()->Clone();
272 break;
273 case CELLTYPE_VALUE:
274 maData = r.getDouble();
275 break;
276 default: ;
277 }
278}
279
281{
282 suppress_fun_call_w_exception(maData = std::monostate()); // reset to empty;
283}
284
286 : maData(std::move(r.maData))
287{
288 r.reset_to_empty();
289}
290
292{
293 clear();
294}
295
297{
298 switch (maData.index())
299 {
300 case 0: return CELLTYPE_NONE;
301 case 1: return CELLTYPE_VALUE;
302 case 2: return CELLTYPE_STRING;
303 case 3: return CELLTYPE_EDIT;
304 case 4: return CELLTYPE_FORMULA;
305 default:
306 assert(false);
307 return CELLTYPE_NONE;
308 }
309}
310
311void ScCellValue::clear() noexcept
312{
313 switch (getType())
314 {
315 case CELLTYPE_EDIT:
317 break;
318 case CELLTYPE_FORMULA:
320 break;
321 default:
322 ;
323 }
324
325 // Reset to empty value.
327}
328
329void ScCellValue::set( double fValue )
330{
331 clear();
332 maData = fValue;
333}
334
336{
337 clear();
338 maData = rStr;
339}
340
341void ScCellValue::set( const EditTextObject& rEditText )
342{
343 clear();
344 maData = rEditText.Clone().release();
345}
346
347void ScCellValue::set( std::unique_ptr<EditTextObject> xEditText )
348{
349 clear();
350 maData = xEditText.release();
351}
352
354{
355 clear();
356 maData = pFormula;
357}
358
359void ScCellValue::assign( const ScDocument& rDoc, const ScAddress& rPos )
360{
361 clear();
362
363 ScRefCellValue aRefVal(const_cast<ScDocument&>(rDoc), rPos);
364
365 switch (aRefVal.getType())
366 {
367 case CELLTYPE_STRING:
368 maData = *aRefVal.getSharedString();
369 break;
370 case CELLTYPE_EDIT:
371 maData = aRefVal.getEditText() ? aRefVal.getEditText()->Clone().release() : static_cast<EditTextObject*>(nullptr);
372 break;
373 case CELLTYPE_VALUE:
374 maData = aRefVal.getDouble();
375 break;
376 case CELLTYPE_FORMULA:
377 maData = aRefVal.getFormula()->Clone();
378 break;
379 default: ; // leave empty
380 }
381}
382
383void ScCellValue::assign(const ScCellValue& rOther, ScDocument& rDestDoc, ScCloneFlags nCloneFlags)
384{
385 clear();
386
387 switch (rOther.getType())
388 {
389 case CELLTYPE_STRING:
390 maData = rOther.maData;
391 break;
392 case CELLTYPE_EDIT:
393 {
394 // Switch to the pool of the destination document.
395 ScFieldEditEngine& rEngine = rDestDoc.GetEditEngine();
396 if (rOther.getEditText()->HasOnlineSpellErrors())
397 {
398 EEControlBits nControl = rEngine.GetControlWord();
399 const EEControlBits nSpellControl = EEControlBits::ONLINESPELLING | EEControlBits::ALLOWBIGOBJS;
400 bool bNewControl = ((nControl & nSpellControl) != nSpellControl);
401 if (bNewControl)
402 rEngine.SetControlWord(nControl | nSpellControl);
403 rEngine.SetTextCurrentDefaults(*rOther.getEditText());
404 maData = rEngine.CreateTextObject().release();
405 if (bNewControl)
406 rEngine.SetControlWord(nControl);
407 }
408 else
409 {
410 rEngine.SetTextCurrentDefaults(*rOther.getEditText());
411 maData = rEngine.CreateTextObject().release();
412 }
413 }
414 break;
415 case CELLTYPE_VALUE:
416 maData = rOther.maData;
417 break;
418 case CELLTYPE_FORMULA:
419 // Switch to the destination document.
420 maData = new ScFormulaCell(*rOther.getFormula(), rDestDoc, rOther.getFormula()->aPos, nCloneFlags);
421 break;
422 default: ; // leave empty
423 }
424}
425
426void ScCellValue::commit( ScDocument& rDoc, const ScAddress& rPos ) const
427{
428 switch (getType())
429 {
430 case CELLTYPE_STRING:
431 {
432 ScSetStringParam aParam;
433 aParam.setTextInput();
434 rDoc.SetString(rPos, getSharedString()->getString(), &aParam);
435 }
436 break;
437 case CELLTYPE_EDIT:
438 rDoc.SetEditText(rPos, getEditText()->Clone());
439 break;
440 case CELLTYPE_VALUE:
441 rDoc.SetValue(rPos, getDouble());
442 break;
443 case CELLTYPE_FORMULA:
444 rDoc.SetFormulaCell(rPos, getFormula()->Clone());
445 break;
446 default:
447 rDoc.SetEmptyCell(rPos);
448 }
449}
450
451void ScCellValue::commit( ScColumn& rColumn, SCROW nRow ) const
452{
453 commitToColumn(*this, rColumn, nRow);
454}
455
456void ScCellValue::release( ScDocument& rDoc, const ScAddress& rPos )
457{
458 switch (getType())
459 {
460 case CELLTYPE_STRING:
461 {
462 // Currently, string cannot be placed without copying.
463 ScSetStringParam aParam;
464 aParam.setTextInput();
465 rDoc.SetString(rPos, getSharedString()->getString(), &aParam);
466 }
467 break;
468 case CELLTYPE_EDIT:
469 // Cell takes the ownership of the text object.
470 rDoc.SetEditText(rPos, std::unique_ptr<EditTextObject>(getEditText()));
471 break;
472 case CELLTYPE_VALUE:
473 rDoc.SetValue(rPos, getDouble());
474 break;
475 case CELLTYPE_FORMULA:
476 // This formula cell instance is directly placed in the document without copying.
477 rDoc.SetFormulaCell(rPos, getFormula());
478 break;
479 default:
480 rDoc.SetEmptyCell(rPos);
481 }
482
483 reset_to_empty(); // reset to empty
484}
485
487{
488 switch (getType())
489 {
490 case CELLTYPE_STRING:
491 {
492 // Currently, string cannot be placed without copying.
493 rColumn.SetRawString(nRow, *getSharedString());
494 }
495 break;
496 case CELLTYPE_EDIT:
497 // Cell takes the ownership of the text object.
498 rColumn.SetEditText(nRow, std::unique_ptr<EditTextObject>(getEditText()));
499 break;
500 case CELLTYPE_VALUE:
501 rColumn.SetValue(nRow, getDouble());
502 break;
503 case CELLTYPE_FORMULA:
504 // This formula cell instance is directly placed in the document without copying.
505 rColumn.SetFormulaCell(nRow, getFormula(), eListenType);
506 break;
507 default:
508 rColumn.DeleteContent(nRow);
509 }
510
511 reset_to_empty(); // reset to empty
512}
513
514OUString ScCellValue::getString( const ScDocument& rDoc ) const
515{
516 return getStringImpl(*this, &rDoc);
517}
518
520{
521 return getType() == CELLTYPE_NONE;
522}
523
525{
526 return equalsWithoutFormatImpl(*this, r);
527}
528
530{
531 ScCellValue aTmp(r);
532 swap(aTmp);
533 return *this;
534}
535
537{
538 clear();
539 maData = std::move(rCell.maData);
540 rCell.reset_to_empty(); // reset to empty;
541 return *this;
542}
543
545{
546 ScCellValue aTmp(r);
547 swap(aTmp);
548 return *this;
549}
550
552{
553 std::swap(maData, r.maData);
554}
555
557ScRefCellValue::ScRefCellValue( double fValue ) : meType(CELLTYPE_VALUE), mfValue(fValue) {}
559ScRefCellValue::ScRefCellValue( const EditTextObject* pEditText ) : meType(CELLTYPE_EDIT), mpEditText(pEditText) {}
561
563{
564 assign( rDoc, rPos);
565}
566
568{
569 assign( rDoc, rPos, rBlockPos );
570}
571
573{
574 // Reset to empty value.
576 mfValue = 0.0;
577}
578
580{
581 *this = rDoc.GetRefCellValue(rPos);
582}
583
585{
586 *this = rDoc.GetRefCellValue(rPos, rBlockPos);
587}
588
589void ScRefCellValue::commit( ScDocument& rDoc, const ScAddress& rPos ) const
590{
591 switch (meType)
592 {
593 case CELLTYPE_STRING:
594 {
595 ScSetStringParam aParam;
596 aParam.setTextInput();
597 rDoc.SetString(rPos, mpString->getString(), &aParam);
598 }
599 break;
600 case CELLTYPE_EDIT:
601 rDoc.SetEditText(rPos, ScEditUtil::Clone(*mpEditText, rDoc));
602 break;
603 case CELLTYPE_VALUE:
604 rDoc.SetValue(rPos, mfValue);
605 break;
606 case CELLTYPE_FORMULA:
607 rDoc.SetFormulaCell(rPos, new ScFormulaCell(*mpFormula, rDoc, rPos));
608 break;
609 default:
610 rDoc.SetEmptyCell(rPos);
611 }
612}
613
615{
616 return hasStringImpl(meType, mpFormula);
617}
618
620{
621 return hasNumericImpl(meType, mpFormula);
622}
623
625{
626 return meType == CELLTYPE_FORMULA && mpFormula->GetErrCode() != FormulaError::NONE;
627}
628
630{
631 switch (meType)
632 {
633 case CELLTYPE_VALUE:
634 return mfValue;
635 case CELLTYPE_FORMULA:
636 return mpFormula->GetValue();
637 default:
638 ;
639 }
640 return 0.0;
641}
642
644{
645 switch (meType)
646 {
647 case CELLTYPE_VALUE:
648 return mfValue;
649 case CELLTYPE_FORMULA:
650 return mpFormula->GetRawValue();
651 default:
652 ;
653 }
654 return 0.0;
655}
656
657OUString ScRefCellValue::getString( const ScDocument* pDoc ) const
658{
659 return getStringImpl(*this, pDoc);
660}
661
662OUString ScRefCellValue::getRawString( const ScDocument& rDoc ) const
663{
664 return getRawStringImpl(*this, rDoc);
665}
666
668{
669 return meType == CELLTYPE_NONE;
670}
671
673{
674 if (isEmpty())
675 return true;
676
678 return mpFormula->IsEmpty();
679
680 return false;
681}
682
684{
685 return equalsWithoutFormatImpl(*this, r);
686}
687
688/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
SCTAB GetTab() const
Definition: column.hxx:254
void SetValue(SCROW nRow, double fVal)
Definition: column3.cxx:3042
ScFormulaCell * SetFormulaCell(SCROW nRow, ScFormulaCell *pCell, sc::StartListeningType eListenType=sc::SingleCellListening, bool bInheritNumFormatIfNeeded=true)
Takes ownership of pCell.
Definition: column3.cxx:2420
SCCOL GetCol() const
Definition: column.hxx:255
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
Definition: column3.cxx:2322
void DeleteContent(SCROW nRow, bool bBroadcast=true)
Definition: column3.cxx:204
void SetRawString(SCROW nRow, const OUString &rStr)
Definition: column3.cxx:2993
ScDocument & GetDoc() const
Definition: column.hxx:127
void SetEmptyCell(const ScAddress &rPos)
Definition: document.cxx:3508
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
Definition: document.cxx:3452
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
Definition: documen2.cxx:1108
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
Definition: documen2.cxx:477
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3421
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
Definition: document.cxx:3516
ScRefCellValue GetRefCellValue(const ScAddress &rPos)
Definition: documen2.cxx:570
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:616
static std::unique_ptr< EditTextObject > Clone(const EditTextObject &rSrc, ScDocument &rDestDoc)
Definition: editutil.cxx:189
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:119
double GetValue()
ScFormulaCell * Clone() const
double GetRawValue() const
Get a numeric value without potentially triggering re-calculation.
FormulaError GetErrCode()
ScTokenArray * GetCode()
ScAddress aPos
sal_uInt16 GetLen() const
FormulaToken ** GetArray() const
FormulaError GetCodeError() const
const OUString & getString() const
#define suppress_fun_call_w_exception(expr)
OString right
EEControlBits
CellType
Definition: global.hxx:271
@ CELLTYPE_EDIT
Definition: global.hxx:276
@ CELLTYPE_STRING
Definition: global.hxx:274
@ CELLTYPE_FORMULA
Definition: global.hxx:275
@ CELLTYPE_NONE
Definition: global.hxx:272
@ CELLTYPE_VALUE
Definition: global.hxx:273
ScCloneFlags
Definition: global.hxx:250
sal_Int64 n
std::vector< sal_Int8, boost::noinit_adaptor< std::allocator< sal_Int8 > > > maData
OUString getString(const Any &_rAny)
int i
StartListeningType
Definition: types.hxx:124
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.
Definition: cellvalue.hxx:32
OUString getString(const ScDocument &rDoc) const
Definition: cellvalue.cxx:514
void reset_to_empty()
Definition: cellvalue.cxx:280
void swap(ScCellValue &r)
Definition: cellvalue.cxx:551
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
Definition: cellvalue.cxx:359
bool isEmpty() const
Definition: cellvalue.cxx:519
void set(double fValue)
Definition: cellvalue.cxx:329
bool equalsWithoutFormat(const ScCellValue &r) const
Definition: cellvalue.cxx:524
const svl::SharedString * getSharedString() const
Definition: cellvalue.hxx:60
std::variant< std::monostate, double, svl::SharedString, EditTextObject *, ScFormulaCell * > maData
std::monostate is there to indicate CellType::NONE
Definition: cellvalue.hxx:35
ScCellValue & operator=(const ScCellValue &r)
Definition: cellvalue.cxx:529
void clear() noexcept
Definition: cellvalue.cxx:311
CellType getType() const
Definition: cellvalue.cxx:296
ScFormulaCell * getFormula() const
Definition: cellvalue.hxx:59
EditTextObject * getEditText() const
Definition: cellvalue.hxx:61
double getDouble() const
Definition: cellvalue.hxx:58
void release(ScDocument &rDoc, const ScAddress &rPos)
Set cell value at specified position in specified document.
Definition: cellvalue.cxx:456
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
Definition: cellvalue.cxx:426
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
ScFormulaCell * getFormula() const
Definition: cellvalue.hxx:137
double getRawValue() const
Retrieve a numeric value without modifying the states of any objects in the referenced document store...
Definition: cellvalue.cxx:643
CellType meType
Definition: cellvalue.hxx:110
bool hasError() const
Definition: cellvalue.cxx:624
const EditTextObject * getEditText() const
Definition: cellvalue.hxx:136
OUString getRawString(const ScDocument &rDoc) const
Retrieve a string value without modifying the states of any objects in the referenced document store.
Definition: cellvalue.cxx:662
bool hasEmptyValue()
Definition: cellvalue.cxx:672
double getDouble() const
Definition: cellvalue.hxx:134
bool isEmpty() const
Definition: cellvalue.cxx:667
const EditTextObject * mpEditText
Definition: cellvalue.hxx:114
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
Definition: cellvalue.cxx:657
bool hasNumeric() const
Definition: cellvalue.cxx:619
const svl::SharedString * mpString
Definition: cellvalue.hxx:113
ScFormulaCell * mpFormula
Definition: cellvalue.hxx:115
double getValue()
Definition: cellvalue.cxx:629
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
Definition: cellvalue.cxx:589
void assign(ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
Definition: cellvalue.cxx:579
bool equalsWithoutFormat(const ScRefCellValue &r) const
Definition: cellvalue.cxx:683
const svl::SharedString * getSharedString() const
Definition: cellvalue.hxx:135
bool hasString() const
Definition: cellvalue.cxx:614
CellType getType() const
Definition: cellvalue.hxx:133
Store parameters used in the ScDocument::SetString() method.
Definition: stringutil.hxx:35
void setTextInput()
Call this whenever you need to unconditionally set input as text, no matter what the input is.
Definition: stringutil.cxx:38
Store position data for column array storage.
sal_Int32 SCROW
Definition: types.hxx:17
sal_uInt64 left
RedlineType meType