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