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