Kaydet (Commit) 0c7e52c9 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

Fixed units mess in SvxBorderLine and BorderLineImpl

üst a99d5769
...@@ -549,18 +549,21 @@ void SvxBorderTabPage::Reset( const SfxItemSet& rSet ) ...@@ -549,18 +549,21 @@ void SvxBorderTabPage::Reset( const SfxItemSet& rSet )
//------------------------------------------------------------- //-------------------------------------------------------------
{ {
// Do all visible lines show the same line widths? // Do all visible lines show the same line widths?
sal_uInt16 nPrim, nDist, nSecn; long nWidth;
SvxBorderStyle nStyle; SvxBorderStyle nStyle;
bool bWidthEq = aFrameSel.GetVisibleWidth( nPrim, nDist, nSecn, nStyle ); bool bWidthEq = aFrameSel.GetVisibleWidth( nWidth, nStyle );
if( bWidthEq ) if( bWidthEq )
{ {
// Determine the width first as some styles can be missing depending on it // Determine the width first as some styles can be missing depending on it
long nWidth = aLbLineStyle.GetWidthFromStyle( nPrim * 5, nSecn * 5, nDist * 5, nStyle ); aLineWidthMF.SetValue( sal_Int64( nWidth * 5 ) );
aLineWidthMF.SetValue( sal_Int64( nWidth ) );
aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) ); aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) );
// then set the style // then set the style
aLbLineStyle.SelectEntry( nPrim * 5, nSecn * 5, nDist * 5, nStyle ); // TODO Change the SelectEntry method
SvxBorderLine aLine( NULL, nWidth, nStyle );
aLbLineStyle.SelectEntry( aLine.GetOutWidth() * 5,
aLine.GetInWidth() * 5,
aLine.GetDistance() * 5, nStyle );
} }
else else
aLbLineStyle.SelectEntryPos( 1 ); aLbLineStyle.SelectEntryPos( 1 );
...@@ -1106,25 +1109,25 @@ void SvxBorderTabPage::FillLineListBox_Impl() ...@@ -1106,25 +1109,25 @@ void SvxBorderTabPage::FillLineListBox_Impl()
// Double lines // Double lines
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( DOUBLE ), DOUBLE ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( DOUBLE ), DOUBLE );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_SMALLGAP ), THINTHICK_SMALLGAP, 100 ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_SMALLGAP ), THINTHICK_SMALLGAP, 20 );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_MEDIUMGAP ), THINTHICK_MEDIUMGAP ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_MEDIUMGAP ), THINTHICK_MEDIUMGAP );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_LARGEGAP ), THINTHICK_LARGEGAP ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_LARGEGAP ), THINTHICK_LARGEGAP );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_SMALLGAP ), THICKTHIN_SMALLGAP, 100 ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_SMALLGAP ), THICKTHIN_SMALLGAP, 20 );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_MEDIUMGAP ), THICKTHIN_MEDIUMGAP ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_MEDIUMGAP ), THICKTHIN_MEDIUMGAP );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_LARGEGAP ), THICKTHIN_LARGEGAP ); aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_LARGEGAP ), THICKTHIN_LARGEGAP );
// Engraved / Embossed // Engraved / Embossed
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( EMBOSSED ), EMBOSSED, 75, aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( EMBOSSED ), EMBOSSED, 15,
&SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor,
&lcl_mediumColor ); &lcl_mediumColor );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( ENGRAVED ), ENGRAVED, 75, aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( ENGRAVED ), ENGRAVED, 15,
&SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor,
&lcl_mediumColor ); &lcl_mediumColor );
// Inset / Outset // Inset / Outset
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( OUTSET ), OUTSET, 0.5, aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( OUTSET ), OUTSET, 5,
&SvxBorderLine::lightColor, &SvxBorderLine::darkColor ); &SvxBorderLine::lightColor, &SvxBorderLine::darkColor );
aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( INSET ), INSET, 0.5, aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( INSET ), INSET, 5,
&SvxBorderLine::darkColor, &SvxBorderLine::lightColor ); &SvxBorderLine::darkColor, &SvxBorderLine::lightColor );
aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) ); aLbLineStyle.SetWidth( aLineWidthMF.GetValue( ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment