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 .
22 #include <tools/gen.hxx>
23 #include <tools/color.hxx>
24 #include "attarray.hxx"
26 #include "colcontainer.hxx"
27 #include "sortparam.hxx"
29 #include "cellvalue.hxx"
30 #include <formula/types.hxx>
31 #include "calcmacros.hxx"
32 #include <formula/errorcodes.hxx>
33 #include "document.hxx"
34 #include "drwlayer.hxx"
43 template <typename A
, typename D
> class ScBitMaskCompressedArray
;
44 template <typename A
, typename D
> class ScCompressedArray
;
50 namespace com::sun::star
{
52 struct TablePageBreakData
;
56 namespace formula
{ struct VectorRefArray
; }
59 class StartListeningContext
;
60 class EndListeningContext
;
61 class CopyFromClipContext
;
62 class CopyToClipContext
;
63 class CopyToDocContext
;
66 class RangeColumnSpanSet
;
68 struct ColumnBlockPosition
;
69 class TableColumnBlockPositionSet
;
70 struct RefUpdateContext
;
71 struct RefUpdateInsertTabContext
;
72 struct RefUpdateDeleteTabContext
;
73 struct RefUpdateMoveTabContext
;
75 class DocumentStreamAccess
;
78 class RowHeightContext
;
79 class CompileFormulaContext
;
80 struct SetFormulaDirtyContext
;
86 class SfxStyleSheetBase
;
91 class ScAutoFormatData
;
92 class ScEditDataArray
;
95 class ScPrintSaverTab
;
99 class ScSortInfoArray
;
100 class ScConditionalFormat
;
101 class ScConditionalFormatList
;
103 class ScTableProtection
;
104 class ScUserListData
;
106 class ScFunctionData
;
107 class CollatorWrapper
;
108 class ScFlatUInt16RowSegments
;
109 class ScFlatBoolRowSegments
;
110 class ScFlatBoolColSegments
;
111 struct ScSetStringParam
;
112 struct ScColWidthParam
;
117 struct ScInterpreterContext
;
120 class ScColumnsRange final
125 std::vector
<std::unique_ptr
<ScColumn
, o3tl::default_delete
<ScColumn
>>>::const_iterator maColIter
;
127 typedef std::input_iterator_tag iterator_category
;
128 typedef SCCOL value_type
;
129 typedef SCCOL difference_type
;
130 typedef const SCCOL
* pointer
;
131 typedef SCCOL reference
;
133 explicit Iterator(const std::vector
<std::unique_ptr
<ScColumn
, o3tl::default_delete
<ScColumn
>>>::const_iterator
& colIter
) : maColIter(colIter
) {}
135 Iterator
& operator++() { ++maColIter
; return *this;}
136 Iterator
& operator--() { --maColIter
; return *this;}
138 bool operator==(const Iterator
& rOther
) const {return maColIter
== rOther
.maColIter
;}
139 bool operator!=(const Iterator
& rOther
) const {return !(*this == rOther
);}
140 SCCOL
operator*() const {return (*maColIter
)->GetCol();}
143 ScColumnsRange(const Iterator
& rBegin
, const Iterator
& rEnd
) : maBegin(rBegin
), maEnd(rEnd
) {}
144 const Iterator
& begin() { return maBegin
; }
145 const Iterator
& end() { return maEnd
; }
146 std::reverse_iterator
<Iterator
> rbegin() { return std::reverse_iterator
<Iterator
>(maEnd
); }
147 std::reverse_iterator
<Iterator
> rend() { return std::reverse_iterator
<Iterator
>(maBegin
); }
149 const Iterator maBegin
;
150 const Iterator maEnd
;
156 typedef ::std::vector
< ScRange
> ScRangeVec
;
158 mutable ScColContainer aCol
;
168 sal_uLong nLinkRefreshDelay
;
169 ScLinkMode nLinkMode
;
171 // page style template
173 Size aPageSizeTwips
; // size of the print-page
174 SCCOL nRepeatStartX
; // repeating rows/columns
175 SCCOL nRepeatEndX
; // REPEAT_NONE, if not used
179 std::unique_ptr
<ScTableProtection
> pTabProtection
;
181 std::unique_ptr
<ScCompressedArray
<SCCOL
, sal_uInt16
>> mpColWidth
;
182 std::unique_ptr
<ScFlatUInt16RowSegments
> mpRowHeights
;
184 std::unique_ptr
<ScBitMaskCompressedArray
<SCCOL
, CRFlags
>> mpColFlags
;
185 std::unique_ptr
<ScBitMaskCompressedArray
< SCROW
, CRFlags
>> pRowFlags
;
186 std::unique_ptr
<ScFlatBoolColSegments
> mpHiddenCols
;
187 std::unique_ptr
<ScFlatBoolRowSegments
> mpHiddenRows
;
188 std::unique_ptr
<ScFlatBoolColSegments
> mpFilteredCols
;
189 std::unique_ptr
<ScFlatBoolRowSegments
> mpFilteredRows
;
191 ::std::set
<SCROW
> maRowPageBreaks
;
192 ::std::set
<SCROW
> maRowManualBreaks
;
193 ::std::set
<SCCOL
> maColPageBreaks
;
194 ::std::set
<SCCOL
> maColManualBreaks
;
196 std::unique_ptr
<ScOutlineTable
> pOutlineTable
;
198 std::unique_ptr
<ScSheetEvents
> pSheetEvents
;
200 mutable SCCOL nTableAreaX
;
201 mutable SCROW nTableAreaY
;
202 mutable SCCOL nTableAreaVisibleX
;
203 mutable SCROW nTableAreaVisibleY
;
206 ScDocument
& rDocument
;
207 std::unique_ptr
<utl::TextSearch
> pSearchText
;
209 mutable OUString aUpperName
; // #i62977# filled only on demand, reset in SetName
211 // sort parameter to minimize stack size of quicksort
212 ScSortParam aSortParam
;
213 CollatorWrapper
* pSortCollator
;
215 ScRangeVec aPrintRanges
;
217 std::unique_ptr
<ScRange
> pRepeatColRange
;
218 std::unique_ptr
<ScRange
> pRepeatRowRange
;
220 sal_uInt16 nLockCount
;
222 std::unique_ptr
<ScRangeList
> pScenarioRanges
;
223 Color aScenarioColor
;
225 ScScenarioFlags nScenarioFlags
;
226 std::unique_ptr
<ScDBData
> pDBDataNoName
;
227 mutable std::unique_ptr
<ScRangeName
> mpRangeName
;
229 std::unique_ptr
<ScConditionalFormatList
> mpCondFormatList
;
231 ScAddress maLOKFreezeCell
;
236 bool bPageSizeValid
:1;
237 mutable bool bTableAreaValid
:1;
238 mutable bool bTableAreaVisibleValid
:1;
240 bool bPendingRowHeights
:1;
241 bool bCalcNotification
:1;
242 bool bGlobalKeepQuery
:1;
243 bool bPrintEntireSheet
:1;
244 bool bActiveScenario
:1;
245 bool mbPageBreaksValid
:1;
246 bool mbForceBreaks
:1;
247 /** this is touched from formula group threading context */
248 std::atomic
<bool> bStreamValid
;
250 // Default attributes for the unallocated columns.
251 ScAttrArray aDefaultColAttrArray
;
253 friend class ScDocument
; // for FillInfo
254 friend class ScColumn
;
255 friend class ScValueIterator
;
256 friend class ScHorizontalValueIterator
;
257 friend class ScDBQueryDataIterator
;
258 friend class ScFormulaGroupIterator
;
259 friend class ScCellIterator
;
260 friend class ScQueryCellIterator
;
261 friend class ScCountIfCellIterator
;
262 friend class ScHorizontalCellIterator
;
263 friend class ScHorizontalAttrIterator
;
264 friend class ScDocAttrIterator
;
265 friend class ScAttrRectIterator
;
266 friend class ScColumnTextWidthIterator
;
267 friend class ScDocumentImport
;
268 friend class sc::DocumentStreamAccess
;
269 friend class sc::ColumnSpanSet
;
270 friend class sc::RangeColumnSpanSet
;
271 friend class sc::EditTextIterator
;
272 friend class sc::FormulaGroupAreaListener
;
275 ScTable( ScDocument
& rDoc
, SCTAB nNewTab
, const OUString
& rNewName
,
276 bool bColInfo
= true, bool bRowInfo
= true );
277 ~ScTable() COVERITY_NOEXCEPT_FALSE
;
278 ScTable(const ScTable
&) = delete;
279 ScTable
& operator=(const ScTable
&) = delete;
281 ScDocument
& GetDoc() { return rDocument
;}
282 const ScDocument
& GetDoc() const { return rDocument
;}
283 SCTAB
GetTab() const { return nTab
; }
285 ScOutlineTable
* GetOutlineTable() { return pOutlineTable
.get(); }
287 ScColumn
& CreateColumnIfNotExists( const SCCOL nScCol
) const
289 if ( nScCol
>= aCol
.size() )
290 CreateColumnIfNotExistsImpl(nScCol
);
293 // out-of-line the cold part of the function
294 void CreateColumnIfNotExistsImpl( const SCCOL nScCol
) const;
295 sal_uLong
GetCellCount() const;
296 sal_uLong
GetWeightedCount() const;
297 sal_uLong
GetWeightedCount(SCROW nStartRow
, SCROW nEndRow
) const;
298 sal_uLong
GetCodeCount() const; // RPN code in formula
300 sal_uInt16
GetTextWidth(SCCOL nCol
, SCROW nRow
) const;
302 bool SetOutlineTable( const ScOutlineTable
* pNewOutline
);
303 void StartOutlineTable();
305 void DoAutoOutline( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
);
307 bool TestRemoveSubTotals( const ScSubTotalParam
& rParam
);
308 void RemoveSubTotals( ScSubTotalParam
& rParam
);
309 bool DoSubTotals( ScSubTotalParam
& rParam
);
311 const ScSheetEvents
* GetSheetEvents() const { return pSheetEvents
.get(); }
312 void SetSheetEvents( std::unique_ptr
<ScSheetEvents
> pNew
);
314 bool IsVisible() const { return bVisible
; }
315 void SetVisible( bool bVis
);
317 bool IsStreamValid() const { return bStreamValid
; }
318 void SetStreamValid( bool bSet
, bool bIgnoreLock
= false );
320 [[nodiscard
]] bool IsColValid( const SCCOL nScCol
) const
322 return nScCol
>= static_cast< SCCOL
>( 0 ) && nScCol
< aCol
.size();
324 [[nodiscard
]] bool IsColRowValid( const SCCOL nScCol
, const SCROW nScRow
) const
326 return IsColValid( nScCol
) && GetDoc().ValidRow( nScRow
);
328 [[nodiscard
]] bool IsColRowTabValid( const SCCOL nScCol
, const SCROW nScRow
, const SCTAB nScTab
) const
330 return IsColValid( nScCol
) && GetDoc().ValidRow( nScRow
) && ValidTab( nScTab
);
332 [[nodiscard
]] bool ValidCol(SCCOL nCol
) const { return GetDoc().ValidCol(nCol
); }
333 [[nodiscard
]] bool ValidRow(SCROW nRow
) const { return GetDoc().ValidRow(nRow
); }
334 [[nodiscard
]] bool ValidColRow(SCCOL nCol
, SCROW nRow
) const { return GetDoc().ValidColRow(nCol
, nRow
); }
336 bool IsPendingRowHeights() const { return bPendingRowHeights
; }
337 void SetPendingRowHeights( bool bSet
);
339 bool GetCalcNotification() const { return bCalcNotification
; }
340 void SetCalcNotification( bool bSet
);
342 bool IsLayoutRTL() const { return bLayoutRTL
; }
343 bool IsLoadingRTL() const { return bLoadingRTL
; }
344 void SetLayoutRTL( bool bSet
);
345 void SetLoadingRTL( bool bSet
);
347 bool IsScenario() const { return bScenario
; }
348 void SetScenario( bool bFlag
);
349 void GetScenarioComment( OUString
& rComment
) const { rComment
= aComment
; }
350 void SetScenarioComment( const OUString
& rComment
) { aComment
= rComment
; }
351 const Color
& GetScenarioColor() const { return aScenarioColor
; }
352 void SetScenarioColor(const Color
& rNew
) { aScenarioColor
= rNew
; }
353 const Color
& GetTabBgColor() const { return aTabBgColor
; }
354 void SetTabBgColor(const Color
& rColor
);
355 ScScenarioFlags
GetScenarioFlags() const { return nScenarioFlags
; }
356 void SetScenarioFlags(ScScenarioFlags nNew
) { nScenarioFlags
= nNew
; }
357 void SetActiveScenario(bool bSet
) { bActiveScenario
= bSet
; }
358 bool IsActiveScenario() const { return bActiveScenario
; }
360 ScLinkMode
GetLinkMode() const { return nLinkMode
; }
361 bool IsLinked() const { return nLinkMode
!= ScLinkMode::NONE
; }
362 const OUString
& GetLinkDoc() const { return aLinkDoc
; }
363 const OUString
& GetLinkFlt() const { return aLinkFlt
; }
364 const OUString
& GetLinkOpt() const { return aLinkOpt
; }
365 const OUString
& GetLinkTab() const { return aLinkTab
; }
366 sal_uLong
GetLinkRefreshDelay() const { return nLinkRefreshDelay
; }
368 void SetLink( ScLinkMode nMode
, const OUString
& rDoc
, const OUString
& rFlt
,
369 const OUString
& rOpt
, const OUString
& rTab
, sal_uLong nRefreshDelay
);
371 sal_Int64
GetHashCode () const;
373 const OUString
& GetName() const { return aName
; }
374 void SetName( const OUString
& rNewName
);
376 void SetAnonymousDBData(std::unique_ptr
<ScDBData
> pDBData
);
377 ScDBData
* GetAnonymousDBData() { return pDBDataNoName
.get();}
379 const OUString
& GetCodeName() const { return aCodeName
; }
380 void SetCodeName( const OUString
& rNewName
) { aCodeName
= rNewName
; }
382 const OUString
& GetUpperName() const;
384 const OUString
& GetPageStyle() const { return aPageStyle
; }
385 void SetPageStyle( const OUString
& rName
);
386 void PageStyleModified( const OUString
& rNewName
);
388 bool IsProtected() const;
389 void SetProtection(const ScTableProtection
* pProtect
);
390 const ScTableProtection
* GetProtection() const;
391 void GetUnprotectedCells( ScRangeList
& rRangeList
) const;
393 bool IsEditActionAllowed( sc::ColRowEditAction eAction
, SCCOLROW nStart
, SCCOLROW nEnd
) const;
395 Size
GetPageSize() const;
396 void SetPageSize( const Size
& rSize
);
397 void SetRepeatArea( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCROW nEndRow
);
402 bool IsBlockEditable( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
,
403 SCROW nRow2
, bool* pOnlyNotBecauseOfMatrix
= nullptr,
404 bool bNoMatrixAtAll
= false ) const;
405 bool IsSelectionEditable( const ScMarkData
& rMark
,
406 bool* pOnlyNotBecauseOfMatrix
= nullptr ) const;
408 bool HasBlockMatrixFragment( const SCCOL nCol1
, SCROW nRow1
, const SCCOL nCol2
, SCROW nRow2
,
409 bool bNoMatrixAtAll
= false ) const;
410 bool HasSelectionMatrixFragment( const ScMarkData
& rMark
) const;
412 bool IsBlockEmpty( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, bool bIgnoreNotes
) const;
414 bool SetString( SCCOL nCol
, SCROW nRow
, SCTAB nTab
, const OUString
& rString
,
415 const ScSetStringParam
* pParam
= nullptr );
417 bool SetEditText( SCCOL nCol
, SCROW nRow
, std::unique_ptr
<EditTextObject
> pEditText
);
418 void SetEditText( SCCOL nCol
, SCROW nRow
, const EditTextObject
& rEditText
, const SfxItemPool
* pEditPool
);
419 SCROW
GetFirstEditTextRow( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
) const;
421 void SetEmptyCell( SCCOL nCol
, SCROW nRow
);
423 SCCOL nCol
, SCROW nRow
, const ScTokenArray
& rArray
, formula::FormulaGrammar::Grammar eGram
);
425 SCCOL nCol
, SCROW nRow
, const OUString
& rFormula
, formula::FormulaGrammar::Grammar eGram
);
428 * Takes ownership of pCell
430 * @return pCell if it was successfully inserted, NULL otherwise. pCell
431 * is deleted automatically on failure to insert.
433 ScFormulaCell
* SetFormulaCell( SCCOL nCol
, SCROW nRow
, ScFormulaCell
* pCell
);
435 bool SetFormulaCells( SCCOL nCol
, SCROW nRow
, std::vector
<ScFormulaCell
*>& rCells
);
437 bool HasFormulaCell( const SCCOL nCol1
, SCROW nRow1
, const SCCOL nCol2
, SCROW nRow2
) const;
439 svl::SharedString
GetSharedString( SCCOL nCol
, SCROW nRow
) const;
441 void SetValue( SCCOL nCol
, SCROW nRow
, const double& rVal
);
442 void SetValues( const SCCOL nCol
, const SCROW nRow
, const std::vector
<double>& rVals
);
443 void SetError( SCCOL nCol
, SCROW nRow
, FormulaError nError
);
444 SCSIZE
GetPatternCount( SCCOL nCol
) const;
445 SCSIZE
GetPatternCount( SCCOL nCol
, SCROW nRow1
, SCROW nRow2
) const;
446 bool ReservePatternCount( SCCOL nCol
, SCSIZE nReserve
);
448 void SetRawString( SCCOL nCol
, SCROW nRow
, const svl::SharedString
& rStr
);
449 OUString
GetString( SCCOL nCol
, SCROW nRow
, const ScInterpreterContext
* pContext
= nullptr ) const;
450 double* GetValueCell( SCCOL nCol
, SCROW nRow
);
451 // Note that if pShared is set and a value is returned that way, the returned OUString is empty.
452 OUString
GetInputString( SCCOL nCol
, SCROW nRow
, const svl::SharedString
** pShared
= nullptr ) const;
453 double GetValue( SCCOL nCol
, SCROW nRow
) const;
454 const EditTextObject
* GetEditText( SCCOL nCol
, SCROW nRow
) const;
455 void RemoveEditTextCharAttribs( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
);
456 OUString
GetFormula( SCCOL nCol
, SCROW nRow
) const;
457 const ScFormulaCell
* GetFormulaCell( SCCOL nCol
, SCROW nRow
) const;
458 ScFormulaCell
* GetFormulaCell( SCCOL nCol
, SCROW nRow
);
460 CellType
GetCellType( const ScAddress
& rPos
) const
462 if (!GetDoc().ValidColRow(rPos
.Col(),rPos
.Row()))
463 return CELLTYPE_NONE
;
464 if (rPos
.Col() >= aCol
.size())
465 return CELLTYPE_NONE
;
466 return aCol
[rPos
.Col()].GetCellType( rPos
.Row() );
468 CellType
GetCellType( SCCOL nCol
, SCROW nRow
) const;
469 ScRefCellValue
GetCellValue( SCCOL nCol
, sc::ColumnBlockPosition
& rBlockPos
, SCROW nRow
);
470 ScRefCellValue
GetCellValue( SCCOL nCol
, SCROW nRow
) const;
472 void GetFirstDataPos(SCCOL
& rCol
, SCROW
& rRow
) const;
473 void GetLastDataPos(SCCOL
& rCol
, SCROW
& rRow
) const;
475 std::unique_ptr
<ScPostIt
> ReleaseNote( SCCOL nCol
, SCROW nRow
);
476 ScPostIt
* GetNote( SCCOL nCol
, SCROW nRow
);
477 void SetNote( SCCOL nCol
, SCROW nRow
, std::unique_ptr
<ScPostIt
> pNote
);
479 size_t GetNoteCount( SCCOL nCol
) const;
480 SCROW
GetNotePosition( SCCOL nCol
, size_t nIndex
) const;
481 void CreateAllNoteCaptions();
482 void ForgetNoteCaptions( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, bool bPreserveData
);
484 void GetAllNoteEntries( std::vector
<sc::NoteEntry
>& rNotes
) const;
485 void GetNotesInRange( const ScRange
& rRange
, std::vector
<sc::NoteEntry
>& rNotes
) const;
486 CommentCaptionState
GetAllNoteCaptionsState( const ScRange
& rRange
, std::vector
<sc::NoteEntry
>& rNotes
);
487 bool ContainsNotesInRange( const ScRange
& rRange
) const;
489 bool TestInsertRow( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
) const;
490 void InsertRow( SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
);
492 const sc::ColumnSet
& rRegroupCols
, SCCOL nStartCol
, SCCOL nEndCol
, SCROW nStartRow
, SCSIZE nSize
,
493 bool* pUndoOutline
, std::vector
<ScAddress
>* pGroupPos
);
495 bool TestInsertCol( SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
) const;
497 const sc::ColumnSet
& rRegroupCols
, SCCOL nStartCol
, SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
);
499 const sc::ColumnSet
& rRegroupCols
, SCCOL nStartCol
, SCROW nStartRow
, SCROW nEndRow
, SCSIZE nSize
, bool* pUndoOutline
);
502 SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, InsertDeleteFlags nDelFlag
,
503 bool bBroadcast
= true, sc::ColumnSpanSet
* pBroadcastSpans
= nullptr );
505 void CopyToClip( sc::CopyToClipContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScTable
* pTable
);
506 void CopyToClip( sc::CopyToClipContext
& rCxt
, const ScRangeList
& rRanges
, ScTable
* pTable
);
508 void CopyStaticToDocument(
509 SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, const SvNumberFormatterMergeMap
& rMap
,
512 void CopyCellToDocument( SCCOL nSrcCol
, SCROW nSrcRow
, SCCOL nDestCol
, SCROW nDestRow
, ScTable
& rDestTab
);
514 bool InitColumnBlockPosition( sc::ColumnBlockPosition
& rBlockPos
, SCCOL nCol
);
516 void DeleteBeforeCopyFromClip(
517 sc::CopyFromClipContext
& rCxt
, const ScTable
& rClipTab
, sc::ColumnSpanSet
& rBroadcastSpans
);
519 void CopyOneCellFromClip(
520 sc::CopyFromClipContext
& rCxt
, const SCCOL nCol1
, const SCROW nRow1
,
521 const SCCOL nCol2
, const SCROW nRow2
,
522 const SCROW nSrcRow
, const ScTable
* pSrcTab
);
525 sc::CopyFromClipContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
526 SCCOL nDx
, SCROW nDy
, ScTable
* pTable
);
528 void StartListeningFormulaCells(
529 sc::StartListeningContext
& rStartCxt
, sc::EndListeningContext
& rEndCxt
,
530 SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
532 void SetDirtyFromClip(
533 SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, sc::ColumnSpanSet
& rBroadcastSpans
);
536 sc::CopyToDocContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
537 InsertDeleteFlags nFlags
, bool bMarked
, ScTable
* pDestTab
,
538 const ScMarkData
* pMarkData
, bool bAsLink
, bool bColRowFlags
,
539 bool bGlobalNamesToLocal
, bool bCopyCaptions
);
541 void CopyCaptionsToTable( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScTable
* pDestTab
, bool bCloneCaption
);
544 sc::CopyToDocContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
545 InsertDeleteFlags nFlags
, bool bMarked
, ScTable
* pDestTab
);
547 void CopyConditionalFormat( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
548 SCCOL nDx
, SCROW nDy
, const ScTable
* pTable
);
550 * @param nCombinedStartRow start row of the combined range;
551 * used for transposed multi range selection with row direction;
552 * for other cases than multi range row selection this it equal to nRow1
553 * @param nRowDestOffset adjustment of destination row position;
554 * used for transposed multi range selection with row direction, otherwise 0
556 void TransposeClip(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, SCROW nCombinedStartRow
,
557 SCROW nRowDestOffset
, ScTable
* pTransClip
, InsertDeleteFlags nFlags
,
558 bool bAsLink
, bool bIncludeFiltered
);
560 // mark of this document
562 sc::MixDocContext
& rCxt
, const ScMarkData
& rMark
, ScPasteFunc nFunction
,
563 bool bSkipEmpty
, const ScTable
* pSrcTab
);
566 sc::MixDocContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
567 ScPasteFunc nFunction
, bool bSkipEmpty
, const ScTable
* pSrcTab
);
569 void CopyData( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
570 SCCOL nDestCol
, SCROW nDestRow
, SCTAB nDestTab
);
572 void CopyScenarioFrom( const ScTable
* pSrcTab
);
573 void CopyScenarioTo( const ScTable
* pDestTab
) const;
574 bool TestCopyScenarioTo( const ScTable
* pDestTab
) const;
575 void MarkScenarioIn(ScMarkData
& rMark
, ScScenarioFlags nNeededBits
) const;
576 bool HasScenarioRange( const ScRange
& rRange
) const;
577 void InvalidateScenarioRanges();
578 const ScRangeList
* GetScenarioRanges() const;
580 void CopyUpdated( const ScTable
* pPosTab
, ScTable
* pDestTab
) const;
582 void InvalidateTableArea();
583 void InvalidatePageBreaks();
585 bool GetCellArea( SCCOL
& rEndCol
, SCROW
& rEndRow
) const; // FALSE = empty
586 bool GetTableArea( SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bCalcHiddens
= false) const;
587 bool GetPrintArea( SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bNotes
, bool bCalcHiddens
= false) const;
588 bool GetPrintAreaHor( SCROW nStartRow
, SCROW nEndRow
,
589 SCCOL
& rEndCol
) const;
590 bool GetPrintAreaVer( SCCOL nStartCol
, SCCOL nEndCol
,
591 SCROW
& rEndRow
, bool bNotes
) const;
593 bool GetDataStart( SCCOL
& rStartCol
, SCROW
& rStartRow
) const;
595 void ExtendPrintArea( OutputDevice
* pDev
,
596 SCCOL nStartCol
, SCROW nStartRow
, SCCOL
& rEndCol
, SCROW nEndRow
);
598 void GetDataArea( SCCOL
& rStartCol
, SCROW
& rStartRow
, SCCOL
& rEndCol
, SCROW
& rEndRow
,
599 bool bIncludeOld
, bool bOnlyDown
) const;
601 bool GetDataAreaSubrange( ScRange
& rRange
) const;
603 bool ShrinkToUsedDataArea( bool& o_bShrunk
, SCCOL
& rStartCol
, SCROW
& rStartRow
,
604 SCCOL
& rEndCol
, SCROW
& rEndRow
, bool bColumnsOnly
,
605 bool bStickyTopRow
, bool bStickyLeftCol
,
606 ScDataAreaExtras
* pDataAreaExtras
) const;
608 SCROW
GetLastDataRow( SCCOL nCol1
, SCCOL nCol2
, SCROW nLastRow
,
609 ScDataAreaExtras
* pDataAreaExtras
= nullptr ) const;
611 SCSIZE
GetEmptyLinesInBlock( SCCOL nStartCol
, SCROW nStartRow
,
612 SCCOL nEndCol
, SCROW nEndRow
, ScDirection eDir
) const;
614 void FindAreaPos( SCCOL
& rCol
, SCROW
& rRow
, ScMoveDirection eDirection
) const;
615 void GetNextPos( SCCOL
& rCol
, SCROW
& rRow
, SCCOL nMovX
, SCROW nMovY
,
616 bool bMarked
, bool bUnprotected
, const ScMarkData
& rMark
, SCCOL nTabStartCol
) const;
618 bool SkipRow( const SCCOL rCol
, SCROW
& rRow
, const SCROW nMovY
, const ScMarkData
& rMark
,
619 const bool bUp
, const SCROW nUsedY
, const bool bMarked
, const bool bSheetProtected
) const;
620 void LimitChartArea( SCCOL
& rStartCol
, SCROW
& rStartRow
, SCCOL
& rEndCol
, SCROW
& rEndRow
) const;
622 bool HasData( SCCOL nCol
, SCROW nRow
) const;
623 bool HasStringData( SCCOL nCol
, SCROW nRow
) const;
624 bool HasValueData( SCCOL nCol
, SCROW nRow
) const;
625 bool HasStringCells( SCCOL nStartCol
, SCROW nStartRow
,
626 SCCOL nEndCol
, SCROW nEndRow
) const;
628 sc::MultiDataCellState
HasMultipleDataCells( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
) const;
630 FormulaError
GetErrCode( const ScAddress
& rPos
) const
632 return IsColRowValid(rPos
.Col(),rPos
.Row()) ?
633 aCol
[rPos
.Col()].GetErrCode( rPos
.Row() ) :
637 void ResetChanged( const ScRange
& rRange
);
639 void CheckVectorizationState();
640 void SetAllFormulasDirty( const sc::SetFormulaDirtyContext
& rCxt
);
641 void SetDirty( const ScRange
&, ScColumn::BroadcastMode
);
642 void SetDirtyAfterLoad();
644 void SetTableOpDirty( const ScRange
& );
646 void CalcAfterLoad( sc::CompileFormulaContext
& rCxt
, bool bStartListening
);
647 void CompileAll( sc::CompileFormulaContext
& rCxt
);
648 void CompileXML( sc::CompileFormulaContext
& rCxt
, ScProgress
& rProgress
);
650 /** Broadcast single broadcasters in range, without explicitly setting
651 anything dirty, not doing area broadcasts.
652 @param rHint address is modified to adapt to the actual broadcasted
653 position on each iteration and upon return points to the last
654 position broadcasted. */
655 bool BroadcastBroadcasters( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, SfxHintId nHint
);
657 bool CompileErrorCells( sc::CompileFormulaContext
& rCxt
, FormulaError nErrCode
);
659 void UpdateReference(
660 sc::RefUpdateContext
& rCxt
, ScDocument
* pUndoDoc
= nullptr,
661 bool bIncludeDraw
= true, bool bUpdateNoteCaptionPos
= true );
663 void UpdateDrawRef( UpdateRefMode eUpdateRefMode
, SCCOL nCol1
, SCROW nRow1
, SCTAB nTab1
,
664 SCCOL nCol2
, SCROW nRow2
, SCTAB nTab2
,
665 SCCOL nDx
, SCROW nDy
, SCTAB nDz
, bool bUpdateNoteCaptionPos
= true );
667 void UpdateTranspose( const ScRange
& rSource
, const ScAddress
& rDest
,
668 ScDocument
* pUndoDoc
);
670 void UpdateGrow( const ScRange
& rArea
, SCCOL nGrowX
, SCROW nGrowY
);
672 void UpdateInsertTab( sc::RefUpdateInsertTabContext
& rCxt
);
673 void UpdateDeleteTab( sc::RefUpdateDeleteTabContext
& rCxt
);
674 void UpdateMoveTab( sc::RefUpdateMoveTabContext
& rCxt
, SCTAB nTabNo
, ScProgress
* pProgress
);
675 void UpdateCompile( bool bForceIfNameInUse
= false );
676 void SetTabNo(SCTAB nNewTab
);
677 void FindRangeNamesInUse(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
678 sc::UpdatedRangeNames
& rIndexes
) const;
679 void Fill( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
680 sal_uLong nFillCount
, FillDir eFillDir
, FillCmd eFillCmd
, FillDateCmd eFillDateCmd
,
681 double nStepValue
, double nMaxValue
, ScProgress
* pProgress
);
682 OUString
GetAutoFillPreview( const ScRange
& rSource
, SCCOL nEndX
, SCROW nEndY
);
684 void UpdateSelectionFunction( ScFunctionData
& rData
, const ScMarkData
& rMark
);
686 void AutoFormat( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
687 sal_uInt16 nFormatNo
);
688 void GetAutoFormatData(SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, ScAutoFormatData
& rData
);
689 bool SearchAndReplace(
690 const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
,
691 ScRangeList
& rMatchedRanges
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
693 void FindMaxRotCol( RowInfo
* pRowInfo
, SCSIZE nArrCount
, SCCOL nX1
, SCCOL nX2
);
695 bool HasAttrib( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, HasAttrFlags nMask
) const;
696 bool HasAttribSelection( const ScMarkData
& rMark
, HasAttrFlags nMask
) const;
697 bool IsMerged( SCCOL nCol
, SCROW nRow
) const;
698 bool ExtendMerge( SCCOL nStartCol
, SCROW nStartRow
,
699 SCCOL
& rEndCol
, SCROW
& rEndRow
,
701 void SetMergedCells( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
703 const SfxPoolItem
* GetAttr( SCCOL nCol
, SCROW nRow
, sal_uInt16 nWhich
) const;
704 template<class T
> const T
* GetAttr( SCCOL nCol
, SCROW nRow
, TypedWhichId
<T
> nWhich
) const
706 return static_cast<const T
*>(GetAttr(nCol
, nRow
, sal_uInt16(nWhich
)));
708 const ScPatternAttr
* GetPattern( SCCOL nCol
, SCROW nRow
) const;
709 const ScPatternAttr
* GetMostUsedPattern( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
) const;
711 sal_uInt32
GetNumberFormat( const ScInterpreterContext
& rContext
, const ScAddress
& rPos
) const;
712 sal_uInt32
GetNumberFormat( SCCOL nCol
, SCROW nRow
) const;
713 sal_uInt32
GetNumberFormat( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
) const;
715 void SetNumberFormat( SCCOL nCol
, SCROW nRow
, sal_uInt32 nNumberFormat
);
717 void MergeSelectionPattern( ScMergePatternState
& rState
,
718 const ScMarkData
& rMark
, bool bDeep
) const;
719 void MergePatternArea( ScMergePatternState
& rState
, SCCOL nCol1
, SCROW nRow1
,
720 SCCOL nCol2
, SCROW nRow2
, bool bDeep
) const;
721 void MergeBlockFrame( SvxBoxItem
* pLineOuter
, SvxBoxInfoItem
* pLineInner
,
723 SCCOL nStartCol
, SCROW nStartRow
,
724 SCCOL nEndCol
, SCROW nEndRow
) const;
725 void ApplyBlockFrame(const SvxBoxItem
& rLineOuter
,
726 const SvxBoxInfoItem
* pLineInner
,
727 SCCOL nStartCol
, SCROW nStartRow
,
728 SCCOL nEndCol
, SCROW nEndRow
);
730 void ApplyAttr( SCCOL nCol
, SCROW nRow
, const SfxPoolItem
& rAttr
);
731 void ApplyPattern( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
);
732 void ApplyPatternArea( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
733 const ScPatternAttr
& rAttr
, ScEditDataArray
* pDataArray
= nullptr,
734 bool* const pIsChanged
= nullptr );
736 void SetPattern( const ScAddress
& rPos
, const ScPatternAttr
& rAttr
);
737 const ScPatternAttr
* SetPattern( SCCOL nCol
, SCROW nRow
, std::unique_ptr
<ScPatternAttr
> );
738 void SetPattern( SCCOL nCol
, SCROW nRow
, const ScPatternAttr
& rAttr
);
739 void ApplyPatternIfNumberformatIncompatible( const ScRange
& rRange
,
740 const ScPatternAttr
& rPattern
, SvNumFormatType nNewType
);
741 void AddCondFormatData( const ScRangeList
& rRange
, sal_uInt32 nIndex
);
742 void RemoveCondFormatData( const ScRangeList
& rRange
, sal_uInt32 nIndex
);
743 void SetPatternAreaCondFormat( SCCOL nCol
, SCROW nStartRow
, SCROW nEndRow
,
744 const ScPatternAttr
& rAttr
, const ScCondFormatIndexes
& rCondFormatIndexes
);
746 void ApplyStyle( SCCOL nCol
, SCROW nRow
, const ScStyleSheet
* rStyle
);
747 void ApplyStyleArea( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, const ScStyleSheet
& rStyle
);
748 void ApplySelectionStyle(const ScStyleSheet
& rStyle
, const ScMarkData
& rMark
);
749 void ApplySelectionLineStyle( const ScMarkData
& rMark
,
750 const ::editeng::SvxBorderLine
* pLine
, bool bColorOnly
);
752 const ScStyleSheet
* GetStyle( SCCOL nCol
, SCROW nRow
) const;
753 const ScStyleSheet
* GetSelectionStyle( const ScMarkData
& rMark
, bool& rFound
) const;
754 const ScStyleSheet
* GetAreaStyle( bool& rFound
, SCCOL nCol1
, SCROW nRow1
,
755 SCCOL nCol2
, SCROW nRow2
) const;
757 void StyleSheetChanged( const SfxStyleSheetBase
* pStyleSheet
, bool bRemoved
,
759 double nPPTX
, double nPPTY
,
760 const Fraction
& rZoomX
, const Fraction
& rZoomY
);
762 bool IsStyleSheetUsed( const ScStyleSheet
& rStyle
) const;
764 bool ApplyFlags( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, ScMF nFlags
);
765 bool RemoveFlags( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, ScMF nFlags
);
767 void ApplySelectionCache( SfxItemPoolCache
* pCache
, const ScMarkData
& rMark
, ScEditDataArray
* pDataArray
= nullptr, bool* const pIsChanged
= nullptr );
768 void DeleteSelection( InsertDeleteFlags nDelFlag
, const ScMarkData
& rMark
, bool bBroadcast
= true );
770 void ClearSelectionItems( const sal_uInt16
* pWhich
, const ScMarkData
& rMark
);
771 void ChangeSelectionIndent( bool bIncrement
, const ScMarkData
& rMark
);
773 const ScRange
* GetRepeatColRange() const { return pRepeatColRange
.get(); }
774 const ScRange
* GetRepeatRowRange() const { return pRepeatRowRange
.get(); }
775 void SetRepeatColRange( std::unique_ptr
<ScRange
> pNew
);
776 void SetRepeatRowRange( std::unique_ptr
<ScRange
> pNew
);
778 sal_uInt16
GetPrintRangeCount() const { return static_cast< sal_uInt16
>( aPrintRanges
.size() ); }
779 const ScRange
* GetPrintRange(sal_uInt16 nPos
) const;
780 /** Returns true, if the sheet is always printed. */
781 bool IsPrintEntireSheet() const { return bPrintEntireSheet
; }
783 /** Removes all print ranges. */
784 void ClearPrintRanges();
785 /** Adds a new print ranges. */
786 void AddPrintRange( const ScRange
& rNew
);
787 /** Marks the specified sheet to be printed completely. Deletes old print ranges! */
788 void SetPrintEntireSheet();
790 void FillPrintSaver( ScPrintSaverTab
& rSaveTab
) const;
791 void RestorePrintRanges( const ScPrintSaverTab
& rSaveTab
);
793 sal_uInt16
GetOptimalColWidth( SCCOL nCol
, OutputDevice
* pDev
,
794 double nPPTX
, double nPPTY
,
795 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
796 bool bFormula
, const ScMarkData
* pMarkData
,
797 const ScColWidthParam
* pParam
);
798 bool SetOptimalHeight(
799 sc::RowHeightContext
& rCxt
, SCROW nStartRow
, SCROW nEndRow
, bool bApi
,
800 ScProgress
* pOuterProgress
= nullptr, sal_uLong nProgressStart
= 0 );
802 void SetOptimalHeightOnly(
803 sc::RowHeightContext
& rCxt
, SCROW nStartRow
, SCROW nEndRow
,
804 ScProgress
* pOuterProgress
= nullptr, sal_uLong nProgressStart
= 0 );
806 tools::Long
GetNeededSize( SCCOL nCol
, SCROW nRow
,
808 double nPPTX
, double nPPTY
,
809 const Fraction
& rZoomX
, const Fraction
& rZoomY
,
810 bool bWidth
, bool bTotalSize
,
811 bool bInPrintTwips
= false);
812 void SetColWidth( SCCOL nCol
, sal_uInt16 nNewWidth
);
813 void SetColWidthOnly( SCCOL nCol
, sal_uInt16 nNewWidth
);
814 void SetRowHeight( SCROW nRow
, sal_uInt16 nNewHeight
);
815 bool SetRowHeightRange( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nNewHeight
,
816 double nPPTY
, bool bApi
);
819 * Set specified row height to specified ranges. Don't check for drawing
820 * objects etc. Just set the row height. Nothing else.
822 * Note that setting a new row height via this function will not
823 * invalidate page breaks.
825 void SetRowHeightOnly( SCROW nStartRow
, SCROW nEndRow
, sal_uInt16 nNewHeight
);
827 // nPPT to test for modification
828 void SetManualHeight( SCROW nStartRow
, SCROW nEndRow
, bool bManual
);
830 sal_uInt16
GetColWidth( SCCOL nCol
, bool bHiddenAsZero
= true ) const;
831 sal_uLong
GetColWidth( SCCOL nStartCol
, SCCOL nEndCol
) const;
832 sal_uInt16
GetRowHeight( SCROW nRow
, SCROW
* pStartRow
, SCROW
* pEndRow
, bool bHiddenAsZero
= true ) const;
833 sal_uLong
GetRowHeight( SCROW nStartRow
, SCROW nEndRow
, bool bHiddenAsZero
= true ) const;
834 sal_uLong
GetScaledRowHeight( SCROW nStartRow
, SCROW nEndRow
, double fScale
) const;
835 sal_uLong
GetColOffset( SCCOL nCol
, bool bHiddenAsZero
= true ) const;
836 sal_uLong
GetRowOffset( SCROW nRow
, bool bHiddenAsZero
= true ) const;
839 * Get the last row such that the height of row 0 to the end row is as
840 * high as possible without exceeding the specified height value.
842 * @param nHeight maximum desired height
844 * @return SCROW last row of the range within specified height.
846 SCROW
GetRowForHeight(sal_uLong nHeight
) const;
848 sal_uInt16
GetOriginalWidth( SCCOL nCol
) const;
849 sal_uInt16
GetOriginalHeight( SCROW nRow
) const;
851 sal_uInt16
GetCommonWidth( SCCOL nEndCol
) const;
853 SCROW
GetHiddenRowCount( SCROW nRow
) const;
855 void ShowCol(SCCOL nCol
, bool bShow
);
856 void ShowRow(SCROW nRow
, bool bShow
);
857 void DBShowRow(SCROW nRow
, bool bShow
);
859 void ShowRows(SCROW nRow1
, SCROW nRow2
, bool bShow
);
860 void DBShowRows(SCROW nRow1
, SCROW nRow2
, bool bShow
);
862 void SetRowFlags( SCROW nRow
, CRFlags nNewFlags
);
863 void SetRowFlags( SCROW nStartRow
, SCROW nEndRow
, CRFlags nNewFlags
);
865 /// @return the index of the last row with any set flags (auto-pagebreak is ignored).
866 SCROW
GetLastFlaggedRow() const;
868 /// @return the index of the last changed column (flags and column width, auto pagebreak is ignored).
869 SCCOL
GetLastChangedCol() const;
870 /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored).
871 SCROW
GetLastChangedRow() const;
873 bool IsDataFiltered(SCCOL nColStart
, SCROW nRowStart
, SCCOL nColEnd
, SCROW nRowEnd
) const;
874 bool IsDataFiltered(const ScRange
& rRange
) const;
875 CRFlags
GetColFlags( SCCOL nCol
) const;
876 CRFlags
GetRowFlags( SCROW nRow
) const;
878 const ScBitMaskCompressedArray
< SCROW
, CRFlags
> * GetRowFlagsArray() const
879 { return pRowFlags
.get(); }
881 bool UpdateOutlineCol( SCCOL nStartCol
, SCCOL nEndCol
, bool bShow
);
882 bool UpdateOutlineRow( SCROW nStartRow
, SCROW nEndRow
, bool bShow
);
884 void UpdatePageBreaks( const ScRange
* pUserArea
);
885 void RemoveManualBreaks();
886 bool HasManualBreaks() const;
887 void SetRowManualBreaks( ::std::set
<SCROW
>&& rBreaks
);
888 void SetColManualBreaks( ::std::set
<SCCOL
>&& rBreaks
);
890 void GetAllRowBreaks(::std::set
<SCROW
>& rBreaks
, bool bPage
, bool bManual
) const;
891 void GetAllColBreaks(::std::set
<SCCOL
>& rBreaks
, bool bPage
, bool bManual
) const;
892 bool HasRowPageBreak(SCROW nRow
) const;
893 bool HasColPageBreak(SCCOL nCol
) const;
894 bool HasRowManualBreak(SCROW nRow
) const;
895 bool HasColManualBreak(SCCOL nCol
) const;
898 * Get the row position of the next manual break that occurs at or below
899 * specified row. When no more manual breaks are present at or below
900 * the specified row, -1 is returned.
902 * @param nRow row at which the search begins.
904 * @return SCROW next row position with manual page break, or -1 if no
905 * more manual breaks are present.
907 SCROW
GetNextManualBreak(SCROW nRow
) const;
909 void RemoveRowPageBreaks(SCROW nStartRow
, SCROW nEndRow
);
910 void RemoveRowBreak(SCROW nRow
, bool bPage
, bool bManual
);
911 void RemoveColBreak(SCCOL nCol
, bool bPage
, bool bManual
);
912 void SetRowBreak(SCROW nRow
, bool bPage
, bool bManual
);
913 void SetColBreak(SCCOL nCol
, bool bPage
, bool bManual
);
915 css::sheet::TablePageBreakData
> GetRowBreakData() const;
917 bool RowHidden(SCROW nRow
, SCROW
* pFirstRow
= nullptr, SCROW
* pLastRow
= nullptr) const;
918 bool RowHiddenLeaf(SCROW nRow
, SCROW
* pFirstRow
= nullptr, SCROW
* pLastRow
= nullptr) const;
919 bool HasHiddenRows(SCROW nStartRow
, SCROW nEndRow
) const;
920 bool ColHidden(SCCOL nCol
, SCCOL
* pFirstCol
= nullptr, SCCOL
* pLastCol
= nullptr) const;
921 bool SetRowHidden(SCROW nStartRow
, SCROW nEndRow
, bool bHidden
);
922 void SetColHidden(SCCOL nStartCol
, SCCOL nEndCol
, bool bHidden
);
923 void CopyColHidden(const ScTable
& rTable
, SCCOL nStartCol
, SCCOL nEndCol
);
924 void CopyRowHidden(const ScTable
& rTable
, SCROW nStartRow
, SCROW nEndRow
);
925 void CopyRowHeight(const ScTable
& rSrcTable
, SCROW nStartRow
, SCROW nEndRow
, SCROW nSrcOffset
);
926 SCROW
FirstVisibleRow(SCROW nStartRow
, SCROW nEndRow
) const;
927 SCROW
LastVisibleRow(SCROW nStartRow
, SCROW nEndRow
) const;
928 SCROW
CountVisibleRows(SCROW nStartRow
, SCROW nEndRow
) const;
929 sal_uInt32
GetTotalRowHeight(SCROW nStartRow
, SCROW nEndRow
, bool bHiddenAsZero
= true) const;
931 SCCOLROW
LastHiddenColRow(SCCOLROW nPos
, bool bCol
) const;
933 bool RowFiltered(SCROW nRow
, SCROW
* pFirstRow
= nullptr, SCROW
* pLastRow
= nullptr) const;
934 bool ColFiltered(SCCOL nCol
, SCCOL
* pFirstCol
= nullptr, SCCOL
* pLastCol
= nullptr) const;
935 bool HasFilteredRows(SCROW nStartRow
, SCROW nEndRow
) const;
936 void CopyColFiltered(const ScTable
& rTable
, SCCOL nStartCol
, SCCOL nEndCol
);
937 void CopyRowFiltered(const ScTable
& rTable
, SCROW nStartRow
, SCROW nEndRow
);
938 void SetRowFiltered(SCROW nStartRow
, SCROW nEndRow
, bool bFiltered
);
939 void SetColFiltered(SCCOL nStartCol
, SCCOL nEndCol
, bool bFiltered
);
940 SCROW
FirstNonFilteredRow(SCROW nStartRow
, SCROW nEndRow
) const;
941 SCROW
LastNonFilteredRow(SCROW nStartRow
, SCROW nEndRow
) const;
942 SCROW
CountNonFilteredRows(SCROW nStartRow
, SCROW nEndRow
) const;
944 bool IsManualRowHeight(SCROW nRow
) const;
946 bool HasUniformRowHeight( SCROW nRow1
, SCROW nRow2
) const;
948 void SyncColRowFlags();
950 void StripHidden( SCCOL
& rX1
, SCROW
& rY1
, SCCOL
& rX2
, SCROW
& rY2
);
951 void ExtendHidden( SCCOL
& rX1
, SCROW
& rY1
, SCCOL
& rX2
, SCROW
& rY2
);
953 /** Sort a range of data. */
955 const ScSortParam
& rSortParam
, bool bKeepQuery
, bool bUpdateRefs
,
956 ScProgress
* pProgress
, sc::ReorderParam
* pUndo
);
958 void Reorder( const sc::ReorderParam
& rParam
);
960 // For ValidQuery() see ScQueryEvalutor class.
961 void TopTenQuery( ScQueryParam
& );
962 void PrepareQuery( ScQueryParam
& rQueryParam
);
963 SCSIZE
Query(const ScQueryParam
& rQueryParam
, bool bKeepSub
);
964 bool CreateQueryParam(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
966 void GetFilterEntries(SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, ScFilterEntries
& rFilterEntries
, bool bFiltering
= false);
967 void GetFilteredFilterEntries(SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, const ScQueryParam
& rParam
, ScFilterEntries
& rFilterEntries
, bool bFiltering
);
969 bool GetDataEntries(SCCOL nCol
, SCROW nRow
, std::set
<ScTypedStrData
>& rStrings
);
971 bool HasColHeader( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
) const;
972 bool HasRowHeader( SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
) const;
974 sal_Int32
GetMaxStringLen( SCCOL nCol
,
975 SCROW nRowStart
, SCROW nRowEnd
, rtl_TextEncoding eCharSet
) const;
976 sal_Int32
GetMaxNumberStringLen( sal_uInt16
& nPrecision
,
978 SCROW nRowStart
, SCROW nRowEnd
) const;
980 bool IsSortCollatorGlobal() const;
981 void InitSortCollator( const ScSortParam
& rPar
);
982 void DestroySortCollator();
983 void SetDrawPageSize( bool bResetStreamValid
= true, bool bUpdateNoteCaptionPos
= true,
984 const ScObjectHandling eObjectHandling
= ScObjectHandling::RecalcPosMode
);
986 void SetRangeName(std::unique_ptr
<ScRangeName
> pNew
);
987 ScRangeName
* GetRangeName() const;
989 void PreprocessRangeNameUpdate(
990 sc::EndListeningContext
& rEndListenCxt
, sc::CompileFormulaContext
& rCompileCxt
);
992 void CompileHybridFormula(
993 sc::StartListeningContext
& rStartListenCxt
, sc::CompileFormulaContext
& rCompileCxt
);
995 void PreprocessDBDataUpdate(
996 sc::EndListeningContext
& rEndListenCxt
, sc::CompileFormulaContext
& rCompileCxt
);
998 ScConditionalFormatList
* GetCondFormList();
999 const ScConditionalFormatList
* GetCondFormList() const;
1000 void SetCondFormList( ScConditionalFormatList
* pList
);
1002 void DeleteConditionalFormat(sal_uLong nOldIndex
);
1004 sal_uLong
AddCondFormat( std::unique_ptr
<ScConditionalFormat
> pNew
);
1006 SvtScriptType
GetScriptType( SCCOL nCol
, SCROW nRow
) const;
1007 void SetScriptType( SCCOL nCol
, SCROW nRow
, SvtScriptType nType
);
1008 void UpdateScriptTypes( const SCCOL nCol1
, SCROW nRow1
, const SCCOL nCol2
, SCROW nRow2
);
1010 SvtScriptType
GetRangeScriptType( sc::ColumnBlockPosition
& rBlockPos
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
1012 formula::FormulaTokenRef
ResolveStaticReference( SCCOL nCol
, SCROW nRow
);
1013 formula::FormulaTokenRef
ResolveStaticReference( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
1014 formula::VectorRefArray
FetchVectorRefArray( SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
1015 bool HandleRefArrayForParallelism( SCCOL nCol
, SCROW nRow1
, SCROW nRow2
, const ScFormulaCellGroupRef
& mxGroup
);
1017 void AssertNoInterpretNeeded( SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
1020 void SplitFormulaGroups( SCCOL nCol
, std::vector
<SCROW
>& rRows
);
1021 void UnshareFormulaCells( SCCOL nCol
, std::vector
<SCROW
>& rRows
);
1022 void RegroupFormulaCells( SCCOL nCol
);
1024 ScRefCellValue
GetRefCellValue( SCCOL nCol
, SCROW nRow
);
1025 ScRefCellValue
GetRefCellValue( SCCOL nCol
, SCROW nRow
, sc::ColumnBlockPosition
& rBlockPos
);
1027 SvtBroadcaster
* GetBroadcaster( SCCOL nCol
, SCROW nRow
);
1028 const SvtBroadcaster
* GetBroadcaster( SCCOL nCol
, SCROW nRow
) const;
1029 void DeleteBroadcasters( sc::ColumnBlockPosition
& rBlockPos
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
);
1031 void FillMatrix( ScMatrix
& rMat
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, svl::SharedStringPool
* pPool
) const;
1033 void InterpretDirtyCells( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
1034 void InterpretCellsIfNeeded( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
1036 void SetFormulaResults( SCCOL nCol
, SCROW nRow
, const double* pResults
, size_t nLen
);
1038 void CalculateInColumnInThread( ScInterpreterContext
& rContext
, SCCOL nColStart
, SCCOL nColEnd
,
1039 SCROW nRowStart
, SCROW nRowEnd
, unsigned nThisThread
, unsigned nThreadsTotal
);
1040 void HandleStuffAfterParallelCalculation( SCCOL nColStart
, SCCOL nColEnd
, SCROW nRow
, size_t nLen
, ScInterpreter
* pInterpreter
);
1043 * Either start all formula cells as listeners unconditionally, or start
1044 * those that are marked "needs listening".
1046 * @param rCxt context object.
1047 * @param bAll when true, start all formula cells as listeners. When
1048 * false, only start those that are marked "needs listening".
1050 void StartListeners( sc::StartListeningContext
& rCxt
, bool bAll
);
1053 * Mark formula cells dirty that have the mbPostponedDirty flag set or
1054 * contain named ranges with relative references.
1056 void SetDirtyIfPostponed();
1059 * Broadcast dirty formula cells that contain functions such as CELL(),
1060 * COLUMN() or ROW() which may change its value on move.
1062 void BroadcastRecalcOnRefMove();
1064 void TransferCellValuesTo( const SCCOL nCol
, SCROW nRow
, size_t nLen
, sc::CellValues
& rDest
);
1065 void CopyCellValuesFrom( const SCCOL nCol
, SCROW nRow
, const sc::CellValues
& rSrc
);
1067 std::optional
<sc::ColumnIterator
> GetColumnIterator( SCCOL nCol
, SCROW nRow1
, SCROW nRow2
) const;
1069 bool EnsureFormulaCellResults( const SCCOL nCol1
, SCROW nRow1
, const SCCOL nCol2
, SCROW nRow2
, bool bSkipRunning
= false );
1071 void ConvertFormulaToValue(
1072 sc::EndListeningContext
& rCxt
,
1073 const SCCOL nCol1
, const SCROW nRow1
, const SCCOL nCol2
, const SCROW nRow2
,
1074 sc::TableValues
* pUndo
);
1077 sc::TableValues
& rValues
, sc::StartListeningContext
& rStartCxt
, sc::EndListeningContext
& rEndCxt
);
1079 void finalizeOutlineImport();
1081 void StoreToCache(SvStream
& rStrm
) const;
1083 void RestoreFromCache(SvStream
& rStrm
);
1085 #if DUMP_COLUMN_STORAGE
1086 void DumpColumnStorage( SCCOL nCol
) const;
1089 /** Replace behaves differently to the Search; adjust the rCol and rRow accordingly.
1091 'Replace' replaces at the 'current' position, but in order to achieve
1092 that, we have to 'shift' the rCol / rRow to the 'previous' position -
1093 what it is depends on various settings in rSearchItem.
1095 static void UpdateSearchItemAddressForReplace( const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
);
1097 ScColumnsRange
GetColumnsRange(SCCOL begin
, SCCOL end
) const;
1098 SCCOL
ClampToAllocatedColumns(SCCOL nCol
) const { return std::min(nCol
, static_cast<SCCOL
>(aCol
.size() - 1)); }
1099 SCCOL
GetAllocatedColumnsCount() const { return aCol
.size(); }
1102 * Serializes the sheet's geometry data.
1104 * @param bColumns - if true it dumps the data for columns, else it does for rows.
1105 * @param eGeomType indicates the type of data to be dumped for rows/columns.
1106 * @return the serialization of the sheet's geometry data as an OString.
1108 OString
dumpSheetGeomData(bool bColumns
, SheetGeomType eGeomType
);
1110 std::set
<SCCOL
> QueryColumnsWithFormulaCells() const;
1112 void CheckIntegrity() const;
1116 void FillFormulaVertical(
1117 const ScFormulaCell
& rSrcCell
,
1118 SCCOLROW
& rInner
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
,
1119 ScProgress
* pProgress
, sal_uLong
& rProgress
);
1121 void FillSeriesSimple(
1122 const ScCellValue
& rSrcCell
, SCCOLROW
& rInner
, SCCOLROW nIMin
, SCCOLROW nIMax
,
1123 const SCCOLROW
& rCol
, const SCCOLROW
& rRow
, bool bVertical
, ScProgress
* pProgress
, sal_uLong
& rProgress
);
1125 void FillAutoSimple(
1126 SCCOLROW nISrcStart
, SCCOLROW nISrcEnd
, SCCOLROW nIStart
, SCCOLROW nIEnd
,
1127 SCCOLROW
& rInner
, const SCCOLROW
& rCol
, const SCCOLROW
& rRow
,
1128 sal_uLong nActFormCnt
, sal_uLong nMaxFormCnt
,
1129 bool bHasFiltered
, bool bVertical
, bool bPositive
,
1130 ScProgress
* pProgress
, sal_uLong
& rProgress
);
1132 void FillSeries( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
1133 sal_uLong nFillCount
, FillDir eFillDir
, FillCmd eFillCmd
,
1134 FillDateCmd eFillDateCmd
,
1135 double nStepValue
, double nMaxValue
, sal_uInt16 nMinDigits
,
1136 bool bAttribs
, ScProgress
* pProgress
,
1137 bool bSkipOverlappedCells
= false,
1138 std::vector
<sal_Int32
>* pNonOverlappedCellIdx
= nullptr);
1139 void FillAnalyse( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
1140 FillCmd
& rCmd
, FillDateCmd
& rDateCmd
,
1141 double& rInc
, sal_uInt16
& rMinDigits
,
1142 ScUserListData
*& rListData
, sal_uInt16
& rListIndex
,
1143 bool bHasFiltered
, bool& rSkipOverlappedCells
,
1144 std::vector
<sal_Int32
>& rNonOverlappedCellIdx
);
1145 void FillAuto( SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
,
1146 sal_uLong nFillCount
, FillDir eFillDir
, ScProgress
* pProgress
);
1148 bool ValidNextPos( SCCOL nCol
, SCROW nRow
, const ScMarkData
& rMark
,
1149 bool bMarked
, bool bUnprotected
) const;
1151 void AutoFormatArea(SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
1152 const ScPatternAttr
& rAttr
, sal_uInt16 nFormatNo
);
1153 void GetAutoFormatAttr(SCCOL nCol
, SCROW nRow
, sal_uInt16 nIndex
, ScAutoFormatData
& rData
);
1154 void GetAutoFormatFrame(SCCOL nCol
, SCROW nRow
, sal_uInt16 nFlags
, sal_uInt16 nIndex
, ScAutoFormatData
& rData
);
1155 bool SearchCell(const SvxSearchItem
& rSearchItem
, SCCOL nCol
, sc::ColumnBlockConstPosition
& rBlockPos
, SCROW nRow
,
1156 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1157 bool Search(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
1158 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1159 bool Search(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
1160 SCCOL nLastCol
, SCROW nLastRow
,
1161 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1162 bool SearchAll(const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
,
1163 ScRangeList
& rMatchedRanges
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1164 bool Replace(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
1165 const ScMarkData
& rMark
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1167 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
1168 OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1170 bool SearchStyle(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
1171 const ScMarkData
& rMark
);
1172 bool ReplaceStyle(const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
1173 const ScMarkData
& rMark
, bool bIsUndo
);
1174 bool SearchAllStyle(
1175 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
);
1176 bool ReplaceAllStyle(
1177 const SvxSearchItem
& rSearchItem
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
1178 ScDocument
* pUndoDoc
);
1179 bool SearchAndReplaceEmptyCells(
1180 const SvxSearchItem
& rSearchItem
,
1181 SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
, ScRangeList
& rMatchedRanges
,
1182 OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1183 bool SearchRangeForEmptyCell(const ScRange
& rRange
,
1184 const SvxSearchItem
& rSearchItem
, SCCOL
& rCol
, SCROW
& rRow
,
1185 OUString
& rUndoStr
);
1186 bool SearchRangeForAllEmptyCells(
1187 const ScRange
& rRange
, const SvxSearchItem
& rSearchItem
,
1188 ScRangeList
& rMatchedRanges
, OUString
& rUndoStr
, ScDocument
* pUndoDoc
);
1190 // use the global sort parameter:
1191 bool IsSorted(SCCOLROW nStart
, SCCOLROW nEnd
) const;
1192 static void DecoladeRow( ScSortInfoArray
*, SCROW nRow1
, SCROW nRow2
);
1195 ScRefCellValue
& rCell1
, SCCOL nCell1Col
, SCROW nCell1Row
,
1196 ScRefCellValue
& rCell2
, SCCOL nCell2Col
, SCROW nCell2Row
) const;
1197 short Compare(SCCOLROW nIndex1
, SCCOLROW nIndex2
) const;
1198 short Compare( ScSortInfoArray
*, SCCOLROW nIndex1
, SCCOLROW nIndex2
) const;
1199 std::unique_ptr
<ScSortInfoArray
> CreateSortInfoArray( const sc::ReorderParam
& rParam
);
1200 std::unique_ptr
<ScSortInfoArray
> CreateSortInfoArray(
1201 const ScSortParam
& rSortParam
, SCCOLROW nInd1
, SCCOLROW nInd2
,
1202 bool bKeepQuery
, bool bUpdateRefs
);
1203 void QuickSort( ScSortInfoArray
*, SCCOLROW nLo
, SCCOLROW nHi
);
1204 void SortReorderByColumn( const ScSortInfoArray
* pArray
, SCROW nRow1
, SCROW nRow2
,
1205 bool bPattern
, ScProgress
* pProgress
);
1206 void SortReorderAreaExtrasByColumn( const ScSortInfoArray
* pArray
, SCROW nDataRow1
, SCROW nDataRow2
,
1207 const ScDataAreaExtras
& rDataAreaExtras
, ScProgress
* pProgress
);
1209 void SortReorderByRow( ScSortInfoArray
* pArray
, SCCOL nCol1
, SCCOL nCol2
,
1210 ScProgress
* pProgress
, bool bOnlyDataAreaExtras
);
1211 void SortReorderByRowRefUpdate( ScSortInfoArray
* pArray
, SCCOL nCol1
, SCCOL nCol2
,
1212 ScProgress
* pProgress
);
1213 void SortReorderAreaExtrasByRow( ScSortInfoArray
* pArray
, SCCOL nDataCol1
, SCCOL nDataCol2
,
1214 const ScDataAreaExtras
& rDataAreaExtras
, ScProgress
* pProgress
);
1216 bool CreateExcelQuery(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
1217 bool CreateStarQuery(SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
, ScQueryParam
& rQueryParam
);
1218 OUString
GetUpperCellString(SCCOL nCol
, SCROW nRow
);
1220 bool RefVisible(const ScFormulaCell
* pCell
);
1222 bool IsEmptyLine(SCROW nRow
, SCCOL nStartCol
, SCCOL nEndCol
) const;
1224 void IncDate(double& rVal
, sal_uInt16
& nDayOfMonth
, double nStep
, FillDateCmd eCmd
);
1226 const ScFormulaCell
* pSrcCell
, SCCOL nDestCol
, SCROW nDestRow
, bool bLast
);
1227 void UpdateInsertTabAbs(SCTAB nNewPos
);
1228 bool GetNextSpellingCell(SCCOL
& rCol
, SCROW
& rRow
, bool bInSel
,
1229 const ScMarkData
& rMark
) const;
1230 bool GetNextMarkedCell( SCCOL
& rCol
, SCROW
& rRow
, const ScMarkData
& rMark
) const;
1231 void TestTabRefAbs(SCTAB nTable
) const;
1232 void CompileDBFormula( sc::CompileFormulaContext
& rCxt
);
1233 void CompileColRowNameFormula( sc::CompileFormulaContext
& rCxt
);
1235 void StartListening( const ScAddress
& rAddress
, SvtListener
* pListener
);
1236 void EndListening( const ScAddress
& rAddress
, SvtListener
* pListener
);
1237 void StartListening( sc::StartListeningContext
& rCxt
, const ScAddress
& rAddress
, SvtListener
& rListener
);
1238 void EndListening( sc::EndListeningContext
& rCxt
, const ScAddress
& rAddress
, SvtListener
& rListener
);
1240 void AttachFormulaCells( sc::StartListeningContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
1241 void DetachFormulaCells( sc::EndListeningContext
& rCxt
, SCCOL nCol1
, SCROW nRow1
, SCCOL nCol2
, SCROW nRow2
);
1243 void SetLoadingMedium(bool bLoading
);
1245 SCSIZE
FillMaxRot( RowInfo
* pRowInfo
, SCSIZE nArrCount
, SCCOL nX1
, SCCOL nX2
,
1246 SCCOL nCol
, SCROW nAttrRow1
, SCROW nAttrRow2
, SCSIZE nArrY
,
1247 const ScPatternAttr
* pPattern
, const SfxItemSet
* pCondSet
);
1249 // idle calculation of OutputDevice text width for cell
1250 // also invalidates script type, broadcasts for "calc as shown"
1251 void InvalidateTextWidth( const ScAddress
* pAdrFrom
, const ScAddress
* pAdrTo
,
1252 bool bNumFormatChanged
, bool bBroadcast
);
1254 void SkipFilteredRows(SCROW
& rRow
, SCROW
& rLastNonFilteredRow
, bool bForward
);
1257 * In case the cell text goes beyond the column width, move the max column
1258 * position to the right. This is called from ExtendPrintArea.
1260 void MaybeAddExtraColumn(SCCOL
& rCol
, SCROW nRow
, OutputDevice
* pDev
, double nPPTX
, double nPPTY
);
1262 void CopyPrintRange(const ScTable
& rTable
);
1264 SCCOL
FindNextVisibleColWithContent(SCCOL nCol
, bool bRight
, SCROW nRow
) const;
1266 SCCOL
FindNextVisibleCol(SCCOL nCol
, bool bRight
) const;
1269 * Transpose clipboard patterns
1270 * @param nCombinedStartRow start row of the combined range;
1271 * used for transposed multi range selection with row direction;
1272 * for other cases than multi range row selection this it equal to nRow1
1273 * @param nRowDestOffset adjustment of destination row position;
1274 * used for transposed multi range row selections, otherwise 0
1276 void TransposeColPatterns(ScTable
* pTransClip
, SCCOL nCol1
, SCCOL nCol
, SCROW nRow1
,
1277 SCROW nRow2
, SCROW nCombinedStartRow
, bool bIncludeFiltered
,
1278 const std::vector
<SCROW
>& rFilteredRows
, SCROW nRowDestOffset
);
1281 * Transpose clipboard notes
1282 * @param nCombinedStartRow start row of the combined range;
1283 * used for transposed multi range selection with row direction;
1284 * for other cases than multi range row selection this it equal to nRow1
1285 * @param nRowDestOffset adjustment of destination row position;
1286 * used for transposed multi range row selections, otherwise 0
1288 void TransposeColNotes(ScTable
* pTransClip
, SCCOL nCol1
, SCCOL nCol
, SCROW nRow1
, SCROW nRow2
,
1289 SCROW nCombinedStartRow
, bool bIncludeFiltered
, SCROW nRowDestOffset
);
1291 ScColumn
* FetchColumn( SCCOL nCol
);
1292 const ScColumn
* FetchColumn( SCCOL nCol
) const;
1294 void EndListeningIntersectedGroup(
1295 sc::EndListeningContext
& rCxt
, SCCOL nCol
, SCROW nRow
, std::vector
<ScAddress
>* pGroupPos
);
1297 void EndListeningIntersectedGroups(
1298 sc::EndListeningContext
& rCxt
, const SCCOL nCol1
, SCROW nRow1
, const SCCOL nCol2
, SCROW nRow2
,
1299 std::vector
<ScAddress
>* pGroupPos
);
1301 void EndListeningGroup( sc::EndListeningContext
& rCxt
, const SCCOL nCol
, SCROW nRow
);
1302 void SetNeedsListeningGroup( SCCOL nCol
, SCROW nRow
);
1304 /// Returns list-of-spans representation of the column-widths/row-heights in twips encoded as an OString.
1305 OString
dumpColumnRowSizes(bool bColumns
);
1306 /// Returns list-of-spans representation of hidden/filtered states of columns/rows encoded as an OString.
1307 OString
dumpHiddenFiltered(bool bColumns
, bool bHidden
);
1308 /// Returns list-of-spans representation of the column/row groupings encoded as an OString.
1309 OString
dumpColumnRowGroups(bool bColumns
) const;
1311 SCCOL
GetLOKFreezeCol() const;
1312 SCROW
GetLOKFreezeRow() const;
1313 bool SetLOKFreezeCol(SCCOL nFreezeCol
);
1314 bool SetLOKFreezeRow(SCROW nFreezeRow
);
1317 * Use this to iterate through non-empty visible cells in a single column.
1319 class VisibleDataCellIterator
1321 static constexpr SCROW ROW_NOT_FOUND
= -1;
1324 explicit VisibleDataCellIterator(const ScDocument
& rDoc
, ScFlatBoolRowSegments
& rRowSegs
, ScColumn
& rColumn
);
1325 ~VisibleDataCellIterator();
1328 * Set the start row position. In case there is not visible data cell
1329 * at the specified row position, it will move to the position of the
1330 * first visible data cell below that point.
1332 * @return First visible data cell if found, or NULL otherwise.
1334 ScRefCellValue
reset(SCROW nRow
);
1337 * Find the next visible data cell position.
1339 * @return Next visible data cell if found, or NULL otherwise.
1341 ScRefCellValue
next();
1344 * Get the current row position.
1346 * @return Current row position, or ROW_NOT_FOUND if the iterator
1347 * doesn't point to a valid data cell position.
1349 SCROW
getRow() const { return mnCurRow
;}
1352 const ScDocument
& mrDocument
;
1353 ScFlatBoolRowSegments
& mrRowSegs
;
1355 ScRefCellValue maCell
;
1362 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */