diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-03-09 15:12:43 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-03-10 08:34:58 +0100 |
commit | 7a9e60c4b7d6c28f5b3e084e3db9ab2445c94bfd (patch) | |
tree | f48cfed978039c68e1dda5bea449f093bd9a4f5f /sc/inc/column.hxx | |
parent | a15c02effa654da06e9695b5e4c0c595f851a878 (diff) |
fix attr iterators to walk even unallocated columns if needed
Things like applying bold to an entire row no longer allocates
all rows after my recent changes, but the attribute change is
done in ScTable to the default attribute of unallocated columns.
That means that clamping column positions to the end of allocated
columns is no longer valid when handling attributes. Add functions
that clamp depending on whether unallocated columns have
a non-default attribute set.
Change-Id: I879d0a034c0b336064361d0f8cb12e5a8da22b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131265
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc/column.hxx')
-rw-r--r-- | sc/inc/column.hxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 0b5fb0aa8ff2..2cf4bdd66573 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -161,6 +161,11 @@ public: bool HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const; bool HasAttrib( SCROW nRow, HasAttrFlags nMask, SCROW* nStartRow = nullptr, SCROW* nEndRow = nullptr ) const; + std::unique_ptr<ScAttrIterator> CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const; + + bool IsAllAttrEqual( const ScColumnData& rCol, SCROW nStartRow, SCROW nEndRow ) const; + bool HasNonDefPattern( SCROW nStartRow, SCROW nEndRow ) const; + void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark, SCCOL nCol ); void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark, SCCOL nCol ); }; @@ -207,7 +212,6 @@ friend class ScCountIfCellIterator; friend class ScFormulaGroupIterator; friend class ScCellIterator; friend class ScHorizontalCellIterator; -friend class ScHorizontalAttrIterator; friend class ScColumnTextWidthIterator; friend class ScDocumentImport; friend class sc::DocumentStreamAccess; @@ -299,7 +303,6 @@ public: bool GetLastVisibleAttr( SCROW& rLastRow ) const; bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const; bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const; - bool IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const; bool TestInsertCol( SCROW nStartRow, SCROW nEndRow) const; bool TestInsertRow( SCROW nStartRow, SCSIZE nSize ) const; @@ -348,8 +351,6 @@ public: sc::MixDocContext& rCxt, SCROW nRow1, SCROW nRow2, ScPasteFunc nFunction, bool bSkipEmpty, const ScColumn& rSrcCol ); - std::unique_ptr<ScAttrIterator> CreateAttrIterator( SCROW nStartRow, SCROW nEndRow ) const; - void UpdateSelectionFunction( const ScRangeList& rRanges, ScFunctionData& rData, const ScFlatBoolRowSegments& rHiddenRows ); @@ -835,11 +836,16 @@ inline bool ScColumn::IsEmptyAttr() const return pAttrArray->IsEmpty(); } -inline bool ScColumn::IsAllAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const +inline bool ScColumnData::IsAllAttrEqual( const ScColumnData& rCol, SCROW nStartRow, SCROW nEndRow ) const { return pAttrArray->IsAllEqual( *rCol.pAttrArray, nStartRow, nEndRow ); } +inline bool ScColumnData::HasNonDefPattern( SCROW nStartRow, SCROW nEndRow ) const +{ + return pAttrArray->HasNonDefPattern( nStartRow, nEndRow ); +} + inline bool ScColumn::IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow, SCROW nEndRow ) const { return pAttrArray->IsVisibleEqual( *rCol.pAttrArray, nStartRow, nEndRow ); |