update ooo310-m15
[ooovba.git] / sc / inc / cell.hxx
blob714fb1e87416e1f89d0c7d57cc9846e4b72d97e2
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 class ScMultipleReadHeader;
70 class ScMultipleWriteHeader;
72 // ============================================================================
74 /** Default cell clone flags: do not start listening, do not adjust 3D refs to
75 old position, clone note captions of cell notes. */
76 const int SC_CLONECELL_DEFAULT = 0x0000;
78 /** If set, cloned formula cells will start to listen to the document. */
79 const int SC_CLONECELL_STARTLISTENING = 0x0001;
81 /** If set, relative 3D references of cloned formula cells will be adjusted to
82 old position (used while swapping cells for sorting a cell range). */
83 const int SC_CLONECELL_ADJUST3DREL = 0x0002;
85 /** If set, the caption object of a cell note will not be cloned (used while
86 copying cells to undo document, where captions are handled in drawing undo). */
87 const int SC_CLONECELL_NOCAPTION = 0x0004;
89 // ============================================================================
91 class SC_DLLPUBLIC ScBaseCell
93 protected:
94 ~ScBaseCell(); // nicht virtuell -> darf nicht direkt aufgerufen werden
96 public:
97 explicit ScBaseCell( CellType eNewType );
99 /** Base copy constructor. Does NOT clone cell note or broadcaster! */
100 ScBaseCell( const ScBaseCell& rCell );
102 /** Returns a clone of this cell at the same position, cell note and
103 broadcaster will not be cloned. */
104 ScBaseCell* CloneWithoutNote( ScDocument& rDestDoc, int nCloneFlags = SC_CLONECELL_DEFAULT ) const;
106 /** Returns a clone of this cell for the passed document position, cell
107 note and broadcaster will not be cloned. */
108 ScBaseCell* CloneWithoutNote( ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags = SC_CLONECELL_DEFAULT ) const;
110 /** Returns a clone of this cell, clones cell note and caption object too
111 (unless SC_CLONECELL_NOCAPTION flag is set). Broadcaster will not be cloned. */
112 ScBaseCell* CloneWithNote( ScDocument& rDestDoc, const ScAddress& rDestPos, int nCloneFlags = SC_CLONECELL_DEFAULT ) const;
114 /** Due to the fact that ScBaseCell does not have a vtable, this function
115 deletes the cell by calling the appropriate d'tor of the derived class. */
116 void Delete();
118 inline CellType GetCellType() const { return (CellType)eCellType; }
120 /** Returns true, if the cell is empty (neither value nor formula nor cell note).
121 Returns false for formula cells returning nothing, use HasEmptyData() for that. */
122 bool IsBlank( bool bIgnoreNotes = false ) const;
124 // fuer Idle-Berechnung
125 inline USHORT GetTextWidth() const { return nTextWidth; }
126 inline void SetTextWidth( USHORT nNew ) { nTextWidth = nNew; }
128 inline BYTE GetScriptType() const { return nScriptType; }
129 inline void SetScriptType( BYTE nNew ) { nScriptType = nNew; }
131 /** Returns true, if the cell contains a note. */
132 inline bool HasNote() const { return mpNote != 0; }
133 /** Returns the pointer to a cell note object (read-only). */
134 inline const ScPostIt* GetNote() const { return mpNote; }
135 /** Returns the pointer to a cell note object. */
136 inline ScPostIt* GetNote() { return mpNote; }
137 /** Takes ownership of the passed cell note object. */
138 void TakeNote( ScPostIt* pNote );
139 /** Returns and forgets the own cell note object. Caller takes ownership! */
140 ScPostIt* ReleaseNote();
141 /** Deletes the own cell note object. */
142 void DeleteNote();
144 /** Returns true, if the cell contains a broadcaster. */
145 inline bool HasBroadcaster() const { return mpBroadcaster != 0; }
146 /** Returns the pointer to the cell broadcaster. */
147 inline SvtBroadcaster* GetBroadcaster() const { return mpBroadcaster; }
148 /** Takes ownership of the passed cell broadcaster. */
149 void TakeBroadcaster( SvtBroadcaster* pBroadcaster );
150 /** Returns and forgets the own cell broadcaster. Caller takes ownership! */
151 SvtBroadcaster* ReleaseBroadcaster();
152 /** Deletes the own cell broadcaster. */
153 void DeleteBroadcaster();
155 // String- oder EditCell
156 static ScBaseCell* CreateTextCell( const String& rString, ScDocument* );
158 // nOnlyNames may be one or more of SC_LISTENING_NAMES_*
159 void StartListeningTo( ScDocument* pDoc );
160 void EndListeningTo( ScDocument* pDoc,
161 ScTokenArray* pArr = NULL,
162 ScAddress aPos = ScAddress() );
164 /** Error code if ScFormulaCell, else 0. */
165 USHORT GetErrorCode() const;
166 /** ScFormulaCell with formula::svEmptyCell result, or ScNoteCell (may have been
167 created due to reference to empty cell). */
168 BOOL HasEmptyData() const;
169 BOOL HasValueData() const;
170 BOOL HasStringData() const;
171 String GetStringData() const; // nur echte Strings
173 static BOOL CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 );
175 private:
176 ScBaseCell& operator=( const ScBaseCell& );
178 private:
179 ScPostIt* mpNote; /// The cell note. Cell takes ownership!
180 SvtBroadcaster* mpBroadcaster; /// Broadcaster for changed values. Cell takes ownership!
182 protected:
183 USHORT nTextWidth;
184 BYTE eCellType; // enum CellType - BYTE spart Speicher
185 BYTE nScriptType;
188 // ============================================================================
190 class SC_DLLPUBLIC ScNoteCell : public ScBaseCell
192 public:
193 #ifdef USE_MEMPOOL
194 DECL_FIXEDMEMPOOL_NEWDEL( ScNoteCell )
195 #endif
197 /** Cell takes ownership of the passed broadcaster. */
198 explicit ScNoteCell( SvtBroadcaster* pBC = 0 );
199 /** Cell takes ownership of the passed note and broadcaster. */
200 explicit ScNoteCell( ScPostIt* pNote, SvtBroadcaster* pBC = 0 );
202 #ifdef DBG_UTIL
203 ~ScNoteCell();
204 #endif
206 ScNoteCell( SvStream& rStream, USHORT nVer );
208 void Save( SvStream& rStream ) const;
210 private:
211 ScNoteCell( const ScNoteCell& );
214 // ============================================================================
216 class SC_DLLPUBLIC ScValueCell : public ScBaseCell
218 public:
219 #ifdef USE_MEMPOOL
220 DECL_FIXEDMEMPOOL_NEWDEL( ScValueCell )
221 #endif
222 ScValueCell();
223 explicit ScValueCell( double fValue );
225 #ifdef DBG_UTIL
226 ~ScValueCell();
227 #endif
229 inline void SetValue( double fValue ) { mfValue = fValue; }
230 inline double GetValue() const { return mfValue; }
232 private:
233 double mfValue;
236 // ============================================================================
238 class SC_DLLPUBLIC ScStringCell : public ScBaseCell
240 public:
241 #ifdef USE_MEMPOOL
242 DECL_FIXEDMEMPOOL_NEWDEL( ScStringCell )
243 #endif
245 ScStringCell();
246 explicit ScStringCell( const String& rString );
248 #ifdef DBG_UTIL
249 ~ScStringCell();
250 #endif
252 inline void SetString( const String& rString ) { maString = rString; }
253 inline void GetString( String& rString ) const { rString = maString; }
254 inline const String& GetString() const { return maString; }
256 virtual bool HasPhonetic() const;
258 private:
259 String maString;
262 // ============================================================================
265 * A class for representing of Asian phonetic guide.
267 class SC_DLLPUBLIC ScAsianStringCell : public ScStringCell
269 private:
270 ScPhonetic aPhonetic;
272 public:
274 #ifdef USE_MEMPOOL
275 DECL_FIXEDMEMPOOL_NEWDEL( ScAsianStringCell )
276 #endif
277 #ifdef DBG_UTIL
278 ~ScAsianStringCell();
279 #endif
281 ScAsianStringCell();
284 * A constructor of ScAsianStringCell
285 * @param rString the text of the cell.
286 * @param rPhonetic a reference of ScPhonetic.
288 ScAsianStringCell( const String& rString, const ScPhonetic& rPhonetic );
291 * A constructor of ScAsianStringCell
292 * @param rStream a reference of SvStream.
293 * @param nVer the number of vesion.
295 ScAsianStringCell( SvStream& rStream, USHORT nVer );
298 * Sets ScPhonetic:
299 * @param rPhonetic a reference of ScPhonetic.
301 void SetPhonetic( const ScPhonetic& rPhonetic );
304 * Gets ScPhonetic:
305 * @param rPhonetic a reference of ScPhonetic.
307 void GetPhonetic( ScPhonetic& rPhonetic ) const;
309 virtual bool HasPhonetic() const;
312 // ============================================================================
314 class SC_DLLPUBLIC ScEditCell : public ScBaseCell
316 private:
317 EditTextObject* pData;
318 String* pString; // fuer schnelleren Zugriff von Formeln
319 ScDocument* pDoc; // fuer EditEngine Zugriff mit Pool
321 void SetTextObject( const EditTextObject* pObject,
322 const SfxItemPool* pFromPool );
324 // not implemented
325 ScEditCell( const ScEditCell& );
327 public:
329 #ifdef USE_MEMPOOL
330 DECL_FIXEDMEMPOOL_NEWDEL( ScEditCell )
331 #endif
333 ~ScEditCell(); // wegen pData immer!
335 ScEditCell( const EditTextObject* pObject, ScDocument*,
336 const SfxItemPool* pFromPool /* = NULL */ );
337 ScEditCell( const ScEditCell& rCell, ScDocument& rDoc );
338 // fuer Zeilenumbrueche
339 ScEditCell( const String& rString, ScDocument* );
341 void SetData( const EditTextObject* pObject,
342 const SfxItemPool* pFromPool /* = NULL */ );
343 void GetData( const EditTextObject*& rpObject ) const;
344 void GetString( String& rString ) const;
346 virtual bool HasPhonetic() const;
348 const EditTextObject* GetData() const { return pData; }
350 /** Removes character attribute based on new pattern attributes. */
351 void RemoveCharAttribs( const ScPatternAttr& rAttr );
354 // ============================================================================
356 class ScEditDataArray
358 public:
359 class Item
361 public:
362 explicit Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
363 EditTextObject* pOldData, EditTextObject* pNewData);
364 ~Item();
366 const EditTextObject* GetOldData() const;
367 const EditTextObject* GetNewData() const;
368 SCTAB GetTab() const;
369 SCCOL GetCol() const;
370 SCROW GetRow() const;
372 private:
373 Item(); // disabled
375 private:
376 ::boost::shared_ptr<EditTextObject> mpOldData;
377 ::boost::shared_ptr<EditTextObject> mpNewData;
378 SCTAB mnTab;
379 SCCOL mnCol;
380 SCROW mnRow;
384 ScEditDataArray();
385 ~ScEditDataArray();
387 void AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
388 EditTextObject* pOldData, EditTextObject* pNewData);
390 const Item* First();
391 const Item* Next();
393 private:
394 ::std::vector<Item>::const_iterator maIter;
395 ::std::vector<Item> maArray;
398 // ============================================================================
402 * A class for representing of Asian phonetic guide.
403 * It is derived from ScStringCell.
405 class SC_DLLPUBLIC ScAsianEditCell : public ScEditCell
407 private:
408 ScPhonetic aPhonetic;
410 public:
412 #ifdef USE_MEMPOOL
413 DECL_FIXEDMEMPOOL_NEWDEL( ScAsianStringCell )
414 #endif
415 #ifdef DBG_UTIL
416 ~ScAsianEditCell();
417 #endif
420 * A constructor of ScAsianEditCell
421 * @param rEditCell a reference of ScEditCell.
422 * @param pDoc a pointer of ScDocument.
423 * @param rPhonetic a reference of ScPhonetic.
425 ScAsianEditCell( const ScEditCell& rEditCell, ScDocument& rDoc, const ScPhonetic& rPhonetic );
428 * A constructor of ScAsianEditCell
429 * @param pObject a pointer of EditTextObject.
430 * @param pDoc a pointer of ScDocument.
431 * @param pFromPool a pointer of SfxItemPool.
432 * @param rPhonetic a reference of ScPhonetic.
434 ScAsianEditCell( const EditTextObject* pObject, ScDocument* pDoc,
435 const SfxItemPool* pFromPool, const ScPhonetic& rPhonetic );
438 * Sets ScPhonetic:
439 * @param rPhonetic a reference of ScPhonetic.
441 void SetPhonetic( const ScPhonetic& rPhonetic );
444 * Gets ScPhonetic:
445 * @param rPhonetic a reference of ScPhonetic.
447 void GetPhonetic( ScPhonetic& rPhonetic ) const;
449 virtual bool HasPhonetic() const;
452 // ----------------------------------------------------------------------------
454 enum ScMatrixMode {
455 MM_NONE = 0, // No matrix formula
456 MM_FORMULA = 1, // Upper left matrix formula cell
457 MM_REFERENCE = 2, // Remaining cells, via ocMatRef reference token
458 MM_FAKE = 3 // Interpret "as-if" matrix formula (legacy)
461 class ScIndexMap;
463 class SC_DLLPUBLIC ScFormulaCell : public ScBaseCell, public SvtListener
465 private:
466 ScFormulaResult aResult;
467 formula::FormulaGrammar::Grammar eTempGrammar; // used between string (creation) and (re)compilation
468 ScTokenArray* pCode; // The (new) token array
469 ScDocument* pDocument;
470 ScFormulaCell* pPrevious;
471 ScFormulaCell* pNext;
472 ScFormulaCell* pPreviousTrack;
473 ScFormulaCell* pNextTrack;
474 ULONG nFormatIndex; // Number format set by calculation
475 short nFormatType; // Number format type set by calculation
476 USHORT nSeenInIteration; // Iteration cycle in which the cell was last encountered
477 BYTE cMatrixFlag; // One of ScMatrixMode
478 BOOL bDirty : 1; // Must be (re)calculated
479 BOOL bChanged : 1; // Whether something changed regarding display/representation
480 BOOL bRunning : 1; // Already interpreting right now
481 BOOL bCompile : 1; // Must be (re)compiled
482 BOOL bSubTotal : 1; // Cell is part of or contains a SubTotal
483 BOOL bIsIterCell : 1; // Cell is part of a circular reference
484 BOOL bInChangeTrack : 1; // Cell is in ChangeTrack
485 BOOL bTableOpDirty : 1; // Dirty flag for TableOp
486 BOOL bNeedListening : 1; // Listeners need to be re-established after UpdateReference
488 enum ScInterpretTailParameter
490 SCITP_NORMAL,
491 SCITP_FROM_ITERATION,
492 SCITP_CLOSE_ITERATION_CIRCLE
494 void InterpretTail( ScInterpretTailParameter );
496 ScFormulaCell( const ScFormulaCell& );
498 public:
500 #ifdef USE_MEMPOOL
501 DECL_FIXEDMEMPOOL_NEWDEL( ScFormulaCell )
502 #endif
504 ScAddress aPos;
506 ~ScFormulaCell();
507 ScFormulaCell();
509 /** Empty formula cell, or with a preconstructed token array. */
510 ScFormulaCell( ScDocument*, const ScAddress&, const ScTokenArray* = NULL,
511 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
512 BYTE = MM_NONE );
514 /** With formula string and grammar to compile with.
515 formula::FormulaGrammar::GRAM_DEFAULT effectively isformula::FormulaGrammar::GRAM_NATIVE_UI that
516 also includes formula::FormulaGrammar::CONV_UNSPECIFIED, therefor uses the address
517 convention associated with rPos::nTab by default. */
518 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
519 const String& rFormula,
520 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
521 BYTE cMatInd = MM_NONE );
523 ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, const ScAddress& rPos, int nCloneFlags = SC_CLONECELL_DEFAULT );
525 void GetFormula( String& rFormula,
526 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
527 void GetFormula( rtl::OUStringBuffer& rBuffer,
528 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
530 void SetDirty();
531 void SetDirtyVar();
532 // If setting entire document dirty after load, no broadcasts but still append to FormulaTree.
533 void SetDirtyAfterLoad();
534 inline void ResetTableOpDirtyVar() { bTableOpDirty = FALSE; }
535 void SetTableOpDirty();
536 BOOL IsDirtyOrInTableOpDirty() const;
537 BOOL GetDirty() const { return bDirty; }
538 BOOL NeedsListening() const { return bNeedListening; }
539 void SetNeedsListening( BOOL bVar ) { bNeedListening = bVar; }
540 void Compile(const String& rFormula,
541 BOOL bNoListening = FALSE,
542 const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
543 void CompileTokenArray( BOOL bNoListening = FALSE );
544 void CompileXML( ScProgress& rProgress ); // compile temporary string tokens
545 void CalcAfterLoad();
546 bool MarkUsedExternalReferences();
547 void Interpret();
548 inline BOOL IsIterCell() const { return bIsIterCell; }
549 inline USHORT GetSeenInIteration() const { return nSeenInIteration; }
551 BOOL HasOneReference( ScRange& r ) const;
552 BOOL HasRelNameReference() const;
553 BOOL HasColRowName() const;
555 void UpdateReference(UpdateRefMode eUpdateRefMode,
556 const ScRange& r,
557 SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
558 ScDocument* pUndoDoc = NULL );
560 void TransposeReference();
561 void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
562 ScDocument* pUndoDoc );
564 void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
566 void UpdateInsertTab(SCTAB nTable);
567 void UpdateInsertTabAbs(SCTAB nTable);
568 BOOL UpdateDeleteTab(SCTAB nTable, BOOL bIsMove = FALSE);
569 void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo);
570 void UpdateRenameTab(SCTAB nTable, const String& rName);
571 BOOL TestTabRefAbs(SCTAB nTable);
572 void UpdateCompile( BOOL bForceIfNameInUse = FALSE );
573 BOOL IsRangeNameInUse(USHORT nIndex) const;
574 void FindRangeNamesInUse(std::set<USHORT>& rIndexes) const;
575 void ReplaceRangeNamesInUse( const ScIndexMap& rMap );
576 void ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap );
577 BOOL IsSubTotal() const { return bSubTotal; }
578 BOOL IsChanged() const { return bChanged; }
579 void ResetChanged() { bChanged = FALSE; }
580 BOOL IsEmpty(); // formula::svEmptyCell result
581 // display as empty string if formula::svEmptyCell result
582 BOOL IsEmptyDisplayedAsString();
583 BOOL IsValue(); // also TRUE if formula::svEmptyCell
584 double GetValue();
585 double GetValueAlways(); // ignore errors
586 void GetString( String& rString );
587 const ScMatrix* GetMatrix();
588 BOOL GetMatrixOrigin( ScAddress& rPos ) const;
589 void GetResultDimensions( SCSIZE& rCols, SCSIZE& rRows );
590 USHORT GetMatrixEdge( ScAddress& rOrgPos );
591 USHORT GetErrCode(); // interpret first if necessary
592 USHORT GetRawError(); // don't interpret, just return code or result error
593 short GetFormatType() const { return nFormatType; }
594 ULONG GetFormatIndex() const { return nFormatIndex; }
595 void GetFormatInfo( short& nType, ULONG& nIndex ) const
596 { nType = nFormatType; nIndex = nFormatIndex; }
597 BYTE GetMatrixFlag() const { return cMatrixFlag; }
598 ScTokenArray* GetCode() const { return pCode; }
600 BOOL IsRunning() const { return bRunning; }
601 void SetRunning( BOOL bVal ) { bRunning = bVal; }
602 void CompileDBFormula();
603 void CompileDBFormula( BOOL bCreateFormulaString );
604 void CompileNameFormula( BOOL bCreateFormulaString );
605 void CompileColRowNameFormula();
606 ScFormulaCell* GetPrevious() const { return pPrevious; }
607 ScFormulaCell* GetNext() const { return pNext; }
608 void SetPrevious( ScFormulaCell* pF ) { pPrevious = pF; }
609 void SetNext( ScFormulaCell* pF ) { pNext = pF; }
610 ScFormulaCell* GetPreviousTrack() const { return pPreviousTrack; }
611 ScFormulaCell* GetNextTrack() const { return pNextTrack; }
612 void SetPreviousTrack( ScFormulaCell* pF ) { pPreviousTrack = pF; }
613 void SetNextTrack( ScFormulaCell* pF ) { pNextTrack = pF; }
615 virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint);
616 void SetCompile( BOOL bVal ) { bCompile = bVal; }
617 ScDocument* GetDocument() const { return pDocument; }
618 void SetMatColsRows( SCCOL nCols, SCROW nRows );
619 void GetMatColsRows( SCCOL& nCols, SCROW& nRows ) const;
621 // ob Zelle im ChangeTrack und nicht im echten Dokument ist
622 void SetInChangeTrack( BOOL bVal ) { bInChangeTrack = bVal; }
623 BOOL IsInChangeTrack() const { return bInChangeTrack; }
625 // Zu Typ und Format das entsprechende Standardformat.
626 // Bei Format "Standard" evtl. das in die Formelzelle
627 // uebernommene Format.
628 ULONG GetStandardFormat( SvNumberFormatter& rFormatter, ULONG nFormat ) const;
630 // For import filters!
631 void AddRecalcMode( formula::ScRecalcMode );
632 /** For import only: set a double result. */
633 void SetHybridDouble( double n ) { aResult.SetHybridDouble( n); }
634 /** For import only: set a string result.
635 If for whatever reason you have to use both, SetHybridDouble() and
636 SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
637 for performance reasons.*/
638 void SetHybridString( const String& r )
639 { aResult.SetHybridString( r); }
640 /** For import only: set a temporary formula string to be compiled later.
641 If for whatever reason you have to use both, SetHybridDouble() and
642 SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
643 for performance reasons.*/
644 void SetHybridFormula( const String& r,
645 const formula::FormulaGrammar::Grammar eGrammar )
646 { aResult.SetHybridFormula( r); eTempGrammar = eGrammar; }
647 void SetErrCode( USHORT n );
648 inline BOOL IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
649 EditTextObject* CreateURLObject() ;
650 void GetURLResult( String& rURL, String& rCellText );
652 /** Determines whether or not the result string contains more than one paragraph */
653 bool IsMultilineResult();
656 // Iterator fuer Referenzen in einer Formelzelle
657 class ScDetectiveRefIter
659 private:
660 ScTokenArray* pCode;
661 ScAddress aPos;
662 public:
663 ScDetectiveRefIter( ScFormulaCell* pCell );
664 BOOL GetNextRef( ScRange& rRange );
665 ScToken* GetNextRefToken();
668 // ============================================================================
670 inline bool ScStringCell::HasPhonetic() const
672 return false;
675 // ScAsianStringCell
677 inline ScAsianStringCell::ScAsianStringCell()
681 inline ScAsianStringCell::ScAsianStringCell( const String& rString, const ScPhonetic& rPhonetic ) :
682 ScStringCell ( rString ),
683 aPhonetic ( rPhonetic )
687 inline void ScAsianStringCell::GetPhonetic( ScPhonetic& rPhonetic ) const
689 rPhonetic = aPhonetic;
692 inline bool ScAsianStringCell::HasPhonetic() const
694 return true;
697 inline void ScAsianStringCell::SetPhonetic( const ScPhonetic& rPhonetic )
699 aPhonetic = rPhonetic;
702 // ScAsianEditCell
704 inline ScAsianEditCell::ScAsianEditCell( const ScEditCell& rEditCell, ScDocument& rDoc, const ScPhonetic& rPhonetic ) :
705 ScEditCell( rEditCell, rDoc ),
706 aPhonetic( rPhonetic )
710 inline ScAsianEditCell::ScAsianEditCell( const EditTextObject* pObject, ScDocument* pDocP,
711 const SfxItemPool* pFromPool, const ScPhonetic& rPhonetic ) :
712 ScEditCell( pObject, pDocP, pFromPool ),
713 aPhonetic( rPhonetic )
717 inline void ScAsianEditCell::GetPhonetic( ScPhonetic& rPhonetic ) const
719 rPhonetic = aPhonetic;
722 inline void ScAsianEditCell::SetPhonetic( const ScPhonetic& rPhonetic )
724 aPhonetic = rPhonetic;
727 inline bool ScAsianEditCell::HasPhonetic() const
729 return true;
732 #endif