diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-07 14:28:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-08 09:07:08 +0200 |
commit | 90dc63a8ddda7d09635bdf60fcaafc5d0fdbbeeb (patch) | |
tree | d242492d503479dae72d8c8ff4cb0f7849eb0ac1 /sw | |
parent | 2bbce7dcd46e8aca716808602aa152ecd85b42af (diff) |
convert SHADOW_ constants to enum class
Change-Id: I1d3c144b2438776a31a246a2d0d4fe57b0caeaa3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/swfont.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/table/swtable.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/frmdlg/frmmgr.cxx | 8 |
9 files changed, 29 insertions, 28 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index eac0891cb10d..84016661f068 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2718,8 +2718,8 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, SwTwips nPrtWidth = (pTab->Prt().*fnRect->fnGetWidth)(); { SvxShadowItem aShadow( rTab.GetFrmFmt()->GetShadow() ); - nPrtWidth += aShadow.CalcShadowSpace( SHADOW_LEFT ) + - aShadow.CalcShadowSpace( SHADOW_RIGHT ); + nPrtWidth += aShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + + aShadow.CalcShadowSpace( SvxShadowItemSide::RIGHT ); } if( nPrtWidth != rTblFrmSz.GetWidth() ) { diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 1750d7f7e1c4..14cb4c8169fd 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -37,6 +37,7 @@ class SwScriptInfo; // _GetTxtSize class SwViewShell; class IDocumentSettingAccess; typedef struct _xmlTextWriter *xmlTextWriterPtr; +enum class SvxShadowItemSide; const sal_Unicode CH_BLANK = ' '; // ' ' blank spaces const sal_Unicode CH_BREAK = 0x0A; @@ -448,7 +449,7 @@ public: * @return the shadow space **/ sal_uInt16 CalcShadowSpace( - const sal_uInt16 nShadow, const bool bVertLayout, + const SvxShadowItemSide nShadow, const bool bVertLayout, const bool bSkipLeft, const bool bSkipRight ) const; void dumpAsXml( xmlTextWriterPtr writer = NULL ) const; diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 78d36124a07a..4b15cee2b8c4 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1992,7 +1992,7 @@ void SwBorderAttrs::_CalcTopLine() nTopLine = (bBorderDist && !rBox.GetTop()) ? rBox.GetDistance (SvxBoxItemLine::TOP) : rBox.CalcLineSpace(SvxBoxItemLine::TOP); - nTopLine = nTopLine + rShadow.CalcShadowSpace(SHADOW_TOP); + nTopLine = nTopLine + rShadow.CalcShadowSpace(SvxShadowItemSide::TOP); bTopLine = false; } @@ -2001,7 +2001,7 @@ void SwBorderAttrs::_CalcBottomLine() nBottomLine = (bBorderDist && !rBox.GetBottom()) ? rBox.GetDistance (SvxBoxItemLine::BOTTOM) : rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); - nBottomLine = nBottomLine + rShadow.CalcShadowSpace(SHADOW_BOTTOM); + nBottomLine = nBottomLine + rShadow.CalcShadowSpace(SvxShadowItemSide::BOTTOM); bBottomLine = false; } @@ -2010,7 +2010,7 @@ void SwBorderAttrs::_CalcLeftLine() nLeftLine = (bBorderDist && !rBox.GetLeft()) ? rBox.GetDistance (SvxBoxItemLine::LEFT) : rBox.CalcLineSpace(SvxBoxItemLine::LEFT); - nLeftLine = nLeftLine + rShadow.CalcShadowSpace(SHADOW_LEFT); + nLeftLine = nLeftLine + rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT); bLeftLine = false; } @@ -2019,7 +2019,7 @@ void SwBorderAttrs::_CalcRightLine() nRightLine = (bBorderDist && !rBox.GetRight()) ? rBox.GetDistance (SvxBoxItemLine::RIGHT) : rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); - nRightLine = nRightLine + rShadow.CalcShadowSpace(SHADOW_RIGHT); + nRightLine = nRightLine + rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT); bRightLine = false; } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index bb724f88c336..2f129a3a35a2 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1498,12 +1498,12 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, { const SvxShadowItem &rShadow = rAttrs.GetShadow(); if ( bTop ) - (rRect.*fnRect->fnSubTop)(rShadow.CalcShadowSpace(SHADOW_TOP)); - (rRect.*fnRect->fnSubLeft)(rShadow.CalcShadowSpace(SHADOW_LEFT)); + (rRect.*fnRect->fnSubTop)(rShadow.CalcShadowSpace(SvxShadowItemSide::TOP)); + (rRect.*fnRect->fnSubLeft)(rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT)); if ( bBottom ) (rRect.*fnRect->fnAddBottom) - (rShadow.CalcShadowSpace( SHADOW_BOTTOM )); - (rRect.*fnRect->fnAddRight)(rShadow.CalcShadowSpace(SHADOW_RIGHT)); + (rShadow.CalcShadowSpace( SvxShadowItemSide::BOTTOM )); + (rRect.*fnRect->fnAddRight)(rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT)); } } } diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 74cb35ee70e0..663733edf588 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -666,8 +666,8 @@ const SwRect SwFrm::UnionFrm( bool bBorder ) const if( rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE ) { const SvxShadowItem &rShadow = rAttrs.GetShadow(); - nLeft -= rShadow.CalcShadowSpace( SHADOW_LEFT ); - nAdd += rShadow.CalcShadowSpace( SHADOW_RIGHT ); + nLeft -= rShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ); + nAdd += rShadow.CalcShadowSpace( SvxShadowItemSide::RIGHT ); } } if( IsTxtFrm() && static_cast<const SwTxtFrm*>(this)->HasPara() ) diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index ab6522ef4e1d..9c2a5aeb3ec3 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -902,8 +902,8 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld, SvxLRSpaceItem aLR( pFmt->GetLRSpace() ); SvxShadowItem aSh( pFmt->GetShadow() ); - SwTwips nShRight = aSh.CalcShadowSpace( SHADOW_RIGHT ); - SwTwips nShLeft = aSh.CalcShadowSpace( SHADOW_LEFT ); + SwTwips nShRight = aSh.CalcShadowSpace( SvxShadowItemSide::RIGHT ); + SwTwips nShLeft = aSh.CalcShadowSpace( SvxShadowItemSide::LEFT ); aLR.SetLeft ( rNew.GetLeft() - nShLeft ); aLR.SetRight( rNew.GetRightMax() - rNew.GetRight() - nShRight ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index b738d9f5e17f..768ad633658c 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -759,10 +759,10 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor, const bool bJoinWithNext = static_cast<const SwTxtPortion&>(rPor).GetJoinBorderWithNext(); const bool bIsVert = GetTxtFrm()->IsVertical(); - aRect.Top(aRect.Top() + GetFont()->CalcShadowSpace(SHADOW_TOP, bIsVert, bJoinWithPrev, bJoinWithNext )); - aRect.Bottom(aRect.Bottom() - GetFont()->CalcShadowSpace(SHADOW_BOTTOM, bIsVert, bJoinWithPrev, bJoinWithNext )); - aRect.Left(aRect.Left() + GetFont()->CalcShadowSpace(SHADOW_LEFT, bIsVert, bJoinWithPrev, bJoinWithNext )); - aRect.Right(aRect.Right() - GetFont()->CalcShadowSpace(SHADOW_RIGHT, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Top(aRect.Top() + GetFont()->CalcShadowSpace(SvxShadowItemSide::TOP, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Bottom(aRect.Bottom() - GetFont()->CalcShadowSpace(SvxShadowItemSide::BOTTOM, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Left(aRect.Left() + GetFont()->CalcShadowSpace(SvxShadowItemSide::LEFT, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Right(aRect.Right() - GetFont()->CalcShadowSpace(SvxShadowItemSide::RIGHT, bIsVert, bJoinWithPrev, bJoinWithNext )); } if ( pRect ) diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index db618f9d6886..a33b8ec6737d 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -306,7 +306,7 @@ SvxShadowLocation SwFont::GetAbsShadowLocation( const bool bVertLayout ) const } sal_uInt16 SwFont::CalcShadowSpace( - const sal_uInt16 nShadow, const bool bVertLayout, + const SvxShadowItemSide nShadow, const bool bVertLayout, const bool bSkipLeft, const bool bSkipRight ) const { sal_uInt16 nSpace = 0; @@ -314,7 +314,7 @@ sal_uInt16 SwFont::CalcShadowSpace( const SvxShadowLocation aLoc = GetAbsShadowLocation( bVertLayout ); switch( nShadow ) { - case SHADOW_TOP: + case SvxShadowItemSide::TOP: if(( aLoc == SVX_SHADOW_TOPLEFT || aLoc == SVX_SHADOW_TOPRIGHT ) && ( nOrient == 0 || nOrient == 1800 || @@ -325,7 +325,7 @@ sal_uInt16 SwFont::CalcShadowSpace( } break; - case SHADOW_BOTTOM: + case SvxShadowItemSide::BOTTOM: if(( aLoc == SVX_SHADOW_BOTTOMLEFT || aLoc == SVX_SHADOW_BOTTOMRIGHT ) && ( nOrient == 0 || nOrient == 1800 || @@ -336,7 +336,7 @@ sal_uInt16 SwFont::CalcShadowSpace( } break; - case SHADOW_LEFT: + case SvxShadowItemSide::LEFT: if(( aLoc == SVX_SHADOW_TOPLEFT || aLoc == SVX_SHADOW_BOTTOMLEFT ) && ( nOrient == 900 || nOrient == 2700 || @@ -347,7 +347,7 @@ sal_uInt16 SwFont::CalcShadowSpace( } break; - case SHADOW_RIGHT: + case SvxShadowItemSide::RIGHT: if(( aLoc == SVX_SHADOW_TOPRIGHT || aLoc == SVX_SHADOW_BOTTOMRIGHT ) && ( nOrient == 900 || nOrient == 2700 || diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index df0dbf6547b6..925bd67b5b83 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -483,28 +483,28 @@ SwTwips SwFlyFrmAttrMgr::CalcTopSpace() { const SvxShadowItem& rShadow = GetShadow(); const SvxBoxItem& rBox = GetBox(); - return rShadow.CalcShadowSpace(SHADOW_TOP ) + rBox.CalcLineSpace(SvxBoxItemLine::TOP); + return rShadow.CalcShadowSpace(SvxShadowItemSide::TOP ) + rBox.CalcLineSpace(SvxBoxItemLine::TOP); } SwTwips SwFlyFrmAttrMgr::CalcBottomSpace() { const SvxShadowItem& rShadow = GetShadow(); const SvxBoxItem& rBox = GetBox(); - return rShadow.CalcShadowSpace(SHADOW_BOTTOM) + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); + return rShadow.CalcShadowSpace(SvxShadowItemSide::BOTTOM) + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); } SwTwips SwFlyFrmAttrMgr::CalcLeftSpace() { const SvxShadowItem& rShadow = GetShadow(); const SvxBoxItem& rBox = GetBox(); - return rShadow.CalcShadowSpace(SHADOW_LEFT) + rBox.CalcLineSpace(SvxBoxItemLine::LEFT); + return rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT) + rBox.CalcLineSpace(SvxBoxItemLine::LEFT); } SwTwips SwFlyFrmAttrMgr::CalcRightSpace() { const SvxShadowItem& rShadow = GetShadow(); const SvxBoxItem& rBox = GetBox(); - return rShadow.CalcShadowSpace(SHADOW_RIGHT) + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); + return rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT) + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); } // erase attribute from the set |