update dev300-m57
[ooovba.git] / sc / inc / cell.hxx
blob2e385e3a2bfa61677a7f90f72d88dfba97c244c9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cell.hxx,v $
10 * $Revision: 1.30.38.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_CELL_HXX
32 #define SC_CELL_HXX
34 #include <stddef.h>
36 #include <set>
37 #include <vector>
38 #include <boost/shared_ptr.hpp>
40 #include <tools/mempool.hxx>
41 #include <svtools/listener.hxx>
42 #include "global.hxx"
43 #include "rangenam.hxx"
44 #include "formula/grammar.hxx"
45 #include "tokenarray.hxx"
46 #include "formularesult.hxx"
47 #include "phonetic.hxx"
48 #include <rtl/ustrbuf.hxx>
49 #include <vcl/fontcvt.hxx>
50 #include "scdllapi.h"
52 #define USE_MEMPOOL
53 #define TEXTWIDTH_DIRTY 0xffff
55 // in addition to SCRIPTTYPE_... flags from scripttypeitem.hxx:
56 // set (in nScriptType) if type has not been determined yet
57 #define SC_SCRIPTTYPE_UNKNOWN 0x08
59 class ScDocument;
60 class EditTextObject;
61 class ScMatrix;
62 class SvtBroadcaster;
63 class ScCodeArray;
64 class ScProgress;
65 class ScPostIt;
66 class ScPatternAttr;
67 class ScPhonetic;
69 // ============================================================================
71 /** Default cell clone flags: do not start listening, do not adjust 3D refs to
72 old position, clone note captions of cell notes. */
73 const int SC_CLONECELL_DEFAULT = 0x0000;
75 /** If set, cloned formula cells will start to listen to the document. */
76 const int SC_CLONECELL_STARTLISTENING = 0x0001;
78 /** If set, relative 3D references of cloned formula cells will be adjusted to
79 old position (used while swapping cells for sorting a cell range). */
80 const int SC_CLONECELL_ADJUST3DREL = 0x0002;
82 /** If set, the caption object of a cell note will not be cloned (used while
83 copying cells to undo document, where captions are handled in drawing undo). */
84 const int SC_CLONECELL_NOCAPTION = 0x0004;
86 // ============================================================================
88 class SC_DLLPUBLIC ScBaseCell
90 protected:
91 ~ScBaseCell(); // nicht virtuell -> darf nicht direkt aufgerufen werden
93 public:
94 explicit ScBaseCell( CellType eNewType );
96 /** Base copy constructor. Does NOT clone cell note or broadcaster! */
97 ScBaseCell( const ScBaseCell& rCell );
99 /** Returns a clone of this cell at the same position, cell note and
100 broadcaster will not be cloned. */
101 ScBaseCell* CloneWithoutNote( ScDocument& rDestDoc, int nCloneFlags = SC_CLONECELL_DEFAULT ) const;
103 /** Returns a clone of this cell for the passed document position, cell
104 note and broadcaster will not be cloned. */
105 ScBaseCell* CloneWithoutNote( ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags = SC_CLONECELL_DEFAULT ) const;
107 /** Returns a clone of this cell, clones cell note and caption object too
108 (unless SC_CLONECELL_NOCAPTION flag is set). Broadcaster will not be cloned. */
109 ScBaseCell* CloneWithNote( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags = SC_CLONECELL_DEFAULT ) const;
111 /** Due to the fact that ScBaseCell does not have a vtable, this function
112 deletes the cell by calling the appropriate d'tor of the derived class. */
113 void Delete();
115 inline CellType GetCellType() const { return (CellType)eCellType; }
117 /** Returns true, if the cell is empty (neither value nor formula nor cell note).
118 Returns false for formula cells returning nothing, use HasEmptyData() for that. */
119 bool IsBlank( bool bIgnoreNotes = false ) const;
121 // fuer Idle-Berechnung
122 inline USHORT GetTextWidth() const { return nTextWidth; }
123 inline void SetTextWidth( USHORT nNew ) { nTextWidth = nNew; }
125 inline BYTE GetScriptType() const { return nScriptType; }
126 inline void SetScriptType( BYTE nNew ) { nScriptType = nNew; }
128 /** Returns true, if the cell contains a note. */
129 inline bool HasNote() const { return mpNote != 0; }
130 /** Returns the pointer to a cell note object (read-only). */
131 inline const ScPostIt* GetNote() const { return mpNote; }
132 /** Returns the pointer to a cell note object. */
133 inline ScPostIt* GetNote() { return mpNote; }
134 /** Takes ownership of the passed cell note object. */
135 void TakeNote( ScPostIt* pNote );
136 /** Returns and forgets the own cell note object. Caller takes ownership! */
137 ScPostIt* ReleaseNote();
138 /** Deletes the own cell note object. */
139 void DeleteNote();
141 /** Returns true, if the cell contains a broadcaster. */
142 inline bool HasBroadcaster() const { return mpBroadcaster != 0; }
143 /** Returns the pointer to the cell broadcaster. */
144 inline SvtBroadcaster* GetBroadcaster() const { return mpBroadcaster; }
145 /** Takes ownership of the passed cell broadcaster. */
146 void TakeBroadcaster( SvtBroadcaster* pBroadcaster );
147 /** Returns and forgets the own cell broadcaster. Caller takes ownership! */
148 SvtBroadcaster* ReleaseBroadcaster();
149 /** Deletes the own cell broadcaster. */
150 void DeleteBroadcaster();
152 // String- oder EditCell
153 static ScBaseCell* CreateTextCell( const String& rString, ScDocument* );
155 // nOnlyNames may be one or more of SC_LISTENING_NAMES_*
156 void StartListeningTo( ScDocument* pDoc );
157 void EndListeningTo( ScDocument* pDoc,
158 ScTokenArray* pArr = NULL,
159 ScAddress aPos = ScAddress() );
161 /** Error code if ScFormulaCell, else 0. */
162 USHORT GetErrorCode() const;
163 /** ScFormulaCell with formula::svEmptyCell result, or ScNoteCell (may have been
164 created due to reference to empty cell). */
165 BOOL HasEmptyData() const;
166 BOOL HasValueData() const;
167 BOOL HasStringData() const;
168 String GetStringData() const; // nur echte Strings
170 static BOOL CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 );
172 private:
173 ScBaseCell& operator=( const ScBaseCell& );
175 private:
176 ScPostIt* mpNote; /// The cell note. Cell takes ownership!
177 SvtBroadcaster* mpBroadcaster; /// Broadcaster for changed values. Cell takes ownership!
179 protected:
180 USHORT nTextWidth;
181 BYTE eCellType; // enum CellType - BYTE spart Speicher
182 BYTE nScriptType;
185 // ============================================================================
187 class SC_DLLPUBLIC ScNoteCell : public ScBaseCell
189 public:
190 #ifdef USE_MEMPOOL
191 DECL_FIXEDMEMPOOL_NEWDEL( ScNoteCell )
192 #endif
194 /** Cell takes ownership of the passed broadcaster. */
195 explicit ScNoteCell( SvtBroadcaster* pBC = 0 );
196 /** Cell takes ownership of the passed note and broadcaster. */
197 explicit ScNoteCell( ScPostIt* pNote, SvtBroadcaster* pBC = 0 );
199 #ifdef DBG_UTIL
200 ~ScNoteCell();
201 #endif
203 private:
204 ScNoteCell( const ScNoteCell& );
207 // ============================================================================
209 class SC_DLLPUBLIC ScValueCell : public ScBaseCell
211 public:
212 #ifdef USE_MEMPOOL
213 DECL_FIXEDMEMPOOL_NEWDEL( ScValueCell )
214 #endif
215 ScValueCell();
216 explicit ScValueCell( double fValue );
218 #ifdef DBG_UTIL
219 ~ScValueCell();
220 #endif
222 inline void SetValue( double fValue ) { mfValue = fValue; }
223 inline double GetValue() const { return mfValue; }
225 private:
226 double mfValue;
229 // ============================================================================
231 class SC_DLLPUBLIC ScStringCell : public ScBaseCell
233 public:
234 #ifdef USE_MEMPOOL
235 DECL_FIXEDMEMPOOL_NEWDEL( ScStringCell )
236 #endif
238 ScStringCell();
239 explicit ScStringCell( const String& rString );
241 #ifdef DBG_UTIL
242 ~ScStringCell();
243 #endif
245 inline void SetString( const String& rString ) { maString = rString; }
246 inline void GetString( String& rString ) const { rString = maString; }
247 inline const String& GetString() const { return maString; }
249 virtual bool HasPhonetic() const;
251 private:
252 String maString;
255 // ============================================================================
258 * A class for representing of Asian phonetic guide.
260 class SC_DLLPUBLIC ScAsianStringCell : public ScStringCell
262 private:
263 ScPhonetic aPhonetic;
265 public:
267 #ifdef USE_MEMPOOL
268 DECL_FIXEDMEMPOOL_NEWDEL( ScAsianStringCell )
269 #endif
270 #ifdef DBG_UTIL
271 ~ScAsianStringCell();
272 #endif
274 ScAsianStringCell();
277 * A constructor of ScAsianStringCell
278 * @param rString the text of the cell.
279 * @param rPhonetic a reference of ScPhonetic.
281 ScAsianStringCell( const String& rString, const ScPhonetic& rPhonetic );
284 * A constructor of ScAsianStringCell
285 * @param rStream a reference of SvStream.
286 * @param nVer the number of vesion.
288 ScAsianStringCell( SvStream& rStream, USHORT nVer );
291 * Sets ScPhonetic:
292 * @param rPhonetic a reference of ScPhonetic.
294 void SetPhonetic( const ScPhonetic& rPhonetic );
297 * Gets ScPhonetic:
298 * @param rPhonetic a reference of ScPhonetic.
300 void GetPhonetic( ScPhonetic& rPhonetic ) const;
302 virtual bool HasPhonetic() const;
305 // ============================================================================
307 class SC_DLLPUBLIC ScEditCell : public ScBaseCell
309 private:
310 EditTextObject* pData;
311 String* pString; // fuer schnelleren Zugriff von Formeln
312 ScDocument* pDoc; // fuer EditEngine Zugriff mit Pool
314 void SetTextObject( const EditTextObject* pObject,
315 const SfxItemPool* pFromPool );
317 // not implemented
318 ScEditCell( const ScEditCell& );
320 public:
322 #ifdef USE_MEMPOOL
323 DECL_FIXEDMEMPOOL_NEWDEL( ScEditCell )
324 #endif
326 ~ScEditCell(); // wegen pData immer!
328 ScEditCell( const EditTextObject* pObject, ScDocument*,
329 const SfxItemPool* pFromPool /* = NULL */ );
330 ScEditCell( const ScEditCell& rCell, ScDocument& rDoc );
331 // fuer Zeilenumbrueche
332 ScEditCell( const String& rString, ScDocument* );
334 void SetData( const EditTextObject* pObject,
335 const SfxItemPool* pFromPool /* = NULL */ );
336 void GetData( const EditTextObject*& rpObject ) const;
337 void GetString( String& rString ) const;
339 virtual bool HasPhonetic() const;
341 const EditTextObject* GetData() const { return pData; }
343 /** Removes character attribute based on new pattern attributes. */
344 void RemoveCharAttribs( const ScPatternAttr& rAttr );
347 // ============================================================================
349 class ScEditDataArray
351 public:
352 class Item
354 public:
355 explicit Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
356 EditTextObject* pOldData, EditTextObject* pNewData);
357 ~Item();
359 const EditTextObject* GetOldData() const;
360 const EditTextObject* GetNewData() const;
361 SCTAB GetTab() const;
362 SCCOL GetCol() const;
363 SCROW GetRow() const;
365 private:
366 Item(); // disabled
368 private:
369 ::boost::shared_ptr<EditTextObject> mpOldData;
370 ::boost::shared_ptr<EditTextObject> mpNewData;
371 SCTAB mnTab;
372 SCCOL mnCol;
373 SCROW mnRow;
377 ScEditDataArray();
378 ~ScEditDataArray();
380 void AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
381 EditTextObject* pOldData, EditTextObject* pNewData);
383 const Item* First();
384 const Item* Next();
386 private:
387 ::std::vector<Item>::const_iterator maIter;
388 ::std::vector<Item> maArray;
391 // ============================================================================
395 * A class for representing of Asian phonetic guide.
396 * It is derived from ScStringCell.
398 class SC_DLLPUBLIC ScAsianEditCell : public ScEditCell
400 private:
401 ScPhonetic aPhonetic;
403 public:
405 #ifdef USE_MEMPOOL
406 DECL_FIXEDMEMPOOL_NEWDEL( ScAsianStringCell )
407 #endif
408 #ifdef DBG_UTIL
409 ~ScAsianEditCell();
410 #endif
413 * A constructor of ScAsianEditCell
414 * @param rEditCell a reference of ScEditCell.
415 * @param pDoc a pointer of ScDocument.
416 * @param rPhonetic a reference of ScPhonetic.
418 ScAsianEditCell( const ScEditCell& rEditCell, ScDocument& rDoc, const ScPhonetic& rPhonetic );
421 * A constructor of ScAsianEditCell
422 * @param pObject a pointer of EditTextObject.
423 * @param pDoc a pointer of ScDocument.
424 * @param pFromPool a pointer of SfxItemPool.
425 * @param rPhonetic a reference of ScPhonetic.
427 ScAsianEditCell( const EditTextObject* pObject, ScDocument* pDoc,
428 const SfxItemPool* pFromPool, const ScPhonetic& rPhonetic );
431 * Sets ScPhonetic:
432 * @param rPhonetic a reference of ScPhonetic.
434 void SetPhonetic( const ScPhonetic& rPhonetic );
437 * Gets ScPhonetic:
438 * @param rPhonetic a reference of ScPhonetic.
440 void GetPhonetic( ScPhonetic& rPhonetic ) const;
442 virtual bool HasPhonetic() const;
445 // ----------------------------------------------------------------------------
447 enum ScMatrixMode {
448 MM_NONE = 0, // No matrix formula
449 MM_FORMULA = 1, // Upper left matrix formula cell
450 MM_REFERENCE = 2, // Remaining cells, via ocMatRef reference token
451 MM_FAKE = 3 // Interpret "as-if" matrix formula (legacy)
454 class ScIndexMap;
456 class SC_DLLPUBLIC ScFormulaCell : public ScBaseCell, public SvtListener
458 private:
459 ScFormulaResult aResult;
460 formula::FormulaGrammar::Grammar eTempGrammar; // used between string (creation) and (re)compilation
461 ScTokenArray* pCode; // The (new) token array
462 ScDocument* pDocument;
463 ScFormulaCell* pPrevious;
464 ScFormulaCell* pNext;
465 ScFormulaCell* pPreviousTrack;
466 ScFormulaCell* pNextTrack;
467 ULONG nFormatIndex; // Number format set by calculation
468 short nFormatType; // Number format type set by calculation
469 USHORT nSeenInIteration; // Iteration cycle in which the cell was last encountered
470 BYTE cMatrixFlag; // One of ScMatrixMode
471 BOOL bDirty : 1; // Must be (re)calculated
472 BOOL bChanged : 1; // Whether something changed regarding display/representation
473 BOOL bRunning : 1; // Already interpreting right now
474 BOOL bCompile : 1; // Must be (re)compiled
475 BOOL bSubTotal : 1; // Cell is part of or contains a SubTotal
476 BOOL bIsIterCell : 1; // Cell is part of a circular reference
477 BOOL bInChangeTrack : 1; // Cell is in ChangeTrack
478 BOOL bTableOpDirty : 1; // Dirty flag for TableOp
479 BOOL bNeedListening : 1; // Listeners need to be re-established after UpdateReference
481 enum ScInterpretTailParameter
483 SCITP_NORMAL,
484 SCITP_FROM_ITERATION,
485 SCITP_CLOSE_ITERATION_CIRCLE
487 void InterpretTail( ScInterpretTailParameter );
489 ScFormulaCell( const ScFormulaCell& );
491 public:
493 #ifdef USE_MEMPOOL
494 DECL_FIXEDMEMPOOL_NEWDEL( ScFormulaCell )
495 #endif
497 ScAddress aPos;
499 ~ScFormulaCell();
500 ScFormulaCell();
502 /** Empty formula cell, or with a preconstructed token array. */
503 ScFormulaCell( ScDocument*, const ScAddress&, const ScTokenArray* = NULL,
504 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
505 BYTE = MM_NONE );
507 /** With formula string and grammar to compile with.
508 formula::FormulaGrammar::GRAM_DEFAULT effectively isformula::FormulaGrammar::GRAM_NATIVE_UI that
509 also includes formula::FormulaGrammar::CONV_UNSPECIFIED, therefor uses the address
510 convention associated with rPos::nTab by default. */
511 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
512 const String& rFormula,
513 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
514 BYTE cMatInd = MM_NONE );
516 ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, const ScAddress& rPos, int nCloneFlags = SC_CLONECELL_DEFAULT );
518 void GetFormula( String& rFormula,
519 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
520 void GetFormula( rtl::OUStringBuffer& rBuffer,
521 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
523 void SetDirty();
524 void SetDirtyVar();
525 // If setting entire document dirty after load, no broadcasts but still append to FormulaTree.
526 void SetDirtyAfterLoad();
527 inline void ResetTableOpDirtyVar() { bTableOpDirty = FALSE; }
528 void SetTableOpDirty();
529 BOOL IsDirtyOrInTableOpDirty() const;
530 BOOL GetDirty() const { return bDirty; }
531 BOOL NeedsListening() const { return bNeedListening; }
532 void SetNeedsListening( BOOL bVar ) { bNeedListening = bVar; }
533 void Compile(const String& rFormula,
534 BOOL bNoListening = FALSE,
535 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
536 void CompileTokenArray( BOOL bNoListening = FALSE );
537 void CompileXML( ScProgress& rProgress ); // compile temporary string tokens
538 void CalcAfterLoad();
539 bool MarkUsedExternalReferences();
540 void Interpret();
541 inline BOOL IsIterCell() const { return bIsIterCell; }
542 inline USHORT GetSeenInIteration() const { return nSeenInIteration; }
544 BOOL HasOneReference( ScRange& r ) const;
545 /* Checks if the formula contains reference list that can be
546 expressed by one reference (like A1;A2;A3:A5 -> A1:A5). The
547 reference list is not required to be sorted (i.e. A3;A1;A2 is
548 still recognized as A1:A3), but no overlapping is allowed.
549 If one reference is recognized, the rRange is filled.
551 It is similar to HasOneReference(), but more general.
553 bool HasRefListExpressibleAsOneReference(ScRange& rRange) const;
554 BOOL HasRelNameReference() const;
555 BOOL HasColRowName() const;
557 void UpdateReference(UpdateRefMode eUpdateRefMode,
558 const ScRange& r,
559 SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
560 ScDocument* pUndoDoc = NULL,
561 const ScAddress* pUndoCellPos = NULL );
563 void TransposeReference();
564 void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
565 ScDocument* pUndoDoc );
567 void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
569 void UpdateInsertTab(SCTAB nTable);
570 void UpdateInsertTabAbs(SCTAB nTable);
571 BOOL UpdateDeleteTab(SCTAB nTable, BOOL bIsMove = FALSE);
572 void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo);
573 void UpdateRenameTab(SCTAB nTable, const String& rName);
574 BOOL TestTabRefAbs(SCTAB nTable);
575 void UpdateCompile( BOOL bForceIfNameInUse = FALSE );
576 BOOL IsRangeNameInUse(USHORT nIndex) const;
577 void FindRangeNamesInUse(std::set<USHORT>& rIndexes) const;
578 void ReplaceRangeNamesInUse( const ScIndexMap& rMap );
579 void ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap );
580 BOOL IsSubTotal() const { return bSubTotal; }
581 BOOL IsChanged() const { return bChanged; }
582 void ResetChanged() { bChanged = FALSE; }
583 BOOL IsEmpty(); // formula::svEmptyCell result
584 // display as empty string if formula::svEmptyCell result
585 BOOL IsEmptyDisplayedAsString();
586 BOOL IsValue(); // also TRUE if formula::svEmptyCell
587 double GetValue();
588 double GetValueAlways(); // ignore errors
589 void GetString( String& rString );
590 const ScMatrix* GetMatrix();
591 BOOL GetMatrixOrigin( ScAddress& rPos ) const;
592 void GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows );
593 USHORT GetMatrixEdge( ScAddress& rOrgPos );
594 USHORT GetErrCode(); // interpret first if necessary
595 USHORT GetRawError(); // don't interpret, just return code or result error
596 short GetFormatType() const { return nFormatType; }
597 ULONG GetFormatIndex() const { return nFormatIndex; }
598 void GetFormatInfo( short& nType, ULONG& nIndex ) const
599 { nType = nFormatType; nIndex = nFormatIndex; }
600 BYTE GetMatrixFlag() const { return cMatrixFlag; }
601 ScTokenArray* GetCode() const { return pCode; }
603 BOOL IsRunning() const { return bRunning; }
604 void SetRunning( BOOL bVal ) { bRunning = bVal; }
605 void CompileDBFormula();
606 void CompileDBFormula( BOOL bCreateFormulaString );
607 void CompileNameFormula( BOOL bCreateFormulaString );
608 void CompileColRowNameFormula();
609 ScFormulaCell* GetPrevious() const { return pPrevious; }
610 ScFormulaCell* GetNext() const { return pNext; }
611 void SetPrevious( ScFormulaCell* pF ) { pPrevious = pF; }
612 void SetNext( ScFormulaCell* pF ) { pNext = pF; }
613 ScFormulaCell* GetPreviousTrack() const { return pPreviousTrack; }
614 ScFormulaCell* GetNextTrack() const { return pNextTrack; }
615 void SetPreviousTrack( ScFormulaCell* pF ) { pPreviousTrack = pF; }
616 void SetNextTrack( ScFormulaCell* pF ) { pNextTrack = pF; }
618 virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint);
619 void SetCompile( BOOL bVal ) { bCompile = bVal; }
620 ScDocument* GetDocument() const { return pDocument; }
621 void SetMatColsRows( SCCOL nCols, SCROW nRows );
622 void GetMatColsRows( SCCOL& nCols, SCROW& nRows ) const;
624 // ob Zelle im ChangeTrack und nicht im echten Dokument ist
625 void SetInChangeTrack( BOOL bVal ) { bInChangeTrack = bVal; }
626 BOOL IsInChangeTrack() const { return bInChangeTrack; }
628 // Zu Typ und Format das entsprechende Standardformat.
629 // Bei Format "Standard" evtl. das in die Formelzelle
630 // uebernommene Format.
631 ULONG GetStandardFormat( SvNumberFormatter& rFormatter, ULONG nFormat ) const;
633 // For import filters!
634 void AddRecalcMode( formula::ScRecalcMode );
635 /** For import only: set a double result. */
636 void SetHybridDouble( double n ) { aResult.SetHybridDouble( n); }
637 /** For import only: set a string result.
638 If for whatever reason you have to use both, SetHybridDouble() and
639 SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
640 for performance reasons.*/
641 void SetHybridString( const String& r )
642 { aResult.SetHybridString( r); }
643 /** For import only: set a temporary formula string to be compiled later.
644 If for whatever reason you have to use both, SetHybridDouble() and
645 SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
646 for performance reasons.*/
647 void SetHybridFormula( const String& r,
648 const formula::FormulaGrammar::Grammar eGrammar )
649 { aResult.SetHybridFormula( r); eTempGrammar = eGrammar; }
650 void SetErrCode( USHORT n );
651 inline BOOL IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
652 EditTextObject* CreateURLObject() ;
653 void GetURLResult( String& rURL, String& rCellText );
655 /** Determines whether or not the result string contains more than one paragraph */
656 bool IsMultilineResult();
659 // Iterator fuer Referenzen in einer Formelzelle
660 class ScDetectiveRefIter
662 private:
663 ScTokenArray* pCode;
664 ScAddress aPos;
665 public:
666 ScDetectiveRefIter( ScFormulaCell* pCell );
667 BOOL GetNextRef( ScRange& rRange );
668 ScToken* GetNextRefToken();
671 // ============================================================================
673 inline bool ScStringCell::HasPhonetic() const
675 return false;
678 // ScAsianStringCell
680 inline ScAsianStringCell::ScAsianStringCell()
684 inline ScAsianStringCell::ScAsianStringCell( const String& rString, const ScPhonetic& rPhonetic ) :
685 ScStringCell ( rString ),
686 aPhonetic ( rPhonetic )
690 inline void ScAsianStringCell::GetPhonetic( ScPhonetic& rPhonetic ) const
692 rPhonetic = aPhonetic;
695 inline bool ScAsianStringCell::HasPhonetic() const
697 return true;
700 inline void ScAsianStringCell::SetPhonetic( const ScPhonetic& rPhonetic )
702 aPhonetic = rPhonetic;
705 // ScAsianEditCell
707 inline ScAsianEditCell::ScAsianEditCell( const ScEditCell& rEditCell, ScDocument& rDoc, const ScPhonetic& rPhonetic ) :
708 ScEditCell( rEditCell, rDoc ),
709 aPhonetic( rPhonetic )
713 inline ScAsianEditCell::ScAsianEditCell( const EditTextObject* pObject, ScDocument* pDocP,
714 const SfxItemPool* pFromPool, const ScPhonetic& rPhonetic ) :
715 ScEditCell( pObject, pDocP, pFromPool ),
716 aPhonetic( rPhonetic )
720 inline void ScAsianEditCell::GetPhonetic( ScPhonetic& rPhonetic ) const
722 rPhonetic = aPhonetic;
725 inline void ScAsianEditCell::SetPhonetic( const ScPhonetic& rPhonetic )
727 aPhonetic = rPhonetic;
730 inline bool ScAsianEditCell::HasPhonetic() const
732 return true;
735 #endif