diff options
-rw-r--r-- | include/vcl/field.hxx | 3 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index b0a7f45680e4..3af20ff93558 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -183,7 +183,7 @@ protected: void FieldFirst(); void FieldLast(); - SAL_DLLPRIVATE void ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr ); + SAL_DLLPRIVATE void ImplNumericReformat( sal_Int64& rValue, OUString& rOutStr ); SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue ); SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection const * pNewSelection = nullptr ); @@ -626,6 +626,7 @@ public: class VCL_DLLPUBLIC NumericBox : public ComboBox, public NumericFormatter { + SAL_DLLPRIVATE void ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr ); public: explicit NumericBox( vcl::Window* pParent, WinBits nWinStyle ); diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index b2bd446fe521..6221a6f688fa 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -474,10 +474,9 @@ bool FormatterBase::IsEmptyFieldValue() const return (!mpField || mpField->GetText().isEmpty()); } -void NumericFormatter::ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, - OUString& rOutStr ) +void NumericFormatter::ImplNumericReformat(sal_Int64& rValue, OUString& rOutStr) { - if (ImplNumericGetValue(rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper())) + if (ImplNumericGetValue(GetField()->GetText(), rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper())) { sal_Int64 nTempVal = ClipAgainstMinMax(rValue); rOutStr = CreateFieldText( nTempVal ); @@ -646,7 +645,7 @@ void NumericFormatter::Reformat() OUString aStr; sal_Int64 nTemp = mnLastValue; - ImplNumericReformat(GetField()->GetText(), nTemp, aStr); + ImplNumericReformat(nTemp, aStr); mnLastValue = nTemp; if ( !aStr.isEmpty() ) @@ -949,6 +948,16 @@ void NumericBox::Modify() ComboBox::Modify(); } +void NumericBox::ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, + OUString& rOutStr ) +{ + if (ImplNumericGetValue(rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper())) + { + sal_Int64 nTempVal = ClipAgainstMinMax(rValue); + rOutStr = CreateFieldText( nTempVal ); + } +} + void NumericBox::ReformatAll() { sal_Int64 nValue; |