summaryrefslogtreecommitdiff
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
commit3b3379e278943ba221841c86d2a01c2e47ab5773 (patch)
tree792fb88a634e845845dd1f1da36f9620c173e723
parent7ba3c4cb83e978d916f48bdf73d2c671e0826164 (diff)
One LineListBox to rule them all: started improving column sep line
-rw-r--r--cui/source/inc/border.hxx2
-rw-r--r--cui/source/tabpages/border.cxx37
2 files changed, 25 insertions, 14 deletions
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 5063610aa..27d692c72 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -78,7 +78,7 @@ private:
FixedLine aFlSep1;
FixedLine aFlLine;
FixedText aStyleFT;
- LineStyleListBox aLbLineStyle;
+ LineListBox aLbLineStyle;
FixedText aColorFT;
ColorListBox aLbLineColor;
FixedText aWidthFT;
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 3321f8979..378805427 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 );
}
// -----------------------------------------------------------------------