summaryrefslogtreecommitdiff
path: root/editeng
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
parent107b2df50603cb030d50d5b34014972320a6e586 (diff)
Fixed units mess in SvxBorderLine and BorderLineImpl
Diffstat (limited to 'editeng')
-rwxr-xr-xediteng/inc/editeng/borderline.hxx2
-rw-r--r--editeng/qa/items/borderline_test.cxx14
-rw-r--r--editeng/qa/items/makefile.mk13
-rw-r--r--editeng/source/items/borderline.cxx24
4 files changed, 24 insertions, 29 deletions
diff --git a/editeng/inc/editeng/borderline.hxx b/editeng/inc/editeng/borderline.hxx
index 68be9986ad..d7f6e0b648 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 ad8ba40d58..22e76b8488 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 3d6b16eda5..fd15b0d8f8 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 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 );
}
}