summaryrefslogtreecommitdiff
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
commit9bd78655198ad497bef9872422a1004cfbf8698f (patch)
tree1977de2e31348fcbefb486b7f50d59e5c223844f
parent302b7b094d87184530af66be91fef91b6dce1d12 (diff)
Fixed units mess in SvxBorderLine and BorderLineImpl
-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
-rwxr-xr-xsvx/inc/svx/frmsel.hxx5
-rwxr-xr-xsvx/source/dialog/frmsel.cxx11
6 files changed, 29 insertions, 40 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 );
}
}
diff --git a/svx/inc/svx/frmsel.hxx b/svx/inc/svx/frmsel.hxx
index 395cf5194936..dc458fa11488 100755
--- a/svx/inc/svx/frmsel.hxx
+++ b/svx/inc/svx/frmsel.hxx
@@ -129,9 +129,8 @@ public:
/** Returns true, if all visible frame borders have equal widths.
@descr Ignores hidden and "don't care" frame borders. On success,
- returns the widths in the passed parameters. */
- bool GetVisibleWidth( sal_uInt16& rnPrim, sal_uInt16& rnDist, sal_uInt16& rnSec,
- SvxBorderStyle& rnStyle ) const;
+ returns the width in the passed parameter. */
+ bool GetVisibleWidth( long& rnWidth, SvxBorderStyle& rnStyle ) const;
/** Returns true, if all visible frame borders have equal color.
@descr Ignores hidden and "don't care" frame borders. On success,
returns the color in the passed parameter. */
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 65007cfe6f27..c0badf227606 100755
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -887,8 +887,7 @@ void FrameSelector::HideAllBorders()
mxImpl->SetBorderState( **aIt, FRAMESTATE_HIDE );
}
-bool FrameSelector::GetVisibleWidth( sal_uInt16& rnPrim, sal_uInt16& rnDist, sal_uInt16& rnSecn,
- SvxBorderStyle& rnStyle ) const
+bool FrameSelector::GetVisibleWidth( long& rnWidth, SvxBorderStyle& rnStyle ) const
{
VisFrameBorderCIter aIt( mxImpl->maEnabBorders );
if( !aIt.Is() )
@@ -898,16 +897,12 @@ bool FrameSelector::GetVisibleWidth( sal_uInt16& rnPrim, sal_uInt16& rnDist, sal
bool bFound = true;
for( ++aIt; bFound && aIt.Is(); ++aIt )
bFound =
- (rStyle.GetOutWidth() == (*aIt)->GetCoreStyle().GetOutWidth()) &&
- (rStyle.GetDistance() == (*aIt)->GetCoreStyle().GetDistance()) &&
- (rStyle.GetInWidth() == (*aIt)->GetCoreStyle().GetInWidth()) &&
+ (rStyle.GetWidth() == (*aIt)->GetCoreStyle().GetWidth()) &&
(rStyle.GetStyle() == (*aIt)->GetCoreStyle().GetStyle());
if( bFound )
{
- rnPrim = rStyle.GetOutWidth();
- rnDist = rStyle.GetDistance();
- rnSecn = rStyle.GetInWidth();
+ rnWidth = rStyle.GetWidth();
rnStyle = rStyle.GetStyle();
}
return bFound;