summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2011-01-04 13:41:02 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-19 17:57:16 +0100
commit95ef468983dc8a3dd03dfb6fb9de4a44d5255c1c (patch)
tree31ef7bc1eabbf76bb592c6e7b1a5eb880572fd75 /editeng/source
parent107b2df50603cb030d50d5b34014972320a6e586 (diff)
Fixed units mess in SvxBorderLine and BorderLineImpl
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/items/borderline.cxx24
1 files changed, 14 insertions, 10 deletions
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 038158574b..87a21ba901 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 );
}
}