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"
33 #include "cellvalue.hxx"
34 #include "formula/types.hxx"
35 #include "calcmacros.hxx"
39 #include <boost/scoped_ptr.hpp>
40 #include <boost/noncopyable.hpp>
46 namespace com
{ namespace sun
{ namespace star
{
48 struct TablePageBreakData
;
52 namespace formula
{ struct VectorRefArray
; }
55 struct FormulaGroupContext
;
56 class StartListeningContext
;
57 class EndListeningContext
;
58 class CopyFromClipContext
;
59 class CopyToClipContext
;
60 class CopyToDocContext
;
64 struct ColumnBlockPosition
;
65 struct RefUpdateContext
;
66 struct RefUpdateInsertTabContext
;
67 struct RefUpdateDeleteTabContext
;
68 struct RefUpdateMoveTabContext
;
74 class SfxStyleSheetBase
;
79 class ScAutoFormatData
;
81 class ScEditDataArray
;
84 class ScPrintSaverTab
;
88 class ScSortInfoArray
;
89 class ScConditionalFormat
;
90 class ScConditionalFormatList
;
92 class ScTableProtection
;
95 struct ScFunctionData
;
97 class CollatorWrapper
;
98 class ScFlatUInt16RowSegments
;
99 class ScFlatBoolRowSegments
;
100 class ScFlatBoolColSegments
;
101 struct ScSetStringParam
;
102 struct ScColWidthParam
;
103 struct ScColWidthParam
;
106 class ScDocumentImport
;
108 class ScTable
: boost::noncopyable
111 typedef ::std::vector
< ScRange
> ScRangeVec
;
113 ScColumn aCol
[MAXCOLCOUNT
];
123 sal_uLong nLinkRefreshDelay
;
126 // page style template
128 Size aPageSizeTwips
; // size of the print-page
129 SCCOL nRepeatStartX
; // repeating rows/columns
130 SCCOL nRepeatEndX
; // REPEAT_NONE, if not used
134 boost::scoped_ptr
<ScTableProtection
> pTabProtection
;
136 sal_uInt16
* pColWidth
;
137 boost::scoped_ptr
<ScFlatUInt16RowSegments
> mpRowHeights
;
139 sal_uInt8
* pColFlags
;
140 ScBitMaskCompressedArray
< SCROW
, sal_uInt8
>* pRowFlags
;
141 boost::scoped_ptr
<ScFlatBoolColSegments
> mpHiddenCols
;
142 boost::scoped_ptr
<ScFlatBoolRowSegments
> mpHiddenRows
;
143 boost::scoped_ptr
<ScFlatBoolColSegments
> mpFilteredCols
;
144 boost::scoped_ptr
<ScFlatBoolRowSegments
> mpFilteredRows
;
146 ::std::set
<SCROW
> maRowPageBreaks
;
147 ::std::set
<SCROW
> maRowManualBreaks
;
148 ::std::set
<SCCOL
> maColPageBreaks
;
149 ::std::set
<SCCOL
> maColManualBreaks
;
151 ScOutlineTable
* pOutlineTable
;
153 ScSheetEvents
* pSheetEvents
;
155 mutable SCCOL nTableAreaX
;
156 mutable SCROW nTableAreaY
;
159 ScDocument
* pDocument
;
160 utl::TextSearch
* pSearchText
;
162 mutable OUString aUpperName
; // #i62977# filled only on demand, reset in SetName
164 // sort parameter to minimize stack size of quicksort
165 ScSortParam aSortParam
;
166 CollatorWrapper
* pSortCollator
;
168 ScRangeVec aPrintRanges
;
170 ScRange
* pRepeatColRange
;
171 ScRange
* pRepeatRowRange
;
173 sal_uInt16 nLockCount
;
175 ScRangeList
* pScenarioRanges
;
176 Color aScenarioColor
;
178 sal_uInt16 nScenarioFlags
;
179 ScDBData
* pDBDataNoName
;
180 mutable ScRangeName
* mpRangeName
;
182 boost::scoped_ptr
<ScConditionalFormatList
> mpCondFormatList
;
187 bool bPageSizeValid
:1;
188 mutable bool bTableAreaValid
:1;
191 bool bPendingRowHeights
:1;
192 bool bCalcNotification
:1;
193 bool bGlobalKeepQuery
:1;
194 bool bPrintEntireSheet
:1;
195 bool bActiveScenario
:1;
196 bool mbPageBreaksValid
:1;
197 bool mbForceBreaks
:1;
199 friend class ScDocument
; // for FillInfo
200 friend class ScValueIterator
;
201 friend class ScHorizontalValueIterator
;
202 friend class ScDBQueryDataIterator
;
203 friend class ScCellIterator
;
204 friend class ScQueryCellIterator
;
205 friend class ScHorizontalCellIterator
;
206 friend class ScHorizontalAttrIterator
;
207 friend class ScDocAttrIterator
;
208 friend class ScAttrRectIterator
;
209 friend class ScColumnTextWidthIterator
;
210 friend class ScDocumentImport
;
211 friend class sc::ColumnSpanSet
;
212 friend class sc::EditTextIterator
;
215 ScTable( ScDocument
* pDoc
, SCTAB nNewTab
, const OUString
& rNewName
,
216 bool bColInfo
= true, bool bRowInfo
= true );
219 ScDocument
& GetDoc();
220 const ScDocument
& GetDoc() const;
221 SCTAB
GetTab() const { return nTab
; }
223 ScOutlineTable
* GetOutlineTable() { return pOutlineTable
; }
225 SCSIZE
GetCellCount(SCCOL nCol
) const;
226 sal_uLong
GetCellCount() const;
227 sal_uLong
GetWeightedCount() const;
228 sal_uLong
GetCodeCount() const; // RPN code in formula
230 sal_uInt16
GetTextWidth(SCCOL nCol
, SCROW nRow
) const;
232 bool SetOutlineTable( const ScOutlineTable
* pNewOutline
);
233 void StartOutlineTable();
235 void DoAutoOutline( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
);
237 bool TestRemoveSubTotals( const ScSubTotalParam
& rParam
);
238 void RemoveSubTotals( ScSubTotalParam
& rParam
);
239 bool DoSubTotals( ScSubTotalParam
& rParam
);
241 void MarkSubTotalCells( sc::ColumnSpanSet
& rSet
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, bool bVal
) const;
243 const ScSheetEvents
* GetSheetEvents() const { return pSheetEvents
; }
244 void SetSheetEvents( const ScSheetEvents
* pNew
);
246 bool IsVisible() const { return bVisible
; }
247 void SetVisible( bool bVis
);
249 bool IsStreamValid() const { return bStreamValid
; }
250 void SetStreamValid( bool bSet
, bool bIgnoreLock
= false );
252 bool IsPendingRowHeights() const { return bPendingRowHeights
; }
253 void SetPendingRowHeights( bool bSet
);
255 bool GetCalcNotification() const { return bCalcNotification
; }
256 void SetCalcNotification( bool bSet
);
258 bool IsLayoutRTL() const { return bLayoutRTL
; }
259 bool IsLoadingRTL() const { return bLoadingRTL
; }
260 void SetLayoutRTL( bool bSet
);
261 void SetLoadingRTL( bool bSet
);
263 bool IsScenario() const { return bScenario
; }
264 void SetScenario( bool bFlag
);
265 void GetScenarioComment( OUString
& rComment
) const { rComment
= aComment
; }
266 void SetScenarioComment( const OUString
& rComment
) { aComment
= rComment
; }
267 const Color
& GetScenarioColor() const { return aScenarioColor
; }
268 void SetScenarioColor(const Color
& rNew
) { aScenarioColor
= rNew
; }
269 const Color
& GetTabBgColor() const;
270 void SetTabBgColor(const Color
& rColor
);
271 sal_uInt16
GetScenarioFlags() const { return nScenarioFlags
; }
272 void SetScenarioFlags(sal_uInt16 nNew
) { nScenarioFlags
= nNew
; }
273 void SetActiveScenario(bool bSet
) { bActiveScenario
= bSet
; }
274 bool IsActiveScenario() const { return bActiveScenario
; }
276 sal_uInt8
GetLinkMode() const { return nLinkMode
; }
277 bool IsLinked() const { return nLinkMode
!= SC_LINK_NONE
; }
278 const OUString
& GetLinkDoc() const { return aLinkDoc
; }
279 const OUString
& GetLinkFlt() const { return aLinkFlt
; }
280 const OUString
& GetLinkOpt() const { return aLinkOpt
; }
281 const OUString
& GetLinkTab() const { return aLinkTab
; }
282 sal_uLong
GetLinkRefreshDelay() const { return nLinkRefreshDelay
; }
284 void SetLink( sal_uInt8 nMode
, const OUString
& rDoc
, const OUString
& rFlt
,
285 const OUString
& rOpt
, const OUString
& rTab
, sal_uLong nRefreshDelay
);
287 void GetName( OUString
& rName
) const;
288 void SetName( const OUString
& rNewName
);
290 void SetAnonymousDBData(ScDBData
* pDBData
);
291 ScDBData
* GetAnonymousDBData();
293 void GetCodeName( OUString
& rName
) const { rName
= aCodeName
; }
294 void SetCodeName( const OUString
& rNewName
) { aCodeName
= rNewName
; }
296 const OUString
& GetUpperName() const;
298 const OUString
& GetPageStyle() const { return aPageStyle
; }
299 void SetPageStyle( const OUString
& rName
);
300 void PageStyleModified( const OUString
& rNewName
);
302 bool IsProtected() const;
303 void SetProtection(const ScTableProtection
* pProtect
);
304 ScTableProtection
* GetProtection();
306 Size
GetPageSize() const;
307 void SetPageSize( const Size
& rSize
);
308 void SetRepeatArea( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCROW nEndRow
);
313 bool IsBlockEditable( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
,
314 SCROW nRow2
, bool* pOnlyNotBecauseOfMatrix
= NULL
) const;
315 bool IsSelectionEditable( const ScMarkData
& rMark
,
316 bool* pOnlyNotBecauseOfMatrix
= NULL
) const;
318 bool HasBlockMatrixFragment( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
) const;
319 bool HasSelectionMatrixFragment( const ScMarkData
& rMark
) const;
321 bool IsBlockEmpty( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, bool bIgnoreNotes
= false ) const;
323 bool SetString( SCCOL nCol
, SCROW nRow
, SCTAB nTab
, const OUString
& rString
,
324 ScSetStringParam
* pParam
= NULL
);
326 void SetEditText( SCCOL nCol
, SCROW nRow
, EditTextObject
* pEditText
);
327 void SetEditText( SCCOL nCol
, SCROW nRow
, const EditTextObject
& rEditText
, const SfxItemPool
* pEditPool
);
329 void SetEmptyCell( SCCOL nCol
, SCROW nRow
);
331 SCCOL nCol
, SCROW nRow
, const ScTokenArray
& rArray
, formula::FormulaGrammar::Grammar eGram
);
333 SCCOL nCol
, SCROW nRow
, const OUString
& rFormula
, formula::FormulaGrammar::Grammar eGram
);
336 * Takes ownership of pCell
338 * @return pCell if it was successfully inserted, NULL otherwise. pCell
339 * is deleted automatically on failure to insert.
341 ScFormulaCell
* SetFormulaCell( SCCOL nCol
, SCROW nRow
, ScFormulaCell
* pCell
);
343 svl::SharedString
GetSharedString( SCCOL nCol
, SCROW nRow
) const;
345 void SetValue( SCCOL nCol
, SCROW nRow
, const double& rVal
);
346 void SetError( SCCOL nCol
, SCROW nRow
, sal_uInt16 nError
);
348 void SetRawString( SCCOL nCol
, SCROW nRow
, const OUString
& rStr
);
349 void SetRawString( SCCOL nCol
, SCROW nRow
, const svl::SharedString
& rStr
);
350 void GetString( SCCOL nCol
, SCROW nRow
, OUString
& rString
) const;
351 double* GetValueCell( SCCOL nCol
, SCROW nRow
);
352 void GetInputString( SCCOL nCol
, SCROW nRow
, OUString
& rString
) const;
353 double GetValue( const ScAddress
& rPos
) const
355 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
356 aCol
[rPos
.Col()].GetValue( rPos
.Row() ) :
359 double GetValue( SCCOL nCol
, SCROW nRow
) const;
360 const EditTextObject
* GetEditText( SCCOL nCol
, SCROW nRow
) const;
361 void RemoveEditTextCharAttribs( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
);
362 void GetFormula( SCCOL nCol
, SCROW nRow
, OUString
& rFormula
) const;
363 const ScTokenArray
* GetFormulaTokens( SCCOL nCol
, SCROW nRow
) const;
364 const ScFormulaCell
* GetFormulaCell( SCCOL nCol
, SCROW nRow
) const;
365 ScFormulaCell
* GetFormulaCell( SCCOL nCol
, SCROW nRow
);
367 CellType
GetCellType( const ScAddress
& rPos
) const
369 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
370 aCol
[rPos
.Col()].GetCellType( rPos
.Row() ) :
373 CellType
GetCellType( SCCOL nCol
, SCROW nRow
) const;
374 ScRefCellValue
GetCellValue( SCCOL nCol
, SCROW nRow
) const;
376 void GetFirstDataPos(SCCOL
& rCol
, SCROW
& rRow
) const;
377 void GetLastDataPos(SCCOL
& rCol
, SCROW
& rRow
) const;
379 ScPostIt
* GetNote(const SCCOL nCol
, const SCROW nRow
);
381 size_t GetNoteCount( SCCOL nCol
) const;
382 SCROW
GetNotePosition( SCCOL nCol
, size_t nIndex
) const;
384 void GetAllNoteEntries( std::vector
<sc::NoteEntry
>& rNotes
) const;
385 void GetNotesInRange( const ScRange
& rRange
, std::vector
<sc::NoteEntry
>& rNotes
) const;
386 bool ContainsNotesInRange( const ScRange
& rRange
) const;
388 bool TestInsertRow( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
) const;
389 void InsertRow( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
);
391 const sc::ColumnSet
& rRegroupCols
, SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
, bool* pUndoOutline
= NULL
);
393 bool TestInsertCol( SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
) const;
395 const sc::ColumnSet
& rRegroupCols
, SCCOL nStartCol
, SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
);
397 const sc::ColumnSet
& rRegroupCols
, SCCOL nStartCol
, SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
, bool* pUndoOutline
= NULL
);
399 void DeleteArea(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, sal_uInt16 nDelFlag
);
400 void CopyToClip( sc::CopyToClipContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScTable
* pTable
);
401 void CopyToClip( sc::CopyToClipContext
& rCxt
, const ScRangeList
& rRanges
, ScTable
* pTable
);
402 void CopyStaticToDocument(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScTable
* pDestTab
);
403 void CopyCellToDocument( SCCOL nSrcCol
, SCROW nSrcRow
, SCCOL nDestCol
, SCROW nDestRow
, ScTable
& rDestTab
);
405 bool InitColumnBlockPosition( sc::ColumnBlockPosition
& rBlockPos
, SCCOL nCol
);
408 sc::CopyFromClipContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
409 SCsCOL nDx
, SCsROW nDy
, ScTable
* pTable
);
411 void StartListeningInArea(
412 sc::StartListeningContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
414 void BroadcastInArea( SCCOL nCol1
, SCROW nRow1
,
415 SCCOL nCol2
, SCROW nRow2
);
418 sc::CopyToDocContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
419 sal_uInt16 nFlags
, bool bMarked
, ScTable
* pDestTab
,
420 const ScMarkData
* pMarkData
= NULL
, bool bAsLink
= false, bool bColRowFlags
= true );
423 sc::CopyToDocContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
424 sal_uInt16 nFlags
, bool bMarked
, ScTable
* pDestTab
, const ScMarkData
* pMarkData
= NULL
);
426 void CopyConditionalFormat( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
427 SCsCOL nDx
, SCsROW nDy
, ScTable
* pTable
);
428 void TransposeClip( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
429 ScTable
* pTransClip
, sal_uInt16 nFlags
, bool bAsLink
);
431 // mark of this document
433 sc::MixDocContext
& rCxt
, const ScMarkData
& rMark
, sal_uInt16 nFunction
,
434 bool bSkipEmpty
, const ScTable
* pSrcTab
);
437 sc::MixDocContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
438 sal_uInt16 nFunction
, bool bSkipEmpty
, const ScTable
* pSrcTab
);
440 void CopyData( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
441 SCCOL nDestCol
, SCROW nDestRow
, SCTAB nDestTab
);
443 void CopyScenarioFrom( const ScTable
* pSrcTab
);
444 void CopyScenarioTo( ScTable
* pDestTab
) const;
445 bool TestCopyScenarioTo( const ScTable
* pDestTab
) const;
446 void MarkScenarioIn( ScMarkData
& rMark
, sal_uInt16 nNeededBits
) const;
447 bool HasScenarioRange( const ScRange
& rRange
) const;
448 void InvalidateScenarioRanges();
449 const ScRangeList
* GetScenarioRanges() const;
451 void CopyUpdated( const ScTable
* pPosTab
, ScTable
* pDestTab
) const;
453 void InvalidateTableArea();
454 void InvalidatePageBreaks();
456 bool GetCellArea( SCCOL
& rEndCol
, SCROW
& rEndRow
) const; // FALSE = empty
457 bool GetTableArea( SCCOL
& rEndCol
, SCROW
& rEndRow
) const;
458 bool GetPrintArea( SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bNotes
, bool bFullFormattedArea
= false ) const;
459 bool GetPrintAreaHor( SCROW nStartRow
, SCROW nEndRow
,
460 SCCOL
& rEndCol
, bool bNotes
) const;
461 bool GetPrintAreaVer( SCCOL nStartCol
, SCCOL nEndCol
,
462 SCROW
& rEndRow
, bool bNotes
) const;
464 bool GetDataStart( SCCOL
& rStartCol
, SCROW
& rStartRow
) const;
466 void ExtendPrintArea( OutputDevice
* pDev
,
467 SCCOL nStartCol
, SCROW nStartRow
, SCCOL
& rEndCol
, SCROW nEndRow
);
469 void GetDataArea( SCCOL
& rStartCol
, SCROW
& rStartRow
, SCCOL
& rEndCol
, SCROW
& rEndRow
,
470 bool bIncludeOld
, bool bOnlyDown
) const;
472 bool ShrinkToUsedDataArea( bool& o_bShrunk
, SCCOL
& rStartCol
, SCROW
& rStartRow
,
473 SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bColumnsOnly
) const;
475 SCROW
GetLastDataRow( SCCOL nCol1
, SCCOL nCol2
, SCROW nLastRow
) const;
477 SCSIZE
GetEmptyLinesInBlock( SCCOL nStartCol
, SCROW nStartRow
,
478 SCCOL nEndCol
, SCROW nEndRow
, ScDirection eDir
) const;
480 void FindAreaPos( SCCOL
& rCol
, SCROW
& rRow
, ScMoveDirection eDirection
) const;
481 void GetNextPos( SCCOL
& rCol
, SCROW
& rRow
, SCsCOL nMovX
, SCsROW nMovY
,
482 bool bMarked
, bool bUnprotected
, const ScMarkData
& rMark
) const;
484 void LimitChartArea( SCCOL
& rStartCol
, SCROW
& rStartRow
, SCCOL
& rEndCol
, SCROW
& rEndRow
) const;
486 bool HasData( SCCOL nCol
, SCROW nRow
) const;
487 bool HasStringData( SCCOL nCol
, SCROW nRow
) const;
488 bool HasValueData( SCCOL nCol
, SCROW nRow
) const;
489 bool HasStringCells( SCCOL nStartCol
, SCROW nStartRow
,
490 SCCOL nEndCol
, SCROW nEndRow
) const;
492 sal_uInt16
GetErrCode( const ScAddress
& rPos
) const
494 return ValidColRow(rPos
.Col(),rPos
.Row()) ?
495 aCol
[rPos
.Col()].GetErrCode( rPos
.Row() ) :
499 bool IsEmptyData( SCCOL nCol
) const;
501 void ResetChanged( const ScRange
& rRange
);
504 void SetDirty( const ScRange
& );
505 void SetDirtyAfterLoad();
507 void SetTableOpDirty( const ScRange
& );
509 void CalcAfterLoad();
511 void CompileXML( ScProgress
& rProgress
);
513 bool CompileErrorCells(sal_uInt16 nErrCode
);
515 void UpdateReference(
516 sc::RefUpdateContext
& rCxt
, ScDocument
* pUndoDoc
= NULL
,
517 bool bIncludeDraw
= true, bool bUpdateNoteCaptionPos
= true );
519 void UpdateDrawRef( UpdateRefMode eUpdateRefMode
, SCCOL nCol1
, SCROW nRow1
, SCTAB nTab1
,
520 SCCOL nCol2
, SCROW nRow2
, SCTAB nTab2
,
521 SCsCOL nDx
, SCsROW nDy
, SCsTAB nDz
, bool bUpdateNoteCaptionPos
= true );
523 void UpdateTranspose( const ScRange
& rSource
, const ScAddress
& rDest
,
524 ScDocument
* pUndoDoc
);
526 void UpdateGrow( const ScRange
& rArea
, SCCOL nGrowX
, SCROW nGrowY
);
528 void UpdateInsertTab( sc::RefUpdateInsertTabContext
& rCxt
);
529 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext
& rCxt
);
530 void UpdateMoveTab( sc::RefUpdateMoveTabContext
& rCxt
, SCTAB nTabNo
, ScProgress
* pProgress
);
531 void UpdateCompile( bool bForceIfNameInUse
= false );
532 void SetTabNo(SCTAB nNewTab
);
533 void FindRangeNamesInUse(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
534 std::set
<sal_uInt16
>& rIndexes
) const;
535 void Fill( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
536 sal_uLong nFillCount
, FillDir eFillDir
, FillCmd eFillCmd
, FillDateCmd eFillDateCmd
,
537 double nStepValue
, double nMaxValue
, ScProgress
* pProgress
);
538 OUString
GetAutoFillPreview( const ScRange
& rSource
, SCCOL nEndX
, SCROW nEndY
);
540 void UpdateSelectionFunction( ScFunctionData
& rData
,
541 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
542 const ScMarkData
& rMark
);
544 void AutoFormat( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
545 sal_uInt16 nFormatNo
);
546 void GetAutoFormatData(SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, ScAutoFormatData
& rData
);
547 void ScReplaceTabsStr( OUString
& rStr
, const OUString
& rSrch
, const OUString
& rRepl
); // from sw
548 bool SearchAndReplace(
549 const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
,
550 ScRangeList
& rMatchedRanges
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
552 void FindMaxRotCol( RowInfo
* pRowInfo
, SCSIZE nArrCount
, SCCOL nX1
, SCCOL nX2
);
554 void GetBorderLines( SCCOL nCol
, SCROW nRow
,
555 const ::editeng::SvxBorderLine
** ppLeft
, const ::editeng::SvxBorderLine
** ppTop
,
556 const ::editeng::SvxBorderLine
** ppRight
, const ::editeng::SvxBorderLine
** ppBottom
) const;
558 bool HasAttrib( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, sal_uInt16 nMask
) const;
559 bool HasAttribSelection( const ScMarkData
& rMark
, sal_uInt16 nMask
) const;
560 bool ExtendMerge( SCCOL nStartCol
, SCROW nStartRow
,
561 SCCOL
& rEndCol
, SCROW
& rEndRow
,
563 const SfxPoolItem
* GetAttr( SCCOL nCol
, SCROW nRow
, sal_uInt16 nWhich
) const;
564 const ScPatternAttr
* GetPattern( SCCOL nCol
, SCROW nRow
) const;
565 const ScPatternAttr
* GetMostUsedPattern( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
) const;
567 sal_uInt32
GetNumberFormat( const ScAddress
& rPos
) const;
568 sal_uInt32
GetNumberFormat( SCCOL nCol
, SCROW nRow
) const;
569 sal_uInt32
GetNumberFormat( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
) const;
571 void SetNumberFormat( SCCOL nCol
, SCROW nRow
, sal_uInt32 nNumberFormat
);
573 void MergeSelectionPattern( ScMergePatternState
& rState
,
574 const ScMarkData
& rMark
, bool bDeep
) const;
575 void MergePatternArea( ScMergePatternState
& rState
, SCCOL nCol1
, SCROW nRow1
,
576 SCCOL nCol2
, SCROW nRow2
, bool bDeep
) const;
577 void MergeBlockFrame( SvxBoxItem
* pLineOuter
, SvxBoxInfoItem
* pLineInner
,
579 SCCOL nStartCol
, SCROW nStartRow
,
580 SCCOL nEndCol
, SCROW nEndRow
) const;
581 void ApplyBlockFrame( const SvxBoxItem
* pLineOuter
,
582 const SvxBoxInfoItem
* pLineInner
,
583 SCCOL nStartCol
, SCROW nStartRow
,
584 SCCOL nEndCol
, SCROW nEndRow
);
586 void ApplyAttr( SCCOL nCol
, SCROW nRow
, const SfxPoolItem
& rAttr
);
587 void ApplyPattern( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
);
588 void ApplyPatternArea( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
589 const ScPatternAttr
& rAttr
, ScEditDataArray
* pDataArray
= NULL
);
590 bool SetAttrEntries(SCCOL nCol
, ScAttrEntry
* pData
, SCSIZE nSize
);
592 void SetPattern( const ScAddress
& rPos
, const ScPatternAttr
& rAttr
, bool bPutToPool
= false )
594 if (ValidColRow(rPos
.Col(),rPos
.Row()))
595 aCol
[rPos
.Col()].SetPattern( rPos
.Row(), rAttr
, bPutToPool
);
597 void SetPattern( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
, bool bPutToPool
= false );
598 void ApplyPatternIfNumberformatIncompatible( const ScRange
& rRange
,
599 const ScPatternAttr
& rPattern
, short nNewType
);
600 void AddCondFormatData( const ScRangeList
& rRange
, sal_uInt32 nIndex
);
601 void RemoveCondFormatData( const ScRangeList
& rRange
, sal_uInt32 nIndex
);
603 void ApplyStyle( SCCOL nCol
, SCROW nRow
, const ScStyleSheet
& rStyle
);
604 void ApplyStyleArea( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, const ScStyleSheet
& rStyle
);
605 void ApplySelectionStyle(const ScStyleSheet
& rStyle
, const ScMarkData
& rMark
);
606 void ApplySelectionLineStyle( const ScMarkData
& rMark
,
607 const ::editeng::SvxBorderLine
* pLine
, bool bColorOnly
);
609 const ScStyleSheet
* GetStyle( SCCOL nCol
, SCROW nRow
) const;
610 const ScStyleSheet
* GetSelectionStyle( const ScMarkData
& rMark
, bool& rFound
) const;
611 const ScStyleSheet
* GetAreaStyle( bool& rFound
, SCCOL nCol1
, SCROW nRow1
,
612 SCCOL nCol2
, SCROW nRow2
) const;
614 void StyleSheetChanged( const SfxStyleSheetBase
* pStyleSheet
, bool bRemoved
,
616 double nPPTX
, double nPPTY
,
617 const Fraction
& rZoomX
, const Fraction
& rZoomY
);
619 bool IsStyleSheetUsed( const ScStyleSheet
& rStyle
, bool bGatherAllStyles
) const;
621 bool ApplyFlags( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, sal_Int16 nFlags
);
622 bool RemoveFlags( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, sal_Int16 nFlags
);
624 void ApplySelectionCache( SfxItemPoolCache
* pCache
, const ScMarkData
& rMark
, ScEditDataArray
* pDataArray
= NULL
);
625 void DeleteSelection( sal_uInt16 nDelFlag
, const ScMarkData
& rMark
);
627 void ClearSelectionItems( const sal_uInt16
* pWhich
, const ScMarkData
& rMark
);
628 void ChangeSelectionIndent( bool bIncrement
, const ScMarkData
& rMark
);
630 const ScRange
* GetRepeatColRange() const { return pRepeatColRange
; }
631 const ScRange
* GetRepeatRowRange() const { return pRepeatRowRange
; }
632 void SetRepeatColRange( const ScRange
* pNew
);
633 void SetRepeatRowRange( const ScRange
* pNew
);
635 sal_uInt16
GetPrintRangeCount() const { return static_cast< sal_uInt16
>( aPrintRanges
.size() ); }
636 const ScRange
* GetPrintRange(sal_uInt16 nPos
) const;
637 /** Returns true, if the sheet is always printed. */
638 bool IsPrintEntireSheet() const { return bPrintEntireSheet
; }
640 /** Removes all print ranges. */
641 void ClearPrintRanges();
642 /** Adds a new print ranges. */
643 void AddPrintRange( const ScRange
& rNew
);
644 /** Marks the specified sheet to be printed completely. Deletes old print ranges! */
645 void SetPrintEntireSheet();
647 void FillPrintSaver( ScPrintSaverTab
& rSaveTab
) const;
648 void RestorePrintRanges( const ScPrintSaverTab
& rSaveTab
);
650 sal_uInt16
GetOptimalColWidth( SCCOL nCol
, OutputDevice
* pDev
,
651 double nPPTX
, double nPPTY
,
652 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
653 bool bFormula
, const ScMarkData
* pMarkData
,
654 const ScColWidthParam
* pParam
);
655 bool SetOptimalHeight( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nExtra
,
657 double nPPTX
, double nPPTY
,
658 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
660 ScProgress
* pOuterProgress
= NULL
, sal_uLong nProgressStart
= 0 );
662 void SetOptimalHeightOnly(SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nExtra
,
664 double nPPTX
, double nPPTY
,
665 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
667 ScProgress
* pOuterProgress
= NULL
, sal_uLong nProgressStart
= 0 );
669 long GetNeededSize( SCCOL nCol
, SCROW nRow
,
671 double nPPTX
, double nPPTY
,
672 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
673 bool bWidth
, bool bTotalSize
);
674 void SetColWidth( SCCOL nCol
, sal_uInt16 nNewWidth
);
675 void SetColWidthOnly( SCCOL nCol
, sal_uInt16 nNewWidth
);
676 void SetRowHeight( SCROW nRow
, sal_uInt16 nNewHeight
);
677 bool SetRowHeightRange( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nNewHeight
,
678 double nPPTX
, double nPPTY
);
681 * Set specified row height to specified ranges. Don't check for drawing
682 * objects etc. Just set the row height. Nothing else.
684 * Note that setting a new row height via this function will not
685 * invalidate page breaks.
687 void SetRowHeightOnly( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nNewHeight
);
689 // nPPT to test for modification
690 void SetManualHeight( SCROW nStartRow
, SCROW nEndRow
, bool bManual
);
692 sal_uInt16
GetColWidth( SCCOL nCol
, bool bHiddenAsZero
= true ) const;
693 SC_DLLPUBLIC sal_uInt16
GetRowHeight( SCROW nRow
, SCROW
* pStartRow
= NULL
, SCROW
* pEndRow
= NULL
, bool bHiddenAsZero
= true ) const;
694 sal_uLong
GetRowHeight( SCROW nStartRow
, SCROW nEndRow
, bool bHiddenAsZero
= true ) const;
695 sal_uLong
GetScaledRowHeight( SCROW nStartRow
, SCROW nEndRow
, double fScale
) const;
696 sal_uLong
GetColOffset( SCCOL nCol
, bool bHiddenAsZero
= true ) const;
697 sal_uLong
GetRowOffset( SCROW nRow
, bool bHiddenAsZero
= true ) const;
700 * Get the last row such that the height of row 0 to the end row is as
701 * high as possible without exceeding the specified height value.
703 * @param nHeight maximum desired height
705 * @return SCROW last row of the range within specified height.
707 SCROW
GetRowForHeight(sal_uLong nHeight
) const;
709 sal_uInt16
GetOriginalWidth( SCCOL nCol
) const;
710 sal_uInt16
GetOriginalHeight( SCROW nRow
) const;
712 sal_uInt16
GetCommonWidth( SCCOL nEndCol
) const;
714 SCROW
GetHiddenRowCount( SCROW nRow
) const;
716 void ShowCol(SCCOL nCol
, bool bShow
);
717 void ShowRow(SCROW nRow
, bool bShow
);
718 void DBShowRow(SCROW nRow
, bool bShow
);
720 void ShowRows(SCROW nRow1
, SCROW nRow2
, bool bShow
);
721 void DBShowRows(SCROW nRow1
, SCROW nRow2
, bool bShow
);
723 void SetRowFlags( SCROW nRow
, sal_uInt8 nNewFlags
);
724 void SetRowFlags( SCROW nStartRow
, SCROW nEndRow
, sal_uInt8 nNewFlags
);
726 /// @return the index of the last row with any set flags (auto-pagebreak is ignored).
727 SCROW
GetLastFlaggedRow() const;
729 /// @return the index of the last changed column (flags and column width, auto pagebreak is ignored).
730 SCCOL
GetLastChangedCol() const;
731 /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored).
732 SCROW
GetLastChangedRow() const;
734 bool IsDataFiltered(SCCOL nColStart
, SCROW nRowStart
, SCCOL nColEnd
, SCROW nRowEnd
) const;
735 bool IsDataFiltered(const ScRange
& rRange
) const;
736 sal_uInt8
GetColFlags( SCCOL nCol
) const;
737 sal_uInt8
GetRowFlags( SCROW nRow
) const;
739 const ScBitMaskCompressedArray
< SCROW
, sal_uInt8
> * GetRowFlagsArray() const
740 { return pRowFlags
; }
742 bool UpdateOutlineCol( SCCOL nStartCol
, SCCOL nEndCol
, bool bShow
);
743 bool UpdateOutlineRow( SCROW nStartRow
, SCROW nEndRow
, bool bShow
);
745 void UpdatePageBreaks( const ScRange
* pUserArea
);
746 void RemoveManualBreaks();
747 bool HasManualBreaks() const;
748 void SetRowManualBreaks( const ::std::set
<SCROW
>& rBreaks
);
749 void SetColManualBreaks( const ::std::set
<SCCOL
>& rBreaks
);
751 void GetAllRowBreaks(::std::set
<SCROW
>& rBreaks
, bool bPage
, bool bManual
) const;
752 void GetAllColBreaks(::std::set
<SCCOL
>& rBreaks
, bool bPage
, bool bManual
) const;
753 bool HasRowPageBreak(SCROW nRow
) const;
754 bool HasColPageBreak(SCCOL nCol
) const;
755 bool HasRowManualBreak(SCROW nRow
) const;
756 bool HasColManualBreak(SCCOL nCol
) const;
759 * Get the row position of the next manual break that occurs at or below
760 * specified row. When no more manual breaks are present at or below
761 * the specified row, -1 is returned.
763 * @param nRow row at which the search begins.
765 * @return SCROW next row position with manual page break, or -1 if no
766 * more manual breaks are present.
768 SCROW
GetNextManualBreak(SCROW nRow
) const;
770 void RemoveRowPageBreaks(SCROW nStartRow
, SCROW nEndRow
);
771 void RemoveRowBreak(SCROW nRow
, bool bPage
, bool bManual
);
772 void RemoveColBreak(SCCOL nCol
, bool bPage
, bool bManual
);
773 void SetRowBreak(SCROW nRow
, bool bPage
, bool bManual
);
774 void SetColBreak(SCCOL nCol
, bool bPage
, bool bManual
);
775 ::com::sun::star::uno::Sequence
<
776 ::com::sun::star::sheet::TablePageBreakData
> GetRowBreakData() const;
778 bool RowHidden(SCROW nRow
, SCROW
* pFirstRow
= NULL
, SCROW
* pLastRow
= NULL
) const;
779 bool RowHiddenLeaf(SCROW nRow
, SCROW
* pFirstRow
= NULL
, SCROW
* pLastRow
= NULL
) const;
780 bool HasHiddenRows(SCROW nStartRow
, SCROW nEndRow
) const;
781 bool ColHidden(SCCOL nCol
, SCCOL
* pFirstCol
= NULL
, SCCOL
* pLastCol
= NULL
) const;
782 bool SetRowHidden(SCROW nStartRow
, SCROW nEndRow
, bool bHidden
);
783 bool SetColHidden(SCCOL nStartCol
, SCCOL nEndCol
, bool bHidden
);
784 void CopyColHidden(ScTable
& rTable
, SCCOL nStartCol
, SCCOL nEndCol
);
785 void CopyRowHidden(ScTable
& rTable
, SCROW nStartRow
, SCROW nEndRow
);
786 void CopyRowHeight(ScTable
& rSrcTable
, SCROW nStartRow
, SCROW nEndRow
, SCROW nSrcOffset
);
787 SCROW
FirstVisibleRow(SCROW nStartRow
, SCROW nEndRow
) const;
788 SCROW
LastVisibleRow(SCROW nStartRow
, SCROW nEndRow
) const;
789 SCROW
CountVisibleRows(SCROW nStartRow
, SCROW nEndRow
) const;
790 sal_uInt32
GetTotalRowHeight(SCROW nStartRow
, SCROW nEndRow
, bool bHiddenAsZero
= true) const;
792 SCCOLROW
LastHiddenColRow(SCCOLROW nPos
, bool bCol
) const;
794 bool RowFiltered(SCROW nRow
, SCROW
* pFirstRow
= NULL
, SCROW
* pLastRow
= NULL
) const;
795 bool ColFiltered(SCCOL nCol
, SCCOL
* pFirstCol
= NULL
, SCCOL
* pLastCol
= NULL
) const;
796 bool HasFilteredRows(SCROW nStartRow
, SCROW nEndRow
) const;
797 void CopyColFiltered(ScTable
& rTable
, SCCOL nStartCol
, SCCOL nEndCol
);
798 void CopyRowFiltered(ScTable
& rTable
, SCROW nStartRow
, SCROW nEndRow
);
799 void SetRowFiltered(SCROW nStartRow
, SCROW nEndRow
, bool bFiltered
);
800 void SetColFiltered(SCCOL nStartCol
, SCCOL nEndCol
, bool bFiltered
);
801 SCROW
FirstNonFilteredRow(SCROW nStartRow
, SCROW nEndRow
) const;
802 SCROW
LastNonFilteredRow(SCROW nStartRow
, SCROW nEndRow
) const;
803 SCROW
CountNonFilteredRows(SCROW nStartRow
, SCROW nEndRow
) const;
805 bool IsManualRowHeight(SCROW nRow
) const;
807 void SyncColRowFlags();
809 void StripHidden( SCCOL
& rX1
, SCROW
& rY1
, SCCOL
& rX2
, SCROW
& rY2
);
810 void ExtendHidden( SCCOL
& rX1
, SCROW
& rY1
, SCCOL
& rX2
, SCROW
& rY2
);
812 void Sort(const ScSortParam
& rSortParam
, bool bKeepQuery
, ScProgress
* pProgress
);
814 SCROW nRow
, const ScQueryParam
& rQueryParam
, ScRefCellValue
* pCell
= NULL
,
815 bool* pbTestEqualCondition
= NULL
);
816 void TopTenQuery( ScQueryParam
& );
817 SCSIZE
Query(ScQueryParam
& rQueryParam
, bool bKeepSub
);
818 bool CreateQueryParam(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
820 void GetFilterEntries(SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, std::vector
<ScTypedStrData
>& rStrings
, bool& rHasDates
);
821 void GetFilteredFilterEntries(SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, const ScQueryParam
& rParam
, std::vector
<ScTypedStrData
>& rStrings
, bool& rHasDates
);
822 bool GetDataEntries(SCCOL nCol
, SCROW nRow
, std::set
<ScTypedStrData
>& rStrings
, bool bLimit
);
824 bool HasColHeader( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
) const;
825 bool HasRowHeader( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
) const;
827 sal_Int32
GetMaxStringLen( SCCOL nCol
,
828 SCROW nRowStart
, SCROW nRowEnd
, rtl_TextEncoding eCharSet
) const;
829 xub_StrLen
GetMaxNumberStringLen( sal_uInt16
& nPrecision
,
831 SCROW nRowStart
, SCROW nRowEnd
) const;
833 bool IsSortCollatorGlobal() const;
834 void InitSortCollator( const ScSortParam
& rPar
);
835 void DestroySortCollator();
836 void SetDrawPageSize( bool bResetStreamValid
= true, bool bUpdateNoteCaptionPos
= true );
838 void SetRangeName(ScRangeName
* pNew
);
839 ScRangeName
* GetRangeName() const;
841 ScConditionalFormatList
* GetCondFormList();
842 const ScConditionalFormatList
* GetCondFormList() const;
843 void SetCondFormList( ScConditionalFormatList
* pList
);
845 void DeleteConditionalFormat(sal_uLong nOldIndex
);
847 sal_uLong
AddCondFormat( ScConditionalFormat
* pNew
);
849 sal_uInt8
GetScriptType( SCCOL nCol
, SCROW nRow
) const;
850 void SetScriptType( SCCOL nCol
, SCROW nRow
, sal_uInt8 nType
);
852 sal_uInt8
GetRangeScriptType( sc::ColumnBlockPosition
& rBlockPos
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
854 size_t GetFormulaHash( SCCOL nCol
, SCROW nRow
) const;
856 ScFormulaVectorState
GetFormulaVectorState( SCCOL nCol
, SCROW nRow
) const;
857 formula::FormulaTokenRef
ResolveStaticReference( SCCOL nCol
, SCROW nRow
);
858 formula::FormulaTokenRef
ResolveStaticReference( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
859 formula::VectorRefArray
FetchVectorRefArray( SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
861 ScRefCellValue
GetRefCellValue( SCCOL nCol
, SCROW nRow
);
863 SvtBroadcaster
* GetBroadcaster( SCCOL nCol
, SCROW nRow
);
864 const SvtBroadcaster
* GetBroadcaster( SCCOL nCol
, SCROW nRow
) const;
865 void DeleteBroadcasters( sc::ColumnBlockPosition
& rBlockPos
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
866 bool HasBroadcaster( SCCOL nCol
) const;
868 void FillMatrix( ScMatrix
& rMat
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
) const;
870 void InterpretDirtyCells( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
872 void SetFormulaResults( SCCOL nCol
, SCROW nRow
, const double* pResults
, size_t nLen
);
873 void SetFormulaResults( SCCOL nCol
, SCROW nRow
, const formula::FormulaTokenRef
* pResults
, size_t nLen
);
876 * Have formula cells with NeedsListening() == true start listening to the
879 void StartNeededListeners();
882 * Mark dirty those formula cells that has named ranges with relative
885 void SetRelNameDirty();
888 * Broadcast dirty formula cells that contain functions such as CELL(),
889 * COLUMN() or ROW() which may change its value on move.
891 void BroadcastRecalcOnRefMove();
893 #if DEBUG_COLUMN_STORAGE
894 void DumpFormulaGroups( SCCOL nCol
) const;
897 /** Replace behaves differently to the Search; adjust the rCol and rRow accordingly.
899 'Replace' replaces at the 'current' position, but in order to achieve
900 that, we have to 'shift' the rCol / rRow to the 'previous' position -
901 what it is depends on various settings in rSearchItem.
903 static void UpdateSearchItemAddressForReplace( const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
);
906 void FillSeries( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
907 sal_uLong nFillCount
, FillDir eFillDir
, FillCmd eFillCmd
,
908 FillDateCmd eFillDateCmd
,
909 double nStepValue
, double nMaxValue
, sal_uInt16 nMinDigits
,
910 bool bAttribs
, ScProgress
* pProgress
);
911 void FillAnalyse( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
912 FillCmd
& rCmd
, FillDateCmd
& rDateCmd
,
913 double& rInc
, sal_uInt16
& rMinDigits
,
914 ScUserListData
*& rListData
, sal_uInt16
& rListIndex
);
915 void FillAuto( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
916 sal_uLong nFillCount
, FillDir eFillDir
, ScProgress
* pProgress
);
918 bool ValidNextPos( SCCOL nCol
, SCROW nRow
, const ScMarkData
& rMark
,
919 bool bMarked
, bool bUnprotected
) const;
921 void AutoFormatArea(SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
922 const ScPatternAttr
& rAttr
, sal_uInt16 nFormatNo
);
923 void GetAutoFormatAttr(SCCOL nCol
, SCROW nRow
, sal_uInt16 nIndex
, ScAutoFormatData
& rData
);
924 void GetAutoFormatFrame(SCCOL nCol
, SCROW nRow
, sal_uInt16 nFlags
, sal_uInt16 nIndex
, ScAutoFormatData
& rData
);
925 bool SearchCell(const SvxSearchItem
& rSearchItem
, SCCOL nCol
, SCROW nRow
,
926 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
927 bool Search(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
928 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
929 bool SearchAll(const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
,
930 ScRangeList
& rMatchedRanges
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
931 bool Replace(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
932 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
934 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
935 OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
937 bool SearchStyle(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
938 const ScMarkData
& rMark
);
939 bool ReplaceStyle(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
940 const ScMarkData
& rMark
, bool bIsUndo
);
942 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
);
943 bool ReplaceAllStyle(
944 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
945 ScDocument
* pUndoDoc
);
946 bool SearchAndReplaceEmptyCells(
947 const SvxSearchItem
& rSearchItem
,
948 SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
949 OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
950 bool SearchRangeForEmptyCell(const ScRange
& rRange
,
951 const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
953 bool SearchRangeForAllEmptyCells(
954 const ScRange
& rRange
, const SvxSearchItem
& rSearchItem
,
955 ScRangeList
& rMatchedRanges
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
957 // use the global sort parameter:
958 bool IsSorted(SCCOLROW nStart
, SCCOLROW nEnd
) const;
959 void DecoladeRow( ScSortInfoArray
*, SCROW nRow1
, SCROW nRow2
);
960 void SwapCol(SCCOL nCol1
, SCCOL nCol2
);
961 void SwapRow(SCROW nRow1
, SCROW nRow2
);
964 ScRefCellValue
& rCell1
, SCCOL nCell1Col
, SCROW nCell1Row
,
965 ScRefCellValue
& rCell2
, SCCOL nCell2Col
, SCROW nCell2Row
) const;
966 short Compare(SCCOLROW nIndex1
, SCCOLROW nIndex2
) const;
967 short Compare( ScSortInfoArray
*, SCCOLROW nIndex1
, SCCOLROW nIndex2
) const;
968 ScSortInfoArray
* CreateSortInfoArray( SCCOLROW nInd1
, SCCOLROW nInd2
);
969 void QuickSort( ScSortInfoArray
*, SCsCOLROW nLo
, SCsCOLROW nHi
);
970 void SortReorder( ScSortInfoArray
*, ScProgress
* );
972 bool CreateExcelQuery(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
973 bool CreateStarQuery(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
974 void GetUpperCellString(SCCOL nCol
, SCROW nRow
, OUString
& rStr
);
976 bool RefVisible(ScFormulaCell
* pCell
);
978 bool IsEmptyLine(SCROW nRow
, SCCOL nStartCol
, SCCOL nEndCol
) const;
980 void IncDate(double& rVal
, sal_uInt16
& nDayOfMonth
, double nStep
, FillDateCmd eCmd
);
981 void FillFormula(sal_uLong
& nFormulaCounter
, bool bFirst
, ScFormulaCell
* pSrcCell
,
982 SCCOL nDestCol
, SCROW nDestRow
, bool bLast
);
983 void UpdateInsertTabAbs(SCTAB nNewPos
);
984 bool GetNextSpellingCell(SCCOL
& rCol
, SCROW
& rRow
, bool bInSel
,
985 const ScMarkData
& rMark
) const;
986 bool GetNextMarkedCell( SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
) const;
987 bool TestTabRefAbs(SCTAB nTable
) const;
988 void CompileDBFormula();
989 void CompileDBFormula( bool bCreateFormulaString
);
990 void CompileNameFormula( bool bCreateFormulaString
);
991 void CompileColRowNameFormula();
992 void RebuildFormulaGroups();
994 void StartListening( const ScAddress
& rAddress
, SvtListener
* pListener
);
995 void EndListening( const ScAddress
& rAddress
, SvtListener
* pListener
);
996 void StartListening( sc::StartListeningContext
& rCxt
, SCCOL nCol
, SCROW nRow
, SvtListener
& rListener
);
997 void EndListening( sc::EndListeningContext
& rCxt
, SCCOL nCol
, SCROW nRow
, SvtListener
& rListener
);
998 void StartAllListeners();
1000 void SetLoadingMedium(bool bLoading
);
1002 SCSIZE
FillMaxRot( RowInfo
* pRowInfo
, SCSIZE nArrCount
, SCCOL nX1
, SCCOL nX2
,
1003 SCCOL nCol
, SCROW nAttrRow1
, SCROW nAttrRow2
, SCSIZE nArrY
,
1004 const ScPatternAttr
* pPattern
, const SfxItemSet
* pCondSet
);
1006 // idle calculation of OutputDevice text width for cell
1007 // also invalidates script type, broadcasts for "calc as shown"
1008 void InvalidateTextWidth( const ScAddress
* pAdrFrom
, const ScAddress
* pAdrTo
,
1009 bool bNumFormatChanged
, bool bBroadcast
);
1011 void SkipFilteredRows(SCROW
& rRow
, SCROW
& rLastNonFilteredRow
, bool bForward
);
1014 * In case the cell text goes beyond the column width, move the max column
1015 * position to the right. This is called from ExtendPrintArea.
1017 void MaybeAddExtraColumn(SCCOL
& rCol
, SCROW nRow
, OutputDevice
* pDev
, double nPPTX
, double nPPTY
);
1019 void CopyPrintRange(const ScTable
& rTable
);
1021 SCCOL
FindNextVisibleColWithContent(SCCOL nCol
, bool bRight
, SCROW nRow
) const;
1023 SCCOL
FindNextVisibleCol(SCCOL nCol
, bool bRight
) const;
1025 // Clipboard transpose for notes
1026 void TransposeColNotes(ScTable
* pTransClip
, SCCOL nCol1
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
1029 * Use this to iterate through non-empty visible cells in a single column.
1031 class VisibleDataCellIterator
1034 static SCROW ROW_NOT_FOUND
;
1036 explicit VisibleDataCellIterator(ScFlatBoolRowSegments
& rRowSegs
, ScColumn
& rColumn
);
1037 ~VisibleDataCellIterator();
1040 * Set the start row position. In case there is not visible data cell
1041 * at the specified row position, it will move to the position of the
1042 * first visible data cell below that point.
1044 * @return First visible data cell if found, or NULL otherwise.
1046 ScRefCellValue
reset(SCROW nRow
);
1049 * Find the next visible data cell position.
1051 * @return Next visible data cell if found, or NULL otherwise.
1053 ScRefCellValue
next();
1056 * Get the current row position.
1058 * @return Current row position, or ROW_NOT_FOUND if the iterator
1059 * doesn't point to a valid data cell position.
1061 SCROW
getRow() const;
1064 ScFlatBoolRowSegments
& mrRowSegs
;
1066 ScRefCellValue maCell
;
1076 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */