diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-23 15:30:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-09-26 08:29:38 +0200 |
commit | 606077ed58dfbc133d99a6a38a8aabf552a687bb (patch) | |
tree | 96dbb8dd1450ca40a65726e3f4f5df4f3bb7ad21 | |
parent | 5d944079fa264777293a869e38e38424edceedfa (diff) |
convert HASATTR constants to typed_flags_set
Remove unused constant RTL.
Inline PAINTEXT constant since it is only used in one place.
Change-Id: I7b2c15e7579fc5bc475d00fe714f17592bd5e2a1
34 files changed, 146 insertions, 175 deletions
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index c1f5c2a70b0d..c24f658954dd 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -155,7 +155,7 @@ public: bool Search( SCROW nRow, SCSIZE& nIndex ) const; - bool HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const; + bool HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const; bool IsMerged( SCROW nRow ) const; bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 2041ce79f87c..621a65bc6a9b 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -210,31 +210,31 @@ public: void DeleteContent( SCROW nRow, bool bBroadcast = true ); void FreeAll(); void FreeNotes(); - void Swap( ScColumn& rOther, SCROW nRow1, SCROW nRow2, bool bPattern ); + void Swap( ScColumn& rOther, SCROW nRow1, SCROW nRow2, bool bPattern ); - bool HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const; - bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const; - bool IsMerged( SCROW nRow ) const; - bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, + bool HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const; + bool HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const; + bool IsMerged( SCROW nRow ) const; + bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, bool bRefresh ); - bool IsEmptyData() const; - bool IsEmptyAttr() const; - bool IsEmpty() const; + bool IsEmptyData() const; + bool IsEmptyAttr() const; + bool IsEmpty() const; // data only: - bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const; - SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; - bool HasDataAt(SCROW nRow) const; - bool HasVisibleDataAt(SCROW nRow) const; - SCROW GetFirstDataPos() const; - SCROW GetLastDataPos() const; - SCROW GetLastDataPos( SCROW nLastRow ) const; - bool GetPrevDataPos(SCROW& rRow) const; - bool GetNextDataPos(SCROW& rRow) const; - void FindDataAreaPos(SCROW& rRow, bool bDown) const; // (without Broadcaster) - void FindUsed( SCROW nStartRow, SCROW nEndRow, mdds::flat_segment_tree<SCROW, bool>& rUsed ) const; + bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const; + SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; + bool HasDataAt(SCROW nRow) const; + bool HasVisibleDataAt(SCROW nRow) const; + SCROW GetFirstDataPos() const; + SCROW GetLastDataPos() const; + SCROW GetLastDataPos( SCROW nLastRow ) const; + bool GetPrevDataPos(SCROW& rRow) const; + bool GetNextDataPos(SCROW& rRow) const; + void FindDataAreaPos(SCROW& rRow, bool bDown) const; // (without Broadcaster) + void FindUsed( SCROW nStartRow, SCROW nEndRow, mdds::flat_segment_tree<SCROW, bool>& rUsed ) const; SCSIZE VisibleCount( SCROW nStartRow, SCROW nEndRow ) const; sc::MatrixEdge GetBlockMatrixEdges(SCROW nRow1, SCROW nRow2, sc::MatrixEdge nMask ) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 979257ec71ac..079d120855b3 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1158,8 +1158,8 @@ public: bool IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; SC_DLLPUBLIC bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt16 nMask ) const; - SC_DLLPUBLIC bool HasAttrib( const ScRange& rRange, sal_uInt16 nMask ) const; + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask ) const; + SC_DLLPUBLIC bool HasAttrib( const ScRange& rRange, HasAttrFlags nMask ) const; SC_DLLPUBLIC void GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, const ::editeng::SvxBorderLine** ppLeft, diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 7ccf940a5f01..3a2d99bd09cd 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -172,22 +172,26 @@ enum class ScPasteFunc { NONE, ADD, SUB, MUL, DIV }; // bits for HasAttr -#define HASATTR_LINES 1 -#define HASATTR_MERGED 2 -#define HASATTR_OVERLAPPED 4 -#define HASATTR_PROTECTED 8 -#define HASATTR_SHADOW 16 -#define HASATTR_NEEDHEIGHT 32 -#define HASATTR_SHADOW_RIGHT 64 -#define HASATTR_SHADOW_DOWN 128 -#define HASATTR_AUTOFILTER 256 -#define HASATTR_CONDITIONAL 512 -#define HASATTR_ROTATE 1024 -#define HASATTR_NOTOVERLAPPED 2048 -#define HASATTR_RTL 4096 -#define HASATTR_RIGHTORCENTER 8192 // right or centered logical alignment - -#define HASATTR_PAINTEXT ( HASATTR_LINES | HASATTR_SHADOW | HASATTR_CONDITIONAL ) +enum class HasAttrFlags { + NONE = 0x0000, + Lines = 0x0001, + Merged = 0x0002, + Overlapped = 0x0004, + Protected = 0x0008, + Shadow = 0x0010, + NeedHeight = 0x0020, + ShadowRight = 0x0040, + ShadowDown = 0x0080, + AutoFilter = 0x0100, + Conditional = 0x0200, + Rotate = 0x0400, + NotOverlapped = 0x0800, + RightOrCenter = 0x1000, // right or centered logical alignment +}; +namespace o3tl { + template<> struct typed_flags<HasAttrFlags> : is_typed_flags<HasAttrFlags, 0x1fff> {}; +} + #define EMPTY_OUSTRING ScGlobal::GetEmptyOUString() diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index d987071274a5..88ef6bed967b 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -588,8 +588,8 @@ public: void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 ); - bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nMask ) const; - bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const; + bool HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask ) const; + bool HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const; bool IsMerged( SCCOL nCol, SCROW nRow ) const; bool ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index f122b287aef4..a2aadccb6a7f 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1192,7 +1192,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf // Test if field contains specific attribute -bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const +bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const { SCSIZE nStartIndex; SCSIZE nEndIndex; @@ -1203,46 +1203,46 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const for (SCSIZE i=nStartIndex; i<=nEndIndex && !bFound; i++) { const ScPatternAttr* pPattern = pData[i].pPattern; - if ( nMask & HASATTR_MERGED ) + if ( nMask & HasAttrFlags::Merged ) { const ScMergeAttr* pMerge = static_cast<const ScMergeAttr*>( &pPattern->GetItem( ATTR_MERGE ) ); if ( pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1 ) bFound = true; } - if ( nMask & ( HASATTR_OVERLAPPED | HASATTR_NOTOVERLAPPED | HASATTR_AUTOFILTER ) ) + if ( nMask & ( HasAttrFlags::Overlapped | HasAttrFlags::NotOverlapped | HasAttrFlags::AutoFilter ) ) { const ScMergeFlagAttr* pMergeFlag = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem( ATTR_MERGE_FLAG ) ); - if ( (nMask & HASATTR_OVERLAPPED) && pMergeFlag->IsOverlapped() ) + if ( (nMask & HasAttrFlags::Overlapped) && pMergeFlag->IsOverlapped() ) bFound = true; - if ( (nMask & HASATTR_NOTOVERLAPPED) && !pMergeFlag->IsOverlapped() ) + if ( (nMask & HasAttrFlags::NotOverlapped) && !pMergeFlag->IsOverlapped() ) bFound = true; - if ( (nMask & HASATTR_AUTOFILTER) && pMergeFlag->HasAutoFilter() ) + if ( (nMask & HasAttrFlags::AutoFilter) && pMergeFlag->HasAutoFilter() ) bFound = true; } - if ( nMask & HASATTR_LINES ) + if ( nMask & HasAttrFlags::Lines ) { const SvxBoxItem* pBox = static_cast<const SvxBoxItem*>( &pPattern->GetItem( ATTR_BORDER ) ); if ( pBox->GetLeft() || pBox->GetRight() || pBox->GetTop() || pBox->GetBottom() ) bFound = true; } - if ( nMask & HASATTR_SHADOW ) + if ( nMask & HasAttrFlags::Shadow ) { const SvxShadowItem* pShadow = static_cast<const SvxShadowItem*>( &pPattern->GetItem( ATTR_SHADOW ) ); if ( pShadow->GetLocation() != SVX_SHADOW_NONE ) bFound = true; } - if ( nMask & HASATTR_CONDITIONAL ) + if ( nMask & HasAttrFlags::Conditional ) { bool bContainsCondFormat = !static_cast<const ScCondFormatItem&>(pPattern->GetItem( ATTR_CONDITIONAL )).GetCondFormatData().empty(); if ( bContainsCondFormat ) bFound = true; } - if ( nMask & HASATTR_PROTECTED ) + if ( nMask & HasAttrFlags::Protected ) { const ScProtectionAttr* pProtect = static_cast<const ScProtectionAttr*>( &pPattern->GetItem( ATTR_PROTECTION ) ); @@ -1285,7 +1285,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const if(bFoundTemp) bFound = true; } - if ( nMask & HASATTR_ROTATE ) + if ( nMask & HasAttrFlags::Rotate ) { const SfxInt32Item* pRotate = static_cast<const SfxInt32Item*>( &pPattern->GetItem( ATTR_ROTATE_VALUE ) ); @@ -1295,7 +1295,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const if ( nAngle != 0 && nAngle != 9000 && nAngle != 27000 ) bFound = true; } - if ( nMask & HASATTR_NEEDHEIGHT ) + if ( nMask & HasAttrFlags::NeedHeight ) { if (pPattern->GetCellOrientation() != SVX_ORIENTATION_STANDARD) bFound = true; @@ -1310,26 +1310,19 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const else if (static_cast<const SfxInt32Item&>(pPattern->GetItem( ATTR_ROTATE_VALUE )).GetValue()) bFound = true; } - if ( nMask & ( HASATTR_SHADOW_RIGHT | HASATTR_SHADOW_DOWN ) ) + if ( nMask & ( HasAttrFlags::ShadowRight | HasAttrFlags::ShadowDown ) ) { const SvxShadowItem* pShadow = static_cast<const SvxShadowItem*>( &pPattern->GetItem( ATTR_SHADOW )); SvxShadowLocation eLoc = pShadow->GetLocation(); - if ( nMask & HASATTR_SHADOW_RIGHT ) + if ( nMask & HasAttrFlags::ShadowRight ) if ( eLoc == SVX_SHADOW_TOPRIGHT || eLoc == SVX_SHADOW_BOTTOMRIGHT ) bFound = true; - if ( nMask & HASATTR_SHADOW_DOWN ) + if ( nMask & HasAttrFlags::ShadowDown ) if ( eLoc == SVX_SHADOW_BOTTOMLEFT || eLoc == SVX_SHADOW_BOTTOMRIGHT ) bFound = true; } - if ( nMask & HASATTR_RTL ) - { - const SvxFrameDirectionItem& rDirection = - static_cast<const SvxFrameDirectionItem&>( pPattern->GetItem( ATTR_WRITINGDIR ) ); - if ( rDirection.GetValue() == FRMDIR_HORI_RIGHT_TOP ) - bFound = true; - } - if ( nMask & HASATTR_RIGHTORCENTER ) + if ( nMask & HasAttrFlags::RightOrCenter ) { // called only if the sheet is LTR, so physical=logical alignment can be assumed SvxCellHorJustify eHorJust = (SvxCellHorJustify) @@ -2118,7 +2111,7 @@ void ScAttrArray::DeleteArea(SCROW nStartRow, SCROW nEndRow) { RemoveAreaMerge( nStartRow, nEndRow ); // remove from combined flags - if ( !HasAttrib( nStartRow, nEndRow, HASATTR_OVERLAPPED | HASATTR_AUTOFILTER) ) + if ( !HasAttrib( nStartRow, nEndRow, HasAttrFlags::Overlapped | HasAttrFlags::AutoFilter) ) SetPatternArea( nStartRow, nEndRow, pDocument->GetDefPattern() ); else DeleteAreaSafe( nStartRow, nEndRow ); // leave merge flags @@ -2261,7 +2254,7 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr SCROW nDestStart = std::max((long)((long)nStartRow + nDy), (long) 0); SCROW nDestEnd = std::min((long)((long)nEndRow + nDy), (long) MAXROW); - if ( !rAttrArray.HasAttrib( nDestStart, nDestEnd, HASATTR_OVERLAPPED ) ) + if ( !rAttrArray.HasAttrib( nDestStart, nDestEnd, HasAttrFlags::Overlapped ) ) { CopyArea( nStartRow+nDy, nEndRow+nDy, nDy, rAttrArray ); return; diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index dfe343ec46ca..95959b9386c4 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -302,12 +302,12 @@ bool ScColumn::HasSelectionMatrixFragment(const ScMarkData& rMark) const return false; } -bool ScColumn::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const +bool ScColumn::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) const { return pAttrArray->HasAttrib( nRow1, nRow2, nMask ); } -bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const +bool ScColumn::HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const { bool bFound = false; @@ -1831,7 +1831,7 @@ bool ScColumn::TestCopyScenarioTo( const ScColumn& rDestCol ) const while (pPattern && bOk) { if ( static_cast<const ScMergeFlagAttr&>(pPattern->GetItem( ATTR_MERGE_FLAG )).IsScenario() ) - if ( rDestCol.pAttrArray->HasAttrib( nStart, nEnd, HASATTR_PROTECTED ) ) + if ( rDestCol.pAttrArray->HasAttrib( nStart, nEnd, HasAttrFlags::Protected ) ) bOk = false; pPattern = aAttrIter.Next( nStart, nEnd ); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 60035652315b..b99c6c6507aa 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -983,7 +983,7 @@ bool ScColumn::GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& r if (!bInSel && it != maCells.end() && eType != sc::element_type_empty) { if ( (eType == sc::element_type_string || eType == sc::element_type_edittext) && - !(HasAttrib( nRow, nRow, HASATTR_PROTECTED) && + !(HasAttrib( nRow, nRow, HasAttrFlags::Protected) && pDocument->IsTabProtected(nTab)) ) return true; } @@ -1002,7 +1002,7 @@ bool ScColumn::GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& r it = maCells.position(it, nRow).first; eType = it->type; if ( (eType == sc::element_type_string || eType == sc::element_type_edittext) && - !(HasAttrib( nRow, nRow, HASATTR_PROTECTED) && + !(HasAttrib( nRow, nRow, HasAttrFlags::Protected) && pDocument->IsTabProtected(nTab)) ) return true; else @@ -1014,7 +1014,7 @@ bool ScColumn::GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& r it = maCells.position(it, nRow).first; eType = it->type; if ( (eType == sc::element_type_string || eType == sc::element_type_edittext) && - !(HasAttrib( nRow, nRow, HASATTR_PROTECTED) && + !(HasAttrib( nRow, nRow, HasAttrFlags::Protected) && pDocument->IsTabProtected(nTab)) ) return true; else diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 4ad9532c62a9..176b0c477304 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -456,7 +456,7 @@ bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow )) return false; - if (HasAttrib(ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), HASATTR_LINES)) + if (HasAttrib(ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), HasAttrFlags::Lines)) // We want to print sheets with borders even if there is no cell content. return false; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 48e762c49e5f..b8b0c15a8545 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1717,7 +1717,7 @@ bool ScDocument::HasPartOfMerged( const ScRange& rRange ) SCROW nEndY = rRange.aEnd.Row(); if (HasAttrib( nStartX, nStartY, nTab, nEndX, nEndY, nTab, - HASATTR_MERGED | HASATTR_OVERLAPPED )) + HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { ExtendMerge( nStartX, nStartY, nEndX, nEndY, nTab ); ExtendOverlapped( nStartX, nStartY, nEndX, nEndY, nTab ); @@ -5066,9 +5066,9 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark, } bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, - SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt16 nMask ) const + SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask ) const { - if ( nMask & HASATTR_ROTATE ) + if ( nMask & HasAttrFlags::Rotate ) { // Is attribute used in document? // (as in fillinfo) @@ -5093,44 +5093,17 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, } } if (!bAnyItem) - nMask &= ~HASATTR_ROTATE; + nMask &= ~HasAttrFlags::Rotate; } - if ( nMask & HASATTR_RTL ) - { - // first check if right-to left is in the pool at all - // (the same item is used in cell and page format) - - ScDocumentPool* pPool = xPoolHelper->GetDocPool(); - - bool bHasRtl = false; - sal_uInt32 nDirCount = pPool->GetItemCount2( ATTR_WRITINGDIR ); - for (sal_uInt32 nItem=0; nItem<nDirCount; nItem++) - { - const SfxPoolItem* pItem = pPool->GetItem2( ATTR_WRITINGDIR, nItem ); - if ( pItem && static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue() == FRMDIR_HORI_RIGHT_TOP ) - { - bHasRtl = true; - break; - } - } - if (!bHasRtl) - nMask &= ~HASATTR_RTL; - } - - if (!nMask) + if (nMask == HasAttrFlags::NONE) return false; bool bFound = false; for (SCTAB i=nTab1; i<=nTab2 && !bFound && i < static_cast<SCTAB>(maTabs.size()); i++) if (maTabs[i]) { - if ( nMask & HASATTR_RTL ) - { - if ( GetEditTextDirection(i) == EE_HTEXTDIR_R2L ) // sheet default - bFound = true; - } - if ( nMask & HASATTR_RIGHTORCENTER ) + if ( nMask & HasAttrFlags::RightOrCenter ) { // On a RTL sheet, don't start to look for the default left value // (which is then logically right), instead always assume true. @@ -5147,7 +5120,7 @@ bool ScDocument::HasAttrib( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, return bFound; } -bool ScDocument::HasAttrib( const ScRange& rRange, sal_uInt16 nMask ) const +bool ScDocument::HasAttrib( const ScRange& rRange, HasAttrFlags nMask ) const { return HasAttrib( rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(), rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), @@ -5524,14 +5497,14 @@ void ScDocument::ExtendTotalMerge( ScRange& rRange ) const { ScRange aTest = aExt; aTest.aStart.SetRow( rRange.aEnd.Row() + 1 ); - if ( HasAttrib( aTest, HASATTR_NOTOVERLAPPED ) ) + if ( HasAttrib( aTest, HasAttrFlags::NotOverlapped ) ) aExt.aEnd.SetRow(rRange.aEnd.Row()); } if ( aExt.aEnd.Col() > rRange.aEnd.Col() ) { ScRange aTest = aExt; aTest.aStart.SetCol( rRange.aEnd.Col() + 1 ); - if ( HasAttrib( aTest, HASATTR_NOTOVERLAPPED ) ) + if ( HasAttrib( aTest, HasAttrFlags::NotOverlapped ) ) aExt.aEnd.SetCol(rRange.aEnd.Col()); } diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index d74ea57355c3..9f2ebca39264 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -435,9 +435,9 @@ void ScDocument::FillInfo( SCCOL nRotMax = nCol2; if ( bAnyItem && HasAttrib( 0, nRow1, nTab, MAXCOL, nRow2+1, nTab, - HASATTR_ROTATE | HASATTR_CONDITIONAL ) ) + HasAttrFlags::Rotate | HasAttrFlags::Conditional ) ) { - //TODO: check Conditionals also for HASATTR_ROTATE ???? + //TODO: check Conditionals also for HasAttrFlags::Rotate ???? OSL_ENSURE( nArrCount>2, "nArrCount too small" ); FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-1, nCol1, nCol2 ); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 2da7c761afcd..b17f7aa40465 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1223,7 +1223,7 @@ bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark, if (!ValidCol(nCol) || !ValidRow(nRow)) return false; - if (pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) + if (pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::Overlapped)) // Skip an overlapped cell. return false; @@ -1271,7 +1271,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, bool bUp = ( nMovY < 0 ); nRow = rMark.GetNextMarked( nCol, nRow, bUp ); while ( ValidRow(nRow) && - (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) ) + (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::Overlapped)) ) { // skip hidden rows (see above) nRow += nMovY; @@ -1301,7 +1301,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, nRow = 0; nRow = rMark.GetNextMarked( nCol, nRow, bUp ); while ( ValidRow(nRow) && - (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_OVERLAPPED)) ) + (RowHidden(nRow) || pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::Overlapped)) ) { // skip hidden rows (see above) nRow += nMovY; diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 341eeea0b864..78dd198cefab 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1904,7 +1904,7 @@ const ScPatternAttr* ScTable::GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, S return nullptr; } -bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nMask ) const +bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, HasAttrFlags nMask ) const { bool bFound = false; for (SCCOL i=nCol1; i<=nCol2 && !bFound; i++) @@ -1912,7 +1912,7 @@ bool ScTable::HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal return bFound; } -bool ScTable::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const +bool ScTable::HasAttribSelection( const ScMarkData& rMark, HasAttrFlags nMask ) const { std::vector<sc::ColRowSpan> aSpans = rMark.GetMarkedColSpans(); @@ -2220,7 +2220,7 @@ bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, bIsEditable = false; else if ( IsProtected() && !pDocument->IsScenario(nTab) ) { - bIsEditable = !HasAttrib( nCol1, nRow1, nCol2, nRow2, HASATTR_PROTECTED ); + bIsEditable = !HasAttrib( nCol1, nRow1, nCol2, nRow2, HasAttrFlags::Protected ); if (!bIsEditable) { // An enhanced protection permission may override the attribute. @@ -2295,7 +2295,7 @@ bool ScTable::IsSelectionEditable( const ScMarkData& rMark, { ScRangeList aRanges; rMark.FillRangeListWithMarks( &aRanges, false ); - bIsEditable = !HasAttribSelection( rMark, HASATTR_PROTECTED ); + bIsEditable = !HasAttribSelection( rMark, HasAttrFlags::Protected ); if (!bIsEditable) { // An enhanced protection permission may override the attribute. diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index d9dd73e40844..97b2e3204577 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -149,7 +149,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu if ( nRow <= nOverlapRowMax ) { while ( nCol <= MAXCOL && mpDoc->HasAttrib( nCol, nRow, nTab, - nCol, nRow, nTab, HASATTR_OVERLAPPED ) ) + nCol, nRow, nTab, HasAttrFlags::Overlapped ) ) { nCol++; nMergeColAdd++; diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 5329d7cfac52..006cac20e167 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -372,7 +372,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, rSrcDoc.CopyToClip(aClipParam, &aClipDoc, &aSourceMark, false, false); if ( aClipDoc.HasAttrib( 0,0,nSrcTab, MAXCOL,MAXROW,nSrcTab, - HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { //! ResetAttrib am Dokument !!! diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 413762501e57..ee3f8e6a3676 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -522,7 +522,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, if ( aLocalParam.bIncludePattern && rDoc.HasAttrib( aLocalParam.nCol1, nStartRow , nTab, aLocalParam.nCol2, aLocalParam.nRow2, nTab, - HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { // Merge-Attribute wuerden beim Sortieren durcheinanderkommen if (!bApi) @@ -979,7 +979,7 @@ void ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, } if (rDoc.HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab, - rParam.nCol2, rParam.nRow2, nTab, HASATTR_MERGED | HASATTR_OVERLAPPED )) + rParam.nCol2, rParam.nRow2, nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { if (!bApi) rDocShell.ErrorMessage(STR_MSSG_INSERTCELLS_0); // nicht in zusammengefasste einfuegen diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index ef5430a2eaac..85714d49e82c 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -812,7 +812,7 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con new ScUndoEnterData(&rDocShell, rPos, aOldValues, rText, nullptr)); } - if ( bEditDeleted || rDoc.HasAttrib( ScRange(rPos), HASATTR_NEEDHEIGHT ) ) + if ( bEditDeleted || rDoc.HasAttrib( ScRange(rPos), HasAttrFlags::NeedHeight ) ) AdjustRowHeight( ScRange(rPos) ); rDocShell.PostPaintCell( rPos ); @@ -831,7 +831,7 @@ bool ScDocFunc::SetValueCell( const ScAddress& rPos, double fVal, bool bInteract ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT); + bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -899,7 +899,7 @@ bool ScDocFunc::SetStringCell( const ScAddress& rPos, const OUString& rStr, bool ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT); + bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -936,7 +936,7 @@ bool ScDocFunc::SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT); + bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -988,7 +988,7 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HASATTR_NEEDHEIGHT); + bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -1722,7 +1722,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, ScRange aExtendMergeRange( aTargetRange ); - if( aTargetRange.aStart == aTargetRange.aEnd && rDoc.HasAttrib(aTargetRange, HASATTR_MERGED) ) + if( aTargetRange.aStart == aTargetRange.aEnd && rDoc.HasAttrib(aTargetRange, HasAttrFlags::Merged) ) { rDoc.ExtendMerge( aExtendMergeRange ); rDoc.ExtendOverlapped( aExtendMergeRange ); @@ -1800,7 +1800,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, for (; itr != itrEnd && nTabCount; ++itr) { i = *itr; - if( rDoc.HasAttrib( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + if( rDoc.HasAttrib( nMergeTestStartCol, nMergeTestStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { if (eCmd==INS_CELLSRIGHT) bNeedRefresh = true; @@ -1905,7 +1905,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, for( ::std::vector<ScRange>::const_iterator iIter( qIncreaseRange.begin()); iIter != qIncreaseRange.end(); ++iIter ) { ScRange aRange( *iIter ); - if( rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) + if( rDoc.HasAttrib( aRange, HasAttrFlags::Overlapped | HasAttrFlags::Merged ) ) { UnmergeCells( aRange, true ); } @@ -1991,7 +1991,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, while( !qIncreaseRange.empty() ) { ScRange aRange = qIncreaseRange.back(); - if( !rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) + if( !rDoc.HasAttrib( aRange, HasAttrFlags::Overlapped | HasAttrFlags::Merged ) ) { switch (eCmd) { @@ -2166,7 +2166,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, ScRange aExtendMergeRange( rRange ); - if( rRange.aStart == rRange.aEnd && rDoc.HasAttrib(rRange, HASATTR_MERGED) ) + if( rRange.aStart == rRange.aEnd && rDoc.HasAttrib(rRange, HasAttrFlags::Merged) ) { rDoc.ExtendMerge( aExtendMergeRange ); rDoc.ExtendOverlapped( aExtendMergeRange ); @@ -2233,7 +2233,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, for (; itr != itrEnd && *itr < nTabCount; ++itr) { SCTAB i = *itr; - if ( rDoc.HasAttrib( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HASATTR_MERGED | HASATTR_OVERLAPPED )) + if ( rDoc.HasAttrib( nUndoStartCol, nUndoStartRow, i, nMergeTestEndCol, nMergeTestEndRow, i, HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { SCCOL nMergeStartCol = nUndoStartCol; SCROW nMergeStartRow = nUndoStartRow; @@ -2340,7 +2340,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, for( ::std::vector<ScRange>::const_iterator iIter( qDecreaseRange.begin()); iIter != qDecreaseRange.end(); ++iIter ) { ScRange aRange( *iIter ); - if( rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) + if( rDoc.HasAttrib( aRange, HasAttrFlags::Overlapped | HasAttrFlags::Merged ) ) { UnmergeCells( aRange, true ); } @@ -2513,7 +2513,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, break; } - if( !rDoc.HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) + if( !rDoc.HasAttrib( aRange, HasAttrFlags::Overlapped | HasAttrFlags::Merged ) ) { ScCellMergeOption aMergeOption(aRange); MergeCells( aMergeOption, false, true, true ); @@ -2708,7 +2708,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, if (bClipOver && !bCut) if (rDoc.HasAttrib( nDestCol,nDestRow,nDestTab, nUndoEndCol,nUndoEndRow,nDestEndTab, - HASATTR_MERGED | HASATTR_OVERLAPPED )) + HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { // "Zusammenfassen nicht verschachteln !" if (!bApi) rDocShell.ErrorMessage(STR_MSSG_MOVEBLOCKTO_0); @@ -2766,7 +2766,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, if (bClipOver) if (rDoc.HasAttrib( nDestCol,nDestRow,nDestTab, nUndoEndCol,nUndoEndRow,nDestEndTab, - HASATTR_MERGED | HASATTR_OVERLAPPED )) + HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { rDoc.CopyFromClip( rSource, aSourceMark, InsertDeleteFlags::ALL, nullptr, pClipDoc ); for (nTab=nStartTab; nTab<=nEndTab; nTab++) @@ -4707,7 +4707,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo } if ( rDoc.HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr, - HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { // "Zusammenfassen nicht verschachteln !" if (!bApi) @@ -4822,7 +4822,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord ) { SCTAB nTab = *itr; ScRange aRange = rOption.getSingleRange(nTab); - if ( !rDoc.HasAttrib(aRange, HASATTR_MERGED) ) + if ( !rDoc.HasAttrib(aRange, HasAttrFlags::Merged) ) continue; ScRange aExtended = aRange; diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index e23662089d02..13fb41483d53 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -152,7 +152,7 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, sal_uInt16 nPart, sal_uI if ( ( nExtFlags & SC_PF_WHOLEROWS ) || aDocument.HasAttrib( nCol1,nRow1,nTab1, - MAXCOL,nRow2,nTab2, HASATTR_ROTATE | HASATTR_RIGHTORCENTER ) ) + MAXCOL,nRow2,nTab2, HasAttrFlags::Rotate | HasAttrFlags::RightOrCenter ) ) { nCol1 = 0; nCol2 = MAXCOL; @@ -198,7 +198,8 @@ void ScDocShell::PostPaintExtras() void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange ) { - if ( ( rExtFlags & SC_PF_LINES ) == 0 && aDocument.HasAttrib( rRange, HASATTR_PAINTEXT ) ) + if ( ( rExtFlags & SC_PF_LINES ) == 0 && + aDocument.HasAttrib( rRange, HasAttrFlags::Lines | HasAttrFlags::Shadow | HasAttrFlags::Conditional ) ) { // If the range contains lines, shadow or conditional formats, // set SC_PF_LINES to include one extra cell in all directions. @@ -208,7 +209,7 @@ void ScDocShell::UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange ) if ( ( rExtFlags & SC_PF_WHOLEROWS ) == 0 && ( rRange.aStart.Col() != 0 || rRange.aEnd.Col() != MAXCOL ) && - aDocument.HasAttrib( rRange, HASATTR_ROTATE | HASATTR_RIGHTORCENTER ) ) + aDocument.HasAttrib( rRange, HasAttrFlags::Rotate | HasAttrFlags::RightOrCenter ) ) { // If the range contains (logically) right- or center-aligned cells, // or rotated cells, set SC_PF_WHOLEROWS to paint the whole rows. diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index ce3410e56709..8c8643ef0b50 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -65,7 +65,7 @@ static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab, nEndRow = nEnd; } if (rDoc.HasAttrib( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, - HASATTR_MERGED | HASATTR_OVERLAPPED )) + HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { nStartCol = 0; nStartRow = 0; diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index c7bd62961c90..2d7c7b26423d 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -197,7 +197,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo ) for( i=0; i<nCount; i++ ) { if ( rDoc.HasAttrib( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), pTabs[i], - aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(), pTabs[i], HASATTR_MERGED ) ) + aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(), pTabs[i], HasAttrFlags::Merged ) ) { SCCOL nEndCol = aWorkRange.aEnd.Col(); SCROW nEndRow = aWorkRange.aEnd.Row(); @@ -417,7 +417,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo ) for( i=0; i<nCount; i++ ) { if ( rDoc.HasAttrib( aWorkRange.aStart.Col(), aWorkRange.aStart.Row(), pTabs[i], - aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(), pTabs[i], HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + aWorkRange.aEnd.Col(), aWorkRange.aEnd.Row(), pTabs[i], HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { // #i51445# old merge flag attributes must be deleted also for single cells, // not only for whole columns/rows @@ -1235,7 +1235,7 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) rDoc.DeleteAreaTab( aRange, nDelFlags ); pRefUndoDoc->CopyToDocument(aRange, nUndoFlags, false, rDoc); - if ( rDoc.HasAttrib( aRange, HASATTR_MERGED ) ) + if ( rDoc.HasAttrib( aRange, HasAttrFlags::Merged ) ) rDoc.ExtendMerge( aRange, true ); aPaintRange.aEnd.SetCol( std::max( aPaintRange.aEnd.Col(), aRange.aEnd.Col() ) ); @@ -1691,7 +1691,7 @@ void ScUndoSelectionStyle::DoChange( const bool bUndo ) SetViewMarkData( aMarkData ); ScRange aWorkRange( aRange ); - if ( rDoc.HasAttrib( aWorkRange, HASATTR_MERGED ) ) // Merged cells? + if ( rDoc.HasAttrib( aWorkRange, HasAttrFlags::Merged ) ) // Merged cells? rDoc.ExtendMerge( aWorkRange, true ); sal_uInt16 nExtFlags = 0; diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 6f5260386d0b..9c0e21a39cd9 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -392,7 +392,7 @@ void ScUndoSelectionAttr::DoChange( const bool bUndo ) SetViewMarkData( aMarkData ); ScRange aEffRange( aRangeCover ); - if ( rDoc.HasAttrib( aEffRange, HASATTR_MERGED ) ) // merged cells? + if ( rDoc.HasAttrib( aEffRange, HasAttrFlags::Merged ) ) // merged cells? rDoc.ExtendMerge( aEffRange ); sal_uInt16 nExtFlags = 0; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 722de400ea90..c57892869e70 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -5379,7 +5379,7 @@ sal_Bool SAL_CALL ScCellRangeObj::getIsMerged() throw(uno::RuntimeException, std { SolarMutexGuard aGuard; ScDocShell* pDocSh = GetDocShell(); - return pDocSh && pDocSh->GetDocument().HasAttrib( aRange, HASATTR_MERGED ); + return pDocSh && pDocSh->GetDocument().HasAttrib( aRange, HasAttrFlags::Merged ); } // XCellSeries diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index afbe7098dfcb..31f2e1eacb7b 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -157,7 +157,7 @@ static bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, pSrcDoc->CopyToClip(aClipParam, pClipDoc.get(), &aSourceMark, false, false); if ( pClipDoc->HasAttrib( 0,0,nSrcTab, MAXCOL,MAXROW,nSrcTab, - HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { ScPatternAttr aPattern( pSrcDoc->GetPool() ); aPattern.GetItemSet().Put( ScMergeAttr() ); // Defaults diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 72bc3ffdab5e..70f0f9b4d7dd 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1348,7 +1348,7 @@ util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxC of a merged range is part of this range are not covered. */ ScRange aScRange; ScUnoConversion::FillScRange( aScRange, aRangeAddr ); - bool bHasMerged = getDocumentFromRange( rxCellRange ).HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED ); + bool bHasMerged = getDocumentFromRange( rxCellRange ).HasAttrib( aScRange, HasAttrFlags::Merged | HasAttrFlags::Overlapped ); return bHasMerged ? util::TriState_INDETERMINATE : util::TriState_NO; } diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index c1042038ad32..bb8dd9da835c 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -385,7 +385,7 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord, } if (rDoc.HasAttrib( rParam.nCol1, rParam.nRow1+1, nTab, - rParam.nCol2, rParam.nRow2, nTab, HASATTR_MERGED | HASATTR_OVERLAPPED )) + rParam.nCol2, rParam.nRow2, nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped )) { ErrorMessage(STR_MSSG_INSERTCELLS_0); // do not insert into merged return; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b36b3af592c3..2f4776b9a1fa 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1567,7 +1567,7 @@ bool ScGridWindow::IsCellCoveredByText(SCsCOL nPosX, SCsROW nPosY, SCTAB nTab, S // to the left, there is no cell that would contain (potentially // overrunning) text - if (nNonEmptyX < 0 || pDoc->HasAttrib(nNonEmptyX, nPosY, nTab, nPosX, nPosY, nTab, HASATTR_MERGED | HASATTR_OVERLAPPED)) + if (nNonEmptyX < 0 || pDoc->HasAttrib(nNonEmptyX, nPosY, nTab, nPosX, nPosY, nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped)) return false; double nPPTX = pViewData->GetPPTX(); @@ -2257,7 +2257,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) bool bEditAllowed = true; if ( pProtect && pProtect->isProtected() ) { - bool bCellProtected = pDoc->HasAttrib(nPosX, nPosY, nTab, nPosX, nPosY, nTab, HASATTR_PROTECTED); + bool bCellProtected = pDoc->HasAttrib(nPosX, nPosY, nTab, nPosX, nPosY, nTab, HasAttrFlags::Protected); bool bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); bool bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); @@ -2963,7 +2963,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt ) if ( pProtect && pProtect->isProtected() ) { // This sheet is protected. Check if a context menu is allowed on this cell. - bool bCellProtected = pDoc->HasAttrib(nCellX, nCellY, nTab, nCellX, nCellY, nTab, HASATTR_PROTECTED); + bool bCellProtected = pDoc->HasAttrib(nCellX, nCellY, nTab, nCellX, nCellY, nTab, HasAttrFlags::Protected); bool bSelProtected = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); bool bSelUnprotected = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 2e60997c74ae..2fd99256b093 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -626,13 +626,13 @@ bool ScHeaderControl::IsSelectionAllowed(SCCOLROW nPos) const { // row header SCROW nRPos = static_cast<SCROW>(nPos); - bCellsProtected = pDoc->HasAttrib(0, nRPos, nTab, MAXCOL, nRPos, nTab, HASATTR_PROTECTED); + bCellsProtected = pDoc->HasAttrib(0, nRPos, nTab, MAXCOL, nRPos, nTab, HasAttrFlags::Protected); } else { // column header SCCOL nCPos = static_cast<SCCOL>(nPos); - bCellsProtected = pDoc->HasAttrib(nCPos, 0, nTab, nCPos, MAXROW, nTab, HASATTR_PROTECTED); + bCellsProtected = pDoc->HasAttrib(nCPos, 0, nTab, nCPos, MAXROW, nTab, HasAttrFlags::Protected); } bool bSelProtected = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index c981c631c41a..069f7e439bba 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1537,7 +1537,7 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA if ( nTempX < nX1 && !IsEmptyCellText( pThisRowInfo, nTempX, nY ) && - !mpDoc->HasAttrib( nTempX,nY,nTab, nX1,nY,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + !mpDoc->HasAttrib( nTempX,nY,nTab, nX1,nY,nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { nCellX = nTempX; bDoCell = true; @@ -1556,7 +1556,7 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA if ( nTempX > nX && !IsEmptyCellText( pThisRowInfo, nTempX, nY ) && - !mpDoc->HasAttrib( nTempX,nY,nTab, nX,nY,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + !mpDoc->HasAttrib( nTempX,nY,nTab, nX,nY,nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { nCellX = nTempX; bDoCell = true; @@ -4530,7 +4530,7 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) if ( nTempX > nX && !IsEmptyCellText( pThisRowInfo, nTempX, nY ) && - !mpDoc->HasAttrib( nTempX,nY,nTab, nX,nY,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + !mpDoc->HasAttrib( nTempX,nY,nTab, nX,nY,nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { nCellX = nTempX; bDoCell = true; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index cd8e05ab16ec..a23fba02d732 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -721,10 +721,10 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew ) } if ( nEndCol < MAXCOL && pDoc->HasAttrib( - nEndCol,nStartRow,nPrintTab, nEndCol,nEndRow,nPrintTab, HASATTR_SHADOW_RIGHT ) ) + nEndCol,nStartRow,nPrintTab, nEndCol,nEndRow,nPrintTab, HasAttrFlags::ShadowRight ) ) ++nEndCol; if ( nEndRow < MAXROW && pDoc->HasAttrib( - nStartCol,nEndRow,nPrintTab, nEndCol,nEndRow,nPrintTab, HASATTR_SHADOW_DOWN ) ) + nStartCol,nEndRow,nPrintTab, nEndCol,nEndRow,nPrintTab, HasAttrFlags::ShadowDown ) ) ++nEndRow; if (!bChangeCol) nEndCol = nOldEndCol; diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index e81a27545051..8f1f92d5fdb1 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -427,7 +427,7 @@ bool ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, bool bScrol if ( bSkipProtected && bSkipUnprotected ) return false; - bool bCellProtected = pDoc->HasAttrib(nPosX, nPosY, nTab, nPosX, nPosY, nTab, HASATTR_PROTECTED); + bool bCellProtected = pDoc->HasAttrib(nPosX, nPosY, nTab, nPosX, nPosY, nTab, HasAttrFlags::Protected); if ( (bCellProtected && bSkipProtected) || (!bCellProtected && bSkipUnprotected) ) // Don't select this cell! return false; diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 42b843cdd59a..275002ca920e 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -51,7 +51,7 @@ namespace { bool isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked) { bool bCellProtected = pDoc->HasAttrib( - nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_PROTECTED); + nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::Protected); if (bCellProtected && !bSelectLocked) return false; @@ -744,9 +744,9 @@ void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, { bSkipCell = pDoc->ColHidden(rCurX, nTab) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab); if (bSkipProtected && !bSkipCell) - bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED); + bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected); if (bSkipUnprotected && !bSkipCell) - bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED); + bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected); if (bSkipCell) { @@ -804,9 +804,9 @@ void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, S SCROW nLastRow = -1; bSkipCell = pDoc->RowHidden(rCurY, nTab, nullptr, &nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab ); if (bSkipProtected && !bSkipCell) - bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED); + bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected); if (bSkipUnprotected && !bSkipCell) - bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED); + bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected); if (bSkipCell) { diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 234299997bcf..630dbadef968 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1055,7 +1055,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bCenter ) } if ( rDoc.HasAttrib( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab, - HASATTR_MERGED | HASATTR_OVERLAPPED ) ) + HasAttrFlags::Merged | HasAttrFlags::Overlapped ) ) { // "Don't nest merging !" ErrorMessage(STR_MSSG_MERGECELLS_0); return false; @@ -1138,7 +1138,7 @@ bool ScViewFunc::TestRemoveMerge() if (GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE) { ScDocument* pDoc = GetViewData().GetDocument(); - if ( pDoc->HasAttrib( aRange, HASATTR_MERGED ) ) + if ( pDoc->HasAttrib( aRange, HasAttrFlags::Merged ) ) bMerged = true; } return bMerged; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 88d1f14e071b..6ef87ad6ee9a 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -802,7 +802,7 @@ bool ScViewFunc::PasteOnDrawObjectLinked( } static bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScMarkData& rTabSelection, sal_uInt16 nMask ) + const ScMarkData& rTabSelection, HasAttrFlags nMask ) { ScMarkData::const_iterator itr = rTabSelection.begin(), itrEnd = rTabSelection.end(); for (; itr != itrEnd; ++itr) @@ -1185,7 +1185,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, } if (bClipOver) - if (lcl_SelHasAttrib( pDoc, nStartCol,nStartRow, nUndoEndCol,nUndoEndRow, aFilteredMark, HASATTR_OVERLAPPED )) + if (lcl_SelHasAttrib( pDoc, nStartCol,nStartRow, nUndoEndCol,nUndoEndRow, aFilteredMark, HasAttrFlags::Overlapped )) { // "Cell merge not possible if cells already merged" ScDocAttrIterator aIter( pDoc, nStartTab, nStartCol, nStartRow, nUndoEndCol, nUndoEndRow ); const ScPatternAttr* pPattern = nullptr; diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index e43ef8aa896f..5b5c3ca5b49b 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1773,7 +1773,7 @@ void ScViewFunc::DeleteContents( InsertDeleteFlags nFlags ) aMarkRange.aStart.SetRow(GetViewData().GetCurY()); aMarkRange.aStart.SetTab(GetViewData().GetTabNo()); aMarkRange.aEnd = aMarkRange.aStart; - if ( pDoc->HasAttrib( aMarkRange, HASATTR_MERGED ) ) + if ( pDoc->HasAttrib( aMarkRange, HasAttrFlags::Merged ) ) { aFuncMark.SetMarkArea( aMarkRange ); } @@ -2061,7 +2061,7 @@ void ScViewFunc::SetWidthOrHeight( { if (rDoc.HasAttrib( static_cast<SCCOL>(nStart),0,nTab, static_cast<SCCOL>(nEnd),MAXROW,nTab, - HASATTR_MERGED | HASATTR_OVERLAPPED )) + HasAttrFlags::Merged | HasAttrFlags::Overlapped )) nStart = 0; if (nStart > 0) // go upwards because of Lines and cursor --nStart; @@ -2070,7 +2070,7 @@ void ScViewFunc::SetWidthOrHeight( } else { - if (rDoc.HasAttrib( 0,nStart,nTab, MAXCOL,nEnd,nTab, HASATTR_MERGED | HASATTR_OVERLAPPED )) + if (rDoc.HasAttrib( 0,nStart,nTab, MAXCOL,nEnd,nTab, HasAttrFlags::Merged | HasAttrFlags::Overlapped )) nStart = 0; if (nStart != 0) --nStart; @@ -2265,7 +2265,7 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal ) if ( bAnyEdit ) { UpdateEditView(); - if ( rDoc.HasAttrib( nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_NEEDHEIGHT ) ) + if ( rDoc.HasAttrib( nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::NeedHeight ) ) { ScInputHandler* pHdl = pScMod->GetInputHdl( GetViewData().GetViewShell() ); if (pHdl) |