summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-09 14:26:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-09 21:40:21 +0200
commitf717b7b5fb6c00aee127f94aba3b8f7e25160134 (patch)
tree4313b4ec9b824601141b84ae063f9bf25a937f91
parent9479e5c63f7ce9e46093eebde2ac5a89518e8c04 (diff)
ImplNumericReformat always returns true
Change-Id: Icfb555a59d0a221bdbdcf17601440fda43680d4b Reviewed-on: https://gerrit.libreoffice.org/54032 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/field.hxx2
-rw-r--r--vcl/source/control/field.cxx12
2 files changed, 4 insertions, 10 deletions
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 615421153a0d..b0a7f45680e4 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -183,7 +183,7 @@ protected:
void FieldFirst();
void FieldLast();
- SAL_DLLPRIVATE bool ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr );
+ SAL_DLLPRIVATE void ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr );
SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection const * pNewSelection = nullptr );
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 706a56a93a93..b2bd446fe521 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -474,17 +474,13 @@ bool FormatterBase::IsEmptyFieldValue() const
return (!mpField || mpField->GetText().isEmpty());
}
-bool NumericFormatter::ImplNumericReformat( const OUString& rStr, sal_Int64& rValue,
+void NumericFormatter::ImplNumericReformat( const OUString& rStr, sal_Int64& rValue,
OUString& rOutStr )
{
- if ( !ImplNumericGetValue( rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() ) )
- return true;
- else
+ if (ImplNumericGetValue(rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper()))
{
sal_Int64 nTempVal = ClipAgainstMinMax(rValue);
-
rOutStr = CreateFieldText( nTempVal );
- return true;
}
}
@@ -650,10 +646,8 @@ void NumericFormatter::Reformat()
OUString aStr;
sal_Int64 nTemp = mnLastValue;
- bool bOK = ImplNumericReformat( GetField()->GetText(), nTemp, aStr );
+ ImplNumericReformat(GetField()->GetText(), nTemp, aStr);
mnLastValue = nTemp;
- if ( !bOK )
- return;
if ( !aStr.isEmpty() )
ImplSetText( aStr );