summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/border.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2011-01-06 15:58:55 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2011-03-19 17:56:36 +0100
commit91c5a262cd9302ae24e6cdc558dfdbcc62c51597 (patch)
tree86b79ebe1fa67431dd27cde6c08148387d731189 /cui/source/tabpages/border.cxx
parent0c7e52c99f2b6cfe19e162ade996fd57db9e4ae6 (diff)
One LineListBox to rule them all: started improving column sep line
Diffstat (limited to 'cui/source/tabpages/border.cxx')
-rw-r--r--cui/source/tabpages/border.cxx37
1 files changed, 24 insertions, 13 deletions
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 53c91503230d..9a6a2b4dea85 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -555,15 +555,11 @@ void SvxBorderTabPage::Reset( const SfxItemSet& rSet )
if( bWidthEq )
{
// Determine the width first as some styles can be missing depending on it
- aLineWidthMF.SetValue( sal_Int64( nWidth * 5 ) );
- aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) );
+ aLineWidthMF.SetValue( sal_Int64( nWidth ) );
+ aLbLineStyle.SetWidth( nWidth );
// then set the style
- // TODO Change the SelectEntry method
- SvxBorderLine aLine( NULL, nWidth, nStyle );
- aLbLineStyle.SelectEntry( aLine.GetOutWidth() * 5,
- aLine.GetInWidth() * 5,
- aLine.GetDistance() * 5, nStyle );
+ aLbLineStyle.SelectEntry( nStyle );
}
else
aLbLineStyle.SelectEntryPos( 1 );
@@ -929,10 +925,13 @@ IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb )
IMPL_LINK( SvxBorderTabPage, ModifyWidthHdl_Impl, void *, EMPTYARG )
{
- sal_Int64 nVal = aLineWidthMF.GetValue( );
+ sal_Int64 nVal = MetricField::ConvertDoubleValue(
+ aLineWidthMF.GetValue( ),
+ aLineWidthMF.GetDecimalDigits( ),
+ aLineWidthMF.GetUnit(), MAP_TWIP );
aLbLineStyle.SetWidth( nVal );
- aFrameSel.SetStyleToSelection( long( nVal / 5 ),
+ aFrameSel.SetStyleToSelection( nVal,
SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) );
return 0;
@@ -943,8 +942,14 @@ IMPL_LINK( SvxBorderTabPage, ModifyWidthHdl_Impl, void *, EMPTYARG )
IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb )
{
if ( pLb == &aLbLineStyle )
- aFrameSel.SetStyleToSelection ( long( aLineWidthMF.GetValue() / 5 ),
+ {
+ sal_Int64 nVal = MetricField::ConvertDoubleValue(
+ aLineWidthMF.GetValue( ),
+ aLineWidthMF.GetDecimalDigits( ),
+ aLineWidthMF.GetUnit(), MAP_TWIP );
+ aFrameSel.SetStyleToSelection ( nVal,
SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) );
+ }
return 0;
}
@@ -1100,6 +1105,8 @@ Color lcl_mediumColor( Color aMain, Color /*aDefault*/ )
void SvxBorderTabPage::FillLineListBox_Impl()
{
+ aLbLineStyle.SetSourceUnit( FUNIT_TWIP );
+
aLbLineStyle.SetNone( SVX_RESSTR( RID_SVXSTR_NONE ) );
// Simple lines
@@ -1125,12 +1132,16 @@ void SvxBorderTabPage::FillLineListBox_Impl()
&lcl_mediumColor );
// Inset / Outset
- aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( OUTSET ), OUTSET, 5,
+ aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( OUTSET ), OUTSET, 10,
&SvxBorderLine::lightColor, &SvxBorderLine::darkColor );
- aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( INSET ), INSET, 5,
+ aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( INSET ), INSET, 10,
&SvxBorderLine::darkColor, &SvxBorderLine::lightColor );
- aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) );
+ sal_Int64 nVal = MetricField::ConvertDoubleValue(
+ aLineWidthMF.GetValue( ),
+ aLineWidthMF.GetDecimalDigits( ),
+ aLineWidthMF.GetUnit(), MAP_TWIP );
+ aLbLineStyle.SetWidth( nVal );
}
// -----------------------------------------------------------------------