diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-08 08:58:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-08 09:07:34 +0000 |
commit | 1f4e0359d3cee2780944f64025a63c208720c74d (patch) | |
tree | f99934a01892ede88b5213655de481919e5edfab /sc | |
parent | 9cacb6ad9f5a012bc892cf9893cd8d37a2a5f304 (diff) |
convert SvxShadowLocation to scoped enum
Change-Id: Ie51995579312328538263172cd3173641df89bca
Reviewed-on: https://gerrit.libreoffice.org/34965
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/fillinfo.cxx | 28 | ||||
-rw-r--r-- | sc/source/core/data/patattr.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 30 |
5 files changed, 41 insertions, 41 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index cfbb1c0e133d..98f3dc04b1eb 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1334,7 +1334,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) cons { const SvxShadowItem* pShadow = static_cast<const SvxShadowItem*>( &pPattern->GetItem( ATTR_SHADOW ) ); - if ( pShadow->GetLocation() != SVX_SHADOW_NONE ) + if ( pShadow->GetLocation() != SvxShadowLocation::NONE ) bFound = true; } if ( nMask & HasAttrFlags::Conditional ) @@ -1418,10 +1418,10 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) cons static_cast<const SvxShadowItem*>( &pPattern->GetItem( ATTR_SHADOW )); SvxShadowLocation eLoc = pShadow->GetLocation(); if ( nMask & HasAttrFlags::ShadowRight ) - if ( eLoc == SVX_SHADOW_TOPRIGHT || eLoc == SVX_SHADOW_BOTTOMRIGHT ) + if ( eLoc == SvxShadowLocation::TopRight || eLoc == SvxShadowLocation::BottomRight ) bFound = true; if ( nMask & HasAttrFlags::ShadowDown ) - if ( eLoc == SVX_SHADOW_BOTTOMLEFT || eLoc == SVX_SHADOW_BOTTOMRIGHT ) + if ( eLoc == SvxShadowLocation::BottomLeft || eLoc == SvxShadowLocation::BottomRight ) bFound = true; } if ( nMask & HasAttrFlags::RightOrCenter ) diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index d8ec3ed9eec3..ad9e56b36113 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -831,8 +831,8 @@ void ScDocument::FillInfo( CellInfo* pInfo = &pRowInfo[nArrRow].pCellInfo[nArrCol]; const SvxShadowItem* pThisAttr = pInfo->pShadowAttr; - SvxShadowLocation eLoc = pThisAttr ? pThisAttr->GetLocation() : SVX_SHADOW_NONE; - if (eLoc != SVX_SHADOW_NONE) + SvxShadowLocation eLoc = pThisAttr ? pThisAttr->GetLocation() : SvxShadowLocation::NONE; + if (eLoc != SvxShadowLocation::NONE) { // or test on != eLoc @@ -845,22 +845,22 @@ void ScDocument::FillInfo( --nDxNeg; bool bLeftDiff = !bLeft && - pRowInfo[nArrRow].pCellInfo[nArrCol+nDxNeg].pShadowAttr->GetLocation() == SVX_SHADOW_NONE; + pRowInfo[nArrRow].pCellInfo[nArrCol+nDxNeg].pShadowAttr->GetLocation() == SvxShadowLocation::NONE; bool bRightDiff = !bRight && - pRowInfo[nArrRow].pCellInfo[nArrCol+nDxPos].pShadowAttr->GetLocation() == SVX_SHADOW_NONE; + pRowInfo[nArrRow].pCellInfo[nArrCol+nDxPos].pShadowAttr->GetLocation() == SvxShadowLocation::NONE; bool bTopDiff = !bTop && - pRowInfo[nArrRow-1].pCellInfo[nArrCol].pShadowAttr->GetLocation() == SVX_SHADOW_NONE; + pRowInfo[nArrRow-1].pCellInfo[nArrCol].pShadowAttr->GetLocation() == SvxShadowLocation::NONE; bool bBottomDiff = !bBottom && - pRowInfo[nArrRow+1].pCellInfo[nArrCol].pShadowAttr->GetLocation() == SVX_SHADOW_NONE; + pRowInfo[nArrRow+1].pCellInfo[nArrCol].pShadowAttr->GetLocation() == SvxShadowLocation::NONE; if ( bLayoutRTL ) { switch (eLoc) { - case SVX_SHADOW_BOTTOMRIGHT: eLoc = SVX_SHADOW_BOTTOMLEFT; break; - case SVX_SHADOW_BOTTOMLEFT: eLoc = SVX_SHADOW_BOTTOMRIGHT; break; - case SVX_SHADOW_TOPRIGHT: eLoc = SVX_SHADOW_TOPLEFT; break; - case SVX_SHADOW_TOPLEFT: eLoc = SVX_SHADOW_TOPRIGHT; break; + case SvxShadowLocation::BottomRight: eLoc = SvxShadowLocation::BottomLeft; break; + case SvxShadowLocation::BottomLeft: eLoc = SvxShadowLocation::BottomRight; break; + case SvxShadowLocation::TopRight: eLoc = SvxShadowLocation::TopLeft; break; + case SvxShadowLocation::TopLeft: eLoc = SvxShadowLocation::TopRight; break; default: { // added to avoid warnings @@ -870,7 +870,7 @@ void ScDocument::FillInfo( switch (eLoc) { - case SVX_SHADOW_BOTTOMRIGHT: + case SvxShadowLocation::BottomRight: if (bBottomDiff) { pRowInfo[nArrRow+1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr; @@ -890,7 +890,7 @@ void ScDocument::FillInfo( } break; - case SVX_SHADOW_BOTTOMLEFT: + case SvxShadowLocation::BottomLeft: if (bBottomDiff) { pRowInfo[nArrRow+1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr; @@ -910,7 +910,7 @@ void ScDocument::FillInfo( } break; - case SVX_SHADOW_TOPRIGHT: + case SvxShadowLocation::TopRight: if (bTopDiff) { pRowInfo[nArrRow-1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr; @@ -930,7 +930,7 @@ void ScDocument::FillInfo( } break; - case SVX_SHADOW_TOPLEFT: + case SvxShadowLocation::TopLeft: if (bTopDiff) { pRowInfo[nArrRow-1].pCellInfo[nArrCol].pHShadowOrigin = pThisAttr; diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 40ac77231f62..bb46e37a15c1 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -1181,7 +1181,7 @@ bool ScPatternAttr::IsVisible() const eState = rSet.GetItemState( ATTR_SHADOW, true, &pItem ); if ( eState == SfxItemState::SET ) - if ( static_cast<const SvxShadowItem*>(pItem)->GetLocation() != SVX_SHADOW_NONE ) + if ( static_cast<const SvxShadowItem*>(pItem)->GetLocation() != SvxShadowLocation::NONE ) return true; return false; diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 6368dfea5478..8382d983883d 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1230,10 +1230,10 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot // so the attribute's location value is mirrored here and in FillInfo. switch (eLoc) { - case SVX_SHADOW_BOTTOMRIGHT: eLoc = SVX_SHADOW_BOTTOMLEFT; break; - case SVX_SHADOW_BOTTOMLEFT: eLoc = SVX_SHADOW_BOTTOMRIGHT; break; - case SVX_SHADOW_TOPRIGHT: eLoc = SVX_SHADOW_TOPLEFT; break; - case SVX_SHADOW_TOPLEFT: eLoc = SVX_SHADOW_TOPRIGHT; break; + case SvxShadowLocation::BottomRight: eLoc = SvxShadowLocation::BottomLeft; break; + case SvxShadowLocation::BottomLeft: eLoc = SvxShadowLocation::BottomRight; break; + case SvxShadowLocation::TopRight: eLoc = SvxShadowLocation::TopLeft; break; + case SvxShadowLocation::TopLeft: eLoc = SvxShadowLocation::TopRight; break; default: { // added to avoid warnings @@ -1244,7 +1244,7 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot if (ePart == SC_SHADOW_HORIZ || ePart == SC_SHADOW_HSTART || ePart == SC_SHADOW_CORNER) { - if (eLoc == SVX_SHADOW_TOPLEFT || eLoc == SVX_SHADOW_TOPRIGHT) + if (eLoc == SvxShadowLocation::TopLeft || eLoc == SvxShadowLocation::TopRight) aRect.Top() = aRect.Bottom() - nSizeY; else aRect.Bottom() = aRect.Top() + nSizeY; @@ -1252,21 +1252,21 @@ void ScOutputData::DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBot if (ePart == SC_SHADOW_VERT || ePart == SC_SHADOW_VSTART || ePart == SC_SHADOW_CORNER) { - if (eLoc == SVX_SHADOW_TOPLEFT || eLoc == SVX_SHADOW_BOTTOMLEFT) + if (eLoc == SvxShadowLocation::TopLeft || eLoc == SvxShadowLocation::BottomLeft) aRect.Left() = aRect.Right() - nSizeX; else aRect.Right() = aRect.Left() + nSizeX; } if (ePart == SC_SHADOW_HSTART) { - if (eLoc == SVX_SHADOW_TOPLEFT || eLoc == SVX_SHADOW_BOTTOMLEFT) + if (eLoc == SvxShadowLocation::TopLeft || eLoc == SvxShadowLocation::BottomLeft) aRect.Right() -= nSizeX; else aRect.Left() += nSizeX; } if (ePart == SC_SHADOW_VSTART) { - if (eLoc == SVX_SHADOW_TOPLEFT || eLoc == SVX_SHADOW_TOPRIGHT) + if (eLoc == SvxShadowLocation::TopLeft || eLoc == SvxShadowLocation::TopRight) aRect.Bottom() -= nSizeY; else aRect.Top() += nSizeY; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 569e0c059c0a..a423db307ec5 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -758,7 +758,7 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam ) lcl_LineTotal(rParam.pBorder->GetLeft()) + lcl_LineTotal(rParam.pBorder->GetRight()) ) * 100 / nZoom; - if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE) + if (rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE) nPaperWidth -= ( rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) + rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) ) * 100L / nZoom; @@ -784,7 +784,7 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam ) rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM) + lcl_LineTotal( rParam.pBorder->GetTop() ) + lcl_LineTotal( rParam.pBorder->GetBottom() ); - if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE) + if (rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE) rParam.nHeight += rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) + rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM); @@ -1245,7 +1245,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, long nBottom = 0; // aFrameRect - outside around frame, without shadow - if ( pShadow && pShadow->GetLocation() != SVX_SHADOW_NONE ) + if ( pShadow && pShadow->GetLocation() != SvxShadowLocation::NONE ) { nLeft += (long) ( pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX ); nRight += (long) ( pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX ); @@ -1291,7 +1291,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, } } - if ( pShadow && pShadow->GetLocation() != SVX_SHADOW_NONE ) + if ( pShadow && pShadow->GetLocation() != SvxShadowLocation::NONE ) { pDev->SetFillColor(pShadow->GetColor()); pDev->SetLineColor(); @@ -1299,7 +1299,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, long nShadowY = (long) ( pShadow->GetWidth() * nScaleY ); switch (pShadow->GetLocation()) { - case SVX_SHADOW_TOPLEFT: + case SvxShadowLocation::TopLeft: pDev->DrawRect( Rectangle( aFrameRect.Left()-nShadowX, aFrameRect.Top()-nShadowY, aFrameRect.Right()-nShadowX, aFrameRect.Top() ) ); @@ -1307,7 +1307,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, aFrameRect.Left()-nShadowX, aFrameRect.Top()-nShadowY, aFrameRect.Left(), aFrameRect.Bottom()-nShadowY ) ); break; - case SVX_SHADOW_TOPRIGHT: + case SvxShadowLocation::TopRight: pDev->DrawRect( Rectangle( aFrameRect.Left()+nShadowX, aFrameRect.Top()-nShadowY, aFrameRect.Right()+nShadowX, aFrameRect.Top() ) ); @@ -1315,7 +1315,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, aFrameRect.Right(), aFrameRect.Top()-nShadowY, aFrameRect.Right()+nShadowX, aFrameRect.Bottom()-nShadowY ) ); break; - case SVX_SHADOW_BOTTOMLEFT: + case SvxShadowLocation::BottomLeft: pDev->DrawRect( Rectangle( aFrameRect.Left()-nShadowX, aFrameRect.Bottom(), aFrameRect.Right()-nShadowX, aFrameRect.Bottom()+nShadowY ) ); @@ -1323,7 +1323,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, aFrameRect.Left()-nShadowX, aFrameRect.Top()+nShadowY, aFrameRect.Left(), aFrameRect.Bottom()+nShadowY ) ); break; - case SVX_SHADOW_BOTTOMRIGHT: + case SvxShadowLocation::BottomRight: pDev->DrawRect( Rectangle( aFrameRect.Left()+nShadowX, aFrameRect.Bottom(), aFrameRect.Right()+nShadowX, aFrameRect.Bottom()+nShadowY ) ); @@ -1739,7 +1739,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY, aPaperSize.Height() -= nTop + lcl_LineTotal( rParam.pBorder->GetBottom() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM); } - if ( rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE ) + if ( rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE ) { long nLeft = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT); long nTop = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP); @@ -1772,7 +1772,7 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY, lcl_LineTotal( rParam.pBorder->GetBottom() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::TOP) + rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM); - if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE) + if (rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE) nMaxHeight += rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) + rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM); @@ -2081,7 +2081,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO if (pBorderItem) nDataWidth += pBorderItem->GetDistance(SvxBoxItemLine::LEFT) + pBorderItem->GetDistance(SvxBoxItemLine::RIGHT); //! Line width? - if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE) + if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE) nDataWidth += pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) + pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT); if ( bCenterHor ) @@ -2104,7 +2104,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO if (pBorderItem) nDataHeight += pBorderItem->GetDistance(SvxBoxItemLine::TOP) + pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM); //! Line width? - if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE) + if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE) nDataHeight += pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) + pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM); nTopSpace += ( aPageRect.GetHeight() - nDataHeight ) / 2; @@ -2150,7 +2150,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO nInnerStartY += (long) ( ( lcl_LineTotal(pBorderItem->GetTop()) + pBorderItem->GetDistance(SvxBoxItemLine::TOP) ) * nScaleY ); } - if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE) + if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE) { nInnerStartX += (long) ( pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX ); nInnerStartY += (long) ( pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY ); @@ -2204,7 +2204,7 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO nBorderEndY += (long) ( ( lcl_LineTotal(pBorderItem->GetBottom()) + pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM) ) * nScaleY ); } - if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE) + if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE) { nBorderEndX += (long) ( pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX ); nBorderEndY += (long) ( pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY ); @@ -2928,7 +2928,7 @@ Size ScPrintFunc::GetDocPageSize() pBorderItem->GetDistance(SvxBoxItemLine::TOP) + pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM); } - if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE) + if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE) { aDocPageSize.Width() -= pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) + pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT); |