diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-16 12:44:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-17 06:04:30 +0000 |
commit | f2a873cd13adf0b74d18af203676f2de86d1cb2e (patch) | |
tree | 8b0f044b217e86db3c7320855e4df133fbabf3ae /editeng | |
parent | 1bffa5e110772a7d6183ac64e56c23f2c3019f93 (diff) |
convert SvxBorderStyle to scoped enum
and rename to SvxBorderLineStyle
Change-Id: I19e530f162e4ca6290a0ad076e7fe3d5775ae6bc
Reviewed-on: https://gerrit.libreoffice.org/35265
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/qa/items/borderline_test.cxx | 30 | ||||
-rw-r--r-- | editeng/source/items/borderline.cxx | 214 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 26 | ||||
-rw-r--r-- | editeng/source/rtf/rtfitem.cxx | 28 |
4 files changed, 149 insertions, 149 deletions
diff --git a/editeng/qa/items/borderline_test.cxx b/editeng/qa/items/borderline_test.cxx index 58a46ffc8b01..a44c2927d4cb 100644 --- a/editeng/qa/items/borderline_test.cxx +++ b/editeng/qa/items/borderline_test.cxx @@ -30,14 +30,14 @@ using namespace editeng; CPPUNIT_NS_BEGIN -template<> struct assertion_traits<SvxBorderStyle> +template<> struct assertion_traits<SvxBorderLineStyle> { - static bool equal( SvxBorderStyle x, SvxBorderStyle y ) + static bool equal( SvxBorderLineStyle x, SvxBorderLineStyle y ) { return x == y; } - static std::string toString( SvxBorderStyle x ) + static std::string toString( SvxBorderLineStyle x ) { OStringStream ost; ost << static_cast<unsigned int>(x); @@ -75,8 +75,8 @@ void BorderLineTest::testGuessWidthDouble() { // Normal double case SvxBorderLine line; - line.GuessLinesWidths( DOUBLE, TEST_WIDTH, TEST_WIDTH, TEST_WIDTH ); - CPPUNIT_ASSERT_EQUAL( DOUBLE, line.GetBorderLineStyle() ); + line.GuessLinesWidths( SvxBorderLineStyle::DOUBLE, TEST_WIDTH, TEST_WIDTH, TEST_WIDTH ); + CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::DOUBLE, line.GetBorderLineStyle() ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<long>(line.GetOutWidth()) ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<long>(line.GetInWidth()) ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<long>(line.GetDistance()) ); @@ -86,9 +86,9 @@ void BorderLineTest::testGuessWidthDouble() void BorderLineTest::testGuessWidthNoMatch() { SvxBorderLine line; - line.GuessLinesWidths( DOUBLE, + line.GuessLinesWidths( SvxBorderLineStyle::DOUBLE, TEST_WIDTH + 1, TEST_WIDTH + 2, TEST_WIDTH + 3 ); - CPPUNIT_ASSERT_EQUAL( DOUBLE, line.GetBorderLineStyle() ); + CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::DOUBLE, line.GetBorderLineStyle() ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+1, static_cast<long>(line.GetOutWidth()) ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+2, static_cast<long>(line.GetInWidth()) ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+3, static_cast<long>(line.GetDistance())); @@ -98,11 +98,11 @@ void BorderLineTest::testGuessWidthNoMatch() void BorderLineTest::testGuessWidthThinthickSmallgap() { SvxBorderLine line; - line.GuessLinesWidths( DOUBLE, + line.GuessLinesWidths( SvxBorderLineStyle::DOUBLE, THINTHICKSG_OUT_WIDTH, THINTHICKSG_IN_WIDTH, THINTHICKSG_DIST_WIDTH ); - CPPUNIT_ASSERT_EQUAL( THINTHICK_SMALLGAP, line.GetBorderLineStyle() ); + CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::THINTHICK_SMALLGAP, line.GetBorderLineStyle() ); CPPUNIT_ASSERT_EQUAL( THINTHICKSG_OUT_WIDTH, static_cast<long>(line.GetOutWidth()) ); CPPUNIT_ASSERT_EQUAL( THINTHICKSG_IN_WIDTH, @@ -116,11 +116,11 @@ void BorderLineTest::testGuessWidthThinthickSmallgap() void BorderLineTest::testGuessWidthThinthickLargegap() { SvxBorderLine line; - line.GuessLinesWidths( DOUBLE, + line.GuessLinesWidths( SvxBorderLineStyle::DOUBLE, THINTHICKLG_OUT_WIDTH, THINTHICKLG_IN_WIDTH, THINTHICKLG_DIST_WIDTH ); - CPPUNIT_ASSERT_EQUAL( THINTHICK_LARGEGAP, line.GetBorderLineStyle() ); + CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::THINTHICK_LARGEGAP, line.GetBorderLineStyle() ); CPPUNIT_ASSERT_EQUAL( THINTHICKLG_OUT_WIDTH, static_cast<long>(line.GetOutWidth()) ); CPPUNIT_ASSERT_EQUAL( THINTHICKLG_IN_WIDTH, @@ -134,11 +134,11 @@ void BorderLineTest::testGuessWidthThinthickLargegap() void BorderLineTest::testGuessWidthNostyleDouble() { SvxBorderLine line; - line.GuessLinesWidths( css::table::BorderLineStyle::NONE, + line.GuessLinesWidths( SvxBorderLineStyle::NONE, THINTHICKLG_OUT_WIDTH, THINTHICKLG_IN_WIDTH, THINTHICKLG_DIST_WIDTH ); - CPPUNIT_ASSERT_EQUAL( THINTHICK_LARGEGAP, line.GetBorderLineStyle() ); + CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::THINTHICK_LARGEGAP, line.GetBorderLineStyle() ); CPPUNIT_ASSERT_EQUAL( THINTHICKLG_OUT_WIDTH, static_cast<long>(line.GetOutWidth()) ); CPPUNIT_ASSERT_EQUAL( THINTHICKLG_IN_WIDTH, @@ -152,8 +152,8 @@ void BorderLineTest::testGuessWidthNostyleDouble() void BorderLineTest::testGuessWidthNostyleSingle() { SvxBorderLine line; - line.GuessLinesWidths( css::table::BorderLineStyle::NONE, TEST_WIDTH ); - CPPUNIT_ASSERT_EQUAL( SOLID, line.GetBorderLineStyle() ); + line.GuessLinesWidths( SvxBorderLineStyle::NONE, TEST_WIDTH ); + CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::SOLID, line.GetBorderLineStyle() ); CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, line.GetWidth() ); } diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx index 41aaf8f0bbbd..6b766b4b85ab 100644 --- a/editeng/source/items/borderline.cxx +++ b/editeng/source/items/borderline.cxx @@ -90,7 +90,7 @@ Color SvxBorderLine::threeDMediumColor( Color aMain ) } SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth, - SvxBorderStyle nStyle, + SvxBorderLineStyle nStyle, Color (*pColorOutFn)( Color ), Color (*pColorInFn)( Color ) ) : m_nWidth( nWidth ) , m_bMirrorWidths( false ) @@ -108,7 +108,7 @@ SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth, } -SvxBorderStyle +SvxBorderLineStyle ConvertBorderStyleFromWord(int const nWordLineStyle) { switch (nWordLineStyle) @@ -119,50 +119,50 @@ ConvertBorderStyleFromWord(int const nWordLineStyle) case 5: // hairline // and the unsupported special cases which we map to a single line case 20: - return SOLID; + return SvxBorderLineStyle::SOLID; case 6: - return DOTTED; + return SvxBorderLineStyle::DOTTED; case 7: - return DASHED; + return SvxBorderLineStyle::DASHED; case 22: - return FINE_DASHED; + return SvxBorderLineStyle::FINE_DASHED; case 8: - return DASH_DOT; + return SvxBorderLineStyle::DASH_DOT; case 9: - return DASH_DOT_DOT; + return SvxBorderLineStyle::DASH_DOT_DOT; // then the shading beams which we represent by a double line case 23: - return DOUBLE; + return SvxBorderLineStyle::DOUBLE; // then the double lines, for which we have good matches case 3: case 10: // Don't have triple so use double case 21: // Don't have double wave: use double instead - return DOUBLE; + return SvxBorderLineStyle::DOUBLE; case 11: - return THINTHICK_SMALLGAP; + return SvxBorderLineStyle::THINTHICK_SMALLGAP; case 12: case 13: // Don't have thin thick thin, so use thick thin - return THICKTHIN_SMALLGAP; + return SvxBorderLineStyle::THICKTHIN_SMALLGAP; case 14: - return THINTHICK_MEDIUMGAP; + return SvxBorderLineStyle::THINTHICK_MEDIUMGAP; case 15: case 16: // Don't have thin thick thin, so use thick thin - return THICKTHIN_MEDIUMGAP; + return SvxBorderLineStyle::THICKTHIN_MEDIUMGAP; case 17: - return THINTHICK_LARGEGAP; + return SvxBorderLineStyle::THINTHICK_LARGEGAP; case 18: case 19: // Don't have thin thick thin, so use thick thin - return THICKTHIN_LARGEGAP; + return SvxBorderLineStyle::THICKTHIN_LARGEGAP; case 24: - return EMBOSSED; + return SvxBorderLineStyle::EMBOSSED; case 25: - return ENGRAVED; + return SvxBorderLineStyle::ENGRAVED; case 26: - return OUTSET; + return SvxBorderLineStyle::OUTSET; case 27: - return INSET; + return SvxBorderLineStyle::INSET; default: - return css::table::BorderLineStyle::NONE; + return SvxBorderLineStyle::NONE; } } @@ -178,7 +178,7 @@ static const double OUTSET_line1 = 15.0; static const double INSET_line2 = 15.0; double -ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const i_fWidth, +ConvertBorderWidthFromWord(SvxBorderLineStyle const eStyle, double const i_fWidth, int const nWordLineStyle) { // fdo#68779: at least for RTF, 0.75pt is the default if width is missing @@ -186,7 +186,7 @@ ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const i_fWidth, switch (eStyle) { // Single lines - case SOLID: + case SvxBorderLineStyle::SOLID: switch (nWordLineStyle) { case 2: @@ -198,42 +198,42 @@ ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const i_fWidth, } break; - case DOTTED: - case DASHED: - case DASH_DOT: - case DASH_DOT_DOT: + case SvxBorderLineStyle::DOTTED: + case SvxBorderLineStyle::DASHED: + case SvxBorderLineStyle::DASH_DOT: + case SvxBorderLineStyle::DASH_DOT_DOT: return fWidth; // Display a minimum effective border width of 1pt - case FINE_DASHED: + case SvxBorderLineStyle::FINE_DASHED: return (fWidth > 0 && fWidth < 20) ? 20 : fWidth; // Double lines - case DOUBLE: + case SvxBorderLineStyle::DOUBLE: return fWidth * 3.0; - case THINTHICK_MEDIUMGAP: - case THICKTHIN_MEDIUMGAP: - case EMBOSSED: - case ENGRAVED: + case SvxBorderLineStyle::THINTHICK_MEDIUMGAP: + case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP: + case SvxBorderLineStyle::EMBOSSED: + case SvxBorderLineStyle::ENGRAVED: return fWidth * 2.0; - case THINTHICK_SMALLGAP: + case SvxBorderLineStyle::THINTHICK_SMALLGAP: return fWidth + THINTHICK_SMALLGAP_line2 + THINTHICK_SMALLGAP_gap; - case THINTHICK_LARGEGAP: + case SvxBorderLineStyle::THINTHICK_LARGEGAP: return fWidth + THINTHICK_LARGEGAP_line1 + THINTHICK_LARGEGAP_line2; - case THICKTHIN_SMALLGAP: + case SvxBorderLineStyle::THICKTHIN_SMALLGAP: return fWidth + THICKTHIN_SMALLGAP_line1 + THICKTHIN_SMALLGAP_gap; - case THICKTHIN_LARGEGAP: + case SvxBorderLineStyle::THICKTHIN_LARGEGAP: return fWidth + THICKTHIN_LARGEGAP_line1 + THICKTHIN_LARGEGAP_line2; - case OUTSET: + case SvxBorderLineStyle::OUTSET: return (fWidth * 2.0) + OUTSET_line1; - case INSET: + case SvxBorderLineStyle::INSET: return (fWidth * 2.0) + INSET_line2; default: @@ -243,49 +243,49 @@ ConvertBorderWidthFromWord(SvxBorderStyle const eStyle, double const i_fWidth, } double -ConvertBorderWidthToWord(SvxBorderStyle const eStyle, double const fWidth) +ConvertBorderWidthToWord(SvxBorderLineStyle const eStyle, double const fWidth) { switch (eStyle) { // Single lines - case SOLID: - case DOTTED: - case DASHED: - case FINE_DASHED: - case DASH_DOT: - case DASH_DOT_DOT: + case SvxBorderLineStyle::SOLID: + case SvxBorderLineStyle::DOTTED: + case SvxBorderLineStyle::DASHED: + case SvxBorderLineStyle::FINE_DASHED: + case SvxBorderLineStyle::DASH_DOT: + case SvxBorderLineStyle::DASH_DOT_DOT: return fWidth; // Double lines - case DOUBLE: - case DOUBLE_THIN: + case SvxBorderLineStyle::DOUBLE: + case SvxBorderLineStyle::DOUBLE_THIN: return fWidth / 3.0; - case THINTHICK_MEDIUMGAP: - case THICKTHIN_MEDIUMGAP: - case EMBOSSED: - case ENGRAVED: + case SvxBorderLineStyle::THINTHICK_MEDIUMGAP: + case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP: + case SvxBorderLineStyle::EMBOSSED: + case SvxBorderLineStyle::ENGRAVED: return fWidth / 2.0; - case THINTHICK_SMALLGAP: + case SvxBorderLineStyle::THINTHICK_SMALLGAP: return fWidth - THINTHICK_SMALLGAP_line2 - THINTHICK_SMALLGAP_gap; - case THINTHICK_LARGEGAP: + case SvxBorderLineStyle::THINTHICK_LARGEGAP: return fWidth - THINTHICK_LARGEGAP_line1 - THINTHICK_LARGEGAP_line2; - case THICKTHIN_SMALLGAP: + case SvxBorderLineStyle::THICKTHIN_SMALLGAP: return fWidth - THICKTHIN_SMALLGAP_line1 - THICKTHIN_SMALLGAP_gap; - case THICKTHIN_LARGEGAP: + case SvxBorderLineStyle::THICKTHIN_LARGEGAP: return fWidth - THICKTHIN_LARGEGAP_line1 - THICKTHIN_LARGEGAP_line2; - case OUTSET: + case SvxBorderLineStyle::OUTSET: return (fWidth - OUTSET_line1) / 2.0; - case INSET: + case SvxBorderLineStyle::INSET: return (fWidth - INSET_line2) / 2.0; - case css::table::BorderLineStyle::NONE: + case SvxBorderLineStyle::NONE: return 0; default: @@ -298,30 +298,30 @@ ConvertBorderWidthToWord(SvxBorderStyle const eStyle, double const fWidth) units handled by the resulting object are Twips and the BorderWidthImpl::GetLine1() corresponds to the Outer Line. */ -BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) +BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderLineStyle nStyle ) { BorderWidthImpl aImpl; switch ( nStyle ) { // No line: no width - case css::table::BorderLineStyle::NONE: + case SvxBorderLineStyle::NONE: aImpl = BorderWidthImpl( BorderWidthImplFlags::FIXED, 0.0 ); break; // Single lines - case SOLID: - case DOTTED: - case DASHED: - case FINE_DASHED: - case DASH_DOT: - case DASH_DOT_DOT: + case SvxBorderLineStyle::SOLID: + case SvxBorderLineStyle::DOTTED: + case SvxBorderLineStyle::DASHED: + case SvxBorderLineStyle::FINE_DASHED: + case SvxBorderLineStyle::DASH_DOT: + case SvxBorderLineStyle::DASH_DOT_DOT: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1, 1.0 ); break; // Double lines - case DOUBLE: + case SvxBorderLineStyle::DOUBLE: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1 | BorderWidthImplFlags::CHANGE_LINE2 | BorderWidthImplFlags::CHANGE_DIST, // fdo#46112 fdo#38542 fdo#43249: @@ -329,38 +329,38 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) 1.0/3.0, 1.0/3.0, 1.0/3.0 ); break; - case DOUBLE_THIN: + case SvxBorderLineStyle::DOUBLE_THIN: aImpl = BorderWidthImpl(BorderWidthImplFlags::CHANGE_DIST, 10.0, 10.0, 1.0); break; - case THINTHICK_SMALLGAP: + case SvxBorderLineStyle::THINTHICK_SMALLGAP: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1, 1.0, THINTHICK_SMALLGAP_line2, THINTHICK_SMALLGAP_gap ); break; - case THINTHICK_MEDIUMGAP: + case SvxBorderLineStyle::THINTHICK_MEDIUMGAP: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1 | BorderWidthImplFlags::CHANGE_LINE2 | BorderWidthImplFlags::CHANGE_DIST, 0.5, 0.25, 0.25 ); break; - case THINTHICK_LARGEGAP: + case SvxBorderLineStyle::THINTHICK_LARGEGAP: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_DIST, THINTHICK_LARGEGAP_line1, THINTHICK_LARGEGAP_line2, 1.0 ); break; - case THICKTHIN_SMALLGAP: + case SvxBorderLineStyle::THICKTHIN_SMALLGAP: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE2, THICKTHIN_SMALLGAP_line1, 1.0, THICKTHIN_SMALLGAP_gap ); break; - case THICKTHIN_MEDIUMGAP: + case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1 | BorderWidthImplFlags::CHANGE_LINE2 | BorderWidthImplFlags::CHANGE_DIST, 0.25, 0.5, 0.25 ); break; - case THICKTHIN_LARGEGAP: + case SvxBorderLineStyle::THICKTHIN_LARGEGAP: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_DIST, THICKTHIN_LARGEGAP_line1, THICKTHIN_LARGEGAP_line2, 1.0 ); break; @@ -371,8 +371,8 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) * 0.75pt up to 3pt and then 3pt */ - case EMBOSSED: - case ENGRAVED: + case SvxBorderLineStyle::EMBOSSED: + case SvxBorderLineStyle::ENGRAVED: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1 | BorderWidthImplFlags::CHANGE_LINE2 | BorderWidthImplFlags::CHANGE_DIST, 0.25, 0.25, 0.5 ); @@ -383,13 +383,13 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) * Word compat: the gap width should be measured relatively to the biggest width for the * row or column. */ - case OUTSET: + case SvxBorderLineStyle::OUTSET: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE2 | BorderWidthImplFlags::CHANGE_DIST, OUTSET_line1, 0.5, 0.5 ); break; - case INSET: + case SvxBorderLineStyle::INSET: aImpl = BorderWidthImpl( BorderWidthImplFlags::CHANGE_LINE1 | BorderWidthImplFlags::CHANGE_DIST, 0.5, INSET_line2, 0.5 ); @@ -429,32 +429,32 @@ void SvxBorderLine::ScaleMetrics( long nMult, long nDiv ) m_nDiv = nDiv; } -void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sal_uInt16 nIn, sal_uInt16 nDist ) +void SvxBorderLine::GuessLinesWidths( SvxBorderLineStyle nStyle, sal_uInt16 nOut, sal_uInt16 nIn, sal_uInt16 nDist ) { - if (css::table::BorderLineStyle::NONE == nStyle) + if (SvxBorderLineStyle::NONE == nStyle) { - nStyle = SOLID; + nStyle = SvxBorderLineStyle::SOLID; if ( nOut > 0 && nIn > 0 ) - nStyle = DOUBLE; + nStyle = SvxBorderLineStyle::DOUBLE; } - if ( nStyle == DOUBLE ) + if ( nStyle == SvxBorderLineStyle::DOUBLE ) { - static const SvxBorderStyle aDoubleStyles[] = + static const SvxBorderLineStyle aDoubleStyles[] = { - DOUBLE, - DOUBLE_THIN, - THINTHICK_SMALLGAP, - THINTHICK_MEDIUMGAP, - THINTHICK_LARGEGAP, - THICKTHIN_SMALLGAP, - THICKTHIN_MEDIUMGAP, - THICKTHIN_LARGEGAP + SvxBorderLineStyle::DOUBLE, + SvxBorderLineStyle::DOUBLE_THIN, + SvxBorderLineStyle::THINTHICK_SMALLGAP, + SvxBorderLineStyle::THINTHICK_MEDIUMGAP, + SvxBorderLineStyle::THINTHICK_LARGEGAP, + SvxBorderLineStyle::THICKTHIN_SMALLGAP, + SvxBorderLineStyle::THICKTHIN_MEDIUMGAP, + SvxBorderLineStyle::THICKTHIN_LARGEGAP }; static size_t const len = SAL_N_ELEMENTS(aDoubleStyles); long nWidth = 0; - SvxBorderStyle nTestStyle(css::table::BorderLineStyle::NONE); + SvxBorderLineStyle nTestStyle(SvxBorderLineStyle::NONE); for (size_t i = 0; i < len && nWidth == 0; ++i) { nTestStyle = aDoubleStyles[i]; @@ -494,12 +494,12 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nOut, sa // and returns a 0 width. switch (nStyle) { - case SOLID: - case DOTTED: - case DASHED: - case FINE_DASHED: - case DASH_DOT: - case DASH_DOT_DOT: + case SvxBorderLineStyle::SOLID: + case SvxBorderLineStyle::DOTTED: + case SvxBorderLineStyle::DASHED: + case SvxBorderLineStyle::FINE_DASHED: + case SvxBorderLineStyle::DASH_DOT: + case SvxBorderLineStyle::DASH_DOT_DOT: std::swap( nOut, nIn); break; default: @@ -545,32 +545,32 @@ bool SvxBorderLine::operator==( const SvxBorderLine& rCmp ) const ( m_pColorGapFn == rCmp.m_pColorGapFn ) ); } -void SvxBorderLine::SetBorderLineStyle( SvxBorderStyle nNew ) +void SvxBorderLine::SetBorderLineStyle( SvxBorderLineStyle nNew ) { m_nStyle = nNew; m_aWidthImpl = getWidthImpl( m_nStyle ); switch ( nNew ) { - case EMBOSSED: + case SvxBorderLineStyle::EMBOSSED: m_pColorOutFn = threeDLightColor; m_pColorInFn = threeDDarkColor; m_pColorGapFn = threeDMediumColor; m_bUseLeftTop = true; break; - case ENGRAVED: + case SvxBorderLineStyle::ENGRAVED: m_pColorOutFn = threeDDarkColor; m_pColorInFn = threeDLightColor; m_pColorGapFn = threeDMediumColor; m_bUseLeftTop = true; break; - case OUTSET: + case SvxBorderLineStyle::OUTSET: m_pColorOutFn = lightColor; m_pColorInFn = darkColor; m_bUseLeftTop = true; m_pColorGapFn = nullptr; break; - case INSET: + case SvxBorderLineStyle::INSET: m_pColorOutFn = darkColor; m_pColorInFn = lightColor; m_bUseLeftTop = true; @@ -660,9 +660,9 @@ OUString SvxBorderLine::GetValueString(MapUnit eSrcUnit, }; OUString aStr = "(" + ::GetColorString( aColor ) + OUString(cpDelim); - if ( m_nStyle < int(SAL_N_ELEMENTS(aStyleIds)) ) + if ( (int)m_nStyle < int(SAL_N_ELEMENTS(aStyleIds)) ) { - sal_uInt16 nResId = aStyleIds[m_nStyle]; + sal_uInt16 nResId = aStyleIds[(int)m_nStyle]; aStr += EE_RESSTR(nResId); } else diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 88d319099f65..9dd99b8792e5 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -111,7 +111,7 @@ namespace .WriteUInt16( l.GetDistance() ); if (version >= BORDER_LINE_WITH_STYLE_VERSION) - stream.WriteUInt16( l.GetBorderLineStyle() ); + stream.WriteUInt16( (sal_uInt16)l.GetBorderLineStyle() ); return stream; } @@ -129,7 +129,7 @@ namespace stream.ReadUInt16( nStyle ); SvxBorderLine border(&aColor); - border.GuessLinesWidths(nStyle, nOutline, nInline, nDistance); + border.GuessLinesWidths((SvxBorderLineStyle)nStyle, nOutline, nInline, nDistance); return border; } @@ -1671,7 +1671,7 @@ table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, bool bC aLine.InnerLineWidth = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetInWidth() ): pLine->GetInWidth() ); aLine.OuterLineWidth = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetOutWidth()): pLine->GetOutWidth() ); aLine.LineDistance = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetDistance()): pLine->GetDistance() ); - aLine.LineStyle = pLine->GetBorderLineStyle(); + aLine.LineStyle = sal_Int16(pLine->GetBorderLineStyle()); aLine.LineWidth = sal_uInt32( bConvert ? convertTwipToMm100( pLine->GetWidth( ) ) : pLine->GetWidth( ) ); } else @@ -1786,10 +1786,10 @@ bool SvxBoxItem::LineToSvxLine(const css::table::BorderLine& rLine, SvxBorderLin bool SvxBoxItem::LineToSvxLine(const css::table::BorderLine2& rLine, SvxBorderLine& rSvxLine, bool bConvert) { - SvxBorderStyle const nStyle = + SvxBorderLineStyle const nStyle = (rLine.LineStyle < 0 || BORDER_LINE_STYLE_MAX < rLine.LineStyle) - ? SOLID // default - : rLine.LineStyle; + ? SvxBorderLineStyle::SOLID // default + : (SvxBorderLineStyle)rLine.LineStyle; rSvxLine.SetBorderLineStyle( nStyle ); @@ -1799,7 +1799,7 @@ SvxBoxItem::LineToSvxLine(const css::table::BorderLine2& rLine, SvxBorderLine& r rSvxLine.SetWidth( bConvert? convertMm100ToTwip( rLine.LineWidth ) : rLine.LineWidth ); // fdo#46112: double does not necessarily mean symmetric // for backwards compatibility - bGuessWidth = ((DOUBLE == nStyle || DOUBLE_THIN == nStyle)) && + bGuessWidth = ((SvxBorderLineStyle::DOUBLE == nStyle || SvxBorderLineStyle::DOUBLE_THIN == nStyle)) && (rLine.InnerLineWidth > 0) && (rLine.OuterLineWidth > 0); } @@ -1924,17 +1924,17 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { drawing::LineStyle eDrawingStyle; rVal >>= eDrawingStyle; - editeng::SvxBorderStyle eBorderStyle = css::table::BorderLineStyle::NONE; + SvxBorderLineStyle eBorderStyle = SvxBorderLineStyle::NONE; switch ( eDrawingStyle ) { default: case drawing::LineStyle_NONE: break; case drawing::LineStyle_SOLID: - eBorderStyle = SOLID; + eBorderStyle = SvxBorderLineStyle::SOLID; break; case drawing::LineStyle_DASH: - eBorderStyle = DASHED; + eBorderStyle = SvxBorderLineStyle::DASHED; break; } @@ -2669,7 +2669,7 @@ SfxPoolItem* SvxBoxInfoItem::Create( SvStream& rStrm, sal_uInt16 ) const Color aColor; ReadColor( rStrm, aColor ).ReadInt16( nOutline ).ReadInt16( nInline ).ReadInt16( nDistance ); SvxBorderLine aBorder( &aColor ); - aBorder.GuessLinesWidths(css::table::BorderLineStyle::NONE, nOutline, nInline, nDistance); + aBorder.GuessLinesWidths(SvxBorderLineStyle::NONE, nOutline, nInline, nDistance); switch( cLine ) { @@ -3166,7 +3166,7 @@ bool SvxLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemId ) { case MID_FG_COLOR: pLine->SetColor( Color(nVal) ); break; case MID_LINE_STYLE: - pLine->SetBorderLineStyle(static_cast<SvxBorderStyle>(nVal)); + pLine->SetBorderLineStyle(static_cast<SvxBorderLineStyle>(nVal)); break; default: OSL_FAIL( "Wrong MemberId" ); @@ -3237,7 +3237,7 @@ SfxPoolItem* SvxLineItem::Create( SvStream& rStrm, sal_uInt16 ) const if( nOutline ) { SvxBorderLine aLine( &aColor ); - aLine.GuessLinesWidths(css::table::BorderLineStyle::NONE, nOutline, nInline, nDistance); + aLine.GuessLinesWidths(SvxBorderLineStyle::NONE, nOutline, nInline, nDistance); _pLine->SetLine( &aLine ); } return _pLine; diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index f0d9f32ced68..584fc1ddcbdc 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -1453,49 +1453,49 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, } case RTF_BRDRDOT: // dotted border - aBrd.SetBorderLineStyle(table::BorderLineStyle::DOTTED); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::DOTTED); break; case RTF_BRDRDASH: // dashed border - aBrd.SetBorderLineStyle(table::BorderLineStyle::DASHED); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::DASHED); break; case RTF_BRDRHAIR: // hairline border { - aBrd.SetBorderLineStyle( table::BorderLineStyle::SOLID); + aBrd.SetBorderLineStyle( SvxBorderLineStyle::SOLID); aBrd.SetWidth( DEF_LINE_WIDTH_0 ); } break; case RTF_BRDRDB: // Double border - aBrd.SetBorderLineStyle(table::BorderLineStyle::DOUBLE); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE); break; case RTF_BRDRINSET: // inset border - aBrd.SetBorderLineStyle(table::BorderLineStyle::INSET); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::INSET); break; case RTF_BRDROUTSET: // outset border - aBrd.SetBorderLineStyle(table::BorderLineStyle::OUTSET); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::OUTSET); break; case RTF_BRDRTNTHSG: // ThinThick Small gap - aBrd.SetBorderLineStyle(table::BorderLineStyle::THINTHICK_SMALLGAP); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::THINTHICK_SMALLGAP); break; case RTF_BRDRTNTHMG: // ThinThick Medium gap - aBrd.SetBorderLineStyle(table::BorderLineStyle::THINTHICK_MEDIUMGAP); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::THINTHICK_MEDIUMGAP); break; case RTF_BRDRTNTHLG: // ThinThick Large gap - aBrd.SetBorderLineStyle(table::BorderLineStyle::THINTHICK_LARGEGAP); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::THINTHICK_LARGEGAP); break; case RTF_BRDRTHTNSG: // ThickThin Small gap - aBrd.SetBorderLineStyle(table::BorderLineStyle::THICKTHIN_SMALLGAP); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::THICKTHIN_SMALLGAP); break; case RTF_BRDRTHTNMG: // ThickThin Medium gap - aBrd.SetBorderLineStyle(table::BorderLineStyle::THICKTHIN_MEDIUMGAP); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::THICKTHIN_MEDIUMGAP); break; case RTF_BRDRTHTNLG: // ThickThin Large gap - aBrd.SetBorderLineStyle(table::BorderLineStyle::THICKTHIN_LARGEGAP); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::THICKTHIN_LARGEGAP); break; case RTF_BRDREMBOSS: // Embossed border - aBrd.SetBorderLineStyle(table::BorderLineStyle::EMBOSSED); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::EMBOSSED); break; case RTF_BRDRENGRAVE: // Engraved border - aBrd.SetBorderLineStyle(table::BorderLineStyle::ENGRAVED); + aBrd.SetBorderLineStyle(SvxBorderLineStyle::ENGRAVED); break; case RTF_BRDRS: // single thickness border |