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 $
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
36 #ifndef _SV_TIMER_HXX //autogen
37 #include <vcl/timer.hxx>
42 #include <vos/ref.hxx>
46 #include "table.hxx" // FastGetRowHeight (inline)
49 #ifndef SC_RANGELST_HXX
50 #include "rangelst.hxx"
53 #ifndef _SC_BRDCST_HXX
57 #ifndef SC_TABOPPARAMS_HXX
58 #include "tabopparams.hxx"
60 namespace com
{ namespace sun
{ namespace star
{
62 class XMultiServiceFactory
;
74 class SvNumberFormatter
;
81 class SfxStyleSheetBase
;
87 class SfxStatusBarManager
;
92 class SvxForbiddenCharactersTable
;
97 class ScAutoFormatData
;
100 class ScBroadcastAreaSlotMachine
;
101 class ScChangeViewSettings
;
102 class ScChartCollection
;
103 class ScChartListenerCollection
;
104 class ScConditionalFormat
;
105 class ScConditionalFormatList
;
106 class ScDBCollection
;
111 class ScDocumentPool
;
113 class ScExtDocOptions
;
117 class ScOutlineTable
;
120 class ScPivotCollection
;
121 class ScPrintRangeSaver
;
125 class ScStyleSheetPool
;
128 class ScValidationData
;
129 class ScValidationDataList
;
132 class TypedStrCollection
;
134 class ScFieldEditEngine
;
135 struct ScConsolidateParam
;
137 class ScDPCollection
;
139 class ScScriptTypeData
;
141 class ScImpExpLogMsg
;
143 class ScRefreshTimerControl
;
145 //STRIP008 namespace com { namespace sun { namespace star {
146 //STRIP008 namespace lang {
147 //STRIP008 class XMultiServiceFactory;
149 //STRIP008 namespace i18n {
150 //STRIP008 class XBreakIterator;
154 } //namespace binfilter
156 #include <bf_svtools/zforlist.hxx> // IsNumberFormat
157 /*#ifdef _ZFORLIST_DECLARE_TABLE
158 class SvNumberFormatterIndexTable;
161 typedef Table SvNumberFormatterIndexTable;
163 namespace binfilter
{//STRIP009
164 #define SC_TAB_APPEND 0xFFFF
165 #define SC_DOC_NEW 0xFFFF
166 #define REPEAT_NONE 0xFFFF
168 #define SC_MACROCALL_ALLOWED 0
169 #define SC_MACROCALL_NOTALLOWED 1
170 #define SC_MACROCALL_ASK 2
172 #define SC_ASIANCOMPRESSION_INVALID 0xff
173 #define SC_ASIANKERNING_INVALID 0xff
185 // -----------------------------------------------------------------------
187 // structs fuer FillInfo
199 #define SC_ROTDIR_NONE 0
200 #define SC_ROTDIR_STANDARD 1
201 #define SC_ROTDIR_LEFT 2
202 #define SC_ROTDIR_RIGHT 3
203 #define SC_ROTDIR_CENTER 4
209 const ScPatternAttr
* pPatternAttr
;
210 const SfxItemSet
* pConditionSet
;
212 const SvxBrushItem
* pBackground
;
214 const SvxBoxItem
* pLinesAttr
; // Original-Item (intern)
216 const SvxBorderLine
* pThisBottom
; // einzelne inkl. zusammengefasst
217 const SvxBorderLine
* pNextTop
; // (intern)
218 const SvxBorderLine
* pThisRight
;
219 const SvxBorderLine
* pNextLeft
;
221 const SvxBorderLine
* pRightLine
; // dickere zum Zeichnen
222 const SvxBorderLine
* pBottomLine
;
224 const SvxShadowItem
* pShadowAttr
; // Original-Item (intern)
226 ScShadowPart eHShadowPart
; // Schatten effektiv zum Zeichnen
227 ScShadowPart eVShadowPart
;
228 const SvxShadowItem
* pHShadowOrigin
;
229 const SvxShadowItem
* pVShadowOrigin
;
244 BOOL bPrinted
; // bei Bedarf (Pagebreak-Modus)
246 BOOL bHideGrid
; // output-intern
247 BOOL bEditEngine
; // output-intern
250 #define SC_ROTMAX_NONE USHRT_MAX
258 USHORT nRotMaxCol
; // SC_ROTMAX_NONE, wenn nichts
264 BOOL bChanged
; // TRUE, wenn nicht getestet
275 // nicht 11 Parameter bei CopyBlockFromClip, konstante Werte der Schleife hier
276 struct ScCopyBlockFromClipParams
278 ScDocument
* pRefUndoDoc
;
279 ScDocument
* pClipDoc
;
284 BOOL bSkipAttrForEmpty
;
287 #define ROWINFO_MAX 1024
290 // for loading of binary file format symbol string cells which need font conversion
291 struct ScSymbolStringCellEntry
298 // Spezialwert fuer Recalc-Alwyas-Zellen
300 #define BCA_BRDCST_ALWAYS ScAddress( 0, 32767, 0 )
301 #define BCA_LISTEN_ALWAYS ScRange( BCA_BRDCST_ALWAYS, BCA_BRDCST_ALWAYS )
303 // -----------------------------------------------------------------------
307 #define SC_DDE_DEFAULT 0
308 #define SC_DDE_ENGLISH 1
309 #define SC_DDE_TEXT 2
310 #define SC_DDE_IGNOREMODE 255 // for usage in FindDdeLink() only!
312 // -----------------------------------------------------------------------
316 friend class ScValueIterator
;
317 friend class ScQueryValueIterator
;
318 friend class ScCellIterator
;
319 friend class ScQueryCellIterator
;
320 friend class ScHorizontalCellIterator
;
321 friend class ScDocAttrIterator
;
322 friend class ScAttrRectIterator
;
323 friend class ScPivot
;
326 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xServiceManager
;
328 vos::ORef
<ScPoolHelper
> xPoolHelper
;
330 ScFieldEditEngine
* pEditEngine
; // uses pEditPool from xPoolHelper
331 SfxObjectShell
* pShell
;
332 SfxPrinter
* pPrinter
;
333 ScDrawLayer
* pDrawLayer
; // SdrModel
334 XColorTable
* pColorTable
;
335 ScConditionalFormatList
* pCondFormList
; // bedingte Formate
336 ScValidationDataList
* pValidationList
; // Gueltigkeit
337 SvNumberFormatterIndexTable
* pFormatExchangeList
; // zum Umsetzen von Zahlenformaten
338 ScTable
* pTab
[MAXTAB
+1];
339 ScRangeName
* pRangeName
;
340 ScDBCollection
* pDBCollection
;
341 ScPivotCollection
* pPivotCollection
;
342 ScDPCollection
* pDPCollection
;
343 ScChartCollection
* pChartCollection
;
344 ScPatternAttr
* pSelectionAttr
; // Attribute eines Blocks
345 SvxLinkManager
* pLinkManager
;
346 ScFormulaCell
* pFormulaTree
; // Berechnungsbaum Start
347 ScFormulaCell
* pEOFormulaTree
; // Berechnungsbaum Ende, letzte Zelle
348 ScFormulaCell
* pFormulaTrack
; // BroadcastTrack Start
349 ScFormulaCell
* pEOFormulaTrack
; // BrodcastTrack Ende, letzte Zelle
350 ScBroadcastAreaSlotMachine
* pBASM
; // BroadcastAreas
351 ScChartListenerCollection
* pChartListenerCollection
;
352 StrCollection
* pOtherObjects
; // non-chart OLE objects
353 SvMemoryStream
* pClipData
;
354 ScDetOpList
* pDetOpList
;
355 ScChangeTrack
* pChangeTrack
;
356 SfxBroadcaster
* pUnoBroadcaster
;
357 ScChangeViewSettings
* pChangeViewSettings
;
358 ScScriptTypeData
* pScriptTypeData
;
359 ScRefreshTimerControl
* pRefreshTimerControl
;
360 vos::ORef
<SvxForbiddenCharactersTable
> xForbiddenCharacters
;
362 ScFieldEditEngine
* pCacheFieldEditEngine
;
364 ::com::sun::star::uno::Sequence
<sal_Int8
> aProtectPass
;
365 String aDocName
; // opt: Dokumentname
366 ScRangePairListRef xColNameRanges
;
367 ScRangePairListRef xRowNameRanges
;
369 ScViewOptions
* pViewOptions
; // View-Optionen
370 ScDocOptions
* pDocOptions
; // Dokument-Optionen
371 ScExtDocOptions
* pExtDocOptions
; // fuer Import etc.
372 ScConsolidateParam
* pConsolidateDlgData
;
374 List
* pLoadedSymbolStringCellList
; // binary file format import of symbol font string cells
378 ScAddress aCurTextWidthCalcPos
;
379 ScAddress aOnlineSpellPos
; // within whole document
380 ScRange aVisSpellRange
;
381 ScAddress aVisSpellPos
; // within aVisSpellRange (see nVisSpellState)
386 ScTabOpList aTableOpList
; // list of ScInterpreterTableOpParams currently in use
387 ScInterpreterTableOpParams aLastTableOpParams
; // remember last params
390 LanguageType eLanguage
; // default language
391 LanguageType eCjkLanguage
; // default language for asian text
392 LanguageType eCtlLanguage
; // default language for complex text
393 CharSet eSrcSet
; // Einlesen: Quell-Zeichensatz
395 ULONG nFormulaCodeInTree
; // FormelRPN im Formelbaum
396 ULONG nXMLImportedFormulaCount
; // progress count during XML import
397 USHORT nInterpretLevel
; // >0 wenn im Interpreter
398 USHORT nMacroInterpretLevel
; // >0 wenn Macro im Interpreter
399 USHORT nInterpreterTableOpLevel
; // >0 if in Interpreter TableOp
400 USHORT nMaxTableNumber
;
401 USHORT nSrcVer
; // Dateiversion (Laden/Speichern)
402 USHORT nSrcMaxRow
; // Zeilenzahl zum Laden/Speichern
403 USHORT nFormulaTrackCount
;
404 USHORT nHardRecalcState
; // 0: soft, 1: hard-warn, 2: hard
405 USHORT nVisibleTab
; // fuer OLE etc.
407 ScLkUpdMode eLinkMode
;
410 BOOL bAutoCalc
; // Automatisch Berechnen
411 BOOL bAutoCalcShellDisabled
; // in/von/fuer ScDocShell disabled
412 // ob noch ForcedFormulas berechnet werden muessen,
413 // im Zusammenspiel mit ScDocShell SetDocumentModified,
414 // AutoCalcShellDisabled und TrackFormulas
415 BOOL bForcedFormulaPending
;
416 BOOL bCalculatingFormulaTree
;
421 BOOL bIsEmbedded
; // Embedded-Bereich anzeigen/anpassen ?
423 // kein SetDirty bei ScFormulaCell::CompileTokenArray sondern am Ende
424 // von ScDocument::CompileAll[WithFormats], CopyScenario, CopyBlockFromClip
426 // kein Broadcast, keine Listener aufbauen waehrend aus einem anderen
427 // Doc (per Filter o.ae.) inserted wird, erst bei CompileAll / CalcAfterLoad
428 BOOL bInsertingFromOtherDoc
;
429 BOOL bImportingXML
; // special handling of formula text
430 BOOL bCalcingAfterLoad
; // in CalcAfterLoad TRUE
431 // wenn temporaer keine Listener auf/abgebaut werden sollen
435 BOOL bInLinkUpdate
; // TableLink or AreaLink
436 BOOL bChartListenerCollectionNeedsUpdate
;
437 // ob RC_FORCED Formelzellen im Dokument sind/waren (einmal an immer an)
438 BOOL bHasForcedFormulas
;
439 // ist beim Laden/Speichern etwas weggelassen worden?
441 // ob das Doc gerade zerstoert wird (kein Notify-Tracking etc. mehr)
443 // ob bei Spalte/Zeile einfuegen am Rand einer Referenz die Referenz
444 // erweitert wird, wird in jedem UpdateReference aus InputOptions geholt,
445 // gesetzt und am Ende von UpdateReference zurueckgesetzt
447 // fuer Detektiv-Update, wird bei jeder Aenderung an Formeln gesetzt
448 BOOL bDetectiveDirty
;
450 BYTE nMacroCallMode
; // Makros per Warnung-Dialog disabled?
451 BOOL bHasMacroFunc
; // valid only after loading
455 BYTE nAsianCompression
;
458 BOOL bPastingDrawFromOtherDoc
;
460 BYTE nInDdeLinkUpdate
; // originating DDE links (stacked bool)
462 BOOL bInUnoBroadcast
;
464 mutable BOOL bStyleSheetUsageInvalid
;
467 inline BOOL
RowHidden( USHORT nRow
, USHORT nTab
); // FillInfo
470 long GetCellCount() const; // alle Zellen
471 long GetWeightedCount() const; // Formeln und Edit staerker gewichtet
472 DECL_LINK( GetUserDefinedColor
, USHORT
* );
476 ScDocument( ScDocumentMode eMode
= SCDOCMODE_DOCUMENT
,
477 SfxObjectShell
* pDocShell
= NULL
);
480 inline ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>
481 GetServiceManager() const { return xServiceManager
; }
483 const String
& GetName() const { return aDocName
; }
484 void SetName( const String
& r
) { aDocName
= r
; }
487 void InitDrawLayer( SfxObjectShell
* pDocShell
= NULL
);
488 XColorTable
* GetColorTable();
490 SvxLinkManager
* GetLinkManager() { return pLinkManager
; }
492 const ScDocOptions
& GetDocOptions() const;
493 void SetDocOptions( const ScDocOptions
& rOpt
);
494 const ScViewOptions
& GetViewOptions() const;
495 void SetViewOptions( const ScViewOptions
& rOpt
);
496 void SetPrintOptions();
498 ScExtDocOptions
* GetExtDocOptions() { return pExtDocOptions
; }
500 void GetLanguage( LanguageType
& rLatin
, LanguageType
& rCjk
, LanguageType
& rCtl
) const;
501 void SetLanguage( LanguageType eLatin
, LanguageType eCjk
, LanguageType eCtl
);
503 void SetConsolidateDlgData( const ScConsolidateParam
* pData
);
504 const ScConsolidateParam
* GetConsolidateDlgData() const { return pConsolidateDlgData
; }
508 ScFieldEditEngine
* CreateFieldEditEngine();
509 void DisposeFieldEditEngine(ScFieldEditEngine
*& rpEditEngine
);
511 ScRangeName
* GetRangeName();
512 void SetRangeName( ScRangeName
* pNewRangeName
);
513 USHORT
GetMaxTableNumber() { return nMaxTableNumber
; }
514 void SetMaxTableNumber(USHORT nNumber
) { nMaxTableNumber
= nNumber
; }
516 ScRangePairList
* GetColNameRanges() { return &xColNameRanges
; }
517 ScRangePairList
* GetRowNameRanges() { return &xRowNameRanges
; }
518 ScRangePairListRef
& GetColNameRangesRef() { return xColNameRanges
; }
519 ScRangePairListRef
& GetRowNameRangesRef() { return xRowNameRanges
; }
521 ScDBCollection
* GetDBCollection() const;
522 ScDBData
* GetDBAtCursor(USHORT nCol
, USHORT nRow
, USHORT nTab
,
523 BOOL bStartOnly
= FALSE
) const;
524 ScDBData
* GetDBAtArea(USHORT nTab
, USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
) const;
527 ScDPCollection
* GetDPCollection();
532 void UpdateChartArea( const String
& rChartName
,
533 const ScRangeListRef
& rNewList
,
534 BOOL bColHeaders
, BOOL bRowHeaders
, BOOL bAdd
,
536 SchMemChart
* FindChartData(const String
& rName
, BOOL bForModify
= FALSE
);
538 void MakeTable( USHORT nTab
);
540 USHORT
GetVisibleTab() const { return nVisibleTab
; }
541 void SetVisibleTab(USHORT nTab
) { nVisibleTab
= nTab
; }
543 BOOL
HasTable( USHORT nTab
) const;
544 BOOL
GetName( USHORT nTab
, String
& rName
) const;
545 BOOL
GetTable( const String
& rName
, USHORT
& rTab
) const;
546 inline USHORT
GetTableCount() const { return nMaxTableNumber
; }
547 SvNumberFormatterIndexTable
* GetFormatExchangeList() const { return pFormatExchangeList
; }
549 void SetDocProtection( BOOL bProtect
, const ::com::sun::star::uno::Sequence
<sal_Int8
>& aPass
);
550 void SetTabProtection( USHORT nTab
, BOOL bProtect
, const ::com::sun::star::uno::Sequence
<sal_Int8
>& aPass
);
551 BOOL
IsDocProtected() const;
552 BOOL
IsDocEditable() const;
553 BOOL
IsTabProtected( USHORT nTab
) const;
554 const ::com::sun::star::uno::Sequence
<sal_Int8
>& GetDocPassword() const;
555 const ::com::sun::star::uno::Sequence
<sal_Int8
>& GetTabPassword( USHORT nTab
) const;
557 void LockTable(USHORT nTab
);
558 void UnlockTable(USHORT nTab
);
560 BOOL
IsBlockEditable( USHORT nTab
, USHORT nStartCol
, USHORT nStartRow
,
561 USHORT nEndCol
, USHORT nEndRow
,
562 BOOL
* pOnlyNotBecauseOfMatrix
= NULL
) const;
563 BOOL
IsSelectionEditable( const ScMarkData
& rMark
,
564 BOOL
* pOnlyNotBecauseOfMatrix
= NULL
) const;
567 BOOL
GetMatrixFormulaRange( const ScAddress
& rCellPos
, ScRange
& rMatrix
);
569 BOOL
IsEmbedded() const;
570 void SnapVisArea( Rectangle
& rRect
) const; // 1/100 mm
572 BOOL
ValidTabName( const String
& rName
) const;
573 BOOL
ValidNewTabName( const String
& rName
) const;
574 void CreateValidTabName(String
& rName
) const;
575 BOOL
InsertTab( USHORT nPos
, const String
& rName
,
576 BOOL bExternalDocument
= FALSE
);
577 /*N*/ BOOL
DeleteTab( USHORT nTab
, ScDocument
* pRefUndoDoc
= NULL
);
578 BOOL
RenameTab( USHORT nTab
, const String
& rName
,
579 BOOL bUpdateRef
= TRUE
,
580 BOOL bExternalDocument
= FALSE
);
581 ULONG
TransferTab(ScDocument
* pSrcDoc
, USHORT nSrcPos
, USHORT nDestPos
,
582 BOOL bInsertNew
= TRUE
,
583 BOOL bResultsOnly
= FALSE
);
584 void TransferDrawPage(ScDocument
* pSrcDoc
, USHORT nSrcPos
, USHORT nDestPos
);
585 void SetVisible( USHORT nTab
, BOOL bVisible
);
586 BOOL
IsVisible( USHORT nTab
) const;
587 void SetScenario( USHORT nTab
, BOOL bFlag
);
588 BOOL
IsScenario( USHORT nTab
) const;
589 void GetScenarioData( USHORT nTab
, String
& rComment
,
590 Color
& rColor
, USHORT
& rFlags
) const;
591 void SetScenarioData( USHORT nTab
, const String
& rComment
,
592 const Color
& rColor
, USHORT nFlags
);
593 BOOL
IsActiveScenario( USHORT nTab
) const;
594 void SetActiveScenario( USHORT nTab
, BOOL bActive
); // nur fuer Undo etc.
595 BYTE
GetLinkMode( USHORT nTab
) const;
596 BOOL
IsLinked( USHORT nTab
) const;
597 const String
& GetLinkDoc( USHORT nTab
) const;
598 const String
& GetLinkFlt( USHORT nTab
) const;
599 const String
& GetLinkOpt( USHORT nTab
) const;
600 const String
& GetLinkTab( USHORT nTab
) const;
601 ULONG
GetLinkRefreshDelay( USHORT nTab
) const;
602 void SetLink( USHORT nTab
, BYTE nMode
, const String
& rDoc
,
603 const String
& rFilter
, const String
& rOptions
,
604 const String
& rTabName
, ULONG nRefreshDelay
);
605 BOOL
HasLink( const String
& rDoc
,
606 const String
& rFilter
, const String
& rOptions
) const;
607 BOOL
LinkExternalTab( USHORT
& nTab
, const String
& aDocTab
,
608 const String
& aFileName
,
609 const String
& aTabName
);
611 // originating DDE links
612 void IncInDdeLinkUpdate() { if ( nInDdeLinkUpdate
< 255 ) ++nInDdeLinkUpdate
; }
613 void DecInDdeLinkUpdate() { if ( nInDdeLinkUpdate
) --nInDdeLinkUpdate
; }
614 BOOL
IsInDdeLinkUpdate() const { return nInDdeLinkUpdate
!= 0; }
618 USHORT
GetDdeLinkCount() const;
619 BOOL
GetDdeLinkData( USHORT nPos
, String
& rAppl
, String
& rTopic
, String
& rItem
) const;
620 BOOL
UpdateDdeLink( const String
& rAppl
, const String
& rTopic
, const String
& rItem
);
622 // For XCL/XML Export (nPos is index of DDE links only):
623 BOOL
GetDdeLinkMode(USHORT nPos
, USHORT
& nMode
);
624 BOOL
GetDdeLinkResultDimension( USHORT nPos
, USHORT
& nCol
, USHORT
& nRow
, ScMatrix
*& pMatrix
);
625 BOOL
GetDdeLinkResult(const ScMatrix
* pMatrix
, USHORT nCol
, USHORT nRow
, String
& rStrValue
, double& rDoubValue
, BOOL
& bIsString
);
627 // For XCL/XML Import (nPos is index of DDE links only):
628 void CreateDdeLink(const String
& rAppl
, const String
& rTopic
, const String
& rItem
, const BYTE nMode
= SC_DDE_DEFAULT
);
629 BOOL
FindDdeLink(const String
& rAppl
, const String
& rTopic
, const String
& rItem
, const BYTE nMode
, USHORT
& nPos
);
630 BOOL
CreateDdeLinkResultDimension(USHORT nPos
, USHORT nCols
, USHORT nRows
, ScMatrix
*& pMatrix
);
631 void SetDdeLinkResult(ScMatrix
* pMatrix
, const USHORT nCol
, const USHORT nRow
, const String
& rStrValue
, const double& rDoubValue
, BOOL bString
, BOOL bEmpty
);
634 SfxBindings
* GetViewBindings();
635 SfxObjectShell
* GetDocumentShell() const { return pShell
; }
636 ScDrawLayer
* GetDrawLayer() { return pDrawLayer
; }
638 BOOL
IsChart( SdrObject
* pObject
);
639 void UpdateAllCharts( BOOL bDoUpdate
= TRUE
);
640 void UpdateChartRef( UpdateRefMode eUpdateRefMode
,
641 USHORT nCol1
, USHORT nRow1
, USHORT nTab1
,
642 USHORT nCol2
, USHORT nRow2
, USHORT nTab2
,
643 short nDx
, short nDy
, short nDz
);
644 //! setzt nur die neue RangeList, keine ChartListener o.ae.
646 ScOutlineTable
* GetOutlineTable( USHORT nTab
, BOOL bCreate
= FALSE
);
650 void PutCell( const ScAddress
&, ScBaseCell
* pCell
, BOOL bForceTab
= FALSE
);
651 void PutCell( USHORT nCol
, USHORT nRow
, USHORT nTab
, ScBaseCell
* pCell
,
652 BOOL bForceTab
= FALSE
);
653 void PutCell(USHORT nCol
, USHORT nRow
, USHORT nTab
, ScBaseCell
* pCell
,
654 ULONG nFormatIndex
, BOOL bForceTab
= FALSE
);
655 // return TRUE = Zahlformat gesetzt
656 BOOL
SetString( USHORT nCol
, USHORT nRow
, USHORT nTab
, const String
& rString
);
657 void SetValue( USHORT nCol
, USHORT nRow
, USHORT nTab
, const double& rVal
);
658 void SetNote( USHORT nCol
, USHORT nRow
, USHORT nTab
, const ScPostIt
& rNote
);
659 void SetError( USHORT nCol
, USHORT nRow
, USHORT nTab
, const USHORT nError
);
661 void InsertMatrixFormula(USHORT nCol1
, USHORT nRow1
,
662 USHORT nCol2
, USHORT nRow2
,
663 const ScMarkData
& rMark
,
664 const String
& rFormula
,
665 const ScTokenArray
* p
= NULL
);
667 void GetString( USHORT nCol
, USHORT nRow
, USHORT nTab
, String
& rString
);
668 void GetInputString( USHORT nCol
, USHORT nRow
, USHORT nTab
, String
& rString
);
669 double GetValue( const ScAddress
& );
670 void GetValue( USHORT nCol
, USHORT nRow
, USHORT nTab
, double& rValue
);
671 double RoundValueAsShown( double fVal
, ULONG nFormat
);
672 void GetNumberFormat( USHORT nCol
, USHORT nRow
, USHORT nTab
,
673 sal_uInt32
& rFormat
);
674 ULONG
GetNumberFormat( const ScAddress
& ) const;
675 /// if no number format attribute is set the calculated
676 /// number format of the formula cell is returned
677 void GetNumberFormatInfo( short& nType
, ULONG
& nIndex
,
678 const ScAddress
& rPos
, const ScFormulaCell
& rFCell
) const;
679 BOOL
GetNote( USHORT nCol
, USHORT nRow
, USHORT nTab
, ScPostIt
& rNote
);
680 void GetCellType( USHORT nCol
, USHORT nRow
, USHORT nTab
, CellType
& rCellType
) const;
681 CellType
GetCellType( const ScAddress
& rPos
) const;
682 void GetCell( USHORT nCol
, USHORT nRow
, USHORT nTab
, ScBaseCell
*& rpCell
) const;
683 ScBaseCell
* GetCell( const ScAddress
& rPos
) const;
685 void RefreshNoteFlags();
686 BOOL
HasNoteObject( USHORT nCol
, USHORT nRow
, USHORT nTab
) const;
688 BOOL
HasData( USHORT nCol
, USHORT nRow
, USHORT nTab
);
689 BOOL
HasStringData( USHORT nCol
, USHORT nRow
, USHORT nTab
) const;
690 BOOL
HasValueData( USHORT nCol
, USHORT nRow
, USHORT nTab
) const;
692 BOOL
ExtendMerge( USHORT nStartCol
, USHORT nStartRow
,
693 USHORT
& rEndCol
, USHORT
& rEndRow
, USHORT nTab
,
694 BOOL bRefresh
= FALSE
, BOOL bAttrs
= FALSE
);
695 BOOL
ExtendMerge( ScRange
& rRange
, BOOL bRefresh
= FALSE
, BOOL bAttrs
= FALSE
);
696 BOOL
ExtendOverlapped( USHORT
& rStartCol
, USHORT
& rStartRow
,
697 USHORT nEndCol
, USHORT nEndRow
, USHORT nTab
);
698 BOOL
ExtendOverlapped( ScRange
& rRange
);
701 // ohne Ueberpruefung:
702 void DoMerge( USHORT nTab
, USHORT nStartCol
, USHORT nStartRow
,
703 USHORT nEndCol
, USHORT nEndRow
);
705 BOOL
IsBlockEmpty( USHORT nTab
, USHORT nStartCol
, USHORT nStartRow
,
706 USHORT nEndCol
, USHORT nEndRow
) const;
707 BOOL
IsPrintEmpty( USHORT nTab
, USHORT nStartCol
, USHORT nStartRow
,
708 USHORT nEndCol
, USHORT nEndRow
,
709 BOOL bLeftIsEmpty
= FALSE
,
710 ScRange
* pLastRange
= NULL
,
711 Rectangle
* pLastMM
= NULL
) const;
714 BOOL
HasAttrib( USHORT nCol1
, USHORT nRow1
, USHORT nTab1
,
715 USHORT nCol2
, USHORT nRow2
, USHORT nTab2
, USHORT nMask
);
716 BOOL
HasAttrib( const ScRange
& rRange
, USHORT nMask
);
720 void ResetChanged( const ScRange
& rRange
);
723 void SetDirty( const ScRange
& );
724 void SetTableOpDirty( const ScRange
& ); // for Interpreter TableOp
726 void CalcAfterLoad();
729 // Automatisch Berechnen
730 void SetAutoCalc( BOOL bNewAutoCalc
);
731 BOOL
GetAutoCalc() const { return bAutoCalc
; }
732 // Automatisch Berechnen in/von/fuer ScDocShell disabled
733 void SetAutoCalcShellDisabled( BOOL bNew
) { bAutoCalcShellDisabled
= bNew
; }
734 BOOL
IsAutoCalcShellDisabled() const { return bAutoCalcShellDisabled
; }
735 // ForcedFormulas zu berechnen
736 void SetForcedFormulaPending( BOOL bNew
) { bForcedFormulaPending
= bNew
; }
737 BOOL
IsForcedFormulaPending() const { return bForcedFormulaPending
; }
738 // if CalcFormulaTree() is currently running
739 BOOL
IsCalculatingFormulaTree() { return bCalculatingFormulaTree
; }
741 USHORT
GetErrCode( const ScAddress
& ) const;
743 void GetDataArea( USHORT nTab
, USHORT
& rStartCol
, USHORT
& rStartRow
,
744 USHORT
& rEndCol
, USHORT
& rEndRow
, BOOL bIncludeOld
);
745 BOOL
GetCellArea( USHORT nTab
, USHORT
& rEndCol
, USHORT
& rEndRow
) const;
746 BOOL
GetTableArea( USHORT nTab
, USHORT
& rEndCol
, USHORT
& rEndRow
) const;
747 BOOL
GetPrintArea( USHORT nTab
, USHORT
& rEndCol
, USHORT
& rEndRow
,
748 BOOL bNotes
= TRUE
) const;
749 void InvalidateTableArea();
751 BOOL
GetDataStart( USHORT nTab
, USHORT
& rStartCol
, USHORT
& rStartRow
) const;
753 void ExtendPrintArea( OutputDevice
* pDev
, USHORT nTab
,
754 USHORT nStartCol
, USHORT nStartRow
,
755 USHORT
& rEndCol
, USHORT nEndRow
);
758 void GetNextPos( USHORT
& rCol
, USHORT
& rRow
, USHORT nTab
, short nMovX
, short nMovY
,
759 BOOL bMarked
, BOOL bUnprotected
, const ScMarkData
& rMark
);
761 BOOL
GetNextMarkedCell( USHORT
& rCol
, USHORT
& rRow
, USHORT nTab
,
762 const ScMarkData
& rMark
);
765 /*N*/ BOOL
InsertRow( USHORT nStartCol
, USHORT nStartTab
,
766 /*N*/ USHORT nEndCol
, USHORT nEndTab
,
767 /*N*/ USHORT nStartRow
, USHORT nSize
, ScDocument
* pRefUndoDoc
= NULL
);
768 /*N*/ BOOL
InsertRow( const ScRange
& rRange
, ScDocument
* pRefUndoDoc
= NULL
);
769 /*N*/ void DeleteRow( USHORT nStartCol
, USHORT nStartTab
,
770 /*N*/ USHORT nEndCol
, USHORT nEndTab
,
771 /*N*/ USHORT nStartRow
, USHORT nSize
,
772 /*N*/ ScDocument
* pRefUndoDoc
= NULL
, BOOL
* pUndoOutline
= NULL
);
773 /*N*/ void DeleteRow( const ScRange
& rRange
,
774 /*N*/ ScDocument
* pRefUndoDoc
= NULL
, BOOL
* pUndoOutline
= NULL
);
775 /*N*/ BOOL
InsertCol( USHORT nStartRow
, USHORT nStartTab
,
776 /*N*/ USHORT nEndRow
, USHORT nEndTab
,
777 /*N*/ USHORT nStartCol
, USHORT nSize
, ScDocument
* pRefUndoDoc
= NULL
);
778 /*N*/ BOOL
InsertCol( const ScRange
& rRange
, ScDocument
* pRefUndoDoc
= NULL
);
779 /*N*/ void DeleteCol( USHORT nStartRow
, USHORT nStartTab
,
780 /*N*/ USHORT nEndRow
, USHORT nEndTab
,
781 /*N*/ USHORT nStartCol
, USHORT nSize
,
782 /*N*/ ScDocument
* pRefUndoDoc
= NULL
, BOOL
* pUndoOutline
= NULL
);
783 /*N*/ void DeleteCol( const ScRange
& rRange
,
784 /*N*/ ScDocument
* pRefUndoDoc
= NULL
, BOOL
* pUndoOutline
= NULL
);
786 /*N*/ BOOL
CanInsertRow( const ScRange
& rRange
) const;
787 /*N*/ BOOL
CanInsertCol( const ScRange
& rRange
) const;
789 void FitBlock( const ScRange
& rOld
, const ScRange
& rNew
, BOOL bClear
= TRUE
);
790 BOOL
CanFitBlock( const ScRange
& rOld
, const ScRange
& rNew
);
792 BOOL
IsClipOrUndo() const { return bIsClip
|| bIsUndo
; }
793 BOOL
IsUndo() const { return bIsUndo
; }
794 BOOL
IsClipboard() const { return bIsClip
; }
795 BOOL
IsUndoEnabled() const { return !bImportingXML
; }
796 void ResetClip( ScDocument
* pSourceDoc
, const ScMarkData
* pMarks
);
800 void DeleteArea(USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
801 const ScMarkData
& rMark
, USHORT nDelFlag
);
802 void DeleteAreaTab(USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
803 USHORT nTab
, USHORT nDelFlag
);
804 void DeleteAreaTab(const ScRange
& rRange
, USHORT nDelFlag
);
805 void CopyToClip(USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
806 BOOL bCut
, ScDocument
* pClipDoc
, BOOL bAllTabs
,
807 const ScMarkData
* pMarks
= NULL
,
808 BOOL bKeepScenarioFlags
= FALSE
, BOOL bIncludeObjects
= FALSE
);
809 void CopyBlockFromClip( USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
810 const ScMarkData
& rMark
, short nDx
, short nDy
,
811 const ScCopyBlockFromClipParams
* pCBFCP
);
812 void CopyNonFilteredFromClip( USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
813 const ScMarkData
& rMark
, short nDx
, short nDy
,
814 const ScCopyBlockFromClipParams
* pCBFCP
);
815 void StartListeningFromClip( USHORT nCol1
, USHORT nRow1
,
816 USHORT nCol2
, USHORT nRow2
,
817 const ScMarkData
& rMark
, USHORT nInsFlag
);
818 void BroadcastFromClip( USHORT nCol1
, USHORT nRow1
,
819 USHORT nCol2
, USHORT nRow2
,
820 const ScMarkData
& rMark
, USHORT nInsFlag
);
821 void CopyFromClip( const ScRange
& rDestRange
, const ScMarkData
& rMark
,
823 ScDocument
* pRefUndoDoc
= NULL
,
824 ScDocument
* pClipDoc
= NULL
,
825 BOOL bResetCut
= TRUE
,
826 BOOL bAsLink
= FALSE
,
827 BOOL bIncludeFiltered
= TRUE
,
828 BOOL bSkipAttrForEmpty
= FALSE
);
830 void GetClipArea(USHORT
& nClipX
, USHORT
& nClipY
, BOOL bIncludeFiltered
);
833 void InitUndo( ScDocument
* pSrcDoc
, USHORT nTab1
, USHORT nTab2
,
834 BOOL bColInfo
= FALSE
, BOOL bRowInfo
= FALSE
);
836 // nicht mehr benutzen:
837 void CopyToDocument(USHORT nCol1
, USHORT nRow1
, USHORT nTab1
,
838 USHORT nCol2
, USHORT nRow2
, USHORT nTab2
,
839 USHORT nFlags
, BOOL bMarked
, ScDocument
* pDestDoc
,
840 const ScMarkData
* pMarks
= NULL
, BOOL bColRowFlags
= TRUE
);
842 void CopyToDocument(const ScRange
& rRange
,
843 USHORT nFlags
, BOOL bMarked
, ScDocument
* pDestDoc
,
844 const ScMarkData
* pMarks
= NULL
, BOOL bColRowFlags
= TRUE
);
846 const ScRangeList
* GetScenarioRanges( USHORT nTab
) const;
849 /*N*/ void UpdateReference( UpdateRefMode eUpdateRefMode
, USHORT nCol1
, USHORT nRow1
, USHORT nTab1
,
850 /*N*/ USHORT nCol2
, USHORT nRow2
, USHORT nTab2
,
851 /*N*/ short nDx
, short nDy
, short nDz
,
852 /*N*/ ScDocument
* pUndoDoc
= NULL
, BOOL bIncludeDraw
= TRUE
);
856 void Fill( USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
857 const ScMarkData
& rMark
,
858 USHORT nFillCount
, FillDir eFillDir
= FILL_TO_BOTTOM
,
859 FillCmd eFillCmd
= FILL_LINEAR
, FillDateCmd eFillDateCmd
= FILL_DAY
,
860 double nStepValue
= 1.0, double nMaxValue
= 1E307
);
862 BOOL
GetSelectionFunction( ScSubTotalFunc eFunc
,
863 const ScAddress
& rCursor
, const ScMarkData
& rMark
,
866 const SfxPoolItem
* GetAttr( USHORT nCol
, USHORT nRow
, USHORT nTab
, USHORT nWhich
) const;
867 const ScPatternAttr
* GetPattern( USHORT nCol
, USHORT nRow
, USHORT nTab
) const;
868 ScPatternAttr
* CreateSelectionPattern( const ScMarkData
& rMark
, BOOL bDeep
= TRUE
);
870 const ScConditionalFormat
* GetCondFormat( USHORT nCol
, USHORT nRow
, USHORT nTab
) const;
871 const SfxItemSet
* GetCondResult( USHORT nCol
, USHORT nRow
, USHORT nTab
) const;
873 const ::com::sun::star::uno::Reference
< ::com::sun::star::i18n::XBreakIterator
>& GetBreakIterator();
874 BYTE
GetStringScriptType( const String
& rString
);
875 BYTE
GetCellScriptType( ScBaseCell
* pCell
, ULONG nNumberFormat
);
876 BYTE
GetScriptType( USHORT nCol
, USHORT nRow
, USHORT nTab
, ScBaseCell
* pCell
= NULL
);
878 void AddDetectiveOperation( const ScDetOpData
& rData
);
879 void ClearDetectiveOperations();
880 ScDetOpList
* GetDetOpList() const { return pDetOpList
; }
882 BOOL
HasDetectiveObjects(USHORT nTab
) const;
884 void GetSelectionFrame( const ScMarkData
& rMark
,
885 SvxBoxItem
& rLineOuter
,
886 SvxBoxInfoItem
& rLineInner
);
887 void ApplySelectionFrame( const ScMarkData
& rMark
,
888 const SvxBoxItem
* pLineOuter
,
889 const SvxBoxInfoItem
* pLineInner
);
891 void ClearSelectionItems( const USHORT
* pWhich
, const ScMarkData
& rMark
);
892 void ChangeSelectionIndent( BOOL bIncrement
, const ScMarkData
& rMark
);
894 ULONG
AddCondFormat( const ScConditionalFormat
& rNew
);
895 void FindConditionalFormat( ULONG nKey
, ScRangeList
& rRanges
);
896 void FindConditionalFormat( ULONG nKey
, ScRangeList
& rRanges
, USHORT nTab
);
897 void ConditionalChanged( ULONG nKey
);
898 void SetConditionalUsed( ULONG nKey
); // beim Speichern
900 ULONG
AddValidationEntry( const ScValidationData
& rNew
);
901 void SetValidationUsed( ULONG nKey
); // beim Speichern
903 const ScValidationData
* GetValidationEntry( ULONG nIndex
) const;
905 ScConditionalFormatList
* GetCondFormList() const // Ref-Undo
906 { return pCondFormList
; }
908 ScValidationDataList
* GetValidationList() const
909 { return pValidationList
; }
911 void ApplyAttr( USHORT nCol
, USHORT nRow
, USHORT nTab
,
912 const SfxPoolItem
& rAttr
);
913 void ApplyPatternArea( USHORT nStartCol
, USHORT nStartRow
,
914 USHORT nEndCol
, USHORT nEndRow
,
915 const ScMarkData
& rMark
, const ScPatternAttr
& rAttr
);
916 void ApplyPatternAreaTab( USHORT nStartCol
, USHORT nStartRow
,
917 USHORT nEndCol
, USHORT nEndRow
, USHORT nTab
,
918 const ScPatternAttr
& rAttr
);
920 void ApplyStyleArea( USHORT nStartCol
, USHORT nStartRow
,
921 USHORT nEndCol
, USHORT nEndRow
,
922 const ScMarkData
& rMark
, const ScStyleSheet
& rStyle
);
923 void ApplyStyleAreaTab( USHORT nStartCol
, USHORT nStartRow
,
924 USHORT nEndCol
, USHORT nEndRow
, USHORT nTab
,
925 const ScStyleSheet
& rStyle
);
927 void ApplySelectionStyle( const ScStyleSheet
& rStyle
, const ScMarkData
& rMark
);
929 const ScStyleSheet
* GetSelectionStyle( const ScMarkData
& rMark
) const;
931 void StyleSheetChanged( const SfxStyleSheetBase
* pStyleSheet
, BOOL bRemoved
,
933 double nPPTX
, double nPPTY
,
934 const Fraction
& rZoomX
, const Fraction
& rZoomY
);
936 BOOL
IsStyleSheetUsed( const ScStyleSheet
& rStyle
, BOOL bGatherAllStyles
) const;
938 // Rueckgabe TRUE bei ApplyFlags: Wert geaendert
939 BOOL
ApplyFlagsTab( USHORT nStartCol
, USHORT nStartRow
,
940 USHORT nEndCol
, USHORT nEndRow
,
941 USHORT nTab
, INT16 nFlags
);
942 BOOL
RemoveFlagsTab( USHORT nStartCol
, USHORT nStartRow
,
943 USHORT nEndCol
, USHORT nEndRow
,
944 USHORT nTab
, INT16 nFlags
);
947 void AutoFormat( USHORT nStartCol
, USHORT nStartRow
, USHORT nEndCol
, USHORT nEndRow
,
948 USHORT nFormatNo
, const ScMarkData
& rMark
);
951 BOOL
Solver(USHORT nFCol
, USHORT nFRow
, USHORT nFTab
,
952 USHORT nVCol
, USHORT nVRow
, USHORT nVTab
,
953 const String
& sValStr
, double& nX
);
955 void ApplySelectionPattern( const ScPatternAttr
& rAttr
, const ScMarkData
& rMark
);
959 void SetColWidth( USHORT nCol
, USHORT nTab
, USHORT nNewWidth
);
960 void SetRowHeightRange( USHORT nStartRow
, USHORT nEndRow
, USHORT nTab
,
962 void SetManualHeight( USHORT nStartRow
, USHORT nEndRow
, USHORT nTab
, BOOL bManual
);
964 USHORT
GetColWidth( USHORT nCol
, USHORT nTab
) const;
965 USHORT
GetRowHeight( USHORT nRow
, USHORT nTab
) const;
967 USHORT
GetOriginalWidth( USHORT nCol
, USHORT nTab
) const;
968 USHORT
GetOriginalHeight( USHORT nRow
, USHORT nTab
) const;
971 inline USHORT
FastGetRowHeight( USHORT nRow
, USHORT nTab
) const; // ohne Ueberpruefungen!
973 USHORT
GetHiddenRowCount( USHORT nRow
, USHORT nTab
) const;
975 USHORT
GetOptimalColWidth( USHORT nCol
, USHORT nTab
, OutputDevice
* pDev
,
976 double nPPTX
, double nPPTY
,
977 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
979 const ScMarkData
* pMarkData
= NULL
,
980 BOOL bSimpleTextImport
= FALSE
);
981 BOOL
SetOptimalHeight( USHORT nStartRow
, USHORT nEndRow
, USHORT nTab
, USHORT nExtra
,
983 double nPPTX
, double nPPTY
,
984 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
987 void ShowCol(USHORT nCol
, USHORT nTab
, BOOL bShow
);
988 void ShowRows(USHORT nRow1
, USHORT nRow2
, USHORT nTab
, BOOL bShow
);
989 void SetRowFlags( USHORT nRow
, USHORT nTab
, BYTE nNewFlags
);
991 BYTE
GetColFlags( USHORT nCol
, USHORT nTab
) const;
992 BYTE
GetRowFlags( USHORT nRow
, USHORT nTab
) const;
994 /// @return the index of the last column with any set flags (auto-pagebreak is ignored).
995 /// @return the index of the last row with any set flags (auto-pagebreak is ignored).
997 /// @return the index of the last changed column (flags and column width, auto pagebreak is ignored).
998 USHORT
GetLastChangedCol( USHORT nTab
) const;
999 /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored).
1000 USHORT
GetLastChangedRow( USHORT nTab
) const;
1002 USHORT
GetNextDifferentChangedCol( USHORT nTab
, USHORT nStart
) const;
1004 // #108550#; if bCareManualSize is set then the row
1005 // heights are compared only if the manual size flag for
1006 // the row is set. If the bCareManualSize is not set then
1007 // the row heights are always compared.
1008 USHORT
GetNextDifferentChangedRow( USHORT nTab
, USHORT nStart
, bool bCareManualSize
= true) const;
1010 // returns whether to export a Default style for this col/row or not
1011 // nDefault is setted to one possition in the current row/col where the Default style is
1012 BOOL
GetColDefault( USHORT nTab
, USHORT nCol
, USHORT nLastRow
, USHORT
& nDefault
);
1013 BOOL
GetRowDefault( USHORT nTab
, USHORT nRow
, USHORT nLastCol
, USHORT
& nDefault
);
1016 BOOL
UpdateOutlineCol( USHORT nStartCol
, USHORT nEndCol
, USHORT nTab
, BOOL bShow
);
1017 BOOL
UpdateOutlineRow( USHORT nStartRow
, USHORT nEndRow
, USHORT nTab
, BOOL bShow
);
1019 ScPatternAttr
* GetDefPattern() const;
1020 ScDocumentPool
* GetPool();
1021 ScStyleSheetPool
* GetStyleSheetPool() const;
1024 const String
& GetPageStyle( USHORT nTab
) const;
1025 void SetPageStyle( USHORT nTab
, const String
& rName
);
1026 Size
GetPageSize( USHORT nTab
) const;
1027 void SetPageSize( USHORT nTab
, const Size
& rSize
);
1028 void SetRepeatArea( USHORT nTab
, USHORT nStartCol
, USHORT nEndCol
, USHORT nStartRow
, USHORT nEndRow
);
1029 void UpdatePageBreaks( USHORT nTab
, const ScRange
* pUserArea
= NULL
);
1030 void RemoveManualBreaks( USHORT nTab
);
1032 BOOL
RemovePageStyleInUse( const String
& rStrPageStyle
);
1036 // war vorher im PageStyle untergracht. Jetzt an jeder Tabelle:
1037 BOOL
HasPrintRange();
1038 USHORT
GetPrintRangeCount( USHORT nTab
);
1039 const ScRange
* GetPrintRange( USHORT nTab
, USHORT nPos
);
1040 const ScRange
* GetRepeatColRange( USHORT nTab
);
1041 const ScRange
* GetRepeatRowRange( USHORT nTab
);
1042 void SetPrintRangeCount( USHORT nTab
, USHORT nNew
);
1043 void SetPrintRange( USHORT nTab
, USHORT nPos
, const ScRange
& rNew
);
1044 void SetRepeatColRange( USHORT nTab
, const ScRange
* pNew
);
1045 void SetRepeatRowRange( USHORT nTab
, const ScRange
* pNew
);
1046 ScPrintRangeSaver
* CreatePrintRangeSaver() const;
1048 Rectangle
GetMMRect( USHORT nStartCol
, USHORT nStartRow
,
1049 USHORT nEndCol
, USHORT nEndRow
, USHORT nTab
);
1050 ScRange
GetRange( USHORT nTab
, const Rectangle
& rMMRect
);
1052 BOOL
LoadPool( SvStream
& rStream
, BOOL bLoadRefCounts
);
1053 BOOL
SavePool( SvStream
& rStream
) const;
1055 BOOL
Load( SvStream
& rStream
, ScProgress
* pProgress
);
1056 BOOL
Save( SvStream
& rStream
, ScProgress
* pProgress
) const;
1058 void UpdStlShtPtrsFrmNms();
1061 CharSet
GetSrcCharSet() const { return eSrcSet
; }
1062 ULONG
GetSrcVersion() const { return nSrcVer
; }
1063 USHORT
GetSrcMaxRow() const { return nSrcMaxRow
; }
1066 BOOL
HasLostData() const { return bLostData
; }
1068 void SetSrcCharSet( CharSet eNew
) { eSrcSet
= eNew
; }
1069 void UpdateFontCharSet();
1071 friend SvStream
& operator>>( SvStream
& rStream
, ScDocument
& rDocument
);
1072 friend SvStream
& operator<<( SvStream
& rStream
, const ScDocument
& rDocument
);
1074 SvNumberFormatter
* GetFormatTable() const;
1076 void Sort( USHORT nTab
, const ScSortParam
& rSortParam
, BOOL bKeepQuery
);
1077 USHORT
Query( USHORT nTab
, const ScQueryParam
& rQueryParam
, BOOL bKeepSub
);
1078 BOOL
CreateQueryParam( USHORT nCol1
, USHORT nRow1
, USHORT nCol2
, USHORT nRow2
,
1079 USHORT nTab
, ScQueryParam
& rQueryParam
);
1082 BOOL
HasColHeader( USHORT nStartCol
, USHORT nStartRow
, USHORT nEndCol
, USHORT nEndRow
,
1085 SfxPrinter
* GetPrinter();
1086 void SetPrinter( SfxPrinter
* pNewPrinter
);
1089 void DoColResize( USHORT nTab
, USHORT nCol1
, USHORT nCol2
, USHORT nAdd
);
1091 // Idleberechnung der OutputDevice-Zelltextbreite
1092 BOOL
IsLoadingDone() const { return bLoadingDone
; }
1093 void InvalidateTextWidth( const ScAddress
* pAdrFrom
= NULL
,
1094 const ScAddress
* pAdrTo
= NULL
,
1095 BOOL bBroadcast
= FALSE
);
1097 BOOL
IsIdleDisabled() const { return bIdleDisabled
; }
1098 void DisableIdle(BOOL bDo
) { bIdleDisabled
= bDo
; }
1100 BOOL
IsDetectiveDirty() const { return bDetectiveDirty
; }
1101 void SetDetectiveDirty(BOOL bSet
) { bDetectiveDirty
= bSet
; }
1103 BYTE
GetMacroCallMode() const { return nMacroCallMode
; }
1104 void SetMacroCallMode(BYTE nNew
) { nMacroCallMode
= nNew
; }
1106 BOOL
GetHasMacroFunc() const { return bHasMacroFunc
; }
1107 void SetHasMacroFunc(BOOL bSet
) { bHasMacroFunc
= bSet
; }
1109 BOOL
CheckMacroWarn();
1111 // fuer Broadcasting/Listening
1112 void SetNoSetDirty( BOOL bVal
) { bNoSetDirty
= bVal
; }
1113 BOOL
GetNoSetDirty() const { return bNoSetDirty
; }
1114 void SetInsertingFromOtherDoc( BOOL bVal
) { bInsertingFromOtherDoc
= bVal
; }
1115 BOOL
IsInsertingFromOtherDoc() const { return bInsertingFromOtherDoc
; }
1116 void SetImportingXML( BOOL bVal
);
1117 BOOL
IsImportingXML() const { return bImportingXML
; }
1118 void SetCalcingAfterLoad( BOOL bVal
) { bCalcingAfterLoad
= bVal
; }
1119 BOOL
IsCalcingAfterLoad() const { return bCalcingAfterLoad
; }
1120 void SetNoListening( BOOL bVal
) { bNoListening
= bVal
; }
1121 BOOL
GetNoListening() const { return bNoListening
; }
1123 ScChartListenerCollection
* GetChartListenerCollection() const
1124 { return pChartListenerCollection
; }
1125 void UpdateChart( const String
& rName
, Window
* pWin
);
1126 void UpdateChartListenerCollection();
1127 BOOL
IsChartListenerCollectionNeedsUpdate() const
1128 { return bChartListenerCollectionNeedsUpdate
; }
1129 void SetChartListenerCollectionNeedsUpdate( BOOL bFlg
)
1130 { bChartListenerCollectionNeedsUpdate
= bFlg
; }
1131 void AddOLEObjectToCollection(const String
& rName
);
1133 ScChangeViewSettings
* GetChangeViewSettings() const { return pChangeViewSettings
; }
1134 void SetChangeViewSettings(const ScChangeViewSettings
& rNew
);
1136 vos::ORef
<SvxForbiddenCharactersTable
> GetForbiddenCharacters();
1137 void SetForbiddenCharacters( const vos::ORef
<SvxForbiddenCharactersTable
> xNew
);
1139 BYTE
GetAsianCompression() const; // CharacterCompressionType values
1140 BOOL
IsValidAsianCompression() const;
1141 void SetAsianCompression(BYTE nNew
);
1143 BOOL
GetAsianKerning() const;
1144 BOOL
IsValidAsianKerning() const;
1145 void SetAsianKerning(BOOL bNew
);
1147 BYTE
GetEditTextDirection(USHORT nTab
) const; // EEHorizontalTextDirection values
1149 ScLkUpdMode
GetLinkMode() const { return eLinkMode
;}
1150 void SetLinkMode( ScLkUpdMode nSet
) { eLinkMode
= nSet
;}
1154 void SetAutoFilterFlags();
1156 DECL_LINK( TrackTimeHdl
, Timer
* );
1159 void StartListeningArea( const ScRange
& rRange
,
1160 SfxListener
* pListener
);
1161 void EndListeningArea( const ScRange
& rRange
,
1162 SfxListener
* pListener
);
1163 /** Broadcast wrapper, calls
1164 rHint.GetCell()->Broadcast() and AreaBroadcast()
1165 and TrackFormulas() and conditional format list
1169 void Broadcast( const ScHint
& rHint
);
1171 void Broadcast( ULONG nHint
, const ScAddress
& rAddr
,
1172 ScBaseCell
* pCell
);
1173 /// only area, no cell broadcast
1174 void AreaBroadcast( const ScHint
& rHint
);
1175 /// only areas in range, no cell broadcasts
1176 void AreaBroadcastInRange( const ScRange
& rRange
,
1177 const ScHint
& rHint
);
1178 void DelBroadcastAreasInRange( const ScRange
& rRange
);
1179 /*N*/ void UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode
,
1180 /*N*/ const ScRange
& rRange
,
1181 /*N*/ short nDx
, short nDy
, short nDz
);
1184 void StartListeningCell( const ScAddress
& rAddress
,
1185 SfxListener
* pListener
);
1186 void EndListeningCell( const ScAddress
& rAddress
,
1187 SfxListener
* pListener
);
1188 void PutInFormulaTree( ScFormulaCell
* pCell
);
1189 void RemoveFromFormulaTree( ScFormulaCell
* pCell
);
1190 void ClearFormulaTree();
1191 void AppendToFormulaTrack( ScFormulaCell
* pCell
);
1192 void RemoveFromFormulaTrack( ScFormulaCell
* pCell
);
1193 void TrackFormulas( ULONG nHintId
= SC_HINT_DATACHANGED
);
1194 USHORT
GetFormulaTrackCount() const { return nFormulaTrackCount
; }
1195 BOOL
IsInFormulaTree( ScFormulaCell
* pCell
) const;
1196 BOOL
IsInFormulaTrack( ScFormulaCell
* pCell
) const;
1197 USHORT
GetHardRecalcState() { return nHardRecalcState
; }
1198 void SetHardRecalcState( USHORT nVal
) { nHardRecalcState
= nVal
; }
1199 void StartAllListeners();
1200 const ScFormulaCell
* GetFormulaTree() const { return pFormulaTree
; }
1201 BOOL
HasForcedFormulas() const { return bHasForcedFormulas
; }
1202 void SetForcedFormulas( BOOL bVal
) { bHasForcedFormulas
= bVal
; }
1203 ULONG
GetFormulaCodeInTree() const { return nFormulaCodeInTree
; }
1204 BOOL
IsInInterpreter() const { return nInterpretLevel
!= 0; }
1205 USHORT
GetInterpretLevel() { return nInterpretLevel
; }
1206 void IncInterpretLevel()
1208 if ( nInterpretLevel
< USHRT_MAX
)
1211 void DecInterpretLevel()
1213 if ( nInterpretLevel
)
1216 BOOL
IsInMacroInterpreter() const { return nMacroInterpretLevel
!= 0; }
1217 USHORT
GetMacroInterpretLevel() { return nMacroInterpretLevel
; }
1218 void IncMacroInterpretLevel()
1220 if ( nMacroInterpretLevel
< USHRT_MAX
)
1221 nMacroInterpretLevel
++;
1223 void DecMacroInterpretLevel()
1225 if ( nMacroInterpretLevel
)
1226 nMacroInterpretLevel
--;
1228 BOOL
IsInInterpreterTableOp() const { return nInterpreterTableOpLevel
!= 0; }
1229 USHORT
GetInterpreterTableOpLevel() { return nInterpreterTableOpLevel
; }
1230 void IncInterpreterTableOpLevel()
1232 if ( nInterpreterTableOpLevel
< USHRT_MAX
)
1233 nInterpreterTableOpLevel
++;
1235 void DecInterpreterTableOpLevel()
1237 if ( nInterpreterTableOpLevel
)
1238 nInterpreterTableOpLevel
--;
1240 // add a formula to be remembered for TableOp broadcasts
1241 void AddTableOpFormulaCell( ScFormulaCell
* );
1242 void InvalidateLastTableOpParams() { aLastTableOpParams
.bValid
= FALSE
; }
1243 BOOL
IsInDtorClear() const { return bInDtorClear
; }
1244 void SetExpandRefs( BOOL bVal
) { bExpandRefs
= bVal
; }
1245 BOOL
IsExpandRefs() { return bExpandRefs
; }
1247 void IncSizeRecalcLevel( USHORT nTab
);
1248 void DecSizeRecalcLevel( USHORT nTab
);
1250 ULONG
GetXMLImportedFormulaCount() const { return nXMLImportedFormulaCount
; }
1251 void IncXMLImportedFormulaCount( ULONG nVal
)
1253 if ( nXMLImportedFormulaCount
+ nVal
> nXMLImportedFormulaCount
)
1254 nXMLImportedFormulaCount
+= nVal
;
1256 void DecXMLImportedFormulaCount( ULONG nVal
)
1258 if ( nVal
<= nXMLImportedFormulaCount
)
1259 nXMLImportedFormulaCount
-= nVal
;
1261 nXMLImportedFormulaCount
= 0;
1265 void CompileDBFormula();
1266 void CompileDBFormula( BOOL bCreateFormulaString
);
1267 void CompileNameFormula( BOOL bCreateFormulaString
);
1268 void CompileColRowNameFormula();
1270 // maximale Stringlaengen einer Column, fuer z.B. dBase Export
1273 ScChangeTrack
* GetChangeTrack() const { return pChangeTrack
; }
1275 //! only for import filter, deletes any existing ChangeTrack via
1276 //! EndChangeTracking() and takes ownership of new ChangeTrack pTrack
1277 void SetChangeTrack( ScChangeTrack
* pTrack
);
1279 /*N*/ void StartChangeTracking();
1280 /*N*/ void EndChangeTracking();
1283 void AddUnoObject( SfxListener
& rObject
);
1284 void RemoveUnoObject( SfxListener
& rObject
);
1285 void BroadcastUno( const SfxHint
&rHint
);
1287 void SetInLinkUpdate(BOOL bSet
); // TableLink or AreaLink
1289 SfxItemPool
* GetEditPool() const;
1290 SfxItemPool
* GetEnginePool() const;
1291 ScFieldEditEngine
& GetEditEngine();
1294 ScRefreshTimerControl
* GetRefreshTimerControl() const
1295 { return pRefreshTimerControl
; }
1296 ScRefreshTimerControl
* const * GetRefreshTimerControlAddress() const
1297 { return &pRefreshTimerControl
; }
1299 /// if symbol string cells of old binary file format are in list
1300 BOOL
SymbolStringCellsPending() const;
1301 /// get list of ScSymbolStringCellEntry, create if necessary
1302 List
& GetLoadedSymbolStringCellsList();
1304 void SetPastingDrawFromOtherDoc( BOOL bVal
)
1305 { bPastingDrawFromOtherDoc
= bVal
; }
1306 BOOL
PastingDrawFromOtherDoc() const
1307 { return bPastingDrawFromOtherDoc
; }
1309 /// an ID unique to each document instance
1311 void InvalidateStyleSheetUsage()
1312 { bStyleSheetUsageInvalid
= TRUE
; }
1314 private: // CLOOK-Impl-Methoden
1315 void ImplLoadDocOptions( SvStream
& rStream
);
1316 void ImplLoadViewOptions( SvStream
& rStream
);
1317 void ImplSaveDocOptions( SvStream
& rStream
) const;
1318 void ImplSaveViewOptions( SvStream
& rStream
) const;
1319 void ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen?
1320 void ImplDeleteOptions();
1322 void DeleteDrawLayer();
1323 void DeleteColorTable();
1324 void LoadDrawLayer(SvStream
& rStream
);
1325 void StoreDrawLayer(SvStream
& rStream
) const;
1326 BOOL
DrawGetPrintArea( ScRange
& rRange
, BOOL bSetHor
, BOOL bSetVer
) const;
1328 void UpdateDrawPrinter();
1329 void UpdateDrawLanguages();
1331 void LoadDdeLinks(SvStream
& rStream
);
1332 void SaveDdeLinks(SvStream
& rStream
) const;
1333 void LoadAreaLinks(SvStream
& rStream
);
1334 void SaveAreaLinks(SvStream
& rStream
) const;
1336 void UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode
,
1337 const ScRange
& r
, short nDx
, short nDy
, short nDz
);
1343 inline USHORT
ScDocument::FastGetRowHeight( USHORT nRow
, USHORT nTab
) const
1345 return ( pTab
[nTab
]->pRowFlags
[nRow
] & CR_HIDDEN
) ? 0 : pTab
[nTab
]->pRowHeight
[nRow
];
1350 } //namespace binfilter