merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / inc / table.hxx
blob63cefe22626a59f9048f884cf84f1bc925115459
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_TABLE_HXX
29 #define SC_TABLE_HXX
31 #include <vector>
32 #include <memory>
33 #include <utility>
34 #include <tools/gen.hxx>
35 #include <tools/color.hxx>
36 #include <com/sun/star/uno/Sequence.hxx>
37 #include "column.hxx"
38 #include "sortparam.hxx"
39 #include "compressedarray.hxx"
41 #include <memory>
42 #include <set>
43 #include <boost/shared_ptr.hpp>
45 namespace utl {
46 class SearchParam;
47 class TextSearch;
50 namespace com { namespace sun { namespace star {
51 namespace sheet {
52 struct TablePageBreakData;
54 } } }
56 class SfxItemSet;
57 class SfxStyleSheetBase;
58 class SvxBoxInfoItem;
59 class SvxBoxItem;
60 class SvxSearchItem;
62 class ScAutoFormat;
63 class ScAutoFormatData;
64 class ScBaseCell;
65 class ScDocument;
66 class ScDrawLayer;
67 class ScFormulaCell;
68 class ScOutlineTable;
69 class ScPostIt;
70 class ScPrintSaverTab;
71 class ScProgress;
72 class ScProgress;
73 class ScRangeList;
74 class ScSheetEvents;
75 class ScSortInfoArray;
76 class ScStyleSheet;
77 class ScTableLink;
78 class ScTableProtection;
79 class ScUserListData;
80 struct RowInfo;
81 struct ScFunctionData;
82 struct ScLineFlags;
83 class CollatorWrapper;
84 class ScFlatUInt16RowSegments;
85 class ScFlatBoolRowSegments;
86 class ScFlatBoolColSegments;
89 class ScTable
91 private:
92 typedef ::std::vector< ScRange > ScRangeVec;
93 typedef ::std::pair< SCCOL, SCROW > ScAddress2D;
94 typedef ::std::vector< ScAddress2D > ScAddress2DVec;
95 typedef ::std::auto_ptr< ScAddress2DVec > ScAddress2DVecPtr;
97 // Daten pro Tabelle ------------------
98 ScColumn aCol[MAXCOLCOUNT];
100 String aName;
101 String aCodeName;
102 String aComment;
103 BOOL bScenario;
104 BOOL bLayoutRTL;
105 BOOL bLoadingRTL;
107 String aLinkDoc;
108 String aLinkFlt;
109 String aLinkOpt;
110 String aLinkTab;
111 ULONG nLinkRefreshDelay;
112 BYTE nLinkMode;
114 // Seitenformatvorlage
115 String aPageStyle;
116 BOOL bPageSizeValid;
117 Size aPageSizeTwips; // Groesse der Druck-Seite
118 SCCOL nRepeatStartX; // Wiederholungszeilen/Spalten
119 SCCOL nRepeatEndX; // REPEAT_NONE, wenn nicht benutzt
120 SCROW nRepeatStartY;
121 SCROW nRepeatEndY;
123 ::std::auto_ptr<ScTableProtection> pTabProtection;
125 USHORT* pColWidth;
126 ::boost::shared_ptr<ScFlatUInt16RowSegments> mpRowHeights;
128 BYTE* pColFlags;
129 ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags;
130 ::boost::shared_ptr<ScFlatBoolColSegments> mpHiddenCols;
131 ::boost::shared_ptr<ScFlatBoolRowSegments> mpHiddenRows;
132 ::boost::shared_ptr<ScFlatBoolColSegments> mpFilteredCols;
133 ::boost::shared_ptr<ScFlatBoolRowSegments> mpFilteredRows;
135 ::std::set<SCROW> maRowPageBreaks;
136 ::std::set<SCROW> maRowManualBreaks;
137 ::std::set<SCCOL> maColPageBreaks;
138 ::std::set<SCCOL> maColManualBreaks;
140 ScOutlineTable* pOutlineTable;
142 ScSheetEvents* pSheetEvents;
144 SCCOL nTableAreaX;
145 SCROW nTableAreaY;
146 BOOL bTableAreaValid;
148 // interne Verwaltung ------------------
149 BOOL bVisible;
150 BOOL bStreamValid;
151 BOOL bPendingRowHeights;
152 BOOL bCalcNotification;
154 SCTAB nTab;
155 USHORT nRecalcLvl; // Rekursionslevel Size-Recalc
156 ScDocument* pDocument;
157 utl::SearchParam* pSearchParam;
158 utl::TextSearch* pSearchText;
160 mutable String aUpperName; // #i62977# filled only on demand, reset in SetName
162 ScAddress2DVecPtr mxUninitNotes;
164 // SortierParameter um den Stackbedarf von Quicksort zu Minimieren
165 ScSortParam aSortParam;
166 CollatorWrapper* pSortCollator;
167 BOOL bGlobalKeepQuery;
168 BOOL bSharedNameInserted;
170 ScRangeVec aPrintRanges;
171 BOOL bPrintEntireSheet;
173 ScRange* pRepeatColRange;
174 ScRange* pRepeatRowRange;
176 USHORT nLockCount;
178 ScRangeList* pScenarioRanges;
179 Color aScenarioColor;
180 Color aTabBgColor;
181 USHORT nScenarioFlags;
182 BOOL bActiveScenario;
183 bool mbPageBreaksValid;
185 friend class ScDocument; // fuer FillInfo
186 friend class ScDocumentIterator;
187 friend class ScValueIterator;
188 friend class ScDBQueryDataIterator;
189 friend class ScCellIterator;
190 friend class ScQueryCellIterator;
191 friend class ScHorizontalCellIterator;
192 friend class ScHorizontalAttrIterator;
193 friend class ScDocAttrIterator;
194 friend class ScAttrRectIterator;
197 public:
198 ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName,
199 BOOL bColInfo = TRUE, BOOL bRowInfo = TRUE );
200 ~ScTable();
202 ScOutlineTable* GetOutlineTable() { return pOutlineTable; }
204 SCSIZE GetCellCount(SCCOL nCol) const;
205 ULONG GetCellCount() const;
206 ULONG GetWeightedCount() const;
207 ULONG GetCodeCount() const; // RPN-Code in Formeln
209 BOOL SetOutlineTable( const ScOutlineTable* pNewOutline );
210 void StartOutlineTable();
212 void DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
214 BOOL TestRemoveSubTotals( const ScSubTotalParam& rParam );
215 void RemoveSubTotals( ScSubTotalParam& rParam );
216 BOOL DoSubTotals( ScSubTotalParam& rParam );
218 const ScSheetEvents* GetSheetEvents() const { return pSheetEvents; }
219 void SetSheetEvents( const ScSheetEvents* pNew );
221 BOOL IsVisible() const { return bVisible; }
222 void SetVisible( BOOL bVis );
224 BOOL IsStreamValid() const { return bStreamValid; }
225 void SetStreamValid( BOOL bSet, BOOL bIgnoreLock = FALSE );
227 BOOL IsPendingRowHeights() const { return bPendingRowHeights; }
228 void SetPendingRowHeights( BOOL bSet );
230 BOOL GetCalcNotification() const { return bCalcNotification; }
231 void SetCalcNotification( BOOL bSet );
233 BOOL IsLayoutRTL() const { return bLayoutRTL; }
234 BOOL IsLoadingRTL() const { return bLoadingRTL; }
235 void SetLayoutRTL( BOOL bSet );
236 void SetLoadingRTL( BOOL bSet );
238 BOOL IsScenario() const { return bScenario; }
239 void SetScenario( BOOL bFlag );
240 void GetScenarioComment( String& rComment) const { rComment = aComment; }
241 void SetScenarioComment( const String& rComment ) { aComment = rComment; }
242 const Color& GetScenarioColor() const { return aScenarioColor; }
243 void SetScenarioColor(const Color& rNew) { aScenarioColor = rNew; }
244 const Color& GetTabBgColor() const;
245 void SetTabBgColor(const Color& rColor);
246 USHORT GetScenarioFlags() const { return nScenarioFlags; }
247 void SetScenarioFlags(USHORT nNew) { nScenarioFlags = nNew; }
248 void SetActiveScenario(BOOL bSet) { bActiveScenario = bSet; }
249 BOOL IsActiveScenario() const { return bActiveScenario; }
251 BYTE GetLinkMode() const { return nLinkMode; }
252 BOOL IsLinked() const { return nLinkMode != SC_LINK_NONE; }
253 const String& GetLinkDoc() const { return aLinkDoc; }
254 const String& GetLinkFlt() const { return aLinkFlt; }
255 const String& GetLinkOpt() const { return aLinkOpt; }
256 const String& GetLinkTab() const { return aLinkTab; }
257 ULONG GetLinkRefreshDelay() const { return nLinkRefreshDelay; }
259 void SetLink( BYTE nMode, const String& rDoc, const String& rFlt,
260 const String& rOpt, const String& rTab, ULONG nRefreshDelay );
262 void GetName( String& rName ) const;
263 void SetName( const String& rNewName );
265 void GetCodeName( String& rName ) const { rName = aCodeName; }
266 void SetCodeName( const String& rNewName ) { aCodeName = rNewName; }
268 const String& GetUpperName() const;
270 const String& GetPageStyle() const { return aPageStyle; }
271 void SetPageStyle( const String& rName );
272 void PageStyleModified( const String& rNewName );
274 BOOL IsProtected() const;
275 void SetProtection(const ScTableProtection* pProtect);
276 ScTableProtection* GetProtection();
278 Size GetPageSize() const;
279 void SetPageSize( const Size& rSize );
280 void SetRepeatArea( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
282 void RemoveAutoSpellObj();
284 void LockTable();
285 void UnlockTable();
287 BOOL IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
288 SCROW nRow2, BOOL* pOnlyNotBecauseOfMatrix = NULL ) const;
289 BOOL IsSelectionEditable( const ScMarkData& rMark,
290 BOOL* pOnlyNotBecauseOfMatrix = NULL ) const;
292 BOOL HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const;
293 BOOL HasSelectionMatrixFragment( const ScMarkData& rMark ) const;
295 BOOL IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes = false ) const;
297 void PutCell( const ScAddress&, ScBaseCell* pCell );
298 //UNUSED2009-05 void PutCell( const ScAddress&, ULONG nFormatIndex, ScBaseCell* pCell);
299 void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell );
300 void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell);
301 // TRUE = Zahlformat gesetzt
302 BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
303 SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
304 void SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
305 void SetError( SCCOL nCol, SCROW nRow, USHORT nError);
307 void GetString( SCCOL nCol, SCROW nRow, String& rString );
308 void GetInputString( SCCOL nCol, SCROW nRow, String& rString );
309 double GetValue( const ScAddress& rPos ) const
311 return ValidColRow(rPos.Col(),rPos.Row()) ?
312 aCol[rPos.Col()].GetValue( rPos.Row() ) :
313 0.0;
315 double GetValue( SCCOL nCol, SCROW nRow );
316 void GetFormula( SCCOL nCol, SCROW nRow, String& rFormula,
317 BOOL bAsciiExport = FALSE );
319 CellType GetCellType( const ScAddress& rPos ) const
321 return ValidColRow(rPos.Col(),rPos.Row()) ?
322 aCol[rPos.Col()].GetCellType( rPos.Row() ) :
323 CELLTYPE_NONE;
325 CellType GetCellType( SCCOL nCol, SCROW nRow ) const;
326 ScBaseCell* GetCell( const ScAddress& rPos ) const
328 return ValidColRow(rPos.Col(),rPos.Row()) ?
329 aCol[rPos.Col()].GetCell( rPos.Row() ) :
330 NULL;
332 ScBaseCell* GetCell( SCCOL nCol, SCROW nRow ) const;
334 void GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const;
335 void GetLastDataPos(SCCOL& rCol, SCROW& rRow) const;
337 /** Returns the pointer to a cell note object at the passed cell address. */
338 ScPostIt* GetNote( SCCOL nCol, SCROW nRow );
339 /** Sets the passed cell note object at the passed cell address. Takes ownership! */
340 void TakeNote( SCCOL nCol, SCROW nRow, ScPostIt*& rpNote );
341 /** Returns and forgets the cell note object at the passed cell address. */
342 ScPostIt* ReleaseNote( SCCOL nCol, SCROW nRow );
343 /** Deletes the note at the passed cell address. */
344 void DeleteNote( SCCOL nCol, SCROW nRow );
345 /** Creates the captions of all uninitialized cell notes.
346 @param bForced True = always create all captions, false = skip when Undo is disabled. */
347 void InitializeNoteCaptions( bool bForced = false );
349 BOOL TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize );
350 void InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize );
351 void DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize,
352 BOOL* pUndoOutline = NULL );
354 BOOL TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize );
355 void InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize );
356 void DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize,
357 BOOL* pUndoOutline = NULL );
359 void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nDelFlag);
360 void CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable,
361 BOOL bKeepScenarioFlags, BOOL bCloneNoteCaptions);
362 void CopyToClip(const ScRangeList& rRanges, ScTable* pTable,
363 bool bKeepScenarioFlags, bool bCloneNoteCaptions);
364 void CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy,
365 USHORT nInsFlag, BOOL bAsLink, BOOL bSkipAttrForEmpty, ScTable* pTable);
366 void StartListeningInArea( SCCOL nCol1, SCROW nRow1,
367 SCCOL nCol2, SCROW nRow2 );
368 void BroadcastInArea( SCCOL nCol1, SCROW nRow1,
369 SCCOL nCol2, SCROW nRow2 );
371 void CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
372 USHORT nFlags, BOOL bMarked, ScTable* pDestTab,
373 const ScMarkData* pMarkData = NULL,
374 BOOL bAsLink = FALSE, BOOL bColRowFlags = TRUE);
375 void UndoToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
376 USHORT nFlags, BOOL bMarked, ScTable* pDestTab,
377 const ScMarkData* pMarkData = NULL);
379 void TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
380 ScTable* pTransClip, USHORT nFlags, BOOL bAsLink );
382 // Markierung von diesem Dokument
383 void MixMarked( const ScMarkData& rMark, USHORT nFunction,
384 BOOL bSkipEmpty, ScTable* pSrcTab );
385 void MixData( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
386 USHORT nFunction, BOOL bSkipEmpty, ScTable* pSrcTab );
388 void CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
389 SCCOL nDestCol, SCROW nDestRow, SCTAB nDestTab );
391 void CopyScenarioFrom( const ScTable* pSrcTab );
392 void CopyScenarioTo( ScTable* pDestTab ) const;
393 BOOL TestCopyScenarioTo( const ScTable* pDestTab ) const;
394 void MarkScenarioIn( ScMarkData& rMark, USHORT nNeededBits ) const;
395 BOOL HasScenarioRange( const ScRange& rRange ) const;
396 void InvalidateScenarioRanges();
397 const ScRangeList* GetScenarioRanges() const;
399 void CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const;
401 void InvalidateTableArea();
402 void InvalidatePageBreaks();
404 BOOL GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const; // FALSE = leer
405 BOOL GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const;
406 BOOL GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, BOOL bNotes ) const;
407 BOOL GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
408 SCCOL& rEndCol, BOOL bNotes ) const;
409 BOOL GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
410 SCROW& rEndRow, BOOL bNotes ) const;
412 BOOL GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const;
414 void ExtendPrintArea( OutputDevice* pDev,
415 SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow );
417 void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow,
418 BOOL bIncludeOld, bool bOnlyDown ) const;
420 bool ShrinkToUsedDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
422 SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
423 SCCOL nEndCol, SCROW nEndRow, ScDirection eDir );
425 void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY );
426 void GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
427 BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark );
429 void LimitChartArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow );
431 BOOL HasData( SCCOL nCol, SCROW nRow );
432 BOOL HasStringData( SCCOL nCol, SCROW nRow );
433 BOOL HasValueData( SCCOL nCol, SCROW nRow );
434 //UNUSED2008-05 USHORT GetErrorData(SCCOL nCol, SCROW nRow) const;
435 BOOL HasStringCells( SCCOL nStartCol, SCROW nStartRow,
436 SCCOL nEndCol, SCROW nEndRow ) const;
438 USHORT GetErrCode( const ScAddress& rPos ) const
440 return ValidColRow(rPos.Col(),rPos.Row()) ?
441 aCol[rPos.Col()].GetErrCode( rPos.Row() ) :
444 //UNUSED2008-05 USHORT GetErrCode( SCCOL nCol, SCROW nRow ) const;
446 void ResetChanged( const ScRange& rRange );
448 void SetDirty();
449 void SetDirty( const ScRange& );
450 void SetDirtyAfterLoad();
451 void SetDirtyVar();
452 void SetTableOpDirty( const ScRange& );
453 void CalcAll();
454 void CalcAfterLoad();
455 void CompileAll();
456 void CompileXML( ScProgress& rProgress );
458 void UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
459 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
460 SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
461 ScDocument* pUndoDoc = NULL, BOOL bIncludeDraw = TRUE, bool bUpdateNoteCaptionPos = true );
463 void UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
464 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
465 SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bUpdateNoteCaptionPos = true );
467 void UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
468 ScDocument* pUndoDoc );
470 void UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
472 void UpdateInsertTab(SCTAB nTable);
473 //UNUSED2008-05 void UpdateInsertTabOnlyCells(SCTAB nTable);
474 void UpdateDeleteTab( SCTAB nTable, BOOL bIsMove, ScTable* pRefUndo = NULL );
475 void UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo, ScProgress& );
476 void UpdateCompile( BOOL bForceIfNameInUse = FALSE );
477 void SetTabNo(SCTAB nNewTab);
478 BOOL IsRangeNameInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
479 USHORT nIndex) const;
480 void FindRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
481 std::set<USHORT>& rIndexes) const;
482 void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
483 const ScRangeData::IndexMap& rMap );
484 void Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
485 ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd,
486 double nStepValue, double nMaxValue);
487 String GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY );
489 void UpdateSelectionFunction( ScFunctionData& rData,
490 SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
491 const ScMarkData& rMark );
493 void AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
494 USHORT nFormatNo );
495 void GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData& rData);
496 void ScReplaceTabsStr( String& rStr, const String& rSrch, const String& rRepl ); // aus sw
497 BOOL SearchAndReplace(const SvxSearchItem& rSearchItem,
498 SCCOL& rCol, SCROW& rRow, ScMarkData& rMark,
499 String& rUndoStr, ScDocument* pUndoDoc);
501 void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 );
503 void GetBorderLines( SCCOL nCol, SCROW nRow,
504 const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop,
505 const SvxBorderLine** ppRight, const SvxBorderLine** ppBottom ) const;
507 //UNUSED2009-05 BOOL HasLines( const ScRange& rRange, Rectangle& rSizes ) const;
508 bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nMask ) const;
509 BOOL HasAttribSelection( const ScMarkData& rMark, USHORT nMask ) const;
510 BOOL ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
511 SCCOL& rEndCol, SCROW& rEndRow,
512 BOOL bRefresh, BOOL bAttrs );
513 const SfxPoolItem* GetAttr( SCCOL nCol, SCROW nRow, USHORT nWhich ) const;
514 const ScPatternAttr* GetPattern( SCCOL nCol, SCROW nRow ) const;
515 const ScPatternAttr* GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
517 ULONG GetNumberFormat( const ScAddress& rPos ) const
519 return ValidColRow(rPos.Col(),rPos.Row()) ?
520 aCol[rPos.Col()].GetNumberFormat( rPos.Row() ) :
523 ULONG GetNumberFormat( SCCOL nCol, SCROW nRow ) const;
524 void MergeSelectionPattern( ScMergePatternState& rState,
525 const ScMarkData& rMark, BOOL bDeep ) const;
526 void MergePatternArea( ScMergePatternState& rState, SCCOL nCol1, SCROW nRow1,
527 SCCOL nCol2, SCROW nRow2, BOOL bDeep ) const;
528 void MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
529 ScLineFlags& rFlags,
530 SCCOL nStartCol, SCROW nStartRow,
531 SCCOL nEndCol, SCROW nEndRow ) const;
532 void ApplyBlockFrame( const SvxBoxItem* pLineOuter,
533 const SvxBoxInfoItem* pLineInner,
534 SCCOL nStartCol, SCROW nStartRow,
535 SCCOL nEndCol, SCROW nEndRow );
537 void ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr );
538 void ApplyPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr );
539 void ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr& rAttr );
540 void SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, BOOL bPutToPool = FALSE )
542 if (ValidColRow(rPos.Col(),rPos.Row()))
543 aCol[rPos.Col()].SetPattern( rPos.Row(), rAttr, bPutToPool );
545 void SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, BOOL bPutToPool = FALSE );
546 void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
547 const ScPatternAttr& rPattern, short nNewType );
549 void ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet& rStyle );
550 void ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScStyleSheet& rStyle );
551 void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark);
552 void ApplySelectionLineStyle( const ScMarkData& rMark,
553 const SvxBorderLine* pLine, BOOL bColorOnly );
555 const ScStyleSheet* GetStyle( SCCOL nCol, SCROW nRow ) const;
556 const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const;
557 const ScStyleSheet* GetAreaStyle( BOOL& rFound, SCCOL nCol1, SCROW nRow1,
558 SCCOL nCol2, SCROW nRow2 ) const;
560 void StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRemoved,
561 OutputDevice* pDev,
562 double nPPTX, double nPPTY,
563 const Fraction& rZoomX, const Fraction& rZoomY );
565 BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const;
567 BOOL ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, INT16 nFlags );
568 BOOL RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, INT16 nFlags );
570 void ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark );
571 void DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark );
573 void ClearSelectionItems( const USHORT* pWhich, const ScMarkData& rMark );
574 void ChangeSelectionIndent( BOOL bIncrement, const ScMarkData& rMark );
576 const ScRange* GetRepeatColRange() const { return pRepeatColRange; }
577 const ScRange* GetRepeatRowRange() const { return pRepeatRowRange; }
578 void SetRepeatColRange( const ScRange* pNew );
579 void SetRepeatRowRange( const ScRange* pNew );
581 USHORT GetPrintRangeCount() const { return static_cast< USHORT >( aPrintRanges.size() ); }
582 const ScRange* GetPrintRange(USHORT nPos) const;
583 /** Returns true, if the sheet is always printed. */
584 BOOL IsPrintEntireSheet() const { return bPrintEntireSheet; }
586 /** Removes all print ranges. */
587 void ClearPrintRanges();
588 /** Adds a new print ranges. */
589 void AddPrintRange( const ScRange& rNew );
590 //UNUSED2009-05 /** Removes all old print ranges and sets the passed print ranges. */
591 //UNUSED2009-05 void SetPrintRange( const ScRange& rNew );
592 /** Marks the specified sheet to be printed completely. Deletes old print ranges! */
593 void SetPrintEntireSheet();
595 void FillPrintSaver( ScPrintSaverTab& rSaveTab ) const;
596 void RestorePrintRanges( const ScPrintSaverTab& rSaveTab );
598 USHORT GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev,
599 double nPPTX, double nPPTY,
600 const Fraction& rZoomX, const Fraction& rZoomY,
601 BOOL bFormula, const ScMarkData* pMarkData,
602 BOOL bSimpleTextImport );
603 BOOL SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, USHORT nExtra,
604 OutputDevice* pDev,
605 double nPPTX, double nPPTY,
606 const Fraction& rZoomX, const Fraction& rZoomY,
607 BOOL bForce,
608 ScProgress* pOuterProgress = NULL, ULONG nProgressStart = 0 );
609 long GetNeededSize( SCCOL nCol, SCROW nRow,
610 OutputDevice* pDev,
611 double nPPTX, double nPPTY,
612 const Fraction& rZoomX, const Fraction& rZoomY,
613 BOOL bWidth, BOOL bTotalSize );
614 void SetColWidth( SCCOL nCol, USHORT nNewWidth );
615 void SetRowHeight( SCROW nRow, USHORT nNewHeight );
616 BOOL SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeight,
617 double nPPTX, double nPPTY );
620 * Set specified row height to specified ranges. Don't check for drawing
621 * objects etc. Just set the row height. Nothing else.
623 * Note that setting a new row height via this function will not
624 * invalidate page breaks.
626 void SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeight );
628 // nPPT fuer Test auf Veraenderung
629 void SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual );
631 USHORT GetColWidth( SCCOL nCol ) const;
632 SC_DLLPUBLIC USHORT GetRowHeight( SCROW nRow, SCROW* pStartRow = NULL, SCROW* pEndRow = NULL, bool bHiddenAsZero = true ) const;
633 ULONG GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const;
634 ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const;
635 ULONG GetColOffset( SCCOL nCol ) const;
636 ULONG GetRowOffset( SCROW nRow ) const;
639 * Get the last row such that the height of row 0 to the end row is as
640 * high as possible without exceeding the specified height value.
642 * @param nHeight maximum desired height
644 * @return SCROW last row of the range within specified height.
646 SCROW GetRowForHeight(ULONG nHeight) const;
648 USHORT GetOriginalWidth( SCCOL nCol ) const;
649 USHORT GetOriginalHeight( SCROW nRow ) const;
651 USHORT GetCommonWidth( SCCOL nEndCol );
653 SCROW GetHiddenRowCount( SCROW nRow );
655 void ShowCol(SCCOL nCol, bool bShow);
656 void ShowRow(SCROW nRow, bool bShow);
657 void DBShowRow(SCROW nRow, bool bShow);
659 void ShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
660 void DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
662 void SetColFlags( SCCOL nCol, BYTE nNewFlags );
663 void SetRowFlags( SCROW nRow, BYTE nNewFlags );
664 void SetRowFlags( SCROW nStartRow, SCROW nEndRow, BYTE nNewFlags );
666 /// @return the index of the last row with any set flags (auto-pagebreak is ignored).
667 SCROW GetLastFlaggedRow() const;
669 /// @return the index of the last changed column (flags and column width, auto pagebreak is ignored).
670 SCCOL GetLastChangedCol() const;
671 /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored).
672 SCROW GetLastChangedRow() const;
674 BYTE GetColFlags( SCCOL nCol ) const;
675 BYTE GetRowFlags( SCROW nRow ) const;
677 const ScBitMaskCompressedArray< SCROW, BYTE> * GetRowFlagsArray() const
678 { return pRowFlags; }
680 BOOL UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow );
681 BOOL UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, BOOL bShow );
683 void UpdatePageBreaks( const ScRange* pUserArea );
684 void RemoveManualBreaks();
685 BOOL HasManualBreaks() const;
686 void SetRowManualBreaks( const ::std::set<SCROW>& rBreaks );
687 void SetColManualBreaks( const ::std::set<SCCOL>& rBreaks );
689 void GetAllRowBreaks(::std::set<SCROW>& rBreaks, bool bPage, bool bManual) const;
690 void GetAllColBreaks(::std::set<SCCOL>& rBreaks, bool bPage, bool bManual) const;
691 bool HasRowPageBreak(SCROW nRow) const;
692 bool HasColPageBreak(SCCOL nCol) const;
693 bool HasRowManualBreak(SCROW nRow) const;
694 bool HasColManualBreak(SCCOL nCol) const;
697 * Get the row position of the next manual break that occurs at or below
698 * specified row. When no more manual breaks are present at or below
699 * the specified row, -1 is returned.
701 * @param nRow row at which the search begins.
703 * @return SCROW next row position with manual page break, or -1 if no
704 * more manual breaks are present.
706 SCROW GetNextManualBreak(SCROW nRow) const;
708 void RemoveRowPageBreaks(SCROW nStartRow, SCROW nEndRow);
709 void RemoveRowBreak(SCROW nRow, bool bPage, bool bManual);
710 void RemoveColBreak(SCCOL nCol, bool bPage, bool bManual);
711 void SetRowBreak(SCROW nRow, bool bPage, bool bManual);
712 void SetColBreak(SCCOL nCol, bool bPage, bool bManual);
713 ::com::sun::star::uno::Sequence<
714 ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const;
716 bool RowHidden(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
717 bool RowHidden(SCROW nRow, SCROW& rLastRow) const;
718 bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const;
719 bool ColHidden(SCCOL nCol, SCCOL& rLastCol) const;
720 bool ColHidden(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
721 void SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden);
722 void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden);
723 void CopyColHidden(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol);
724 void CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow);
725 void CopyRowHeight(ScTable& rSrcTable, SCROW nStartRow, SCROW nEndRow, SCROW nSrcOffset);
726 SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow) const;
727 SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow) const;
728 SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow) const;
729 sal_uInt32 GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow) const;
731 SCCOLROW LastHiddenColRow(SCCOLROW nPos, bool bCol) const;
733 bool RowFiltered(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
734 bool ColFiltered(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
735 bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow) const;
736 void CopyColFiltered(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol);
737 void CopyRowFiltered(ScTable& rTable, SCROW nStartRow, SCROW nEndRow);
738 void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, bool bFiltered);
739 void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, bool bFiltered);
740 SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow) const;
741 SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow) const;
742 SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow) const;
744 void SyncColRowFlags();
746 void StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
747 void ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
749 void Sort(const ScSortParam& rSortParam, BOOL bKeepQuery);
750 BOOL ValidQuery(SCROW nRow, const ScQueryParam& rQueryParam,
751 BOOL* pSpecial = NULL, ScBaseCell* pCell = NULL,
752 BOOL* pbTestEqualCondition = NULL );
753 void TopTenQuery( ScQueryParam& );
754 SCSIZE Query(ScQueryParam& rQueryParam, BOOL bKeepSub);
755 BOOL CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
757 void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates);
758 void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates );
759 BOOL GetDataEntries(SCCOL nCol, SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit);
761 BOOL HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
762 BOOL HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
764 void DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd );
767 sal_Int32 GetMaxStringLen( SCCOL nCol,
768 SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
769 xub_StrLen GetMaxNumberStringLen( sal_uInt16& nPrecision,
770 SCCOL nCol,
771 SCROW nRowStart, SCROW nRowEnd ) const;
773 void FindConditionalFormat( ULONG nKey, ScRangeList& rRanges );
775 void IncRecalcLevel() { ++nRecalcLvl; }
776 void DecRecalcLevel( bool bUpdateNoteCaptionPos = true ) { if (!--nRecalcLvl) SetDrawPageSize(true, bUpdateNoteCaptionPos); }
778 BOOL IsSortCollatorGlobal() const;
779 void InitSortCollator( const ScSortParam& rPar );
780 void DestroySortCollator();
782 private:
783 void FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
784 ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd,
785 FillDateCmd eFillDateCmd,
786 double nStepValue, double nMaxValue, USHORT nMinDigits,
787 BOOL bAttribs, ScProgress& rProgress );
788 void FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
789 FillCmd& rCmd, FillDateCmd& rDateCmd,
790 double& rInc, USHORT& rMinDigits,
791 ScUserListData*& rListData, USHORT& rListIndex);
792 void FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
793 ULONG nFillCount, FillDir eFillDir, ScProgress& rProgress );
795 BOOL ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark,
796 BOOL bMarked, BOOL bUnprotected );
798 void AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
799 const ScPatternAttr& rAttr, USHORT nFormatNo);
800 void GetAutoFormatAttr(SCCOL nCol, SCROW nRow, USHORT nIndex, ScAutoFormatData& rData);
801 void GetAutoFormatFrame(SCCOL nCol, SCROW nRow, USHORT nFlags, USHORT nIndex, ScAutoFormatData& rData);
802 BOOL SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow,
803 const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc);
804 BOOL Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
805 const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc);
806 BOOL SearchAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark,
807 String& rUndoStr, ScDocument* pUndoDoc);
808 BOOL Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
809 const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc);
810 BOOL ReplaceAll(const SvxSearchItem& rSearchItem, ScMarkData& rMark,
811 String& rUndoStr, ScDocument* pUndoDoc);
813 BOOL SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
814 ScMarkData& rMark);
815 BOOL ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
816 ScMarkData& rMark, BOOL bIsUndo);
817 BOOL SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark);
818 BOOL ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark,
819 ScDocument* pUndoDoc);
821 // benutzen globalen SortParam:
822 BOOL IsSorted(SCCOLROW nStart, SCCOLROW nEnd);
823 void DecoladeRow( ScSortInfoArray*, SCROW nRow1, SCROW nRow2 );
824 void SwapCol(SCCOL nCol1, SCCOL nCol2);
825 void SwapRow(SCROW nRow1, SCROW nRow2);
826 short CompareCell( USHORT nSort,
827 ScBaseCell* pCell1, SCCOL nCell1Col, SCROW nCell1Row,
828 ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row );
829 short Compare(SCCOLROW nIndex1, SCCOLROW nIndex2);
830 short Compare( ScSortInfoArray*, SCCOLROW nIndex1, SCCOLROW nIndex2);
831 ScSortInfoArray* CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 );
832 void QuickSort( ScSortInfoArray*, SCsCOLROW nLo, SCsCOLROW nHi);
833 void SortReorder( ScSortInfoArray*, ScProgress& );
835 BOOL CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
836 BOOL CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
837 void GetUpperCellString(SCCOL nCol, SCROW nRow, String& rStr);
839 BOOL RefVisible(ScFormulaCell* pCell);
841 BOOL IsEmptyLine(SCROW nRow, SCCOL nStartCol, SCCOL nEndCol);
843 void IncDate(double& rVal, USHORT& nDayOfMonth, double nStep, FillDateCmd eCmd);
844 void FillFormula(ULONG& nFormulaCounter, BOOL bFirst, ScFormulaCell* pSrcCell,
845 SCCOL nDestCol, SCROW nDestRow, BOOL bLast );
846 void UpdateInsertTabAbs(SCTAB nNewPos);
847 BOOL GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, BOOL bInSel,
848 const ScMarkData& rMark) const;
849 BOOL GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark );
850 void SetDrawPageSize( bool bResetStreamValid = true, bool bUpdateNoteCaptionPos = true );
851 BOOL TestTabRefAbs(SCTAB nTable);
852 void CompileDBFormula();
853 void CompileDBFormula( BOOL bCreateFormulaString );
854 void CompileNameFormula( BOOL bCreateFormulaString );
855 void CompileColRowNameFormula();
857 void StartListening( const ScAddress& rAddress, SvtListener* pListener );
858 void EndListening( const ScAddress& rAddress, SvtListener* pListener );
859 void StartAllListeners();
860 void StartNeededListeners(); // only for cells where NeedsListening()==TRUE
861 void SetRelNameDirty();
863 void SetLoadingMedium(bool bLoading);
865 SCSIZE FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2,
866 SCCOL nCol, SCROW nAttrRow1, SCROW nAttrRow2, SCSIZE nArrY,
867 const ScPatternAttr* pPattern, const SfxItemSet* pCondSet );
869 // idle calculation of OutputDevice text width for cell
870 // also invalidates script type, broadcasts for "calc as shown"
871 void InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
872 BOOL bNumFormatChanged, BOOL bBroadcast );
875 * In case the cell text goes beyond the column width, move the max column
876 * position to the right. This is called from ExtendPrintArea.
878 void MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY);
881 * Use this to iterate through non-empty visible cells in a single column.
883 class VisibleDataCellIterator
885 public:
886 static SCROW ROW_NOT_FOUND;
888 explicit VisibleDataCellIterator(ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn);
889 ~VisibleDataCellIterator();
892 * Set the start row position. In case there is not visible data cell
893 * at the specified row position, it will move to the position of the
894 * first visible data cell below that point.
896 * @return First visible data cell if found, or NULL otherwise.
898 ScBaseCell* reset(SCROW nRow);
901 * Find the next visible data cell position.
903 * @return Next visible data cell if found, or NULL otherwise.
905 ScBaseCell* next();
908 * Get the current row position.
910 * @return Current row position, or ROW_NOT_FOUND if the iterator
911 * doesn't point to a valid data cell position.
913 SCROW getRow() const;
915 private:
916 ScFlatBoolRowSegments& mrRowSegs;
917 ScColumn& mrColumn;
918 ScBaseCell* mpCell;
919 SCROW mnCurRow;
920 SCROW mnUBound;
925 #endif