xref: /aoo42x/main/sc/inc/document.hxx (revision 0deba7fb)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
1038d50f7bSAndrew Rist  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1238d50f7bSAndrew Rist  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
1938d50f7bSAndrew Rist  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
2238d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_DOCUMENT_HXX
25cdf0e10cSrcweir #define SC_DOCUMENT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <vcl/prntypes.hxx>
29cdf0e10cSrcweir #include <vcl/timer.hxx>
30cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
31cdf0e10cSrcweir #include <vos/ref.hxx>
32cdf0e10cSrcweir #include "scdllapi.h"
33cdf0e10cSrcweir #include "table.hxx"		// FastGetRowHeight (inline)
34cdf0e10cSrcweir #include "rangelst.hxx"
35cdf0e10cSrcweir #include "brdcst.hxx"
36cdf0e10cSrcweir #include "tabopparams.hxx"
37cdf0e10cSrcweir #include "formula/grammar.hxx"
38cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp>
39cdf0e10cSrcweir #include "scdllapi.h"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #include <memory>
42cdf0e10cSrcweir #include <map>
43cdf0e10cSrcweir #include <set>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir // Wang Xu Ming -- 2009-8-17
46cdf0e10cSrcweir // DataPilot Migration - Cache&&Performance
47cdf0e10cSrcweir #include <list>
48cdf0e10cSrcweir class ScDPTableDataCache;
49cdf0e10cSrcweir // End Comments
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class KeyEvent;
52cdf0e10cSrcweir class OutputDevice;
53cdf0e10cSrcweir class SdrObject;
54cdf0e10cSrcweir class SfxBroadcaster;
55cdf0e10cSrcweir class SfxListener;
56cdf0e10cSrcweir class SfxHint;
57cdf0e10cSrcweir class SfxItemSet;
58cdf0e10cSrcweir class SfxObjectShell;
59cdf0e10cSrcweir class SfxBindings;
60cdf0e10cSrcweir class SfxPoolItem;
61cdf0e10cSrcweir class SfxItemPool;
62cdf0e10cSrcweir class SfxPrinter;
63cdf0e10cSrcweir class SfxStatusBarManager;
64cdf0e10cSrcweir class SfxStyleSheetBase;
65cdf0e10cSrcweir class SvMemoryStream;
66cdf0e10cSrcweir class SvNumberFormatter;
67cdf0e10cSrcweir class SvxBorderLine;
68cdf0e10cSrcweir class SvxBoxInfoItem;
69cdf0e10cSrcweir class SvxBoxItem;
70cdf0e10cSrcweir class SvxBrushItem;
71cdf0e10cSrcweir class SvxForbiddenCharactersTable;
72cdf0e10cSrcweir namespace sfx2 {
73cdf0e10cSrcweir     class LinkManager;
74cdf0e10cSrcweir     }
75cdf0e10cSrcweir class SvxSearchItem;
76cdf0e10cSrcweir class SvxShadowItem;
77cdf0e10cSrcweir class Window;
7897e8a929SArmin Le Grand class XColorList;
79c7be74b1SArmin Le Grand typedef ::boost::shared_ptr< XColorList > XColorListSharedPtr;
80cdf0e10cSrcweir class List;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir class ScAutoFormatData;
83cdf0e10cSrcweir class ScBaseCell;
84cdf0e10cSrcweir class ScStringCell;
85cdf0e10cSrcweir class ScBroadcastAreaSlotMachine;
86cdf0e10cSrcweir class ScChangeViewSettings;
87cdf0e10cSrcweir class ScChartCollection;
88cdf0e10cSrcweir class ScChartListenerCollection;
89cdf0e10cSrcweir class ScConditionalFormat;
90cdf0e10cSrcweir class ScConditionalFormatList;
91cdf0e10cSrcweir class ScDBCollection;
92cdf0e10cSrcweir class ScDBData;
93cdf0e10cSrcweir class ScDetOpData;
94cdf0e10cSrcweir class ScDetOpList;
95cdf0e10cSrcweir class ScDocOptions;
96cdf0e10cSrcweir class ScDocProtection;
97cdf0e10cSrcweir class ScDocumentPool;
98cdf0e10cSrcweir class ScDrawLayer;
99cdf0e10cSrcweir class ScExtDocOptions;
100cdf0e10cSrcweir class ScExternalRefManager;
101cdf0e10cSrcweir class ScFormulaCell;
102cdf0e10cSrcweir class ScMarkData;
103cdf0e10cSrcweir class ScOutlineTable;
104cdf0e10cSrcweir class ScPatternAttr;
105cdf0e10cSrcweir class ScPrintRangeSaver;
106cdf0e10cSrcweir class ScRangeData;
107cdf0e10cSrcweir class ScRangeName;
108cdf0e10cSrcweir class ScStyleSheet;
109cdf0e10cSrcweir class ScStyleSheetPool;
110cdf0e10cSrcweir class ScTable;
111cdf0e10cSrcweir class ScTableProtection;
112cdf0e10cSrcweir class ScTokenArray;
113cdf0e10cSrcweir class ScValidationData;
114cdf0e10cSrcweir class ScValidationDataList;
115cdf0e10cSrcweir class ScViewOptions;
116cdf0e10cSrcweir class ScStrCollection;
117cdf0e10cSrcweir class TypedScStrCollection;
118cdf0e10cSrcweir class ScChangeTrack;
119cdf0e10cSrcweir class ScEditEngineDefaulter;
120cdf0e10cSrcweir class ScFieldEditEngine;
121cdf0e10cSrcweir class ScNoteEditEngine;
122cdf0e10cSrcweir struct ScConsolidateParam;
123cdf0e10cSrcweir class ScDPObject;
124cdf0e10cSrcweir class ScDPCollection;
125cdf0e10cSrcweir class ScMatrix;
126cdf0e10cSrcweir class ScScriptTypeData;
127cdf0e10cSrcweir class ScPoolHelper;
128cdf0e10cSrcweir struct ScSortParam;
129cdf0e10cSrcweir class ScRefreshTimerControl;
130cdf0e10cSrcweir class ScUnoListenerCalls;
131cdf0e10cSrcweir class ScUnoRefList;
132cdf0e10cSrcweir class ScRecursionHelper;
133cdf0e10cSrcweir struct RowInfo;
134cdf0e10cSrcweir struct ScTableInfo;
135cdf0e10cSrcweir struct ScTabOpParam;
136cdf0e10cSrcweir class VirtualDevice;
137cdf0e10cSrcweir class ScAutoNameCache;
138cdf0e10cSrcweir class ScTemporaryChartLock;
139cdf0e10cSrcweir class ScLookupCache;
140cdf0e10cSrcweir struct ScLookupCacheMapImpl;
141cdf0e10cSrcweir class SfxUndoManager;
142cdf0e10cSrcweir class ScFormulaParserPool;
143cdf0e10cSrcweir struct ScClipParam;
144cdf0e10cSrcweir struct ScClipRangeNameData;
145cdf0e10cSrcweir class ScRowBreakIterator;
146cdf0e10cSrcweir 
147cdf0e10cSrcweir namespace com { namespace sun { namespace star {
148cdf0e10cSrcweir     namespace lang {
149cdf0e10cSrcweir         class XMultiServiceFactory;
150cdf0e10cSrcweir         struct EventObject;
151cdf0e10cSrcweir     }
152cdf0e10cSrcweir     namespace i18n {
153cdf0e10cSrcweir         class XBreakIterator;
154cdf0e10cSrcweir     }
155cdf0e10cSrcweir     namespace util {
156cdf0e10cSrcweir         class XModifyListener;
157cdf0e10cSrcweir     }
158cdf0e10cSrcweir     namespace embed {
159cdf0e10cSrcweir         class XEmbeddedObject;
160cdf0e10cSrcweir     }
161cdf0e10cSrcweir     namespace script { namespace vba {
162cdf0e10cSrcweir         class XVBAEventProcessor;
163cdf0e10cSrcweir     } }
164cdf0e10cSrcweir     namespace sheet {
165cdf0e10cSrcweir         struct TablePageBreakData;
166cdf0e10cSrcweir     }
167cdf0e10cSrcweir } } }
168cdf0e10cSrcweir 
169cdf0e10cSrcweir #include <svl/zforlist.hxx>
170cdf0e10cSrcweir /*
171cdf0e10cSrcweir #ifdef _ZFORLIST_DECLARE_TABLE
172cdf0e10cSrcweir class SvNumberFormatterIndexTable;
173cdf0e10cSrcweir #else
174cdf0e10cSrcweir class Table;
175cdf0e10cSrcweir typedef Table SvNumberFormatterIndexTable;
176cdf0e10cSrcweir #endif
177cdf0e10cSrcweir */
178cdf0e10cSrcweir 
179cdf0e10cSrcweir #define SC_DOC_NEW			0xFFFF
180cdf0e10cSrcweir 
181cdf0e10cSrcweir #define SC_MACROCALL_ALLOWED		0
182cdf0e10cSrcweir #define SC_MACROCALL_NOTALLOWED		1
183cdf0e10cSrcweir #define SC_MACROCALL_ASK			2
184cdf0e10cSrcweir 
185cdf0e10cSrcweir #define SC_ASIANCOMPRESSION_INVALID		0xff
186cdf0e10cSrcweir #define SC_ASIANKERNING_INVALID			0xff
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 
189cdf0e10cSrcweir enum ScDocumentMode
190cdf0e10cSrcweir 	{
191cdf0e10cSrcweir 		SCDOCMODE_DOCUMENT,
192cdf0e10cSrcweir 		SCDOCMODE_CLIP,
193cdf0e10cSrcweir 		SCDOCMODE_UNDO
194cdf0e10cSrcweir 	};
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 
197cdf0e10cSrcweir struct ScDocStat
198cdf0e10cSrcweir {
199cdf0e10cSrcweir 	String	aDocName;
200cdf0e10cSrcweir 	SCTAB	nTableCount;
201cdf0e10cSrcweir 	sal_uLong	nCellCount;
202cdf0e10cSrcweir 	sal_uInt16	nPageCount;
203cdf0e10cSrcweir };
204cdf0e10cSrcweir 
205cdf0e10cSrcweir // The constant parameters to CopyBlockFromClip
206cdf0e10cSrcweir struct ScCopyBlockFromClipParams
207cdf0e10cSrcweir {
208cdf0e10cSrcweir 	ScDocument*	pRefUndoDoc;
209cdf0e10cSrcweir 	ScDocument*	pClipDoc;
210cdf0e10cSrcweir 	sal_uInt16		nInsFlag;
211cdf0e10cSrcweir 	SCTAB		nTabStart;
212cdf0e10cSrcweir 	SCTAB		nTabEnd;
213cdf0e10cSrcweir 	sal_Bool		bAsLink;
214cdf0e10cSrcweir 	sal_Bool		bSkipAttrForEmpty;
215cdf0e10cSrcweir };
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 
218cdf0e10cSrcweir // for loading of binary file format symbol string cells which need font conversion
219cdf0e10cSrcweir struct ScSymbolStringCellEntry
220cdf0e10cSrcweir {
221cdf0e10cSrcweir     ScStringCell*   pCell;
222cdf0e10cSrcweir     SCROW           nRow;
223cdf0e10cSrcweir };
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 
226cdf0e10cSrcweir // -----------------------------------------------------------------------
227cdf0e10cSrcweir 
228cdf0e10cSrcweir // DDE link modes
229cdf0e10cSrcweir const sal_uInt8 SC_DDE_DEFAULT       = 0;
230cdf0e10cSrcweir const sal_uInt8 SC_DDE_ENGLISH       = 1;
231cdf0e10cSrcweir const sal_uInt8 SC_DDE_TEXT          = 2;
232cdf0e10cSrcweir const sal_uInt8 SC_DDE_IGNOREMODE    = 255;       /// For usage in FindDdeLink() only!
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 
235cdf0e10cSrcweir // -----------------------------------------------------------------------
236577c0052SWang Lei enum { E_MEDIUM_FLAG_NONE = 0, E_MEDIUM_FLAG_EXCEL = 1, E_MEDIUM_FLAG_MSXML = 2 };
237cdf0e10cSrcweir 
238cdf0e10cSrcweir class ScDocument
239cdf0e10cSrcweir {
240cdf0e10cSrcweir friend class ScDocumentIterator;
241cdf0e10cSrcweir friend class ScValueIterator;
242cdf0e10cSrcweir friend class ScHorizontalValueIterator;
243cdf0e10cSrcweir friend class ScDBQueryDataIterator;
244cdf0e10cSrcweir friend class ScCellIterator;
245cdf0e10cSrcweir friend class ScQueryCellIterator;
246cdf0e10cSrcweir friend class ScHorizontalCellIterator;
247cdf0e10cSrcweir friend class ScHorizontalAttrIterator;
248cdf0e10cSrcweir friend class ScDocAttrIterator;
249cdf0e10cSrcweir friend class ScAttrRectIterator;
250cdf0e10cSrcweir friend class ScDocShell;
251cdf0e10cSrcweir 
252cdf0e10cSrcweir private:
253cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager;
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	vos::ORef<ScPoolHelper> xPoolHelper;
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 	SfxUndoManager* 	mpUndoManager;
258cdf0e10cSrcweir 	ScFieldEditEngine*	pEditEngine;					// uses pEditPool from xPoolHelper
259cdf0e10cSrcweir 	ScNoteEditEngine*	pNoteEngine;					// uses pEditPool from xPoolHelper
260cdf0e10cSrcweir 	SfxItemPool*	pNoteItemPool; // SfxItemPool to be used if pDrawLayer not created.
261cdf0e10cSrcweir 	SfxObjectShell*		pShell;
262cdf0e10cSrcweir 	SfxPrinter*			pPrinter;
263cdf0e10cSrcweir 	VirtualDevice*		pVirtualDevice_100th_mm;
264cdf0e10cSrcweir 	ScDrawLayer*		pDrawLayer;						// SdrModel
265c7be74b1SArmin Le Grand 	XColorListSharedPtr maColorTable;
266cdf0e10cSrcweir 	ScConditionalFormatList* pCondFormList;				// bedingte Formate
267cdf0e10cSrcweir 	ScValidationDataList* pValidationList;				// Gueltigkeit
268cdf0e10cSrcweir 	SvNumberFormatterIndexTable*	pFormatExchangeList;			// zum Umsetzen von Zahlenformaten
269cdf0e10cSrcweir 	ScTable*			pTab[MAXTABCOUNT];
270cdf0e10cSrcweir 	ScRangeName*		pRangeName;
271cdf0e10cSrcweir 	ScDBCollection*		pDBCollection;
272cdf0e10cSrcweir 	ScDPCollection*		pDPCollection;
273cdf0e10cSrcweir     // Wang Xu Ming -- 2009-8-17
274cdf0e10cSrcweir     // DataPilot Migration - Cache&&Performance
275cdf0e10cSrcweir     std::list<ScDPTableDataCache*>   m_listDPObjectsCaches;
276cdf0e10cSrcweir     // End Comments
277cdf0e10cSrcweir 	ScChartCollection*	pChartCollection;
278cdf0e10cSrcweir     std::auto_ptr< ScTemporaryChartLock > apTemporaryChartLock;
279cdf0e10cSrcweir 	ScPatternAttr*		pSelectionAttr;					// Attribute eines Blocks
280cdf0e10cSrcweir 	mutable sfx2::LinkManager*		pLinkManager;
281cdf0e10cSrcweir 	ScFormulaCell*		pFormulaTree;					// Berechnungsbaum Start
282cdf0e10cSrcweir 	ScFormulaCell*		pEOFormulaTree;					// Berechnungsbaum Ende, letzte Zelle
283cdf0e10cSrcweir 	ScFormulaCell*		pFormulaTrack;					// BroadcastTrack Start
284cdf0e10cSrcweir 	ScFormulaCell*		pEOFormulaTrack;				// BrodcastTrack Ende, letzte Zelle
285cdf0e10cSrcweir 	ScBroadcastAreaSlotMachine*	pBASM;					// BroadcastAreas
286cdf0e10cSrcweir 	ScChartListenerCollection* pChartListenerCollection;
287cdf0e10cSrcweir 	ScStrCollection*		pOtherObjects;					// non-chart OLE objects
288cdf0e10cSrcweir 	SvMemoryStream*		pClipData;
289cdf0e10cSrcweir 	ScDetOpList*		pDetOpList;
290cdf0e10cSrcweir 	ScChangeTrack*		pChangeTrack;
291cdf0e10cSrcweir 	SfxBroadcaster*		pUnoBroadcaster;
292cdf0e10cSrcweir 	ScUnoListenerCalls*	pUnoListenerCalls;
293cdf0e10cSrcweir     ScUnoRefList*       pUnoRefUndoList;
294cdf0e10cSrcweir 	ScChangeViewSettings* pChangeViewSettings;
295cdf0e10cSrcweir 	ScScriptTypeData*	pScriptTypeData;
296cdf0e10cSrcweir 	ScRefreshTimerControl* pRefreshTimerControl;
297cdf0e10cSrcweir 	vos::ORef<SvxForbiddenCharactersTable> xForbiddenCharacters;
298cdf0e10cSrcweir 
299cdf0e10cSrcweir 	ScFieldEditEngine*	pCacheFieldEditEngine;
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     ::std::auto_ptr<ScDocProtection> pDocProtection;
302cdf0e10cSrcweir     ::std::auto_ptr<ScClipParam>     mpClipParam;
303cdf0e10cSrcweir 
304cdf0e10cSrcweir     ::std::auto_ptr<ScExternalRefManager> pExternalRefMgr;
305cdf0e10cSrcweir 
306cdf0e10cSrcweir     // mutable for lazy construction
307cdf0e10cSrcweir     mutable ::std::auto_ptr< ScFormulaParserPool >
308cdf0e10cSrcweir                         mxFormulaParserPool;            /// Pool for all external formula parsers used by this document.
309cdf0e10cSrcweir 
310cdf0e10cSrcweir 	String              aDocName;                       // opt: Dokumentname
311cdf0e10cSrcweir 	String              aDocCodeName;                       // opt: Dokumentname
312cdf0e10cSrcweir 	ScRangePairListRef	xColNameRanges;
313cdf0e10cSrcweir 	ScRangePairListRef	xRowNameRanges;
314cdf0e10cSrcweir 
315cdf0e10cSrcweir 	ScViewOptions*		pViewOptions;					// View-Optionen
316cdf0e10cSrcweir 	ScDocOptions*		pDocOptions;					// Dokument-Optionen
317cdf0e10cSrcweir 	ScExtDocOptions*	pExtDocOptions;					// fuer Import etc.
318cdf0e10cSrcweir 	ScConsolidateParam*	pConsolidateDlgData;
319cdf0e10cSrcweir 
320cdf0e10cSrcweir     ScRecursionHelper*  pRecursionHelper;               // information for recursive and iterative cell formulas
321cdf0e10cSrcweir 
322cdf0e10cSrcweir     ScAutoNameCache*    pAutoNameCache;                 // for automatic name lookup during CompileXML
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     ScLookupCacheMapImpl* pLookupCacheMapImpl;          // cache for lookups like VLOOKUP and MATCH
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     sal_Int64           nUnoObjectId;                   // counted up for UNO objects
327cdf0e10cSrcweir 
328cdf0e10cSrcweir     sal_uInt32          nRangeOverflowType;             // used in (xml) loading for overflow warnings
329cdf0e10cSrcweir 
330cdf0e10cSrcweir 	ScRange				aEmbedRange;
331cdf0e10cSrcweir 	ScAddress			aCurTextWidthCalcPos;
332cdf0e10cSrcweir 	ScAddress			aOnlineSpellPos;				// within whole document
333cdf0e10cSrcweir 	ScRange				aVisSpellRange;
334cdf0e10cSrcweir 	ScAddress			aVisSpellPos;					// within aVisSpellRange (see nVisSpellState)
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 	Timer				aTrackTimer;
337cdf0e10cSrcweir 
338cdf0e10cSrcweir     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >
339cdf0e10cSrcweir                         mxVbaEvents;
340cdf0e10cSrcweir 
341cdf0e10cSrcweir public:
342cdf0e10cSrcweir     ScTabOpList         aTableOpList;		            // list of ScInterpreterTableOpParams currently in use
343cdf0e10cSrcweir     ScInterpreterTableOpParams  aLastTableOpParams;     // remember last params
344cdf0e10cSrcweir private:
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 	LanguageType		eLanguage;						// default language
347cdf0e10cSrcweir 	LanguageType		eCjkLanguage;					// default language for asian text
348cdf0e10cSrcweir 	LanguageType		eCtlLanguage;					// default language for complex text
349cdf0e10cSrcweir 	CharSet				eSrcSet; 						// Einlesen: Quell-Zeichensatz
350cdf0e10cSrcweir 
351cdf0e10cSrcweir     /** The compiler grammar used in document storage. GRAM_PODF for ODF 1.1
352cdf0e10cSrcweir         documents, GRAM_ODFF for ODF 1.2 documents. */
353cdf0e10cSrcweir     formula::FormulaGrammar::Grammar  eStorageGrammar;
354cdf0e10cSrcweir 
355cdf0e10cSrcweir     /** The compiler grammar used in ODF import after brackets had been
356cdf0e10cSrcweir         stripped (which they shouldn't, but until that's fixed) by the XML
357cdf0e10cSrcweir         importer. */
358cdf0e10cSrcweir     formula::FormulaGrammar::Grammar  eXmlImportGrammar;
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 	sal_uLong				nFormulaCodeInTree;				// FormelRPN im Formelbaum
361cdf0e10cSrcweir     sal_uLong               nXMLImportedFormulaCount;        // progress count during XML import
362cdf0e10cSrcweir 	sal_uInt16				nInterpretLevel;				// >0 wenn im Interpreter
363cdf0e10cSrcweir 	sal_uInt16				nMacroInterpretLevel; 			// >0 wenn Macro im Interpreter
364cdf0e10cSrcweir 	sal_uInt16				nInterpreterTableOpLevel;		// >0 if in Interpreter TableOp
365cdf0e10cSrcweir 	SCTAB				nMaxTableNumber;
366cdf0e10cSrcweir 	sal_uInt16				nSrcVer;						// Dateiversion (Laden/Speichern)
367cdf0e10cSrcweir 	SCROW				nSrcMaxRow;						// Zeilenzahl zum Laden/Speichern
368cdf0e10cSrcweir 	sal_uInt16				nFormulaTrackCount;
369cdf0e10cSrcweir 	sal_uInt16				nHardRecalcState;				// 0: soft, 1: hard-warn, 2: hard
370cdf0e10cSrcweir 	SCTAB				nVisibleTab;					// fuer OLE etc.
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 	ScLkUpdMode			eLinkMode;
373cdf0e10cSrcweir 
374cdf0e10cSrcweir 	sal_Bool				bAutoCalc;						// Automatisch Berechnen
375cdf0e10cSrcweir 	sal_Bool				bAutoCalcShellDisabled;			// in/von/fuer ScDocShell disabled
376cdf0e10cSrcweir 	// ob noch ForcedFormulas berechnet werden muessen,
377cdf0e10cSrcweir 	// im Zusammenspiel mit ScDocShell SetDocumentModified,
378cdf0e10cSrcweir 	// AutoCalcShellDisabled und TrackFormulas
379cdf0e10cSrcweir 	sal_Bool				bForcedFormulaPending;
380cdf0e10cSrcweir 	sal_Bool				bCalculatingFormulaTree;
381cdf0e10cSrcweir 	sal_Bool				bIsClip;
382cdf0e10cSrcweir 	sal_Bool				bIsUndo;
383cdf0e10cSrcweir 	sal_Bool				bIsVisible;						// set from view ctor
384cdf0e10cSrcweir 
385cdf0e10cSrcweir 	sal_Bool				bIsEmbedded;					// Embedded-Bereich anzeigen/anpassen ?
386cdf0e10cSrcweir 
387cdf0e10cSrcweir 	// kein SetDirty bei ScFormulaCell::CompileTokenArray sondern am Ende
388cdf0e10cSrcweir 	// von ScDocument::CompileAll[WithFormats], CopyScenario, CopyBlockFromClip
389cdf0e10cSrcweir 	sal_Bool				bNoSetDirty;
390cdf0e10cSrcweir 	// kein Broadcast, keine Listener aufbauen waehrend aus einem anderen
391cdf0e10cSrcweir 	// Doc (per Filter o.ae.) inserted wird, erst bei CompileAll / CalcAfterLoad
392cdf0e10cSrcweir 	sal_Bool				bInsertingFromOtherDoc;
393cdf0e10cSrcweir     bool                bLoadingMedium;
394cdf0e10cSrcweir     bool                bImportingXML;      // special handling of formula text
395577c0052SWang Lei     bool                mbImportingMSXML;
396cdf0e10cSrcweir     sal_Bool                bXMLFromWrapper;    // distinguish ScXMLImportWrapper from external component
397cdf0e10cSrcweir 	sal_Bool				bCalcingAfterLoad;				// in CalcAfterLoad TRUE
398cdf0e10cSrcweir 	// wenn temporaer keine Listener auf/abgebaut werden sollen
399cdf0e10cSrcweir 	sal_Bool				bNoListening;
400cdf0e10cSrcweir 	sal_Bool				bIdleDisabled;
401cdf0e10cSrcweir 	sal_Bool				bInLinkUpdate;					// TableLink or AreaLink
402cdf0e10cSrcweir 	sal_Bool				bChartListenerCollectionNeedsUpdate;
403cdf0e10cSrcweir 	// ob RC_FORCED Formelzellen im Dokument sind/waren (einmal an immer an)
404cdf0e10cSrcweir 	sal_Bool				bHasForcedFormulas;
405cdf0e10cSrcweir 	// ob das Doc gerade zerstoert wird (kein Notify-Tracking etc. mehr)
406cdf0e10cSrcweir 	sal_Bool				bInDtorClear;
407cdf0e10cSrcweir 	// ob bei Spalte/Zeile einfuegen am Rand einer Referenz die Referenz
408cdf0e10cSrcweir 	// erweitert wird, wird in jedem UpdateReference aus InputOptions geholt,
409cdf0e10cSrcweir 	// gesetzt und am Ende von UpdateReference zurueckgesetzt
410cdf0e10cSrcweir 	sal_Bool				bExpandRefs;
411cdf0e10cSrcweir 	// fuer Detektiv-Update, wird bei jeder Aenderung an Formeln gesetzt
412cdf0e10cSrcweir 	sal_Bool				bDetectiveDirty;
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 	sal_uInt8				nMacroCallMode;		// Makros per Warnung-Dialog disabled?
415cdf0e10cSrcweir 	sal_Bool				bHasMacroFunc;		// valid only after loading
416cdf0e10cSrcweir 
417cdf0e10cSrcweir 	sal_uInt8				nVisSpellState;
418cdf0e10cSrcweir 
419cdf0e10cSrcweir 	sal_uInt8				nAsianCompression;
420cdf0e10cSrcweir 	sal_uInt8				nAsianKerning;
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     sal_Bool                bPastingDrawFromOtherDoc;
423cdf0e10cSrcweir 
424cdf0e10cSrcweir     sal_uInt8                nInDdeLinkUpdate;   // originating DDE links (stacked bool)
425cdf0e10cSrcweir 
426cdf0e10cSrcweir 	sal_Bool				bInUnoBroadcast;
427cdf0e10cSrcweir 	sal_Bool				bInUnoListenerCall;
428cdf0e10cSrcweir     formula::FormulaGrammar::Grammar  eGrammar;
429cdf0e10cSrcweir 
430cdf0e10cSrcweir     mutable sal_Bool        bStyleSheetUsageInvalid;
431cdf0e10cSrcweir 
432cdf0e10cSrcweir     bool                mbUndoEnabled;
433cdf0e10cSrcweir     bool                mbAdjustHeightEnabled;
434cdf0e10cSrcweir     bool                mbExecuteLinkEnabled;
435cdf0e10cSrcweir     bool                mbChangeReadOnlyEnabled;    // allow changes in read-only document (for API import filters)
436cdf0e10cSrcweir     bool                mbStreamValidLocked;
437cdf0e10cSrcweir 
43896f862caSArmin Le Grand     // #118840# Have a flag to know that this ScDocument is used temporary
43996f862caSArmin Le Grand     bool                mbIsTemporary : 1;
44096f862caSArmin Le Grand 
441cdf0e10cSrcweir     sal_Int16           mnNamedRangesLockCount;
442cdf0e10cSrcweir 
443*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
444*0deba7fbSSteve Yin 	String msDocAccTitle;
445cdf0e10cSrcweir public:
446*0deba7fbSSteve Yin 	// SC_DLLPUBLIC sal_Bool RowHidden( SCROW nRow, SCTAB nTab );
447*0deba7fbSSteve Yin 	//inline sal_Bool 		RowHidden( SCROW nRow, SCTAB nTab );		// FillInfo
448*0deba7fbSSteve Yin 	virtual void setDocAccTitle( const String& rTitle ) { msDocAccTitle = rTitle; }
449*0deba7fbSSteve Yin 	virtual const String getDocAccTitle() const { return msDocAccTitle; }
450*0deba7fbSSteve Yin 
451*0deba7fbSSteve Yin private:
452*0deba7fbSSteve Yin 	sal_Bool bReadOnly;  // MT: Really needed???
453*0deba7fbSSteve Yin 
454*0deba7fbSSteve Yin public:
455*0deba7fbSSteve Yin 	virtual void setDocReadOnly( sal_Bool b){ bReadOnly = b; }
456*0deba7fbSSteve Yin 	virtual sal_Bool getDocReadOnly() const { return bReadOnly; }
457*0deba7fbSSteve Yin 	sal_Bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBoder);
458*0deba7fbSSteve Yin 	void GetCellChangeTrackNote( const ScAddress &cell,String &strTrackText,sal_Bool &pbLeftEdge);
459*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
460cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uLong			GetCellCount() const;		// alle Zellen
461cdf0e10cSrcweir     SCSIZE          GetCellCount(SCTAB nTab, SCCOL nCol) const;
462cdf0e10cSrcweir 	sal_uLong			GetWeightedCount() const;	// Formeln und Edit staerker gewichtet
463cdf0e10cSrcweir 	sal_uLong			GetCodeCount() const;		// RPN-Code in Formeln
464cdf0e10cSrcweir 	DECL_LINK( GetUserDefinedColor, sal_uInt16 * );
465cdf0e10cSrcweir 																// Numberformatter
466cdf0e10cSrcweir 
467cdf0e10cSrcweir public:
468cdf0e10cSrcweir 	SC_DLLPUBLIC 				ScDocument( ScDocumentMode eMode = SCDOCMODE_DOCUMENT,
469cdf0e10cSrcweir 								SfxObjectShell* pDocShell = NULL );
470cdf0e10cSrcweir 	SC_DLLPUBLIC 				~ScDocument();
471cdf0e10cSrcweir 
472cdf0e10cSrcweir 	inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
473cdf0e10cSrcweir 					GetServiceManager() const { return xServiceManager; }
474cdf0e10cSrcweir 
475cdf0e10cSrcweir 	SC_DLLPUBLIC const String& 	GetName() const { return aDocName; }
476cdf0e10cSrcweir 	void			SetName( const String& r ) { aDocName = r; }
477cdf0e10cSrcweir 	const String& 	GetCodeName() const { return aDocCodeName; }
478cdf0e10cSrcweir 	void			SetCodeName( const String& r ) { aDocCodeName = r; }
479cdf0e10cSrcweir 
480cdf0e10cSrcweir 	void			GetDocStat( ScDocStat& rDocStat );
481cdf0e10cSrcweir 
482cdf0e10cSrcweir 	SC_DLLPUBLIC void			InitDrawLayer( SfxObjectShell* pDocShell = NULL );
483c7be74b1SArmin Le Grand 	XColorListSharedPtr GetColorTable();
484cdf0e10cSrcweir 
485*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
486*0deba7fbSSteve Yin 	ScTable*      GetTableByIndex(sal_Int32 nIndex);
487*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
488cdf0e10cSrcweir 	SC_DLLPUBLIC sfx2::LinkManager*		GetLinkManager() const;
489cdf0e10cSrcweir 
490cdf0e10cSrcweir 	SC_DLLPUBLIC const ScDocOptions&		GetDocOptions() const;
491cdf0e10cSrcweir 	SC_DLLPUBLIC void					SetDocOptions( const ScDocOptions& rOpt );
492cdf0e10cSrcweir 	SC_DLLPUBLIC const ScViewOptions&	GetViewOptions() const;
493cdf0e10cSrcweir 	SC_DLLPUBLIC void 					SetViewOptions( const ScViewOptions& rOpt );
494cdf0e10cSrcweir 	void					SetPrintOptions();
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 	ScExtDocOptions*		GetExtDocOptions()	{ return pExtDocOptions; }
497cdf0e10cSrcweir 	SC_DLLPUBLIC void					SetExtDocOptions( ScExtDocOptions* pNewOptions );
498cdf0e10cSrcweir 
499cdf0e10cSrcweir 	void					GetLanguage( LanguageType& rLatin, LanguageType& rCjk, LanguageType& rCtl ) const;
500cdf0e10cSrcweir 	void					SetLanguage( LanguageType eLatin, LanguageType eCjk, LanguageType eCtl );
501cdf0e10cSrcweir 
502cdf0e10cSrcweir 	void						SetConsolidateDlgData( const ScConsolidateParam* pData );
503cdf0e10cSrcweir 	const ScConsolidateParam*	GetConsolidateDlgData() const { return pConsolidateDlgData; }
504cdf0e10cSrcweir 
505cdf0e10cSrcweir 	void			Clear( sal_Bool bFromDestructor = sal_False );
506cdf0e10cSrcweir 
507cdf0e10cSrcweir 	ScFieldEditEngine*	CreateFieldEditEngine();
508cdf0e10cSrcweir 	void				DisposeFieldEditEngine(ScFieldEditEngine*& rpEditEngine);
509cdf0e10cSrcweir 
510cdf0e10cSrcweir 	SC_DLLPUBLIC ScRangeName*	GetRangeName();
511cdf0e10cSrcweir 	void			SetRangeName( ScRangeName* pNewRangeName );
512cdf0e10cSrcweir 	SCTAB			GetMaxTableNumber() { return nMaxTableNumber; }
513cdf0e10cSrcweir 	void			SetMaxTableNumber(SCTAB nNumber) { nMaxTableNumber = nNumber; }
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 	ScRangePairList*	GetColNameRanges() { return &xColNameRanges; }
516cdf0e10cSrcweir 	ScRangePairList*	GetRowNameRanges() { return &xRowNameRanges; }
517cdf0e10cSrcweir 	ScRangePairListRef&	GetColNameRangesRef() { return xColNameRanges; }
518cdf0e10cSrcweir 	ScRangePairListRef&	GetRowNameRangesRef() { return xRowNameRanges; }
519cdf0e10cSrcweir 
520cdf0e10cSrcweir 	SC_DLLPUBLIC ScDBCollection*	GetDBCollection() const;
521cdf0e10cSrcweir 	void			SetDBCollection( ScDBCollection* pNewDBCollection,
522cdf0e10cSrcweir 										sal_Bool bRemoveAutoFilter = sal_False );
523cdf0e10cSrcweir 	ScDBData*		GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
524cdf0e10cSrcweir 										sal_Bool bStartOnly = sal_False) const;
525cdf0e10cSrcweir 	ScDBData*		GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
526cdf0e10cSrcweir     ScDBData*       GetFilterDBAtTable(SCTAB nTab) const;
527cdf0e10cSrcweir //UNUSED2008-05  ScRangeData*	GetRangeAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab,
528cdf0e10cSrcweir //UNUSED2008-05                                      sal_Bool bStartOnly = sal_False) const;
529cdf0e10cSrcweir 	SC_DLLPUBLIC ScRangeData*	GetRangeAtBlock( const ScRange& rBlock, String* pName=NULL ) const;
53057b4fa3cSWang Lei     ScDBData*       GetDBAtTable(SCTAB nTab, ScGetDBMode eMode) const;
531cdf0e10cSrcweir 
532cdf0e10cSrcweir 	SC_DLLPUBLIC ScDPCollection*		GetDPCollection();
533cdf0e10cSrcweir 	ScDPObject*			GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
534cdf0e10cSrcweir     ScDPObject*         GetDPAtBlock( const ScRange& rBlock ) const;
535cdf0e10cSrcweir     // Wang Xu Ming -- 2009-8-17
536cdf0e10cSrcweir     // DataPilot Migration - Cache&&Performance
537cdf0e10cSrcweir     SC_DLLPUBLIC ScDPTableDataCache*    GetDPObjectCache( long nID );
538cdf0e10cSrcweir     SC_DLLPUBLIC ScDPTableDataCache*    GetUsedDPObjectCache ( ScRange rRange );
539cdf0e10cSrcweir     SC_DLLPUBLIC long                                 AddDPObjectCache( ScDPTableDataCache* pData );
540cdf0e10cSrcweir     SC_DLLPUBLIC void                                 RemoveDPObjectCache( long nID );
541cdf0e10cSrcweir     SC_DLLPUBLIC void                                 RemoveUnusedDPObjectCaches();
542cdf0e10cSrcweir     SC_DLLPUBLIC void                                 GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist );
543cdf0e10cSrcweir     SC_DLLPUBLIC long                                 GetNewDPObjectCacheId ();
544cdf0e10cSrcweir     // End Comments
545cdf0e10cSrcweir 
546cdf0e10cSrcweir 	SC_DLLPUBLIC ScChartCollection*	GetChartCollection() const;
547cdf0e10cSrcweir 
548cdf0e10cSrcweir     void				StopTemporaryChartLock();
549cdf0e10cSrcweir 
550cdf0e10cSrcweir 	void			EnsureGraphicNames();
551cdf0e10cSrcweir 
552cdf0e10cSrcweir 	SdrObject*		GetObjectAtPoint( SCTAB nTab, const Point& rPos );
553cdf0e10cSrcweir 	sal_Bool			HasChartAtPoint( SCTAB nTab, const Point& rPos, String* pName = NULL );
554cdf0e10cSrcweir 
555cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartByName( const String& rChartName );
556cdf0e10cSrcweir     SC_DLLPUBLIC void            GetChartRanges( const String& rChartName, ::std::vector< ScRangeList >& rRanges, ScDocument* pSheetNameDoc );
557cdf0e10cSrcweir     void            SetChartRanges( const String& rChartName, const ::std::vector< ScRangeList >& rRanges );
558cdf0e10cSrcweir 
559cdf0e10cSrcweir     void			UpdateChartArea( const String& rChartName, const ScRange& rNewArea,
560cdf0e10cSrcweir 										sal_Bool bColHeaders, sal_Bool bRowHeaders, sal_Bool bAdd );
561cdf0e10cSrcweir 	void			UpdateChartArea( const String& rChartName,
562cdf0e10cSrcweir 									const ScRangeListRef& rNewList,
563cdf0e10cSrcweir 									sal_Bool bColHeaders, sal_Bool bRowHeaders, sal_Bool bAdd );
564cdf0e10cSrcweir     void            GetOldChartParameters( const String& rName,
565cdf0e10cSrcweir                                     ScRangeList& rRanges, sal_Bool& rColHeaders, sal_Bool& rRowHeaders );
566cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
567cdf0e10cSrcweir             ::com::sun::star::embed::XEmbeddedObject >
568cdf0e10cSrcweir                     FindOleObjectByName( const String& rName );
569cdf0e10cSrcweir 
570cdf0e10cSrcweir 	SC_DLLPUBLIC void			MakeTable( SCTAB nTab,bool _bNeedsNameCheck = true );
571cdf0e10cSrcweir 
572cdf0e10cSrcweir 	SCTAB			GetVisibleTab() const		{ return nVisibleTab; }
573cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetVisibleTab(SCTAB nTab)	{ nVisibleTab = nTab; }
574cdf0e10cSrcweir 
575cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasTable( SCTAB nTab ) const;
576cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetName( SCTAB nTab, String& rName ) const;
577cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetCodeName( SCTAB nTab, String& rName ) const;
578cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			SetCodeName( SCTAB nTab, const String& rName );
579cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetTable( const String& rName, SCTAB& rTab ) const;
580cdf0e10cSrcweir 	SC_DLLPUBLIC inline SCTAB	GetTableCount() const { return nMaxTableNumber; }
581cdf0e10cSrcweir 	SvNumberFormatterIndexTable* GetFormatExchangeList() const { return pFormatExchangeList; }
582cdf0e10cSrcweir 
583cdf0e10cSrcweir     SC_DLLPUBLIC ScDocProtection* GetDocProtection() const;
584cdf0e10cSrcweir     SC_DLLPUBLIC void            SetDocProtection(const ScDocProtection* pProtect);
585cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsDocProtected() const;
586cdf0e10cSrcweir 	sal_Bool			IsDocEditable() const;
587cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsTabProtected( SCTAB nTab ) const;
588cdf0e10cSrcweir     SC_DLLPUBLIC    ScTableProtection* GetTabProtection( SCTAB nTab ) const;
589cdf0e10cSrcweir     SC_DLLPUBLIC void SetTabProtection(SCTAB nTab, const ScTableProtection* pProtect);
590cdf0e10cSrcweir     void            CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest);
591cdf0e10cSrcweir 
592cdf0e10cSrcweir 	void			LockTable(SCTAB nTab);
593cdf0e10cSrcweir 	void			UnlockTable(SCTAB nTab);
594cdf0e10cSrcweir 
595cdf0e10cSrcweir 	sal_Bool			IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
596cdf0e10cSrcweir 										SCCOL nEndCol, SCROW nEndRow,
597cdf0e10cSrcweir 										sal_Bool* pOnlyNotBecauseOfMatrix = NULL ) const;
598cdf0e10cSrcweir 	sal_Bool			IsSelectionEditable( const ScMarkData& rMark,
599cdf0e10cSrcweir 										sal_Bool* pOnlyNotBecauseOfMatrix = NULL ) const;
600cdf0e10cSrcweir 	sal_Bool			HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow,
601cdf0e10cSrcweir 											SCCOL nEndCol, SCROW nEndRow,
602cdf0e10cSrcweir 											const ScMarkData& rMark ) const;
603cdf0e10cSrcweir 
604cdf0e10cSrcweir 	sal_Bool			GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix );
605cdf0e10cSrcweir 
606cdf0e10cSrcweir 	sal_Bool			IsEmbedded() const;
607cdf0e10cSrcweir 	void			GetEmbedded( ScRange& rRange ) const;
608cdf0e10cSrcweir 	void			SetEmbedded( const ScRange& rRange );
609cdf0e10cSrcweir 	void			ResetEmbedded();
610cdf0e10cSrcweir 	Rectangle		GetEmbeddedRect() const;						// 1/100 mm
611cdf0e10cSrcweir 	void			SetEmbedded( const Rectangle& rRect );			// aus VisArea (1/100 mm)
612cdf0e10cSrcweir 	void			SnapVisArea( Rectangle& rRect ) const;			// 1/100 mm
613cdf0e10cSrcweir 
614cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			ValidTabName( const String& rName ) const;
615cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			ValidNewTabName( const String& rName ) const;
616cdf0e10cSrcweir 	SC_DLLPUBLIC void			CreateValidTabName(String& rName) const;
617cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			InsertTab( SCTAB nPos, const String& rName,
618cdf0e10cSrcweir 								sal_Bool bExternalDocument = sal_False );
619cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool            DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc = NULL );
620cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			RenameTab( SCTAB nTab, const String& rName,
621cdf0e10cSrcweir 								sal_Bool bUpdateRef = sal_True,
622cdf0e10cSrcweir 								sal_Bool bExternalDocument = sal_False );
623cdf0e10cSrcweir 	sal_Bool			MoveTab( SCTAB nOldPos, SCTAB nNewPos );
624cdf0e10cSrcweir 	sal_Bool			CopyTab( SCTAB nOldPos, SCTAB nNewPos,
625cdf0e10cSrcweir 								const ScMarkData* pOnlyMarked = NULL );
626cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uLong			TransferTab(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos,
627cdf0e10cSrcweir 									sal_Bool bInsertNew = sal_True,
628cdf0e10cSrcweir 									sal_Bool bResultsOnly = sal_False );
629cdf0e10cSrcweir 	SC_DLLPUBLIC void			TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDestPos);
630cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetVisible( SCTAB nTab, sal_Bool bVisible );
631cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsVisible( SCTAB nTab ) const;
632cdf0e10cSrcweir     sal_Bool            IsStreamValid( SCTAB nTab ) const;
633cdf0e10cSrcweir     void            SetStreamValid( SCTAB nTab, sal_Bool bSet, sal_Bool bIgnoreLock = sal_False );
634cdf0e10cSrcweir     void            LockStreamValid( bool bLock );
635cdf0e10cSrcweir     bool            IsStreamValidLocked() const                         { return mbStreamValidLocked; }
63696f862caSArmin Le Grand 
63796f862caSArmin Le Grand     // #118840# Have a flag to know that this ScDocument is used temporary
63896f862caSArmin Le Grand     bool IsTemporary() const { return mbIsTemporary; }
63996f862caSArmin Le Grand 
640237246f4SWang Lei     SC_DLLPUBLIC sal_Bool        IsPendingRowHeights( SCTAB nTab ) const;
641237246f4SWang Lei     SC_DLLPUBLIC void            SetPendingRowHeights( SCTAB nTab, sal_Bool bSet );
642cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetLayoutRTL( SCTAB nTab, sal_Bool bRTL );
643cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsLayoutRTL( SCTAB nTab ) const;
644cdf0e10cSrcweir 	sal_Bool			IsNegativePage( SCTAB nTab ) const;
645cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetScenario( SCTAB nTab, sal_Bool bFlag );
646cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsScenario( SCTAB nTab ) const;
647cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetScenarioData( SCTAB nTab, String& rComment,
648cdf0e10cSrcweir 										Color& rColor, sal_uInt16& rFlags ) const;
649cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetScenarioData( SCTAB nTab, const String& rComment,
650cdf0e10cSrcweir 										const Color& rColor, sal_uInt16 nFlags );
651cdf0e10cSrcweir     SC_DLLPUBLIC Color GetTabBgColor( SCTAB nTab ) const;
652cdf0e10cSrcweir     SC_DLLPUBLIC void SetTabBgColor( SCTAB nTab, const Color& rColor );
653cdf0e10cSrcweir     SC_DLLPUBLIC bool IsDefaultTabBgColor( SCTAB nTab ) const;
654cdf0e10cSrcweir 	void			GetScenarioFlags( SCTAB nTab, sal_uInt16& rFlags ) const;
655cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsActiveScenario( SCTAB nTab ) const;
656cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetActiveScenario( SCTAB nTab, sal_Bool bActive );		// nur fuer Undo etc.
657cdf0e10cSrcweir 	SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const;
658cdf0e10cSrcweir     SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const;
659cdf0e10cSrcweir     void            SetGrammar( formula::FormulaGrammar::Grammar eGram );
660cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt8			GetLinkMode( SCTAB nTab ) const;
661cdf0e10cSrcweir 	sal_Bool			IsLinked( SCTAB nTab ) const;
662cdf0e10cSrcweir 	SC_DLLPUBLIC const String&	GetLinkDoc( SCTAB nTab ) const;
663cdf0e10cSrcweir 	const String&	GetLinkFlt( SCTAB nTab ) const;
664cdf0e10cSrcweir 	const String&	GetLinkOpt( SCTAB nTab ) const;
665cdf0e10cSrcweir 	SC_DLLPUBLIC const String&	GetLinkTab( SCTAB nTab ) const;
666cdf0e10cSrcweir 	sal_uLong			GetLinkRefreshDelay( SCTAB nTab ) const;
667cdf0e10cSrcweir 	void			SetLink( SCTAB nTab, sal_uInt8 nMode, const String& rDoc,
668cdf0e10cSrcweir 							const String& rFilter, const String& rOptions,
669cdf0e10cSrcweir 							const String& rTabName, sal_uLong nRefreshDelay );
670cdf0e10cSrcweir 	sal_Bool			HasLink( const String& rDoc,
671cdf0e10cSrcweir 							const String& rFilter, const String& rOptions ) const;
672cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			LinkExternalTab( SCTAB& nTab, const String& aDocTab,
673cdf0e10cSrcweir 									const String& aFileName,
674cdf0e10cSrcweir 									const String& aTabName );
675cdf0e10cSrcweir 
676cdf0e10cSrcweir     bool            HasExternalRefManager() const { return pExternalRefMgr.get(); }
677cdf0e10cSrcweir     SC_DLLPUBLIC ScExternalRefManager* GetExternalRefManager() const;
678cdf0e10cSrcweir     bool            IsInExternalReferenceMarking() const;
679cdf0e10cSrcweir     void            MarkUsedExternalReferences();
680cdf0e10cSrcweir     bool            MarkUsedExternalReferences( ScTokenArray & rArr );
681cdf0e10cSrcweir 
682cdf0e10cSrcweir     /** Returns the pool containing external formula parsers. Creates the pool
683cdf0e10cSrcweir         on first call. */
684cdf0e10cSrcweir     ScFormulaParserPool& GetFormulaParserPool() const;
685cdf0e10cSrcweir 
686cdf0e10cSrcweir 	sal_Bool			HasDdeLinks() const;
687cdf0e10cSrcweir 	sal_Bool			HasAreaLinks() const;
688cdf0e10cSrcweir     void            UpdateExternalRefLinks();
689cdf0e10cSrcweir 	void			UpdateDdeLinks();
690cdf0e10cSrcweir 	void			UpdateAreaLinks();
691cdf0e10cSrcweir 
692cdf0e10cSrcweir                     // originating DDE links
693cdf0e10cSrcweir     void            IncInDdeLinkUpdate() { if ( nInDdeLinkUpdate < 255 ) ++nInDdeLinkUpdate; }
694cdf0e10cSrcweir     void            DecInDdeLinkUpdate() { if ( nInDdeLinkUpdate ) --nInDdeLinkUpdate; }
695cdf0e10cSrcweir     sal_Bool            IsInDdeLinkUpdate() const   { return nInDdeLinkUpdate != 0; }
696cdf0e10cSrcweir 
697cdf0e10cSrcweir 	SC_DLLPUBLIC void			CopyDdeLinks( ScDocument* pDestDoc ) const;
698cdf0e10cSrcweir 	void			DisconnectDdeLinks();
699cdf0e10cSrcweir 
700cdf0e10cSrcweir 					// Fuer StarOne Api:
701cdf0e10cSrcweir 	sal_uInt16			GetDdeLinkCount() const;
702cdf0e10cSrcweir 	sal_Bool			UpdateDdeLink( const String& rAppl, const String& rTopic, const String& rItem );
703cdf0e10cSrcweir 
704cdf0e10cSrcweir     /** Tries to find a DDE link with the specified connection data.
705cdf0e10cSrcweir         @param rnDdePos  (out-param) Returns the index of the DDE link (does not include other links from link manager).
706cdf0e10cSrcweir         @return  true = DDE link found, rnDdePos valid. */
707cdf0e10cSrcweir     SC_DLLPUBLIC bool            FindDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, sal_uInt16& rnDdePos );
708cdf0e10cSrcweir 
709cdf0e10cSrcweir     /** Returns the connection data of the specified DDE link.
710cdf0e10cSrcweir         @param nDdePos  Index of the DDE link (does not include other links from link manager).
711cdf0e10cSrcweir         @param rAppl  (out-param) The application name.
712cdf0e10cSrcweir         @param rTopic  (out-param) The DDE topic.
713cdf0e10cSrcweir         @param rItem  (out-param) The DDE item.
714cdf0e10cSrcweir         @return  true = DDE link found, out-parameters valid. */
715cdf0e10cSrcweir     bool            GetDdeLinkData( sal_uInt16 nDdePos, String& rAppl, String& rTopic, String& rItem ) const;
716cdf0e10cSrcweir     /** Returns the link mode of the specified DDE link.
717cdf0e10cSrcweir         @param nDdePos  Index of the DDE link (does not include other links from link manager).
718cdf0e10cSrcweir         @param rnMode  (out-param) The link mode of the specified DDE link.
719cdf0e10cSrcweir         @return  true = DDE link found, rnMode valid. */
720cdf0e10cSrcweir     bool            GetDdeLinkMode( sal_uInt16 nDdePos, sal_uInt8& rnMode ) const;
721cdf0e10cSrcweir     /** Returns the result matrix of the specified DDE link.
722cdf0e10cSrcweir         @param nDdePos  Index of the DDE link (does not include other links from link manager).
723cdf0e10cSrcweir         @return  The result matrix, if the DDE link has been found, 0 otherwise. */
724cdf0e10cSrcweir     SC_DLLPUBLIC const ScMatrix* GetDdeLinkResultMatrix( sal_uInt16 nDdePos ) const;
725cdf0e10cSrcweir 
726cdf0e10cSrcweir     /** Tries to find a DDE link or creates a new, if not extant.
727cdf0e10cSrcweir         @param pResults  If not 0, sets the matrix as as DDE link result matrix (also for existing links).
728cdf0e10cSrcweir         @return  true = DDE link found; false = Unpredictable error occured, no DDE link created. */
729cdf0e10cSrcweir     SC_DLLPUBLIC bool            CreateDdeLink( const String& rAppl, const String& rTopic, const String& rItem, sal_uInt8 nMode, ScMatrix* pResults = NULL );
730cdf0e10cSrcweir     /** Sets a result matrix for the specified DDE link.
731cdf0e10cSrcweir         @param nDdePos  Index of the DDE link (does not include other links from link manager).
732cdf0e10cSrcweir         @param pResults  The array containing all results of the DDE link (intrusive-ref-counted, do not delete).
733cdf0e10cSrcweir         @return  true = DDE link found and matrix set. */
734cdf0e10cSrcweir     bool            SetDdeLinkResultMatrix( sal_uInt16 nDdePos, ScMatrix* pResults );
735cdf0e10cSrcweir 
736cdf0e10cSrcweir 
737cdf0e10cSrcweir 	SfxBindings*	GetViewBindings();
738cdf0e10cSrcweir 	SfxObjectShell* GetDocumentShell() const	{ return pShell; }
739cdf0e10cSrcweir 	ScDrawLayer*	GetDrawLayer()				{ return pDrawLayer; }
740cdf0e10cSrcweir 	SfxBroadcaster*	GetDrawBroadcaster();		// zwecks Header-Vermeidung
741cdf0e10cSrcweir 	void			BeginDrawUndo();
742ee342afcSWang Lei 	sal_Bool		IsDrawRecording() const;
743ee342afcSWang Lei 	void			EndDrawUndo();//paired with BeginDrawUndo, clear undo object if GetUndoObj is not called.
744ee342afcSWang Lei 								//Not necessary if GetUndoObj is called, but call EndDrawUndo paired with BeginDrawUndo is recommended
745cdf0e10cSrcweir 
746cdf0e10cSrcweir     void            BeginUnoRefUndo();
747cdf0e10cSrcweir     bool            HasUnoRefUndo() const       { return ( pUnoRefUndoList != NULL ); }
748cdf0e10cSrcweir     ScUnoRefList*   EndUnoRefUndo();            // must be deleted by caller!
749cdf0e10cSrcweir     sal_Int64       GetNewUnoId();
750cdf0e10cSrcweir     void            AddUnoRefChange( sal_Int64 nId, const ScRangeList& rOldRanges );
751cdf0e10cSrcweir 
752cdf0e10cSrcweir 	// #109985#
753cdf0e10cSrcweir 	sal_Bool IsChart( const SdrObject* pObject );
754cdf0e10cSrcweir 
755cdf0e10cSrcweir 	SC_DLLPUBLIC void			UpdateAllCharts();
756cdf0e10cSrcweir 	void			UpdateChartRef( UpdateRefMode eUpdateRefMode,
757cdf0e10cSrcweir 									SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
758cdf0e10cSrcweir 									SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
759cdf0e10cSrcweir 									SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
760cdf0e10cSrcweir 					//! setzt nur die neue RangeList, keine ChartListener o.ae.
761cdf0e10cSrcweir 	void			SetChartRangeList( const String& rChartName,
762cdf0e10cSrcweir 						const ScRangeListRef& rNewRangeListRef );
763cdf0e10cSrcweir 
764cdf0e10cSrcweir 	sal_Bool			HasControl( SCTAB nTab, const Rectangle& rMMRect );
765cdf0e10cSrcweir 	void			InvalidateControls( Window* pWin, SCTAB nTab, const Rectangle& rMMRect );
766cdf0e10cSrcweir 
767cdf0e10cSrcweir 	void			StartAnimations( SCTAB nTab, Window* pWin );
768cdf0e10cSrcweir 
769cdf0e10cSrcweir 	sal_Bool			HasBackgroundDraw( SCTAB nTab, const Rectangle& rMMRect );
770cdf0e10cSrcweir 	sal_Bool			HasAnyDraw( SCTAB nTab, const Rectangle& rMMRect );
771cdf0e10cSrcweir 
772cdf0e10cSrcweir     const ScSheetEvents* GetSheetEvents( SCTAB nTab ) const;
773cdf0e10cSrcweir     void            SetSheetEvents( SCTAB nTab, const ScSheetEvents* pNew );
774cdf0e10cSrcweir     bool            HasSheetEventScript( SCTAB nTab, sal_Int32 nEvent, bool bWithVbaEvents = false ) const;
775cdf0e10cSrcweir     bool            HasAnySheetEventScript( sal_Int32 nEvent, bool bWithVbaEvents = false ) const;  // on any sheet
776cdf0e10cSrcweir 
777cdf0e10cSrcweir     bool            HasAnyCalcNotification() const;
778cdf0e10cSrcweir     sal_Bool            HasCalcNotification( SCTAB nTab ) const;
779cdf0e10cSrcweir     void            SetCalcNotification( SCTAB nTab );
780cdf0e10cSrcweir     void            ResetCalcNotifications();
781cdf0e10cSrcweir 
782cdf0e10cSrcweir 	SC_DLLPUBLIC ScOutlineTable*	GetOutlineTable( SCTAB nTab, sal_Bool bCreate = sal_False );
783cdf0e10cSrcweir 	sal_Bool			SetOutlineTable( SCTAB nTab, const ScOutlineTable* pNewOutline );
784cdf0e10cSrcweir 
785cdf0e10cSrcweir 	void			DoAutoOutline( SCCOL nStartCol, SCROW nStartRow,
786cdf0e10cSrcweir 									SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
787cdf0e10cSrcweir 
788cdf0e10cSrcweir 	sal_Bool			DoSubTotals( SCTAB nTab, ScSubTotalParam& rParam );
789cdf0e10cSrcweir 	void			RemoveSubTotals( SCTAB nTab, ScSubTotalParam& rParam );
790cdf0e10cSrcweir 	sal_Bool			TestRemoveSubTotals( SCTAB nTab, const ScSubTotalParam& rParam );
791cdf0e10cSrcweir 	sal_Bool			HasSubTotalCells( const ScRange& rRange );
792cdf0e10cSrcweir 
793cdf0e10cSrcweir 	SC_DLLPUBLIC void			PutCell( const ScAddress&, ScBaseCell* pCell, sal_Bool bForceTab = sal_False );
794cdf0e10cSrcweir //UNUSED2009-05 SC_DLLPUBLIC void			PutCell( const ScAddress&, ScBaseCell* pCell,
795cdf0e10cSrcweir //UNUSED2009-05                         sal_uLong nFormatIndex, sal_Bool bForceTab = sal_False);
796cdf0e10cSrcweir 	SC_DLLPUBLIC void			PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
797cdf0e10cSrcweir 							sal_Bool bForceTab = sal_False );
798cdf0e10cSrcweir 	SC_DLLPUBLIC void			PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
799cdf0e10cSrcweir 							sal_uLong nFormatIndex, sal_Bool bForceTab = sal_False);
800cdf0e10cSrcweir 					//	return sal_True = Zahlformat gesetzt
801cdf0e10cSrcweir     SC_DLLPUBLIC sal_Bool           SetString(
802cdf0e10cSrcweir         SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
803cdf0e10cSrcweir         SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
804cdf0e10cSrcweir     SC_DLLPUBLIC void           SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
805cdf0e10cSrcweir 	void 			SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const sal_uInt16 nError);
806cdf0e10cSrcweir 
807cdf0e10cSrcweir 	SC_DLLPUBLIC void 			InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
808cdf0e10cSrcweir 										SCCOL nCol2, SCROW nRow2,
809cdf0e10cSrcweir 										const ScMarkData& rMark,
810cdf0e10cSrcweir 										const String& rFormula,
811cdf0e10cSrcweir 										const ScTokenArray* p = NULL,
812cdf0e10cSrcweir                                         const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
813cdf0e10cSrcweir 	SC_DLLPUBLIC void 			InsertTableOp(const ScTabOpParam& rParam,	// Mehrfachoperation
814cdf0e10cSrcweir 								  SCCOL nCol1, SCROW nRow1,
815cdf0e10cSrcweir 								  SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark);
816cdf0e10cSrcweir 
817cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
818cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
819cdf0e10cSrcweir     sal_uInt16                  GetStringForFormula( const ScAddress& rPos, rtl::OUString& rString );
820cdf0e10cSrcweir 	SC_DLLPUBLIC double			GetValue( const ScAddress& );
821cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, double& rValue );
822cdf0e10cSrcweir 	SC_DLLPUBLIC double			RoundValueAsShown( double fVal, sal_uLong nFormat );
823cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab,
824cdf0e10cSrcweir 									 sal_uInt32& rFormat );
825cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt32		GetNumberFormat( const ScAddress& ) const;
826cdf0e10cSrcweir                     /** If no number format attribute is set and the cell
827cdf0e10cSrcweir                         pointer passed is of type formula cell, the calculated
828cdf0e10cSrcweir                         number format of the formula cell is returned. pCell
829cdf0e10cSrcweir                         may be NULL. */
830cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetNumberFormatInfo( short& nType, sal_uLong& nIndex,
831cdf0e10cSrcweir 						const ScAddress& rPos, const ScBaseCell* pCell ) const;
832cdf0e10cSrcweir 	void			GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rFormula,
833cdf0e10cSrcweir 								sal_Bool bAsciiExport = sal_False ) const;
834cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetCellType( SCCOL nCol, SCROW nRow, SCTAB nTab, CellType& rCellType ) const;
835cdf0e10cSrcweir 	SC_DLLPUBLIC CellType		GetCellType( const ScAddress& rPos ) const;
836cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell*& rpCell ) const;
837cdf0e10cSrcweir 	SC_DLLPUBLIC ScBaseCell*		GetCell( const ScAddress& rPos ) const;
838cdf0e10cSrcweir 
839cdf0e10cSrcweir //UNUSED2008-05  void			RefreshNoteFlags();
840cdf0e10cSrcweir 
841cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasData( SCCOL nCol, SCROW nRow, SCTAB nTab );
842cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasStringData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
843cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasValueData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
844cdf0e10cSrcweir 	sal_Bool			HasStringCells( const ScRange& rRange ) const;
845cdf0e10cSrcweir 
846cdf0e10cSrcweir     /** Returns true, if there is any data to create a selection list for rPos. */
847cdf0e10cSrcweir     sal_Bool            HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
848cdf0e10cSrcweir 
849cdf0e10cSrcweir     /** Returns the pointer to a cell note object at the passed cell address. */
850cdf0e10cSrcweir     ScPostIt*       GetNote( const ScAddress& rPos );
851cdf0e10cSrcweir     /** Sets the passed note at the cell with the passed cell address. */
852cdf0e10cSrcweir     void            TakeNote( const ScAddress& rPos, ScPostIt*& rpNote );
853cdf0e10cSrcweir     /** Returns and forgets the cell note object at the passed cell address. */
854cdf0e10cSrcweir     ScPostIt*       ReleaseNote( const ScAddress& rPos );
855cdf0e10cSrcweir     /** Returns the pointer to an existing or created cell note object at the passed cell address. */
856cdf0e10cSrcweir     SC_DLLPUBLIC ScPostIt* GetOrCreateNote( const ScAddress& rPos );
857cdf0e10cSrcweir     /** Deletes the note at the passed cell address. */
858cdf0e10cSrcweir     void            DeleteNote( const ScAddress& rPos );
859cdf0e10cSrcweir     /** Creates the captions of all uninitialized cell notes in the specified sheet.
860cdf0e10cSrcweir         @param bForced  True = always create all captions, false = skip when Undo is disabled. */
861cdf0e10cSrcweir     void            InitializeNoteCaptions( SCTAB nTab, bool bForced = false );
862cdf0e10cSrcweir     /** Creates the captions of all uninitialized cell notes in all sheets.
863cdf0e10cSrcweir         @param bForced  True = always create all captions, false = skip when Undo is disabled. */
864cdf0e10cSrcweir     void            InitializeAllNoteCaptions( bool bForced = false );
865cdf0e10cSrcweir 
866cdf0e10cSrcweir     sal_Bool            ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
867cdf0e10cSrcweir                                 SCCOL& rEndCol, SCROW& rEndRow, const ScMarkData& rMark,
868cdf0e10cSrcweir                                 sal_Bool bRefresh = sal_False, sal_Bool bAttrs = sal_False );
869cdf0e10cSrcweir 	sal_Bool			ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
870cdf0e10cSrcweir 								SCCOL& rEndCol, SCROW& rEndRow, SCTAB nTab,
871cdf0e10cSrcweir 								sal_Bool bRefresh = sal_False, sal_Bool bAttrs = sal_False );
872cdf0e10cSrcweir 	sal_Bool			ExtendMerge( ScRange& rRange, sal_Bool bRefresh = sal_False, sal_Bool bAttrs = sal_False );
873cdf0e10cSrcweir 	sal_Bool			ExtendTotalMerge( ScRange& rRange );
874cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
875cdf0e10cSrcweir 								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
876cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			ExtendOverlapped( ScRange& rRange );
877cdf0e10cSrcweir 
878cdf0e10cSrcweir 	sal_Bool			RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow,
879cdf0e10cSrcweir 								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
880cdf0e10cSrcweir 
881cdf0e10cSrcweir 	SC_DLLPUBLIC void			DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
882cdf0e10cSrcweir 									SCCOL nEndCol, SCROW nEndRow );
883cdf0e10cSrcweir 					//	ohne Ueberpruefung:
884cdf0e10cSrcweir 	SC_DLLPUBLIC void			DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
885cdf0e10cSrcweir                                     SCCOL nEndCol, SCROW nEndRow, bool bDeleteCaptions = true );
886cdf0e10cSrcweir 	void			RemoveMerge( SCCOL nCol, SCROW nRow, SCTAB nTab );
887cdf0e10cSrcweir 
888cdf0e10cSrcweir 	sal_Bool			IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
889cdf0e10cSrcweir 												SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes = false ) const;
890cdf0e10cSrcweir 	sal_Bool			IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
891cdf0e10cSrcweir 												SCCOL nEndCol, SCROW nEndRow,
892cdf0e10cSrcweir 												sal_Bool bLeftIsEmpty = sal_False,
893cdf0e10cSrcweir 												ScRange* pLastRange = NULL,
894cdf0e10cSrcweir 												Rectangle* pLastMM = NULL ) const;
895cdf0e10cSrcweir 
896cdf0e10cSrcweir 	sal_Bool			IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
897cdf0e10cSrcweir 	sal_Bool			IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
898cdf0e10cSrcweir 
899cdf0e10cSrcweir     SC_DLLPUBLIC bool           HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
900cdf0e10cSrcweir                                            SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt16 nMask );
901cdf0e10cSrcweir     SC_DLLPUBLIC bool           HasAttrib( const ScRange& rRange, sal_uInt16 nMask );
902cdf0e10cSrcweir 
903cdf0e10cSrcweir 	void			GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
904cdf0e10cSrcweir 									const SvxBorderLine** ppLeft,
905cdf0e10cSrcweir 									const SvxBorderLine** ppTop,
906cdf0e10cSrcweir 									const SvxBorderLine** ppRight,
907cdf0e10cSrcweir 									const SvxBorderLine** ppBottom ) const;
908cdf0e10cSrcweir 
909cdf0e10cSrcweir 	void			ResetChanged( const ScRange& rRange );
910cdf0e10cSrcweir 
911cdf0e10cSrcweir 	void			SetDirty();
912cdf0e10cSrcweir 	void			SetDirty( const ScRange& );
913cdf0e10cSrcweir 	void			SetTableOpDirty( const ScRange& );	// for Interpreter TableOp
914cdf0e10cSrcweir     void            InterpretDirtyCells( const ScRangeList& rRanges );
915cdf0e10cSrcweir 	void			CalcAll();
916cdf0e10cSrcweir 	SC_DLLPUBLIC void			CalcAfterLoad();
917cdf0e10cSrcweir 	void			CompileAll();
918cdf0e10cSrcweir 	void			CompileXML();
919cdf0e10cSrcweir 
920cdf0e10cSrcweir     ScAutoNameCache* GetAutoNameCache()     { return pAutoNameCache; }
921cdf0e10cSrcweir 
922cdf0e10cSrcweir                     /** Creates a ScLookupCache cache for the range if it
923cdf0e10cSrcweir                         doesn't already exist. */
924cdf0e10cSrcweir     ScLookupCache & GetLookupCache( const ScRange & rRange );
925cdf0e10cSrcweir                     /** Only ScLookupCache ctor uses AddLookupCache(), do not
926cdf0e10cSrcweir                         use elsewhere! */
927cdf0e10cSrcweir     void            AddLookupCache( ScLookupCache & rCache );
928cdf0e10cSrcweir                     /** Only ScLookupCache dtor uses RemoveLookupCache(), do
929cdf0e10cSrcweir                         not use elsewhere! */
930cdf0e10cSrcweir     void            RemoveLookupCache( ScLookupCache & rCache );
931cdf0e10cSrcweir                     /** Zap all caches. */
932cdf0e10cSrcweir     void            ClearLookupCaches();
933cdf0e10cSrcweir 
934cdf0e10cSrcweir 					// Automatisch Berechnen
935cdf0e10cSrcweir 	void			SetAutoCalc( sal_Bool bNewAutoCalc );
936cdf0e10cSrcweir 	sal_Bool			GetAutoCalc() const { return bAutoCalc; }
937cdf0e10cSrcweir 					// Automatisch Berechnen in/von/fuer ScDocShell disabled
938cdf0e10cSrcweir 	void			SetAutoCalcShellDisabled( sal_Bool bNew ) { bAutoCalcShellDisabled = bNew; }
939cdf0e10cSrcweir 	sal_Bool			IsAutoCalcShellDisabled() const { return bAutoCalcShellDisabled; }
940cdf0e10cSrcweir 					// ForcedFormulas zu berechnen
941cdf0e10cSrcweir 	void			SetForcedFormulaPending( sal_Bool bNew ) { bForcedFormulaPending = bNew; }
942cdf0e10cSrcweir 	sal_Bool			IsForcedFormulaPending() const { return bForcedFormulaPending; }
943cdf0e10cSrcweir 					// if CalcFormulaTree() is currently running
944cdf0e10cSrcweir 	sal_Bool			IsCalculatingFormulaTree() { return bCalculatingFormulaTree; }
945cdf0e10cSrcweir 
946cdf0e10cSrcweir 	sal_uInt16			GetErrCode( const ScAddress& ) const;
947cdf0e10cSrcweir 
948cdf0e10cSrcweir                     /** Shrink a range to only include data area.
949cdf0e10cSrcweir 
950cdf0e10cSrcweir                         This is not the actually used area within the
951cdf0e10cSrcweir                         selection, but the bounds of the sheet's data area
952cdf0e10cSrcweir                         instead.
953cdf0e10cSrcweir 
954cdf0e10cSrcweir                         @returns True if the area passed intersected the data
955cdf0e10cSrcweir                                  area, false if not, in which case the values
956cdf0e10cSrcweir                                  obtained may be out of bounds, not in order or
957cdf0e10cSrcweir                                  unmodified. True does not mean that there
958cdf0e10cSrcweir                                  actually is any data within the selection.
959cdf0e10cSrcweir                      */
960cdf0e10cSrcweir     bool            ShrinkToDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
961cdf0e10cSrcweir 
962cdf0e10cSrcweir                     /** Shrink a range to only include used data area.
963cdf0e10cSrcweir 
964cdf0e10cSrcweir                         @param o_bShrunk
965cdf0e10cSrcweir                                Out parameter, True if area was shrunk, false if not.
966cdf0e10cSrcweir 
967cdf0e10cSrcweir                         @returns True if there is any data, fakse if not.
968cdf0e10cSrcweir                      */
969cdf0e10cSrcweir     bool            ShrinkToUsedDataArea( bool& o_bShrunk,
970cdf0e10cSrcweir                                           SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
971cdf0e10cSrcweir                                           SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
972cdf0e10cSrcweir 
973cdf0e10cSrcweir     SC_DLLPUBLIC void           GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
974cdf0e10cSrcweir                                     SCCOL& rEndCol, SCROW& rEndRow, sal_Bool bIncludeOld, bool bOnlyDown ) const;
975cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
976cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
977cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
978cdf0e10cSrcweir 									sal_Bool bNotes = sal_True ) const;
979cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow,
980cdf0e10cSrcweir 										SCCOL& rEndCol, sal_Bool bNotes = sal_True ) const;
981cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol,
982cdf0e10cSrcweir 										SCROW& rEndRow, sal_Bool bNotes = sal_True ) const;
983cdf0e10cSrcweir 	void			InvalidateTableArea();
984cdf0e10cSrcweir 
985557cb412SWang Lei 	/*
986557cb412SWang Lei 	Get the last cell's row number , which have visual atribute or visual data in specific table
987557cb412SWang Lei 	*/
988557cb412SWang Lei 	SC_DLLPUBLIC void			GetLastAttrCell( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const;
989cdf0e10cSrcweir 
990cdf0e10cSrcweir     SC_DLLPUBLIC sal_Bool			GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const;
991cdf0e10cSrcweir 
992cdf0e10cSrcweir     /**
993cdf0e10cSrcweir      * Find the maximum column position that contains printable data for the
994cdf0e10cSrcweir      * specified row range.  The final column position must be equal or less
995cdf0e10cSrcweir      * than the initial value of rEndCol.
996cdf0e10cSrcweir      */
997cdf0e10cSrcweir     void			ExtendPrintArea( OutputDevice* pDev, SCTAB nTab,
998cdf0e10cSrcweir                                     SCCOL nStartCol, SCROW nStartRow,
999cdf0e10cSrcweir                                     SCCOL& rEndCol, SCROW nEndRow );
1000cdf0e10cSrcweir 	SC_DLLPUBLIC SCSIZE	    	GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
1001cdf0e10cSrcweir 											SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab,
1002cdf0e10cSrcweir 											ScDirection eDir );
1003cdf0e10cSrcweir 
1004cdf0e10cSrcweir 	void			FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY );
1005cdf0e10cSrcweir 	SC_DLLPUBLIC void			GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY,
1006cdf0e10cSrcweir 								sal_Bool bMarked, sal_Bool bUnprotected, const ScMarkData& rMark );
1007cdf0e10cSrcweir 
1008cdf0e10cSrcweir 	sal_Bool			GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, SCTAB nTab,
1009cdf0e10cSrcweir 										const ScMarkData& rMark );
1010cdf0e10cSrcweir 
1011cdf0e10cSrcweir 	void			LimitChartArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow,
1012cdf0e10cSrcweir 													SCCOL& rEndCol, SCROW& rEndRow );
1013cdf0e10cSrcweir 	void			LimitChartIfAll( ScRangeListRef& rRangeList );
1014cdf0e10cSrcweir 
1015cdf0e10cSrcweir 	sal_Bool			InsertRow( SCCOL nStartCol, SCTAB nStartTab,
1016cdf0e10cSrcweir 							   SCCOL nEndCol,   SCTAB nEndTab,
1017cdf0e10cSrcweir                                SCROW nStartRow, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL,
1018cdf0e10cSrcweir                                const ScMarkData* pTabMark = NULL );
1019cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			InsertRow( const ScRange& rRange, ScDocument* pRefUndoDoc = NULL );
1020cdf0e10cSrcweir 	void			DeleteRow( SCCOL nStartCol, SCTAB nStartTab,
1021cdf0e10cSrcweir 							   SCCOL nEndCol,   SCTAB nEndTab,
1022cdf0e10cSrcweir 							   SCROW nStartRow, SCSIZE nSize,
1023cdf0e10cSrcweir                                ScDocument* pRefUndoDoc = NULL, sal_Bool* pUndoOutline = NULL,
1024cdf0e10cSrcweir                                const ScMarkData* pTabMark = NULL );
1025cdf0e10cSrcweir 	void			DeleteRow( const ScRange& rRange,
1026cdf0e10cSrcweir 							   ScDocument* pRefUndoDoc = NULL, sal_Bool* pUndoOutline = NULL );
1027cdf0e10cSrcweir 	sal_Bool			InsertCol( SCROW nStartRow, SCTAB nStartTab,
1028cdf0e10cSrcweir 							   SCROW nEndRow,   SCTAB nEndTab,
1029cdf0e10cSrcweir                                SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL,
1030cdf0e10cSrcweir                                const ScMarkData* pTabMark = NULL );
1031cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			InsertCol( const ScRange& rRange, ScDocument* pRefUndoDoc = NULL );
1032cdf0e10cSrcweir 	void			DeleteCol( SCROW nStartRow, SCTAB nStartTab,
1033cdf0e10cSrcweir 							   SCROW nEndRow, SCTAB nEndTab,
1034cdf0e10cSrcweir 							   SCCOL nStartCol, SCSIZE nSize,
1035cdf0e10cSrcweir                                ScDocument* pRefUndoDoc = NULL, sal_Bool* pUndoOutline = NULL,
1036cdf0e10cSrcweir                                const ScMarkData* pTabMark = NULL );
1037cdf0e10cSrcweir 	void			DeleteCol( const ScRange& rRange,
1038cdf0e10cSrcweir 							   ScDocument* pRefUndoDoc = NULL, sal_Bool* pUndoOutline = NULL );
1039cdf0e10cSrcweir 
1040cdf0e10cSrcweir 	sal_Bool			CanInsertRow( const ScRange& rRange ) const;
1041cdf0e10cSrcweir 	sal_Bool			CanInsertCol( const ScRange& rRange ) const;
1042cdf0e10cSrcweir 
1043cdf0e10cSrcweir 	void			FitBlock( const ScRange& rOld, const ScRange& rNew, sal_Bool bClear = sal_True );
1044cdf0e10cSrcweir 	sal_Bool			CanFitBlock( const ScRange& rOld, const ScRange& rNew );
1045cdf0e10cSrcweir 
1046cdf0e10cSrcweir 	sal_Bool			IsClipOrUndo() const 						{ return bIsClip || bIsUndo; }
1047cdf0e10cSrcweir 	sal_Bool			IsUndo() const								{ return bIsUndo; }
1048cdf0e10cSrcweir 	sal_Bool			IsClipboard() const 						{ return bIsClip; }
1049cdf0e10cSrcweir 	bool			IsUndoEnabled() const						{ return mbUndoEnabled; }
1050cdf0e10cSrcweir 	void            EnableUndo( bool bVal );
1051cdf0e10cSrcweir 
1052cdf0e10cSrcweir     bool            IsAdjustHeightEnabled() const               { return mbAdjustHeightEnabled; }
1053cdf0e10cSrcweir     void            EnableAdjustHeight( bool bVal )             { mbAdjustHeightEnabled = bVal; }
1054cdf0e10cSrcweir     bool            IsExecuteLinkEnabled() const                { return mbExecuteLinkEnabled; }
1055cdf0e10cSrcweir     void            EnableExecuteLink( bool bVal )              { mbExecuteLinkEnabled = bVal; }
1056cdf0e10cSrcweir     bool            IsChangeReadOnlyEnabled() const             { return mbChangeReadOnlyEnabled; }
1057cdf0e10cSrcweir     void            EnableChangeReadOnly( bool bVal )           { mbChangeReadOnlyEnabled = bVal; }
1058cdf0e10cSrcweir     SC_DLLPUBLIC sal_Int16       GetNamedRangesLockCount() const             { return mnNamedRangesLockCount; }
1059cdf0e10cSrcweir     void            SetNamedRangesLockCount( sal_Int16 nCount ) { mnNamedRangesLockCount = nCount; }
1060cdf0e10cSrcweir     SC_DLLPUBLIC void			ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks );
1061cdf0e10cSrcweir 	SC_DLLPUBLIC void			ResetClip( ScDocument* pSourceDoc, SCTAB nTab );
1062cdf0e10cSrcweir 	void			SetCutMode( sal_Bool bCut );
1063cdf0e10cSrcweir 	sal_Bool			IsCutMode();
1064cdf0e10cSrcweir 	void			SetClipArea( const ScRange& rArea, sal_Bool bCut = sal_False );
1065cdf0e10cSrcweir 
1066cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			IsDocVisible() const						{ return bIsVisible; }
1067cdf0e10cSrcweir 	void			SetDocVisible( sal_Bool bSet );
1068cdf0e10cSrcweir 
1069cdf0e10cSrcweir 	sal_Bool			HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* pTabMark = NULL );
1070cdf0e10cSrcweir 
1071cdf0e10cSrcweir 	void			DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1072cdf0e10cSrcweir 										const ScMarkData& rMark );
1073cdf0e10cSrcweir 	void			DeleteObjectsInSelection( const ScMarkData& rMark );
1074cdf0e10cSrcweir 
1075cdf0e10cSrcweir 	void			DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1076cdf0e10cSrcweir 							const ScMarkData& rMark, sal_uInt16 nDelFlag);
1077cdf0e10cSrcweir 	void			DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1078cdf0e10cSrcweir 								SCTAB nTab, sal_uInt16 nDelFlag);
1079cdf0e10cSrcweir 	void			DeleteAreaTab(const ScRange& rRange, sal_uInt16 nDelFlag);
1080cdf0e10cSrcweir 
1081cdf0e10cSrcweir     void            CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc,
1082cdf0e10cSrcweir                                const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false,
1083cdf0e10cSrcweir                                bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
1084cdf0e10cSrcweir 
1085cdf0e10cSrcweir     void			CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1086cdf0e10cSrcweir                                 SCTAB nTab, ScDocument* pClipDoc = NULL);
1087cdf0e10cSrcweir 	void 			CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1088cdf0e10cSrcweir 									const ScMarkData& rMark, SCsCOL nDx, SCsROW nDy,
1089cdf0e10cSrcweir 									const ScCopyBlockFromClipParams* pCBFCP );
1090cdf0e10cSrcweir 	void 			CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1091cdf0e10cSrcweir 									const ScMarkData& rMark, SCsCOL nDx, SCsROW nDy,
1092cdf0e10cSrcweir 									const ScCopyBlockFromClipParams* pCBFCP,
1093cdf0e10cSrcweir                                     SCROW & rClipStartRow );
1094cdf0e10cSrcweir 	void 			StartListeningFromClip( SCCOL nCol1, SCROW nRow1,
1095cdf0e10cSrcweir 										SCCOL nCol2, SCROW nRow2,
1096cdf0e10cSrcweir 										const ScMarkData& rMark, sal_uInt16 nInsFlag );
1097cdf0e10cSrcweir 	void 			BroadcastFromClip( SCCOL nCol1, SCROW nRow1,
1098cdf0e10cSrcweir 									SCCOL nCol2, SCROW nRow2,
1099cdf0e10cSrcweir 									const ScMarkData& rMark, sal_uInt16 nInsFlag );
1100cdf0e10cSrcweir     /** If pDestRanges is given it overrides rDestRange, rDestRange in this
1101cdf0e10cSrcweir         case is the overall encompassing range. */
1102cdf0e10cSrcweir 	void			CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMark,
1103cdf0e10cSrcweir 									sal_uInt16 nInsFlag,
1104cdf0e10cSrcweir 									ScDocument* pRefUndoDoc = NULL,
1105cdf0e10cSrcweir 									ScDocument* pClipDoc = NULL,
1106cdf0e10cSrcweir 									sal_Bool bResetCut = sal_True,
1107cdf0e10cSrcweir 									sal_Bool bAsLink = sal_False,
1108cdf0e10cSrcweir 									sal_Bool bIncludeFiltered = sal_True,
1109cdf0e10cSrcweir 									sal_Bool bSkipAttrForEmpty = sal_False,
1110cdf0e10cSrcweir                                     const ScRangeList * pDestRanges = NULL );
1111cdf0e10cSrcweir 
1112cdf0e10cSrcweir     void            CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark,
1113cdf0e10cSrcweir                                            sal_uInt16 nInsFlag, ScDocument* pClipDoc,
1114cdf0e10cSrcweir                                            bool bResetCut = true, bool bAsLink = false,
1115cdf0e10cSrcweir                                            bool bIncludeFiltered = true,
1116cdf0e10cSrcweir                                            bool bSkipAttrForEmpty = false);
1117cdf0e10cSrcweir 
1118cdf0e10cSrcweir 	void			GetClipArea(SCCOL& nClipX, SCROW& nClipY, sal_Bool bIncludeFiltered);
1119cdf0e10cSrcweir 	void			GetClipStart(SCCOL& nClipX, SCROW& nClipY);
1120cdf0e10cSrcweir 
1121cdf0e10cSrcweir 	sal_Bool			HasClipFilteredRows();
1122cdf0e10cSrcweir 
1123cdf0e10cSrcweir 	sal_Bool			IsClipboardSource() const;
1124cdf0e10cSrcweir 
1125cdf0e10cSrcweir 	SC_DLLPUBLIC void			TransposeClip( ScDocument* pTransClip, sal_uInt16 nFlags, sal_Bool bAsLink );
1126cdf0e10cSrcweir 
1127cdf0e10cSrcweir     ScClipParam&    GetClipParam();
1128cdf0e10cSrcweir     void            SetClipParam(const ScClipParam& rParam);
1129cdf0e10cSrcweir 
1130cdf0e10cSrcweir 	void			MixDocument( const ScRange& rRange, sal_uInt16 nFunction, sal_Bool bSkipEmpty,
1131cdf0e10cSrcweir 									ScDocument* pSrcDoc );
1132cdf0e10cSrcweir 
1133cdf0e10cSrcweir 	void			FillTab( const ScRange& rSrcArea, const ScMarkData& rMark,
1134cdf0e10cSrcweir 								sal_uInt16 nFlags, sal_uInt16 nFunction,
1135cdf0e10cSrcweir 								sal_Bool bSkipEmpty, sal_Bool bAsLink );
1136cdf0e10cSrcweir 	void			FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark,
1137cdf0e10cSrcweir 								sal_uInt16 nFlags, sal_uInt16 nFunction,
1138cdf0e10cSrcweir 								sal_Bool bSkipEmpty, sal_Bool bAsLink );
1139cdf0e10cSrcweir 
1140cdf0e10cSrcweir 	void			TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType );
1141cdf0e10cSrcweir 
1142cdf0e10cSrcweir 	SC_DLLPUBLIC void			InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
1143cdf0e10cSrcweir 								sal_Bool bColInfo = sal_False, sal_Bool bRowInfo = sal_False );
1144cdf0e10cSrcweir 	void			AddUndoTab( SCTAB nTab1, SCTAB nTab2,
1145cdf0e10cSrcweir 								sal_Bool bColInfo = sal_False, sal_Bool bRowInfo = sal_False );
1146cdf0e10cSrcweir 	SC_DLLPUBLIC void			InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSelection,
1147cdf0e10cSrcweir 								sal_Bool bColInfo = sal_False, sal_Bool bRowInfo = sal_False );
1148cdf0e10cSrcweir 
1149cdf0e10cSrcweir 					//	nicht mehr benutzen:
1150cdf0e10cSrcweir 	void			CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
1151cdf0e10cSrcweir 								SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
1152cdf0e10cSrcweir 								sal_uInt16 nFlags, sal_Bool bMarked, ScDocument* pDestDoc,
1153cdf0e10cSrcweir 								const ScMarkData* pMarks = NULL, sal_Bool bColRowFlags = sal_True);
1154cdf0e10cSrcweir 	void			UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
1155cdf0e10cSrcweir 								SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
1156cdf0e10cSrcweir 								sal_uInt16 nFlags, sal_Bool bMarked, ScDocument* pDestDoc,
1157cdf0e10cSrcweir 								const ScMarkData* pMarks = NULL);
1158cdf0e10cSrcweir 
1159cdf0e10cSrcweir 	void			CopyToDocument(const ScRange& rRange,
1160cdf0e10cSrcweir 								sal_uInt16 nFlags, sal_Bool bMarked, ScDocument* pDestDoc,
1161cdf0e10cSrcweir 								const ScMarkData* pMarks = NULL, sal_Bool bColRowFlags = sal_True);
1162cdf0e10cSrcweir 	void			UndoToDocument(const ScRange& rRange,
1163cdf0e10cSrcweir 								sal_uInt16 nFlags, sal_Bool bMarked, ScDocument* pDestDoc,
1164cdf0e10cSrcweir 								const ScMarkData* pMarks = NULL);
1165cdf0e10cSrcweir 
1166cdf0e10cSrcweir 	void			CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bNewScenario = sal_False );
1167cdf0e10cSrcweir 	sal_Bool			TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const;
1168cdf0e10cSrcweir 	void			MarkScenario( SCTAB nSrcTab, SCTAB nDestTab,
1169cdf0e10cSrcweir 									ScMarkData& rDestMark, sal_Bool bResetMark = sal_True,
1170cdf0e10cSrcweir 									sal_uInt16 nNeededBits = 0 ) const;
1171cdf0e10cSrcweir 	sal_Bool			HasScenarioRange( SCTAB nTab, const ScRange& rRange ) const;
1172cdf0e10cSrcweir 	SC_DLLPUBLIC const ScRangeList* GetScenarioRanges( SCTAB nTab ) const;
1173cdf0e10cSrcweir 
1174cdf0e10cSrcweir 	SC_DLLPUBLIC void			CopyUpdated( ScDocument* pPosDoc, ScDocument* pDestDoc );
1175cdf0e10cSrcweir 
1176cdf0e10cSrcweir 	void			UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
1177cdf0e10cSrcweir 									 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
1178cdf0e10cSrcweir 									 SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
1179cdf0e10cSrcweir 									 ScDocument* pUndoDoc = NULL, sal_Bool bIncludeDraw = sal_True,
1180cdf0e10cSrcweir                                      bool bUpdateNoteCaptionPos = true );
1181cdf0e10cSrcweir 
1182cdf0e10cSrcweir 	SC_DLLPUBLIC void			UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDoc,
1183cdf0e10cSrcweir 										const ScMarkData& rMark, ScDocument* pUndoDoc = NULL );
1184cdf0e10cSrcweir 
1185cdf0e10cSrcweir 	void			UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
1186cdf0e10cSrcweir 
1187cdf0e10cSrcweir 	void			Fill(	SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1188cdf0e10cSrcweir 							const ScMarkData& rMark,
1189cdf0e10cSrcweir 							sal_uLong nFillCount, FillDir eFillDir = FILL_TO_BOTTOM,
1190cdf0e10cSrcweir 							FillCmd eFillCmd = FILL_LINEAR, FillDateCmd eFillDateCmd = FILL_DAY,
1191cdf0e10cSrcweir 							double nStepValue = 1.0, double nMaxValue = 1E307);
1192cdf0e10cSrcweir 	String			GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY );
1193cdf0e10cSrcweir 
1194cdf0e10cSrcweir 	sal_Bool			GetSelectionFunction( ScSubTotalFunc eFunc,
1195cdf0e10cSrcweir 											const ScAddress& rCursor, const ScMarkData& rMark,
1196cdf0e10cSrcweir 											double& rResult );
1197cdf0e10cSrcweir 
1198cdf0e10cSrcweir 	SC_DLLPUBLIC const SfxPoolItem* 		GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const;
1199cdf0e10cSrcweir 	SC_DLLPUBLIC const ScPatternAttr*	GetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
1200cdf0e10cSrcweir     SC_DLLPUBLIC const ScPatternAttr*    GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const;
1201cdf0e10cSrcweir 	const ScPatternAttr*	GetSelectionPattern( const ScMarkData& rMark, sal_Bool bDeep = sal_True );
1202cdf0e10cSrcweir 	ScPatternAttr*			CreateSelectionPattern( const ScMarkData& rMark, sal_Bool bDeep = sal_True );
1203cdf0e10cSrcweir 
1204cdf0e10cSrcweir 	const ScConditionalFormat* GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
1205cdf0e10cSrcweir 	SC_DLLPUBLIC const SfxItemSet*	GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
1206cdf0e10cSrcweir 	const SfxPoolItem*	GetEffItem( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const;
1207cdf0e10cSrcweir 
1208cdf0e10cSrcweir     SC_DLLPUBLIC const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator();
1209cdf0e10cSrcweir 	sal_Bool			HasStringWeakCharacters( const String& rString );
1210cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt8			GetStringScriptType( const String& rString );
1211cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt8			GetCellScriptType( ScBaseCell* pCell, sal_uLong nNumberFormat );
1212cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt8			GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell = NULL );
1213cdf0e10cSrcweir 
1214cdf0e10cSrcweir 	sal_Bool			HasDetectiveOperations() const;
1215cdf0e10cSrcweir 	void			AddDetectiveOperation( const ScDetOpData& rData );
1216cdf0e10cSrcweir 	void			ClearDetectiveOperations();
1217cdf0e10cSrcweir 	ScDetOpList*	GetDetOpList() const				{ return pDetOpList; }
1218cdf0e10cSrcweir 	void			SetDetOpList(ScDetOpList* pNew);
1219cdf0e10cSrcweir 
1220cdf0e10cSrcweir 	sal_Bool			HasDetectiveObjects(SCTAB nTab) const;
1221cdf0e10cSrcweir 
1222cdf0e10cSrcweir 	void			GetSelectionFrame( const ScMarkData& rMark,
1223cdf0e10cSrcweir 									   SvxBoxItem&		rLineOuter,
1224cdf0e10cSrcweir 									   SvxBoxInfoItem&	rLineInner );
1225cdf0e10cSrcweir 	void			ApplySelectionFrame( const ScMarkData& rMark,
1226cdf0e10cSrcweir 										 const SvxBoxItem* pLineOuter,
1227cdf0e10cSrcweir 										 const SvxBoxInfoItem* pLineInner );
1228cdf0e10cSrcweir 	void			ApplyFrameAreaTab( const ScRange& rRange,
1229cdf0e10cSrcweir 										 const SvxBoxItem* pLineOuter,
1230cdf0e10cSrcweir 										 const SvxBoxInfoItem* pLineInner );
1231cdf0e10cSrcweir 
1232cdf0e10cSrcweir 	void			ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
1233cdf0e10cSrcweir 	void			ChangeSelectionIndent( sal_Bool bIncrement, const ScMarkData& rMark );
1234cdf0e10cSrcweir 
1235cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uLong			AddCondFormat( const ScConditionalFormat& rNew );
1236cdf0e10cSrcweir 	SC_DLLPUBLIC void			FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges );
1237cdf0e10cSrcweir 	SC_DLLPUBLIC void			FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab );
1238cdf0e10cSrcweir 	void			ConditionalChanged( sal_uLong nKey );
1239cdf0e10cSrcweir 
1240cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uLong			AddValidationEntry( const ScValidationData& rNew );
1241cdf0e10cSrcweir 
1242cdf0e10cSrcweir 	SC_DLLPUBLIC const ScValidationData*	GetValidationEntry( sal_uLong nIndex ) const;
1243cdf0e10cSrcweir 
1244cdf0e10cSrcweir 	ScConditionalFormatList* GetCondFormList() const		// Ref-Undo
1245cdf0e10cSrcweir 					{ return pCondFormList; }
1246cdf0e10cSrcweir 	void			SetCondFormList(ScConditionalFormatList* pNew);
1247cdf0e10cSrcweir 
1248cdf0e10cSrcweir 	ScValidationDataList* GetValidationList() const
1249cdf0e10cSrcweir 					{ return pValidationList; }
1250cdf0e10cSrcweir 
1251cdf0e10cSrcweir 	SC_DLLPUBLIC void			ApplyAttr( SCCOL nCol, SCROW nRow, SCTAB nTab,
1252cdf0e10cSrcweir 								const SfxPoolItem& rAttr );
1253cdf0e10cSrcweir 	SC_DLLPUBLIC void			ApplyPattern( SCCOL nCol, SCROW nRow, SCTAB nTab,
1254cdf0e10cSrcweir 									const ScPatternAttr& rAttr );
1255cdf0e10cSrcweir 	SC_DLLPUBLIC void			ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow,
1256cdf0e10cSrcweir 										SCCOL nEndCol, SCROW nEndRow,
1257cdf0e10cSrcweir 										const ScMarkData& rMark, const ScPatternAttr& rAttr );
1258cdf0e10cSrcweir 	SC_DLLPUBLIC void			ApplyPatternAreaTab( SCCOL nStartCol, SCROW nStartRow,
1259cdf0e10cSrcweir 											SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
1260cdf0e10cSrcweir 											const ScPatternAttr& rAttr );
12613a02adb1SWang Lei 	SC_DLLPUBLIC void			ApplyPooledPatternAreaTab( SCCOL nStartCol, SCROW nStartRow,
12623a02adb1SWang Lei 											SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
12633a02adb1SWang Lei 											const ScPatternAttr& rPooledAttr, const ScPatternAttr& rAttr );
1264cdf0e10cSrcweir 	SC_DLLPUBLIC void			ApplyPatternIfNumberformatIncompatible(
1265cdf0e10cSrcweir 							const ScRange& rRange, const ScMarkData& rMark,
1266cdf0e10cSrcweir 							const ScPatternAttr& rPattern, short nNewType );
1267cdf0e10cSrcweir 
1268cdf0e10cSrcweir 	void			ApplyStyle( SCCOL nCol, SCROW nRow, SCTAB nTab,
1269cdf0e10cSrcweir 								const ScStyleSheet& rStyle);
1270cdf0e10cSrcweir 	void			ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow,
1271cdf0e10cSrcweir 									SCCOL nEndCol, SCROW nEndRow,
1272cdf0e10cSrcweir 									const ScMarkData& rMark, const ScStyleSheet& rStyle);
1273cdf0e10cSrcweir 	SC_DLLPUBLIC void			ApplyStyleAreaTab( SCCOL nStartCol, SCROW nStartRow,
1274cdf0e10cSrcweir 										SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
1275cdf0e10cSrcweir 										const ScStyleSheet& rStyle);
1276cdf0e10cSrcweir 
1277cdf0e10cSrcweir 	void			ApplySelectionStyle( const ScStyleSheet& rStyle, const ScMarkData& rMark );
1278cdf0e10cSrcweir 	void			ApplySelectionLineStyle( const ScMarkData& rMark,
1279cdf0e10cSrcweir 											const SvxBorderLine* pLine, sal_Bool bColorOnly );
1280cdf0e10cSrcweir 
1281cdf0e10cSrcweir 	const ScStyleSheet*	GetStyle( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
1282cdf0e10cSrcweir 	const ScStyleSheet*	GetSelectionStyle( const ScMarkData& rMark ) const;
1283cdf0e10cSrcweir 
1284cdf0e10cSrcweir 	void			StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, sal_Bool bRemoved,
1285cdf0e10cSrcweir 										OutputDevice* pDev,
1286cdf0e10cSrcweir 										double nPPTX, double nPPTY,
1287cdf0e10cSrcweir 										const Fraction& rZoomX, const Fraction& rZoomY );
1288cdf0e10cSrcweir 
1289cdf0e10cSrcweir 	sal_Bool			IsStyleSheetUsed( const ScStyleSheet& rStyle, sal_Bool bGatherAllStyles ) const;
1290cdf0e10cSrcweir 
1291cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow,
1292cdf0e10cSrcweir 											SCCOL nEndCol, SCROW nEndRow,
1293cdf0e10cSrcweir 											SCTAB nTab, sal_Int16 nFlags );
1294cdf0e10cSrcweir 	sal_Bool			RemoveFlagsTab( SCCOL nStartCol, SCROW nStartRow,
1295cdf0e10cSrcweir 											SCCOL nEndCol, SCROW nEndRow,
1296cdf0e10cSrcweir 											SCTAB nTab, sal_Int16 nFlags );
1297cdf0e10cSrcweir 
1298cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetPattern( const ScAddress&, const ScPatternAttr& rAttr,
1299cdf0e10cSrcweir 									sal_Bool bPutToPool = sal_False );
1300cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr& rAttr,
1301cdf0e10cSrcweir 									sal_Bool bPutToPool = sal_False );
1302cdf0e10cSrcweir 	void            DeleteNumberFormat( const sal_uInt32* pDelKeys, sal_uInt32 nCount );
1303cdf0e10cSrcweir 
1304cdf0e10cSrcweir 	void			AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
1305cdf0e10cSrcweir 									sal_uInt16 nFormatNo, const ScMarkData& rMark );
1306cdf0e10cSrcweir 	void			GetAutoFormatData( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
1307cdf0e10cSrcweir 										ScAutoFormatData& rData );
1308cdf0e10cSrcweir 	sal_Bool			SearchAndReplace( const SvxSearchItem& rSearchItem,
1309cdf0e10cSrcweir 										SCCOL& rCol, SCROW& rRow, SCTAB& rTab,
1310cdf0e10cSrcweir 										ScMarkData& rMark,
1311cdf0e10cSrcweir 										String& rUndoStr, ScDocument* pUndoDoc = NULL );
1312cdf0e10cSrcweir 
1313cdf0e10cSrcweir 					// Col/Row von Folgeaufrufen bestimmen
1314cdf0e10cSrcweir 					// (z.B. nicht gefunden von Anfang, oder folgende Tabellen)
1315cdf0e10cSrcweir 	static void		GetSearchAndReplaceStart( const SvxSearchItem& rSearchItem,
1316cdf0e10cSrcweir 						SCCOL& rCol, SCROW& rRow );
1317cdf0e10cSrcweir 
1318cdf0e10cSrcweir 	sal_Bool			Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab,
1319cdf0e10cSrcweir 							SCCOL nVCol, SCROW nVRow, SCTAB nVTab,
1320cdf0e10cSrcweir 							const String& sValStr, double& nX);
1321cdf0e10cSrcweir 
1322cdf0e10cSrcweir 	void			ApplySelectionPattern( const ScPatternAttr& rAttr, const ScMarkData& rMark );
1323cdf0e10cSrcweir     void            DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark );
1324cdf0e10cSrcweir 	void			DeleteSelectionTab( SCTAB nTab, sal_uInt16 nDelFlag, const ScMarkData& rMark );
1325cdf0e10cSrcweir 
1326cdf0e10cSrcweir     SC_DLLPUBLIC void           SetColWidth( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth );
13273ce8cab8SWang Lei 	SC_DLLPUBLIC void			SetColWidthOnly( SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth );
1328cdf0e10cSrcweir     SC_DLLPUBLIC void           SetRowHeight( SCROW nRow, SCTAB nTab, sal_uInt16 nNewHeight );
1329cdf0e10cSrcweir     SC_DLLPUBLIC void           SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, SCTAB nTab,
1330cdf0e10cSrcweir                                             sal_uInt16 nNewHeight );
1331cdf0e10cSrcweir 
1332cdf0e10cSrcweir     SC_DLLPUBLIC void           SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, SCTAB nTab,
1333cdf0e10cSrcweir                                                   sal_uInt16 nNewHeight );
1334cdf0e10cSrcweir     void                        SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bManual );
1335cdf0e10cSrcweir 
1336cdf0e10cSrcweir     SC_DLLPUBLIC sal_uInt16         GetColWidth( SCCOL nCol, SCTAB nTab ) const;
1337cdf0e10cSrcweir     SC_DLLPUBLIC sal_uInt16         GetRowHeight( SCROW nRow, SCTAB nTab, bool bHiddenAsZero = true ) const;
1338cdf0e10cSrcweir     SC_DLLPUBLIC sal_uInt16         GetRowHeight( SCROW nRow, SCTAB nTab, SCROW* pStartRow, SCROW* pEndRow, bool bHiddenAsZero = true ) const;
1339cdf0e10cSrcweir     SC_DLLPUBLIC sal_uLong          GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const;
1340cdf0e10cSrcweir     SCROW                       GetRowForHeight( SCTAB nTab, sal_uLong nHeight ) const;
1341cdf0e10cSrcweir     sal_uLong                       GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const;
1342cdf0e10cSrcweir     SC_DLLPUBLIC sal_uLong          GetColOffset( SCCOL nCol, SCTAB nTab ) const;
1343cdf0e10cSrcweir     SC_DLLPUBLIC sal_uLong          GetRowOffset( SCROW nRow, SCTAB nTab ) const;
1344cdf0e10cSrcweir 
1345cdf0e10cSrcweir     SC_DLLPUBLIC sal_uInt16         GetOriginalWidth( SCCOL nCol, SCTAB nTab ) const;
1346cdf0e10cSrcweir     SC_DLLPUBLIC sal_uInt16         GetOriginalHeight( SCROW nRow, SCTAB nTab ) const;
1347cdf0e10cSrcweir 
1348cdf0e10cSrcweir 	sal_uInt16			GetCommonWidth( SCCOL nEndCol, SCTAB nTab ) const;
1349cdf0e10cSrcweir 
1350cdf0e10cSrcweir 	SCROW			GetHiddenRowCount( SCROW nRow, SCTAB nTab ) const;
1351cdf0e10cSrcweir 
1352cdf0e10cSrcweir 	sal_uInt16			GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev,
1353cdf0e10cSrcweir 										double nPPTX, double nPPTY,
1354cdf0e10cSrcweir 										const Fraction& rZoomX, const Fraction& rZoomY,
1355cdf0e10cSrcweir 										sal_Bool bFormula,
1356cdf0e10cSrcweir 										const ScMarkData* pMarkData = NULL,
1357cdf0e10cSrcweir 										sal_Bool bSimpleTextImport = sal_False );
1358cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nExtra,
1359cdf0e10cSrcweir 										OutputDevice* pDev,
1360cdf0e10cSrcweir 										double nPPTX, double nPPTY,
1361cdf0e10cSrcweir 										const Fraction& rZoomX, const Fraction& rZoomY,
1362cdf0e10cSrcweir 										sal_Bool bShrink );
1363cdf0e10cSrcweir     void            UpdateAllRowHeights( OutputDevice* pDev,
1364cdf0e10cSrcweir                                         double nPPTX, double nPPTY,
1365cdf0e10cSrcweir                                         const Fraction& rZoomX, const Fraction& rZoomY,
1366cdf0e10cSrcweir                                         const ScMarkData* pTabMark = NULL );
1367cdf0e10cSrcweir 	long			GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab,
1368cdf0e10cSrcweir 									OutputDevice* pDev,
1369cdf0e10cSrcweir 									double nPPTX, double nPPTY,
1370cdf0e10cSrcweir 									const Fraction& rZoomX, const Fraction& rZoomY,
1371cdf0e10cSrcweir 									sal_Bool bWidth, sal_Bool bTotalSize = sal_False );
1372cdf0e10cSrcweir 
1373cdf0e10cSrcweir 	SC_DLLPUBLIC void			ShowCol(SCCOL nCol, SCTAB nTab, sal_Bool bShow);
1374cdf0e10cSrcweir 	SC_DLLPUBLIC void			ShowRow(SCROW nRow, SCTAB nTab, sal_Bool bShow);
1375cdf0e10cSrcweir 	SC_DLLPUBLIC void			ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, sal_Bool bShow);
1376cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetColFlags( SCCOL nCol, SCTAB nTab, sal_uInt8 nNewFlags );
1377cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetRowFlags( SCROW nRow, SCTAB nTab, sal_uInt8 nNewFlags );
1378cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetRowFlags( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt8 nNewFlags );
1379cdf0e10cSrcweir 
1380cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt8			GetColFlags( SCCOL nCol, SCTAB nTab ) const;
1381cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt8			GetRowFlags( SCROW nRow, SCTAB nTab ) const;
1382cdf0e10cSrcweir 
1383cdf0e10cSrcweir     SC_DLLPUBLIC const ScBitMaskCompressedArray< SCROW, sal_uInt8> & GetRowFlagsArray( SCTAB nTab ) const;
1384cdf0e10cSrcweir     SC_DLLPUBLIC       ScBitMaskCompressedArray< SCROW, sal_uInt8> & GetRowFlagsArrayModifiable( SCTAB nTab );
1385cdf0e10cSrcweir 
1386cdf0e10cSrcweir     SC_DLLPUBLIC void           GetAllRowBreaks(::std::set<SCROW>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const;
1387cdf0e10cSrcweir     SC_DLLPUBLIC void           GetAllColBreaks(::std::set<SCCOL>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const;
1388cdf0e10cSrcweir     SC_DLLPUBLIC ScBreakType    HasRowBreak(SCROW nRow, SCTAB nTab) const;
1389cdf0e10cSrcweir     SC_DLLPUBLIC ScBreakType    HasColBreak(SCCOL nCol, SCTAB nTab) const;
1390cdf0e10cSrcweir     SC_DLLPUBLIC void           SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual);
1391cdf0e10cSrcweir     SC_DLLPUBLIC void           SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual);
1392cdf0e10cSrcweir     void                        RemoveRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual);
1393cdf0e10cSrcweir     void                        RemoveColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual);
1394cdf0e10cSrcweir     ::com::sun::star::uno::Sequence<
1395cdf0e10cSrcweir         ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const;
1396cdf0e10cSrcweir 
1397cdf0e10cSrcweir     SC_DLLPUBLIC bool           RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL);
1398cdf0e10cSrcweir     SC_DLLPUBLIC bool           RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow);
1399cdf0e10cSrcweir     SC_DLLPUBLIC bool           HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1400cdf0e10cSrcweir     SC_DLLPUBLIC bool           ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol);
1401cdf0e10cSrcweir     SC_DLLPUBLIC bool           ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL);
1402cdf0e10cSrcweir     SC_DLLPUBLIC void           SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden);
1403cdf0e10cSrcweir     SC_DLLPUBLIC void           SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden);
1404cdf0e10cSrcweir     SC_DLLPUBLIC SCROW          FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1405cdf0e10cSrcweir     SC_DLLPUBLIC SCROW          LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1406cdf0e10cSrcweir     SCROW                       CountVisibleRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1407cdf0e10cSrcweir 
1408cdf0e10cSrcweir     bool                        RowFiltered(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL);
1409cdf0e10cSrcweir     bool                        HasFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1410cdf0e10cSrcweir     bool                        ColFiltered(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL);
1411cdf0e10cSrcweir     SC_DLLPUBLIC void           SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bFiltered);
1412cdf0e10cSrcweir     SC_DLLPUBLIC void           SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bFiltered);
1413cdf0e10cSrcweir     SCROW                       FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1414cdf0e10cSrcweir     SCROW                       LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1415cdf0e10cSrcweir     SCROW                       CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
1416cdf0e10cSrcweir 
1417cdf0e10cSrcweir     /**
1418cdf0e10cSrcweir      * Write all column row flags to table's flag data, because not all column
1419cdf0e10cSrcweir      * row attributes are stored in the flag data members.  This is necessary
1420cdf0e10cSrcweir      * for ods export.
1421cdf0e10cSrcweir      */
1422cdf0e10cSrcweir     void                        SyncColRowFlags();
1423cdf0e10cSrcweir 
1424cdf0e10cSrcweir                     /// @return  the index of the last row with any set flags (auto-pagebreak is ignored).
1425cdf0e10cSrcweir 	SC_DLLPUBLIC SCROW			GetLastFlaggedRow( SCTAB nTab ) const;
1426cdf0e10cSrcweir 
1427cdf0e10cSrcweir                     /// @return  the index of the last changed column (flags and column width, auto pagebreak is ignored).
1428cdf0e10cSrcweir     SCCOL           GetLastChangedCol( SCTAB nTab ) const;
1429cdf0e10cSrcweir                     /// @return  the index of the last changed row (flags and row height, auto pagebreak is ignored).
1430cdf0e10cSrcweir     SCROW           GetLastChangedRow( SCTAB nTab ) const;
1431cdf0e10cSrcweir 
1432cdf0e10cSrcweir     SCCOL           GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) const;
1433cdf0e10cSrcweir 
1434cdf0e10cSrcweir 					// #108550#; if bCareManualSize is set then the row
1435cdf0e10cSrcweir 					// heights are compared only if the manual size flag for
1436cdf0e10cSrcweir 					// the row is set. If the bCareManualSize is not set then
1437cdf0e10cSrcweir 					// the row heights are always compared.
1438cdf0e10cSrcweir     SCROW           GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool bCareManualSize = true) const;
1439cdf0e10cSrcweir 
1440cdf0e10cSrcweir     // returns whether to export a Default style for this col/row or not
1441cdf0e10cSrcweir 	// nDefault is setted to one possition in the current row/col where the Default style is
1442cdf0e10cSrcweir 	sal_Bool			GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault);
1443cdf0e10cSrcweir 	sal_Bool			GetRowDefault( SCTAB nTab, SCROW nRow, SCCOL nLastCol, SCCOL& nDefault);
1444cdf0e10cSrcweir 
1445cdf0e10cSrcweir 	sal_Bool			UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, sal_Bool bShow );
1446cdf0e10cSrcweir 	sal_Bool			UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_Bool bShow );
1447cdf0e10cSrcweir 
1448cdf0e10cSrcweir 	void			StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, SCTAB nTab );
1449cdf0e10cSrcweir 	void			ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2, SCTAB nTab );
1450cdf0e10cSrcweir 
1451cdf0e10cSrcweir 	SC_DLLPUBLIC ScPatternAttr*		GetDefPattern() const;
1452cdf0e10cSrcweir 	SC_DLLPUBLIC ScDocumentPool*		GetPool();
1453cdf0e10cSrcweir 	SC_DLLPUBLIC ScStyleSheetPool*	GetStyleSheetPool() const;
1454cdf0e10cSrcweir 
1455cdf0e10cSrcweir 	// PageStyle:
1456cdf0e10cSrcweir 	SC_DLLPUBLIC const String&	GetPageStyle( SCTAB nTab ) const;
1457cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetPageStyle( SCTAB nTab, const String& rName );
1458cdf0e10cSrcweir 	Size			GetPageSize( SCTAB nTab ) const;
1459cdf0e10cSrcweir 	void			SetPageSize( SCTAB nTab, const Size& rSize );
1460cdf0e10cSrcweir 	void			SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
1461cdf0e10cSrcweir     void            InvalidatePageBreaks(SCTAB nTab);
1462cdf0e10cSrcweir 	void			UpdatePageBreaks( SCTAB nTab, const ScRange* pUserArea = NULL );
1463cdf0e10cSrcweir 	void			RemoveManualBreaks( SCTAB nTab );
1464cdf0e10cSrcweir 	sal_Bool			HasManualBreaks( SCTAB nTab ) const;
1465cdf0e10cSrcweir 
1466cdf0e10cSrcweir 	sal_Bool			IsPageStyleInUse( const String& rStrPageStyle, SCTAB* pInTab = NULL );
1467cdf0e10cSrcweir 	sal_Bool			RemovePageStyleInUse( const String& rStrPageStyle );
1468cdf0e10cSrcweir 	sal_Bool			RenamePageStyleInUse( const String& rOld, const String& rNew );
1469cdf0e10cSrcweir 	void			ModifyStyleSheet( SfxStyleSheetBase& rPageStyle,
1470cdf0e10cSrcweir 									  const SfxItemSet&	 rChanges );
1471cdf0e10cSrcweir 
1472cdf0e10cSrcweir 	void			PageStyleModified( SCTAB nTab, const String& rNewName );
1473cdf0e10cSrcweir 
1474cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			NeedPageResetAfterTab( SCTAB nTab ) const;
1475cdf0e10cSrcweir 
1476cdf0e10cSrcweir 	// war vorher im PageStyle untergracht. Jetzt an jeder Tabelle:
1477cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasPrintRange();
1478cdf0e10cSrcweir 	SC_DLLPUBLIC sal_uInt16			GetPrintRangeCount( SCTAB nTab );
1479cdf0e10cSrcweir 	SC_DLLPUBLIC const ScRange*	GetPrintRange( SCTAB nTab, sal_uInt16 nPos );
1480cdf0e10cSrcweir 	SC_DLLPUBLIC const ScRange*	GetRepeatColRange( SCTAB nTab );
1481cdf0e10cSrcweir 	SC_DLLPUBLIC const ScRange*	GetRepeatRowRange( SCTAB nTab );
1482cdf0e10cSrcweir     /** Returns true, if the specified sheet is always printed. */
1483cdf0e10cSrcweir     sal_Bool            IsPrintEntireSheet( SCTAB nTab ) const;
1484cdf0e10cSrcweir 
1485cdf0e10cSrcweir     /** Removes all print ranges. */
1486cdf0e10cSrcweir     SC_DLLPUBLIC void            ClearPrintRanges( SCTAB nTab );
1487cdf0e10cSrcweir     /** Adds a new print ranges. */
1488cdf0e10cSrcweir     SC_DLLPUBLIC void            AddPrintRange( SCTAB nTab, const ScRange& rNew );
1489cdf0e10cSrcweir //UNUSED2009-05 /** Removes all old print ranges and sets the passed print ranges. */
1490cdf0e10cSrcweir //UNUSED2009-05 void            SetPrintRange( SCTAB nTab, const ScRange& rNew );
1491cdf0e10cSrcweir     /** Marks the specified sheet to be printed completely. Deletes old print ranges on the sheet! */
1492cdf0e10cSrcweir     SC_DLLPUBLIC void            SetPrintEntireSheet( SCTAB nTab );
1493cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetRepeatColRange( SCTAB nTab, const ScRange* pNew );
1494cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetRepeatRowRange( SCTAB nTab, const ScRange* pNew );
1495cdf0e10cSrcweir 	ScPrintRangeSaver* CreatePrintRangeSaver() const;
1496cdf0e10cSrcweir 	void			RestorePrintRanges( const ScPrintRangeSaver& rSaver );
1497cdf0e10cSrcweir 
1498cdf0e10cSrcweir 	SC_DLLPUBLIC Rectangle		GetMMRect( SCCOL nStartCol, SCROW nStartRow,
1499cdf0e10cSrcweir 								SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
1500cdf0e10cSrcweir 	SC_DLLPUBLIC ScRange			GetRange( SCTAB nTab, const Rectangle& rMMRect );
1501cdf0e10cSrcweir 
1502cdf0e10cSrcweir 	void			UpdStlShtPtrsFrmNms();
1503cdf0e10cSrcweir 	void			StylesToNames();
1504cdf0e10cSrcweir 
1505cdf0e10cSrcweir 	SC_DLLPUBLIC void			CopyStdStylesFrom( ScDocument* pSrcDoc );
1506cdf0e10cSrcweir 
1507cdf0e10cSrcweir 	CharSet			GetSrcCharSet() const	{ return eSrcSet; }
1508cdf0e10cSrcweir 	sal_uLong			GetSrcVersion() const	{ return nSrcVer; }
1509cdf0e10cSrcweir 	SCROW			GetSrcMaxRow() const	{ return nSrcMaxRow; }
1510cdf0e10cSrcweir 
1511cdf0e10cSrcweir 	void			SetSrcCharSet( CharSet eNew )	{ eSrcSet = eNew; }
1512cdf0e10cSrcweir 	void			UpdateFontCharSet();
1513cdf0e10cSrcweir 
1514cdf0e10cSrcweir     void            FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
1515cdf0e10cSrcweir 						SCTAB nTab, double nScaleX, double nScaleY,
1516cdf0e10cSrcweir 						sal_Bool bPageMode, sal_Bool bFormulaMode,
1517cdf0e10cSrcweir 						const ScMarkData* pMarkData = NULL );
1518cdf0e10cSrcweir 
1519cdf0e10cSrcweir 	SC_DLLPUBLIC SvNumberFormatter*	GetFormatTable() const;
1520cdf0e10cSrcweir 
1521cdf0e10cSrcweir 	void			Sort( SCTAB nTab, const ScSortParam& rSortParam, sal_Bool bKeepQuery );
1522cdf0e10cSrcweir 	SCSIZE			Query( SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool bKeepSub );
1523cdf0e10cSrcweir 	sal_Bool			ValidQuery( SCROW nRow, SCTAB nTab, const ScQueryParam& rQueryParam, sal_Bool* pSpecial = NULL );
1524cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			CreateQueryParam( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
1525cdf0e10cSrcweir 										SCTAB nTab, ScQueryParam& rQueryParam );
1526cdf0e10cSrcweir 	void 			GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr);
1527cdf0e10cSrcweir 
1528cdf0e10cSrcweir 	sal_Bool			GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
1529cdf0e10cSrcweir                                 bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates);
1530cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow,
1531cdf0e10cSrcweir                                 SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates );
1532cdf0e10cSrcweir 	sal_Bool			GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
1533cdf0e10cSrcweir 								TypedScStrCollection& rStrings, sal_Bool bLimit = sal_False );
1534cdf0e10cSrcweir 	sal_Bool			GetFormulaEntries( TypedScStrCollection& rStrings );
1535cdf0e10cSrcweir 
1536cdf0e10cSrcweir 	sal_Bool			HasAutoFilter( SCCOL nCol, SCROW nRow, SCTAB nTab );
1537cdf0e10cSrcweir 
1538cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
1539cdf0e10cSrcweir 									SCTAB nTab );
1540cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
1541cdf0e10cSrcweir 									SCTAB nTab );
1542cdf0e10cSrcweir 
1543cdf0e10cSrcweir 	SfxPrinter*		GetPrinter( sal_Bool bCreateIfNotExist = sal_True );
1544cdf0e10cSrcweir 	void			SetPrinter( SfxPrinter* pNewPrinter );
1545cdf0e10cSrcweir 	VirtualDevice*	GetVirtualDevice_100th_mm();
1546cdf0e10cSrcweir 	SC_DLLPUBLIC OutputDevice*	GetRefDevice();	// WYSIWYG: Printer, otherwise VirtualDevice...
1547cdf0e10cSrcweir 
1548cdf0e10cSrcweir 	void 			EraseNonUsedSharedNames(sal_uInt16 nLevel);
1549cdf0e10cSrcweir 	sal_Bool			GetNextSpellingCell(SCCOL& nCol, SCROW& nRow, SCTAB nTab,
1550cdf0e10cSrcweir 										sal_Bool bInSel, const ScMarkData& rMark) const;
1551cdf0e10cSrcweir 
1552cdf0e10cSrcweir 	sal_Bool			ReplaceStyle(const SvxSearchItem& rSearchItem,
1553cdf0e10cSrcweir 								 SCCOL nCol, SCROW nRow, SCTAB nTab,
1554cdf0e10cSrcweir 								 ScMarkData& rMark, sal_Bool bIsUndo);
1555cdf0e10cSrcweir 
1556cdf0e10cSrcweir 	void			DoColResize( SCTAB nTab, SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd );
1557cdf0e10cSrcweir 
1558cdf0e10cSrcweir 	void			InvalidateTextWidth( const String& rStyleName );
1559cdf0e10cSrcweir 	void			InvalidateTextWidth( SCTAB nTab );
1560cdf0e10cSrcweir     void            InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, sal_Bool bNumFormatChanged );
1561cdf0e10cSrcweir 
1562cdf0e10cSrcweir 	sal_Bool			IdleCalcTextWidth();
1563cdf0e10cSrcweir 	sal_Bool			IdleCheckLinks();
1564cdf0e10cSrcweir 
1565cdf0e10cSrcweir 	sal_Bool			ContinueOnlineSpelling();	// sal_True = etwas gefunden
1566cdf0e10cSrcweir 
1567cdf0e10cSrcweir     void            RepaintRange( const ScRange& rRange );
1568cdf0e10cSrcweir 
1569cdf0e10cSrcweir 	sal_Bool		IsIdleDisabled() const		{ return bIdleDisabled; }
1570cdf0e10cSrcweir 	void			DisableIdle(sal_Bool bDo)	{ bIdleDisabled = bDo; }
1571cdf0e10cSrcweir 
1572cdf0e10cSrcweir 	sal_Bool			IsDetectiveDirty() const	 { return bDetectiveDirty; }
1573cdf0e10cSrcweir 	void			SetDetectiveDirty(sal_Bool bSet) { bDetectiveDirty = bSet; }
1574cdf0e10cSrcweir 
1575cdf0e10cSrcweir 	void			RemoveAutoSpellObj();
1576cdf0e10cSrcweir 	void			SetOnlineSpellPos( const ScAddress& rPos );
1577cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool			SetVisibleSpellRange( const ScRange& rRange );	// sal_True = changed
1578cdf0e10cSrcweir 
1579cdf0e10cSrcweir 	sal_uInt8			GetMacroCallMode() const	 { return nMacroCallMode; }
1580cdf0e10cSrcweir 	void			SetMacroCallMode(sal_uInt8 nNew)	 { nMacroCallMode = nNew; }
1581cdf0e10cSrcweir 
1582cdf0e10cSrcweir 	sal_Bool			GetHasMacroFunc() const		 { return bHasMacroFunc; }
1583cdf0e10cSrcweir 	void			SetHasMacroFunc(sal_Bool bSet)	 { bHasMacroFunc = bSet; }
1584cdf0e10cSrcweir 
1585cdf0e10cSrcweir 	sal_Bool			CheckMacroWarn();
1586cdf0e10cSrcweir 
1587cdf0e10cSrcweir     void            SetRangeOverflowType(sal_uInt32 nType)  { nRangeOverflowType = nType; }
1588cdf0e10cSrcweir     sal_Bool        HasRangeOverflow() const                { return nRangeOverflowType != 0; }
1589cdf0e10cSrcweir     SC_DLLPUBLIC sal_uInt32      GetRangeOverflowType() const            { return nRangeOverflowType; }
1590cdf0e10cSrcweir 
1591cdf0e10cSrcweir 	// fuer Broadcasting/Listening
1592cdf0e10cSrcweir 	void			SetNoSetDirty( sal_Bool bVal ) { bNoSetDirty = bVal; }
1593cdf0e10cSrcweir 	sal_Bool			GetNoSetDirty() const { return bNoSetDirty; }
1594cdf0e10cSrcweir 	void			SetInsertingFromOtherDoc( sal_Bool bVal ) { bInsertingFromOtherDoc = bVal; }
1595cdf0e10cSrcweir 	sal_Bool			IsInsertingFromOtherDoc() const { return bInsertingFromOtherDoc; }
1596cdf0e10cSrcweir     void            SetLoadingMedium( bool bVal );
1597cdf0e10cSrcweir     void            SetImportingXML( bool bVal );
1598cdf0e10cSrcweir     bool            IsImportingXML() const { return bImportingXML; }
1599577c0052SWang Lei 	void			SetImportingMSXML( bool bVal );
1600577c0052SWang Lei 	bool			IsImportingMSXML() const { return mbImportingMSXML; }
1601cdf0e10cSrcweir 	void			SetXMLFromWrapper( sal_Bool bVal );
1602cdf0e10cSrcweir 	sal_Bool			IsXMLFromWrapper() const { return bXMLFromWrapper; }
1603cdf0e10cSrcweir 	void			SetCalcingAfterLoad( sal_Bool bVal ) { bCalcingAfterLoad = bVal; }
1604cdf0e10cSrcweir 	sal_Bool			IsCalcingAfterLoad() const { return bCalcingAfterLoad; }
1605cdf0e10cSrcweir 	void			SetNoListening( sal_Bool bVal ) { bNoListening = bVal; }
1606cdf0e10cSrcweir 	sal_Bool			GetNoListening() const { return bNoListening; }
1607cdf0e10cSrcweir 	ScBroadcastAreaSlotMachine*	GetBASM() const { return pBASM; }
1608cdf0e10cSrcweir 
1609cdf0e10cSrcweir 	ScChartListenerCollection* GetChartListenerCollection() const
1610cdf0e10cSrcweir 						{ return pChartListenerCollection; }
1611cdf0e10cSrcweir 	void			SetChartListenerCollection( ScChartListenerCollection*,
1612cdf0e10cSrcweir 						sal_Bool bSetChartRangeLists = sal_False );
1613cdf0e10cSrcweir 	void			UpdateChart( const String& rName );
1614cdf0e10cSrcweir     void            RestoreChartListener( const String& rName );
1615cdf0e10cSrcweir 	SC_DLLPUBLIC void			UpdateChartListenerCollection();
1616cdf0e10cSrcweir 	sal_Bool			IsChartListenerCollectionNeedsUpdate() const
1617cdf0e10cSrcweir 						{ return bChartListenerCollectionNeedsUpdate; }
1618cdf0e10cSrcweir 	void			SetChartListenerCollectionNeedsUpdate( sal_Bool bFlg )
1619cdf0e10cSrcweir 						{ bChartListenerCollectionNeedsUpdate = bFlg; }
1620cdf0e10cSrcweir 	void			AddOLEObjectToCollection(const String& rName);
1621cdf0e10cSrcweir 
1622cdf0e10cSrcweir 	ScChangeViewSettings* GetChangeViewSettings() const		{ return pChangeViewSettings; }
1623cdf0e10cSrcweir 	SC_DLLPUBLIC void				SetChangeViewSettings(const ScChangeViewSettings& rNew);
1624cdf0e10cSrcweir 
1625cdf0e10cSrcweir 	vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharacters();
1626cdf0e10cSrcweir 	void			SetForbiddenCharacters( const vos::ORef<SvxForbiddenCharactersTable> xNew );
1627cdf0e10cSrcweir 
1628cdf0e10cSrcweir 	sal_uInt8			GetAsianCompression() const;		// CharacterCompressionType values
1629cdf0e10cSrcweir 	sal_Bool			IsValidAsianCompression() const;
1630cdf0e10cSrcweir 	void			SetAsianCompression(sal_uInt8 nNew);
1631cdf0e10cSrcweir 
1632cdf0e10cSrcweir 	sal_Bool			GetAsianKerning() const;
1633cdf0e10cSrcweir 	sal_Bool			IsValidAsianKerning() const;
1634cdf0e10cSrcweir 	void			SetAsianKerning(sal_Bool bNew);
1635cdf0e10cSrcweir 
1636cdf0e10cSrcweir     void            ApplyAsianEditSettings(ScEditEngineDefaulter& rEngine);
1637cdf0e10cSrcweir 
1638cdf0e10cSrcweir 	sal_uInt8			GetEditTextDirection(SCTAB nTab) const;	// EEHorizontalTextDirection values
1639cdf0e10cSrcweir 
1640cdf0e10cSrcweir 	SC_DLLPUBLIC ScLkUpdMode		GetLinkMode() const				{ return eLinkMode ;}
1641cdf0e10cSrcweir 	void			SetLinkMode( ScLkUpdMode nSet )	{ 	eLinkMode  = nSet;}
1642cdf0e10cSrcweir 
1643cdf0e10cSrcweir 
1644cdf0e10cSrcweir private:
1645cdf0e10cSrcweir     ScDocument(const ScDocument& r); // disabled with no definition
1646cdf0e10cSrcweir 
1647cdf0e10cSrcweir 	void				FindMaxRotCol( SCTAB nTab, RowInfo* pRowInfo, SCSIZE nArrCount,
1648cdf0e10cSrcweir 										SCCOL nX1, SCCOL nX2 ) const;
1649cdf0e10cSrcweir 
1650cdf0e10cSrcweir 	sal_uInt16				RowDifferences( SCROW nThisRow, SCTAB nThisTab,
1651cdf0e10cSrcweir 										ScDocument& rOtherDoc,
1652cdf0e10cSrcweir 										SCROW nOtherRow, SCTAB nOtherTab,
1653cdf0e10cSrcweir 										SCCOL nMaxCol, SCCOLROW* pOtherCols );
1654cdf0e10cSrcweir 	sal_uInt16				ColDifferences( SCCOL nThisCol, SCTAB nThisTab,
1655cdf0e10cSrcweir 										ScDocument& rOtherDoc,
1656cdf0e10cSrcweir 										SCCOL nOtherCol, SCTAB nOtherTab,
1657cdf0e10cSrcweir 										SCROW nMaxRow, SCCOLROW* pOtherRows );
1658cdf0e10cSrcweir 	void				FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW nOtherEndRow,
1659cdf0e10cSrcweir 										sal_Bool bColumns,
1660cdf0e10cSrcweir 										ScDocument& rOtherDoc, SCTAB nThisTab, SCTAB nOtherTab,
1661cdf0e10cSrcweir 										SCCOLROW nEndCol, SCCOLROW* pTranslate,
1662cdf0e10cSrcweir 										ScProgress* pProgress, sal_uLong nProAdd );
1663cdf0e10cSrcweir 	sal_Bool				OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpellPos,
1664cdf0e10cSrcweir 										sal_uInt16 nMaxTest );
1665cdf0e10cSrcweir 
1666cdf0e10cSrcweir 	DECL_LINK( TrackTimeHdl, Timer* );
1667cdf0e10cSrcweir 
1668cdf0e10cSrcweir     static ScRecursionHelper*   CreateRecursionHelperInstance();
1669cdf0e10cSrcweir 
1670cdf0e10cSrcweir public:
1671cdf0e10cSrcweir 	void				StartListeningArea( const ScRange& rRange,
1672cdf0e10cSrcweir 											SvtListener* pListener );
1673cdf0e10cSrcweir 	void				EndListeningArea( const ScRange& rRange,
1674cdf0e10cSrcweir 											SvtListener* pListener );
1675cdf0e10cSrcweir                         /** Broadcast wrapper, calls
1676cdf0e10cSrcweir     SC_DLLPUBLIC                         rHint.GetCell()->Broadcast() and AreaBroadcast()
1677cdf0e10cSrcweir                             and TrackFormulas() and conditional format list
1678cdf0e10cSrcweir                             SourceChanged().
1679cdf0e10cSrcweir                             Preferred.
1680cdf0e10cSrcweir                          */
1681cdf0e10cSrcweir     void                Broadcast( const ScHint& rHint );
1682cdf0e10cSrcweir                         /// deprecated
1683cdf0e10cSrcweir 	void				Broadcast( sal_uLong nHint, const ScAddress& rAddr,
1684cdf0e10cSrcweir 									ScBaseCell* pCell );
1685cdf0e10cSrcweir                         /// only area, no cell broadcast
1686cdf0e10cSrcweir     void                AreaBroadcast( const ScHint& rHint );
1687cdf0e10cSrcweir                         /// only areas in range, no cell broadcasts
1688cdf0e10cSrcweir     void                AreaBroadcastInRange( const ScRange& rRange,
1689cdf0e10cSrcweir                                               const ScHint& rHint );
1690cdf0e10cSrcweir 	void				DelBroadcastAreasInRange( const ScRange& rRange );
1691cdf0e10cSrcweir 	void				UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode,
1692cdf0e10cSrcweir 											const ScRange& rRange,
1693cdf0e10cSrcweir 											SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
1694cdf0e10cSrcweir 
1695cdf0e10cSrcweir 
1696cdf0e10cSrcweir 	void				StartListeningCell( const ScAddress& rAddress,
1697cdf0e10cSrcweir 											SvtListener* pListener );
1698cdf0e10cSrcweir 	void				EndListeningCell( const ScAddress& rAddress,
1699cdf0e10cSrcweir 											SvtListener* pListener );
1700cdf0e10cSrcweir 	void				PutInFormulaTree( ScFormulaCell* pCell );
1701cdf0e10cSrcweir 	void				RemoveFromFormulaTree( ScFormulaCell* pCell );
1702cdf0e10cSrcweir 	void				CalcFormulaTree( sal_Bool bOnlyForced = sal_False,
1703cdf0e10cSrcweir 										sal_Bool bNoProgressBar = sal_False );
1704cdf0e10cSrcweir 	void				ClearFormulaTree();
1705cdf0e10cSrcweir 	void				AppendToFormulaTrack( ScFormulaCell* pCell );
1706cdf0e10cSrcweir 	void				RemoveFromFormulaTrack( ScFormulaCell* pCell );
1707cdf0e10cSrcweir 	void				TrackFormulas( sal_uLong nHintId = SC_HINT_DATACHANGED );
1708cdf0e10cSrcweir 	sal_uInt16				GetFormulaTrackCount() const { return nFormulaTrackCount; }
1709cdf0e10cSrcweir 	sal_Bool				IsInFormulaTree( ScFormulaCell* pCell ) const;
1710cdf0e10cSrcweir 	sal_Bool				IsInFormulaTrack( ScFormulaCell* pCell ) const;
1711cdf0e10cSrcweir 	sal_uInt16				GetHardRecalcState() { return nHardRecalcState; }
1712cdf0e10cSrcweir 	void				SetHardRecalcState( sal_uInt16 nVal ) { nHardRecalcState = nVal; }
1713cdf0e10cSrcweir 	void				StartAllListeners();
1714cdf0e10cSrcweir 	const ScFormulaCell*	GetFormulaTree() const { return pFormulaTree; }
1715cdf0e10cSrcweir 	sal_Bool				HasForcedFormulas() const { return bHasForcedFormulas; }
1716cdf0e10cSrcweir 	void				SetForcedFormulas( sal_Bool bVal ) { bHasForcedFormulas = bVal; }
1717cdf0e10cSrcweir 	sal_uLong				GetFormulaCodeInTree() const { return nFormulaCodeInTree; }
1718cdf0e10cSrcweir 	sal_Bool				IsInInterpreter() const { return nInterpretLevel != 0; }
1719cdf0e10cSrcweir 	sal_uInt16				GetInterpretLevel() { return nInterpretLevel; }
1720cdf0e10cSrcweir 	void				IncInterpretLevel()
1721cdf0e10cSrcweir 							{
1722cdf0e10cSrcweir 								if ( nInterpretLevel < USHRT_MAX )
1723cdf0e10cSrcweir 									nInterpretLevel++;
1724cdf0e10cSrcweir 							}
1725cdf0e10cSrcweir 	void				DecInterpretLevel()
1726cdf0e10cSrcweir 							{
1727cdf0e10cSrcweir 								if ( nInterpretLevel )
1728cdf0e10cSrcweir 									nInterpretLevel--;
1729cdf0e10cSrcweir 							}
1730cdf0e10cSrcweir 	sal_Bool				IsInMacroInterpreter() const { return nMacroInterpretLevel != 0; }
1731cdf0e10cSrcweir 	sal_uInt16				GetMacroInterpretLevel() { return nMacroInterpretLevel; }
1732cdf0e10cSrcweir 	void				IncMacroInterpretLevel()
1733cdf0e10cSrcweir 							{
1734cdf0e10cSrcweir 								if ( nMacroInterpretLevel < USHRT_MAX )
1735cdf0e10cSrcweir 									nMacroInterpretLevel++;
1736cdf0e10cSrcweir 							}
1737cdf0e10cSrcweir 	void				DecMacroInterpretLevel()
1738cdf0e10cSrcweir 							{
1739cdf0e10cSrcweir 								if ( nMacroInterpretLevel )
1740cdf0e10cSrcweir 									nMacroInterpretLevel--;
1741cdf0e10cSrcweir 							}
1742cdf0e10cSrcweir 	sal_Bool				IsInInterpreterTableOp() const { return nInterpreterTableOpLevel != 0; }
1743cdf0e10cSrcweir 	sal_uInt16				GetInterpreterTableOpLevel() { return nInterpreterTableOpLevel; }
1744cdf0e10cSrcweir 	void				IncInterpreterTableOpLevel()
1745cdf0e10cSrcweir 							{
1746cdf0e10cSrcweir 								if ( nInterpreterTableOpLevel < USHRT_MAX )
1747cdf0e10cSrcweir 									nInterpreterTableOpLevel++;
1748cdf0e10cSrcweir 							}
1749cdf0e10cSrcweir 	void				DecInterpreterTableOpLevel()
1750cdf0e10cSrcweir 							{
1751cdf0e10cSrcweir 								if ( nInterpreterTableOpLevel )
1752cdf0e10cSrcweir 									nInterpreterTableOpLevel--;
1753cdf0e10cSrcweir 							}
1754cdf0e10cSrcweir                         // add a formula to be remembered for TableOp broadcasts
1755cdf0e10cSrcweir     void                AddTableOpFormulaCell( ScFormulaCell* );
1756cdf0e10cSrcweir     void                InvalidateLastTableOpParams() { aLastTableOpParams.bValid = sal_False; }
1757cdf0e10cSrcweir     ScRecursionHelper&  GetRecursionHelper()
1758cdf0e10cSrcweir                             {
1759cdf0e10cSrcweir                                 if (!pRecursionHelper)
1760cdf0e10cSrcweir                                     pRecursionHelper = CreateRecursionHelperInstance();
1761cdf0e10cSrcweir                                 return *pRecursionHelper;
1762cdf0e10cSrcweir                             }
1763cdf0e10cSrcweir 	sal_Bool				IsInDtorClear() const { return bInDtorClear; }
1764cdf0e10cSrcweir 	void				SetExpandRefs( sal_Bool bVal ) { bExpandRefs = bVal; }
1765cdf0e10cSrcweir 	sal_Bool				IsExpandRefs() { return bExpandRefs; }
1766cdf0e10cSrcweir 
1767cdf0e10cSrcweir 	SC_DLLPUBLIC void				IncSizeRecalcLevel( SCTAB nTab );
1768cdf0e10cSrcweir 	SC_DLLPUBLIC void				DecSizeRecalcLevel( SCTAB nTab, bool bUpdateNoteCaptionPos = true );
1769cdf0e10cSrcweir 
1770cdf0e10cSrcweir     sal_uLong               GetXMLImportedFormulaCount() const { return nXMLImportedFormulaCount; }
1771cdf0e10cSrcweir     void                IncXMLImportedFormulaCount( sal_uLong nVal )
1772cdf0e10cSrcweir                             {
1773cdf0e10cSrcweir                                 if ( nXMLImportedFormulaCount + nVal > nXMLImportedFormulaCount )
1774cdf0e10cSrcweir                                     nXMLImportedFormulaCount += nVal;
1775cdf0e10cSrcweir                             }
1776cdf0e10cSrcweir     void                DecXMLImportedFormulaCount( sal_uLong nVal )
1777cdf0e10cSrcweir                             {
1778cdf0e10cSrcweir                                 if ( nVal <= nXMLImportedFormulaCount )
1779cdf0e10cSrcweir                                     nXMLImportedFormulaCount -= nVal;
1780cdf0e10cSrcweir                                 else
1781cdf0e10cSrcweir                                     nXMLImportedFormulaCount = 0;
1782cdf0e10cSrcweir                             }
1783cdf0e10cSrcweir 
1784cdf0e10cSrcweir 	void				StartTrackTimer();
1785cdf0e10cSrcweir 
1786cdf0e10cSrcweir 	void 			CompileDBFormula();
1787cdf0e10cSrcweir 	void 			CompileDBFormula( sal_Bool bCreateFormulaString );
1788cdf0e10cSrcweir 	void 			CompileNameFormula( sal_Bool bCreateFormulaString );
1789cdf0e10cSrcweir 	void 			CompileColRowNameFormula();
1790cdf0e10cSrcweir 
1791cdf0e10cSrcweir     /** Maximum string length of a column, e.g. for dBase export.
1792cdf0e10cSrcweir         @return String length in octets (!) of the destination encoding. In
1793cdf0e10cSrcweir                 case of non-octet encodings (e.g. UCS2) the length in code
1794cdf0e10cSrcweir                 points times sizeof(sal_Unicode) is returned. */
1795cdf0e10cSrcweir     sal_Int32       GetMaxStringLen( SCTAB nTab, SCCOL nCol,
1796cdf0e10cSrcweir                                      SCROW nRowStart, SCROW nRowEnd,
1797cdf0e10cSrcweir                                      CharSet eCharSet ) const;
1798cdf0e10cSrcweir     /** Maximum string length of numerical cells of a column, e.g. for dBase export.
1799cdf0e10cSrcweir         @return String length in characters (!) including the decimal
1800cdf0e10cSrcweir                 separator, and the decimal precision needed. */
1801cdf0e10cSrcweir     xub_StrLen      GetMaxNumberStringLen( sal_uInt16& nPrecision,
1802cdf0e10cSrcweir                                            SCTAB nTab, SCCOL nCol,
1803cdf0e10cSrcweir                                            SCROW nRowStart, SCROW nRowEnd ) const;
1804cdf0e10cSrcweir 
1805cdf0e10cSrcweir 	void	KeyInput( const KeyEvent& rKEvt );		// TimerDelays etc.
1806cdf0e10cSrcweir 
1807cdf0e10cSrcweir 	ScChangeTrack*		GetChangeTrack() const { return pChangeTrack; }
1808cdf0e10cSrcweir 
1809cdf0e10cSrcweir 	//! only for import filter, deletes any existing ChangeTrack via
1810cdf0e10cSrcweir 	//! EndChangeTracking() and takes ownership of new ChangeTrack pTrack
1811cdf0e10cSrcweir 	SC_DLLPUBLIC void			SetChangeTrack( ScChangeTrack* pTrack );
1812cdf0e10cSrcweir 
1813cdf0e10cSrcweir 	void			StartChangeTracking();
1814cdf0e10cSrcweir 	void			EndChangeTracking();
1815cdf0e10cSrcweir 
1816cdf0e10cSrcweir 	SC_DLLPUBLIC void			CompareDocument( ScDocument& rOtherDoc );
1817cdf0e10cSrcweir 
1818cdf0e10cSrcweir 	void			AddUnoObject( SfxListener& rObject );
1819cdf0e10cSrcweir 	void			RemoveUnoObject( SfxListener& rObject );
1820cdf0e10cSrcweir 	void			BroadcastUno( const SfxHint &rHint );
1821cdf0e10cSrcweir 	void			AddUnoListenerCall( const ::com::sun::star::uno::Reference<
1822cdf0e10cSrcweir 											::com::sun::star::util::XModifyListener >& rListener,
1823cdf0e10cSrcweir 										const ::com::sun::star::lang::EventObject& rEvent );
1824cdf0e10cSrcweir 
1825cdf0e10cSrcweir 	void			SetInLinkUpdate(sal_Bool bSet);				// TableLink or AreaLink
1826cdf0e10cSrcweir 	sal_Bool			IsInLinkUpdate() const;					// including DdeLink
1827cdf0e10cSrcweir 
1828cdf0e10cSrcweir 	SC_DLLPUBLIC SfxItemPool*		GetEditPool() const;
1829cdf0e10cSrcweir 	SC_DLLPUBLIC SfxItemPool*		GetEnginePool() const;
1830cdf0e10cSrcweir 	SC_DLLPUBLIC ScFieldEditEngine&	GetEditEngine();
1831cdf0e10cSrcweir 	SC_DLLPUBLIC ScNoteEditEngine&	GetNoteEngine();
1832cdf0e10cSrcweir 
1833cdf0e10cSrcweir 	ScRefreshTimerControl*	GetRefreshTimerControl() const
1834cdf0e10cSrcweir 		{ return pRefreshTimerControl; }
1835cdf0e10cSrcweir 	ScRefreshTimerControl * const * GetRefreshTimerControlAddress() const
1836cdf0e10cSrcweir 		{ return &pRefreshTimerControl; }
1837cdf0e10cSrcweir 
1838cdf0e10cSrcweir     void            SetPastingDrawFromOtherDoc( sal_Bool bVal )
1839cdf0e10cSrcweir                         { bPastingDrawFromOtherDoc = bVal; }
1840cdf0e10cSrcweir     sal_Bool            PastingDrawFromOtherDoc() const
1841cdf0e10cSrcweir                         { return bPastingDrawFromOtherDoc; }
1842cdf0e10cSrcweir 
1843cdf0e10cSrcweir                     /// an ID unique to each document instance
1844cdf0e10cSrcweir     sal_uInt32      GetDocumentID() const;
1845cdf0e10cSrcweir 
1846cdf0e10cSrcweir     void            InvalidateStyleSheetUsage()
1847cdf0e10cSrcweir                         { bStyleSheetUsageInvalid = sal_True; }
1848cdf0e10cSrcweir 	void GetSortParam( ScSortParam& rParam, SCTAB nTab );
1849cdf0e10cSrcweir 	void SetSortParam( ScSortParam& rParam, SCTAB nTab );
1850cdf0e10cSrcweir 
1851cdf0e10cSrcweir     inline void     SetVbaEventProcessor( const com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >& rxVbaEvents )
1852cdf0e10cSrcweir                         { mxVbaEvents = rxVbaEvents; }
1853cdf0e10cSrcweir     inline com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >
1854cdf0e10cSrcweir                     GetVbaEventProcessor() const { return mxVbaEvents; }
1855cdf0e10cSrcweir 
1856cdf0e10cSrcweir     /** Should only be GRAM_PODF or GRAM_ODFF. */
1857cdf0e10cSrcweir     void                SetStorageGrammar( formula::FormulaGrammar::Grammar eGrammar );
1858cdf0e10cSrcweir     formula::FormulaGrammar::Grammar  GetStorageGrammar() const
1859cdf0e10cSrcweir                             { return eStorageGrammar; }
1860cdf0e10cSrcweir 
1861cdf0e10cSrcweir 	SfxUndoManager*     GetUndoManager();
1862cdf0e10cSrcweir     bool IsInVBAMode() const;
1863cdf0e10cSrcweir     ScRowBreakIterator* GetRowBreakIterator(SCTAB nTab) const;
1864cdf0e10cSrcweir 
1865cdf0e10cSrcweir private: // CLOOK-Impl-Methoden
1866cdf0e10cSrcweir 
1867cdf0e10cSrcweir     /**
1868cdf0e10cSrcweir      * Use this class as a locale variable to merge number formatter from
1869cdf0e10cSrcweir      * another document, and set NULL pointer to pFormatExchangeList when
1870cdf0e10cSrcweir      * done.
1871cdf0e10cSrcweir      */
1872cdf0e10cSrcweir     class NumFmtMergeHandler
1873cdf0e10cSrcweir     {
1874cdf0e10cSrcweir     public:
1875cdf0e10cSrcweir         explicit NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc);
1876cdf0e10cSrcweir         ~NumFmtMergeHandler();
1877cdf0e10cSrcweir 
1878cdf0e10cSrcweir     private:
1879cdf0e10cSrcweir         ScDocument* mpDoc;
1880cdf0e10cSrcweir     };
1881cdf0e10cSrcweir 
1882cdf0e10cSrcweir     void    MergeNumberFormatter(ScDocument* pSrcDoc);
1883cdf0e10cSrcweir 
1884cdf0e10cSrcweir 	void	ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen?
1885cdf0e10cSrcweir 	void	ImplDeleteOptions();
1886cdf0e10cSrcweir 
1887cdf0e10cSrcweir 	void	DeleteDrawLayer();
1888cdf0e10cSrcweir 	SC_DLLPUBLIC sal_Bool	DrawGetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const;
1889cdf0e10cSrcweir 	void	DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
1890cdf0e10cSrcweir 	void	DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
1891cdf0e10cSrcweir 
1892cdf0e10cSrcweir 	void	UpdateDrawPrinter();
1893cdf0e10cSrcweir 	void	UpdateDrawLanguages();
1894cdf0e10cSrcweir 	SC_DLLPUBLIC void	InitClipPtrs( ScDocument* pSourceDoc );
1895cdf0e10cSrcweir 
1896cdf0e10cSrcweir 	void	LoadDdeLinks(SvStream& rStream);
1897cdf0e10cSrcweir 	void	SaveDdeLinks(SvStream& rStream) const;
1898cdf0e10cSrcweir 
1899cdf0e10cSrcweir     void    DeleteAreaLinksOnTab( SCTAB nTab );
1900cdf0e10cSrcweir 	void	UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
1901cdf0e10cSrcweir 							 const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
1902cdf0e10cSrcweir 
1903cdf0e10cSrcweir     void    CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs);
1904cdf0e10cSrcweir     void    CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames);
1905cdf0e10cSrcweir     void    UpdateRangeNamesInFormulas(
1906cdf0e10cSrcweir         ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark,
1907cdf0e10cSrcweir         SCCOL nXw, SCROW nYw);
1908cdf0e10cSrcweir 
1909cdf0e10cSrcweir 	sal_Bool	HasPartOfMerged( const ScRange& rRange );
1910cdf0e10cSrcweir 
1911cdf0e10cSrcweir 	std::map< SCTAB, ScSortParam > mSheetSortParams;
1912cdf0e10cSrcweir 
1913b4df81e3SWang Lei public:
1914b4df81e3SWang Lei     void    FillDPCache( ScDPTableDataCache * pCache, SCTAB nDocTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
1915cdf0e10cSrcweir };
1916cdf0e10cSrcweir inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab )
1917cdf0e10cSrcweir {
1918cdf0e10cSrcweir 	rParam = mSheetSortParams[ nTab ];
1919cdf0e10cSrcweir }
1920cdf0e10cSrcweir 
1921cdf0e10cSrcweir inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab )
1922cdf0e10cSrcweir {
1923cdf0e10cSrcweir 	mSheetSortParams[ nTab ] = rParam;
1924cdf0e10cSrcweir }
1925cdf0e10cSrcweir 
1926cdf0e10cSrcweir #endif
1927cdf0e10cSrcweir 
1928cdf0e10cSrcweir 
1929