summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-09 14:41:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-10 12:27:52 +0200
commit557ca49197ff3db6f2c5a28a9ed9cc736faf5796 (patch)
treeefe3ad46a8555dc6b1b6584136739340505c626c /vcl/source/control
parentc1abccec44841bfad287b7227ebfc38daa010369 (diff)
refactor ImplNumericReformat
Change-Id: I92e3a5592691b99683e5c879a3a07b9f3bac7c41 Reviewed-on: https://gerrit.libreoffice.org/54064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/field.cxx17
1 files changed, 13 insertions, 4 deletions
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;