diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-14 15:52:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-14 21:44:16 +0100 |
commit | e917918dfb42ef9f95768280918bc42c628de0be (patch) | |
tree | af36354a988a431c43ec32afb9e8d25c850a4b50 /svtools/source/misc | |
parent | f05aa5bc92ba93cc730f7f61e21011c6f5c82088 (diff) |
remove recently unused functions
Change-Id: Ie7645d7f9b8350d3a993c40541747dc8ac817ab9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88730
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/misc')
-rw-r--r-- | svtools/source/misc/unitconv.cxx | 92 |
1 files changed, 1 insertions, 91 deletions
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 <svtools/unitconv.hxx> #include <tools/debug.hxx> -#include <vcl/field.hxx> +#include <vcl/outdev.hxx> #include <vcl/weld.hxx> 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<long>(nVal), MapUnit::Map100thMM, eUnit ); - if( ! bRoundBefore ) - nUnitVal = rField.Denormalize( nUnitVal ); - return static_cast<long>(nUnitVal); -} - long CalcToUnit( float nIn, MapUnit eUnit ) { // nIn is in Points |