From 19b1caebc453f7df97bd1146fea2265d97df56fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 3 May 2017 17:03:48 +0200 Subject: [PATCH] [apps] Never return n after event XNT except in sequence Change-Id: Ibdd3de34fbba73112f4f1bc15cbac81a19e81a58 --- apps/shared/text_field_delegate_app.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/apps/shared/text_field_delegate_app.cpp b/apps/shared/text_field_delegate_app.cpp index 9c27f7467..c3ce4d2b9 100644 --- a/apps/shared/text_field_delegate_app.cpp +++ b/apps/shared/text_field_delegate_app.cpp @@ -26,23 +26,8 @@ const char * TextFieldDelegateApp::XNT() { } bool TextFieldDelegateApp::cursorInToken(TextField * textField, const char * token) { - const char * text = textField->text(); - int location = textField->cursorLocation(); - int tokenLength = strlen(token); - while (location >= 0) { - while (text[location] != '(') { - location --; - } - if (location - tokenLength < 0) { - return false; - } - char previousToken[10]; - strlcpy(previousToken, text+location-tokenLength, tokenLength+1); - if (strcmp(previousToken, token) == 0) { - return true; - } - location--; - } + /* TODO: find a way to return true when cursor is in token(?,,). Warning: be + * able to differenciate sum(int(x,1,2),3,4) and sum(2*n,2,3) */ return false; }