1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
25 #include <tools/gen.hxx>
26 #include <tools/color.hxx>
27 #include <com/sun/star/uno/Sequence.hxx>
29 #include "sortparam.hxx"
30 #include "compressedarray.hxx"
35 #include <boost/scoped_ptr.hpp>
36 #include <boost/noncopyable.hpp>
42 namespace com
{ namespace sun
{ namespace star
{
44 struct TablePageBreakData
;
49 class SfxStyleSheetBase
;
54 class ScAutoFormatData
;
57 class ScEditDataArray
;
60 class ScPrintSaverTab
;
64 class ScSortInfoArray
;
65 class ScConditionalFormat
;
66 class ScConditionalFormatList
;
68 class ScTableProtection
;
71 struct ScFunctionData
;
73 class CollatorWrapper
;
74 class ScFlatUInt16RowSegments
;
75 class ScFlatBoolRowSegments
;
76 class ScFlatBoolColSegments
;
77 struct ScSetStringParam
;
78 struct ScColWidthParam
;
79 struct ScColWidthParam
;
83 class ScTable
: boost::noncopyable
86 typedef ::std::vector
< ScRange
> ScRangeVec
;
87 typedef ::std::pair
< SCCOL
, SCROW
> ScAddress2D
;
88 typedef ::std::vector
< ScAddress2D
> ScAddress2DVec
;
90 ScColumn aCol
[MAXCOLCOUNT
];
93 rtl::OUString aCodeName
;
94 rtl::OUString aComment
;
96 rtl::OUString aLinkDoc
;
97 rtl::OUString aLinkFlt
;
98 rtl::OUString aLinkOpt
;
99 rtl::OUString aLinkTab
;
100 sal_uLong nLinkRefreshDelay
;
103 // page style template
104 rtl::OUString aPageStyle
;
105 Size aPageSizeTwips
; // size of the print-page
106 SCCOL nRepeatStartX
; // repeating rows/columns
107 SCCOL nRepeatEndX
; // REPEAT_NONE, if not used
111 boost::scoped_ptr
<ScTableProtection
> pTabProtection
;
113 sal_uInt16
* pColWidth
;
114 boost::scoped_ptr
<ScFlatUInt16RowSegments
> mpRowHeights
;
116 sal_uInt8
* pColFlags
;
117 ScBitMaskCompressedArray
< SCROW
, sal_uInt8
>* pRowFlags
;
118 boost::scoped_ptr
<ScFlatBoolColSegments
> mpHiddenCols
;
119 boost::scoped_ptr
<ScFlatBoolRowSegments
> mpHiddenRows
;
120 boost::scoped_ptr
<ScFlatBoolColSegments
> mpFilteredCols
;
121 boost::scoped_ptr
<ScFlatBoolRowSegments
> mpFilteredRows
;
123 ::std::set
<SCROW
> maRowPageBreaks
;
124 ::std::set
<SCROW
> maRowManualBreaks
;
125 ::std::set
<SCCOL
> maColPageBreaks
;
126 ::std::set
<SCCOL
> maColManualBreaks
;
128 ScOutlineTable
* pOutlineTable
;
130 ScSheetEvents
* pSheetEvents
;
132 mutable SCCOL nTableAreaX
;
133 mutable SCROW nTableAreaY
;
136 ScDocument
* pDocument
;
137 utl::TextSearch
* pSearchText
;
139 mutable rtl::OUString aUpperName
; // #i62977# filled only on demand, reset in SetName
141 boost::scoped_ptr
<ScAddress2DVec
> mxUninitNotes
;
143 // sort parameter to minimize stack size of quicksort
144 ScSortParam aSortParam
;
145 CollatorWrapper
* pSortCollator
;
147 ScRangeVec aPrintRanges
;
149 ScRange
* pRepeatColRange
;
150 ScRange
* pRepeatRowRange
;
152 sal_uInt16 nLockCount
;
154 ScRangeList
* pScenarioRanges
;
155 Color aScenarioColor
;
157 sal_uInt16 nScenarioFlags
;
158 ScDBData
* pDBDataNoName
;
159 mutable ScRangeName
* mpRangeName
;
161 boost::scoped_ptr
<ScConditionalFormatList
> mpCondFormatList
;
168 bool bPageSizeValid
:1;
169 mutable bool bTableAreaValid
:1;
172 bool bPendingRowHeights
:1;
173 bool bCalcNotification
:1;
174 bool bGlobalKeepQuery
:1;
175 bool bPrintEntireSheet
:1;
176 bool bActiveScenario
:1;
177 bool mbPageBreaksValid
:1;
179 friend class ScDocument
; // for FillInfo
180 friend class ScDocumentIterator
;
181 friend class ScValueIterator
;
182 friend class ScHorizontalValueIterator
;
183 friend class ScDBQueryDataIterator
;
184 friend class ScCellIterator
;
185 friend class ScQueryCellIterator
;
186 friend class ScHorizontalCellIterator
;
187 friend class ScHorizontalAttrIterator
;
188 friend class ScDocAttrIterator
;
189 friend class ScAttrRectIterator
;
193 ScTable( ScDocument
* pDoc
, SCTAB nNewTab
, const rtl::OUString
& rNewName
,
194 bool bColInfo
= true, bool bRowInfo
= true );
197 ScOutlineTable
* GetOutlineTable() { return pOutlineTable
; }
199 SCSIZE
GetCellCount(SCCOL nCol
) const;
200 sal_uLong
GetCellCount() const;
201 sal_uLong
GetWeightedCount() const;
202 sal_uLong
GetCodeCount() const; // RPN code in formula
204 bool SetOutlineTable( const ScOutlineTable
* pNewOutline
);
205 void StartOutlineTable();
207 void DoAutoOutline( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
);
209 bool TestRemoveSubTotals( const ScSubTotalParam
& rParam
);
210 void RemoveSubTotals( ScSubTotalParam
& rParam
);
211 bool DoSubTotals( ScSubTotalParam
& rParam
);
213 const ScSheetEvents
* GetSheetEvents() const { return pSheetEvents
; }
214 void SetSheetEvents( const ScSheetEvents
* pNew
);
216 bool IsVisible() const { return bVisible
; }
217 void SetVisible( bool bVis
);
219 bool IsStreamValid() const { return bStreamValid
; }
220 void SetStreamValid( bool bSet
, bool bIgnoreLock
= false );
222 bool IsPendingRowHeights() const { return bPendingRowHeights
; }
223 void SetPendingRowHeights( bool bSet
);
225 bool GetCalcNotification() const { return bCalcNotification
; }
226 void SetCalcNotification( bool bSet
);
228 bool IsLayoutRTL() const { return bLayoutRTL
; }
229 bool IsLoadingRTL() const { return bLoadingRTL
; }
230 void SetLayoutRTL( bool bSet
);
231 void SetLoadingRTL( bool bSet
);
233 bool IsScenario() const { return bScenario
; }
234 void SetScenario( bool bFlag
);
235 void GetScenarioComment( rtl::OUString
& rComment
) const { rComment
= aComment
; }
236 void SetScenarioComment( const rtl::OUString
& rComment
) { aComment
= rComment
; }
237 const Color
& GetScenarioColor() const { return aScenarioColor
; }
238 void SetScenarioColor(const Color
& rNew
) { aScenarioColor
= rNew
; }
239 const Color
& GetTabBgColor() const;
240 void SetTabBgColor(const Color
& rColor
);
241 sal_uInt16
GetScenarioFlags() const { return nScenarioFlags
; }
242 void SetScenarioFlags(sal_uInt16 nNew
) { nScenarioFlags
= nNew
; }
243 void SetActiveScenario(bool bSet
) { bActiveScenario
= bSet
; }
244 bool IsActiveScenario() const { return bActiveScenario
; }
246 sal_uInt8
GetLinkMode() const { return nLinkMode
; }
247 bool IsLinked() const { return nLinkMode
!= SC_LINK_NONE
; }
248 const rtl::OUString
& GetLinkDoc() const { return aLinkDoc
; }
249 const rtl::OUString
& GetLinkFlt() const { return aLinkFlt
; }
250 const rtl::OUString
& GetLinkOpt() const { return aLinkOpt
; }
251 const rtl::OUString
& GetLinkTab() const { return aLinkTab
; }
252 sal_uLong
GetLinkRefreshDelay() const { return nLinkRefreshDelay
; }
254 void SetLink( sal_uInt8 nMode
, const String
& rDoc
, const String
& rFlt
,
255 const String
& rOpt
, const String
& rTab
, sal_uLong nRefreshDelay
);
257 void GetName( rtl::OUString
& rName
) const;
258 void SetName( const rtl::OUString
& rNewName
);
260 void SetAnonymousDBData(ScDBData
* pDBData
);
261 ScDBData
* GetAnonymousDBData();
263 void GetCodeName( rtl::OUString
& rName
) const { rName
= aCodeName
; }
264 void SetCodeName( const rtl::OUString
& rNewName
) { aCodeName
= rNewName
; }
266 const rtl::OUString
& GetUpperName() const;
268 const rtl::OUString
& GetPageStyle() const { return aPageStyle
; }
269 void SetPageStyle( const rtl::OUString
& rName
);
270 void PageStyleModified( const String
& rNewName
);
272 bool IsProtected() const;
273 void SetProtection(const ScTableProtection
* pProtect
);
274 ScTableProtection
* GetProtection();
276 Size
GetPageSize() const;
277 void SetPageSize( const Size
& rSize
);
278 void SetRepeatArea( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCROW nEndRow
);
280 void RemoveAutoSpellObj();
285 bool IsBlockEditable( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
,
286 SCROW nRow2
, bool* pOnlyNotBecauseOfMatrix
= NULL
) const;
287 bool IsSelectionEditable( const ScMarkData
& rMark
,
288 bool* pOnlyNotBecauseOfMatrix
= NULL
) const;
290 bool HasBlockMatrixFragment( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
) const;
291 bool HasSelectionMatrixFragment( const ScMarkData
& rMark
) const;
293 bool IsBlockEmpty( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, bool bIgnoreNotes
= false ) const;
295 void PutCell( const ScAddress
&, ScBaseCell
* pCell
);
296 void PutCell( SCCOL nCol
, SCROW nRow
, ScBaseCell
* pCell
);
297 void PutCell(SCCOL nCol
, SCROW nRow
, sal_uLong nFormatIndex
, ScBaseCell
* pCell
);
298 // TRUE = numberformat set
299 bool SetString( SCCOL nCol
, SCROW nRow
, SCTAB nTab
, const String
& rString
,
300 ScSetStringParam
* pParam
= NULL
);
301 void SetValue( SCCOL nCol
, SCROW nRow
, const double& rVal
);
302 void SetError( SCCOL nCol
, SCROW nRow
, sal_uInt16 nError
);
304 void GetString( SCCOL nCol
, SCROW nRow
, rtl::OUString
& rString
) const;
305 void GetInputString( SCCOL nCol
, SCROW nRow
, rtl::OUString
& rString
) const;
306 double GetValue( const ScAddress
& rPos
) const
308 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
309 aCol
[rPos
.Col()].GetValue( rPos
.Row() ) :
312 double GetValue( SCCOL nCol
, SCROW nRow
) const;
313 void GetFormula( SCCOL nCol
, SCROW nRow
, rtl::OUString
& rFormula
);
315 CellType
GetCellType( const ScAddress
& rPos
) const
317 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
318 aCol
[rPos
.Col()].GetCellType( rPos
.Row() ) :
321 CellType
GetCellType( SCCOL nCol
, SCROW nRow
) const;
322 ScBaseCell
* GetCell( const ScAddress
& rPos
) const
324 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
325 aCol
[rPos
.Col()].GetCell( rPos
.Row() ) :
328 ScBaseCell
* GetCell( SCCOL nCol
, SCROW nRow
) const;
330 void GetFirstDataPos(SCCOL
& rCol
, SCROW
& rRow
) const;
331 void GetLastDataPos(SCCOL
& rCol
, SCROW
& rRow
) const;
334 /** Creates the captions of all uninitialized cell notes.
335 @param bForced True = always create all captions, false = skip when Undo is disabled. */
336 void InitializeNoteCaptions( bool bForced
= false );
338 bool TestInsertRow( SCCOL nStartCol
, SCCOL nEndCol
, SCSIZE nSize
) const;
339 void InsertRow( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
);
340 void DeleteRow( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
,
341 bool* pUndoOutline
= NULL
);
343 bool TestInsertCol( SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
) const;
344 void InsertCol( SCCOL nStartCol
, SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
);
345 void DeleteCol( SCCOL nStartCol
, SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
,
346 bool* pUndoOutline
= NULL
);
348 void DeleteArea(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, sal_uInt16 nDelFlag
);
349 void CopyToClip(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScTable
* pTable
,
350 bool bKeepScenarioFlags
, bool bCloneNoteCaptions
);
351 void CopyToClip(const ScRangeList
& rRanges
, ScTable
* pTable
,
352 bool bKeepScenarioFlags
, bool bCloneNoteCaptions
);
353 void CopyStaticToDocument(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScTable
* pDestTab
);
354 void CopyFromClip(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, SCsCOL nDx
, SCsROW nDy
,
355 sal_uInt16 nInsFlag
, bool bAsLink
, bool bSkipAttrForEmpty
, ScTable
* pTable
);
356 void StartListeningInArea( SCCOL nCol1
, SCROW nRow1
,
357 SCCOL nCol2
, SCROW nRow2
);
358 void BroadcastInArea( SCCOL nCol1
, SCROW nRow1
,
359 SCCOL nCol2
, SCROW nRow2
);
361 void CopyToTable(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
362 sal_uInt16 nFlags
, bool bMarked
, ScTable
* pDestTab
,
363 const ScMarkData
* pMarkData
= NULL
,
364 bool bAsLink
= false, bool bColRowFlags
= true);
365 void UndoToTable(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
366 sal_uInt16 nFlags
, bool bMarked
, ScTable
* pDestTab
,
367 const ScMarkData
* pMarkData
= NULL
);
369 void CopyConditionalFormat( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
370 SCsCOL nDx
, SCsROW nDy
, ScTable
* pTable
);
371 void TransposeClip( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
372 ScTable
* pTransClip
, sal_uInt16 nFlags
, bool bAsLink
);
374 // mark of this document
375 void MixMarked( const ScMarkData
& rMark
, sal_uInt16 nFunction
,
376 bool bSkipEmpty
, ScTable
* pSrcTab
);
377 void MixData( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
378 sal_uInt16 nFunction
, bool bSkipEmpty
, ScTable
* pSrcTab
);
380 void CopyData( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
381 SCCOL nDestCol
, SCROW nDestRow
, SCTAB nDestTab
);
383 void CopyScenarioFrom( const ScTable
* pSrcTab
);
384 void CopyScenarioTo( ScTable
* pDestTab
) const;
385 bool TestCopyScenarioTo( const ScTable
* pDestTab
) const;
386 void MarkScenarioIn( ScMarkData
& rMark
, sal_uInt16 nNeededBits
) const;
387 bool HasScenarioRange( const ScRange
& rRange
) const;
388 void InvalidateScenarioRanges();
389 const ScRangeList
* GetScenarioRanges() const;
391 void CopyUpdated( const ScTable
* pPosTab
, ScTable
* pDestTab
) const;
393 void InvalidateTableArea();
394 void InvalidatePageBreaks();
396 bool GetCellArea( SCCOL
& rEndCol
, SCROW
& rEndRow
) const; // FALSE = empty
397 bool GetTableArea( SCCOL
& rEndCol
, SCROW
& rEndRow
) const;
398 bool GetPrintArea( SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bNotes
, bool bFullFormattedArea
= false ) const;
399 bool GetPrintAreaHor( SCROW nStartRow
, SCROW nEndRow
,
400 SCCOL
& rEndCol
, bool bNotes
) const;
401 bool GetPrintAreaVer( SCCOL nStartCol
, SCCOL nEndCol
,
402 SCROW
& rEndRow
, bool bNotes
) const;
404 bool GetDataStart( SCCOL
& rStartCol
, SCROW
& rStartRow
) const;
406 void ExtendPrintArea( OutputDevice
* pDev
,
407 SCCOL nStartCol
, SCROW nStartRow
, SCCOL
& rEndCol
, SCROW nEndRow
);
409 void GetDataArea( SCCOL
& rStartCol
, SCROW
& rStartRow
, SCCOL
& rEndCol
, SCROW
& rEndRow
,
410 bool bIncludeOld
, bool bOnlyDown
) const;
412 bool ShrinkToUsedDataArea( bool& o_bShrunk
, SCCOL
& rStartCol
, SCROW
& rStartRow
,
413 SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bColumnsOnly
) const;
415 SCSIZE
GetEmptyLinesInBlock( SCCOL nStartCol
, SCROW nStartRow
,
416 SCCOL nEndCol
, SCROW nEndRow
, ScDirection eDir
) const;
418 void FindAreaPos( SCCOL
& rCol
, SCROW
& rRow
, ScMoveDirection eDirection
) const;
419 void GetNextPos( SCCOL
& rCol
, SCROW
& rRow
, SCsCOL nMovX
, SCsROW nMovY
,
420 bool bMarked
, bool bUnprotected
, const ScMarkData
& rMark
) const;
422 void LimitChartArea( SCCOL
& rStartCol
, SCROW
& rStartRow
, SCCOL
& rEndCol
, SCROW
& rEndRow
) const;
424 bool HasData( SCCOL nCol
, SCROW nRow
) const;
425 bool HasStringData( SCCOL nCol
, SCROW nRow
) const;
426 bool HasValueData( SCCOL nCol
, SCROW nRow
) const;
427 bool HasStringCells( SCCOL nStartCol
, SCROW nStartRow
,
428 SCCOL nEndCol
, SCROW nEndRow
) const;
430 sal_uInt16
GetErrCode( const ScAddress
& rPos
) const
432 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
433 aCol
[rPos
.Col()].GetErrCode( rPos
.Row() ) :
437 void ResetChanged( const ScRange
& rRange
);
440 void SetDirty( const ScRange
& );
441 void SetDirtyAfterLoad();
443 void SetTableOpDirty( const ScRange
& );
445 void CalcAfterLoad();
447 void CompileXML( ScProgress
& rProgress
);
449 bool CompileErrorCells(sal_uInt16 nErrCode
);
451 void UpdateReference( UpdateRefMode eUpdateRefMode
, SCCOL nCol1
, SCROW nRow1
, SCTAB nTab1
,
452 SCCOL nCol2
, SCROW nRow2
, SCTAB nTab2
,
453 SCsCOL nDx
, SCsROW nDy
, SCsTAB nDz
,
454 ScDocument
* pUndoDoc
= NULL
, bool bIncludeDraw
= true, bool bUpdateNoteCaptionPos
= true );
456 void UpdateDrawRef( UpdateRefMode eUpdateRefMode
, SCCOL nCol1
, SCROW nRow1
, SCTAB nTab1
,
457 SCCOL nCol2
, SCROW nRow2
, SCTAB nTab2
,
458 SCsCOL nDx
, SCsROW nDy
, SCsTAB nDz
, bool bUpdateNoteCaptionPos
= true );
460 void UpdateTranspose( const ScRange
& rSource
, const ScAddress
& rDest
,
461 ScDocument
* pUndoDoc
);
463 void UpdateGrow( const ScRange
& rArea
, SCCOL nGrowX
, SCROW nGrowY
);
465 void UpdateInsertTab(SCTAB nTable
, SCTAB nNewSheets
= 1);
466 void UpdateDeleteTab( SCTAB nTable
, bool bIsMove
, ScTable
* pRefUndo
= NULL
, SCTAB nSheets
= 1 );
467 void UpdateMoveTab(SCTAB nOldPos
, SCTAB nNewPos
, SCTAB nTabNo
, ScProgress
* pProgress
);
468 void UpdateCompile( bool bForceIfNameInUse
= false );
469 void SetTabNo(SCTAB nNewTab
);
470 void FindRangeNamesInUse(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
471 std::set
<sal_uInt16
>& rIndexes
) const;
472 void Fill( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
473 sal_uLong nFillCount
, FillDir eFillDir
, FillCmd eFillCmd
, FillDateCmd eFillDateCmd
,
474 double nStepValue
, double nMaxValue
, ScProgress
* pProgress
);
475 String
GetAutoFillPreview( const ScRange
& rSource
, SCCOL nEndX
, SCROW nEndY
);
477 void UpdateSelectionFunction( ScFunctionData
& rData
,
478 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
479 const ScMarkData
& rMark
);
481 void AutoFormat( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
482 sal_uInt16 nFormatNo
);
483 void GetAutoFormatData(SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, ScAutoFormatData
& rData
);
484 void ScReplaceTabsStr( String
& rStr
, const String
& rSrch
, const String
& rRepl
); // from sw
485 bool SearchAndReplace(
486 const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
,
487 ScRangeList
& rMatchedRanges
, rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
489 void FindMaxRotCol( RowInfo
* pRowInfo
, SCSIZE nArrCount
, SCCOL nX1
, SCCOL nX2
);
491 void GetBorderLines( SCCOL nCol
, SCROW nRow
,
492 const ::editeng::SvxBorderLine
** ppLeft
, const ::editeng::SvxBorderLine
** ppTop
,
493 const ::editeng::SvxBorderLine
** ppRight
, const ::editeng::SvxBorderLine
** ppBottom
) const;
495 bool HasAttrib( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, sal_uInt16 nMask
) const;
496 bool HasAttribSelection( const ScMarkData
& rMark
, sal_uInt16 nMask
) const;
497 bool ExtendMerge( SCCOL nStartCol
, SCROW nStartRow
,
498 SCCOL
& rEndCol
, SCROW
& rEndRow
,
500 const SfxPoolItem
* GetAttr( SCCOL nCol
, SCROW nRow
, sal_uInt16 nWhich
) const;
501 const ScPatternAttr
* GetPattern( SCCOL nCol
, SCROW nRow
) const;
502 const ScPatternAttr
* GetMostUsedPattern( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
) const;
504 sal_uLong
GetNumberFormat( const ScAddress
& rPos
) const
506 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
507 aCol
[rPos
.Col()].GetNumberFormat( rPos
.Row() ) :
510 sal_uLong
GetNumberFormat( SCCOL nCol
, SCROW nRow
) const;
511 sal_uInt32
GetNumberFormat( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
) const;
512 void MergeSelectionPattern( ScMergePatternState
& rState
,
513 const ScMarkData
& rMark
, bool bDeep
) const;
514 void MergePatternArea( ScMergePatternState
& rState
, SCCOL nCol1
, SCROW nRow1
,
515 SCCOL nCol2
, SCROW nRow2
, bool bDeep
) const;
516 void MergeBlockFrame( SvxBoxItem
* pLineOuter
, SvxBoxInfoItem
* pLineInner
,
518 SCCOL nStartCol
, SCROW nStartRow
,
519 SCCOL nEndCol
, SCROW nEndRow
) const;
520 void ApplyBlockFrame( const SvxBoxItem
* pLineOuter
,
521 const SvxBoxInfoItem
* pLineInner
,
522 SCCOL nStartCol
, SCROW nStartRow
,
523 SCCOL nEndCol
, SCROW nEndRow
);
525 void ApplyAttr( SCCOL nCol
, SCROW nRow
, const SfxPoolItem
& rAttr
);
526 void ApplyPattern( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
);
527 void ApplyPatternArea( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
528 const ScPatternAttr
& rAttr
, ScEditDataArray
* pDataArray
= NULL
);
529 bool SetAttrEntries(SCCOL nCol
, ScAttrEntry
* pData
, SCSIZE nSize
);
531 void SetPattern( const ScAddress
& rPos
, const ScPatternAttr
& rAttr
, bool bPutToPool
= false )
533 if (ValidColRow(rPos
.Col(),rPos
.Row()))
534 aCol
[rPos
.Col()].SetPattern( rPos
.Row(), rAttr
, bPutToPool
);
536 void SetPattern( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
, bool bPutToPool
= false );
537 void ApplyPatternIfNumberformatIncompatible( const ScRange
& rRange
,
538 const ScPatternAttr
& rPattern
, short nNewType
);
539 void AddCondFormatData( const ScRangeList
& rRange
, sal_uInt32 nIndex
);
540 void RemoveCondFormatData( const ScRangeList
& rRange
, sal_uInt32 nIndex
);
542 void ApplyStyle( SCCOL nCol
, SCROW nRow
, const ScStyleSheet
& rStyle
);
543 void ApplyStyleArea( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, const ScStyleSheet
& rStyle
);
544 void ApplySelectionStyle(const ScStyleSheet
& rStyle
, const ScMarkData
& rMark
);
545 void ApplySelectionLineStyle( const ScMarkData
& rMark
,
546 const ::editeng::SvxBorderLine
* pLine
, bool bColorOnly
);
548 const ScStyleSheet
* GetStyle( SCCOL nCol
, SCROW nRow
) const;
549 const ScStyleSheet
* GetSelectionStyle( const ScMarkData
& rMark
, bool& rFound
) const;
550 const ScStyleSheet
* GetAreaStyle( bool& rFound
, SCCOL nCol1
, SCROW nRow1
,
551 SCCOL nCol2
, SCROW nRow2
) const;
553 void StyleSheetChanged( const SfxStyleSheetBase
* pStyleSheet
, bool bRemoved
,
555 double nPPTX
, double nPPTY
,
556 const Fraction
& rZoomX
, const Fraction
& rZoomY
);
558 bool IsStyleSheetUsed( const ScStyleSheet
& rStyle
, bool bGatherAllStyles
) const;
560 bool ApplyFlags( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, sal_Int16 nFlags
);
561 bool RemoveFlags( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, sal_Int16 nFlags
);
563 void ApplySelectionCache( SfxItemPoolCache
* pCache
, const ScMarkData
& rMark
, ScEditDataArray
* pDataArray
= NULL
);
564 void DeleteSelection( sal_uInt16 nDelFlag
, const ScMarkData
& rMark
);
566 void ClearSelectionItems( const sal_uInt16
* pWhich
, const ScMarkData
& rMark
);
567 void ChangeSelectionIndent( bool bIncrement
, const ScMarkData
& rMark
);
569 const ScRange
* GetRepeatColRange() const { return pRepeatColRange
; }
570 const ScRange
* GetRepeatRowRange() const { return pRepeatRowRange
; }
571 void SetRepeatColRange( const ScRange
* pNew
);
572 void SetRepeatRowRange( const ScRange
* pNew
);
574 sal_uInt16
GetPrintRangeCount() const { return static_cast< sal_uInt16
>( aPrintRanges
.size() ); }
575 const ScRange
* GetPrintRange(sal_uInt16 nPos
) const;
576 /** Returns true, if the sheet is always printed. */
577 bool IsPrintEntireSheet() const { return bPrintEntireSheet
; }
579 /** Removes all print ranges. */
580 void ClearPrintRanges();
581 /** Adds a new print ranges. */
582 void AddPrintRange( const ScRange
& rNew
);
583 /** Marks the specified sheet to be printed completely. Deletes old print ranges! */
584 void SetPrintEntireSheet();
586 void FillPrintSaver( ScPrintSaverTab
& rSaveTab
) const;
587 void RestorePrintRanges( const ScPrintSaverTab
& rSaveTab
);
589 sal_uInt16
GetOptimalColWidth( SCCOL nCol
, OutputDevice
* pDev
,
590 double nPPTX
, double nPPTY
,
591 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
592 bool bFormula
, const ScMarkData
* pMarkData
,
593 const ScColWidthParam
* pParam
);
594 bool SetOptimalHeight( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nExtra
,
596 double nPPTX
, double nPPTY
,
597 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
599 ScProgress
* pOuterProgress
= NULL
, sal_uLong nProgressStart
= 0 );
601 void SetOptimalHeightOnly(SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nExtra
,
603 double nPPTX
, double nPPTY
,
604 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
606 ScProgress
* pOuterProgress
= NULL
, sal_uLong nProgressStart
= 0 );
608 long GetNeededSize( SCCOL nCol
, SCROW nRow
,
610 double nPPTX
, double nPPTY
,
611 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
612 bool bWidth
, bool bTotalSize
);
613 void SetColWidth( SCCOL nCol
, sal_uInt16 nNewWidth
);
614 void SetColWidthOnly( SCCOL nCol
, sal_uInt16 nNewWidth
);
615 void SetRowHeight( SCROW nRow
, sal_uInt16 nNewHeight
);
616 bool SetRowHeightRange( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 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
, sal_uInt16 nNewHeight
);
628 // nPPT to test for modification
629 void SetManualHeight( SCROW nStartRow
, SCROW nEndRow
, bool bManual
);
631 sal_uInt16
GetColWidth( SCCOL nCol
) const;
632 SC_DLLPUBLIC sal_uInt16
GetRowHeight( SCROW nRow
, SCROW
* pStartRow
= NULL
, SCROW
* pEndRow
= NULL
, bool bHiddenAsZero
= true ) const;
633 sal_uLong
GetRowHeight( SCROW nStartRow
, SCROW nEndRow
) const;
634 sal_uLong
GetScaledRowHeight( SCROW nStartRow
, SCROW nEndRow
, double fScale
) const;
635 sal_uLong
GetColOffset( SCCOL nCol
) const;
636 sal_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(sal_uLong nHeight
) const;
648 sal_uInt16
GetOriginalWidth( SCCOL nCol
) const;
649 sal_uInt16
GetOriginalHeight( SCROW nRow
) const;
651 sal_uInt16
GetCommonWidth( SCCOL nEndCol
) const;
653 SCROW
GetHiddenRowCount( SCROW nRow
) const;
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 SetRowFlags( SCROW nRow
, sal_uInt8 nNewFlags
);
663 void SetRowFlags( SCROW nStartRow
, SCROW nEndRow
, sal_uInt8 nNewFlags
);
665 /// @return the index of the last row with any set flags (auto-pagebreak is ignored).
666 SCROW
GetLastFlaggedRow() const;
668 /// @return the index of the last changed column (flags and column width, auto pagebreak is ignored).
669 SCCOL
GetLastChangedCol() const;
670 /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored).
671 SCROW
GetLastChangedRow() const;
673 bool IsDataFiltered(SCCOL nColStart
, SCROW nRowStart
, SCCOL nColEnd
, SCROW nRowEnd
) const;
674 bool IsDataFiltered(const ScRange
& rRange
) const;
675 sal_uInt8
GetColFlags( SCCOL nCol
) const;
676 sal_uInt8
GetRowFlags( SCROW nRow
) const;
678 const ScBitMaskCompressedArray
< SCROW
, sal_uInt8
> * GetRowFlagsArray() const
679 { return pRowFlags
; }
681 bool UpdateOutlineCol( SCCOL nStartCol
, SCCOL nEndCol
, bool bShow
);
682 bool UpdateOutlineRow( SCROW nStartRow
, SCROW nEndRow
, bool bShow
);
684 void UpdatePageBreaks( const ScRange
* pUserArea
);
685 void RemoveManualBreaks();
686 bool HasManualBreaks() const;
687 void SetRowManualBreaks( const ::std::set
<SCROW
>& rBreaks
);
688 void SetColManualBreaks( const ::std::set
<SCCOL
>& rBreaks
);
690 void GetAllRowBreaks(::std::set
<SCROW
>& rBreaks
, bool bPage
, bool bManual
) const;
691 void GetAllColBreaks(::std::set
<SCCOL
>& rBreaks
, bool bPage
, bool bManual
) const;
692 bool HasRowPageBreak(SCROW nRow
) const;
693 bool HasColPageBreak(SCCOL nCol
) const;
694 bool HasRowManualBreak(SCROW nRow
) const;
695 bool HasColManualBreak(SCCOL nCol
) const;
698 * Get the row position of the next manual break that occurs at or below
699 * specified row. When no more manual breaks are present at or below
700 * the specified row, -1 is returned.
702 * @param nRow row at which the search begins.
704 * @return SCROW next row position with manual page break, or -1 if no
705 * more manual breaks are present.
707 SCROW
GetNextManualBreak(SCROW nRow
) const;
709 void RemoveRowPageBreaks(SCROW nStartRow
, SCROW nEndRow
);
710 void RemoveRowBreak(SCROW nRow
, bool bPage
, bool bManual
);
711 void RemoveColBreak(SCCOL nCol
, bool bPage
, bool bManual
);
712 void SetRowBreak(SCROW nRow
, bool bPage
, bool bManual
);
713 void SetColBreak(SCCOL nCol
, bool bPage
, bool bManual
);
714 ::com::sun::star::uno::Sequence
<
715 ::com::sun::star::sheet::TablePageBreakData
> GetRowBreakData() const;
717 bool RowHidden(SCROW nRow
, SCROW
* pFirstRow
= NULL
, SCROW
* pLastRow
= NULL
) const;
718 bool RowHiddenLeaf(SCROW nRow
, SCROW
* pFirstRow
= NULL
, SCROW
* pLastRow
= NULL
) const;
719 bool HasHiddenRows(SCROW nStartRow
, SCROW nEndRow
) const;
720 bool ColHidden(SCCOL nCol
, SCCOL
* pFirstCol
= NULL
, SCCOL
* pLastCol
= NULL
) const;
721 bool SetRowHidden(SCROW nStartRow
, SCROW nEndRow
, bool bHidden
);
722 bool 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 bool IsManualRowHeight(SCROW nRow
) const;
746 void SyncColRowFlags();
748 void StripHidden( SCCOL
& rX1
, SCROW
& rY1
, SCCOL
& rX2
, SCROW
& rY2
);
749 void ExtendHidden( SCCOL
& rX1
, SCROW
& rY1
, SCCOL
& rX2
, SCROW
& rY2
);
751 void Sort(const ScSortParam
& rSortParam
, bool bKeepQuery
, ScProgress
* pProgress
);
753 SCROW nRow
, const ScQueryParam
& rQueryParam
, ScBaseCell
* pCell
= NULL
,
754 bool* pbTestEqualCondition
= NULL
);
755 void TopTenQuery( ScQueryParam
& );
756 SCSIZE
Query(ScQueryParam
& rQueryParam
, bool bKeepSub
);
757 bool CreateQueryParam(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
759 void GetFilterEntries(SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, std::vector
<ScTypedStrData
>& rStrings
, bool& rHasDates
);
760 void GetFilteredFilterEntries(SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, const ScQueryParam
& rParam
, std::vector
<ScTypedStrData
>& rStrings
, bool& rHasDates
);
761 bool GetDataEntries(SCCOL nCol
, SCROW nRow
, std::set
<ScTypedStrData
>& rStrings
, bool bLimit
);
763 bool HasColHeader( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
) const;
764 bool HasRowHeader( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
) const;
766 void DoColResize( SCCOL nCol1
, SCCOL nCol2
, SCSIZE nAdd
);
769 sal_Int32
GetMaxStringLen( SCCOL nCol
,
770 SCROW nRowStart
, SCROW nRowEnd
, CharSet eCharSet
) const;
771 xub_StrLen
GetMaxNumberStringLen( sal_uInt16
& nPrecision
,
773 SCROW nRowStart
, SCROW nRowEnd
) const;
775 bool IsSortCollatorGlobal() const;
776 void InitSortCollator( const ScSortParam
& rPar
);
777 void DestroySortCollator();
778 void SetDrawPageSize( bool bResetStreamValid
= true, bool bUpdateNoteCaptionPos
= true );
780 void SetRangeName(ScRangeName
* pNew
);
781 ScRangeName
* GetRangeName() const;
782 void UpdateMoveTab(SCTAB nOldPos
,SCTAB nNewPos
);
784 ScConditionalFormatList
* GetCondFormList();
785 const ScConditionalFormatList
* GetCondFormList() const;
786 void SetCondFormList( ScConditionalFormatList
* pList
);
788 void DeleteConditionalFormat(sal_uLong nOldIndex
);
790 sal_uLong
AddCondFormat( ScConditionalFormat
* pNew
);
793 void FillSeries( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
794 sal_uLong nFillCount
, FillDir eFillDir
, FillCmd eFillCmd
,
795 FillDateCmd eFillDateCmd
,
796 double nStepValue
, double nMaxValue
, sal_uInt16 nMinDigits
,
797 bool bAttribs
, ScProgress
* pProgress
);
798 void FillAnalyse( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
799 FillCmd
& rCmd
, FillDateCmd
& rDateCmd
,
800 double& rInc
, sal_uInt16
& rMinDigits
,
801 ScUserListData
*& rListData
, sal_uInt16
& rListIndex
);
802 void FillAuto( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
803 sal_uLong nFillCount
, FillDir eFillDir
, ScProgress
* pProgress
);
805 bool ValidNextPos( SCCOL nCol
, SCROW nRow
, const ScMarkData
& rMark
,
806 bool bMarked
, bool bUnprotected
) const;
808 void AutoFormatArea(SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
809 const ScPatternAttr
& rAttr
, sal_uInt16 nFormatNo
);
810 void GetAutoFormatAttr(SCCOL nCol
, SCROW nRow
, sal_uInt16 nIndex
, ScAutoFormatData
& rData
);
811 void GetAutoFormatFrame(SCCOL nCol
, SCROW nRow
, sal_uInt16 nFlags
, sal_uInt16 nIndex
, ScAutoFormatData
& rData
);
812 bool SearchCell(const SvxSearchItem
& rSearchItem
, SCCOL nCol
, SCROW nRow
,
813 const ScMarkData
& rMark
, rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
814 bool Search(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
815 const ScMarkData
& rMark
, rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
816 bool SearchAll(const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
,
817 ScRangeList
& rMatchedRanges
, rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
818 bool Replace(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
819 const ScMarkData
& rMark
, rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
821 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
822 rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
824 bool SearchStyle(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
825 const ScMarkData
& rMark
);
826 bool ReplaceStyle(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
827 const ScMarkData
& rMark
, bool bIsUndo
);
829 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
);
830 bool ReplaceAllStyle(
831 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
832 ScDocument
* pUndoDoc
);
833 bool SearchAndReplaceEmptyCells(
834 const SvxSearchItem
& rSearchItem
,
835 SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
836 rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
837 bool SearchRangeForEmptyCell(const ScRange
& rRange
,
838 const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
839 rtl::OUString
& rUndoStr
);
840 bool SearchRangeForAllEmptyCells(
841 const ScRange
& rRange
, const SvxSearchItem
& rSearchItem
,
842 ScRangeList
& rMatchedRanges
, rtl::OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
844 // use the global sort parameter:
845 bool IsSorted(SCCOLROW nStart
, SCCOLROW nEnd
) const;
846 void DecoladeRow( ScSortInfoArray
*, SCROW nRow1
, SCROW nRow2
);
847 void SwapCol(SCCOL nCol1
, SCCOL nCol2
);
848 void SwapRow(SCROW nRow1
, SCROW nRow2
);
849 short CompareCell( sal_uInt16 nSort
,
850 ScBaseCell
* pCell1
, SCCOL nCell1Col
, SCROW nCell1Row
,
851 ScBaseCell
* pCell2
, SCCOL nCell2Col
, SCROW nCell2Row
) const;
852 short Compare(SCCOLROW nIndex1
, SCCOLROW nIndex2
) const;
853 short Compare( ScSortInfoArray
*, SCCOLROW nIndex1
, SCCOLROW nIndex2
) const;
854 ScSortInfoArray
* CreateSortInfoArray( SCCOLROW nInd1
, SCCOLROW nInd2
);
855 void QuickSort( ScSortInfoArray
*, SCsCOLROW nLo
, SCsCOLROW nHi
);
856 void SortReorder( ScSortInfoArray
*, ScProgress
* );
858 bool CreateExcelQuery(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
859 bool CreateStarQuery(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
860 void GetUpperCellString(SCCOL nCol
, SCROW nRow
, rtl::OUString
& rStr
);
862 bool RefVisible(ScFormulaCell
* pCell
);
864 bool IsEmptyLine(SCROW nRow
, SCCOL nStartCol
, SCCOL nEndCol
) const;
866 void IncDate(double& rVal
, sal_uInt16
& nDayOfMonth
, double nStep
, FillDateCmd eCmd
);
867 void FillFormula(sal_uLong
& nFormulaCounter
, bool bFirst
, ScFormulaCell
* pSrcCell
,
868 SCCOL nDestCol
, SCROW nDestRow
, bool bLast
);
869 void UpdateInsertTabAbs(SCTAB nNewPos
);
870 bool GetNextSpellingCell(SCCOL
& rCol
, SCROW
& rRow
, bool bInSel
,
871 const ScMarkData
& rMark
) const;
872 bool GetNextMarkedCell( SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
) const;
873 bool TestTabRefAbs(SCTAB nTable
) const;
874 void CompileDBFormula();
875 void CompileDBFormula( bool bCreateFormulaString
);
876 void CompileNameFormula( bool bCreateFormulaString
);
877 void CompileColRowNameFormula();
879 void StartListening( const ScAddress
& rAddress
, SvtListener
* pListener
);
880 void EndListening( const ScAddress
& rAddress
, SvtListener
* pListener
);
881 void StartAllListeners();
882 void StartNeededListeners(); // only for cells where NeedsListening()==TRUE
883 void SetRelNameDirty();
885 void SetLoadingMedium(bool bLoading
);
887 SCSIZE
FillMaxRot( RowInfo
* pRowInfo
, SCSIZE nArrCount
, SCCOL nX1
, SCCOL nX2
,
888 SCCOL nCol
, SCROW nAttrRow1
, SCROW nAttrRow2
, SCSIZE nArrY
,
889 const ScPatternAttr
* pPattern
, const SfxItemSet
* pCondSet
);
891 // idle calculation of OutputDevice text width for cell
892 // also invalidates script type, broadcasts for "calc as shown"
893 void InvalidateTextWidth( const ScAddress
* pAdrFrom
, const ScAddress
* pAdrTo
,
894 bool bNumFormatChanged
, bool bBroadcast
);
896 void SkipFilteredRows(SCROW
& rRow
, SCROW
& rLastNonFilteredRow
, bool bForward
);
899 * In case the cell text goes beyond the column width, move the max column
900 * position to the right. This is called from ExtendPrintArea.
902 void MaybeAddExtraColumn(SCCOL
& rCol
, SCROW nRow
, OutputDevice
* pDev
, double nPPTX
, double nPPTY
);
904 void CopyPrintRange(const ScTable
& rTable
);
906 SCCOL
FindNextVisibleColWithContent(SCCOL nCol
, bool bRight
, SCROW nRow
) const;
908 SCCOL
FindNextVisibleCol(SCCOL nCol
, bool bRight
) const;
911 * Use this to iterate through non-empty visible cells in a single column.
913 class VisibleDataCellIterator
916 static SCROW ROW_NOT_FOUND
;
918 explicit VisibleDataCellIterator(ScFlatBoolRowSegments
& rRowSegs
, ScColumn
& rColumn
);
919 ~VisibleDataCellIterator();
922 * Set the start row position. In case there is not visible data cell
923 * at the specified row position, it will move to the position of the
924 * first visible data cell below that point.
926 * @return First visible data cell if found, or NULL otherwise.
928 ScBaseCell
* reset(SCROW nRow
);
931 * Find the next visible data cell position.
933 * @return Next visible data cell if found, or NULL otherwise.
938 * Get the current row position.
940 * @return Current row position, or ROW_NOT_FOUND if the iterator
941 * doesn't point to a valid data cell position.
943 SCROW
getRow() const;
946 ScFlatBoolRowSegments
& mrRowSegs
;
958 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */