diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-01-04 13:41:02 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-03-19 17:57:16 +0100 |
commit | 9bd78655198ad497bef9872422a1004cfbf8698f (patch) | |
tree | 1977de2e31348fcbefb486b7f50d59e5c223844f /editeng | |
parent | 302b7b094d87184530af66be91fef91b6dce1d12 (diff) |
Fixed units mess in SvxBorderLine and BorderLineImpl
Diffstat (limited to 'editeng')
-rwxr-xr-x | editeng/inc/editeng/borderline.hxx | 2 | ||||
-rw-r--r-- | editeng/qa/items/borderline_test.cxx | 14 | ||||
-rw-r--r-- | editeng/qa/items/makefile.mk | 13 | ||||
-rw-r--r-- | editeng/source/items/borderline.cxx | 24 |
4 files changed, 24 insertions, 29 deletions
diff --git a/editeng/inc/editeng/borderline.hxx b/editeng/inc/editeng/borderline.hxx index 680c866e5607..4134e62e03f9 100755 --- a/editeng/inc/editeng/borderline.hxx +++ b/editeng/inc/editeng/borderline.hxx @@ -108,7 +108,7 @@ enum SvxBorderStyle ENGRAVED, OUTSET, INSET, - NONE = -1 + NO_STYLE = -1 }; class EDITENG_DLLPUBLIC SvxBorderLine diff --git a/editeng/qa/items/borderline_test.cxx b/editeng/qa/items/borderline_test.cxx index ad8ba40d5861..22e76b8488f1 100644 --- a/editeng/qa/items/borderline_test.cxx +++ b/editeng/qa/items/borderline_test.cxx @@ -33,15 +33,15 @@ #include <editeng/borderline.hxx> -#define TEST_WIDTH long( 200 ) +#define TEST_WIDTH long( 40 ) -#define THINTHICKSG_IN_WIDTH long( 200 ) -#define THINTHICKSG_OUT_WIDTH long( 75 ) -#define THINTHICKSG_DIST_WIDTH long( 75 ) +#define THINTHICKSG_IN_WIDTH long( 15 ) +#define THINTHICKSG_OUT_WIDTH long( 40 ) +#define THINTHICKSG_DIST_WIDTH long( 15 ) -#define THINTHICKLG_IN_WIDTH long( 75 ) -#define THINTHICKLG_OUT_WIDTH long( 150 ) -#define THINTHICKLG_DIST_WIDTH long( 200 ) +#define THINTHICKLG_IN_WIDTH long( 15 ) +#define THINTHICKLG_OUT_WIDTH long( 30 ) +#define THINTHICKLG_DIST_WIDTH long( 40 ) namespace { diff --git a/editeng/qa/items/makefile.mk b/editeng/qa/items/makefile.mk index 3d6b16eda57c..fd15b0d8f8ee 100644 --- a/editeng/qa/items/makefile.mk +++ b/editeng/qa/items/makefile.mk @@ -51,16 +51,6 @@ SHL1TARGET = borderline_test SHL1OBJS = \ $(SLO)$/borderline_test.obj -SHL1LIBS= \ - $(SLB)$/items.lib \ - $(SLB)$/misc.lib \ - $(SLB)$/rtf.lib \ - $(SLB)$/uno.lib \ - $(SLB)$/accessibility.lib \ - $(SLB)$/editeng.lib \ - $(SLB)$/outliner.lib \ - $(SLB)$/xml.lib - SHL1STDLIBS= \ $(CPPUNITLIB) \ $(XMLOFFLIB) \ @@ -81,7 +71,8 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) \ $(SALHELPERLIB) \ - $(ICUUCLIB) + $(ICUUCLIB) \ + $(EDITENGLIB) SHL1VERSIONMAP = version.map SHL1IMPLIB = i$(SHL1TARGET) diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx index 038158574ba6..87a21ba90190 100644 --- a/editeng/source/items/borderline.cxx +++ b/editeng/source/items/borderline.cxx @@ -112,6 +112,10 @@ SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth, aColor = *pCol; } +/** Get the BorderWithImpl object corresponding to the given #nStyle, all the + units handled by the resulting object are Twips and the + BorderWidthImpl::GetLine1() corresponds to the Outer Line. + */ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) { BorderWidthImpl aImpl; @@ -119,8 +123,8 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) switch ( nStyle ) { // No line: no width - case NONE: - aImpl = BorderWidthImpl( CHANGE_LINE1, 0.0 ); + case NO_STYLE: + aImpl = BorderWidthImpl( 0, 0.0 ); break; // Single lines @@ -139,7 +143,7 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) break; case THINTHICK_SMALLGAP: - aImpl = BorderWidthImpl( CHANGE_LINE1, 1.0, 75.0, 75.0 ); + aImpl = BorderWidthImpl( CHANGE_LINE1, 1.0, 15.0, 15.0 ); break; case THINTHICK_MEDIUMGAP: @@ -149,11 +153,11 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) break; case THINTHICK_LARGEGAP: - aImpl = BorderWidthImpl( CHANGE_DIST, 75.0, 150.0, 1.0 ); + aImpl = BorderWidthImpl( CHANGE_DIST, 30.0, 15.0, 1.0 ); break; case THICKTHIN_SMALLGAP: - aImpl = BorderWidthImpl( CHANGE_DIST, 75.0, 1.0, 75.0 ); + aImpl = BorderWidthImpl( CHANGE_LINE2, 15.0, 1.0, 15.0 ); break; case THICKTHIN_MEDIUMGAP: @@ -163,7 +167,7 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) break; case THICKTHIN_LARGEGAP: - aImpl = BorderWidthImpl( CHANGE_DIST, 150.0, 75.0, 1.0 ); + aImpl = BorderWidthImpl( CHANGE_DIST, 15.0, 30.0, 1.0 ); break; // Engraved / Embossed @@ -187,13 +191,13 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderStyle nStyle ) case OUTSET: aImpl = BorderWidthImpl( CHANGE_LINE2 | CHANGE_DIST, - 75.0, 1.0, 1.0 ); + 15.0, 1.0, 1.0 ); break; case INSET: aImpl = BorderWidthImpl( CHANGE_LINE1 | CHANGE_DIST, - 1.0, 75.0, 1.0 ); + 1.0, 15.0, 1.0 ); break; } @@ -252,7 +256,7 @@ void SvxBorderLine::SetLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nIn, sal_u { nTestStyle = aDoubleStyles[i]; BorderWidthImpl aWidthImpl = getWidthImpl( nTestStyle ); - nWidth = aWidthImpl.GuessWidth( nIn, nOut, nDist ); + nWidth = aWidthImpl.GuessWidth( nOut, nIn, nDist ); i++; } @@ -266,7 +270,7 @@ void SvxBorderLine::SetLinesWidths( SvxBorderStyle nStyle, sal_uInt16 nIn, sal_u else { SetStyle( nStyle ); - m_nWidth = m_aWidthImpl.GuessWidth( nIn, nOut, nDist ); + m_nWidth = m_aWidthImpl.GuessWidth( nOut, nIn, nDist ); } } |