[Libreoffice-commits] core.git: cui/source editeng/source include/editeng include/o3tl sc/qa sc/source sd/source svx/source sw/source
Noel Grandin
noel at peralex.com
Wed Apr 1 00:37:29 PDT 2015
cui/source/tabpages/border.cxx | 41 ++---
cui/source/tabpages/page.cxx | 8 -
editeng/source/items/frmitems.cxx | 107 +++++++-------
editeng/source/rtf/rtfitem.cxx | 16 +-
include/editeng/boxitem.hxx | 61 ++++----
include/o3tl/enumarray.hxx | 107 ++++++++++++++
include/o3tl/enumrange.hxx | 90 ++++++++++++
sc/qa/unit/ucalc.cxx | 4
sc/source/core/data/attarray.cxx | 40 ++---
sc/source/core/data/docpool.cxx | 4
sc/source/core/data/document.cxx | 12 -
sc/source/core/data/dpoutput.cxx | 26 +--
sc/source/core/data/stlpool.cxx | 8 -
sc/source/core/data/table2.cxx | 16 +-
sc/source/core/data/table4.cxx | 24 +--
sc/source/core/tool/autoform.cxx | 8 -
sc/source/filter/excel/xistyle.cxx | 18 +-
sc/source/filter/html/htmlimp.cxx | 4
sc/source/filter/html/htmlpars.cxx | 8 -
sc/source/filter/inc/xistyle.hxx | 7
sc/source/filter/lotus/lotattr.cxx | 8 -
sc/source/filter/oox/sheetdatabuffer.cxx | 10 -
sc/source/filter/oox/stylesbuffer.cxx | 8 -
sc/source/filter/starcalc/scflt.cxx | 24 +--
sc/source/ui/sidebar/CellBorderStyleControl.cxx | 28 +--
sc/source/ui/unoobj/cellsuno.cxx | 12 -
sc/source/ui/view/formatsh.cxx | 16 +-
sc/source/ui/view/printfun.cxx | 44 ++---
sc/source/ui/view/tabvwsha.cxx | 4
sc/source/ui/view/viewfun2.cxx | 12 -
sd/source/core/drawdoc4.cxx | 8 -
sd/source/ui/table/TableDesignPane.cxx | 14 -
svx/source/table/cell.cxx | 12 -
svx/source/table/tablecontroller.cxx | 177 ++++++++++++------------
svx/source/tbxctrls/tbcontrl.cxx | 24 +--
sw/source/core/doc/DocumentStylePoolManager.cxx | 10 -
sw/source/core/doc/gctable.cxx | 6
sw/source/core/doc/tblafmt.cxx | 8 -
sw/source/core/doc/tblrwcl.cxx | 20 +-
sw/source/core/docnode/ndtbl.cxx | 10 -
sw/source/core/docnode/ndtbl1.cxx | 80 ++++------
sw/source/core/docnode/swbaslnk.cxx | 8 -
sw/source/core/edit/autofmt.cxx | 2
sw/source/core/frmedt/tblsel.cxx | 6
sw/source/core/graphic/ndgrf.cxx | 8 -
sw/source/core/layout/frmtool.cxx | 16 +-
sw/source/core/layout/paintfrm.cxx | 16 +-
sw/source/core/layout/ssfrm.cxx | 8 -
sw/source/core/layout/tabfrm.cxx | 14 -
sw/source/core/table/swnewtable.cxx | 6
sw/source/core/text/atrstck.cxx | 8 -
sw/source/core/txtnode/swfont.cxx | 16 +-
sw/source/core/unocore/unotbl.cxx | 44 ++---
sw/source/filter/basflt/fltini.cxx | 4
sw/source/filter/html/css1atr.cxx | 8 -
sw/source/filter/html/htmlflywriter.cxx | 20 +-
sw/source/filter/html/htmlgrin.cxx | 8 -
sw/source/filter/html/htmltab.cxx | 20 +-
sw/source/filter/html/svxcss1.cxx | 115 +++++++--------
sw/source/filter/html/svxcss1.hxx | 4
sw/source/filter/html/swhtml.cxx | 2
sw/source/filter/writer/wrtswtbl.cxx | 8 -
sw/source/filter/ww8/docxattributeoutput.cxx | 94 ++++++------
sw/source/filter/ww8/docxattributeoutput.hxx | 2
sw/source/filter/ww8/rtfattributeoutput.cxx | 48 +++---
sw/source/filter/ww8/writerwordglue.cxx | 8 -
sw/source/filter/ww8/wrtw8esh.cxx | 6
sw/source/filter/ww8/wrtww8.cxx | 6
sw/source/filter/ww8/wrtww8gr.cxx | 33 ++--
sw/source/filter/ww8/ww8atr.cxx | 32 +---
sw/source/filter/ww8/ww8graf.cxx | 19 +-
sw/source/filter/ww8/ww8par2.cxx | 24 +--
sw/source/filter/ww8/ww8par6.cxx | 68 ++++-----
sw/source/filter/xml/xmlexpit.cxx | 8 -
sw/source/filter/xml/xmlimpit.cxx | 16 +-
sw/source/ui/misc/pggrid.cxx | 8 -
sw/source/uibase/frmdlg/frmmgr.cxx | 8 -
sw/source/uibase/shells/frmsh.cxx | 40 ++---
sw/source/uibase/shells/tabsh.cxx | 12 -
sw/source/uibase/shells/textsh.cxx | 2
sw/source/uibase/uiview/viewtab.cxx | 28 +--
81 files changed, 1068 insertions(+), 879 deletions(-)
New commits:
commit 4b66829390b286010b37b37ec1537a320d8cea8f
Author: Noel Grandin <noel at peralex.com>
Date: Mon Mar 30 11:20:37 2015 +0200
convert BOX_LINE and BOXINFO_LINE to enum class
since their usage is intertwined.
Also introduce new o3tl utilities enumrange and enumarray to make
working with scoped enums a little simpler.
Change-Id: I2e1cc65dd7c638e59f17d96dfae504747cad6533
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index c2a1432..8a3a29a 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -434,13 +434,13 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
m_pBottomMF->SetMin( 0 );
m_pBottomMF->SetFirst( 0 );
}
- long nLeftDist = pBoxItem->GetDistance( BOX_LINE_LEFT);
+ long nLeftDist = pBoxItem->GetDistance( SvxBoxItemLine::LEFT);
SetMetricValue(*m_pLeftMF, nLeftDist, eCoreUnit);
- long nRightDist = pBoxItem->GetDistance( BOX_LINE_RIGHT);
+ long nRightDist = pBoxItem->GetDistance( SvxBoxItemLine::RIGHT);
SetMetricValue(*m_pRightMF, nRightDist, eCoreUnit);
- long nTopDist = pBoxItem->GetDistance( BOX_LINE_TOP);
+ long nTopDist = pBoxItem->GetDistance( SvxBoxItemLine::TOP);
SetMetricValue( *m_pTopMF, nTopDist, eCoreUnit );
- long nBottomDist = pBoxItem->GetDistance( BOX_LINE_BOTTOM);
+ long nBottomDist = pBoxItem->GetDistance( SvxBoxItemLine::BOTTOM);
SetMetricValue( *m_pBottomMF, nBottomDist, eCoreUnit );
// if the distance is set with no active border line
@@ -603,12 +603,11 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
// outer border:
- typedef ::std::pair<svx::FrameBorderType,sal_uInt16> TBorderPair;
- TBorderPair eTypes1[] = {
- TBorderPair(svx::FRAMEBORDER_TOP,BOX_LINE_TOP),
- TBorderPair(svx::FRAMEBORDER_BOTTOM,BOX_LINE_BOTTOM),
- TBorderPair(svx::FRAMEBORDER_LEFT,BOX_LINE_LEFT),
- TBorderPair(svx::FRAMEBORDER_RIGHT,BOX_LINE_RIGHT),
+ ::std::pair<svx::FrameBorderType,SvxBoxItemLine> eTypes1[] = {
+ { svx::FRAMEBORDER_TOP,SvxBoxItemLine::TOP },
+ { svx::FRAMEBORDER_BOTTOM,SvxBoxItemLine::BOTTOM },
+ { svx::FRAMEBORDER_LEFT,SvxBoxItemLine::LEFT },
+ { svx::FRAMEBORDER_RIGHT,SvxBoxItemLine::RIGHT },
};
for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(eTypes1); ++i)
@@ -617,9 +616,9 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
// border hor/ver and TableFlag
- TBorderPair eTypes2[] = {
- TBorderPair(svx::FRAMEBORDER_HOR,BOXINFO_LINE_HORI),
- TBorderPair(svx::FRAMEBORDER_VER,BOXINFO_LINE_VERT)
+ ::std::pair<svx::FrameBorderType,SvxBoxInfoItemLine> eTypes2[] = {
+ { svx::FRAMEBORDER_HOR,SvxBoxInfoItemLine::HORI },
+ { svx::FRAMEBORDER_VER,SvxBoxInfoItemLine::VERT }
};
for (sal_uInt32 j=0; j < SAL_N_ELEMENTS(eTypes2); ++j)
aBoxInfoItem.SetLine( m_pFrameSel->GetFrameBorderStyle( eTypes2[j].first ), eTypes2[j].second );
@@ -664,17 +663,17 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
(pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::DISTANCE))
)
{
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pLeftMF, eCoreUnit ), BOX_LINE_LEFT );
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pRightMF, eCoreUnit ), BOX_LINE_RIGHT );
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pTopMF, eCoreUnit ), BOX_LINE_TOP );
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pBottomMF, eCoreUnit ), BOX_LINE_BOTTOM);
+ aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pLeftMF, eCoreUnit ), SvxBoxItemLine::LEFT );
+ aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pRightMF, eCoreUnit ), SvxBoxItemLine::RIGHT );
+ aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pTopMF, eCoreUnit ), SvxBoxItemLine::TOP );
+ aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pBottomMF, eCoreUnit ), SvxBoxItemLine::BOTTOM);
}
else
{
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_LEFT ), BOX_LINE_LEFT);
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_RIGHT), BOX_LINE_RIGHT);
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_TOP ), BOX_LINE_TOP);
- aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_BOTTOM), BOX_LINE_BOTTOM);
+ aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::LEFT ), SvxBoxItemLine::LEFT);
+ aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::RIGHT), SvxBoxItemLine::RIGHT);
+ aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::TOP ), SvxBoxItemLine::TOP);
+ aBoxItem.SetDistance(pOldBoxItem->GetDistance(SvxBoxItemLine::BOTTOM), SvxBoxItemLine::BOTTOM);
}
aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::DISTANCE, true );
}
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 5d6c92c..25ab875 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -113,10 +113,10 @@ sal_uInt16 PosToPageUsage_Impl( sal_uInt16 nPos )
Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBox )
{
Size aSz;
- aSz.Height() = rShadow.CalcShadowSpace( SHADOW_BOTTOM ) + rBox.CalcLineSpace( BOX_LINE_BOTTOM );
- aSz.Height() += rShadow.CalcShadowSpace( SHADOW_TOP ) + rBox.CalcLineSpace( BOX_LINE_TOP );
- aSz.Width() = rShadow.CalcShadowSpace( SHADOW_LEFT ) + rBox.CalcLineSpace( BOX_LINE_LEFT );
- aSz.Width() += rShadow.CalcShadowSpace( SHADOW_RIGHT ) + rBox.CalcLineSpace( BOX_LINE_RIGHT );
+ aSz.Height() = rShadow.CalcShadowSpace( SHADOW_BOTTOM ) + rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM );
+ aSz.Height() += rShadow.CalcShadowSpace( SHADOW_TOP ) + rBox.CalcLineSpace( SvxBoxItemLine::TOP );
+ aSz.Width() = rShadow.CalcShadowSpace( SHADOW_LEFT ) + rBox.CalcLineSpace( SvxBoxItemLine::LEFT );
+ aSz.Width() += rShadow.CalcShadowSpace( SHADOW_RIGHT ) + rBox.CalcLineSpace( SvxBoxItemLine::RIGHT );
return aSz;
}
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 3fe61eb..2029a85 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -82,6 +82,7 @@
#include <editeng/memberids.hrc>
#include <editeng/editerr.hxx>
#include <libxml/xmlwriter.h>
+#include <o3tl/enumrange.hxx>
using namespace ::editeng;
using namespace ::com::sun::star;
@@ -1652,10 +1653,10 @@ SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& rBox )
nBottomDist = rBox.nBottomDist;
nLeftDist = rBox.nLeftDist;
nRightDist = rBox.nRightDist;
- SetLine( rBox.GetTop(), BOX_LINE_TOP );
- SetLine( rBox.GetBottom(), BOX_LINE_BOTTOM );
- SetLine( rBox.GetLeft(), BOX_LINE_LEFT );
- SetLine( rBox.GetRight(), BOX_LINE_RIGHT );
+ SetLine( rBox.GetTop(), SvxBoxItemLine::TOP );
+ SetLine( rBox.GetBottom(), SvxBoxItemLine::BOTTOM );
+ SetLine( rBox.GetLeft(), SvxBoxItemLine::LEFT );
+ SetLine( rBox.GetRight(), SvxBoxItemLine::RIGHT );
return *this;
}
@@ -1862,9 +1863,9 @@ lcl_extractBorderLine(const uno::Any& rAny, table::BorderLine2& rLine)
return false;
}
-template<typename Item>
+template<typename Item, typename Line>
bool
-lcl_setLine(const uno::Any& rAny, Item& rItem, sal_uInt16 nLine, const bool bConvert)
+lcl_setLine(const uno::Any& rAny, Item& rItem, Line nLine, const bool bConvert)
{
bool bDone = false;
table::BorderLine2 aBorderLine;
@@ -1883,7 +1884,7 @@ lcl_setLine(const uno::Any& rAny, Item& rItem, sal_uInt16 nLine, const bool bCon
bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
- sal_uInt16 nLine = BOX_LINE_TOP;
+ SvxBoxItemLine nLine = SvxBoxItemLine::TOP;
bool bDistMember = false;
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
@@ -1894,7 +1895,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if (( rVal >>= aSeq ) && ( aSeq.getLength() == 9 ))
{
// 4 Borders and 5 distances
- const sal_uInt16 aBorders[] = { BOX_LINE_LEFT, BOX_LINE_RIGHT, BOX_LINE_BOTTOM, BOX_LINE_TOP };
+ const SvxBoxItemLine aBorders[] = { SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::TOP };
for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n)
{
if (!lcl_setLine(aSeq[n], *this, aBorders[n], bConvert))
@@ -1902,7 +1903,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
// WTH are the borders and the distances saved in different order?
- sal_uInt16 nLines[4] = { BOX_LINE_TOP, BOX_LINE_BOTTOM, BOX_LINE_LEFT, BOX_LINE_RIGHT };
+ SvxBoxItemLine nLines[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::LEFT, SvxBoxItemLine::RIGHT };
for ( sal_Int32 n = 4; n < 9; n++ )
{
sal_Int32 nDist = 0;
@@ -1929,28 +1930,28 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
//fall-through
case LEFT_BORDER:
case MID_LEFT_BORDER:
- nLine = BOX_LINE_LEFT;
+ nLine = SvxBoxItemLine::LEFT;
break;
case RIGHT_BORDER_DISTANCE:
bDistMember = true;
//fall-through
case RIGHT_BORDER:
case MID_RIGHT_BORDER:
- nLine = BOX_LINE_RIGHT;
+ nLine = SvxBoxItemLine::RIGHT;
break;
case BOTTOM_BORDER_DISTANCE:
bDistMember = true;
//fall-through
case BOTTOM_BORDER:
case MID_BOTTOM_BORDER:
- nLine = BOX_LINE_BOTTOM;
+ nLine = SvxBoxItemLine::BOTTOM;
break;
case TOP_BORDER_DISTANCE:
bDistMember = true;
//fall-through
case TOP_BORDER:
case MID_TOP_BORDER:
- nLine = BOX_LINE_TOP;
+ nLine = SvxBoxItemLine::TOP;
break;
case LINE_STYLE:
{
@@ -1971,10 +1972,9 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
// Set the line style on all borders
- const sal_uInt16 aBorders[] = { BOX_LINE_LEFT, BOX_LINE_RIGHT, BOX_LINE_BOTTOM, BOX_LINE_TOP };
- for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n)
+ for( SvxBoxItemLine n : o3tl::enumrange<SvxBoxItemLine>() )
{
- editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( aBorders[n] ) );
+ editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( n ) );
if( pLine )
pLine->SetBorderLineStyle( eBorderStyle );
}
@@ -1990,10 +1990,9 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
nWidth = convertMm100ToTwip( nWidth );
// Set the line Width on all borders
- const sal_uInt16 aBorders[] = { BOX_LINE_LEFT, BOX_LINE_RIGHT, BOX_LINE_BOTTOM, BOX_LINE_TOP };
- for (int n(0); n != SAL_N_ELEMENTS(aBorders); ++n)
+ for( SvxBoxItemLine n : o3tl::enumrange<SvxBoxItemLine>() )
{
- editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( aBorders[n] ) );
+ editeng::SvxBorderLine* pLine = const_cast< editeng::SvxBorderLine* >( GetLine( n ) );
if( pLine )
pLine->SetWidth( nWidth );
}
@@ -2308,8 +2307,8 @@ SfxPoolItem* SvxBoxItem::Create( SvStream& rStrm, sal_uInt16 nIVersion ) const
rStrm.ReadUInt16( nDistance );
SvxBoxItem* pAttr = new SvxBoxItem( Which() );
- sal_uInt16 aLineMap[4] = { BOX_LINE_TOP, BOX_LINE_LEFT,
- BOX_LINE_RIGHT, BOX_LINE_BOTTOM };
+ SvxBoxItemLine aLineMap[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
+ SvxBoxItemLine::RIGHT, SvxBoxItemLine::BOTTOM };
sal_Int8 cLine;
while( true )
@@ -2342,22 +2341,22 @@ SfxPoolItem* SvxBoxItem::Create( SvStream& rStrm, sal_uInt16 nIVersion ) const
-const SvxBorderLine *SvxBoxItem::GetLine( sal_uInt16 nLine ) const
+const SvxBorderLine *SvxBoxItem::GetLine( SvxBoxItemLine nLine ) const
{
const SvxBorderLine *pRet = 0;
switch ( nLine )
{
- case BOX_LINE_TOP:
+ case SvxBoxItemLine::TOP:
pRet = pTop;
break;
- case BOX_LINE_BOTTOM:
+ case SvxBoxItemLine::BOTTOM:
pRet = pBottom;
break;
- case BOX_LINE_LEFT:
+ case SvxBoxItemLine::LEFT:
pRet = pLeft;
break;
- case BOX_LINE_RIGHT:
+ case SvxBoxItemLine::RIGHT:
pRet = pRight;
break;
default:
@@ -2370,25 +2369,25 @@ const SvxBorderLine *SvxBoxItem::GetLine( sal_uInt16 nLine ) const
-void SvxBoxItem::SetLine( const SvxBorderLine* pNew, sal_uInt16 nLine )
+void SvxBoxItem::SetLine( const SvxBorderLine* pNew, SvxBoxItemLine nLine )
{
SvxBorderLine* pTmp = pNew ? new SvxBorderLine( *pNew ) : 0;
switch ( nLine )
{
- case BOX_LINE_TOP:
+ case SvxBoxItemLine::TOP:
delete pTop;
pTop = pTmp;
break;
- case BOX_LINE_BOTTOM:
+ case SvxBoxItemLine::BOTTOM:
delete pBottom;
pBottom = pTmp;
break;
- case BOX_LINE_LEFT:
+ case SvxBoxItemLine::LEFT:
delete pLeft;
pLeft = pTmp;
break;
- case BOX_LINE_RIGHT:
+ case SvxBoxItemLine::RIGHT:
delete pRight;
pRight = pTmp;
break;
@@ -2416,21 +2415,21 @@ sal_uInt16 SvxBoxItem::GetDistance() const
-sal_uInt16 SvxBoxItem::GetDistance( sal_uInt16 nLine ) const
+sal_uInt16 SvxBoxItem::GetDistance( SvxBoxItemLine nLine ) const
{
sal_uInt16 nDist = 0;
switch ( nLine )
{
- case BOX_LINE_TOP:
+ case SvxBoxItemLine::TOP:
nDist = nTopDist;
break;
- case BOX_LINE_BOTTOM:
+ case SvxBoxItemLine::BOTTOM:
nDist = nBottomDist;
break;
- case BOX_LINE_LEFT:
+ case SvxBoxItemLine::LEFT:
nDist = nLeftDist;
break;
- case BOX_LINE_RIGHT:
+ case SvxBoxItemLine::RIGHT:
nDist = nRightDist;
break;
default:
@@ -2442,20 +2441,20 @@ sal_uInt16 SvxBoxItem::GetDistance( sal_uInt16 nLine ) const
-void SvxBoxItem::SetDistance( sal_uInt16 nNew, sal_uInt16 nLine )
+void SvxBoxItem::SetDistance( sal_uInt16 nNew, SvxBoxItemLine nLine )
{
switch ( nLine )
{
- case BOX_LINE_TOP:
+ case SvxBoxItemLine::TOP:
nTopDist = nNew;
break;
- case BOX_LINE_BOTTOM:
+ case SvxBoxItemLine::BOTTOM:
nBottomDist = nNew;
break;
- case BOX_LINE_LEFT:
+ case SvxBoxItemLine::LEFT:
nLeftDist = nNew;
break;
- case BOX_LINE_RIGHT:
+ case SvxBoxItemLine::RIGHT:
nRightDist = nNew;
break;
default:
@@ -2465,25 +2464,25 @@ void SvxBoxItem::SetDistance( sal_uInt16 nNew, sal_uInt16 nLine )
-sal_uInt16 SvxBoxItem::CalcLineSpace( sal_uInt16 nLine, bool bIgnoreLine ) const
+sal_uInt16 SvxBoxItem::CalcLineSpace( SvxBoxItemLine nLine, bool bIgnoreLine ) const
{
SvxBorderLine* pTmp = 0;
sal_uInt16 nDist = 0;
switch ( nLine )
{
- case BOX_LINE_TOP:
+ case SvxBoxItemLine::TOP:
pTmp = pTop;
nDist = nTopDist;
break;
- case BOX_LINE_BOTTOM:
+ case SvxBoxItemLine::BOTTOM:
pTmp = pBottom;
nDist = nBottomDist;
break;
- case BOX_LINE_LEFT:
+ case SvxBoxItemLine::LEFT:
pTmp = pLeft;
nDist = nLeftDist;
break;
- case BOX_LINE_RIGHT:
+ case SvxBoxItemLine::RIGHT:
pTmp = pRight;
nDist = nRightDist;
break;
@@ -2575,16 +2574,16 @@ bool SvxBoxInfoItem::operator==( const SfxPoolItem& rAttr ) const
-void SvxBoxInfoItem::SetLine( const SvxBorderLine* pNew, sal_uInt16 nLine )
+void SvxBoxInfoItem::SetLine( const SvxBorderLine* pNew, SvxBoxInfoItemLine nLine )
{
SvxBorderLine* pTmp = pNew ? new SvxBorderLine( *pNew ) : 0;
- if ( BOXINFO_LINE_HORI == nLine )
+ if ( SvxBoxInfoItemLine::HORI == nLine )
{
delete pHori;
pHori = pTmp;
}
- else if ( BOXINFO_LINE_VERT == nLine )
+ else if ( SvxBoxInfoItemLine::VERT == nLine )
{
delete pVert;
pVert = pTmp;
@@ -2698,8 +2697,8 @@ SfxPoolItem* SvxBoxInfoItem::Create( SvStream& rStrm, sal_uInt16 ) const
switch( cLine )
{
- case 0: pAttr->SetLine( &aBorder, BOXINFO_LINE_HORI ); break;
- case 1: pAttr->SetLine( &aBorder, BOXINFO_LINE_VERT ); break;
+ case 0: pAttr->SetLine( &aBorder, SvxBoxInfoItemLine::HORI ); break;
+ case 1: pAttr->SetLine( &aBorder, SvxBoxInfoItemLine::VERT ); break;
}
}
return pAttr;
@@ -2788,9 +2787,9 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if (( rVal >>= aSeq ) && ( aSeq.getLength() == 5 ))
{
// 2 BorderLines, flags, valid flags and distance
- if (!lcl_setLine(aSeq[0], *this, BOXINFO_LINE_HORI, bConvert))
+ if (!lcl_setLine(aSeq[0], *this, SvxBoxInfoItemLine::HORI, bConvert))
return false;
- if (!lcl_setLine(aSeq[1], *this, BOXINFO_LINE_VERT, bConvert))
+ if (!lcl_setLine(aSeq[1], *this, SvxBoxInfoItemLine::VERT, bConvert))
return false;
sal_Int16 nFlags( 0 );
@@ -2896,7 +2895,7 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SvxBorderLine aLine;
bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert);
if ( bSet )
- SetLine( &aLine, nMemberId == MID_HORIZONTAL ? BOXINFO_LINE_HORI : BOXINFO_LINE_VERT );
+ SetLine( &aLine, nMemberId == MID_HORIZONTAL ? SvxBoxInfoItemLine::HORI : SvxBoxInfoItemLine::VERT );
break;
}
case MID_FLAGS:
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 36ab605..ac62e58 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1366,22 +1366,22 @@ static void SetBorderLine( int nBorderTyp, SvxBoxItem& rItem,
{
case RTF_BOX: // run through all levels
case RTF_BRDRT:
- rItem.SetLine( &rBorder, BOX_LINE_TOP );
+ rItem.SetLine( &rBorder, SvxBoxItemLine::TOP );
if( RTF_BOX != nBorderTyp )
return;
// fall-through
case RTF_BRDRB:
- rItem.SetLine( &rBorder, BOX_LINE_BOTTOM );
+ rItem.SetLine( &rBorder, SvxBoxItemLine::BOTTOM );
if( RTF_BOX != nBorderTyp )
return;
// fall-through
case RTF_BRDRL:
- rItem.SetLine( &rBorder, BOX_LINE_LEFT );
+ rItem.SetLine( &rBorder, SvxBoxItemLine::LEFT );
if( RTF_BOX != nBorderTyp )
return;
// fall-through
case RTF_BRDRR:
- rItem.SetLine( &rBorder, BOX_LINE_RIGHT );
+ rItem.SetLine( &rBorder, SvxBoxItemLine::RIGHT );
if( RTF_BOX != nBorderTyp )
return;
}
@@ -1525,19 +1525,19 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet,
switch( nBorderTyp )
{
case RTF_BRDRB:
- aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_BOTTOM );
+ aAttr.SetDistance( (sal_uInt16)nTokenValue, SvxBoxItemLine::BOTTOM );
break;
case RTF_BRDRT:
- aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_TOP );
+ aAttr.SetDistance( (sal_uInt16)nTokenValue, SvxBoxItemLine::TOP );
break;
case RTF_BRDRL:
- aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_LEFT );
+ aAttr.SetDistance( (sal_uInt16)nTokenValue, SvxBoxItemLine::LEFT );
break;
case RTF_BRDRR:
- aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_RIGHT );
+ aAttr.SetDistance( (sal_uInt16)nTokenValue, SvxBoxItemLine::RIGHT );
break;
case RTF_BOX:
diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx
index c99ef29..99379f4 100644
--- a/include/editeng/boxitem.hxx
+++ b/include/editeng/boxitem.hxx
@@ -34,11 +34,10 @@
This item describes a border attribute
(all four edges and the inward distance)
*/
-
-#define BOX_LINE_TOP ((sal_uInt16)0)
-#define BOX_LINE_BOTTOM ((sal_uInt16)1)
-#define BOX_LINE_LEFT ((sal_uInt16)2)
-#define BOX_LINE_RIGHT ((sal_uInt16)3)
+enum class SvxBoxItemLine
+{
+ TOP, BOTTOM, LEFT, RIGHT, LAST = RIGHT
+};
/**
This version causes SvxBoxItem to store the 4 cell spacing distances separately
@@ -93,20 +92,20 @@ public:
const editeng::SvxBorderLine* GetLeft() const { return pLeft; }
const editeng::SvxBorderLine* GetRight() const { return pRight; }
- const editeng::SvxBorderLine* GetLine( sal_uInt16 nLine ) const;
+ const editeng::SvxBorderLine* GetLine( SvxBoxItemLine nLine ) const;
//The Pointers are being copied!
- void SetLine( const editeng::SvxBorderLine* pNew, sal_uInt16 nLine );
+ void SetLine( const editeng::SvxBorderLine* pNew, SvxBoxItemLine nLine );
- sal_uInt16 GetDistance( sal_uInt16 nLine ) const;
+ sal_uInt16 GetDistance( SvxBoxItemLine nLine ) const;
sal_uInt16 GetDistance() const;
- void SetDistance( sal_uInt16 nNew, sal_uInt16 nLine );
+ void SetDistance( sal_uInt16 nNew, SvxBoxItemLine nLine );
inline void SetDistance( sal_uInt16 nNew );
// Line width plus Space plus inward distance
// bIgnoreLine = TRUE -> Also return distance, when no Line is set
- sal_uInt16 CalcLineSpace( sal_uInt16 nLine, bool bIgnoreLine = false ) const;
+ sal_uInt16 CalcLineSpace( SvxBoxItemLine nLine, bool bIgnoreLine = false ) const;
static com::sun::star::table::BorderLine2 SvxLineToLine( const editeng::SvxBorderLine* pLine, bool bConvert );
static bool LineToSvxLine(const ::com::sun::star::table::BorderLine& rLine, editeng::SvxBorderLine& rSvxLine, bool bConvert);
static bool LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, editeng::SvxBorderLine& rSvxLine, bool bConvert);
@@ -127,8 +126,10 @@ inline void SvxBoxItem::SetDistance( sal_uInt16 nNew )
transported the borderline for the inner horizontal and vertical lines.
*/
-#define BOXINFO_LINE_HORI ((sal_uInt16)0)
-#define BOXINFO_LINE_VERT ((sal_uInt16)1)
+enum class SvxBoxInfoItemLine
+{
+ HORI, VERT, LAST = VERT
+};
enum class SvxBoxInfoItemValidFlags
{
@@ -181,8 +182,8 @@ public:
SvxBoxInfoItem &operator=( const SvxBoxInfoItem &rCpy );
// "pure virtual Methods" from SfxPoolItem
- virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
- virtual bool GetPresentation( SfxItemPresentation ePres,
+ virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
+ virtual bool GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
@@ -199,22 +200,22 @@ public:
const editeng::SvxBorderLine* GetVert() const { return pVert; }
//The Pointers are being copied!
- void SetLine( const editeng::SvxBorderLine* pNew, sal_uInt16 nLine );
-
- bool IsTable() const { return mbEnableHor && mbEnableVer; }
- void SetTable( bool bNew ) { mbEnableHor = mbEnableVer = bNew; }
-
- inline bool IsHorEnabled() const { return mbEnableHor; }
- inline void EnableHor( bool bEnable ) { mbEnableHor = bEnable; }
- inline bool IsVerEnabled() const { return mbEnableVer; }
- inline void EnableVer( bool bEnable ) { mbEnableVer = bEnable; }
-
- bool IsDist() const { return bDist; }
- void SetDist( bool bNew ) { bDist = bNew; }
- bool IsMinDist() const { return bMinDist; }
- void SetMinDist( bool bNew ) { bMinDist = bNew; }
- sal_uInt16 GetDefDist() const { return nDefDist; }
- void SetDefDist( sal_uInt16 nNew ) { nDefDist = nNew; }
+ void SetLine( const editeng::SvxBorderLine* pNew, SvxBoxInfoItemLine nLine );
+
+ bool IsTable() const { return mbEnableHor && mbEnableVer; }
+ void SetTable( bool bNew ) { mbEnableHor = mbEnableVer = bNew; }
+
+ inline bool IsHorEnabled() const { return mbEnableHor; }
+ inline void EnableHor( bool bEnable ) { mbEnableHor = bEnable; }
+ inline bool IsVerEnabled() const { return mbEnableVer; }
+ inline void EnableVer( bool bEnable ) { mbEnableVer = bEnable; }
+
+ bool IsDist() const { return bDist; }
+ void SetDist( bool bNew ) { bDist = bNew; }
+ bool IsMinDist() const { return bMinDist; }
+ void SetMinDist( bool bNew ) { bMinDist = bNew; }
+ sal_uInt16 GetDefDist() const { return nDefDist; }
+ void SetDefDist( sal_uInt16 nNew ) { nDefDist = nNew; }
bool IsValid( SvxBoxInfoItemValidFlags nValid ) const
{ return bool( nValidFlags & nValid ); }
diff --git a/include/o3tl/enumarray.hxx b/include/o3tl/enumarray.hxx
new file mode 100644
index 0000000..89f7e16
--- /dev/null
+++ b/include/o3tl/enumarray.hxx
@@ -0,0 +1,107 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_O3TL_ENUMARRAY_HXX
+#define INCLUDED_O3TL_ENUMARRAY_HXX
+
+#include <sal/config.h>
+#include <initializer_list>
+#include <iterator>
+
+namespace o3tl {
+
+template<typename EA>
+class enumarray_iterator;
+
+///
+/// This is a container convenience class for arrays indexed by enum values.
+///
+/// This assumes that the 'enum class' definition
+/// - starts at zero
+/// - has no holes in it's sequence of values
+/// - defines a value called LAST which refers to the greatest constant.
+///
+/// \param E the 'enum class' type.
+/// \param V the value type to be stored in the array
+template<typename E, typename V>
+class enumarray SAL_FINAL
+{
+public:
+ typedef enumarray<E, V> self_type;
+ typedef enumarray_iterator<self_type> iterator;
+
+ typedef V value_type;
+ typedef E key_type;
+ typedef size_t size_type;
+
+ static const size_type max_index = static_cast<size_type>(E::LAST);
+
+ /** Create an enumarray with the given elements.
+
+ @param init an initializer_list
+ */
+ enumarray(std::initializer_list<V> init)
+ { std::copy(init.begin(), init.end(), std::begin(values)); }
+
+ enumarray() {}
+
+ const V operator[](E index) const
+ {
+ assert(index>=static_cast<E>(0) && index<=E::LAST);
+ return values[static_cast<size_type>(index)];
+ }
+
+ V& operator[](E index)
+ {
+ assert(index>=static_cast<E>(0) && index<=E::LAST);
+ return values[static_cast<size_type>(index)];
+ }
+
+ void fill(V val)
+ { for (size_type i=0; i<=max_index; ++i) values[i] = val; }
+
+ size_type size() const { return max_index + 1; }
+ iterator begin() { return iterator(this, 0); }
+ iterator end() { return iterator(this, size()); }
+private:
+ V values[max_index + 1];
+};
+
+
+template<typename EA>
+class enumarray_iterator {
+ EA &m_buf;
+ size_t m_pos;
+public:
+ typedef enumarray_iterator<EA> self_type;
+ typedef typename EA::value_type value_type;
+ typedef typename EA::key_type key_type;
+
+ enumarray_iterator(EA& b, size_t start_pos)
+ : m_buf(b), m_pos(start_pos) {}
+ value_type &operator*() { return m_buf[static_cast<key_type>(m_pos)]; }
+ value_type *operator->() { return &(operator*()); }
+ self_type &operator++() { ++m_pos; return *this; }
+};
+
+}; // namespace o3tl
+
+#endif /* INCLUDED_O3TL_ENUMARRAY_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/o3tl/enumrange.hxx b/include/o3tl/enumrange.hxx
new file mode 100644
index 0000000..b127daf
--- /dev/null
+++ b/include/o3tl/enumrange.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_O3TL_ENUMRANGE_HXX
+#define INCLUDED_O3TL_ENUMRANGE_HXX
+
+#include <sal/config.h>
+
+namespace o3tl {
+
+///
+/// This is a container convenience class iterating over scoped enumerations.
+///
+/// This assumes that the 'enum class' definition
+/// - starts at zero
+/// - has no holes in it's sequence of values
+/// - defines a value called LAST which refers to the greatest constant.
+///
+/// Use like this:
+/// enum class COLOR { RED, GREEN, BLUE, LAST=BLUE };
+/// for( auto e : o3tl::enumrange<Color>() )
+/// .....;
+///
+/// \param T the 'enum class' type.
+template< typename T>
+class enumrange
+{
+public:
+ class Iterator
+ {
+ public:
+ Iterator( int value ) :
+ m_value( value )
+ { }
+
+ T operator*( void ) const
+ {
+ return (T)m_value;
+ }
+
+ void operator++( void )
+ {
+ ++m_value;
+ }
+
+ bool operator!=( Iterator rhs )
+ {
+ return m_value != rhs.m_value;
+ }
+
+ private:
+ int m_value;
+ };
+
+};
+
+template< typename T >
+typename enumrange<T>::Iterator begin( enumrange<T> )
+{
+ return typename enumrange<T>::Iterator( (int)0 );
+}
+
+template< typename T >
+typename enumrange<T>::Iterator end( enumrange<T> )
+{
+ return typename enumrange<T>::Iterator( ((int)T::LAST) + 1 );
+}
+
+
+}; // namespace o3tl
+
+#endif /* INCLUDED_O3TL_ENUMRANGE_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 195be8f..a80eaca 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2225,8 +2225,8 @@ void Test::testDataArea()
// Now, set borders in some cells....
::editeng::SvxBorderLine aLine(NULL, 50, table::BorderLineStyle::SOLID);
SvxBoxItem aBorderItem(ATTR_BORDER);
- aBorderItem.SetLine(&aLine, BOX_LINE_LEFT);
- aBorderItem.SetLine(&aLine, BOX_LINE_RIGHT);
+ aBorderItem.SetLine(&aLine, SvxBoxItemLine::LEFT);
+ aBorderItem.SetLine(&aLine, SvxBoxItemLine::RIGHT);
for (SCROW i = 0; i < 100; ++i)
// Set borders from row 1 to 100.
m_pDoc->ApplyAttr(0, i, 0, aBorderItem);
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index fcba8d9..216ede6 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -695,10 +695,10 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
{
if( pNewBoxItem )
{
- if ( pNewBoxItem->GetTop() ) pNewBoxItem->SetLine( NULL, BOX_LINE_TOP );
- if ( pNewBoxItem->GetBottom() ) pNewBoxItem->SetLine( NULL, BOX_LINE_BOTTOM );
- if ( pNewBoxItem->GetLeft() ) pNewBoxItem->SetLine( NULL, BOX_LINE_LEFT );
- if ( pNewBoxItem->GetRight() ) pNewBoxItem->SetLine( NULL, BOX_LINE_RIGHT );
+ if ( pNewBoxItem->GetTop() ) pNewBoxItem->SetLine( NULL, SvxBoxItemLine::TOP );
+ if ( pNewBoxItem->GetBottom() ) pNewBoxItem->SetLine( NULL, SvxBoxItemLine::BOTTOM );
+ if ( pNewBoxItem->GetLeft() ) pNewBoxItem->SetLine( NULL, SvxBoxItemLine::LEFT );
+ if ( pNewBoxItem->GetRight() ) pNewBoxItem->SetLine( NULL, SvxBoxItemLine::RIGHT );
}
if( pNewTLBRItem && pNewTLBRItem->GetLine() )
pNewTLBRItem->SetLine( 0 );
@@ -1006,45 +1006,45 @@ static void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner
if (bTop)
{
if (lcl_TestAttr( pLineOuter->GetTop(), pTopAttr, rFlags.nTop, pNew ))
- pLineOuter->SetLine( pNew, BOX_LINE_TOP );
+ pLineOuter->SetLine( pNew, SvxBoxItemLine::TOP );
}
else
{
if (lcl_TestAttr( pLineInner->GetHori(), pTopAttr, rFlags.nHori, pNew ))
- pLineInner->SetLine( pNew, BOXINFO_LINE_HORI );
+ pLineInner->SetLine( pNew, SvxBoxInfoItemLine::HORI );
}
if (nDistBottom == 0)
{
if (lcl_TestAttr( pLineOuter->GetBottom(), pBottomAttr, rFlags.nBottom, pNew ))
- pLineOuter->SetLine( pNew, BOX_LINE_BOTTOM );
+ pLineOuter->SetLine( pNew, SvxBoxItemLine::BOTTOM );
}
else
{
if (lcl_TestAttr( pLineInner->GetHori(), pBottomAttr, rFlags.nHori, pNew ))
- pLineInner->SetLine( pNew, BOXINFO_LINE_HORI );
+ pLineInner->SetLine( pNew, SvxBoxInfoItemLine::HORI );
}
if (bLeft)
{
if (lcl_TestAttr( pLineOuter->GetLeft(), pLeftAttr, rFlags.nLeft, pNew ))
- pLineOuter->SetLine( pNew, BOX_LINE_LEFT );
+ pLineOuter->SetLine( pNew, SvxBoxItemLine::LEFT );
}
else
{
if (lcl_TestAttr( pLineInner->GetVert(), pLeftAttr, rFlags.nVert, pNew ))
- pLineInner->SetLine( pNew, BOXINFO_LINE_VERT );
+ pLineInner->SetLine( pNew, SvxBoxInfoItemLine::VERT );
}
if (nDistRight == 0)
{
if (lcl_TestAttr( pLineOuter->GetRight(), pRightAttr, rFlags.nRight, pNew ))
- pLineOuter->SetLine( pNew, BOX_LINE_RIGHT );
+ pLineOuter->SetLine( pNew, SvxBoxItemLine::RIGHT );
}
else
{
if (lcl_TestAttr( pLineInner->GetVert(), pRightAttr, rFlags.nVert, pNew ))
- pLineInner->SetLine( pNew, BOXINFO_LINE_VERT );
+ pLineInner->SetLine( pNew, SvxBoxInfoItemLine::VERT );
}
}
@@ -1112,35 +1112,35 @@ bool ScAttrArray::ApplyFrame( const SvxBoxItem* pBoxItem,
if( bLeft && nDistRight==0)
{
if ( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::LEFT) )
- aNewFrame.SetLine( pBoxItem->GetLeft(), BOX_LINE_RIGHT );
+ aNewFrame.SetLine( pBoxItem->GetLeft(), SvxBoxItemLine::RIGHT );
if ( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::RIGHT) )
- aNewFrame.SetLine( pBoxItem->GetRight(), BOX_LINE_LEFT );
+ aNewFrame.SetLine( pBoxItem->GetRight(), SvxBoxItemLine::LEFT );
}
else
{
if ( (nDistRight==0) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::LEFT) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::VERT) )
aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
- BOX_LINE_RIGHT );
+ SvxBoxItemLine::RIGHT );
if ( bLeft ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::RIGHT) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::VERT) )
aNewFrame.SetLine( bLeft ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
- BOX_LINE_LEFT );
+ SvxBoxItemLine::LEFT );
}
}
else
{
if ( bLeft ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::LEFT) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::VERT) )
aNewFrame.SetLine( bLeft ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(),
- BOX_LINE_LEFT );
+ SvxBoxItemLine::LEFT );
if ( (nDistRight==0) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::RIGHT) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::VERT) )
aNewFrame.SetLine( (nDistRight==0) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(),
- BOX_LINE_RIGHT );
+ SvxBoxItemLine::RIGHT );
}
if ( bTop ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::TOP) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::HORI) )
aNewFrame.SetLine( bTop ? pBoxItem->GetTop() : pBoxInfoItem->GetHori(),
- BOX_LINE_TOP );
+ SvxBoxItemLine::TOP );
if ( (nDistBottom==0) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::BOTTOM) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::HORI) )
aNewFrame.SetLine( (nDistBottom==0) ? pBoxItem->GetBottom() : pBoxInfoItem->GetHori(),
- BOX_LINE_BOTTOM );
+ SvxBoxItemLine::BOTTOM );
if (aNewFrame == *pOldFrame)
{
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 501c49f..eba1d98 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -218,8 +218,8 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool)
ATTR_PAGE_ON, ATTR_PAGE_SHARED,
0 );
- pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_HORI);
- pGlobalBorderInnerAttr->SetLine(NULL, BOXINFO_LINE_VERT);
+ pGlobalBorderInnerAttr->SetLine(NULL, SvxBoxInfoItemLine::HORI);
+ pGlobalBorderInnerAttr->SetLine(NULL, SvxBoxInfoItemLine::VERT);
pGlobalBorderInnerAttr->SetTable(true);
pGlobalBorderInnerAttr->SetDist(true);
pGlobalBorderInnerAttr->SetMinDist(false);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 71d56c8..c3a2f8e 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4900,14 +4900,14 @@ void ScDocument::GetSelectionFrame( const ScMarkData& rMark,
SvxBoxItem& rLineOuter,
SvxBoxInfoItem& rLineInner )
{
- rLineOuter.SetLine(NULL, BOX_LINE_TOP);
- rLineOuter.SetLine(NULL, BOX_LINE_BOTTOM);
- rLineOuter.SetLine(NULL, BOX_LINE_LEFT);
- rLineOuter.SetLine(NULL, BOX_LINE_RIGHT);
+ rLineOuter.SetLine(NULL, SvxBoxItemLine::TOP);
+ rLineOuter.SetLine(NULL, SvxBoxItemLine::BOTTOM);
+ rLineOuter.SetLine(NULL, SvxBoxItemLine::LEFT);
+ rLineOuter.SetLine(NULL, SvxBoxItemLine::RIGHT);
rLineOuter.SetDistance(0);
- rLineInner.SetLine(NULL, BOXINFO_LINE_HORI);
- rLineInner.SetLine(NULL, BOXINFO_LINE_VERT);
+ rLineInner.SetLine(NULL, SvxBoxInfoItemLine::HORI);
+ rLineInner.SetLine(NULL, SvxBoxInfoItemLine::VERT);
rLineInner.SetTable(true);
rLineInner.SetDist(true);
rLineInner.SetMinDist(false);
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index d0340cb..dee436a 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -240,31 +240,31 @@ void ScDPOutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL
SvxBoxItem aBox( ATTR_BORDER );
if ( nStartCol == mnTabStartCol )
- aBox.SetLine(&aOutLine, BOX_LINE_LEFT);
+ aBox.SetLine(&aOutLine, SvxBoxItemLine::LEFT);
else
- aBox.SetLine(&aLine, BOX_LINE_LEFT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::LEFT);
if ( nStartRow == mnTabStartRow )
- aBox.SetLine(&aOutLine, BOX_LINE_TOP);
+ aBox.SetLine(&aOutLine, SvxBoxItemLine::TOP);
else
- aBox.SetLine(&aLine, BOX_LINE_TOP);
+ aBox.SetLine(&aLine, SvxBoxItemLine::TOP);
if ( nEndCol == mnTabEndCol ) //bottom row
- aBox.SetLine(&aOutLine, BOX_LINE_RIGHT);
+ aBox.SetLine(&aOutLine, SvxBoxItemLine::RIGHT);
else
- aBox.SetLine(&aLine, BOX_LINE_RIGHT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::RIGHT);
if ( nEndRow == mnTabEndRow ) //bottom
- aBox.SetLine(&aOutLine, BOX_LINE_BOTTOM);
+ aBox.SetLine(&aOutLine, SvxBoxItemLine::BOTTOM);
else
- aBox.SetLine(&aLine, BOX_LINE_BOTTOM);
+ aBox.SetLine(&aLine, SvxBoxItemLine::BOTTOM);
SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER );
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT,false );
if ( bHori )
{
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI,true);
- aBoxInfo.SetLine( &aLine, BOXINFO_LINE_HORI );
+ aBoxInfo.SetLine( &aLine, SvxBoxInfoItemLine::HORI );
}
else
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI,false );
@@ -311,10 +311,10 @@ void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab,
{
::editeng::SvxBorderLine aLine(0, nWidth, table::BorderLineStyle::SOLID);
SvxBoxItem aBox( ATTR_BORDER );
- aBox.SetLine(&aLine, BOX_LINE_LEFT);
- aBox.SetLine(&aLine, BOX_LINE_TOP);
- aBox.SetLine(&aLine, BOX_LINE_RIGHT);
- aBox.SetLine(&aLine, BOX_LINE_BOTTOM);
+ aBox.SetLine(&aLine, SvxBoxItemLine::LEFT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::TOP);
+ aBox.SetLine(&aLine, SvxBoxItemLine::RIGHT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::BOTTOM);
SvxBoxInfoItem aBoxInfo( ATTR_BORDER_INNER );
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI,false);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT,false);
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 3a02702..7788fa3 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -368,10 +368,10 @@ void ScStyleSheetPool::CreateStandardStyles()
pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_PAGE_REP );
// Background and border
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_TOP );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_BOTTOM );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_LEFT );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_RIGHT );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::TOP );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::BOTTOM );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::LEFT );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::RIGHT );
aBoxItem.SetDistance( 10 ); // 0.2mm
aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::TOP, true );
aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, true );
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 6e067bf..660a776 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -881,14 +881,14 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if ( rOldBox.GetTop() || rOldBox.GetBottom() || rOldBox.GetLeft() || rOldBox.GetRight() )
{
SvxBoxItem aNew( ATTR_BORDER );
- aNew.SetLine( rOldBox.GetLine( BOX_LINE_TOP ), BOX_LINE_LEFT );
- aNew.SetLine( rOldBox.GetLine( BOX_LINE_LEFT ), BOX_LINE_TOP );
- aNew.SetLine( rOldBox.GetLine( BOX_LINE_BOTTOM ), BOX_LINE_RIGHT );
- aNew.SetLine( rOldBox.GetLine( BOX_LINE_RIGHT ), BOX_LINE_BOTTOM );
- aNew.SetDistance( rOldBox.GetDistance( BOX_LINE_TOP ), BOX_LINE_LEFT );
- aNew.SetDistance( rOldBox.GetDistance( BOX_LINE_LEFT ), BOX_LINE_TOP );
- aNew.SetDistance( rOldBox.GetDistance( BOX_LINE_BOTTOM ), BOX_LINE_RIGHT );
- aNew.SetDistance( rOldBox.GetDistance( BOX_LINE_RIGHT ), BOX_LINE_BOTTOM );
+ aNew.SetLine( rOldBox.GetLine( SvxBoxItemLine::TOP ), SvxBoxItemLine::LEFT );
+ aNew.SetLine( rOldBox.GetLine( SvxBoxItemLine::LEFT ), SvxBoxItemLine::TOP );
+ aNew.SetLine( rOldBox.GetLine( SvxBoxItemLine::BOTTOM ), SvxBoxItemLine::RIGHT );
+ aNew.SetLine( rOldBox.GetLine( SvxBoxItemLine::RIGHT ), SvxBoxItemLine::BOTTOM );
+ aNew.SetDistance( rOldBox.GetDistance( SvxBoxItemLine::TOP ), SvxBoxItemLine::LEFT );
+ aNew.SetDistance( rOldBox.GetDistance( SvxBoxItemLine::LEFT ), SvxBoxItemLine::TOP );
+ aNew.SetDistance( rOldBox.GetDistance( SvxBoxItemLine::BOTTOM ), SvxBoxItemLine::RIGHT );
+ aNew.SetDistance( rOldBox.GetDistance( SvxBoxItemLine::RIGHT ), SvxBoxItemLine::BOTTOM );
rNewSet.Put( aNew );
}
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 7c60850..c82469b 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -2021,48 +2021,48 @@ void ScTable::GetAutoFormatFrame(SCCOL nCol, SCROW nRow, sal_uInt16 nFlags, sal_
if (pLeftBox)
{
if (ScHasPriority(pTheBox->GetLeft(), pLeftBox->GetRight()))
- aBox.SetLine(pTheBox->GetLeft(), BOX_LINE_LEFT);
+ aBox.SetLine(pTheBox->GetLeft(), SvxBoxItemLine::LEFT);
else
- aBox.SetLine(pLeftBox->GetRight(), BOX_LINE_LEFT);
+ aBox.SetLine(pLeftBox->GetRight(), SvxBoxItemLine::LEFT);
}
else
- aBox.SetLine(pTheBox->GetLeft(), BOX_LINE_LEFT);
+ aBox.SetLine(pTheBox->GetLeft(), SvxBoxItemLine::LEFT);
}
if (nFlags & LF_TOP)
{
if (pTopBox)
{
if (ScHasPriority(pTheBox->GetTop(), pTopBox->GetBottom()))
- aBox.SetLine(pTheBox->GetTop(), BOX_LINE_TOP);
+ aBox.SetLine(pTheBox->GetTop(), SvxBoxItemLine::TOP);
else
- aBox.SetLine(pTopBox->GetBottom(), BOX_LINE_TOP);
+ aBox.SetLine(pTopBox->GetBottom(), SvxBoxItemLine::TOP);
}
else
- aBox.SetLine(pTheBox->GetTop(), BOX_LINE_TOP);
+ aBox.SetLine(pTheBox->GetTop(), SvxBoxItemLine::TOP);
}
if (nFlags & LF_RIGHT)
{
if (pRightBox)
{
if (ScHasPriority(pTheBox->GetRight(), pRightBox->GetLeft()))
- aBox.SetLine(pTheBox->GetRight(), BOX_LINE_RIGHT);
+ aBox.SetLine(pTheBox->GetRight(), SvxBoxItemLine::RIGHT);
else
- aBox.SetLine(pRightBox->GetLeft(), BOX_LINE_RIGHT);
+ aBox.SetLine(pRightBox->GetLeft(), SvxBoxItemLine::RIGHT);
}
else
- aBox.SetLine(pTheBox->GetRight(), BOX_LINE_RIGHT);
+ aBox.SetLine(pTheBox->GetRight(), SvxBoxItemLine::RIGHT);
}
if (nFlags & LF_BOTTOM)
{
if (pBottomBox)
{
if (ScHasPriority(pTheBox->GetBottom(), pBottomBox->GetTop()))
- aBox.SetLine(pTheBox->GetBottom(), BOX_LINE_BOTTOM);
+ aBox.SetLine(pTheBox->GetBottom(), SvxBoxItemLine::BOTTOM);
else
- aBox.SetLine(pBottomBox->GetTop(), BOX_LINE_BOTTOM);
+ aBox.SetLine(pBottomBox->GetTop(), SvxBoxItemLine::BOTTOM);
}
else
- aBox.SetLine(pTheBox->GetBottom(), BOX_LINE_BOTTOM);
+ aBox.SetLine(pTheBox->GetBottom(), SvxBoxItemLine::BOTTOM);
}
rData.PutItem( nIndex, aBox );
}
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index a6c5e3f..6d69934 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -845,10 +845,10 @@ ScAutoFormat::ScAutoFormat() :
Color aBlack( COL_BLACK );
::editeng::SvxBorderLine aLine( &aBlack, DEF_LINE_WIDTH_0 );
SvxBoxItem aBox( ATTR_BORDER );
- aBox.SetLine(&aLine, BOX_LINE_LEFT);
- aBox.SetLine(&aLine, BOX_LINE_TOP);
- aBox.SetLine(&aLine, BOX_LINE_RIGHT);
- aBox.SetLine(&aLine, BOX_LINE_BOTTOM);
+ aBox.SetLine(&aLine, SvxBoxItemLine::LEFT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::TOP);
+ aBox.SetLine(&aLine, SvxBoxItemLine::RIGHT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::BOTTOM);
Color aWhite(COL_WHITE);
Color aBlue(COL_BLUE);
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 56d9936..3934935 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -973,13 +973,13 @@ void XclImpCellBorder::FillToItemSet( SfxItemSet& rItemSet, const XclImpPalette&
SvxBoxItem aBoxItem( ATTR_BORDER );
::editeng::SvxBorderLine aLine;
if( mbLeftUsed && lclConvertBorderLine( aLine, rPalette, mnLeftLine, mnLeftColor ) )
- aBoxItem.SetLine( &aLine, BOX_LINE_LEFT );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::LEFT );
if( mbRightUsed && lclConvertBorderLine( aLine, rPalette, mnRightLine, mnRightColor ) )
- aBoxItem.SetLine( &aLine, BOX_LINE_RIGHT );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::RIGHT );
if( mbTopUsed && lclConvertBorderLine( aLine, rPalette, mnTopLine, mnTopColor ) )
- aBoxItem.SetLine( &aLine, BOX_LINE_TOP );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::TOP );
if( mbBottomUsed && lclConvertBorderLine( aLine, rPalette, mnBottomLine, mnBottomColor ) )
- aBoxItem.SetLine( &aLine, BOX_LINE_BOTTOM );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
ScfTools::PutItem( rItemSet, aBoxItem, bSkipPoolDefs );
}
if( mbDiagUsed )
@@ -1954,10 +1954,10 @@ void XclImpXFRangeBuffer::SetColumnDefXF( SCCOL nScCol, sal_uInt16 nXFIndex )
maColumns[ nIndex ]->SetDefaultXF( XclImpXFIndex( nXFIndex ) );
}
-void XclImpXFRangeBuffer::SetBorderLine( const ScRange& rRange, SCTAB nScTab, sal_uInt16 nLine )
+void XclImpXFRangeBuffer::SetBorderLine( const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine )
{
- SCCOL nFromScCol = (nLine == BOX_LINE_RIGHT) ? rRange.aEnd.Col() : rRange.aStart.Col();
- SCROW nFromScRow = (nLine == BOX_LINE_BOTTOM) ? rRange.aEnd.Row() : rRange.aStart.Row();
+ SCCOL nFromScCol = (nLine == SvxBoxItemLine::RIGHT) ? rRange.aEnd.Col() : rRange.aStart.Col();
+ SCROW nFromScRow = (nLine == SvxBoxItemLine::BOTTOM) ? rRange.aEnd.Row() : rRange.aStart.Row();
ScDocument& rDoc = GetDoc();
const SvxBoxItem* pFromItem = static_cast< const SvxBoxItem* >(
@@ -2052,10 +2052,10 @@ void XclImpXFRangeBuffer::Finalize()
bool bMultiRow = rStart.Row() != rEnd.Row();
// set correct right border
if( bMultiCol )
- SetBorderLine( *pRange, nScTab, BOX_LINE_RIGHT );
+ SetBorderLine( *pRange, nScTab, SvxBoxItemLine::RIGHT );
// set correct lower border
if( bMultiRow )
- SetBorderLine( *pRange, nScTab, BOX_LINE_BOTTOM );
+ SetBorderLine( *pRange, nScTab, SvxBoxItemLine::BOTTOM );
// do merge
if( bMultiCol || bMultiRow )
rDoc.getDoc().DoMerge( nScTab, rStart.Col(), rStart.Row(), rEnd.Col(), rEnd.Row() );
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 24d6df0..6e4cc37 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -148,13 +148,13 @@ void ScHTMLImport::WriteToDocument(
{
const SvxBoxItem* pFromItem = static_cast<const SvxBoxItem*>(
mpDoc->GetAttr( pEntry->nCol + nColMerge - 1, pEntry->nRow, nTab, ATTR_BORDER ) );
- aNewItem.SetLine( pFromItem->GetLine( BOX_LINE_RIGHT ), BOX_LINE_RIGHT );
+ aNewItem.SetLine( pFromItem->GetLine( SvxBoxItemLine::RIGHT ), SvxBoxItemLine::RIGHT );
}
if( nRowMerge > 1 )
{
const SvxBoxItem* pFromItem = static_cast<const SvxBoxItem*>(
mpDoc->GetAttr( pEntry->nCol, pEntry->nRow + nRowMerge - 1, nTab, ATTR_BORDER ) );
- aNewItem.SetLine( pFromItem->GetLine( BOX_LINE_BOTTOM ), BOX_LINE_BOTTOM );
+ aNewItem.SetLine( pFromItem->GetLine( SvxBoxItemLine::BOTTOM ), SvxBoxItemLine::BOTTOM );
}
mpDoc->ApplyAttr( pEntry->nCol, pEntry->nRow, nTab, aNewItem );
}
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 60cda85..fd390dd 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -2329,12 +2329,12 @@ void ScHTMLTable::ApplyCellBorders( ScDocument* pDoc, const ScAddress& rFirstPos
SCROW nCellRow2 = nCellRow1 + GetDocSize( tdRow, nRow ) - 1;
for( SCCOL nCellCol = nCellCol1; nCellCol <= nCellCol2; ++nCellCol )
{
- aBorderItem.SetLine( (nCellCol == nCellCol1) ? pLeftLine : 0, BOX_LINE_LEFT );
- aBorderItem.SetLine( (nCellCol == nCellCol2) ? pRightLine : 0, BOX_LINE_RIGHT );
+ aBorderItem.SetLine( (nCellCol == nCellCol1) ? pLeftLine : 0, SvxBoxItemLine::LEFT );
+ aBorderItem.SetLine( (nCellCol == nCellCol2) ? pRightLine : 0, SvxBoxItemLine::RIGHT );
for( SCROW nCellRow = nCellRow1; nCellRow <= nCellRow2; ++nCellRow )
{
- aBorderItem.SetLine( (nCellRow == nCellRow1) ? pTopLine : 0, BOX_LINE_TOP );
- aBorderItem.SetLine( (nCellRow == nCellRow2) ? pBottomLine : 0, BOX_LINE_BOTTOM );
+ aBorderItem.SetLine( (nCellRow == nCellRow1) ? pTopLine : 0, SvxBoxItemLine::TOP );
+ aBorderItem.SetLine( (nCellRow == nCellRow2) ? pBottomLine : 0, SvxBoxItemLine::BOTTOM );
pDoc->ApplyAttr( nCellCol, nCellRow, rFirstPos.Tab(), aBorderItem );
}
}
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index dd08823..2b69c1b 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -32,6 +32,7 @@
#include "xiroot.hxx"
struct ScAttrEntry;
+enum class SvxBoxItemLine;
/* ============================================================================
- Buffers for style records (PALETTE, FONT, FORMAT, XF)
@@ -648,9 +649,9 @@ private:
/** Copies border of the last cell of the range to the first cell to keep it visible
when the range is merged.
@param nLine
- BOX_LINE_RIGHT = copy most-right border of top row;
- BOX_LINE_BOTTOM = copy most-bottom border of first column. */
- void SetBorderLine( const ScRange& rRange, SCTAB nScTab, sal_uInt16 nLine );
+ SvxBoxItemLine::RIGHT = copy most-right border of top row;
+ SvxBoxItemLine::BOTTOM = copy most-bottom border of first column. */
+ void SetBorderLine( const ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine );
private:
typedef boost::shared_ptr< XclImpXFRangeColumn > XclImpXFRangeColumnRef;
diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx
index ec10712..9444d9c 100644
--- a/sc/source/filter/lotus/lotattr.cxx
+++ b/sc/source/filter/lotus/lotattr.cxx
@@ -119,10 +119,10 @@ const ScPatternAttr& LotAttrCache::GetPattAttr( const LotAttrWK3& rAttr )
nLine >>= 2;
LotusToScBorderLine( nLine, aBottom );
- aBox.SetLine( &aTop, BOX_LINE_TOP );
- aBox.SetLine( &aLeft, BOX_LINE_LEFT );
- aBox.SetLine( &aBottom, BOX_LINE_BOTTOM );
- aBox.SetLine( &aRight, BOX_LINE_RIGHT );
+ aBox.SetLine( &aTop, SvxBoxItemLine::TOP );
+ aBox.SetLine( &aLeft, SvxBoxItemLine::LEFT );
+ aBox.SetLine( &aBottom, SvxBoxItemLine::BOTTOM );
+ aBox.SetLine( &aRight, SvxBoxItemLine::RIGHT );
rItemSet.Put( aBox );
}
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 58fc26a..812eee1 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -719,10 +719,10 @@ void SheetDataBuffer::setCellFormat( const CellModel& rModel, sal_Int32 nNumFmtI
}
}
-void lcl_SetBorderLine( ScDocument& rDoc, ScRange& rRange, SCTAB nScTab, sal_uInt16 nLine )
+void lcl_SetBorderLine( ScDocument& rDoc, ScRange& rRange, SCTAB nScTab, SvxBoxItemLine nLine )
{
- SCCOL nFromScCol = (nLine == BOX_LINE_RIGHT) ? rRange.aEnd.Col() : rRange.aStart.Col();
- SCROW nFromScRow = (nLine == BOX_LINE_BOTTOM) ? rRange.aEnd.Row() : rRange.aStart.Row();
+ SCCOL nFromScCol = (nLine == SvxBoxItemLine::RIGHT) ? rRange.aEnd.Col() : rRange.aStart.Col();
+ SCROW nFromScRow = (nLine == SvxBoxItemLine::BOTTOM) ? rRange.aEnd.Row() : rRange.aStart.Row();
const SvxBoxItem* pFromItem = static_cast< const SvxBoxItem* >(
rDoc.GetAttr( nFromScCol, nFromScRow, nScTab, ATTR_BORDER ) );
@@ -746,10 +746,10 @@ void SheetDataBuffer::applyCellMerging( const CellRangeAddress& rRange )
ScDocument& rDoc = getScDocument();
// set correct right border
if( bMultiCol )
- lcl_SetBorderLine( rDoc, aRange, getSheetIndex(), BOX_LINE_RIGHT );
+ lcl_SetBorderLine( rDoc, aRange, getSheetIndex(), SvxBoxItemLine::RIGHT );
// set correct lower border
if( bMultiRow )
- lcl_SetBorderLine( rDoc, aRange, getSheetIndex(), BOX_LINE_BOTTOM );
+ lcl_SetBorderLine( rDoc, aRange, getSheetIndex(), SvxBoxItemLine::BOTTOM );
// do merge
if( bMultiCol || bMultiRow )
rDoc.DoMerge( getSheetIndex(), rStart.Col(), rStart.Row(), rEnd.Col(), rEnd.Row() );
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 7cf7158..39995a1 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1601,19 +1601,19 @@ void Border::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
if (SvxBoxItem::LineToSvxLine(maApiData.maLeft, aLine, false))
{
- aBoxItem.SetLine( &aLine, BOX_LINE_LEFT );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::LEFT );
}
if (SvxBoxItem::LineToSvxLine(maApiData.maRight, aLine, false))
{
- aBoxItem.SetLine( &aLine, BOX_LINE_RIGHT );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::RIGHT );
}
if (SvxBoxItem::LineToSvxLine(maApiData.maTop, aLine, false))
{
- aBoxItem.SetLine( &aLine, BOX_LINE_TOP );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::TOP );
}
if (SvxBoxItem::LineToSvxLine(maApiData.maBottom, aLine, false))
{
- aBoxItem.SetLine( &aLine, BOX_LINE_BOTTOM );
+ aBoxItem.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
}
ScfTools::PutItem( rItemSet, aBoxItem, bSkipPoolDefs );
}
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 791ec6a..682eb20 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -832,16 +832,16 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
SvxBoxItem aBox( ATTR_BORDER );
aLine.SetWidth(nLeft);
aLine.SetColor(ColorLeft);
- aBox.SetLine(&aLine, BOX_LINE_LEFT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::LEFT);
aLine.SetWidth(nTop);
aLine.SetColor(ColorTop);
- aBox.SetLine(&aLine, BOX_LINE_TOP);
+ aBox.SetLine(&aLine, SvxBoxItemLine::TOP);
aLine.SetWidth(nRight);
aLine.SetColor(ColorRight);
- aBox.SetLine(&aLine, BOX_LINE_RIGHT);
+ aBox.SetLine(&aLine, SvxBoxItemLine::RIGHT);
aLine.SetWidth(nBottom);
aLine.SetColor(ColorBottom);
- aBox.SetLine(&aLine, BOX_LINE_BOTTOM);
+ aBox.SetLine(&aLine, SvxBoxItemLine::BOTTOM);
aSetItemItemSet.Put(aBox);
}
@@ -1256,16 +1256,16 @@ void Sc10Import::LoadPatternCollection()
aLine.SetWidth( nLeft );
aLine.SetColor( ColorLeft );
- aBox.SetLine( &aLine, BOX_LINE_LEFT );
+ aBox.SetLine( &aLine, SvxBoxItemLine::LEFT );
aLine.SetWidth( nTop );
aLine.SetColor( ColorTop );
- aBox.SetLine( &aLine, BOX_LINE_TOP );
+ aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
aLine.SetWidth( nRight );
aLine.SetColor( ColorRight );
- aBox.SetLine( &aLine, BOX_LINE_RIGHT );
+ aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
aLine.SetWidth( nBottom );
aLine.SetColor( ColorBottom );
- aBox.SetLine( &aLine, BOX_LINE_BOTTOM );
+ aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
rItemSet.Put( aBox );
}
}
@@ -1936,19 +1936,19 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
aLine.SetWidth( nLeft );
aLine.SetColor( ColorLeft );
- aBox.SetLine( &aLine, BOX_LINE_LEFT );
+ aBox.SetLine( &aLine, SvxBoxItemLine::LEFT );
aLine.SetWidth( nTop );
aLine.SetColor( ColorTop );
- aBox.SetLine( &aLine, BOX_LINE_TOP );
+ aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
aLine.SetWidth( nRight );
aLine.SetColor( ColorRight );
- aBox.SetLine( &aLine, BOX_LINE_RIGHT );
+ aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
aLine.SetWidth( nBottom );
aLine.SetColor( ColorBottom );
- aBox.SetLine( &aLine, BOX_LINE_BOTTOM );
+ aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
aScPattern.GetItemSet().Put( aBox );
pDoc->ApplyPatternAreaTab( Col, nStart, Col, nEnd, Tab, aScPattern );
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 17a28ae..5fad23d 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -160,8 +160,8 @@ IMPL_LINK(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox)
break;
case TBI_BORDER1_ALL:
pLeft = pRight = pTop = pBottom = &theDefLine;
- aBorderInner.SetLine( &theDefLine, BOXINFO_LINE_HORI );
- aBorderInner.SetLine( &theDefLine, BOXINFO_LINE_VERT );
+ aBorderInner.SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
+ aBorderInner.SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
nValidFlags |= FRM_VALID_ALL;
break;
case TBI_BORDER1_OUTER:
@@ -175,10 +175,10 @@ IMPL_LINK(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox)
break;
}
- aBorderOuter.SetLine( pLeft, BOX_LINE_LEFT );
- aBorderOuter.SetLine( pRight, BOX_LINE_RIGHT );
- aBorderOuter.SetLine( pTop, BOX_LINE_TOP );
- aBorderOuter.SetLine( pBottom, BOX_LINE_BOTTOM );
+ aBorderOuter.SetLine( pLeft, SvxBoxItemLine::LEFT );
+ aBorderOuter.SetLine( pRight, SvxBoxItemLine::RIGHT );
+ aBorderOuter.SetLine( pTop, SvxBoxItemLine::TOP );
+ aBorderOuter.SetLine( pBottom, SvxBoxItemLine::BOTTOM );
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::TOP, 0 != (nValidFlags&FRM_VALID_TOP ));
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM ));
@@ -244,10 +244,10 @@ IMPL_LINK(CellBorderStyleControl, TB2SelectHdl, ToolBox *, pToolBox)
nValidFlags |= FRM_VALID_RIGHT|FRM_VALID_LEFT;
break;
}
- aBorderOuter.SetLine( pLeft, BOX_LINE_LEFT );
- aBorderOuter.SetLine( pRight, BOX_LINE_RIGHT );
- aBorderOuter.SetLine( pTop, BOX_LINE_TOP );
- aBorderOuter.SetLine( pBottom, BOX_LINE_BOTTOM );
+ aBorderOuter.SetLine( pLeft, SvxBoxItemLine::LEFT );
+ aBorderOuter.SetLine( pRight, SvxBoxItemLine::RIGHT );
+ aBorderOuter.SetLine( pTop, SvxBoxItemLine::TOP );
+ aBorderOuter.SetLine( pBottom, SvxBoxItemLine::BOTTOM );
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::TOP, 0 != (nValidFlags&FRM_VALID_TOP ));
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM ));
@@ -316,10 +316,10 @@ IMPL_LINK(CellBorderStyleControl, TB3SelectHdl, ToolBox *, pToolBox)
break;
}
- aBorderOuter.SetLine( pTop.get(), BOX_LINE_TOP );
- aBorderOuter.SetLine( pBottom.get(), BOX_LINE_BOTTOM );
- aBorderOuter.SetLine( NULL, BOX_LINE_LEFT );
- aBorderOuter.SetLine( NULL, BOX_LINE_RIGHT );
+ aBorderOuter.SetLine( pTop.get(), SvxBoxItemLine::TOP );
+ aBorderOuter.SetLine( pBottom.get(), SvxBoxItemLine::BOTTOM );
+ aBorderOuter.SetLine( NULL, SvxBoxItemLine::LEFT );
+ aBorderOuter.SetLine( NULL, SvxBoxItemLine::RIGHT );
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::TOP, 0 != (nValidFlags&FRM_VALID_TOP ));
aBorderInner.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, 0 != (nValidFlags&FRM_VALID_BOTTOM ));
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 9b6adf2..7a7d4f5 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -963,12 +963,12 @@ void lcl_fillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const TableBo
{
::editeng::SvxBorderLine aLine;
rOuter.SetDistance( static_cast<sal_uInt16>(HMMToTwips( rBorder.Distance )) );
- rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.TopLine ), BOX_LINE_TOP );
- rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.BottomLine ), BOX_LINE_BOTTOM );
- rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.LeftLine ), BOX_LINE_LEFT );
- rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.RightLine ), BOX_LINE_RIGHT );
- rInner.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.HorizontalLine ), BOXINFO_LINE_HORI );
- rInner.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.VerticalLine ), BOXINFO_LINE_VERT );
+ rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.TopLine ), SvxBoxItemLine::TOP );
+ rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.BottomLine ), SvxBoxItemLine::BOTTOM );
+ rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.LeftLine ), SvxBoxItemLine::LEFT );
+ rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.RightLine ), SvxBoxItemLine::RIGHT );
+ rInner.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.HorizontalLine ), SvxBoxInfoItemLine::HORI );
+ rInner.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.VerticalLine ), SvxBoxInfoItemLine::VERT );
rInner.SetValid( SvxBoxInfoItemValidFlags::TOP, rBorder.IsTopLineValid );
rInner.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, rBorder.IsBottomLineValid );
rInner.SetValid( SvxBoxInfoItemValidFlags::LEFT, rBorder.IsLeftLineValid );
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 96c6649..706b0da 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1799,13 +1799,13 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
// -> Substitute existing lines with pDefLine only if widths are 0.
SvxBoxItem aBoxItem ( *static_cast<const SvxBoxItem*>(pItem ));
if ( aBoxItem.GetTop() && aBoxItem.GetTop()->GetOutWidth() == 0 )
- aBoxItem.SetLine( pDefLine, BOX_LINE_TOP );
+ aBoxItem.SetLine( pDefLine, SvxBoxItemLine::TOP );
if ( aBoxItem.GetBottom() && aBoxItem.GetBottom()->GetOutWidth() == 0 )
- aBoxItem.SetLine( pDefLine, BOX_LINE_BOTTOM );
+ aBoxItem.SetLine( pDefLine, SvxBoxItemLine::BOTTOM );
if ( aBoxItem.GetLeft() && aBoxItem.GetLeft()->GetOutWidth() == 0 )
- aBoxItem.SetLine( pDefLine, BOX_LINE_LEFT );
+ aBoxItem.SetLine( pDefLine, SvxBoxItemLine::LEFT );
if ( aBoxItem.GetRight() && aBoxItem.GetRight()->GetOutWidth() == 0 )
- aBoxItem.SetLine( pDefLine, BOX_LINE_RIGHT );
+ aBoxItem.SetLine( pDefLine, SvxBoxItemLine::RIGHT );
pNewSet->Put( aBoxItem );
rReq.AppendItem( aBoxItem );
}
@@ -1815,17 +1815,17 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
SvxBoxInfoItem aBoxInfoItem( *static_cast<const SvxBoxInfoItem*>(pItem) );
if ( aBoxInfoItem.GetHori() && aBoxInfoItem.GetHori()->GetOutWidth() == 0 )
- aBoxInfoItem.SetLine( pDefLine, BOXINFO_LINE_HORI );
+ aBoxInfoItem.SetLine( pDefLine, SvxBoxInfoItemLine::HORI );
if ( aBoxInfoItem.GetVert() && aBoxInfoItem.GetVert()->GetOutWidth() == 0 )
- aBoxInfoItem.SetLine( pDefLine, BOXINFO_LINE_VERT );
+ aBoxInfoItem.SetLine( pDefLine, SvxBoxInfoItemLine::VERT );
pNewSet->Put( aBoxInfoItem );
rReq.AppendItem( aBoxInfoItem );
}
else
{
SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
- aBoxInfoItem.SetLine( NULL, BOXINFO_LINE_HORI );
- aBoxInfoItem.SetLine( NULL, BOXINFO_LINE_VERT );
+ aBoxInfoItem.SetLine( NULL, SvxBoxInfoItemLine::HORI );
+ aBoxInfoItem.SetLine( NULL, SvxBoxInfoItemLine::VERT );
pNewSet->Put( aBoxInfoItem );
}
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 095ef36..f975939 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -743,8 +743,8 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
long nPaperWidth = ( aPageSize.Width() - nLeftMargin - nRightMargin -
rParam.nLeft - rParam.nRight ) * 100 / nZoom;
if (rParam.pBorder)
- nPaperWidth -= ( rParam.pBorder->GetDistance(BOX_LINE_LEFT) +
- rParam.pBorder->GetDistance(BOX_LINE_RIGHT) +
+ nPaperWidth -= ( rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT) +
+ rParam.pBorder->GetDistance(SvxBoxItemLine::RIGHT) +
lcl_LineTotal(rParam.pBorder->GetLeft()) +
lcl_LineTotal(rParam.pBorder->GetRight()) ) * 100 / nZoom;
@@ -770,8 +770,8 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam )
rParam.nHeight = nMaxHeight + rParam.nDistance;
if (rParam.pBorder)
- rParam.nHeight += rParam.pBorder->GetDistance(BOX_LINE_TOP) +
- rParam.pBorder->GetDistance(BOX_LINE_BOTTOM) +
+ rParam.nHeight += rParam.pBorder->GetDistance(SvxBoxItemLine::TOP) +
+ rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM) +
lcl_LineTotal( rParam.pBorder->GetTop() ) +
lcl_LineTotal( rParam.pBorder->GetBottom() );
if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE)
@@ -1721,12 +1721,12 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
Size aPaperSize( nLineWidth, rParam.nHeight-rParam.nDistance );
if ( rParam.pBorder )
{
- long nLeft = lcl_LineTotal( rParam.pBorder->GetLeft() ) + rParam.pBorder->GetDistance(BOX_LINE_LEFT);
- long nTop = lcl_LineTotal( rParam.pBorder->GetTop() ) + rParam.pBorder->GetDistance(BOX_LINE_TOP);
+ long nLeft = lcl_LineTotal( rParam.pBorder->GetLeft() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT);
+ long nTop = lcl_LineTotal( rParam.pBorder->GetTop() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::TOP);
aStart.X() += nLeft;
aStart.Y() += nTop;
- aPaperSize.Width() -= nLeft + lcl_LineTotal( rParam.pBorder->GetRight() ) + rParam.pBorder->GetDistance(BOX_LINE_RIGHT);
- aPaperSize.Height() -= nTop + lcl_LineTotal( rParam.pBorder->GetBottom() ) + rParam.pBorder->GetDistance(BOX_LINE_BOTTOM);
+ aPaperSize.Width() -= nLeft + lcl_LineTotal( rParam.pBorder->GetRight() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::RIGHT);
+ aPaperSize.Height() -= nTop + lcl_LineTotal( rParam.pBorder->GetBottom() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM);
}
if ( rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE )
@@ -1760,8 +1760,8 @@ void ScPrintFunc::PrintHF( long nPageNo, bool bHeader, long nStartY,
if (rParam.pBorder)
nMaxHeight += lcl_LineTotal( rParam.pBorder->GetTop() ) +
lcl_LineTotal( rParam.pBorder->GetBottom() ) +
- rParam.pBorder->GetDistance(BOX_LINE_TOP) +
- rParam.pBorder->GetDistance(BOX_LINE_BOTTOM);
+ rParam.pBorder->GetDistance(SvxBoxItemLine::TOP) +
+ rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM);
if (rParam.pShadow && rParam.pShadow->GetLocation() != SVX_SHADOW_NONE)
nMaxHeight += rParam.pShadow->CalcShadowSpace(SHADOW_TOP) +
rParam.pShadow->CalcShadowSpace(SHADOW_BOTTOM);
@@ -2069,8 +2069,8 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if (aTableParam.bHeaders)
nDataWidth += (long) PRINT_HEADER_WIDTH;
if (pBorderItem)
- nDataWidth += pBorderItem->GetDistance(BOX_LINE_LEFT) +
- pBorderItem->GetDistance(BOX_LINE_RIGHT); //! Line width?
+ nDataWidth += pBorderItem->GetDistance(SvxBoxItemLine::LEFT) +
+ pBorderItem->GetDistance(SvxBoxItemLine::RIGHT); //! Line width?
if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE)
nDataWidth += pShadowItem->CalcShadowSpace(SHADOW_LEFT) +
pShadowItem->CalcShadowSpace(SHADOW_RIGHT);
@@ -2092,8 +2092,8 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if (aTableParam.bHeaders)
nDataHeight += (long) PRINT_HEADER_HEIGHT;
if (pBorderItem)
- nDataHeight += pBorderItem->GetDistance(BOX_LINE_TOP) +
- pBorderItem->GetDistance(BOX_LINE_BOTTOM); //! Line width?
+ nDataHeight += pBorderItem->GetDistance(SvxBoxItemLine::TOP) +
+ pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM); //! Line width?
if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE)
nDataHeight += pShadowItem->CalcShadowSpace(SHADOW_TOP) +
pShadowItem->CalcShadowSpace(SHADOW_BOTTOM);
@@ -2136,9 +2136,9 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if (pBorderItem)
{
nInnerStartX += (long) ( ( lcl_LineTotal(pBorderItem->GetLeft()) +
- pBorderItem->GetDistance(BOX_LINE_LEFT) ) * nScaleX );
+ pBorderItem->GetDistance(SvxBoxItemLine::LEFT) ) * nScaleX );
nInnerStartY += (long) ( ( lcl_LineTotal(pBorderItem->GetTop()) +
- pBorderItem->GetDistance(BOX_LINE_TOP) ) * nScaleY );
+ pBorderItem->GetDistance(SvxBoxItemLine::TOP) ) * nScaleY );
}
if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE)
{
@@ -2190,9 +2190,9 @@ void ScPrintFunc::PrintPage( long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCRO
if (pBorderItem)
{
nBorderEndX += (long) ( ( lcl_LineTotal(pBorderItem->GetRight()) +
- pBorderItem->GetDistance(BOX_LINE_RIGHT) ) * nScaleX );
+ pBorderItem->GetDistance(SvxBoxItemLine::RIGHT) ) * nScaleX );
nBorderEndY += (long) ( ( lcl_LineTotal(pBorderItem->GetBottom()) +
- pBorderItem->GetDistance(BOX_LINE_BOTTOM) ) * nScaleY );
+ pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM) ) * nScaleY );
}
if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE)
{
@@ -2911,12 +2911,12 @@ Size ScPrintFunc::GetDocPageSize()
{
aDocPageSize.Width() -= lcl_LineTotal(pBorderItem->GetLeft()) +
lcl_LineTotal(pBorderItem->GetRight()) +
- pBorderItem->GetDistance(BOX_LINE_LEFT) +
- pBorderItem->GetDistance(BOX_LINE_RIGHT);
+ pBorderItem->GetDistance(SvxBoxItemLine::LEFT) +
+ pBorderItem->GetDistance(SvxBoxItemLine::RIGHT);
aDocPageSize.Height() -= lcl_LineTotal(pBorderItem->GetTop()) +
lcl_LineTotal(pBorderItem->GetBottom()) +
- pBorderItem->GetDistance(BOX_LINE_TOP) +
- pBorderItem->GetDistance(BOX_LINE_BOTTOM);
+ pBorderItem->GetDistance(SvxBoxItemLine::TOP) +
+ pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM);
}
if (pShadowItem && pShadowItem->GetLocation() != SVX_SHADOW_NONE)
{
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 4864c84..57ad8c8 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -490,9 +490,9 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
SvxBoxInfoItem aTempInfo( aLineInner );
if ( aLineInner.IsValid(SvxBoxInfoItemValidFlags::LEFT) )
- aNewFrame.SetLine( aLineOuter.GetLeft(), BOX_LINE_RIGHT );
+ aNewFrame.SetLine( aLineOuter.GetLeft(), SvxBoxItemLine::RIGHT );
if ( aLineInner.IsValid(SvxBoxInfoItemValidFlags::RIGHT) )
- aNewFrame.SetLine( aLineOuter.GetRight(), BOX_LINE_LEFT );
+ aNewFrame.SetLine( aLineOuter.GetRight(), SvxBoxItemLine::LEFT );
aLineInner.SetValid( SvxBoxInfoItemValidFlags::LEFT, aTempInfo.IsValid(SvxBoxInfoItemValidFlags::RIGHT));
aLineInner.SetValid( SvxBoxInfoItemValidFlags::RIGHT, aTempInfo.IsValid(SvxBoxInfoItemValidFlags::LEFT));
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 9cf4091..4b21f41 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2884,13 +2884,13 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
SvxBoxItem aBoxItem( *static_cast<const SvxBoxItem*>(pBorderAttr) );
SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
- SET_LINE_ATTRIBUTES(Top,BOX_LINE_TOP)
- SET_LINE_ATTRIBUTES(Bottom,BOX_LINE_BOTTOM)
- SET_LINE_ATTRIBUTES(Left,BOX_LINE_LEFT)
- SET_LINE_ATTRIBUTES(Right,BOX_LINE_RIGHT)
+ SET_LINE_ATTRIBUTES(Top,SvxBoxItemLine::TOP)
+ SET_LINE_ATTRIBUTES(Bottom,SvxBoxItemLine::BOTTOM)
+ SET_LINE_ATTRIBUTES(Left,SvxBoxItemLine::LEFT)
+ SET_LINE_ATTRIBUTES(Right,SvxBoxItemLine::RIGHT)
- aBoxInfoItem.SetLine( aBoxItem.GetTop(), BOXINFO_LINE_HORI );
- aBoxInfoItem.SetLine( aBoxItem.GetLeft(), BOXINFO_LINE_VERT );
+ aBoxInfoItem.SetLine( aBoxItem.GetTop(), SvxBoxInfoItemLine::HORI );
+ aBoxInfoItem.SetLine( aBoxItem.GetLeft(), SvxBoxInfoItemLine::VERT );
aBoxInfoItem.ResetFlags(); // set Lines to Valid
pOldSet->Put( *pBorderAttr );
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 8572e1e..b56b0ee 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -603,10 +603,10 @@ void SdDrawDocument::CreateDefaultCellStyles()
&aWhite, 1, table::BorderLineStyle::SOLID);
SvxBoxItem aBoxItem( SDRATTR_TABLE_BORDER );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_TOP );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_BOTTOM );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_LEFT );
- aBoxItem.SetLine( &aBorderLine, BOX_LINE_RIGHT );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::TOP );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::BOTTOM );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::LEFT );
+ aBoxItem.SetLine( &aBorderLine, SvxBoxItemLine::RIGHT );
rISet.Put( aBoxItem );
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 5be0d54..564b926 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -43,6 +43,7 @@
#include <editeng/colritem.hxx>
#include <editeng/eeitem.hxx>
#include <svx/sdr/table/tabledesign.hxx>
+#include <o3tl/enumrange.hxx>
#include "TableDesignPane.hxx"
#include "createtabledesignpanel.hxx"
@@ -694,7 +695,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle,
sal_Int32* pDiff = &border_diffs[0];
// draw top border
- for( sal_uInt16 nLine = 0; nLine < 4; ++nLine )
+ for( SvxBoxItemLine nLine : o3tl::enumrange<SvxBoxItemLine>() )
{
const ::editeng::SvxBorderLine* pBorderLine = xCellInfo->maBorder.GetLine(nLine);
if( !pBorderLine || ((pBorderLine->GetOutWidth() == 0) && (pBorderLine->GetInWidth()==0)) )
@@ -708,8 +709,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle,
boost::shared_ptr< CellInfo > xBorderInfo( aMatrix[nBorderCol][nBorderRow] );
if( xBorderInfo.get() )
{
- const sal_uInt16 nOtherLine = nLine ^ 1;
- const ::editeng::SvxBorderLine* pBorderLine2 = xBorderInfo->maBorder.GetLine(nOtherLine^1);
+ const ::editeng::SvxBorderLine* pBorderLine2 = xBorderInfo->maBorder.GetLine(static_cast<SvxBoxItemLine>(static_cast<int>(nLine)^1^1));
if( pBorderLine2 && pBorderLine2->HasPriority(*pBorderLine) )
continue; // other border line wins
}
@@ -718,10 +718,10 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle,
pAccess->SetLineColor( pBorderLine->GetColor() );
switch( nLine )
{
- case 0: pAccess->DrawLine( aPntTL, aPntTR ); break;
- case 1: pAccess->DrawLine( aPntBL, aPntBR ); break;
- case 2: pAccess->DrawLine( aPntTL, aPntBL ); break;
- case 3: pAccess->DrawLine( aPntTR, aPntBR ); break;
+ case SvxBoxItemLine::TOP: pAccess->DrawLine( aPntTL, aPntTR ); break;
+ case SvxBoxItemLine::BOTTOM: pAccess->DrawLine( aPntBL, aPntBR ); break;
+ case SvxBoxItemLine::LEFT: pAccess->DrawLine( aPntTL, aPntBL ); break;
+ case SvxBoxItemLine::RIGHT: pAccess->DrawLine( aPntTR, aPntBR ); break;
}
}
}
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 8a8af8c..c88b4bd 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1060,27 +1060,27 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any&
SvxBorderLine aLine;
bool bSet = SvxBoxItem::LineToSvxLine(pBorder->TopLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_TOP);
+ aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::TOP);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::TOP, pBorder->IsTopLineValid);
bSet = SvxBoxItem::LineToSvxLine(pBorder->BottomLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_BOTTOM);
+ aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::BOTTOM);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::BOTTOM, pBorder->IsBottomLineValid);
bSet = SvxBoxItem::LineToSvxLine(pBorder->LeftLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_LEFT);
+ aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::LEFT);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::LEFT, pBorder->IsLeftLineValid);
bSet = SvxBoxItem::LineToSvxLine(pBorder->RightLine, aLine, false);
- aBox.SetLine(bSet ? &aLine : 0, BOX_LINE_RIGHT);
+ aBox.SetLine(bSet ? &aLine : 0, SvxBoxItemLine::RIGHT);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::RIGHT, pBorder->IsRightLineValid);
bSet = SvxBoxItem::LineToSvxLine(pBorder->HorizontalLine, aLine, false);
- aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_HORI);
+ aBoxInfo.SetLine(bSet ? &aLine : 0, SvxBoxInfoItemLine::HORI);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI, pBorder->IsHorizontalLineValid);
bSet = SvxBoxItem::LineToSvxLine(pBorder->VerticalLine, aLine, false);
- aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_VERT);
+ aBoxInfo.SetLine(bSet ? &aLine : 0, SvxBoxInfoItemLine::VERT);
aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, pBorder->IsVerticalLineValid);
aBox.SetDistance(pBorder->Distance); //TODO
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index e487b06..b2d5d6a 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -68,6 +68,8 @@
#include <vcl/msgbox.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <memory>
+#include <o3tl/enumarray.hxx>
+#include <o3tl/enumrange.hxx>
using ::editeng::SvxBorderLine;
using namespace ::sdr::table;
@@ -889,10 +891,10 @@ namespace
{
// merge drawing layer text distance items into SvxBoxItem used by the dialog
SvxBoxItem aBoxItem( static_cast< const SvxBoxItem& >( rAttrSet.Get( SDRATTR_TABLE_BORDER ) ) );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_LEFTDIST)).GetValue()), BOX_LINE_LEFT );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_RIGHTDIST)).GetValue()), BOX_LINE_RIGHT );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_UPPERDIST)).GetValue()), BOX_LINE_TOP );
- aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_LOWERDIST)).GetValue()), BOX_LINE_BOTTOM );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_LEFTDIST)).GetValue()), SvxBoxItemLine::LEFT );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_RIGHTDIST)).GetValue()), SvxBoxItemLine::RIGHT );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_UPPERDIST)).GetValue()), SvxBoxItemLine::TOP );
+ aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_LOWERDIST)).GetValue()), SvxBoxItemLine::BOTTOM );
return aBoxItem;
}
}
@@ -942,17 +944,17 @@ void SvxTableController::onFormatTable( SfxRequest& rReq )
SvxBoxItem aNewBoxItem( static_cast< const SvxBoxItem& >( aNewSet.Get( SDRATTR_TABLE_BORDER ) ) );
- if( aNewBoxItem.GetDistance( BOX_LINE_LEFT ) != aBoxItem.GetDistance( BOX_LINE_LEFT ) )
- aNewSet.Put(makeSdrTextLeftDistItem( aNewBoxItem.GetDistance( BOX_LINE_LEFT ) ) );
+ if( aNewBoxItem.GetDistance( SvxBoxItemLine::LEFT ) != aBoxItem.GetDistance( SvxBoxItemLine::LEFT ) )
+ aNewSet.Put(makeSdrTextLeftDistItem( aNewBoxItem.GetDistance( SvxBoxItemLine::LEFT ) ) );
- if( aNewBoxItem.GetDistance( BOX_LINE_RIGHT ) != aBoxItem.GetDistance( BOX_LINE_RIGHT ) )
- aNewSet.Put(makeSdrTextRightDistItem( aNewBoxItem.GetDistance( BOX_LINE_RIGHT ) ) );
+ if( aNewBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) != aBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) )
+ aNewSet.Put(makeSdrTextRightDistItem( aNewBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) ) );
- if( aNewBoxItem.GetDistance( BOX_LINE_TOP ) != aBoxItem.GetDistance( BOX_LINE_TOP ) )
- aNewSet.Put(makeSdrTextUpperDistItem( aNewBoxItem.GetDistance( BOX_LINE_TOP ) ) );
+ if( aNewBoxItem.GetDistance( SvxBoxItemLine::TOP ) != aBoxItem.GetDistance( SvxBoxItemLine::TOP ) )
+ aNewSet.Put(makeSdrTextUpperDistItem( aNewBoxItem.GetDistance( SvxBoxItemLine::TOP ) ) );
- if( aNewBoxItem.GetDistance( BOX_LINE_BOTTOM ) != aBoxItem.GetDistance( BOX_LINE_BOTTOM ) )
- aNewSet.Put(makeSdrTextLowerDistItem( aNewBoxItem.GetDistance( BOX_LINE_BOTTOM ) ) );
+ if( aNewBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) != aBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) )
+ aNewSet.Put(makeSdrTextLowerDistItem( aNewBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) ) );
SetAttrToSelectedCells(aNewSet, false);
}
@@ -2249,7 +2251,7 @@ const sal_uInt16 CELL_LOWER = 0x0080;
-static void ImplSetLinePreserveColor( SvxBoxItem& rNewFrame, const SvxBorderLine* pNew, sal_uInt16 nLine )
+static void ImplSetLinePreserveColor( SvxBoxItem& rNewFrame, const SvxBorderLine* pNew, SvxBoxItemLine nLine )
{
if( pNew )
{
@@ -2278,12 +2280,12 @@ static void ImplApplyBoxItem( sal_uInt16 nCellFlags, const SvxBoxItem* pBoxItem,
if( nCellFlags & CELL_UPPER )
{
if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::TOP) )
- rNewFrame.SetLine(0, BOX_LINE_BOTTOM );
+ rNewFrame.SetLine(0, SvxBoxItemLine::BOTTOM );
}
else if( nCellFlags & CELL_LOWER )
{
if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::BOTTOM) )
- rNewFrame.SetLine( 0, BOX_LINE_TOP );
+ rNewFrame.SetLine( 0, SvxBoxItemLine::TOP );
}
}
else if( (nCellFlags & ( CELL_UPPER|CELL_LOWER)) == 0 ) // check if its not sw or se corner
@@ -2291,12 +2293,12 @@ static void ImplApplyBoxItem( sal_uInt16 nCellFlags, const SvxBoxItem* pBoxItem,
if( nCellFlags & CELL_BEFORE )
{
if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::LEFT) )
- rNewFrame.SetLine( 0, BOX_LINE_RIGHT );
+ rNewFrame.SetLine( 0, SvxBoxItemLine::RIGHT );
}
else if( nCellFlags & CELL_AFTER )
{
if( pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::RIGHT) )
- rNewFrame.SetLine( 0, BOX_LINE_LEFT );
+ rNewFrame.SetLine( 0, SvxBoxItemLine::LEFT );
}
}
}
@@ -2305,27 +2307,27 @@ static void ImplApplyBoxItem( sal_uInt16 nCellFlags, const SvxBoxItem* pBoxItem,
// current cell is inside the selection
if( (nCellFlags & CELL_LEFT) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::LEFT) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::VERT) )
- rNewFrame.SetLine( (nCellFlags & CELL_LEFT) ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(), BOX_LINE_LEFT );
+ rNewFrame.SetLine( (nCellFlags & CELL_LEFT) ? pBoxItem->GetLeft() : pBoxInfoItem->GetVert(), SvxBoxItemLine::LEFT );
if( (nCellFlags & CELL_RIGHT) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::RIGHT) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::VERT) )
- rNewFrame.SetLine( (nCellFlags & CELL_RIGHT) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(), BOX_LINE_RIGHT );
+ rNewFrame.SetLine( (nCellFlags & CELL_RIGHT) ? pBoxItem->GetRight() : pBoxInfoItem->GetVert(), SvxBoxItemLine::RIGHT );
if( (nCellFlags & CELL_TOP) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::TOP) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::HORI) )
- rNewFrame.SetLine( (nCellFlags & CELL_TOP) ? pBoxItem->GetTop() : pBoxInfoItem->GetHori(), BOX_LINE_TOP );
+ rNewFrame.SetLine( (nCellFlags & CELL_TOP) ? pBoxItem->GetTop() : pBoxInfoItem->GetHori(), SvxBoxItemLine::TOP );
if( (nCellFlags & CELL_BOTTOM) ? pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::BOTTOM) : pBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::HORI) )
- rNewFrame.SetLine( (nCellFlags & CELL_BOTTOM) ? pBoxItem->GetBottom() : pBoxInfoItem->GetHori(), BOX_LINE_BOTTOM );
+ rNewFrame.SetLine( (nCellFlags & CELL_BOTTOM) ? pBoxItem->GetBottom() : pBoxInfoItem->GetHori(), SvxBoxItemLine::BOTTOM );
// apply distance to borders
if( pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::DISTANCE ) )
- for( sal_uInt16 nLine = 0; nLine < 4; ++nLine )
+ for( SvxBoxItemLine nLine : o3tl::enumrange<SvxBoxItemLine>() )
rNewFrame.SetDistance( pBoxItem->GetDistance( nLine ), nLine );
}
}
-static void ImplSetLineColor( SvxBoxItem& rNewFrame, sal_uInt16 nLine, const Color& rColor )
+static void ImplSetLineColor( SvxBoxItem& rNewFrame, SvxBoxItemLine nLine, const Color& rColor )
{
const SvxBorderLine* pSourceLine = rNewFrame.GetLine( nLine );
if( pSourceLine )
@@ -2343,16 +2345,16 @@ static void ImplApplyLineColorItem( sal_uInt16 nCellFlags, const SvxColorItem* p
const Color aColor( pLineColorItem->GetValue() );
if( (nCellFlags & (CELL_LOWER|CELL_BEFORE|CELL_AFTER)) == 0 )
- ImplSetLineColor( rNewFrame, BOX_LINE_BOTTOM, aColor );
+ ImplSetLineColor( rNewFrame, SvxBoxItemLine::BOTTOM, aColor );
if( (nCellFlags & (CELL_UPPER|CELL_BEFORE|CELL_AFTER)) == 0 )
- ImplSetLineColor( rNewFrame, BOX_LINE_TOP, aColor );
+ ImplSetLineColor( rNewFrame, SvxBoxItemLine::TOP, aColor );
if( (nCellFlags & (CELL_UPPER|CELL_LOWER|CELL_AFTER)) == 0 )
- ImplSetLineColor( rNewFrame, BOX_LINE_RIGHT, aColor );
+ ImplSetLineColor( rNewFrame, SvxBoxItemLine::RIGHT, aColor );
if( (nCellFlags & (CELL_UPPER|CELL_LOWER|CELL_BEFORE)) == 0 )
- ImplSetLineColor( rNewFrame, BOX_LINE_LEFT, aColor );
+ ImplSetLineColor( rNewFrame, SvxBoxItemLine::LEFT, aColor );
}
@@ -2366,12 +2368,12 @@ static void ImplApplyBorderLineItem( sal_uInt16 nCellFlags, const SvxBorderLine*
if( nCellFlags & CELL_UPPER )
{
if( rNewFrame.GetBottom() )
- ImplSetLinePreserveColor( rNewFrame, pBorderLineItem, BOX_LINE_BOTTOM );
+ ImplSetLinePreserveColor( rNewFrame, pBorderLineItem, SvxBoxItemLine::BOTTOM );
}
else if( nCellFlags & CELL_LOWER )
{
if( rNewFrame.GetTop() )
- ImplSetLinePreserveColor( rNewFrame, pBorderLineItem, BOX_LINE_TOP );
+ ImplSetLinePreserveColor( rNewFrame, pBorderLineItem, SvxBoxItemLine::TOP );
}
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list