LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sc/inc - document.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 128 145 88.3 %
Date: 2013-07-09 Functions: 94 105 89.5 %
Legend: Lines: hit not hit

          Line data    Source code
       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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef SC_DOCUMENT_HXX
      21             : #define SC_DOCUMENT_HXX
      22             : 
      23             : #include <vcl/prntypes.hxx>
      24             : #include <vcl/timer.hxx>
      25             : #include <com/sun/star/uno/Reference.hxx>
      26             : #include <rtl/ref.hxx>
      27             : #include "scdllapi.h"
      28             : #include "rangelst.hxx"
      29             : #include "rangenam.hxx"
      30             : #include "brdcst.hxx"
      31             : #include "tabopparams.hxx"
      32             : #include "sortparam.hxx"
      33             : #include "types.hxx"
      34             : #include "formula/grammar.hxx"
      35             : #include "formula/types.hxx"
      36             : #include <com/sun/star/chart2/XChartDocument.hpp>
      37             : #include "typedstrdata.hxx"
      38             : #include "compressedarray.hxx"
      39             : #include "calcmacros.hxx"
      40             : #include <tools/fract.hxx>
      41             : #include <tools/gen.hxx>
      42             : 
      43             : #include <memory>
      44             : #include <map>
      45             : #include <set>
      46             : #include <vector>
      47             : #include <boost/ptr_container/ptr_vector.hpp>
      48             : #include <boost/scoped_ptr.hpp>
      49             : 
      50             : namespace editeng { class SvxBorderLine; }
      51             : namespace sc {
      52             :     struct FormulaGroupContext;
      53             :     class StartListeningContext;
      54             :     class EndListeningContext;
      55             :     class CopyFromClipContext;
      56             :     class ColumnSpanSet;
      57             :     struct ColumnBlockPosition;
      58             : }
      59             : class SvxFontItem;
      60             : 
      61             : class KeyEvent;
      62             : class OutputDevice;
      63             : class SdrObject;
      64             : class SfxBroadcaster;
      65             : class SfxListener;
      66             : class SfxHint;
      67             : class SfxItemSet;
      68             : class SfxObjectShell;
      69             : class SfxBindings;
      70             : class SfxPoolItem;
      71             : class SfxItemPool;
      72             : class SfxPrinter;
      73             : class SfxStyleSheetBase;
      74             : class SvMemoryStream;
      75             : class SvNumberFormatter;
      76             : class SvxBoxInfoItem;
      77             : class SvxBoxItem;
      78             : class SvxForbiddenCharactersTable;
      79             : namespace sfx2 {
      80             :     class LinkManager;
      81             :     }
      82             : class SvxSearchItem;
      83             : class Window;
      84             : class XColorList;
      85             : 
      86             : struct ScAttrEntry;
      87             : class ScAutoFormatData;
      88             : class ScBroadcastAreaSlotMachine;
      89             : class ScChangeViewSettings;
      90             : class ScChartCollection;
      91             : class ScChartListenerCollection;
      92             : class ScConditionalFormat;
      93             : class ScConditionalFormatList;
      94             : class ScDBCollection;
      95             : class ScDBData;
      96             : class ScDetOpData;
      97             : class ScDetOpList;
      98             : class ScDocOptions;
      99             : class ScDocProtection;
     100             : class ScDocumentPool;
     101             : class ScDrawLayer;
     102             : class ScExtDocOptions;
     103             : class ScExternalRefManager;
     104             : class ScFormulaCell;
     105             : class ScMacroManager;
     106             : class ScMarkData;
     107             : class ScOutlineTable;
     108             : class ScPatternAttr;
     109             : class ScPrintRangeSaver;
     110             : class ScRangeData;
     111             : class ScRangeName;
     112             : class ScStyleSheet;
     113             : class ScStyleSheetPool;
     114             : class ScTable;
     115             : class ScTableProtection;
     116             : class ScTokenArray;
     117             : class ScValidationData;
     118             : class ScValidationDataList;
     119             : class ScViewOptions;
     120             : class ScChangeTrack;
     121             : class ScEditEngineDefaulter;
     122             : class ScFieldEditEngine;
     123             : class ScNoteEditEngine;
     124             : struct ScConsolidateParam;
     125             : class ScDPObject;
     126             : class ScDPCollection;
     127             : class ScMatrix;
     128             : class ScScriptTypeData;
     129             : class ScPoolHelper;
     130             : struct ScSortParam;
     131             : class ScRefreshTimerControl;
     132             : class ScUnoListenerCalls;
     133             : class ScUnoRefList;
     134             : class ScRecursionHelper;
     135             : struct RowInfo;
     136             : struct ScTableInfo;
     137             : struct ScTabOpParam;
     138             : class VirtualDevice;
     139             : class ScAutoNameCache;
     140             : class ScTemporaryChartLock;
     141             : class ScLookupCache;
     142             : struct ScLookupCacheMapImpl;
     143             : class SfxUndoManager;
     144             : class ScFormulaParserPool;
     145             : struct ScClipParam;
     146             : class ScRowBreakIterator;
     147             : struct ScSetStringParam;
     148             : class ScDocRowHeightUpdater;
     149             : struct ScColWidthParam;
     150             : class ScSheetEvents;
     151             : class ScProgress;
     152             : class SvtListener;
     153             : class ScNotes;
     154             : class ScEditDataArray;
     155             : class EditTextObject;
     156             : struct ScRefCellValue;
     157             : class ScDocumentImport;
     158             : 
     159             : namespace com { namespace sun { namespace star {
     160             :     namespace lang {
     161             :         class XMultiServiceFactory;
     162             :         struct EventObject;
     163             :     }
     164             :     namespace i18n {
     165             :         class XBreakIterator;
     166             :     }
     167             :     namespace util {
     168             :         class XModifyListener;
     169             :     }
     170             :     namespace embed {
     171             :         class XEmbeddedObject;
     172             :     }
     173             :     namespace script { namespace vba {
     174             :         class XVBAEventProcessor;
     175             :     } }
     176             :     namespace sheet {
     177             :         struct TablePageBreakData;
     178             :     }
     179             : } } }
     180             : 
     181             : #include <svl/zforlist.hxx>
     182             : 
     183             : #define SC_DOC_NEW          0xFFFF
     184             : 
     185             : #define SC_MACROCALL_ALLOWED        0
     186             : #define SC_MACROCALL_NOTALLOWED     1
     187             : #define SC_MACROCALL_ASK            2
     188             : 
     189             : #define SC_ASIANCOMPRESSION_INVALID     0xff
     190             : #define SC_ASIANKERNING_INVALID         0xff
     191             : 
     192             : enum ScDocumentMode
     193             :     {
     194             :         SCDOCMODE_DOCUMENT,
     195             :         SCDOCMODE_CLIP,
     196             :         SCDOCMODE_UNDO
     197             :     };
     198             : 
     199             : 
     200           0 : struct ScDocStat
     201             : {
     202             :     OUString  aDocName;
     203             :     SCTAB   nTableCount;
     204             :     sal_uLong   nCellCount;
     205             :     sal_uInt16  nPageCount;
     206             : };
     207             : 
     208             : // DDE link modes
     209             : const sal_uInt8 SC_DDE_DEFAULT       = 0;
     210             : const sal_uInt8 SC_DDE_ENGLISH       = 1;
     211             : const sal_uInt8 SC_DDE_TEXT          = 2;
     212             : const sal_uInt8 SC_DDE_IGNOREMODE    = 255;       /// For usage in FindDdeLink() only!
     213             : 
     214             : class ScDocument
     215             : {
     216             : friend class ScValueIterator;
     217             : friend class ScHorizontalValueIterator;
     218             : friend class ScDBQueryDataIterator;
     219             : friend class ScCellIterator;
     220             : friend class ScQueryCellIterator;
     221             : friend class ScHorizontalCellIterator;
     222             : friend class ScHorizontalAttrIterator;
     223             : friend class ScDocAttrIterator;
     224             : friend class ScAttrRectIterator;
     225             : friend class ScDocShell;
     226             : friend class ScDocRowHeightUpdater;
     227             : friend class ScColumnTextWidthIterator;
     228             : friend class ScFormulaCell;
     229             : friend class ScTable;
     230             : friend struct ScRefCellValue;
     231             : friend class ScDocumentImport;
     232             : friend class sc::ColumnSpanSet;
     233             : 
     234             :     typedef ::std::vector<ScTable*> TableContainer;
     235             : private:
     236             : 
     237             :     rtl::Reference<ScPoolHelper> xPoolHelper;
     238             : 
     239             :     SfxUndoManager*     mpUndoManager;
     240             :     ScFieldEditEngine*  pEditEngine;                    // uses pEditPool from xPoolHelper
     241             :     ScNoteEditEngine*   pNoteEngine;                    // uses pEditPool from xPoolHelper
     242             :     SfxObjectShell*     pShell;
     243             :     SfxPrinter*         pPrinter;
     244             :     VirtualDevice*      pVirtualDevice_100th_mm;
     245             :     ScDrawLayer*        pDrawLayer;                     // SdrModel
     246             :     rtl::Reference<XColorList> pColorList;
     247             :     ScValidationDataList* pValidationList;              // validity
     248             :     SvNumberFormatterIndexTable*    pFormatExchangeList;    // for application of number formats
     249             :     TableContainer maTabs;
     250             :     std::vector<OUString> maTabNames;               // for undo document, we need the information tab name <-> index
     251             :     mutable ScRangeName* pRangeName;
     252             :     ScDBCollection*     pDBCollection;
     253             :     ScDPCollection*     pDPCollection;
     254             :     ScChartCollection*  pChartCollection;
     255             :     std::auto_ptr< ScTemporaryChartLock > apTemporaryChartLock;
     256             :     ScPatternAttr*      pSelectionAttr;                 // Attributes of a block
     257             :     mutable sfx2::LinkManager*      pLinkManager;
     258             :     ScFormulaCell*      pFormulaTree;                   // formula tree (start)
     259             :     ScFormulaCell*      pEOFormulaTree;                 // formula tree (end), last cell
     260             :     ScFormulaCell*      pFormulaTrack;                  // BroadcastTrack (start)
     261             :     ScFormulaCell*      pEOFormulaTrack;                // BrodcastTrack (end), last cell
     262             :     ScBroadcastAreaSlotMachine* pBASM;                  // BroadcastAreas
     263             :     ScChartListenerCollection* pChartListenerCollection;
     264             :     SvMemoryStream*     pClipData;
     265             :     ScDetOpList*        pDetOpList;
     266             :     ScChangeTrack*      pChangeTrack;
     267             :     SfxBroadcaster*     pUnoBroadcaster;
     268             :     ScUnoListenerCalls* pUnoListenerCalls;
     269             :     ScUnoRefList*       pUnoRefUndoList;
     270             :     ScChangeViewSettings* pChangeViewSettings;
     271             :     ScScriptTypeData*   pScriptTypeData;
     272             :     ScRefreshTimerControl* pRefreshTimerControl;
     273             :     rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharacters;
     274             : 
     275             :     ScFieldEditEngine*  pCacheFieldEditEngine;
     276             : 
     277             :     ::std::auto_ptr<ScDocProtection> pDocProtection;
     278             :     ::std::auto_ptr<ScClipParam>     mpClipParam;
     279             : 
     280             :     ::std::auto_ptr<ScExternalRefManager> pExternalRefMgr;
     281             :     ::std::auto_ptr<ScMacroManager> mpMacroMgr;
     282             : 
     283             : 
     284             :     // mutable for lazy construction
     285             :     mutable ::std::auto_ptr< ScFormulaParserPool >
     286             :                         mxFormulaParserPool;            /// Pool for all external formula parsers used by this document.
     287             : 
     288             :     OUString       aDocName;                       // optional: name of document
     289             :     OUString       aDocCodeName;                       // optional: name of document (twice?)
     290             :     OUString       maFileURL;      // file URL for copy & paste
     291             :     ScRangePairListRef  xColNameRanges;
     292             :     ScRangePairListRef  xRowNameRanges;
     293             : 
     294             :     ScViewOptions*      pViewOptions;                   // view options
     295             :     ScDocOptions*       pDocOptions;                    // document options
     296             :     ScExtDocOptions*    pExtDocOptions;                 // for import etc.
     297             :     ScConsolidateParam* pConsolidateDlgData;
     298             : 
     299             :     ScRecursionHelper*  pRecursionHelper;               // information for recursive and iterative cell formulas
     300             : 
     301             :     ScAutoNameCache*    pAutoNameCache;                 // for automatic name lookup during CompileXML
     302             : 
     303             :     ScLookupCacheMapImpl* pLookupCacheMapImpl;          // cache for lookups like VLOOKUP and MATCH
     304             : 
     305             :     SfxItemSet*         pPreviewFont; // convert to std::auto_ptr or whatever
     306             :     ScMarkData*         pPreviewSelection;
     307             :     sal_Int64           nUnoObjectId;                   // counted up for UNO objects
     308             : 
     309             :     sal_uInt32          nRangeOverflowType;             // used in (xml) loading for overflow warnings
     310             : 
     311             :     ScRange             aEmbedRange;
     312             :     ScAddress           aCurTextWidthCalcPos;
     313             :     ScAddress           aOnlineSpellPos;                // within whole document
     314             :     ScRange             aVisSpellRange;
     315             :     ScAddress           aVisSpellPos;                   // within aVisSpellRange (see nVisSpellState)
     316             : 
     317             :     Timer               aTrackTimer;
     318             : 
     319             :     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >
     320             :                         mxVbaEvents;
     321             : public:
     322             :     boost::ptr_vector< ScInterpreterTableOpParams > aTableOpList; // list of ScInterpreterTableOpParams currently in use
     323             :     ScInterpreterTableOpParams  aLastTableOpParams;     // remember last params
     324             : private:
     325             : 
     326             :     LanguageType        eLanguage;                      // default language
     327             :     LanguageType        eCjkLanguage;                   // default language for asian text
     328             :     LanguageType        eCtlLanguage;                   // default language for complex text
     329             :     CharSet             eSrcSet;                        // during reading: source character set
     330             : 
     331             :     /** The compiler grammar used in document storage. GRAM_PODF for ODF 1.1
     332             :         documents, GRAM_ODFF for ODF 1.2 documents. */
     333             :     formula::FormulaGrammar::Grammar  eStorageGrammar;
     334             : 
     335             :     /** The compiler grammar used in ODF import after brackets had been
     336             :         stripped (which they shouldn't, but until that's fixed) by the XML
     337             :         importer. */
     338             :     formula::FormulaGrammar::Grammar  eXmlImportGrammar;
     339             : 
     340             :     sal_uLong               nFormulaCodeInTree;             // FormelRPN im Formelbaum
     341             :     sal_uLong               nXMLImportedFormulaCount;        // progress count during XML import
     342             :     sal_uInt16              nInterpretLevel;                // >0 if in interpreter
     343             :     sal_uInt16              nMacroInterpretLevel;           // >0 if macro in interpreter
     344             :     sal_uInt16              nInterpreterTableOpLevel;       // >0 if in interpreter TableOp
     345             :     SCTAB               nMaxTableNumber;
     346             :     sal_uInt16              nSrcVer;                        // file version (load/save)
     347             :     SCROW               nSrcMaxRow;                     // number of lines to load/save
     348             :     sal_uInt16              nFormulaTrackCount;
     349             :     bool                bHardRecalcState;               // false: soft, true: hard
     350             :     SCTAB               nVisibleTab;                    // for OLE etc., don't use inside ScDocument
     351             : 
     352             :     ScLkUpdMode         eLinkMode;
     353             : 
     354             :     bool                bAutoCalc;                      // calculate automatically
     355             :     bool                bAutoCalcShellDisabled;         // in/from/for ScDocShell disabled
     356             :     // are there ForcedFormulas which have to be calculated
     357             :     // in interaction with ScDocShell SetDocumentModified,
     358             :     // AutoCalcShellDisabled and TrackFormulas
     359             :     bool                bForcedFormulaPending;
     360             :     bool                bCalculatingFormulaTree;
     361             :     bool                bIsClip;
     362             :     bool                bIsUndo;
     363             :     bool                bIsVisible;                     // set from view ctor
     364             : 
     365             :     bool                bIsEmbedded;                    // display/adjust Embedded area?
     366             : 
     367             :     // no broadcast, construct no listener during insert from a different
     368             :     // Doc (per filter or the like ), not until CompileAll / CalcAfterLoad
     369             :     bool                bInsertingFromOtherDoc;
     370             :     bool                bLoadingMedium;
     371             :     bool                bImportingXML;      // special handling of formula text
     372             :     bool                bXMLFromWrapper;    // distinguish ScXMLImportWrapper from external component
     373             :     bool                bCalcingAfterLoad;              // in CalcAfterLoad TRUE
     374             :     // don't construct/destruct listeners temporarily
     375             :     bool                bNoListening;
     376             :     bool                mbIdleEnabled;
     377             :     bool                bInLinkUpdate;                  // TableLink or AreaLink
     378             :     bool                bChartListenerCollectionNeedsUpdate;
     379             :     // are/were there RC_FORCED formula cells in the document (if set once to TRUE then set forever)
     380             :     bool                bHasForcedFormulas;
     381             :     // is the Doc being destroyed? (no Notify-Tracking etc. needed anymore)
     382             :     bool                bInDtorClear;
     383             :     // expand reference if insert column/row takes place at the border
     384             :     // of a reference
     385             :     // is fetched in each UpdateReference from InputOptions,
     386             :     // assigned, and restored at the end of UpdateReference
     387             :     bool                bExpandRefs;
     388             :     // for detective update, is set for each change of a formula
     389             :     bool                bDetectiveDirty;
     390             : 
     391             :     sal_uInt8               nMacroCallMode;     // Macros per warning dialog disabled?
     392             :     bool                bHasMacroFunc;      // valid only after loading
     393             : 
     394             :     sal_uInt8               nVisSpellState;
     395             : 
     396             :     sal_uInt8               nAsianCompression;
     397             :     sal_uInt8               nAsianKerning;
     398             : 
     399             :     bool                bPastingDrawFromOtherDoc;
     400             : 
     401             :     sal_uInt8                nInDdeLinkUpdate;   // originating DDE links (stacked bool)
     402             : 
     403             :     bool                bInUnoBroadcast;
     404             :     bool                bInUnoListenerCall;
     405             :     formula::FormulaGrammar::Grammar  eGrammar;
     406             : 
     407             :     mutable bool        bStyleSheetUsageInvalid;
     408             : 
     409             :     bool                mbUndoEnabled:1;
     410             :     bool                mbAdjustHeightEnabled:1;
     411             :     bool                mbExecuteLinkEnabled:1;
     412             :     bool                mbChangeReadOnlyEnabled:1;    // allow changes in read-only document (for API import filters)
     413             :     bool                mbStreamValidLocked:1;
     414             :     bool                mbUserInteractionEnabled:1;  // whether or not to launch any kind of interactive dialogs.
     415             : 
     416             :     sal_Int16           mnNamedRangesLockCount;
     417             : 
     418             :     ::std::set<ScFormulaCell*> maSubTotalCells;
     419             : 
     420             :     bool                mbUseEmbedFonts;
     421             : 
     422             : public:
     423          29 :     bool              IsUsingEmbededFonts() { return mbUseEmbedFonts; }
     424          23 :     void              SetIsUsingEmbededFonts( bool bUse ) { mbUseEmbedFonts = bUse; }
     425             :     SC_DLLPUBLIC sal_uLong          GetCellCount() const;       // all cells
     426             :     SCSIZE          GetCellCount(SCTAB nTab, SCCOL nCol) const;
     427             :     sal_uLong           GetCodeCount() const;       // RPN-Code in formulas
     428             :     DECL_LINK( GetUserDefinedColor, sal_uInt16 * );
     429             :                                                                 // number formatter
     430             : 
     431             : public:
     432             :     SC_DLLPUBLIC                ScDocument( ScDocumentMode eMode = SCDOCMODE_DOCUMENT,
     433             :                                 SfxObjectShell* pDocShell = NULL );
     434             :     SC_DLLPUBLIC                ~ScDocument();
     435             : 
     436             :     SC_DLLPUBLIC const OUString&  GetName() const { return aDocName; }
     437         788 :     void            SetName( const OUString& r ) { aDocName = r; }
     438        1866 :     const OUString&   GetCodeName() const { return aDocCodeName; }
     439          53 :     void                SetCodeName( const OUString& r ) { aDocCodeName = r; }
     440           4 :     const OUString& GetFileURL() const { return maFileURL; }
     441             : 
     442             :     void            GetDocStat( ScDocStat& rDocStat );
     443             : 
     444             :     SC_DLLPUBLIC void  InitDrawLayer( SfxObjectShell* pDocShell = NULL );
     445             :     rtl::Reference<XColorList>          GetColorList();
     446             : 
     447             :     SC_DLLPUBLIC sfx2::LinkManager*     GetLinkManager() const;
     448             : 
     449             :     SC_DLLPUBLIC const ScDocOptions&        GetDocOptions() const;
     450             :     SC_DLLPUBLIC void                   SetDocOptions( const ScDocOptions& rOpt );
     451             :     SC_DLLPUBLIC const ScViewOptions&   GetViewOptions() const;
     452             :     SC_DLLPUBLIC void                   SetViewOptions( const ScViewOptions& rOpt );
     453             :     void                    SetPrintOptions();
     454             : 
     455         259 :     ScExtDocOptions*        GetExtDocOptions()  { return pExtDocOptions; }
     456             :     SC_DLLPUBLIC void                   SetExtDocOptions( ScExtDocOptions* pNewOptions );
     457             : 
     458             :     SC_DLLPUBLIC void       GetLanguage( LanguageType& rLatin, LanguageType& rCjk, LanguageType& rCtl ) const;
     459             :     void                    SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageType eCtl );
     460             : 
     461             :     void                        SetConsolidateDlgData( const ScConsolidateParam* pData );
     462           8 :     const ScConsolidateParam*   GetConsolidateDlgData() const { return pConsolidateDlgData; }
     463             : 
     464             :     void            Clear( bool bFromDestructor = false );
     465             : 
     466             :     ScFieldEditEngine*  CreateFieldEditEngine();
     467             :     void                DisposeFieldEditEngine(ScFieldEditEngine*& rpEditEngine);
     468             : 
     469             :     /**
     470             :      * Get all range names that are local to each table.  It only returns
     471             :      * non-empty range name set.
     472             :      */
     473             :     SC_DLLPUBLIC void GetAllTabRangeNames(ScRangeName::TabNameCopyMap& rRangeNames) const;
     474             :     SC_DLLPUBLIC void SetAllRangeNames( const boost::ptr_map<OUString, ScRangeName>& rRangeMap);
     475             :     SC_DLLPUBLIC void GetTabRangeNameMap(std::map<OUString, ScRangeName*>& rRangeName);
     476             :     SC_DLLPUBLIC void GetRangeNameMap(std::map<OUString, ScRangeName*>& rRangeName);
     477             :     SC_DLLPUBLIC ScRangeName* GetRangeName(SCTAB nTab) const;
     478             :     SC_DLLPUBLIC ScRangeName* GetRangeName() const;
     479             :     void SetRangeName(SCTAB nTab, ScRangeName* pNew);
     480             :     void SetRangeName( ScRangeName* pNewRangeName );
     481           6 :     SCTAB           GetMaxTableNumber() { return static_cast<SCTAB>(maTabs.size()) - 1; }
     482             :     void            SetMaxTableNumber(SCTAB nNumber) { nMaxTableNumber = nNumber; }
     483             : 
     484          76 :     ScRangePairList*    GetColNameRanges() { return &xColNameRanges; }
     485          51 :     ScRangePairList*    GetRowNameRanges() { return &xRowNameRanges; }
     486          21 :     ScRangePairListRef& GetColNameRangesRef() { return xColNameRanges; }
     487          14 :     ScRangePairListRef& GetRowNameRangesRef() { return xRowNameRanges; }
     488             : 
     489             :     SC_DLLPUBLIC ScDBCollection*    GetDBCollection() const;
     490             :     void            SetDBCollection( ScDBCollection* pNewDBCollection,
     491             :                                         bool bRemoveAutoFilter = false );
     492             :     const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly = false) const;
     493             :     ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly = false);
     494             :     const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
     495             :     ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
     496             : 
     497             :     SC_DLLPUBLIC const ScRangeData* GetRangeAtBlock( const ScRange& rBlock, OUString* pName=NULL ) const;
     498             : 
     499             :     bool HasPivotTable() const;
     500             :     SC_DLLPUBLIC ScDPCollection*        GetDPCollection();
     501             :     SC_DLLPUBLIC const ScDPCollection* GetDPCollection() const;
     502             :     ScDPObject*         GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
     503             :     ScDPObject*         GetDPAtBlock( const ScRange& rBlock ) const;
     504             : 
     505             :     SC_DLLPUBLIC ScChartCollection* GetChartCollection() const;
     506             : 
     507             :     void                StopTemporaryChartLock();
     508             : 
     509             :     void            EnsureGraphicNames();
     510             : 
     511             :     SdrObject*      GetObjectAtPoint( SCTAB nTab, const Point& rPos );
     512             :     bool            HasChartAtPoint( SCTAB nTab, const Point& rPos, OUString& rName );
     513             : 
     514             :     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartByName( const OUString& rChartName );
     515             :     SC_DLLPUBLIC void            GetChartRanges( const OUString& rChartName, ::std::vector< ScRangeList >& rRanges, ScDocument* pSheetNameDoc );
     516             :     void            SetChartRanges( const OUString& rChartName, const ::std::vector< ScRangeList >& rRanges );
     517             : 
     518             :     void            UpdateChartArea( const OUString& rChartName, const ScRange& rNewArea,
     519             :                                         bool bColHeaders, bool bRowHeaders, bool bAdd );
     520             :     void            UpdateChartArea( const OUString& rChartName,
     521             :                                     const ScRangeListRef& rNewList,
     522             :                                     bool bColHeaders, bool bRowHeaders, bool bAdd );
     523             :     void            GetOldChartParameters( const OUString& rName,
     524             :                                     ScRangeList& rRanges, bool& rColHeaders, bool& rRowHeaders );
     525             :     ::com::sun::star::uno::Reference<
     526             :             ::com::sun::star::embed::XEmbeddedObject >
     527             :                     FindOleObjectByName( const OUString& rName );
     528             : 
     529             :     SC_DLLPUBLIC void           MakeTable( SCTAB nTab,bool _bNeedsNameCheck = true );
     530             : 
     531        1637 :     SCTAB           GetVisibleTab() const       { return nVisibleTab; }
     532         115 :     SC_DLLPUBLIC void           SetVisibleTab(SCTAB nTab)   { nVisibleTab = nTab; }
     533             : 
     534             :     SC_DLLPUBLIC bool HasTable( SCTAB nTab ) const;
     535             :     SC_DLLPUBLIC bool GetName( SCTAB nTab, OUString& rName ) const;
     536             :     SC_DLLPUBLIC bool GetCodeName( SCTAB nTab, OUString& rName ) const;
     537             :     SC_DLLPUBLIC bool SetCodeName( SCTAB nTab, const OUString& rName );
     538             :     SC_DLLPUBLIC bool GetTable( const OUString& rName, SCTAB& rTab ) const;
     539             :     OUString   GetCopyTabName(SCTAB nTab) const;
     540             : 
     541             :     SC_DLLPUBLIC void SetAnonymousDBData(SCTAB nTab, ScDBData* pDBData);
     542             :     SC_DLLPUBLIC ScDBData* GetAnonymousDBData(SCTAB nTab);
     543             : 
     544      424555 :     SC_DLLPUBLIC inline SCTAB   GetTableCount() const { return static_cast<SCTAB>(maTabs.size()); }
     545           7 :     SvNumberFormatterIndexTable* GetFormatExchangeList() const { return pFormatExchangeList; }
     546             : 
     547             :     SC_DLLPUBLIC ScDocProtection* GetDocProtection() const;
     548             :     SC_DLLPUBLIC void           SetDocProtection(const ScDocProtection* pProtect);
     549             :     SC_DLLPUBLIC bool           IsDocProtected() const;
     550             :     bool            IsDocEditable() const;
     551             :     SC_DLLPUBLIC bool           IsTabProtected( SCTAB nTab ) const;
     552             :     SC_DLLPUBLIC    ScTableProtection* GetTabProtection( SCTAB nTab ) const;
     553             :     SC_DLLPUBLIC void SetTabProtection(SCTAB nTab, const ScTableProtection* pProtect);
     554             :     void            CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest);
     555             : 
     556             :     void            LockTable(SCTAB nTab);
     557             :     void            UnlockTable(SCTAB nTab);
     558             : 
     559             :     bool            IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     560             :                                         SCCOL nEndCol, SCROW nEndRow,
     561             :                                         bool* pOnlyNotBecauseOfMatrix = NULL ) const;
     562             :     bool            IsSelectionEditable( const ScMarkData& rMark,
     563             :                                         bool* pOnlyNotBecauseOfMatrix = NULL ) const;
     564             :     bool            HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow,
     565             :                                             SCCOL nEndCol, SCROW nEndRow,
     566             :                                             const ScMarkData& rMark ) const;
     567             : 
     568             :     bool            GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix );
     569             : 
     570             :     bool            IsEmbedded() const;
     571             :     void            GetEmbedded( ScRange& rRange ) const;
     572             :     void            SetEmbedded( const ScRange& rRange );
     573             :     void            ResetEmbedded();
     574             :     Rectangle       GetEmbeddedRect() const;                        // 1/100 mm
     575             :     void            SetEmbedded( SCTAB nTab, const Rectangle& rRect );          // from VisArea (1/100 mm)
     576             : 
     577             :     static SC_DLLPUBLIC bool ValidTabName( const OUString& rName );
     578             : 
     579             :     SC_DLLPUBLIC bool           ValidNewTabName( const OUString& rName ) const;
     580             :     SC_DLLPUBLIC void           CreateValidTabName(OUString& rName) const;
     581             :     SC_DLLPUBLIC void           CreateValidTabNames(std::vector<OUString>& aNames, SCTAB nCount) const;
     582             : 
     583             :     void AppendTabOnLoad(const OUString& rName);
     584             :     void SetTabNameOnLoad(SCTAB nTab, const OUString& rName);
     585             :     void InvalidateStreamOnSave();
     586             : 
     587             :     SC_DLLPUBLIC bool           InsertTab( SCTAB nPos, const OUString& rName,
     588             :                                         bool bExternalDocument = false );
     589             :     SC_DLLPUBLIC bool           InsertTabs( SCTAB nPos, const std::vector<OUString>& rNames,
     590             :                                 bool bExternalDocument = false, bool bNamesValid = false );
     591             :     SC_DLLPUBLIC bool           DeleteTabs( SCTAB nTab, SCTAB nSheets, ScDocument* pRefUndoDoc = NULL );
     592             :     SC_DLLPUBLIC bool           DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc = NULL );
     593             :     SC_DLLPUBLIC bool           RenameTab( SCTAB nTab, const OUString& rName,
     594             :                                 bool bUpdateRef = true,
     595             :                                 bool bExternalDocument = false );
     596             :     bool                        MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress = NULL );
     597             :     bool                        CopyTab( SCTAB nOldPos, SCTAB nNewPos,
     598             :                                 const ScMarkData* pOnlyMarked = NULL );
     599             :     SC_DLLPUBLIC sal_uLong          TransferTab(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos,
     600             :                                     bool bInsertNew = true,
     601             :                                     bool bResultsOnly = false );
     602             :     SC_DLLPUBLIC void           TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos);
     603             :     SC_DLLPUBLIC void           SetVisible( SCTAB nTab, bool bVisible );
     604             :     SC_DLLPUBLIC bool           IsVisible( SCTAB nTab ) const;
     605             :     bool            IsStreamValid( SCTAB nTab ) const;
     606             :     void            SetStreamValid( SCTAB nTab, bool bSet, bool bIgnoreLock = false );
     607             :     void            LockStreamValid( bool bLock );
     608         197 :     bool            IsStreamValidLocked() const                         { return mbStreamValidLocked; }
     609             :     bool            IsPendingRowHeights( SCTAB nTab ) const;
     610             :     void            SetPendingRowHeights( SCTAB nTab, bool bSet );
     611             :     SC_DLLPUBLIC void           SetLayoutRTL( SCTAB nTab, bool bRTL );
     612             :     SC_DLLPUBLIC bool           IsLayoutRTL( SCTAB nTab ) const;
     613             :     bool            IsNegativePage( SCTAB nTab ) const;
     614             :     SC_DLLPUBLIC void           SetScenario( SCTAB nTab, bool bFlag );
     615             :     SC_DLLPUBLIC bool           IsScenario( SCTAB nTab ) const;
     616             :     SC_DLLPUBLIC void GetScenarioData( SCTAB nTab, OUString& rComment,
     617             :                                        Color& rColor, sal_uInt16& rFlags ) const;
     618             :     SC_DLLPUBLIC void           SetScenarioData( SCTAB nTab, const OUString& rComment,
     619             :                                         const Color& rColor, sal_uInt16 nFlags );
     620             :     SC_DLLPUBLIC Color GetTabBgColor( SCTAB nTab ) const;
     621             :     SC_DLLPUBLIC void SetTabBgColor( SCTAB nTab, const Color& rColor );
     622             :     SC_DLLPUBLIC bool IsDefaultTabBgColor( SCTAB nTab ) const;
     623             :     void            GetScenarioFlags( SCTAB nTab, sal_uInt16& rFlags ) const;
     624             :     SC_DLLPUBLIC bool           IsActiveScenario( SCTAB nTab ) const;
     625             :     SC_DLLPUBLIC void           SetActiveScenario( SCTAB nTab, bool bActive );      // only for Undo etc.
     626             :     SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const;
     627             :     SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const;
     628             :     void            SetGrammar( formula::FormulaGrammar::Grammar eGram );
     629             :     SC_DLLPUBLIC sal_uInt8          GetLinkMode( SCTAB nTab ) const;
     630             :     bool            IsLinked( SCTAB nTab ) const;
     631             :     SC_DLLPUBLIC const OUString  GetLinkDoc( SCTAB nTab ) const;
     632             :     const OUString   GetLinkFlt( SCTAB nTab ) const;
     633             :     const OUString   GetLinkOpt( SCTAB nTab ) const;
     634             :     SC_DLLPUBLIC const OUString  GetLinkTab( SCTAB nTab ) const;
     635             :     sal_uLong       GetLinkRefreshDelay( SCTAB nTab ) const;
     636             :     void            SetLink( SCTAB nTab, sal_uInt8 nMode, const OUString& rDoc,
     637             :                             const OUString& rFilter, const OUString& rOptions,
     638             :                             const OUString& rTabName, sal_uLong nRefreshDelay );
     639             :     bool            HasLink( const OUString& rDoc,
     640             :                             const OUString& rFilter, const OUString& rOptions ) const;
     641             :     SC_DLLPUBLIC bool           LinkExternalTab( SCTAB& nTab, const OUString& aDocTab,
     642             :                                     const OUString& aFileName,
     643             :                                     const OUString& aTabName );
     644             : 
     645        5195 :     bool            HasExternalRefManager() const { return pExternalRefMgr.get(); }
     646             :     SC_DLLPUBLIC ScExternalRefManager* GetExternalRefManager() const;
     647             :     bool            IsInExternalReferenceMarking() const;
     648             :     void            MarkUsedExternalReferences();
     649             :     bool            MarkUsedExternalReferences( ScTokenArray & rArr );
     650             : 
     651             :     /** Returns the pool containing external formula parsers. Creates the pool
     652             :         on first call. */
     653             :     ScFormulaParserPool& GetFormulaParserPool() const;
     654             : 
     655             :     bool            HasDdeLinks() const;
     656             :     bool            HasAreaLinks() const;
     657             :     void            UpdateExternalRefLinks(Window* pWin);
     658             :     void            UpdateDdeLinks(Window* pWin);
     659             :     void            UpdateAreaLinks();
     660             : 
     661             :                     // originating DDE links
     662           8 :     void            IncInDdeLinkUpdate() { if ( nInDdeLinkUpdate < 255 ) ++nInDdeLinkUpdate; }
     663           8 :     void            DecInDdeLinkUpdate() { if ( nInDdeLinkUpdate ) --nInDdeLinkUpdate; }
     664        6259 :     bool            IsInDdeLinkUpdate() const   { return nInDdeLinkUpdate != 0; }
     665             : 
     666             :     SC_DLLPUBLIC void           CopyDdeLinks( ScDocument* pDestDoc ) const;
     667             :     void            DisconnectDdeLinks();
     668             : 
     669             :                     // for StarOne Api:
     670             :     size_t          GetDdeLinkCount() const;
     671             :     bool            UpdateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem );
     672             : 
     673             :     /** Tries to find a DDE link with the specified connection data.
     674             :         @param rnDdePos  (out-param) Returns the index of the DDE link (does not include other links from link manager).
     675             :         @return  true = DDE link found, rnDdePos valid. */
     676             :     SC_DLLPUBLIC bool            FindDdeLink( const OUString& rAppl, const OUString& rTopic,
     677             :             const OUString& rItem, sal_uInt8 nMode, size_t& rnDdePos );
     678             : 
     679             :     /** Returns the connection data of the specified DDE link.
     680             :         @param nDdePos  Index of the DDE link (does not include other links from link manager).
     681             :         @param rAppl  (out-param) The application name.
     682             :         @param rTopic  (out-param) The DDE topic.
     683             :         @param rItem  (out-param) The DDE item.
     684             :         @return  true = DDE link found, out-parameters valid. */
     685             :     bool            GetDdeLinkData( size_t nDdePos, OUString& rAppl, OUString& rTopic, OUString& rItem ) const;
     686             :     /** Returns the link mode of the specified DDE link.
     687             :         @param nDdePos  Index of the DDE link (does not include other links from link manager).
     688             :         @param rnMode  (out-param) The link mode of the specified DDE link.
     689             :         @return  true = DDE link found, rnMode valid. */
     690             :     bool            GetDdeLinkMode( size_t nDdePos, sal_uInt8& rnMode ) const;
     691             :     /** Returns the result matrix of the specified DDE link.
     692             :         @param nDdePos  Index of the DDE link (does not include other links from link manager).
     693             :         @return  The result matrix, if the DDE link has been found, 0 otherwise. */
     694             :     SC_DLLPUBLIC const ScMatrix* GetDdeLinkResultMatrix( size_t nDdePos ) const;
     695             : 
     696             :     /** Tries to find a DDE link or creates a new, if not extant.
     697             :         @param pResults  If not 0, sets the matrix as as DDE link result matrix (also for existing links).
     698             :         @return  true = DDE link found; false = Unpredictable error occurred, no DDE link created. */
     699             :     SC_DLLPUBLIC bool            CreateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, ScMatrixRef pResults );
     700             :     /** Sets a result matrix for the specified DDE link.
     701             :         @param nDdePos  Index of the DDE link (does not include other links from link manager).
     702             :         @param pResults  The array containing all results of the DDE link (intrusive-ref-counted, do not delete).
     703             :         @return  true = DDE link found and matrix set. */
     704             :     bool            SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults );
     705             : 
     706             : 
     707             :     SfxBindings*    GetViewBindings();
     708        3772 :     SfxObjectShell* GetDocumentShell() const    { return pShell; }
     709             :     SC_DLLPUBLIC ScDrawLayer* GetDrawLayer();
     710             :     SfxBroadcaster* GetDrawBroadcaster();       // to avoid header
     711             :     void            BeginDrawUndo();
     712             : 
     713             :     void            BeginUnoRefUndo();
     714        3078 :     bool            HasUnoRefUndo() const       { return ( pUnoRefUndoList != NULL ); }
     715             :     ScUnoRefList*   EndUnoRefUndo();            // must be deleted by caller!
     716             :     sal_Int64       GetNewUnoId();
     717             :     void            AddUnoRefChange( sal_Int64 nId, const ScRangeList& rOldRanges );
     718             : 
     719             :     bool IsChart( const SdrObject* pObject );
     720             : 
     721             :     SC_DLLPUBLIC void           UpdateAllCharts();
     722             :     void            UpdateChartRef( UpdateRefMode eUpdateRefMode,
     723             :                                     SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
     724             :                                     SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
     725             :                                     SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
     726             :                     //! only assigns the new RangeList, no ChartListener or the like
     727             :     void            SetChartRangeList( const OUString& rChartName,
     728             :                         const ScRangeListRef& rNewRangeListRef );
     729             : 
     730             :     void            StartAnimations( SCTAB nTab, Window* pWin );
     731             : 
     732             :     bool            HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect ) const;
     733             :     bool            HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect ) const;
     734             : 
     735             :     const ScSheetEvents* GetSheetEvents( SCTAB nTab ) const;
     736             :     void            SetSheetEvents( SCTAB nTab, const ScSheetEvents* pNew );
     737             :     bool            HasSheetEventScript( SCTAB nTab, sal_Int32 nEvent, bool bWithVbaEvents = false ) const;
     738             :     bool            HasAnySheetEventScript( sal_Int32 nEvent, bool bWithVbaEvents = false ) const;  // on any sheet
     739             : 
     740             :     bool            HasAnyCalcNotification() const;
     741             :     bool            HasCalcNotification( SCTAB nTab ) const;
     742             :     void            SetCalcNotification( SCTAB nTab );
     743             :     void            ResetCalcNotifications();
     744             : 
     745             :     SC_DLLPUBLIC ScOutlineTable*    GetOutlineTable( SCTAB nTab, bool bCreate = false );
     746             :     bool            SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline );
     747             : 
     748             :     void            DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
     749             :                                     SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
     750             : 
     751             :     bool            DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam );
     752             :     void            RemoveSubTotals( SCTAB nTab, ScSubTotalParam& rParam );
     753             :     bool            TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam );
     754             :     bool            HasSubTotalCells( const ScRange& rRange );
     755             : 
     756             :     SC_DLLPUBLIC void EnsureTable( SCTAB nTab );
     757             : 
     758             :                     //  return TRUE = number format is set
     759             :     SC_DLLPUBLIC bool           SetString(
     760             :         SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& rString,
     761             :         ScSetStringParam* pParam = NULL );
     762             :     SC_DLLPUBLIC bool SetString( const ScAddress& rPos, const OUString& rString, ScSetStringParam* pParam = NULL );
     763             : 
     764             :     /**
     765             :      * This method manages the lifecycle of the passed edit text object. When
     766             :      * the text is successfully inserted, the cell takes over the ownership of
     767             :      * the text object. If not, the text object gets deleted.
     768             :      *
     769             :      * <p>The caller must ensure that the passed edit text object <i>uses the
     770             :      * SfxItemPool instance returned from ScDocument::GetEditPool()</i>.
     771             :      * This is very important.</p>
     772             :      */
     773             :     SC_DLLPUBLIC void SetEditText( const ScAddress& rPos, EditTextObject* pEditText );
     774             : 
     775             :     void SetEditText( const ScAddress& rPos, const EditTextObject& rEditText, const SfxItemPool* pEditPool );
     776             : 
     777             :     SC_DLLPUBLIC void SetEditText( const ScAddress& rPos, const OUString& rStr );
     778             : 
     779             :     /**
     780             :      * Call this if you are not sure whether to put this as an edit text or a
     781             :      * simple text.
     782             :      */
     783             :     SC_DLLPUBLIC void SetTextCell( const ScAddress& rPos, const OUString& rStr );
     784             : 
     785             :     void SetEmptyCell( const ScAddress& rPos );
     786             : 
     787             :     SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
     788             :     SC_DLLPUBLIC void SetValue( const ScAddress& rPos, double fVal );
     789             :     void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 nError);
     790             : 
     791             :     SC_DLLPUBLIC void SetFormula(
     792             :         const ScAddress& rPos, const ScTokenArray& rArray,
     793             :         formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_DEFAULT );
     794             : 
     795             :     SC_DLLPUBLIC void SetFormula(
     796             :         const ScAddress& rPos, const OUString& rFormula,
     797             :         formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_DEFAULT );
     798             : 
     799             :     /**
     800             :      * Takes ownership of pCell
     801             :      *
     802             :      * @return pCell if it was successfully inserted, NULL otherwise. pCell
     803             :      *         is deleted automatically on failure to insert.
     804             :      */
     805             :     SC_DLLPUBLIC ScFormulaCell* SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell );
     806             : 
     807             :     SC_DLLPUBLIC void InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
     808             :                                         SCCOL nCol2, SCROW nRow2,
     809             :                                         const ScMarkData& rMark,
     810             :                                         const OUString& rFormula,
     811             :                                         const ScTokenArray* p = NULL,
     812             :                                         const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
     813             :                                         bool bDirtyFlag=true );
     814             :     SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam& rParam,   // multi-operation
     815             :                                   SCCOL nCol1, SCROW nRow1,
     816             :                                   SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark);
     817             : 
     818             :     SC_DLLPUBLIC OUString GetString( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
     819             :     OUString GetString( const ScAddress& rPos ) const;
     820             : 
     821             :     /**
     822             :      * Return a pointer to the string object stored in string cell.
     823             :      *
     824             :      * @param rPos cell position.
     825             :      *
     826             :      * @return pointer to the string object stored in string cell, or NULL if
     827             :      *         the cell at specified position is not a string cell. Note that
     828             :      *         it returns NULL even for a edit cell.
     829             :      */
     830             :     const OUString* GetStringCell( const ScAddress& rPos ) const;
     831             : 
     832             :     /**
     833             :      * Return a pointer to the double value stored in value cell.
     834             :      *
     835             :      * @param rPos cell position
     836             :      *
     837             :      * @return pointer to the double value stored in a numeric cell, or NULL
     838             :      *         if the cell at specified position is not a numeric cell.
     839             :      */
     840             :     double* GetValueCell( const ScAddress& rPos );
     841             : 
     842             :     SC_DLLPUBLIC void GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
     843             :     SC_DLLPUBLIC void GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rString );
     844             :     sal_uInt16 GetStringForFormula( const ScAddress& rPos, OUString& rString );
     845             :     SC_DLLPUBLIC double GetValue( const ScAddress& rPos ) const;
     846          97 :     SC_DLLPUBLIC double GetValue( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { ScAddress aAdr(nCol, nRow, nTab); return GetValue(aAdr);}
     847             :     SC_DLLPUBLIC void GetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, double& rValue ) const;
     848             :     SC_DLLPUBLIC const EditTextObject* GetEditText( const ScAddress& rPos ) const;
     849             :     void RemoveEditTextCharAttribs( const ScAddress& rPos, const ScPatternAttr& rAttr );
     850             :     SC_DLLPUBLIC double RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const;
     851             :     SC_DLLPUBLIC void GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
     852             :                                      sal_uInt32& rFormat ) const;
     853             :     sal_uInt32      GetNumberFormat( const ScRange& rRange ) const;
     854             :     SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScAddress& ) const;
     855             :     void SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat );
     856             : 
     857             :     void GetNumberFormatInfo( short& nType, sal_uLong& nIndex, const ScAddress& rPos ) const;
     858             :     void            GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula ) const;
     859             :     const ScTokenArray* GetFormulaTokens( const ScAddress& rPos ) const;
     860             :     SC_DLLPUBLIC const ScFormulaCell* GetFormulaCell( const ScAddress& rPos ) const;
     861             :     SC_DLLPUBLIC ScFormulaCell* GetFormulaCell( const ScAddress& rPos );
     862             :     SC_DLLPUBLIC void           GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rFormula ) const;
     863             :     SC_DLLPUBLIC void           GetCellType( SCCOL nCol, SCROW nRow, SCTAB nTab, CellType& rCellType ) const;
     864             :     SC_DLLPUBLIC CellType       GetCellType( const ScAddress& rPos ) const;
     865             : 
     866             :     SC_DLLPUBLIC bool           HasData( SCCOL nCol, SCROW nRow, SCTAB nTab );
     867             :     SC_DLLPUBLIC bool           HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
     868             :     SC_DLLPUBLIC bool           HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
     869             :     SC_DLLPUBLIC bool HasValueData( const ScAddress& rPos ) const;
     870             :     bool            HasStringCells( const ScRange& rRange ) const;
     871             : 
     872             :     /** Returns true, if there is any data to create a selection list for rPos. */
     873             :     bool            HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
     874             : 
     875             :     /** Returns a table notes container. */
     876             :     SC_DLLPUBLIC ScNotes*       GetNotes(SCTAB nTab);
     877             : 
     878             :     /** Creates the captions of all uninitialized cell notes in the specified sheet.
     879             :         @param bForced  True = always create all captions, false = skip when Undo is disabled. */
     880             :     void            InitializeNoteCaptions( SCTAB nTab, bool bForced = false );
     881             : 
     882             :     SC_DLLPUBLIC void            SetDrawPageSize(SCTAB nTab);
     883             : 
     884             :     bool            ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
     885             :                                 SCCOL& rEndCol, SCROW& rEndRow, const ScMarkData& rMark,
     886             :                                 bool bRefresh = false );
     887             :     SC_DLLPUBLIC bool            ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
     888             :                                 SCCOL& rEndCol, SCROW& rEndRow, SCTAB nTab,
     889             :                                 bool bRefresh = false );
     890             :     bool            ExtendMerge( ScRange& rRange, bool bRefresh = false );
     891             :     bool            ExtendTotalMerge( ScRange& rRange ) const;
     892             :     SC_DLLPUBLIC bool           ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
     893             :                                 SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const;
     894             :     SC_DLLPUBLIC bool           ExtendOverlapped( ScRange& rRange ) const;
     895             : 
     896             :     bool            RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow,
     897             :                                 SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
     898             : 
     899             :     SC_DLLPUBLIC void           DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     900             :                                     SCCOL nEndCol, SCROW nEndRow );
     901             :                     //  without checking:
     902             :     SC_DLLPUBLIC void           DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     903             :                                     SCCOL nEndCol, SCROW nEndRow, bool bDeleteCaptions = true );
     904             :     void            RemoveMerge( SCCOL nCol, SCROW nRow, SCTAB nTab );
     905             : 
     906             :     bool            IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     907             :                                                 SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes = false ) const;
     908             :     bool            IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     909             :                                                 SCCOL nEndCol, SCROW nEndRow,
     910             :                                                 bool bLeftIsEmpty = false,
     911             :                                                 ScRange* pLastRange = NULL,
     912             :                                                 Rectangle* pLastMM = NULL ) const;
     913             : 
     914             :     void            SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const;
     915             :     bool            IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
     916             :     bool            IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
     917             : 
     918             :     SC_DLLPUBLIC bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
     919             :                                  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt16 nMask ) const;
     920             :     SC_DLLPUBLIC bool HasAttrib( const ScRange& rRange, sal_uInt16 nMask ) const;
     921             : 
     922             :     SC_DLLPUBLIC void GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
     923             :                                     const ::editeng::SvxBorderLine** ppLeft,
     924             :                                     const ::editeng::SvxBorderLine** ppTop,
     925             :                                     const ::editeng::SvxBorderLine** ppRight,
     926             :                                     const ::editeng::SvxBorderLine** ppBottom ) const;
     927             : 
     928             :     void            ResetChanged( const ScRange& rRange );
     929             : 
     930             :     void            SetDirty();
     931             :     void            SetDirty( const ScRange& );
     932             :     void            SetTableOpDirty( const ScRange& );  // for Interpreter TableOp
     933             :     void            InterpretDirtyCells( const ScRangeList& rRanges );
     934             :     void            CalcAll();
     935             :     SC_DLLPUBLIC void           CalcAfterLoad();
     936             :     void            CompileAll();
     937             :     void            CompileXML();
     938             : 
     939             :     /**
     940             :      * Re-compile formula cells with error.
     941             :      *
     942             :      * @param nErrCode specified error code to match. Only those cells with
     943             :      *                 this error code will be re-compiled.  If this value is
     944             :      *                 0, cells with any error values will be re-compiled.
     945             :      *
     946             :      * @return true if at least one cell is re-compiled, false if no cells are
     947             :      *         re-compiled.
     948             :      */
     949             :     bool CompileErrorCells(sal_uInt16 nErrCode);
     950             : 
     951          13 :     ScAutoNameCache* GetAutoNameCache()     { return pAutoNameCache; }
     952             :     void             SetPreviewFont( SfxItemSet* pFontSet );
     953       11892 :     SfxItemSet*      GetPreviewFont() { return pPreviewFont; }
     954             :     SfxItemSet*      GetPreviewFont( SCCOL nCol, SCROW nRow, SCTAB nTab );
     955             :     const ScMarkData&      GetPreviewSelection();
     956             :     void             SetPreviewSelection( ScMarkData& rSel );
     957             :     SC_DLLPUBLIC  void             SetAutoNameCache(  ScAutoNameCache* pCache );
     958             : 
     959             :                     /** Creates a ScLookupCache cache for the range if it
     960             :                         doesn't already exist. */
     961             :     ScLookupCache & GetLookupCache( const ScRange & rRange );
     962             :                     /** Only ScLookupCache ctor uses AddLookupCache(), do not
     963             :                         use elsewhere! */
     964             :     void            AddLookupCache( ScLookupCache & rCache );
     965             :                     /** Only ScLookupCache dtor uses RemoveLookupCache(), do
     966             :                         not use elsewhere! */
     967             :     void            RemoveLookupCache( ScLookupCache & rCache );
     968             :                     /** Zap all caches. */
     969             :     void            ClearLookupCaches();
     970             : 
     971             :                     // calculate automatically
     972             :     void            SetAutoCalc( bool bNewAutoCalc );
     973      653789 :     bool            GetAutoCalc() const { return bAutoCalc; }
     974             :                     // calculate automatically in/from/for ScDocShell disabled
     975       62390 :     void            SetAutoCalcShellDisabled( bool bNew ) { bAutoCalcShellDisabled = bNew; }
     976       47923 :     bool            IsAutoCalcShellDisabled() const { return bAutoCalcShellDisabled; }
     977             :                     // ForcedFormulas are to be calculated
     978          30 :     void            SetForcedFormulaPending( bool bNew ) { bForcedFormulaPending = bNew; }
     979        8378 :     bool            IsForcedFormulaPending() const { return bForcedFormulaPending; }
     980             :                     // if CalcFormulaTree() is currently running
     981          30 :     bool            IsCalculatingFormulaTree() { return bCalculatingFormulaTree; }
     982             : 
     983             :     sal_uInt16          GetErrCode( const ScAddress& ) const;
     984             : 
     985             :                     /** Shrink a range to only include data area.
     986             : 
     987             :                         This is not the actually used area within the
     988             :                         selection, but the bounds of the sheet's data area
     989             :                         instead.
     990             : 
     991             :                         @returns TRUE if the area passed intersected the data
     992             :                                  area, FALSE if not, in which case the values
     993             :                                  obtained may be out of bounds, not in order or
     994             :                                  unmodified. TRUE does not mean that there
     995             :                                  actually is any data within the selection.
     996             :                      */
     997             :     bool            ShrinkToDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
     998             : 
     999             :                     /** Shrink a range to only include used data area.
    1000             : 
    1001             :                         @param o_bShrunk
    1002             :                                Out parameter, true if area was shrunk, false if not.
    1003             : 
    1004             :                         @returns true if there is any data, false if not.
    1005             :                      */
    1006             :     bool            ShrinkToUsedDataArea( bool& o_bShrunk,
    1007             :                                           SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
    1008             :                                           SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
    1009             : 
    1010             :     SC_DLLPUBLIC void           GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
    1011             :                                     SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const;
    1012             :     SC_DLLPUBLIC bool           GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
    1013             :     SC_DLLPUBLIC bool           GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
    1014             :     SC_DLLPUBLIC bool           GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
    1015             :                                     bool bNotes = true ) const;
    1016             :     SC_DLLPUBLIC bool           GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow,
    1017             :                                         SCCOL& rEndCol, bool bNotes = true ) const;
    1018             :     SC_DLLPUBLIC bool           GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol,
    1019             :                                         SCROW& rEndRow, bool bNotes = true ) const;
    1020             :     void            InvalidateTableArea();
    1021             : 
    1022             : 
    1023             :     SC_DLLPUBLIC bool           GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const;
    1024             : 
    1025             :     /**
    1026             :      * Find the maximum column position that contains printable data for the
    1027             :      * specified row range.  The final column position must be equal or less
    1028             :      * than the initial value of rEndCol.
    1029             :      */
    1030             :     void            ExtendPrintArea( OutputDevice* pDev, SCTAB nTab,
    1031             :                                     SCCOL nStartCol, SCROW nStartRow,
    1032             :                                     SCCOL& rEndCol, SCROW nEndRow ) const;
    1033             :     SC_DLLPUBLIC SCSIZE         GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
    1034             :                                             SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab,
    1035             :                                             ScDirection eDir );
    1036             : 
    1037             :     void           FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, ScMoveDirection eDirection ) const;
    1038             :     SC_DLLPUBLIC void           GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY,
    1039             :                                 bool bMarked, bool bUnprotected, const ScMarkData& rMark ) const;
    1040             : 
    1041             :     bool            GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, SCTAB nTab,
    1042             :                                         const ScMarkData& rMark );
    1043             : 
    1044             :     void            LimitChartArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
    1045             :                                                     SCCOL& rEndCol, SCROW& rEndRow );
    1046             :     void            LimitChartIfAll( ScRangeListRef& rRangeList );
    1047             : 
    1048             :     bool            InsertRow( SCCOL nStartCol, SCTAB nStartTab,
    1049             :                                SCCOL nEndCol,   SCTAB nEndTab,
    1050             :                                SCROW nStartRow, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL,
    1051             :                                const ScMarkData* pTabMark = NULL );
    1052             :     SC_DLLPUBLIC bool           InsertRow( const ScRange& rRange, ScDocument* pRefUndoDoc = NULL );
    1053             :     void            DeleteRow( SCCOL nStartCol, SCTAB nStartTab,
    1054             :                                SCCOL nEndCol,   SCTAB nEndTab,
    1055             :                                SCROW nStartRow, SCSIZE nSize,
    1056             :                                ScDocument* pRefUndoDoc = NULL, bool* pUndoOutline = NULL,
    1057             :                                const ScMarkData* pTabMark = NULL );
    1058             :     SC_DLLPUBLIC void   DeleteRow( const ScRange& rRange,
    1059             :                                ScDocument* pRefUndoDoc = NULL, bool* pUndoOutline = NULL );
    1060             :     bool            InsertCol( SCROW nStartRow, SCTAB nStartTab,
    1061             :                                SCROW nEndRow,   SCTAB nEndTab,
    1062             :                                SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL,
    1063             :                                const ScMarkData* pTabMark = NULL );
    1064             :     SC_DLLPUBLIC bool           InsertCol( const ScRange& rRange, ScDocument* pRefUndoDoc = NULL );
    1065             :     void            DeleteCol( SCROW nStartRow, SCTAB nStartTab,
    1066             :                                SCROW nEndRow, SCTAB nEndTab,
    1067             :                                SCCOL nStartCol, SCSIZE nSize,
    1068             :                                ScDocument* pRefUndoDoc = NULL, bool* pUndoOutline = NULL,
    1069             :                                const ScMarkData* pTabMark = NULL );
    1070             :     void            DeleteCol( const ScRange& rRange,
    1071             :                                ScDocument* pRefUndoDoc = NULL, bool* pUndoOutline = NULL );
    1072             : 
    1073             :     bool            CanInsertRow( const ScRange& rRange ) const;
    1074             :     bool            CanInsertCol( const ScRange& rRange ) const;
    1075             : 
    1076             :     void            FitBlock( const ScRange& rOld, const ScRange& rNew, bool bClear = true );
    1077             :     bool            CanFitBlock( const ScRange& rOld, const ScRange& rNew );
    1078             : 
    1079       73418 :     bool            IsClipOrUndo() const                        { return bIsClip || bIsUndo; }
    1080        1089 :     bool            IsUndo() const                              { return bIsUndo; }
    1081         871 :     bool            IsClipboard() const                         { return bIsClip; }
    1082       21212 :     bool            IsUndoEnabled() const                       { return mbUndoEnabled; }
    1083             :     void            EnableUndo( bool bVal );
    1084             : 
    1085        2551 :     bool            IsAdjustHeightEnabled() const               { return mbAdjustHeightEnabled; }
    1086         197 :     void            EnableAdjustHeight( bool bVal )             { mbAdjustHeightEnabled = bVal; }
    1087          28 :     bool            IsExecuteLinkEnabled() const                { return mbExecuteLinkEnabled; }
    1088         198 :     void            EnableExecuteLink( bool bVal )              { mbExecuteLinkEnabled = bVal; }
    1089         577 :     bool            IsChangeReadOnlyEnabled() const             { return mbChangeReadOnlyEnabled; }
    1090          46 :     void            EnableChangeReadOnly( bool bVal )           { mbChangeReadOnlyEnabled = bVal; }
    1091             :     SC_DLLPUBLIC bool IsUserInteractionEnabled() const;
    1092             :     SC_DLLPUBLIC void EnableUserInteraction( bool bVal );
    1093          73 :     SC_DLLPUBLIC sal_Int16       GetNamedRangesLockCount() const             { return mnNamedRangesLockCount; }
    1094          42 :     void            SetNamedRangesLockCount( sal_Int16 nCount ) { mnNamedRangesLockCount = nCount; }
    1095             :     SC_DLLPUBLIC void           ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks );
    1096             :     SC_DLLPUBLIC void           ResetClip( ScDocument* pSourceDoc, SCTAB nTab );
    1097             :     void            SetCutMode( bool bCut );
    1098             :     bool            IsCutMode();
    1099             :     void            SetClipArea( const ScRange& rArea, bool bCut = false );
    1100             : 
    1101        1620 :     SC_DLLPUBLIC bool           IsDocVisible() const                        { return bIsVisible; }
    1102             :     void            SetDocVisible( bool bSet );
    1103             : 
    1104             :     bool            HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* pTabMark = NULL );
    1105             : 
    1106             :     void            DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1107             :                                         const ScMarkData& rMark );
    1108             :     void            DeleteObjectsInSelection( const ScMarkData& rMark );
    1109             : 
    1110             :     void            DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1111             :                             const ScMarkData& rMark, sal_uInt16 nDelFlag);
    1112             :     SC_DLLPUBLIC void            DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1113             :                                 SCTAB nTab, sal_uInt16 nDelFlag);
    1114             :     void            DeleteAreaTab(const ScRange& rRange, sal_uInt16 nDelFlag);
    1115             : 
    1116             :     void            CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc,
    1117             :                                const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false,
    1118             :                                bool bIncludeObjects = false, bool bCloneNoteCaptions = true, bool bUseRangeForVBA = false );
    1119             : 
    1120             :     /**
    1121             :      * Copy only raw cell values to another document.  Formula cells are
    1122             :      * converted to raw cells.  No formatting info are copied.
    1123             :      *
    1124             :      * @param rSrcRange source range in the source document
    1125             :      * @param nDestTab table in the clip document to copy to.
    1126             :      * @param pDestDoc document to copy to
    1127             :      */
    1128             :     void CopyStaticToDocument(const ScRange& rSrcRange, SCTAB nDestTab, ScDocument* pDestDoc);
    1129             : 
    1130             :     /**
    1131             :      * Copy only cell, nothing but cell to another document.
    1132             :      *
    1133             :      * @param rSrcPos source cell position
    1134             :      * @param rDestPos destination cell position
    1135             :      * @param rDestDoc destination document
    1136             :      */
    1137             :     void CopyCellToDocument( const ScAddress& rSrcPos, const ScAddress& rDestPos, ScDocument& rDestDoc );
    1138             : 
    1139             :     void            CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1140             :                                 SCTAB nTab, ScDocument* pClipDoc = NULL);
    1141             : 
    1142             :     bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlokPos, SCTAB nTab, SCCOL nCol );
    1143             : 
    1144             :     void CopyBlockFromClip(
    1145             :         sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1146             :         const ScMarkData& rMark, SCsCOL nDx, SCsROW nDy );
    1147             :     void CopyNonFilteredFromClip(
    1148             :         sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1149             :         const ScMarkData& rMark, SCsCOL nDx, SCROW & rClipStartRow );
    1150             : 
    1151             :     void            StartListeningFromClip( SCCOL nCol1, SCROW nRow1,
    1152             :                                         SCCOL nCol2, SCROW nRow2,
    1153             :                                         const ScMarkData& rMark, sal_uInt16 nInsFlag );
    1154             :     void            BroadcastFromClip( SCCOL nCol1, SCROW nRow1,
    1155             :                                     SCCOL nCol2, SCROW nRow2,
    1156             :                                     const ScMarkData& rMark, sal_uInt16 nInsFlag );
    1157             :     /** If pDestRanges is given it overrides rDestRange, rDestRange in this
    1158             :         case is the overall encompassing range. */
    1159             :     void            CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMark,
    1160             :                                     sal_uInt16 nInsFlag,
    1161             :                                     ScDocument* pRefUndoDoc = NULL,
    1162             :                                     ScDocument* pClipDoc = NULL,
    1163             :                                     bool bResetCut = true,
    1164             :                                     bool bAsLink = false,
    1165             :                                     bool bIncludeFiltered = true,
    1166             :                                     bool bSkipAttrForEmpty = false,
    1167             :                                     const ScRangeList * pDestRanges = NULL );
    1168             : 
    1169             :     void            CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark,
    1170             :                                            sal_uInt16 nInsFlag, ScDocument* pClipDoc,
    1171             :                                            bool bResetCut = true, bool bAsLink = false,
    1172             :                                            bool bIncludeFiltered = true,
    1173             :                                            bool bSkipAttrForEmpty = false);
    1174             : 
    1175             :     void            GetClipArea(SCCOL& nClipX, SCROW& nClipY, bool bIncludeFiltered);
    1176             :     void            GetClipStart(SCCOL& nClipX, SCROW& nClipY);
    1177             : 
    1178             :     bool            HasClipFilteredRows();
    1179             : 
    1180             :     bool            IsClipboardSource() const;
    1181             : 
    1182             :     SC_DLLPUBLIC void           TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, bool bAsLink );
    1183             : 
    1184             :     ScClipParam&    GetClipParam();
    1185             :     void            SetClipParam(const ScClipParam& rParam);
    1186             : 
    1187             :     void            MixDocument( const ScRange& rRange, sal_uInt16 nFunction, bool bSkipEmpty,
    1188             :                                     ScDocument* pSrcDoc );
    1189             : 
    1190             :     void            FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
    1191             :                                 sal_uInt16 nFlags, sal_uInt16 nFunction,
    1192             :                                 bool bSkipEmpty, bool bAsLink );
    1193             :     void            FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
    1194             :                                 sal_uInt16 nFlags, sal_uInt16 nFunction,
    1195             :                                 bool bSkipEmpty, bool bAsLink );
    1196             : 
    1197             :     void            TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType );
    1198             : 
    1199             :     SC_DLLPUBLIC void           InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
    1200             :                                 bool bColInfo = false, bool bRowInfo = false );
    1201             :     void            AddUndoTab( SCTAB nTab1, SCTAB nTab2,
    1202             :                                 bool bColInfo = false, bool bRowInfo = false );
    1203             :     SC_DLLPUBLIC void           InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSelection,
    1204             :                                 bool bColInfo = false, bool bRowInfo = false );
    1205             : 
    1206             :                     //  don't use anymore:
    1207             :     void            CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
    1208             :                                 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
    1209             :                                 sal_uInt16 nFlags, bool bMarked, ScDocument* pDestDoc,
    1210             :                                 const ScMarkData* pMarks = NULL, bool bColRowFlags = true);
    1211             :     void            UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
    1212             :                                 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
    1213             :                                 sal_uInt16 nFlags, bool bMarked, ScDocument* pDestDoc,
    1214             :                                 const ScMarkData* pMarks = NULL);
    1215             : 
    1216             :     void            CopyToDocument(const ScRange& rRange,
    1217             :                                 sal_uInt16 nFlags, bool bMarked, ScDocument* pDestDoc,
    1218             :                                 const ScMarkData* pMarks = NULL, bool bColRowFlags = true);
    1219             :     void            UndoToDocument(const ScRange& rRange,
    1220             :                                 sal_uInt16 nFlags, bool bMarked, ScDocument* pDestDoc,
    1221             :                                 const ScMarkData* pMarks = NULL);
    1222             : 
    1223             :     void            CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, bool bNewScenario = false );
    1224             :     bool            TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const;
    1225             :     void            MarkScenario( SCTAB nSrcTab, SCTAB nDestTab,
    1226             :                                     ScMarkData& rDestMark, bool bResetMark = true,
    1227             :                                     sal_uInt16 nNeededBits = 0 ) const;
    1228             :     bool            HasScenarioRange( SCTAB nTab, const ScRange& rRange ) const;
    1229             :     SC_DLLPUBLIC const ScRangeList* GetScenarioRanges( SCTAB nTab ) const;
    1230             : 
    1231             :     SC_DLLPUBLIC void           CopyUpdated( ScDocument* pPosDoc, ScDocument* pDestDoc );
    1232             : 
    1233             :     void            UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
    1234             :                                      SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
    1235             :                                      SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
    1236             :                                      ScDocument* pUndoDoc = NULL, bool bIncludeDraw = true,
    1237             :                                      bool bUpdateNoteCaptionPos = true );
    1238             : 
    1239             :     SC_DLLPUBLIC void           UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDoc,
    1240             :                                         const ScMarkData& rMark, ScDocument* pUndoDoc = NULL );
    1241             : 
    1242             :     void            UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
    1243             : 
    1244             :     SC_DLLPUBLIC void Fill(   SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1245             :                             ScProgress* pProgress, const ScMarkData& rMark,
    1246             :                             sal_uLong nFillCount, FillDir eFillDir = FILL_TO_BOTTOM,
    1247             :                             FillCmd eFillCmd = FILL_LINEAR, FillDateCmd eFillDateCmd = FILL_DAY,
    1248             :                             double nStepValue = 1.0, double nMaxValue = 1E307 );
    1249             :     OUString          GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY );
    1250             : 
    1251             :     bool            GetSelectionFunction( ScSubTotalFunc eFunc,
    1252             :                                             const ScAddress& rCursor, const ScMarkData& rMark,
    1253             :                                             double& rResult );
    1254             : 
    1255             :     SC_DLLPUBLIC const SfxPoolItem*         GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const;
    1256             :     SC_DLLPUBLIC const SfxPoolItem* GetAttr( const ScAddress& rPos, sal_uInt16 nWhich ) const;
    1257             :     SC_DLLPUBLIC const ScPatternAttr*   GetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
    1258             :     SC_DLLPUBLIC const ScPatternAttr* GetPattern( const ScAddress& rPos ) const;
    1259             :     SC_DLLPUBLIC const ScPatternAttr*    GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const;
    1260             :     const ScPatternAttr*    GetSelectionPattern( const ScMarkData& rMark, bool bDeep = true );
    1261             :     ScPatternAttr*          CreateSelectionPattern( const ScMarkData& rMark, bool bDeep = true );
    1262             :     SC_DLLPUBLIC void AddCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex );
    1263             :     void RemoveCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex );
    1264             : 
    1265             :     SC_DLLPUBLIC ScConditionalFormat* GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
    1266             :     SC_DLLPUBLIC const SfxItemSet*  GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
    1267             :     const SfxItemSet* GetCondResult(
    1268             :         ScRefCellValue& rCell, const ScAddress& rPos, const ScConditionalFormatList& rList,
    1269             :         const std::vector<sal_uInt32>& rIndex ) const;
    1270             :     const SfxPoolItem*  GetEffItem( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const;
    1271             : 
    1272             :     SC_DLLPUBLIC const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator();
    1273             :     bool            HasStringWeakCharacters( const OUString& rString );
    1274             :     SC_DLLPUBLIC sal_uInt8          GetStringScriptType( const OUString& rString );
    1275             :     SC_DLLPUBLIC sal_uInt8 GetCellScriptType( const ScAddress& rPos, sal_uLong nNumberFormat );
    1276             :     SC_DLLPUBLIC sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab );
    1277             :     sal_uInt8 GetRangeScriptType(
    1278             :         sc::ColumnBlockPosition& rBlockPos, const ScAddress& rPos, SCROW nLength );
    1279             :     sal_uInt8 GetRangeScriptType( const ScRangeList& rRanges );
    1280             : 
    1281             :     bool            HasDetectiveOperations() const;
    1282             :     void            AddDetectiveOperation( const ScDetOpData& rData );
    1283             :     void            ClearDetectiveOperations();
    1284        8509 :     ScDetOpList*    GetDetOpList() const                { return pDetOpList; }
    1285             :     void            SetDetOpList(ScDetOpList* pNew);
    1286             : 
    1287             :     bool            HasDetectiveObjects(SCTAB nTab) const;
    1288             : 
    1289             :     void            GetSelectionFrame( const ScMarkData& rMark,
    1290             :                                        SvxBoxItem&      rLineOuter,
    1291             :                                        SvxBoxInfoItem&  rLineInner );
    1292             :     void            ApplySelectionFrame( const ScMarkData& rMark,
    1293             :                                          const SvxBoxItem* pLineOuter,
    1294             :                                          const SvxBoxInfoItem* pLineInner );
    1295             :     void            ApplyFrameAreaTab( const ScRange& rRange,
    1296             :                                          const SvxBoxItem* pLineOuter,
    1297             :                                          const SvxBoxInfoItem* pLineInner );
    1298             : 
    1299             :     void            ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
    1300             :     void            ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark );
    1301             : 
    1302             :     SC_DLLPUBLIC sal_uLong AddCondFormat( ScConditionalFormat* pNew, SCTAB nTab );
    1303             :     void DeleteConditionalFormat( sal_uLong nIndex, SCTAB nTab );
    1304             :     void            ConditionalChanged( sal_uLong nKey, SCTAB nTab );
    1305             : 
    1306             :     void SetCondFormList( ScConditionalFormatList* pList, SCTAB nTab );
    1307             : 
    1308             :     SC_DLLPUBLIC sal_uLong          AddValidationEntry( const ScValidationData& rNew );
    1309             : 
    1310             :     SC_DLLPUBLIC const ScValidationData*    GetValidationEntry( sal_uLong nIndex ) const;
    1311             : 
    1312             :     SC_DLLPUBLIC ScConditionalFormatList* GetCondFormList( SCTAB nTab ) const;
    1313             : 
    1314           0 :     ScValidationDataList* GetValidationList() const
    1315           0 :                     { return pValidationList; }
    1316             : 
    1317             :     SC_DLLPUBLIC void           ApplyAttr( SCCOL nCol, SCROW nRow, SCTAB nTab,
    1318             :                                 const SfxPoolItem& rAttr );
    1319             :     SC_DLLPUBLIC void           ApplyPattern( SCCOL nCol, SCROW nRow, SCTAB nTab,
    1320             :                                     const ScPatternAttr& rAttr );
    1321             :     SC_DLLPUBLIC void           ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow,
    1322             :                                         SCCOL nEndCol, SCROW nEndRow,
    1323             :                                         const ScMarkData& rMark, const ScPatternAttr& rAttr,
    1324             :                                         ScEditDataArray* pDataArray = NULL );
    1325             :     SC_DLLPUBLIC void           ApplyPatternAreaTab( SCCOL nStartCol, SCROW nStartRow,
    1326             :                                             SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
    1327             :                                             const ScPatternAttr& rAttr );
    1328             : 
    1329             :     SC_DLLPUBLIC bool SetAttrEntries(SCCOL nCol, SCTAB nTab, ScAttrEntry* pData, SCSIZE nSize);
    1330             : 
    1331             :     SC_DLLPUBLIC void           ApplyPatternIfNumberformatIncompatible(
    1332             :                             const ScRange& rRange, const ScMarkData& rMark,
    1333             :                             const ScPatternAttr& rPattern, short nNewType );
    1334             : 
    1335             :     void            ApplyStyle( SCCOL nCol, SCROW nRow, SCTAB nTab,
    1336             :                                 const ScStyleSheet& rStyle);
    1337             :     void            ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow,
    1338             :                                     SCCOL nEndCol, SCROW nEndRow,
    1339             :                                     const ScMarkData& rMark, const ScStyleSheet& rStyle);
    1340             :     SC_DLLPUBLIC void           ApplyStyleAreaTab( SCCOL nStartCol, SCROW nStartRow,
    1341             :                                         SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
    1342             :                                         const ScStyleSheet& rStyle);
    1343             : 
    1344             :     SC_DLLPUBLIC void            ApplySelectionStyle( const ScStyleSheet& rStyle, const ScMarkData& rMark );
    1345             :     void            ApplySelectionLineStyle( const ScMarkData& rMark,
    1346             :                                             const ::editeng::SvxBorderLine* pLine, bool bColorOnly );
    1347             : 
    1348             :     const ScStyleSheet* GetStyle( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
    1349             :     const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark ) const;
    1350             : 
    1351             :     void            StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool bRemoved,
    1352             :                                         OutputDevice* pDev,
    1353             :                                         double nPPTX, double nPPTY,
    1354             :                                         const Fraction& rZoomX, const Fraction& rZoomY );
    1355             : 
    1356             :     bool            IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyles ) const;
    1357             : 
    1358             :     SC_DLLPUBLIC bool           ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow,
    1359             :                                             SCCOL nEndCol, SCROW nEndRow,
    1360             :                                             SCTAB nTab, sal_Int16 nFlags );
    1361             :     SC_DLLPUBLIC bool           RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow,
    1362             :                                             SCCOL nEndCol, SCROW nEndRow,
    1363             :                                             SCTAB nTab, sal_Int16 nFlags );
    1364             : 
    1365             :     SC_DLLPUBLIC void           SetPattern( const ScAddress&, const ScPatternAttr& rAttr,
    1366             :                                     bool bPutToPool = false );
    1367             :     SC_DLLPUBLIC void           SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr,
    1368             :                                     bool bPutToPool = false );
    1369             : 
    1370             :     void            AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
    1371             :                                     sal_uInt16 nFormatNo, const ScMarkData& rMark );
    1372             :     void            GetAutoFormatData( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
    1373             :                                         ScAutoFormatData& rData );
    1374             :     bool            SearchAndReplace( const SvxSearchItem& rSearchItem,
    1375             :                                       SCCOL& rCol, SCROW& rRow, SCTAB& rTab,
    1376             :                                       const ScMarkData& rMark, ScRangeList& rMatchedRanges,
    1377             :                                       OUString& rUndoStr, ScDocument* pUndoDoc = NULL );
    1378             : 
    1379             :                     // determine Col/Row of subsequent calls
    1380             :                     // (e.g. not found from the beginning, or subsequent tables)
    1381             :                     // meaning of explanation in "()" was already unclear in German
    1382             :     static void     GetSearchAndReplaceStart( const SvxSearchItem& rSearchItem,
    1383             :                         SCCOL& rCol, SCROW& rRow );
    1384             : 
    1385             :     bool            Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
    1386             :                             SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
    1387             :                             const OUString& sValStr, double& nX);
    1388             : 
    1389             :     SC_DLLPUBLIC void            ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark,
    1390             :                                            ScEditDataArray* pDataArray = NULL );
    1391             :     void            DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark );
    1392             :     void            DeleteSelectionTab( SCTAB nTab, sal_uInt16 nDelFlag, const ScMarkData& rMark );
    1393             : 
    1394             :     SC_DLLPUBLIC void           SetColWidth( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth );
    1395             :     SC_DLLPUBLIC void           SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth );
    1396             :     SC_DLLPUBLIC void           SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight );
    1397             :     SC_DLLPUBLIC void           SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab,
    1398             :                                             sal_uInt16 nNewHeight );
    1399             : 
    1400             :     SC_DLLPUBLIC void           SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, SCTAB nTab,
    1401             :                                                   sal_uInt16 nNewHeight );
    1402             :     SC_DLLPUBLIC void           SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bManual );
    1403             : 
    1404             :     SC_DLLPUBLIC sal_uInt16         GetColWidth( SCCOL nCol, SCTAB nTab, bool bHiddenAsZero = true ) const;
    1405             :     SC_DLLPUBLIC sal_uInt16         GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero = true ) const;
    1406             :     SC_DLLPUBLIC sal_uInt16         GetRowHeight( SCROW nRow, SCTAB nTab, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero = true ) const;
    1407             :     SC_DLLPUBLIC sal_uLong          GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero = true ) const;
    1408             :     SCROW                       GetRowForHeight( SCTAB nTab, sal_uLong nHeight ) const;
    1409             :     sal_uLong                       GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const;
    1410             :     SC_DLLPUBLIC sal_uLong          GetColOffset( SCCOL nCol, SCTAB nTab, bool bHiddenAsZero = true ) const;
    1411             :     SC_DLLPUBLIC sal_uLong          GetRowOffset( SCROW nRow, SCTAB nTab, bool bHiddenAsZero = true ) const;
    1412             : 
    1413             :     SC_DLLPUBLIC sal_uInt16         GetOriginalWidth( SCCOL nCol, SCTAB nTab ) const;
    1414             :     SC_DLLPUBLIC sal_uInt16         GetOriginalHeight( SCROW nRow, SCTAB nTab ) const;
    1415             : 
    1416             :     sal_uInt16          GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const;
    1417             : 
    1418             :     SCROW           GetHiddenRowCount( SCROW nRow, SCTAB nTab ) const;
    1419             : 
    1420             :     sal_uInt16          GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev,
    1421             :                                         double nPPTX, double nPPTY,
    1422             :                                         const Fraction& rZoomX, const Fraction& rZoomY,
    1423             :                                         bool bFormula,
    1424             :                                         const ScMarkData* pMarkData = NULL,
    1425             :                                         const ScColWidthParam* pParam = NULL );
    1426             :     SC_DLLPUBLIC bool           SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nExtra,
    1427             :                                         OutputDevice* pDev,
    1428             :                                         double nPPTX, double nPPTY,
    1429             :                                         const Fraction& rZoomX, const Fraction& rZoomY,
    1430             :                                         bool bShrink );
    1431             :     void            UpdateAllRowHeights( OutputDevice* pDev,
    1432             :                                         double nPPTX, double nPPTY,
    1433             :                                         const Fraction& rZoomX, const Fraction& rZoomY,
    1434             :                                         const ScMarkData* pTabMark = NULL );
    1435             :     long            GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab,
    1436             :                                     OutputDevice* pDev,
    1437             :                                     double nPPTX, double nPPTY,
    1438             :                                     const Fraction& rZoomX, const Fraction& rZoomY,
    1439             :                                     bool bWidth, bool bTotalSize = false );
    1440             : 
    1441             :     SC_DLLPUBLIC void           ShowCol(SCCOL nCol, SCTAB nTab, bool bShow);
    1442             :     SC_DLLPUBLIC void           ShowRow(SCROW nRow, SCTAB nTab, bool bShow);
    1443             :     SC_DLLPUBLIC void           ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, bool bShow);
    1444             :     SC_DLLPUBLIC void           SetRowFlags( SCROW nRow, SCTAB nTab, sal_uInt8 nNewFlags );
    1445             :     SC_DLLPUBLIC void           SetRowFlags( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt8 nNewFlags );
    1446             : 
    1447             :     SC_DLLPUBLIC sal_uInt8          GetColFlags( SCCOL nCol, SCTAB nTab ) const;
    1448             :     SC_DLLPUBLIC sal_uInt8          GetRowFlags( SCROW nRow, SCTAB nTab ) const;
    1449             : 
    1450             :     SC_DLLPUBLIC const ScBitMaskCompressedArray< SCROW, sal_uInt8> & GetRowFlagsArray( SCTAB nTab ) const;
    1451             : 
    1452             :     SC_DLLPUBLIC void           GetAllRowBreaks(::std::set<SCROW>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const;
    1453             :     SC_DLLPUBLIC void           GetAllColBreaks(::std::set<SCCOL>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const;
    1454             :     SC_DLLPUBLIC ScBreakType    HasRowBreak(SCROW nRow, SCTAB nTab) const;
    1455             :     SC_DLLPUBLIC ScBreakType    HasColBreak(SCCOL nCol, SCTAB nTab) const;
    1456             :     SC_DLLPUBLIC void           SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual);
    1457             :     SC_DLLPUBLIC void           SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual);
    1458             :     void                        RemoveRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual);
    1459             :     void                        RemoveColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual);
    1460             :     ::com::sun::star::uno::Sequence<
    1461             :         ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const;
    1462             : 
    1463             :     SC_DLLPUBLIC bool           RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
    1464             :     SC_DLLPUBLIC bool           HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1465             :     SC_DLLPUBLIC bool           ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
    1466             :     SC_DLLPUBLIC void           SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden);
    1467             :     SC_DLLPUBLIC void           SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden);
    1468             :     SC_DLLPUBLIC SCROW          FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1469             :     SC_DLLPUBLIC SCROW          LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1470             :     SCROW                       CountVisibleRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1471             : 
    1472             :     bool                        RowFiltered(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
    1473             :     bool                        HasFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1474             :     bool                        ColFiltered(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
    1475             :     SC_DLLPUBLIC void           SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bFiltered);
    1476             :     SCROW                       FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1477             :     SCROW                       LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1478             :     SCROW                       CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const;
    1479             : 
    1480             :     SC_DLLPUBLIC bool IsManualRowHeight(SCROW nRow, SCTAB nTab) const;
    1481             : 
    1482             :     /**
    1483             :      * Write all column row flags to table's flag data, because not all column
    1484             :      * row attributes are stored in the flag data members.  This is necessary
    1485             :      * for ods export.
    1486             :      */
    1487             :     void                        SyncColRowFlags();
    1488             : 
    1489             :                     /// @return  the index of the last row with any set flags (auto-pagebreak is ignored).
    1490             :     SC_DLLPUBLIC SCROW          GetLastFlaggedRow( SCTAB nTab ) const;
    1491             : 
    1492             :                     /// @return  the index of the last changed column (flags and column width, auto pagebreak is ignored).
    1493             :     SCCOL           GetLastChangedCol( SCTAB nTab ) const;
    1494             :                     /// @return  the index of the last changed row (flags and row height, auto pagebreak is ignored).
    1495             :     SCROW           GetLastChangedRow( SCTAB nTab ) const;
    1496             : 
    1497             :     SCCOL           GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const;
    1498             : 
    1499             :                     // if bCareManualSize is set then the row
    1500             :                     // heights are compared only if the manual size flag for
    1501             :                     // the row is set. If the bCareManualSize is not set then
    1502             :                     // the row heights are always compared.
    1503             :     SCROW           GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCareManualSize = true) const;
    1504             : 
    1505             :     // returns whether to export a Default style for this col/row or not
    1506             :     // nDefault is setted to one possition in the current row/col where the Default style is
    1507             :     bool            GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault);
    1508             :     bool            GetRowDefault( SCTAB nTab, SCROW nRow, SCCOL nLastCol, SCCOL& nDefault);
    1509             : 
    1510             :     bool            UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bShow );
    1511             :     bool            UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bShow );
    1512             : 
    1513             :     void            StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, SCTAB nTab );
    1514             :     void            ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, SCTAB nTab );
    1515             : 
    1516             :     SC_DLLPUBLIC ScPatternAttr*     GetDefPattern() const;
    1517             :     SC_DLLPUBLIC ScDocumentPool*        GetPool();
    1518             :     SC_DLLPUBLIC ScStyleSheetPool*  GetStyleSheetPool() const;
    1519             : 
    1520             :     // PageStyle:
    1521             :     SC_DLLPUBLIC const OUString  GetPageStyle( SCTAB nTab ) const;
    1522             :     SC_DLLPUBLIC void           SetPageStyle( SCTAB nTab, const OUString& rName );
    1523             :     Size            GetPageSize( SCTAB nTab ) const;
    1524             :     void            SetPageSize( SCTAB nTab, const Size& rSize );
    1525             :     void            SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
    1526             :     void            InvalidatePageBreaks(SCTAB nTab);
    1527             :     void            UpdatePageBreaks( SCTAB nTab, const ScRange* pUserArea = NULL );
    1528             :     void            RemoveManualBreaks( SCTAB nTab );
    1529             :     bool            HasManualBreaks( SCTAB nTab ) const;
    1530             : 
    1531             :     bool            IsPageStyleInUse( const OUString& rStrPageStyle, SCTAB* pInTab = NULL );
    1532             :     bool            RemovePageStyleInUse( const OUString& rStrPageStyle );
    1533             :     bool            RenamePageStyleInUse( const OUString& rOld, const OUString& rNew );
    1534             :     void            ModifyStyleSheet( SfxStyleSheetBase& rPageStyle,
    1535             :                                       const SfxItemSet&  rChanges );
    1536             : 
    1537             :     void            PageStyleModified( SCTAB nTab, const OUString& rNewName );
    1538             : 
    1539             :     SC_DLLPUBLIC bool           NeedPageResetAfterTab( SCTAB nTab ) const;
    1540             : 
    1541             :     // Was stored in PageStyle previously. Now it exists for every table:
    1542             :     SC_DLLPUBLIC bool           HasPrintRange();
    1543             :     SC_DLLPUBLIC sal_uInt16         GetPrintRangeCount( SCTAB nTab );
    1544             :     SC_DLLPUBLIC const ScRange* GetPrintRange( SCTAB nTab, sal_uInt16 nPos );
    1545             :     SC_DLLPUBLIC const ScRange* GetRepeatColRange( SCTAB nTab );
    1546             :     SC_DLLPUBLIC const ScRange* GetRepeatRowRange( SCTAB nTab );
    1547             :     /** Returns true, if the specified sheet is always printed. */
    1548             :     bool            IsPrintEntireSheet( SCTAB nTab ) const;
    1549             : 
    1550             :     /** Removes all print ranges. */
    1551             :     SC_DLLPUBLIC void            ClearPrintRanges( SCTAB nTab );
    1552             :     /** Adds a new print ranges. */
    1553             :     SC_DLLPUBLIC void            AddPrintRange( SCTAB nTab, const ScRange& rNew );
    1554             :     /** Marks the specified sheet to be printed completely. Deletes old print ranges on the sheet! */
    1555             :     SC_DLLPUBLIC void            SetPrintEntireSheet( SCTAB nTab );
    1556             :     SC_DLLPUBLIC void           SetRepeatColRange( SCTAB nTab, const ScRange* pNew );
    1557             :     SC_DLLPUBLIC void           SetRepeatRowRange( SCTAB nTab, const ScRange* pNew );
    1558             :     ScPrintRangeSaver* CreatePrintRangeSaver() const;
    1559             :     void            RestorePrintRanges( const ScPrintRangeSaver& rSaver );
    1560             : 
    1561             :     SC_DLLPUBLIC Rectangle      GetMMRect( SCCOL nStartCol, SCROW nStartRow,
    1562             :                                            SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero = true ) const;
    1563             :     SC_DLLPUBLIC ScRange            GetRange( SCTAB nTab, const Rectangle& rMMRect, bool bHiddenAsZero = true ) const;
    1564             : 
    1565             :     void            UpdStlShtPtrsFrmNms();
    1566             :     void            StylesToNames();
    1567             : 
    1568             :     SC_DLLPUBLIC void           CopyStdStylesFrom( ScDocument* pSrcDoc );
    1569             : 
    1570             :     CharSet         GetSrcCharSet() const   { return eSrcSet; }
    1571        2473 :     sal_uLong           GetSrcVersion() const   { return nSrcVer; }
    1572             :     SCROW           GetSrcMaxRow() const    { return nSrcMaxRow; }
    1573             : 
    1574          46 :     void            SetSrcCharSet( CharSet eNew )   { eSrcSet = eNew; }
    1575             :     void            UpdateFontCharSet();
    1576             : 
    1577             :     void FillInfo(
    1578             :         ScTableInfo& rTabInfo, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1579             :         SCTAB nTab, double fColScale, double fRowScale, bool bPageMode, bool bFormulaMode,
    1580             :         const ScMarkData* pMarkData = NULL );
    1581             : 
    1582             :     SC_DLLPUBLIC SvNumberFormatter* GetFormatTable() const;
    1583             : 
    1584             :     void            Sort( SCTAB nTab, const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* pProgress );
    1585             :     SCSIZE          Query( SCTAB nTab, const ScQueryParam& rQueryParam, bool bKeepSub );
    1586             :     SC_DLLPUBLIC bool           CreateQueryParam( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
    1587             :                                         SCTAB nTab, ScQueryParam& rQueryParam );
    1588             :     void            GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rStr);
    1589             : 
    1590             :     /**
    1591             :      * Get a list of unique strings to use in filtering criteria.  The string
    1592             :      * values are sorted, and there are no duplicate values in the list.  The
    1593             :      * data range to use to populate the filter entries is inferred from the
    1594             :      * database range that contains the specified cell position.
    1595             :      */
    1596             :     bool GetFilterEntries(
    1597             :         SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, std::vector<ScTypedStrData>& rStrings, bool& rHasDates);
    1598             : 
    1599             :     SC_DLLPUBLIC bool GetFilterEntriesArea(
    1600             :         SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bCaseSens,
    1601             :         std::vector<ScTypedStrData>& rStrings, bool& rHasDates);
    1602             : 
    1603             :     bool GetDataEntries(
    1604             :         SCCOL nCol, SCROW nRow, SCTAB nTab, bool bCaseSens,
    1605             :         std::vector<ScTypedStrData>& rStrings, bool bLimit = false );
    1606             :     bool GetFormulaEntries( ScTypedCaseStrSet& rStrings );
    1607             : 
    1608             :     bool HasAutoFilter( SCCOL nCol, SCROW nRow, SCTAB nTab );
    1609             : 
    1610             :     SC_DLLPUBLIC bool           HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
    1611             :                                     SCTAB nTab );
    1612             :     SC_DLLPUBLIC bool           HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
    1613             :                                     SCTAB nTab );
    1614             : 
    1615             :     SfxPrinter*     GetPrinter( bool bCreateIfNotExist = true );
    1616             :     void            SetPrinter( SfxPrinter* pNewPrinter );
    1617             :     VirtualDevice*  GetVirtualDevice_100th_mm();
    1618             :     SC_DLLPUBLIC OutputDevice*  GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice...
    1619             : 
    1620             :     bool            GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab,
    1621             :                                         bool bInSel, const ScMarkData& rMark) const;
    1622             : 
    1623             :     bool            ReplaceStyle(const SvxSearchItem& rSearchItem,
    1624             :                                  SCCOL nCol, SCROW nRow, SCTAB nTab,
    1625             :                                  ScMarkData& rMark, bool bIsUndo);
    1626             : 
    1627             :     void            InvalidateTextWidth( const OUString& rStyleName );
    1628             :     void            InvalidateTextWidth( SCTAB nTab );
    1629             :     void            InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, bool bNumFormatChanged );
    1630             : 
    1631             :     bool            IdleCalcTextWidth();
    1632             :     bool            IdleCheckLinks();
    1633             : 
    1634             :     bool            ContinueOnlineSpelling();   // TRUE = found s.th.
    1635             : 
    1636             :     void            RepaintRange( const ScRange& rRange );
    1637             :     void            RepaintRange( const ScRangeList& rRange );
    1638             : 
    1639       31498 :     bool IsIdleEnabled() const { return mbIdleEnabled; }
    1640       63850 :     void EnableIdle(bool bDo) { mbIdleEnabled = bDo; }
    1641             : 
    1642          21 :     bool            IsDetectiveDirty() const     { return bDetectiveDirty; }
    1643       13086 :     void            SetDetectiveDirty(bool bSet) { bDetectiveDirty = bSet; }
    1644             : 
    1645             :     void            RemoveAutoSpellObj();
    1646             :     void            SetOnlineSpellPos( const ScAddress& rPos );
    1647             :     SC_DLLPUBLIC bool           SetVisibleSpellRange( const ScRange& rRange );  // true = changed
    1648             : 
    1649             :     sal_uInt8           GetMacroCallMode() const     { return nMacroCallMode; }
    1650             :     void            SetMacroCallMode(sal_uInt8 nNew)     { nMacroCallMode = nNew; }
    1651             : 
    1652         395 :     bool            GetHasMacroFunc() const      { return bHasMacroFunc; }
    1653           0 :     void            SetHasMacroFunc(bool bSet)   { bHasMacroFunc = bSet; }
    1654             : 
    1655             :     bool            CheckMacroWarn();
    1656             : 
    1657         296 :     void            SetRangeOverflowType(sal_uInt32 nType)  { nRangeOverflowType = nType; }
    1658         371 :     bool        HasRangeOverflow() const                { return nRangeOverflowType != 0; }
    1659           0 :     SC_DLLPUBLIC sal_uInt32      GetRangeOverflowType() const            { return nRangeOverflowType; }
    1660             : 
    1661             :     // for broadcasting/listening
    1662        3982 :     void            SetInsertingFromOtherDoc( bool bVal ) { bInsertingFromOtherDoc = bVal; }
    1663       67252 :     bool            IsInsertingFromOtherDoc() const { return bInsertingFromOtherDoc; }
    1664             :     void            SetLoadingMedium( bool bVal );
    1665             :     void            SetImportingXML( bool bVal );
    1666       24084 :     bool            IsImportingXML() const { return bImportingXML; }
    1667             :     void            SetXMLFromWrapper( bool bVal );
    1668         302 :     bool            IsXMLFromWrapper() const { return bXMLFromWrapper; }
    1669             :     void            SetCalcingAfterLoad( bool bVal ) { bCalcingAfterLoad = bVal; }
    1670       29330 :     bool            IsCalcingAfterLoad() const { return bCalcingAfterLoad; }
    1671          30 :     void            SetNoListening( bool bVal ) { bNoListening = bVal; }
    1672        4268 :     bool            GetNoListening() const { return bNoListening; }
    1673        1298 :     ScBroadcastAreaSlotMachine* GetBASM() const { return pBASM; }
    1674             : 
    1675             :     SC_DLLPUBLIC ScChartListenerCollection* GetChartListenerCollection() const;
    1676             :     void            SetChartListenerCollection( ScChartListenerCollection*,
    1677             :                         bool bSetChartRangeLists = false );
    1678             :     void            UpdateChart( const OUString& rName );
    1679             :     void            RestoreChartListener( const OUString& rName );
    1680             :     SC_DLLPUBLIC void           UpdateChartListenerCollection();
    1681        8575 :     bool            IsChartListenerCollectionNeedsUpdate() const
    1682        8575 :                         { return bChartListenerCollectionNeedsUpdate; }
    1683        5913 :     void            SetChartListenerCollectionNeedsUpdate( bool bFlg )
    1684        5913 :                         { bChartListenerCollectionNeedsUpdate = bFlg; }
    1685             :     void            AddOLEObjectToCollection(const OUString& rName);
    1686             : 
    1687           8 :     ScChangeViewSettings* GetChangeViewSettings() const     { return pChangeViewSettings; }
    1688             :     SC_DLLPUBLIC void               SetChangeViewSettings(const ScChangeViewSettings& rNew);
    1689             : 
    1690             :     rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharacters();
    1691             :     void            SetForbiddenCharacters( const rtl::Reference<SvxForbiddenCharactersTable> xNew );
    1692             : 
    1693             :     sal_uInt8           GetAsianCompression() const;        // CharacterCompressionType values
    1694             :     bool            IsValidAsianCompression() const;
    1695             :     void            SetAsianCompression(sal_uInt8 nNew);
    1696             : 
    1697             :     bool            GetAsianKerning() const;
    1698             :     bool            IsValidAsianKerning() const;
    1699             :     void            SetAsianKerning(bool bNew);
    1700             :     void            ApplyAsianEditSettings(ScEditEngineDefaulter& rEngine);
    1701             : 
    1702             :     sal_uInt8           GetEditTextDirection(SCTAB nTab) const; // EEHorizontalTextDirection values
    1703             : 
    1704          13 :     SC_DLLPUBLIC ScLkUpdMode        GetLinkMode() const             { return eLinkMode ;}
    1705          77 :     void            SetLinkMode( ScLkUpdMode nSet ) {   eLinkMode  = nSet;}
    1706             : 
    1707             :     SC_DLLPUBLIC ScMacroManager* GetMacroManager();
    1708             : 
    1709             :     /**
    1710             :      * See if specified column has any non-empty cells.
    1711             :      */
    1712             :     bool IsEmptyData( SCTAB nTab, SCCOL nCol ) const;
    1713             : 
    1714             :     void FillMatrix( ScMatrix& rMat, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const;
    1715             : 
    1716             :     /**
    1717             :      * Set an array of numerical formula results to a group of contiguous
    1718             :      * formula cells.
    1719             :      *
    1720             :      * @param rTopPos position of the top formula cell of a group.
    1721             :      * @param pResults array of numeric results.
    1722             :      * @param nLen length of numeric results.
    1723             :      */
    1724             :     void SetFormulaResults( const ScAddress& rTopPos, const double* pResults, size_t nLen );
    1725             : 
    1726             : private:
    1727             :     ScDocument(const ScDocument& r); // disabled with no definition
    1728             : 
    1729             :     void                FindMaxRotCol( SCTAB nTab, RowInfo* pRowInfo, SCSIZE nArrCount,
    1730             :                                         SCCOL nX1, SCCOL nX2 ) const;
    1731             : 
    1732             :     sal_uInt16              RowDifferences( SCROW nThisRow, SCTAB nThisTab,
    1733             :                                         ScDocument& rOtherDoc,
    1734             :                                         SCROW nOtherRow, SCTAB nOtherTab,
    1735             :                                         SCCOL nMaxCol, SCCOLROW* pOtherCols );
    1736             :     sal_uInt16              ColDifferences( SCCOL nThisCol, SCTAB nThisTab,
    1737             :                                         ScDocument& rOtherDoc,
    1738             :                                         SCCOL nOtherCol, SCTAB nOtherTab,
    1739             :                                         SCROW nMaxRow, SCCOLROW* pOtherRows );
    1740             :     void                FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW nOtherEndRow,
    1741             :                                         bool bColumns,
    1742             :                                         ScDocument& rOtherDoc, SCTAB nThisTab, SCTAB nOtherTab,
    1743             :                                         SCCOLROW nEndCol, SCCOLROW* pTranslate,
    1744             :                                         ScProgress* pProgress, sal_uLong nProAdd );
    1745             :     bool                OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos,
    1746             :                                         sal_uInt16 nMaxTest );
    1747             : 
    1748             :     DECL_LINK(TrackTimeHdl, void *);
    1749             : 
    1750             :     static ScRecursionHelper*   CreateRecursionHelperInstance();
    1751             : 
    1752             : public:
    1753             :     void                StartListeningArea( const ScRange& rRange,
    1754             :                                             SvtListener* pListener );
    1755             :     void                EndListeningArea( const ScRange& rRange,
    1756             :                                             SvtListener* pListener );
    1757             :                         /** Broadcast wrapper, calls
    1758             :                             rHint.GetCell()->Broadcast() and AreaBroadcast()
    1759             :                             and TrackFormulas() and conditional format list
    1760             :                             SourceChanged().
    1761             :                             Preferred.
    1762             :                          */
    1763             :     void                Broadcast( const ScHint& rHint );
    1764             :                         /// only area, no cell broadcast
    1765             :     void                AreaBroadcast( const ScHint& rHint );
    1766             :                         /// only areas in range, no cell broadcasts
    1767             :     void                AreaBroadcastInRange( const ScRange& rRange,
    1768             :                                               const ScHint& rHint );
    1769             :     void                DelBroadcastAreasInRange( const ScRange& rRange );
    1770             :     void                UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode,
    1771             :                                             const ScRange& rRange,
    1772             :                                             SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
    1773             : 
    1774             : 
    1775             :     void                StartListeningCell( const ScAddress& rAddress,
    1776             :                                             SvtListener* pListener );
    1777             :     void                EndListeningCell( const ScAddress& rAddress,
    1778             :                                             SvtListener* pListener );
    1779             : 
    1780             :     void StartListeningCell( sc::StartListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener );
    1781             :     void EndListeningCell( sc::EndListeningContext& rCxt, const ScAddress& rPos, SvtListener& rListener );
    1782             : 
    1783             :     void EndListeningFormulaCells( std::vector<ScFormulaCell*>& rCells );
    1784             : 
    1785             :     void                PutInFormulaTree( ScFormulaCell* pCell );
    1786             :     void                RemoveFromFormulaTree( ScFormulaCell* pCell );
    1787             : 
    1788             :     /**
    1789             :      * Calculate formula cells that are on the formula tree either partially,
    1790             :      * or in full.
    1791             :      *
    1792             :      * @param bOnlyForced when true, it only calculates those formula cells
    1793             :      *                    that are marked "recalc forced".
    1794             :      * @param bProgressBar whether or not to use progress bar.
    1795             :      * @param bSetAllDirty when true, it marks all formula cells currently on
    1796             :      *                     the formula tree dirty, which forces all of them to
    1797             :      *                     be recalculated.  When false, only those cells
    1798             :      *                     that are marked dirty prior to this call get
    1799             :      *                     recalculated.
    1800             :      */
    1801             :     SC_DLLPUBLIC void CalcFormulaTree(
    1802             :         bool bOnlyForced = false, bool bProgressBar = true, bool bSetAllDirty = true );
    1803             :     void                ClearFormulaTree();
    1804             :     void                RebuildFormulaGroups();
    1805             :     void                AppendToFormulaTrack( ScFormulaCell* pCell );
    1806             :     void                RemoveFromFormulaTrack( ScFormulaCell* pCell );
    1807             :     void                TrackFormulas( sal_uLong nHintId = SC_HINT_DATACHANGED );
    1808             :     sal_uInt16              GetFormulaTrackCount() const { return nFormulaTrackCount; }
    1809             :     bool                IsInFormulaTree( ScFormulaCell* pCell ) const;
    1810             :     bool                IsInFormulaTrack( ScFormulaCell* pCell ) const;
    1811       10653 :     bool                GetHardRecalcState() { return bHardRecalcState; }
    1812         152 :     void                SetHardRecalcState( bool bVal ) { bHardRecalcState = bVal; }
    1813             :     void                StartAllListeners();
    1814             :     const ScFormulaCell*    GetFormulaTree() const { return pFormulaTree; }
    1815             :     bool                HasForcedFormulas() const { return bHasForcedFormulas; }
    1816           0 :     void                SetForcedFormulas( bool bVal ) { bHasForcedFormulas = bVal; }
    1817        4720 :     sal_uLong               GetFormulaCodeInTree() const { return nFormulaCodeInTree; }
    1818        2591 :     bool                IsInInterpreter() const { return nInterpretLevel != 0; }
    1819             :     sal_uInt16              GetInterpretLevel() { return nInterpretLevel; }
    1820        4634 :     void                IncInterpretLevel()
    1821             :                             {
    1822        4634 :                                 if ( nInterpretLevel < USHRT_MAX )
    1823        4634 :                                     nInterpretLevel++;
    1824        4634 :                             }
    1825        4634 :     void                DecInterpretLevel()
    1826             :                             {
    1827        4634 :                                 if ( nInterpretLevel )
    1828        4634 :                                     nInterpretLevel--;
    1829        4634 :                             }
    1830             :     bool                IsInMacroInterpreter() const { return nMacroInterpretLevel != 0; }
    1831           0 :     sal_uInt16              GetMacroInterpretLevel() { return nMacroInterpretLevel; }
    1832          59 :     void                IncMacroInterpretLevel()
    1833             :                             {
    1834          59 :                                 if ( nMacroInterpretLevel < USHRT_MAX )
    1835          59 :                                     nMacroInterpretLevel++;
    1836          59 :                             }
    1837          59 :     void                DecMacroInterpretLevel()
    1838             :                             {
    1839          59 :                                 if ( nMacroInterpretLevel )
    1840          59 :                                     nMacroInterpretLevel--;
    1841          59 :                             }
    1842           0 :     bool                IsInInterpreterTableOp() const { return nInterpreterTableOpLevel != 0; }
    1843             :     sal_uInt16              GetInterpreterTableOpLevel() { return nInterpreterTableOpLevel; }
    1844          48 :     void                IncInterpreterTableOpLevel()
    1845             :                             {
    1846          48 :                                 if ( nInterpreterTableOpLevel < USHRT_MAX )
    1847          48 :                                     nInterpreterTableOpLevel++;
    1848          48 :                             }
    1849          48 :     void                DecInterpreterTableOpLevel()
    1850             :                             {
    1851          48 :                                 if ( nInterpreterTableOpLevel )
    1852          48 :                                     nInterpreterTableOpLevel--;
    1853          48 :                             }
    1854             :                         // add a formula to be remembered for TableOp broadcasts
    1855             :     void                AddTableOpFormulaCell( ScFormulaCell* );
    1856        8378 :     void                InvalidateLastTableOpParams() { aLastTableOpParams.bValid = false; }
    1857       28030 :     ScRecursionHelper&  GetRecursionHelper()
    1858             :                             {
    1859       28030 :                                 if (!pRecursionHelper)
    1860          93 :                                     pRecursionHelper = CreateRecursionHelperInstance();
    1861       28030 :                                 return *pRecursionHelper;
    1862             :                             }
    1863        4858 :     bool                IsInDtorClear() const { return bInDtorClear; }
    1864         288 :     void                SetExpandRefs( bool bVal ) { bExpandRefs = bVal; }
    1865        3568 :     bool                IsExpandRefs() { return bExpandRefs; }
    1866             : 
    1867         470 :     sal_uLong               GetXMLImportedFormulaCount() const { return nXMLImportedFormulaCount; }
    1868         395 :     void                IncXMLImportedFormulaCount( sal_uLong nVal )
    1869             :                             {
    1870         395 :                                 if ( nXMLImportedFormulaCount + nVal > nXMLImportedFormulaCount )
    1871         395 :                                     nXMLImportedFormulaCount += nVal;
    1872         395 :                             }
    1873         395 :     void                DecXMLImportedFormulaCount( sal_uLong nVal )
    1874             :                             {
    1875         395 :                                 if ( nVal <= nXMLImportedFormulaCount )
    1876         395 :                                     nXMLImportedFormulaCount -= nVal;
    1877             :                                 else
    1878           0 :                                     nXMLImportedFormulaCount = 0;
    1879         395 :                             }
    1880             : 
    1881             :     void                StartTrackTimer();
    1882             : 
    1883             :     void            CompileDBFormula();
    1884             :     void            CompileDBFormula( bool bCreateFormulaString );
    1885             :     void            CompileNameFormula( bool bCreateFormulaString );
    1886             :     void            CompileColRowNameFormula();
    1887             : 
    1888             :     /** Maximum string length of a column, e.g. for dBase export.
    1889             :         @return String length in octets (!) of the destination encoding. In
    1890             :                 case of non-octet encodings (e.g. UCS2) the length in code
    1891             :                 points times sizeof(sal_Unicode) is returned. */
    1892             :     sal_Int32       GetMaxStringLen( SCTAB nTab, SCCOL nCol,
    1893             :                                      SCROW nRowStart, SCROW nRowEnd,
    1894             :                                      CharSet eCharSet ) const;
    1895             :     /** Maximum string length of numerical cells of a column, e.g. for dBase export.
    1896             :         @return String length in characters (!) including the decimal
    1897             :                 separator, and the decimal precision needed. */
    1898             :     xub_StrLen      GetMaxNumberStringLen( sal_uInt16& nPrecision,
    1899             :                                            SCTAB nTab, SCCOL nCol,
    1900             :                                            SCROW nRowStart, SCROW nRowEnd ) const;
    1901             : 
    1902             :     void    KeyInput( const KeyEvent& rKEvt );      // TimerDelays etc.
    1903             : 
    1904        9449 :     ScChangeTrack*      GetChangeTrack() const { return pChangeTrack; }
    1905             : 
    1906             :     //! only for import filter, deletes any existing ChangeTrack via
    1907             :     //! EndChangeTracking() and takes ownership of new ChangeTrack pTrack
    1908             :     SC_DLLPUBLIC void           SetChangeTrack( ScChangeTrack* pTrack );
    1909             : 
    1910             :     void            StartChangeTracking();
    1911             :     void            EndChangeTracking();
    1912             : 
    1913             :     SC_DLLPUBLIC void           CompareDocument( ScDocument& rOtherDoc );
    1914             : 
    1915             :     void            AddUnoObject( SfxListener& rObject );
    1916             :     void            RemoveUnoObject( SfxListener& rObject );
    1917             :     void            BroadcastUno( const SfxHint &rHint );
    1918             :     void            AddUnoListenerCall( const ::com::sun::star::uno::Reference<
    1919             :                                             ::com::sun::star::util::XModifyListener >& rListener,
    1920             :                                         const ::com::sun::star::lang::EventObject& rEvent );
    1921             : 
    1922             :     void            SetInLinkUpdate(bool bSet);             // TableLink or AreaLink
    1923             :     bool            IsInLinkUpdate() const;                 // including DdeLink
    1924             : 
    1925             :     SC_DLLPUBLIC SfxItemPool*       GetEditPool() const;
    1926             :     SC_DLLPUBLIC SfxItemPool*       GetEnginePool() const;
    1927             :     SC_DLLPUBLIC ScFieldEditEngine& GetEditEngine();
    1928             :     SC_DLLPUBLIC ScNoteEditEngine&  GetNoteEngine();
    1929             : 
    1930             :     ScRefreshTimerControl*  GetRefreshTimerControl() const
    1931             :         { return pRefreshTimerControl; }
    1932       22545 :     ScRefreshTimerControl * const * GetRefreshTimerControlAddress() const
    1933       22545 :         { return &pRefreshTimerControl; }
    1934             : 
    1935           0 :     void            SetPastingDrawFromOtherDoc( bool bVal )
    1936           0 :                         { bPastingDrawFromOtherDoc = bVal; }
    1937          42 :     bool            PastingDrawFromOtherDoc() const
    1938          42 :                         { return bPastingDrawFromOtherDoc; }
    1939             : 
    1940             :                     /// an ID unique to each document instance
    1941             :     sal_uInt32      GetDocumentID() const;
    1942             : 
    1943        8378 :     void            InvalidateStyleSheetUsage()
    1944        8378 :                         { bStyleSheetUsageInvalid = true; }
    1945             :     void GetSortParam( ScSortParam& rParam, SCTAB nTab );
    1946             :     void SetSortParam( ScSortParam& rParam, SCTAB nTab );
    1947             : 
    1948          26 :     inline void     SetVbaEventProcessor( const com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >& rxVbaEvents )
    1949          26 :                         { mxVbaEvents = rxVbaEvents; }
    1950             :     inline com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >
    1951       21292 :                     GetVbaEventProcessor() const { return mxVbaEvents; }
    1952             : 
    1953             :     /** Should only be GRAM_PODF or GRAM_ODFF. */
    1954             :     void                SetStorageGrammar( formula::FormulaGrammar::Grammar eGrammar );
    1955         114 :     formula::FormulaGrammar::Grammar  GetStorageGrammar() const
    1956         114 :                             { return eStorageGrammar; }
    1957             : 
    1958             :     SfxUndoManager*     GetUndoManager();
    1959             :     bool IsInVBAMode() const;
    1960             :     ScRowBreakIterator* GetRowBreakIterator(SCTAB nTab) const;
    1961             : 
    1962             :     void AddSubTotalCell(ScFormulaCell* pCell);
    1963             :     void RemoveSubTotalCell(ScFormulaCell* pCell);
    1964             :     void SetSubTotalCellsDirty(const ScRange& rDirtyRange);
    1965             :     void MarkSubTotalCells( sc::ColumnSpanSet& rSet, const ScRange& rRange, bool bVal ) const;
    1966             : 
    1967             :     sal_uInt16 GetTextWidth( const ScAddress& rPos ) const;
    1968             : 
    1969             :     sal_uInt8 GetScriptType( const ScAddress& rPos ) const;
    1970             :     void SetScriptType( const ScAddress& rPos, sal_uInt8 nType );
    1971             : 
    1972             :     size_t GetFormulaHash( const ScAddress& rPos ) const;
    1973             : 
    1974             :     ScFormulaVectorState GetFormulaVectorState( const ScAddress& rPos ) const;
    1975             : 
    1976             :     formula::FormulaTokenRef ResolveStaticReference( const ScAddress& rPos );
    1977             :     formula::FormulaTokenRef ResolveStaticReference( const ScRange& rRange );
    1978             : 
    1979             :     const double* FetchDoubleArray(
    1980             :         sc::FormulaGroupContext& rCxt, const ScAddress& rPos, SCROW nLength );
    1981             : 
    1982             :     SvtBroadcaster* GetBroadcaster( const ScAddress& rPos );
    1983             :     const SvtBroadcaster* GetBroadcaster( const ScAddress& rPos ) const;
    1984             :     void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rTopPos, SCROW nLength );
    1985             : 
    1986             :     /**
    1987             :      * See if specified column has any broadcaster at all.
    1988             :      */
    1989             :     bool HasBroadcaster( SCTAB nTab, SCCOL nCol ) const;
    1990             : 
    1991             : #if DEBUG_COLUMN_STORAGE
    1992             :     void DumpFormulaGroups( SCTAB nTab, SCCOL nCol ) const;
    1993             : #endif
    1994             : 
    1995             : private: // CLOOK-Impl-methods
    1996             : 
    1997             :     /**
    1998             :      * Use this class as a locale variable to merge number formatter from
    1999             :      * another document, and set NULL pointer to pFormatExchangeList when
    2000             :      * done.
    2001             :      */
    2002             :     class NumFmtMergeHandler
    2003             :     {
    2004             :     public:
    2005             :         explicit NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc);
    2006             :         ~NumFmtMergeHandler();
    2007             : 
    2008             :     private:
    2009             :         ScDocument* mpDoc;
    2010             :     };
    2011             : 
    2012             :     bool TableExists( SCTAB nTab ) const;
    2013             :     ScTable* FetchTable( SCTAB nTab );
    2014             :     const ScTable* FetchTable( SCTAB nTab ) const;
    2015             : 
    2016             :     void    MergeNumberFormatter(ScDocument* pSrcDoc);
    2017             : 
    2018             :     void    ImplCreateOptions(); // Suggestion: switch to on-demand?
    2019             :     void    ImplDeleteOptions();
    2020             : 
    2021             :     void    DeleteDrawLayer();
    2022             :     SC_DLLPUBLIC bool   DrawGetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer ) const;
    2023             :     void    DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
    2024             :     void    DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
    2025             : 
    2026             :     void    UpdateDrawPrinter();
    2027             :     void    UpdateDrawLanguages();
    2028             :     SC_DLLPUBLIC void   InitClipPtrs( ScDocument* pSourceDoc );
    2029             : 
    2030             :     void    LoadDdeLinks(SvStream& rStream);
    2031             :     void    SaveDdeLinks(SvStream& rStream) const;
    2032             : 
    2033             :     void    DeleteAreaLinksOnTab( SCTAB nTab );
    2034             :     void    UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
    2035             :                              const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
    2036             : 
    2037             :     void    CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs);
    2038             : 
    2039             :     bool    HasPartOfMerged( const ScRange& rRange );
    2040             : 
    2041             :     ScRefCellValue GetRefCellValue( const ScAddress& rPos );
    2042             : 
    2043             :     std::map< SCTAB, ScSortParam > mSheetSortParams;
    2044             : 
    2045             : };
    2046           0 : inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab )
    2047             : {
    2048           0 :     rParam = mSheetSortParams[ nTab ];
    2049           0 : }
    2050             : 
    2051           0 : inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab )
    2052             : {
    2053           0 :     mSheetSortParams[ nTab ] = rParam;
    2054           0 : }
    2055             : 
    2056             : #endif
    2057             : 
    2058             : 
    2059             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10