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