mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Factorize portions checking whether text approximates to double
This commit is contained in:
committed by
Émilie Feral
parent
5e5e07e963
commit
82685cb371
@@ -24,11 +24,8 @@ bool EditableCellTableViewController::textFieldShouldFinishEditing(TextField * t
|
||||
}
|
||||
|
||||
bool EditableCellTableViewController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
|
||||
AppsContainer * appsContainer = ((TextFieldDelegateApp *)app())->container();
|
||||
Context * globalContext = appsContainer->globalContext();
|
||||
double floatBody = PoincareHelpers::ApproximateToScalar<double>(text, *globalContext);
|
||||
if (std::isnan(floatBody) || std::isinf(floatBody)) {
|
||||
app()->displayWarning(I18n::Message::UndefinedValue);
|
||||
double floatBody;
|
||||
if (textFieldDelegateApp()->hasUndefinedValue(text, floatBody)) {
|
||||
return false;
|
||||
}
|
||||
if (!setDataAtLocation(floatBody, selectedColumn(), selectedRow())) {
|
||||
|
||||
Reference in New Issue
Block a user