From e917918dfb42ef9f95768280918bc42c628de0be Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 14 Feb 2020 15:52:14 +0000 Subject: remove recently unused functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie7645d7f9b8350d3a993c40541747dc8ac817ab9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88730 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svtools/source/misc/unitconv.cxx | 92 +--------------------------------------- 1 file changed, 1 insertion(+), 91 deletions(-) (limited to 'svtools/source/misc') diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index ef5494a6f96e..8076b6890196 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -19,7 +19,7 @@ #include #include -#include +#include #include void SetFieldUnit(weld::MetricSpinButton& rField, FieldUnit eUnit, bool bAll) @@ -80,64 +80,6 @@ void SetFieldUnit(weld::MetricSpinButton& rField, FieldUnit eUnit, bool bAll) } } -void SetFieldUnit( MetricField& rField, FieldUnit eUnit, bool bAll ) -{ - sal_Int64 nFirst = rField.Denormalize( rField.GetFirst( FieldUnit::TWIP ) ); - sal_Int64 nLast = rField.Denormalize( rField.GetLast( FieldUnit::TWIP ) ); - sal_Int64 nMin = rField.Denormalize( rField.GetMin( FieldUnit::TWIP ) ); - sal_Int64 nMax = rField.Denormalize( rField.GetMax( FieldUnit::TWIP ) ); - - if ( !bAll ) - { - switch ( eUnit ) - { - case FieldUnit::M: - case FieldUnit::KM: - eUnit = FieldUnit::CM; - break; - - case FieldUnit::FOOT: - case FieldUnit::MILE: - eUnit = FieldUnit::INCH; - break; - default: ;//prevent warning - } - } - rField.SetUnit( eUnit ); - switch( eUnit ) - { - // _CHAR and _LINE sets the step of "char" and "line" unit, they are same as FieldUnit::MM - case FieldUnit::CHAR: - case FieldUnit::LINE: - case FieldUnit::MM: - rField.SetSpinSize( 50 ); - break; - - case FieldUnit::INCH: - rField.SetSpinSize( 2 ); - break; - - default: - rField.SetSpinSize( 10 ); - } - - if ( FieldUnit::POINT == eUnit ) - { - if( rField.GetDecimalDigits() > 1 ) - rField.SetDecimalDigits( 1 ); - } - else - rField.SetDecimalDigits( 2 ); - - if ( !bAll ) - { - rField.SetFirst( rField.Normalize( nFirst ), FieldUnit::TWIP ); - rField.SetLast( rField.Normalize( nLast ), FieldUnit::TWIP ); - rField.SetMin( rField.Normalize( nMin ), FieldUnit::TWIP ); - rField.SetMax( rField.Normalize( nMax ), FieldUnit::TWIP ); - } -} - void SetMetricValue(weld::MetricSpinButton& rField, int nCoreValue, MapUnit eUnit) { auto nVal = OutputDevice::LogicToLogic(nCoreValue, eUnit, MapUnit::Map100thMM); @@ -145,14 +87,6 @@ void SetMetricValue(weld::MetricSpinButton& rField, int nCoreValue, MapUnit eUni rField.set_value(nVal, FieldUnit::MM_100TH); } -void SetMetricValue( MetricField& rField, long nCoreValue, MapUnit eUnit ) -{ - sal_Int64 nVal = OutputDevice::LogicToLogic( nCoreValue, eUnit, MapUnit::Map100thMM ); - nVal = rField.Normalize( nVal ); - rField.SetValue(nVal, FieldUnit::MM_100TH); - -} - int GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit) { int nVal = rField.get_value(FieldUnit::MM_100TH); @@ -177,30 +111,6 @@ int GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit) return nUnitVal; } -long GetCoreValue( const MetricField& rField, MapUnit eUnit ) -{ - sal_Int64 nVal = rField.GetValue(FieldUnit::MM_100TH); - // avoid rounding issues - const sal_Int64 nSizeMask = 0xffffffffff000000LL; - bool bRoundBefore = true; - if( nVal >= 0 ) - { - if( (nVal & nSizeMask) == 0 ) - bRoundBefore = false; - } - else - { - if( ((-nVal) & nSizeMask ) == 0 ) - bRoundBefore = false; - } - if( bRoundBefore ) - nVal = rField.Denormalize( nVal ); - sal_Int64 nUnitVal = OutputDevice::LogicToLogic( static_cast(nVal), MapUnit::Map100thMM, eUnit ); - if( ! bRoundBefore ) - nUnitVal = rField.Denormalize( nUnitVal ); - return static_cast(nUnitVal); -} - long CalcToUnit( float nIn, MapUnit eUnit ) { // nIn is in Points -- cgit