Kaydet (Commit) 7f423067 authored tarafından Andras Timar's avatar Andras Timar

tdf#90804 remove SfxFieldUnit enum

b78d8815 removed unused values
from SfxFieldUnit enum. This broke the mapping between SfxFieldUnit
and FieldUnit. In fact SfxFieldUnit was redundant.

Change-Id: I13c7e7d708c6eeab0de192f4cd110b0a23989a31
Reviewed-on: https://gerrit.libreoffice.org/16150Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst ca96e9a8
......@@ -520,7 +520,7 @@ namespace
// conversion twips for the example-window
aSize.Height() =
ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), SFX_FUNIT_TWIP );
ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), FUNIT_TWIP );
}
else if ( !_pFontSizeLB->GetText().isEmpty() )
aSize.Height() = PointToTwips( static_cast<long>(_pFontSizeLB->GetValue() / 10) );
......
......@@ -1099,7 +1099,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewP
if( SFX_MAPUNIT_RELATIVE != eUnit )
nHeight = nNewHeight + ::ItemToControl( (short)nNewProp, eUnit,
SFX_FUNIT_TWIP );
FUNIT_TWIP );
else if( 100 != nNewProp )
nHeight = sal_uInt32(( nNewHeight * nNewProp ) / 100 );
else
......@@ -1117,7 +1117,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp,
if( SFX_MAPUNIT_RELATIVE != eMetric )
nHeight = nNewHeight +
::ControlToItem( ::ItemToControl((short)nNewProp, eMetric,
SFX_FUNIT_TWIP ), SFX_FUNIT_TWIP,
FUNIT_TWIP ), FUNIT_TWIP,
eCoreMetric );
else if( 100 != nNewProp )
nHeight = sal_uInt32(( nNewHeight * nNewProp ) / 100 );
......
......@@ -80,12 +80,6 @@ inline ::com::sun::star::uno::Any Bool2Any( bool bValue )
return ::com::sun::star::uno::Any( &bValue, cppu::UnoType<bool>::get() );
}
enum SfxFieldUnit
{
SFX_FUNIT_NONE, SFX_FUNIT_TWIP
};
enum SfxMapUnit
{
SFX_MAPUNIT_100TH_MM,
......
......@@ -37,8 +37,8 @@ SVT_DLLPUBLIC void SetFieldUnit( MetricBox& rCtrl, FieldUnit eUnit, bool bA
SVT_DLLPUBLIC long CalcToUnit( float nIn, SfxMapUnit eUnit );
SVT_DLLPUBLIC long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFactor );
SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl );
SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem );
SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, FieldUnit eCtrl );
SVT_DLLPUBLIC long ControlToItem( long nIn, FieldUnit eCtrl, SfxMapUnit eItem );
SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const SfxMapUnit eUnit );
......
......@@ -185,7 +185,7 @@ long CalcToUnit( float nIn, SfxMapUnit eUnit )
long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl )
long ItemToControl( long nIn, SfxMapUnit eItem, FieldUnit eCtrl )
{
long nOut = 0;
......@@ -199,13 +199,13 @@ long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl )
nIn /= 10;
else if ( eItem == SFX_MAPUNIT_100TH_MM )
nIn /= 100;
nOut = TransformMetric( nIn, FUNIT_MM, (FieldUnit)eCtrl );
nOut = TransformMetric( nIn, FUNIT_MM, eCtrl );
}
break;
case SFX_MAPUNIT_CM:
{
nOut = TransformMetric( nIn, FUNIT_CM, (FieldUnit)eCtrl );
nOut = TransformMetric( nIn, FUNIT_CM, eCtrl );
}
break;
......@@ -220,19 +220,19 @@ long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl )
nIn /= 100;
else if ( eItem == SFX_MAPUNIT_1000TH_INCH )
nIn /= 1000;
nOut = TransformMetric( nIn, FUNIT_INCH, (FieldUnit)eCtrl );
nOut = TransformMetric( nIn, FUNIT_INCH, eCtrl );
}
break;
case SFX_MAPUNIT_POINT:
{
nOut = TransformMetric( nIn, FUNIT_POINT, (FieldUnit)eCtrl );
nOut = TransformMetric( nIn, FUNIT_POINT, eCtrl );
}
break;
case SFX_MAPUNIT_TWIP:
{
nOut = TransformMetric( nIn, FUNIT_TWIP, (FieldUnit)eCtrl );
nOut = TransformMetric( nIn, FUNIT_TWIP, eCtrl );
}
break;
default: ;//prevent warning
......@@ -242,7 +242,7 @@ long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl )
long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem )
long ControlToItem( long nIn, FieldUnit eCtrl, SfxMapUnit eItem )
{
return ItemToControl( nIn, eItem, eCtrl );
}
......
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