diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-22 14:37:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-22 14:39:13 +0100 |
commit | d50fbfabb61dd9854771a846a39d84d0e4f83ab6 (patch) | |
tree | c4ea7872acc1ae319540b38e6db22118097d8428 /svtools | |
parent | 2174bb1af65d61904d3f45f2121416e7fb33b612 (diff) |
restore a FontSizeBox::GetValue variant
correctly removed by 994a737a317165db736f2a2f6a25b3439207da5d but
we will need it again soon
Change-Id: Ifedf8da2a33e834a5cba6da11c63c784572bd58d
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/svtools/ctrlbox.hxx | 1 | ||||
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx index 0a8e566413f2..39e5bb02bcc0 100644 --- a/svtools/inc/svtools/ctrlbox.hxx +++ b/svtools/inc/svtools/ctrlbox.hxx @@ -539,6 +539,7 @@ public: virtual void SetValue( sal_Int64 nNewValue ); virtual sal_Int64 GetValue( FieldUnit eOutUnit ) const; virtual sal_Int64 GetValue() const; + sal_Int64 GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const; private: // declared as private because some compilers would generate the default functions diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 684a10d6722d..663d24735e89 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1992,6 +1992,27 @@ void FontSizeBox::SetValue( sal_Int64 nNewValue ) SetValue( nNewValue, FUNIT_NONE ); } +// ----------------------------------------------------------------------- + +sal_Int64 FontSizeBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const +{ + if ( !bRelative ) + { + sal_Int64 nComboVal = static_cast<sal_Int64>(reinterpret_cast<long>(ComboBox::GetEntryData( nPos ))); + if ( nComboVal < 0 ) // marked as special? + { + return MetricField::ConvertValue( -nComboVal, mnBaseValue, GetDecimalDigits(), + meUnit, eOutUnit ); + } + } + + // do normal font size processing + sal_Int64 nRetValue = MetricBox::GetValue( nPos, eOutUnit ); + return nRetValue; +} + +// ----------------------------------------------------------------------- + sal_Int64 FontSizeBox::GetValue( FieldUnit eOutUnit ) const { if ( !bRelative ) |