diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-30 11:20:37 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-01 09:36:19 +0200 |
commit | 4b66829390b286010b37b37ec1537a320d8cea8f (patch) | |
tree | e3070f55a80dd8d6f5944db4594608865d0fbbcc /sw/source/core | |
parent | 427ef167e1a49ba7fcdef082de43622e02a84ce5 (diff) |
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
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/doc/DocumentStylePoolManager.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/gctable.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/tblrwcl.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl1.cxx | 80 | ||||
-rw-r--r-- | sw/source/core/docnode/swbaslnk.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/table/swnewtable.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/atrstck.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 44 |
18 files changed, 139 insertions, 147 deletions
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 8d9c8e7a5e9c..f415ca6fc1df 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -997,7 +997,7 @@ SwTxtFmtColl* DocumentStylePoolManager::GetTxtCollFromPool( sal_uInt16 nId, bool SvxBoxItem aBox( RES_BOX ); Color aColor( COL_GRAY ); SvxBorderLine aNew(&aColor, 1, table::BorderLineStyle::DOUBLE); - aBox.SetLine( &aNew, BOX_LINE_BOTTOM ); + aBox.SetLine( &aNew, SvxBoxItemLine::BOTTOM ); aSet.Put( aBox ); aSet.Put( SwParaConnectBorderItem( false ) ); @@ -1257,10 +1257,10 @@ SwFmt* DocumentStylePoolManager::GetFmtFromPool( sal_uInt16 nId ) Color aCol( COL_BLACK ); SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 ); SvxBoxItem aBox( RES_BOX ); - aBox.SetLine( &aLine, BOX_LINE_TOP ); - aBox.SetLine( &aLine, BOX_LINE_BOTTOM ); - aBox.SetLine( &aLine, BOX_LINE_LEFT ); - aBox.SetLine( &aLine, BOX_LINE_RIGHT ); + aBox.SetLine( &aLine, SvxBoxItemLine::TOP ); + aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM ); + aBox.SetLine( &aLine, SvxBoxItemLine::LEFT ); + aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT ); aBox.SetDistance( 85 ); aSet.Put( aBox ); aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx index 1951495e7383..f5c7b75df09e 100644 --- a/sw/source/core/doc/gctable.cxx +++ b/sw/source/core/doc/gctable.cxx @@ -135,9 +135,9 @@ static void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB, { SvxBoxItem aBox( *static_cast<const SvxBoxItem*>(pItem) ); if( bTop ) - aBox.SetLine( 0, BOX_LINE_TOP ); + aBox.SetLine( 0, SvxBoxItemLine::TOP ); else - aBox.SetLine( 0, BOX_LINE_BOTTOM ); + aBox.SetLine( 0, SvxBoxItemLine::BOTTOM ); if( pShareFmts ) pShareFmts->SetAttr( *pBox, aBox ); @@ -191,7 +191,7 @@ void sw_GC_Line_Border( const SwTableLine* pLine, _SwGCLineBorder* pGCPara ) aBPara.IsAnyBorderFound() ) { SvxBoxItem aBox( *static_cast<const SvxBoxItem*>(pItem) ); - aBox.SetLine( 0, BOX_LINE_RIGHT ); + aBox.SetLine( 0, SvxBoxItemLine::RIGHT ); if( pGCPara->pShareFmts ) pGCPara->pShareFmts->SetAttr( *pBox, aBox ); else diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 446e29af773e..5880d2fa7a82 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -1085,13 +1085,13 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl() SvxBoxItem aBox( RES_BOX ); aBox.SetDistance( 55 ); SvxBorderLine aLn( &aColor, DEF_LINE_WIDTH_0 ); - aBox.SetLine( &aLn, BOX_LINE_LEFT ); - aBox.SetLine( &aLn, BOX_LINE_BOTTOM ); + aBox.SetLine( &aLn, SvxBoxItemLine::LEFT ); + aBox.SetLine( &aLn, SvxBoxItemLine::BOTTOM ); for( i = 0; i <= 15; ++i ) { - aBox.SetLine( i <= 3 ? &aLn : 0, BOX_LINE_TOP ); - aBox.SetLine( (3 == ( i & 3 )) ? &aLn : 0, BOX_LINE_RIGHT ); + aBox.SetLine( i <= 3 ? &aLn : 0, SvxBoxItemLine::TOP ); + aBox.SetLine( (3 == ( i & 3 )) ? &aLn : 0, SvxBoxItemLine::RIGHT ); const_cast<SwBoxAutoFmt&>(pNew->GetBoxFmt( i )).SetBox( aBox ); } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index d2d4beeb1b44..1cee55f042a0 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -399,9 +399,9 @@ static void lcl_CopyCol( _FndBox & rFndBox, _CpyPara *const pCpyPara) SvxBoxItem aNew( rBoxItem ); if( 8 > pCpyPara->nDelBorderFlag ) - aNew.SetLine( 0, BOX_LINE_TOP ); + aNew.SetLine( 0, SvxBoxItemLine::TOP ); else - aNew.SetLine( 0, BOX_LINE_RIGHT ); + aNew.SetLine( 0, SvxBoxItemLine::RIGHT ); if( 1 == pCpyPara->nDelBorderFlag || 8 == pCpyPara->nDelBorderFlag ) @@ -724,7 +724,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo, SvxBoxItem aTmp( rNxtBoxItem ); aTmp.SetLine( rBoxItem.GetLeft() ? rBoxItem.GetLeft() : rBoxItem.GetRight(), - BOX_LINE_LEFT ); + SvxBoxItemLine::LEFT ); if( pShareFmts ) pShareFmts->SetAttr( *pNxtBox, aTmp ); else @@ -746,7 +746,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo, SvxBoxItem aTmp( rPrvBoxItem ); aTmp.SetLine( rBoxItem.GetLeft() ? rBoxItem.GetLeft() : rBoxItem.GetRight(), - BOX_LINE_RIGHT ); + SvxBoxItemLine::RIGHT ); if( pShareFmts ) pShareFmts->SetAttr( *pPrvBox, aTmp ); else @@ -945,7 +945,7 @@ lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox, SvxBoxItem aTmp( rNxtBoxItem ); aTmp.SetLine( rBoxItem.GetTop() ? rBoxItem.GetTop() : rBoxItem.GetBottom(), - BOX_LINE_TOP ); + SvxBoxItemLine::TOP ); rShareFmts.SetAttr( *pNxtBox, aTmp ); bChgd = true; } @@ -959,7 +959,7 @@ lcl_SaveUpperLowerBorder( SwTable& rTbl, const SwTableBox& rBox, SvxBoxItem aTmp( rPrvBoxItem ); aTmp.SetLine( rBoxItem.GetTop() ? rBoxItem.GetTop() : rBoxItem.GetBottom(), - BOX_LINE_BOTTOM ); + SvxBoxItemLine::BOTTOM ); rShareFmts.SetAttr( *pPrvBox, aTmp ); } } @@ -1147,7 +1147,7 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn { pCpyBoxFrmFmt = static_cast<SwTableBoxFmt*>(pNewLine->GetTabBoxes()[ 0 ]->ClaimFrmFmt()); SvxBoxItem aTmp( pCpyBoxFrmFmt->GetBox() ); - aTmp.SetLine( 0, BOX_LINE_TOP ); + aTmp.SetLine( 0, SvxBoxItemLine::TOP ); pCpyBoxFrmFmt->SetFmtAttr( aTmp ); bChkBorder = false; } @@ -1269,7 +1269,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt ) pInsLine->GetTabBoxes()[ nBoxPos + nCnt ]->ClaimFrmFmt(); SvxBoxItem aTmp( aSelBoxItem ); - aTmp.SetLine( 0, BOX_LINE_RIGHT ); + aTmp.SetLine( 0, SvxBoxItemLine::RIGHT ); aFindFrm.pNewFrmFmt->SetFmtAttr( aTmp ); // Remove the Format from the "cache" @@ -2661,7 +2661,7 @@ static bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( rBoxItem.GetRight() ) { SvxBoxItem aTmp( rBoxItem ); - aTmp.SetLine( 0, BOX_LINE_RIGHT ); + aTmp.SetLine( 0, SvxBoxItemLine::RIGHT ); rParam.aShareFmts.SetAttr( rParam.bLeft ? *pNewBox : *pBox, aTmp ); @@ -4074,7 +4074,7 @@ static bool lcl_InsDelSelLine( SwTableLine* pLine, CR_SetLineHeight& rParam, if( rBoxItem.GetTop() ) { SvxBoxItem aTmp( rBoxItem ); - aTmp.SetLine( 0, BOX_LINE_TOP ); + aTmp.SetLine( 0, SvxBoxItemLine::TOP ); rParam.aShareFmts.SetAttr( rParam.bTop ? *pOld : *rNewBoxes[ n ], aTmp ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 876b5803515d..eac0891cb10d 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -127,13 +127,13 @@ static void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId ) } SvxBoxItem aBox(RES_BOX); aBox.SetDistance( 55 ); if ( bTop ) - aBox.SetLine( &aLine, BOX_LINE_TOP ); + aBox.SetLine( &aLine, SvxBoxItemLine::TOP ); if ( bBottom ) - aBox.SetLine( &aLine, BOX_LINE_BOTTOM ); + aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM ); if ( bLeft ) - aBox.SetLine( &aLine, BOX_LINE_LEFT ); + aBox.SetLine( &aLine, SvxBoxItemLine::LEFT ); if ( bRight ) - aBox.SetLine( &aLine, BOX_LINE_RIGHT ); + aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT ); rFmt.SetFmtAttr( aBox ); } @@ -3039,7 +3039,7 @@ void sw_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara ) if( !rBoxItem.GetTop() ) { SvxBoxItem aNew( rBoxItem ); - aNew.SetLine( pFmt->GetBox().GetBottom(), BOX_LINE_TOP ); + aNew.SetLine( pFmt->GetBox().GetBottom(), SvxBoxItemLine::TOP ); if( aNew != rBoxItem ) pBox->ClaimFrmFmt()->SetFmtAttr( aNew ); } diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 3aa62a36caab..2b122d059d04 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -50,6 +50,7 @@ #include "undobj.hxx" #include <calbck.hxx> #include <UndoTable.hxx> +#include <o3tl/enumrange.hxx> using ::editeng::SvxBorderLine; using namespace ::com::sun::star; @@ -669,12 +670,12 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { if ( bFirst && bTopOver ) { - aBox.SetLine( pTop, BOX_LINE_TOP ); + aBox.SetLine( pTop, SvxBoxItemLine::TOP ); nType |= 0x0001; } else if ( bHoriValid ) { - aBox.SetLine( 0, BOX_LINE_TOP ); + aBox.SetLine( 0, SvxBoxItemLine::TOP ); nType |= 0x0002; } } @@ -686,12 +687,12 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { if ( bLeftValid ) { - aBox.SetLine( pLeft, BOX_LINE_RIGHT ); + aBox.SetLine( pLeft, SvxBoxItemLine::RIGHT ); nType |= 0x0010; } if ( bRightValid ) { - aBox.SetLine( pRight, BOX_LINE_LEFT ); + aBox.SetLine( pRight, SvxBoxItemLine::LEFT ); nType |= 0x0004; } } @@ -699,20 +700,20 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { if ( bLeftValid ) { - aBox.SetLine( bRightOver ? pLeft : 0, BOX_LINE_RIGHT ); + aBox.SetLine( bRightOver ? pLeft : 0, SvxBoxItemLine::RIGHT ); bVertValid ? nType |= 0x0020 : nType |= 0x0010; } if ( bLeftOver ) { if ( bRightValid ) { - aBox.SetLine( pRight, BOX_LINE_LEFT ); + aBox.SetLine( pRight, SvxBoxItemLine::LEFT ); nType |= 0x0004; } } else if ( bVertValid ) { - aBox.SetLine( pVert, BOX_LINE_LEFT ); + aBox.SetLine( pVert, SvxBoxItemLine::LEFT ); nType |= 0x0008; } } @@ -724,13 +725,13 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { if( bLeftValid ) { - aBox.SetLine( pLeft, BOX_LINE_LEFT ); + aBox.SetLine( pLeft, SvxBoxItemLine::LEFT ); nType |= 0x0004; } } else if( bVertValid ) { - aBox.SetLine( pVert, BOX_LINE_LEFT ); + aBox.SetLine( pVert, SvxBoxItemLine::LEFT ); nType |= 0x0008; } @@ -739,12 +740,12 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { if ( bRightOver ) { - aBox.SetLine( pRight, BOX_LINE_RIGHT ); + aBox.SetLine( pRight, SvxBoxItemLine::RIGHT ); nType |= 0x0010; } else if ( bVertValid ) { - aBox.SetLine( 0, BOX_LINE_RIGHT ); + aBox.SetLine( 0, SvxBoxItemLine::RIGHT ); nType |= 0x0020; } } @@ -755,24 +756,20 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { if( bBottomValid ) { - aBox.SetLine( pBottom, BOX_LINE_BOTTOM ); + aBox.SetLine( pBottom, SvxBoxItemLine::BOTTOM ); nType |= 0x0040; } } else if( bHoriValid ) { - aBox.SetLine( pHori, BOX_LINE_BOTTOM ); + aBox.SetLine( pHori, SvxBoxItemLine::BOTTOM ); nType |= 0x0080; } if( pSetBox ) { - static sal_uInt16 const aBorders[] = { - BOX_LINE_BOTTOM, BOX_LINE_TOP, - BOX_LINE_RIGHT, BOX_LINE_LEFT }; - const sal_uInt16* pBrd = aBorders; - for( int k = 0; k < 4; ++k, ++pBrd ) - aBox.SetDistance( pSetBox->GetDistance( *pBrd ), *pBrd ); + for( SvxBoxItemLine k : o3tl::enumrange<SvxBoxItemLine>() ) + aBox.SetDistance( pSetBox->GetDistance( k ), k ); } SwTableBox *pBox = const_cast<SwTableBox*>(pCell->GetTabBox()); @@ -981,14 +978,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const { if ( !bTopSet ) { bTopSet = true; - aSetBox.SetLine( rBox.GetTop(), BOX_LINE_TOP ); + aSetBox.SetLine( rBox.GetTop(), SvxBoxItemLine::TOP ); } else if ((aSetBox.GetTop() && rBox.GetTop() && !(*aSetBox.GetTop() == *rBox.GetTop())) || ((!aSetBox.GetTop()) != (!rBox.GetTop()))) // != expression is true, if one and only one of the two pointers is !0 { aSetBoxInfo.SetValid(SvxBoxInfoItemValidFlags::TOP, false ); - aSetBox.SetLine( 0, BOX_LINE_TOP ); + aSetBox.SetLine( 0, SvxBoxItemLine::TOP ); } } } @@ -1000,14 +997,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const { if ( !bLeftSet ) { bLeftSet = true; - aSetBox.SetLine( rBox.GetLeft(), BOX_LINE_LEFT ); + aSetBox.SetLine( rBox.GetLeft(), SvxBoxItemLine::LEFT ); } else if ((aSetBox.GetLeft() && rBox.GetLeft() && !(*aSetBox.GetLeft() == *rBox.GetLeft())) || ((!aSetBox.GetLeft()) != (!rBox.GetLeft()))) { aSetBoxInfo.SetValid(SvxBoxInfoItemValidFlags::LEFT, false ); - aSetBox.SetLine( 0, BOX_LINE_LEFT ); + aSetBox.SetLine( 0, SvxBoxItemLine::LEFT ); } } } @@ -1017,13 +1014,13 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const { if ( !bVertSet ) { bVertSet = true; - aSetBoxInfo.SetLine( rBox.GetLeft(), BOXINFO_LINE_VERT ); + aSetBoxInfo.SetLine( rBox.GetLeft(), SvxBoxInfoItemLine::VERT ); } else if ((aSetBoxInfo.GetVert() && rBox.GetLeft() && !(*aSetBoxInfo.GetVert() == *rBox.GetLeft())) || ((!aSetBoxInfo.GetVert()) != (!rBox.GetLeft()))) { aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::VERT, false ); - aSetBoxInfo.SetLine( 0, BOXINFO_LINE_VERT ); + aSetBoxInfo.SetLine( 0, SvxBoxInfoItemLine::VERT ); } } } @@ -1033,13 +1030,13 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const { if ( !bRightSet ) { bRightSet = true; - aSetBox.SetLine( rBox.GetRight(), BOX_LINE_RIGHT ); + aSetBox.SetLine( rBox.GetRight(), SvxBoxItemLine::RIGHT ); } else if ((aSetBox.GetRight() && rBox.GetRight() && !(*aSetBox.GetRight() == *rBox.GetRight())) || (!aSetBox.GetRight() != !rBox.GetRight())) { aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::RIGHT, false ); - aSetBox.SetLine( 0, BOX_LINE_RIGHT ); + aSetBox.SetLine( 0, SvxBoxItemLine::RIGHT ); } } @@ -1050,13 +1047,13 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const { if ( !bBottomSet ) { bBottomSet = true; - aSetBox.SetLine( rBox.GetBottom(), BOX_LINE_BOTTOM ); + aSetBox.SetLine( rBox.GetBottom(), SvxBoxItemLine::BOTTOM ); } else if ((aSetBox.GetBottom() && rBox.GetBottom() && !(*aSetBox.GetBottom() == *rBox.GetBottom())) || (!aSetBox.GetBottom() != !rBox.GetBottom())) { aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, false ); - aSetBox.SetLine( 0, BOX_LINE_BOTTOM ); + aSetBox.SetLine( 0, SvxBoxItemLine::BOTTOM ); } } } @@ -1068,14 +1065,14 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const { if ( !bHoriSet ) { bHoriSet = true; - aSetBoxInfo.SetLine( rBox.GetBottom(), BOXINFO_LINE_HORI ); + aSetBoxInfo.SetLine( rBox.GetBottom(), SvxBoxInfoItemLine::HORI ); } else if ((aSetBoxInfo.GetHori() && rBox.GetBottom() && !(*aSetBoxInfo.GetHori() == *rBox.GetBottom())) || ((!aSetBoxInfo.GetHori()) != (!rBox.GetBottom()))) { aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::HORI, false ); - aSetBoxInfo.SetLine( 0, BOXINFO_LINE_HORI ); + aSetBoxInfo.SetLine( 0, SvxBoxInfoItemLine::HORI ); } } } @@ -1083,22 +1080,17 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const // Distance to text if (aSetBoxInfo.IsValid(SvxBoxInfoItemValidFlags::DISTANCE)) { - static sal_uInt16 const aBorders[] = { - BOX_LINE_BOTTOM, BOX_LINE_TOP, - BOX_LINE_RIGHT, BOX_LINE_LEFT }; - const sal_uInt16* pBrd = aBorders; - if( !bDistanceSet ) // Set on first iteration { bDistanceSet = true; - for( int k = 0; k < 4; ++k, ++pBrd ) - aSetBox.SetDistance( rBox.GetDistance( *pBrd ), *pBrd ); + for( SvxBoxItemLine k : o3tl::enumrange<SvxBoxItemLine>() ) + aSetBox.SetDistance( rBox.GetDistance( k ), k ); } else { - for( int k = 0; k < 4; ++k, ++pBrd ) - if( aSetBox.GetDistance( *pBrd ) != - rBox.GetDistance( *pBrd ) ) + for( SvxBoxItemLine k : o3tl::enumrange<SvxBoxItemLine>() ) + if( aSetBox.GetDistance( k ) != + rBox.GetDistance( k ) ) { aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISTANCE, false ); aSetBox.SetDistance( (sal_uInt16) 0 ); @@ -1115,9 +1107,9 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const SvxBoxItem aTempBox (static_cast<const SvxBoxItem &>( rSet.Get(RES_BOX ))); SvxBoxInfoItem aTempBoxInfo(static_cast<const SvxBoxInfoItem&>( rSet.Get(SID_ATTR_BORDER_INNER))); - aTempBox.SetLine( aSetBox.GetRight(), BOX_LINE_RIGHT); - aSetBox.SetLine( aSetBox.GetLeft(), BOX_LINE_RIGHT); - aSetBox.SetLine( aTempBox.GetRight(), BOX_LINE_LEFT); + aTempBox.SetLine( aSetBox.GetRight(), SvxBoxItemLine::RIGHT); + aSetBox.SetLine( aSetBox.GetLeft(), SvxBoxItemLine::RIGHT); + aSetBox.SetLine( aTempBox.GetRight(), SvxBoxItemLine::LEFT); aTempBoxInfo.SetValid( SvxBoxInfoItemValidFlags::LEFT, aSetBoxInfo.IsValid(SvxBoxInfoItemValidFlags::LEFT) ); aSetBoxInfo.SetValid( SvxBoxInfoItemValidFlags::LEFT, aSetBoxInfo.IsValid(SvxBoxInfoItemValidFlags::RIGHT) ); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 3cb90bc9f8aa..3b3ae1b7c59d 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -318,10 +318,10 @@ static bool SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd, const Size& rO aCalcSz = rGrfSz; const SvxBoxItem &rBox = pFmt->GetBox(); - aCalcSz.Width() += rBox.CalcLineSpace(BOX_LINE_LEFT) + - rBox.CalcLineSpace(BOX_LINE_RIGHT); - aCalcSz.Height()+= rBox.CalcLineSpace(BOX_LINE_TOP) + - rBox.CalcLineSpace(BOX_LINE_BOTTOM); + aCalcSz.Width() += rBox.CalcLineSpace(SvxBoxItemLine::LEFT) + + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); + aCalcSz.Height()+= rBox.CalcLineSpace(SvxBoxItemLine::TOP) + + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); const SwFmtFrmSize& rOldAttr = pFmt->GetFrmSize(); if( rOldAttr.GetSize() != aCalcSz ) { diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index e9e115258e10..8f1cf9914b1f 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -572,7 +572,7 @@ bool SwAutoFormat::DoUnderline() 0); aSet.Put( SwParaConnectBorderItem( false ) ); SvxBoxItem aBox( RES_BOX ); - aBox.SetLine( &aLine, BOX_LINE_BOTTOM ); + aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM ); aBox.SetDistance( 42 ); // ~0,75 mm aSet.Put(aBox); m_pDoc->getIDocumentContentOperations().InsertItemSet( m_aDelPam, aSet ); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 4a1f369b8cb7..d08835d11cde 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1030,7 +1030,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, .GetItemState( RES_BOX, false, &pItem )) { SvxBoxItem aBox( *static_cast<const SvxBoxItem*>(pItem) ); - aBox.SetLine( 0, BOX_LINE_RIGHT ); + aBox.SetLine( 0, SvxBoxItemLine::RIGHT ); pBox->GetFrmFmt()->SetFmtAttr( aBox ); } } @@ -1313,8 +1313,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, { SvxBoxItem aBox( pFirstBox->GetFrmFmt()->GetBox() ); const SvxBoxItem& rBox = pLastBox->GetFrmFmt()->GetBox(); - aBox.SetLine( rBox.GetRight(), BOX_LINE_RIGHT ); - aBox.SetLine( rBox.GetBottom(), BOX_LINE_BOTTOM ); + aBox.SetLine( rBox.GetRight(), SvxBoxItemLine::RIGHT ); + aBox.SetLine( rBox.GetBottom(), SvxBoxItemLine::BOTTOM ); if( aBox.GetLeft() || aBox.GetTop() || aBox.GetRight() || aBox.GetBottom() ) (*ppMergeBox)->GetFrmFmt()->SetFmtAttr( aBox ); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 912bc83046be..228e61ba4169 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -818,8 +818,8 @@ void SwGrfNode::ScaleImageMap() { SwTwips nWidth = rFrmSize.GetWidth(); - nWidth -= rBox.CalcLineSpace(BOX_LINE_LEFT) + - rBox.CalcLineSpace(BOX_LINE_RIGHT); + nWidth -= rBox.CalcLineSpace(SvxBoxItemLine::LEFT) + + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); OSL_ENSURE( nWidth>0, "Do any 0 twip wide graphics exist!?" ); @@ -833,8 +833,8 @@ void SwGrfNode::ScaleImageMap() { SwTwips nHeight = rFrmSize.GetHeight(); - nHeight -= rBox.CalcLineSpace(BOX_LINE_TOP) + - rBox.CalcLineSpace(BOX_LINE_BOTTOM); + nHeight -= rBox.CalcLineSpace(SvxBoxItemLine::TOP) + + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); OSL_ENSURE( nHeight>0, "Do any 0 twip high graphics exist!?" ); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 7e4bc12d0000..78d36124a07a 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1990,8 +1990,8 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const void SwBorderAttrs::_CalcTopLine() { nTopLine = (bBorderDist && !rBox.GetTop()) - ? rBox.GetDistance (BOX_LINE_TOP) - : rBox.CalcLineSpace(BOX_LINE_TOP); + ? rBox.GetDistance (SvxBoxItemLine::TOP) + : rBox.CalcLineSpace(SvxBoxItemLine::TOP); nTopLine = nTopLine + rShadow.CalcShadowSpace(SHADOW_TOP); bTopLine = false; } @@ -1999,8 +1999,8 @@ void SwBorderAttrs::_CalcTopLine() void SwBorderAttrs::_CalcBottomLine() { nBottomLine = (bBorderDist && !rBox.GetBottom()) - ? rBox.GetDistance (BOX_LINE_BOTTOM) - : rBox.CalcLineSpace(BOX_LINE_BOTTOM); + ? rBox.GetDistance (SvxBoxItemLine::BOTTOM) + : rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); nBottomLine = nBottomLine + rShadow.CalcShadowSpace(SHADOW_BOTTOM); bBottomLine = false; } @@ -2008,8 +2008,8 @@ void SwBorderAttrs::_CalcBottomLine() void SwBorderAttrs::_CalcLeftLine() { nLeftLine = (bBorderDist && !rBox.GetLeft()) - ? rBox.GetDistance (BOX_LINE_LEFT) - : rBox.CalcLineSpace(BOX_LINE_LEFT); + ? rBox.GetDistance (SvxBoxItemLine::LEFT) + : rBox.CalcLineSpace(SvxBoxItemLine::LEFT); nLeftLine = nLeftLine + rShadow.CalcShadowSpace(SHADOW_LEFT); bLeftLine = false; } @@ -2017,8 +2017,8 @@ void SwBorderAttrs::_CalcLeftLine() void SwBorderAttrs::_CalcRightLine() { nRightLine = (bBorderDist && !rBox.GetRight()) - ? rBox.GetDistance (BOX_LINE_RIGHT) - : rBox.CalcLineSpace(BOX_LINE_RIGHT); + ? rBox.GetDistance (SvxBoxItemLine::RIGHT) + : rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); nRightLine = nRightLine + rShadow.CalcShadowSpace(SHADOW_RIGHT); bRightLine = false; } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d753f2ba7f99..16e6d44eab99 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1450,10 +1450,10 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, if ( bTop ) { SwTwips nDiff = rBox.GetTop() ? - rBox.CalcLineSpace( BOX_LINE_TOP ) : + rBox.CalcLineSpace( SvxBoxItemLine::TOP ) : ( rAttrs.IsBorderDist() ? // Increase of distance by one twip is incorrect. - rBox.GetDistance( BOX_LINE_TOP ) : 0 ); + rBox.GetDistance( SvxBoxItemLine::TOP ) : 0 ); if( nDiff ) (rRect.*fnRect->fnSubTop)( nDiff ); } @@ -1473,26 +1473,26 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, else { nDiff = rBox.GetBottom() ? - rBox.CalcLineSpace( BOX_LINE_BOTTOM ) : + rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM ) : ( rAttrs.IsBorderDist() ? // Increase of distance by one twip is incorrect. - rBox.GetDistance( BOX_LINE_BOTTOM ) : 0 ); + rBox.GetDistance( SvxBoxItemLine::BOTTOM ) : 0 ); } if( nDiff ) (rRect.*fnRect->fnAddBottom)( nDiff ); } if ( rBox.GetLeft() ) - (rRect.*fnRect->fnSubLeft)( rBox.CalcLineSpace( BOX_LINE_LEFT ) ); + (rRect.*fnRect->fnSubLeft)( rBox.CalcLineSpace( SvxBoxItemLine::LEFT ) ); else if ( rAttrs.IsBorderDist() ) // Increase of distance by one twip is incorrect. - (rRect.*fnRect->fnSubLeft)( rBox.GetDistance( BOX_LINE_LEFT ) ); + (rRect.*fnRect->fnSubLeft)( rBox.GetDistance( SvxBoxItemLine::LEFT ) ); if ( rBox.GetRight() ) - (rRect.*fnRect->fnAddRight)( rBox.CalcLineSpace( BOX_LINE_RIGHT ) ); + (rRect.*fnRect->fnAddRight)( rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ) ); else if ( rAttrs.IsBorderDist() ) // Increase of distance by one twip is incorrect. - (rRect.*fnRect->fnAddRight)( rBox.GetDistance( BOX_LINE_RIGHT ) ); + (rRect.*fnRect->fnAddRight)( rBox.GetDistance( SvxBoxItemLine::RIGHT ) ); if ( bShadow && rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE ) { diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index b25ea093d5f5..74cb35ee70e0 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -656,13 +656,13 @@ const SwRect SwFrm::UnionFrm( bool bBorder ) const const SwBorderAttrs &rAttrs = *aAccess.Get(); const SvxBoxItem &rBox = rAttrs.GetBox(); if ( rBox.GetLeft() ) - nLeft -= rBox.CalcLineSpace( BOX_LINE_LEFT ); + nLeft -= rBox.CalcLineSpace( SvxBoxItemLine::LEFT ); else if ( rAttrs.IsBorderDist() ) - nLeft -= rBox.GetDistance( BOX_LINE_LEFT ) + 1; + nLeft -= rBox.GetDistance( SvxBoxItemLine::LEFT ) + 1; if ( rBox.GetRight() ) - nAdd += rBox.CalcLineSpace( BOX_LINE_RIGHT ); + nAdd += rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ); else if ( rAttrs.IsBorderDist() ) - nAdd += rBox.GetDistance( BOX_LINE_RIGHT ) + 1; + nAdd += rBox.GetDistance( SvxBoxItemLine::RIGHT ) + 1; if( rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE ) { const SvxShadowItem &rShadow = rAttrs.GetShadow(); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 6ab7825db965..20145d5cda89 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -3838,7 +3838,7 @@ static sal_uInt16 lcl_GetTopSpace( const SwRowFrm& rRow ) { const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet(); const SvxBoxItem& rBoxItem = rSet.GetBox(); - nTmpTopSpace = rBoxItem.CalcLineSpace( BOX_LINE_TOP, true ); + nTmpTopSpace = rBoxItem.CalcLineSpace( SvxBoxItemLine::TOP, true ); } nTopSpace = std::max( nTopSpace, nTmpTopSpace ); } @@ -3859,7 +3859,7 @@ static sal_uInt16 lcl_GetTopLineDist( const SwRowFrm& rRow ) { const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet(); const SvxBoxItem& rBoxItem = rSet.GetBox(); - nTmpTopLineDist = rBoxItem.GetDistance( BOX_LINE_TOP ); + nTmpTopLineDist = rBoxItem.GetDistance( SvxBoxItemLine::TOP ); } nTopLineDist = std::max( nTopLineDist, nTmpTopLineDist ); } @@ -3883,8 +3883,8 @@ static sal_uInt16 lcl_GetBottomLineSize( const SwRowFrm& rRow ) { const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet(); const SvxBoxItem& rBoxItem = rSet.GetBox(); - nTmpBottomLineSize = rBoxItem.CalcLineSpace( BOX_LINE_BOTTOM, true ) - - rBoxItem.GetDistance( BOX_LINE_BOTTOM ); + nTmpBottomLineSize = rBoxItem.CalcLineSpace( SvxBoxItemLine::BOTTOM, true ) - + rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ); } nBottomLineSize = std::max( nBottomLineSize, nTmpBottomLineSize ); } @@ -3908,7 +3908,7 @@ static sal_uInt16 lcl_GetBottomLineDist( const SwRowFrm& rRow ) { const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet(); const SvxBoxItem& rBoxItem = rSet.GetBox(); - nTmpBottomLineDist = rBoxItem.GetDistance( BOX_LINE_BOTTOM ); + nTmpBottomLineDist = rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ); } nBottomLineDist = std::max( nBottomLineDist, nTmpBottomLineDist ); } @@ -4666,8 +4666,8 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs ) if ( pTab->IsCollapsingBorders() && !Lower()->IsRowFrm() ) { const SvxBoxItem& rBoxItem = pAttrs->GetBox(); - nLeftSpace = rBoxItem.GetDistance( BOX_LINE_LEFT ); - nRightSpace = rBoxItem.GetDistance( BOX_LINE_RIGHT ); + nLeftSpace = rBoxItem.GetDistance( SvxBoxItemLine::LEFT ); + nRightSpace = rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ); nTopSpace = static_cast<SwRowFrm*>(GetUpper())->GetTopMarginForLowers(); nBottomSpace = static_cast<SwRowFrm*>(GetUpper())->GetBottomMarginForLowers(); } diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index dbb1d007d41d..fb1f78b0ae61 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -742,7 +742,7 @@ bool SwTable::NewInsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, if( aSelBoxItem.GetRight() ) { pNoRightBorder = new SvxBoxItem( aSelBoxItem ); - pNoRightBorder->SetLine( 0, BOX_LINE_RIGHT ); + pNoRightBorder->SetLine( 0, SvxBoxItemLine::RIGHT ); } for( sal_uInt16 j = 0; j < nCnt; ++j ) { @@ -951,8 +951,8 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes, SvxBoxItem aBox( pMergeBox->GetFrmFmt()->GetBox() ); bool bOld = aBox.GetRight() || aBox.GetBottom(); const SvxBoxItem& rBox = pLastBox->GetFrmFmt()->GetBox(); - aBox.SetLine( rBox.GetRight(), BOX_LINE_RIGHT ); - aBox.SetLine( rBox.GetBottom(), BOX_LINE_BOTTOM ); + aBox.SetLine( rBox.GetRight(), SvxBoxItemLine::RIGHT ); + aBox.SetLine( rBox.GetBottom(), SvxBoxItemLine::BOTTOM ); if( bOld || aBox.GetLeft() || aBox.GetTop() || aBox.GetRight() || aBox.GetBottom() ) (*ppMergeBox)->GetFrmFmt()->SetFmtAttr( aBox ); } diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index 0bf4e711aadd..80f2dee123f4 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -698,10 +698,10 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush ) rFnt.SetBottomBorder( aBoxItem.GetBottom() ); rFnt.SetRightBorder( aBoxItem.GetRight() ); rFnt.SetLeftBorder( aBoxItem.GetLeft() ); - rFnt.SetTopBorderDist( aBoxItem.GetDistance(BOX_LINE_TOP) ); - rFnt.SetBottomBorderDist( aBoxItem.GetDistance(BOX_LINE_BOTTOM) ); - rFnt.SetRightBorderDist( aBoxItem.GetDistance(BOX_LINE_RIGHT) ); - rFnt.SetLeftBorderDist( aBoxItem.GetDistance(BOX_LINE_LEFT) ); + rFnt.SetTopBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::TOP) ); + rFnt.SetBottomBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::BOTTOM) ); + rFnt.SetRightBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::RIGHT) ); + rFnt.SetLeftBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::LEFT) ); break; } case RES_CHRATR_SHADOW: diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index f7a6d750e3be..db618f9d6886 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -673,10 +673,10 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, SetBottomBorder(pBoxItem->GetBottom()); SetRightBorder(pBoxItem->GetRight()); SetLeftBorder(pBoxItem->GetLeft()); - SetTopBorderDist(pBoxItem->GetDistance(BOX_LINE_TOP)); - SetBottomBorderDist(pBoxItem->GetDistance(BOX_LINE_BOTTOM)); - SetRightBorderDist(pBoxItem->GetDistance(BOX_LINE_RIGHT)); - SetLeftBorderDist(pBoxItem->GetDistance(BOX_LINE_LEFT)); + SetTopBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::TOP)); + SetBottomBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::BOTTOM)); + SetRightBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::RIGHT)); + SetLeftBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::LEFT)); } if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_SHADOW, true, &pItem )) @@ -857,10 +857,10 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, SetBottomBorder(pBoxItem->GetBottom()); SetRightBorder(pBoxItem->GetRight()); SetLeftBorder(pBoxItem->GetLeft()); - SetTopBorderDist(pBoxItem->GetDistance(BOX_LINE_TOP)); - SetBottomBorderDist(pBoxItem->GetDistance(BOX_LINE_BOTTOM)); - SetRightBorderDist(pBoxItem->GetDistance(BOX_LINE_RIGHT)); - SetLeftBorderDist(pBoxItem->GetDistance(BOX_LINE_LEFT)); + SetTopBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::TOP)); + SetBottomBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::BOTTOM)); + SetRightBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::RIGHT)); + SetLeftBorderDist(pBoxItem->GetDistance(SvxBoxItemLine::LEFT)); } else { diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index aa259f2c8590..8986268d449c 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2747,22 +2747,22 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An SvxBoxItem aBox( RES_BOX ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); - aBox.SetLine(aTopLine.isEmpty() ? 0 : &aTopLine, BOX_LINE_TOP); + aBox.SetLine(aTopLine.isEmpty() ? 0 : &aTopLine, SvxBoxItemLine::TOP); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::TOP, aBorder.IsTopLineValid); - aBox.SetLine(aBottomLine.isEmpty() ? 0 : &aBottomLine, BOX_LINE_BOTTOM); + aBox.SetLine(aBottomLine.isEmpty() ? 0 : &aBottomLine, SvxBoxItemLine::BOTTOM); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::BOTTOM, aBorder.IsBottomLineValid); - aBox.SetLine(aLeftLine.isEmpty() ? 0 : &aLeftLine, BOX_LINE_LEFT); + aBox.SetLine(aLeftLine.isEmpty() ? 0 : &aLeftLine, SvxBoxItemLine::LEFT); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::LEFT, aBorder.IsLeftLineValid); - aBox.SetLine(aRightLine.isEmpty() ? 0 : &aRightLine, BOX_LINE_RIGHT); + aBox.SetLine(aRightLine.isEmpty() ? 0 : &aRightLine, SvxBoxItemLine::RIGHT); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::RIGHT, aBorder.IsRightLineValid); - aBoxInfo.SetLine(aHoriLine.isEmpty() ? 0 : &aHoriLine, BOXINFO_LINE_HORI); + aBoxInfo.SetLine(aHoriLine.isEmpty() ? 0 : &aHoriLine, SvxBoxInfoItemLine::HORI); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI, aBorder.IsHorizontalLineValid); - aBoxInfo.SetLine(aVertLine.isEmpty() ? 0 : &aVertLine, BOXINFO_LINE_VERT); + aBoxInfo.SetLine(aVertLine.isEmpty() ? 0 : &aVertLine, SvxBoxInfoItemLine::VERT); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, aBorder.IsVerticalLineValid); aBox.SetDistance((sal_uInt16)convertMm100ToTwip(aBorder.Distance)); @@ -2804,21 +2804,21 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An const SwFrmFmt* pBoxFmt = pBox->GetFrmFmt(); const SvxBoxItem& rBox = pBoxFmt->GetBox(); if( - (aTableBorderDistances.IsLeftDistanceValid && nLeftDistance != rBox.GetDistance( BOX_LINE_LEFT )) || - (aTableBorderDistances.IsRightDistanceValid && nRightDistance != rBox.GetDistance( BOX_LINE_RIGHT )) || - (aTableBorderDistances.IsTopDistanceValid && nTopDistance != rBox.GetDistance( BOX_LINE_TOP )) || - (aTableBorderDistances.IsBottomDistanceValid && nBottomDistance != rBox.GetDistance( BOX_LINE_BOTTOM ))) + (aTableBorderDistances.IsLeftDistanceValid && nLeftDistance != rBox.GetDistance( SvxBoxItemLine::LEFT )) || + (aTableBorderDistances.IsRightDistanceValid && nRightDistance != rBox.GetDistance( SvxBoxItemLine::RIGHT )) || + (aTableBorderDistances.IsTopDistanceValid && nTopDistance != rBox.GetDistance( SvxBoxItemLine::TOP )) || + (aTableBorderDistances.IsBottomDistanceValid && nBottomDistance != rBox.GetDistance( SvxBoxItemLine::BOTTOM ))) { SvxBoxItem aSetBox( rBox ); SwFrmFmt* pSetBoxFmt = pBox->ClaimFrmFmt(); if( aTableBorderDistances.IsLeftDistanceValid ) - aSetBox.SetDistance( nLeftDistance, BOX_LINE_LEFT ); + aSetBox.SetDistance( nLeftDistance, SvxBoxItemLine::LEFT ); if( aTableBorderDistances.IsRightDistanceValid ) - aSetBox.SetDistance( nRightDistance, BOX_LINE_RIGHT ); + aSetBox.SetDistance( nRightDistance, SvxBoxItemLine::RIGHT ); if( aTableBorderDistances.IsTopDistanceValid ) - aSetBox.SetDistance( nTopDistance, BOX_LINE_TOP ); + aSetBox.SetDistance( nTopDistance, SvxBoxItemLine::TOP ); if( aTableBorderDistances.IsBottomDistanceValid ) - aSetBox.SetDistance( nBottomDistance, BOX_LINE_BOTTOM ); + aSetBox.SetDistance( nBottomDistance, SvxBoxItemLine::BOTTOM ); pDoc->SetAttr( aSetBox, *pSetBoxFmt ); } } @@ -3005,25 +3005,25 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) const SvxBoxItem& rBox = pBoxFmt->GetBox(); if( bFirst ) { - nLeftDistance = convertTwipToMm100( rBox.GetDistance( BOX_LINE_LEFT )); - nRightDistance = convertTwipToMm100( rBox.GetDistance( BOX_LINE_RIGHT )); - nTopDistance = convertTwipToMm100( rBox.GetDistance( BOX_LINE_TOP )); - nBottomDistance = convertTwipToMm100( rBox.GetDistance( BOX_LINE_BOTTOM )); + nLeftDistance = convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::LEFT )); + nRightDistance = convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::RIGHT )); + nTopDistance = convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::TOP )); + nBottomDistance = convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::BOTTOM )); bFirst = false; } else { if( aTableBorderDistances.IsLeftDistanceValid && - nLeftDistance != convertTwipToMm100( rBox.GetDistance( BOX_LINE_LEFT ))) + nLeftDistance != convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::LEFT ))) aTableBorderDistances.IsLeftDistanceValid = sal_False; if( aTableBorderDistances.IsRightDistanceValid && - nRightDistance != convertTwipToMm100( rBox.GetDistance( BOX_LINE_RIGHT ))) + nRightDistance != convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::RIGHT ))) aTableBorderDistances.IsRightDistanceValid = sal_False; if( aTableBorderDistances.IsTopDistanceValid && - nTopDistance != convertTwipToMm100( rBox.GetDistance( BOX_LINE_TOP ))) + nTopDistance != convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::TOP ))) aTableBorderDistances.IsTopDistanceValid = sal_False; if( aTableBorderDistances.IsBottomDistanceValid && - nBottomDistance != convertTwipToMm100( rBox.GetDistance( BOX_LINE_BOTTOM ))) + nBottomDistance != convertTwipToMm100( rBox.GetDistance( SvxBoxItemLine::BOTTOM ))) aTableBorderDistances.IsBottomDistanceValid = sal_False; } |