diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-11 15:12:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-12 08:44:50 +0200 |
commit | 8aa1abe5afc52375d038710c4e7c68e97fd04fc6 (patch) | |
tree | 51f6974aa46fd21883cd8e18a41a26a7fc05a074 /sc | |
parent | 2f5fdd71dbeba5fd0bd21849817633cf64685f21 (diff) |
convert SC_CLIPMARK constants to typed_flags_set
Change-Id: Ibdfe3c46da35b96b040f02a167d35651502a65ef
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/fillinfo.hxx | 15 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 12 |
3 files changed, 19 insertions, 14 deletions
diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index 86955625f5d1..eb09413bfe6a 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -28,6 +28,7 @@ #include "global.hxx" #include "colorscale.hxx" #include "cellvalue.hxx" +#include <o3tl/typed_flags_set.hxx> class SfxItemSet; class SvxBrushItem; @@ -42,9 +43,13 @@ enum class ScRotateDir : sal_uInt8 { NONE, Standard, Left, Right, Center }; -const sal_uInt8 SC_CLIPMARK_NONE = 0; -const sal_uInt8 SC_CLIPMARK_LEFT = 1; -const sal_uInt8 SC_CLIPMARK_RIGHT = 2; +enum class ScClipMark : sal_uInt8 { + NONE = 0x00, Left = 0x01, Right = 0x02 +}; +namespace o3tl { + template<> struct typed_flags<ScClipMark> : is_typed_flags<ScClipMark, 0x03> {}; +} + const sal_uInt8 SC_CLIPMARK_SIZE = 64; enum ScShadowPart @@ -106,7 +111,7 @@ struct CellInfo , pVShadowOrigin(nullptr) , eHShadowPart(SC_SHADOW_HSTART) , eVShadowPart(SC_SHADOW_HSTART) - , nClipMark(SC_CLIPMARK_NONE) + , nClipMark(ScClipMark::NONE) , nWidth(0) , nRotateDir(ScRotateDir::NONE) , bMarked(false) @@ -149,7 +154,7 @@ struct CellInfo ScShadowPart eHShadowPart : 4; // shadow effective for drawing ScShadowPart eVShadowPart : 4; - sal_uInt8 nClipMark; + ScClipMark nClipMark; sal_uInt16 nWidth; ScRotateDir nRotateDir; diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 859e26ae93e8..78d351ba3a51 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -2520,7 +2520,7 @@ void ScOutputData::DrawClipMarks() for (SCCOL nX=nX1; nX<=nX2; nX++) { CellInfo* pInfo = &pThisRowInfo->pCellInfo[nX+1]; - if (pInfo->nClipMark) + if (pInfo->nClipMark != ScClipMark::NONE) { if (pInfo->bHOverlapped || pInfo->bVOverlapped) { @@ -2595,14 +2595,14 @@ void ScOutputData::DrawClipMarks() long nMarkPixel = (long)( SC_CLIPMARK_SIZE * mnPPTX ); Size aMarkSize( nMarkPixel, (nMarkPixel-1)*2 ); - if ( pInfo->nClipMark & ( bLayoutRTL ? SC_CLIPMARK_RIGHT : SC_CLIPMARK_LEFT ) ) + if ( pInfo->nClipMark & ( bLayoutRTL ? ScClipMark::Right : ScClipMark::Left ) ) { // visually left Rectangle aMarkRect = aCellRect; aMarkRect.Right() = aCellRect.Left()+nMarkPixel-1; SvxFont::DrawArrow( *mpDev, aMarkRect, aMarkSize, aArrowFillCol, true ); } - if ( pInfo->nClipMark & ( bLayoutRTL ? SC_CLIPMARK_LEFT : SC_CLIPMARK_RIGHT ) ) + if ( pInfo->nClipMark & ( bLayoutRTL ? ScClipMark::Left : ScClipMark::Right ) ) { // visually right Rectangle aMarkRect = aCellRect; diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 0279dfc8b3a7..0d38a6eeb618 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1313,14 +1313,14 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY // even if rThisRowInfo isn't for nCellY (merged cells). if ( nRightMissing > 0 && bMarkClipped && nRightX >= nX1 && nRightX <= nX2 && !bBreak && !bCellIsValue ) { - rThisRowInfo.pCellInfo[nRightX+1].nClipMark |= SC_CLIPMARK_RIGHT; + rThisRowInfo.pCellInfo[nRightX+1].nClipMark |= ScClipMark::Right; bAnyClipped = true; long nMarkPixel = (long)( SC_CLIPMARK_SIZE * mnPPTX ); rParam.maClipRect.Right() -= nMarkPixel * nLayoutSign; } if ( nLeftMissing > 0 && bMarkClipped && nLeftX >= nX1 && nLeftX <= nX2 && !bBreak && !bCellIsValue ) { - rThisRowInfo.pCellInfo[nLeftX+1].nClipMark |= SC_CLIPMARK_LEFT; + rThisRowInfo.pCellInfo[nLeftX+1].nClipMark |= ScClipMark::Left; bAnyClipped = true; long nMarkPixel = (long)( SC_CLIPMARK_SIZE * mnPPTX ); rParam.maClipRect.Left() += nMarkPixel * nLayoutSign; @@ -3057,7 +3057,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) else pClipMarkCell = &rParam.mpThisRowInfo->pCellInfo[rParam.mnX+1]; - pClipMarkCell->nClipMark |= SC_CLIPMARK_RIGHT; //! also allow left? + pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left? bAnyClipped = true; long nMarkPixel = (long)( SC_CLIPMARK_SIZE * mnPPTX ); @@ -3187,7 +3187,7 @@ void ScOutputData::ShowClipMarks( DrawEditParam& rParam, long nEngineHeight, con else pClipMarkCell = &rParam.mpThisRowInfo->pCellInfo[rParam.mnX+1]; - pClipMarkCell->nClipMark |= SC_CLIPMARK_RIGHT; //! also allow left? + pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left? bAnyClipped = true; const long nMarkPixel = static_cast<long>( SC_CLIPMARK_SIZE * mnPPTX ); @@ -4032,7 +4032,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) else pClipMarkCell = &rParam.mpThisRowInfo->pCellInfo[rParam.mnX+1]; - pClipMarkCell->nClipMark |= SC_CLIPMARK_RIGHT; //! also allow left? + pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left? bAnyClipped = true; long nMarkPixel = (long)( SC_CLIPMARK_SIZE * mnPPTX ); @@ -4379,7 +4379,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) else pClipMarkCell = &rParam.mpThisRowInfo->pCellInfo[rParam.mnX+1]; - pClipMarkCell->nClipMark |= SC_CLIPMARK_RIGHT; //! also allow left? + pClipMarkCell->nClipMark |= ScClipMark::Right; //! also allow left? bAnyClipped = true; long nMarkPixel = (long)( SC_CLIPMARK_SIZE * mnPPTX ); |