From 1fb2ab1829c261b65178696c94d25fdaf87ffaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Mon, 8 Jan 2018 16:56:33 +0100 Subject: [PATCH] [expression_editor] Multiplication button inserts multiplication dots. Change-Id: I9e87487a7419faef161378fc269e1d366c8e1a40 --- apps/expression_editor/controller.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/expression_editor/controller.cpp b/apps/expression_editor/controller.cpp index 8e9c77078..8f686e47b 100644 --- a/apps/expression_editor/controller.cpp +++ b/apps/expression_editor/controller.cpp @@ -1,5 +1,6 @@ #include "controller.h" #include +#include using namespace Poincare; @@ -124,7 +125,12 @@ ExpressionLayout * Controller::handleAddEvent(Ion::Events::Event event) { return m_cursor.addEmptySquarePowerLayout(); } if (event.hasText()) { - return m_cursor.insertText(event.text()); + const char * textToInsert = event.text(); + if (textToInsert[0] == Ion::Charset::MultiplicationSign && textToInsert[1] == 0) { + const char middleDotString[] = {Ion::Charset::MiddleDot, 0}; + return m_cursor.insertText(middleDotString); + } + return m_cursor.insertText(textToInsert); } return nullptr; }