From 14d8a04d38f4f3d6a57eefd1999b05689521516d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 20 Feb 2017 11:06:04 +0100 Subject: [PATCH 1/2] [poincare] Correct trigo evalutation Change-Id: I95999d57155ea99e207728522b0a4e45e1b66e34 --- poincare/src/cosine.cpp | 6 ++++++ poincare/src/sine.cpp | 6 ++++++ poincare/src/tangent.cpp | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/poincare/src/cosine.cpp b/poincare/src/cosine.cpp index 8d3f24a95..999dd38b3 100644 --- a/poincare/src/cosine.cpp +++ b/poincare/src/cosine.cpp @@ -42,6 +42,12 @@ Expression * Cosine::privateEvaluate(Context& context, AngleUnit angleUnit) cons delete evaluation; return new Complex(Complex::Float(NAN)); } + /* Float case */ + if (((Complex *)evaluation)->b() == 0) { + delete evaluation; + return Function::privateEvaluate(context, angleUnit); + } + /* Complex case */ Expression * arg = new Complex(Complex::Cartesian(-((Complex *)evaluation)->b(), ((Complex *)evaluation)->a())); Function * cosh = new HyperbolicCosine(); cosh->setArgument(&arg, 1, true); diff --git a/poincare/src/sine.cpp b/poincare/src/sine.cpp index 4faa2f36a..4560edd72 100644 --- a/poincare/src/sine.cpp +++ b/poincare/src/sine.cpp @@ -43,6 +43,12 @@ Expression * Sine::privateEvaluate(Context& context, AngleUnit angleUnit) const delete evaluation; return new Complex(Complex::Float(NAN)); } + /* Float case */ + if (((Complex *)evaluation)->b() == 0) { + delete evaluation; + return Function::privateEvaluate(context, angleUnit); + } + /* Complex case */ Expression * arg = new Complex(Complex::Cartesian(-((Complex *)evaluation)->b(), ((Complex *)evaluation)->a())); Function * sinh = new HyperbolicSine(); sinh->setArgument(&arg, 1, true); diff --git a/poincare/src/tangent.cpp b/poincare/src/tangent.cpp index a507453c6..25866c1b8 100644 --- a/poincare/src/tangent.cpp +++ b/poincare/src/tangent.cpp @@ -44,6 +44,12 @@ Expression * Tangent::privateEvaluate(Context& context, AngleUnit angleUnit) con delete evaluation; return new Complex(Complex::Float(NAN)); } + /* Float case */ + if (((Complex *)evaluation)->b() == 0) { + delete evaluation; + return Function::privateEvaluate(context, angleUnit); + } + /* Complex case */ Expression * arguments[2]; arguments[0] = new Sine(); ((Function *)arguments[0])->setArgument(&evaluation, 1, true); From 73c366652fabe20b1305683d58c63a041bbfb1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 20 Feb 2017 11:45:11 +0100 Subject: [PATCH 2/2] [apps/shared] Fix bug: do not turn off editing mode when selection has not changed in editable cell table view controller Change-Id: Icf56a2383272f6c14b5698bd38fd538fd04291dc --- apps/shared/editable_cell_table_view_controller.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/shared/editable_cell_table_view_controller.cpp b/apps/shared/editable_cell_table_view_controller.cpp index 980d68eb7..f309762c1 100644 --- a/apps/shared/editable_cell_table_view_controller.cpp +++ b/apps/shared/editable_cell_table_view_controller.cpp @@ -32,6 +32,9 @@ bool EditableCellTableViewController::textFieldDidFinishEditing(TextField * text } void EditableCellTableViewController::tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) { + if (previousSelectedCellX == t->selectedColumn() && previousSelectedCellY == t->selectedRow()) { + return; + } if (cellAtLocationIsEditable(previousSelectedCellX, previousSelectedCellY)) { EvenOddEditableTextCell * myCell = (EvenOddEditableTextCell *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY); myCell->setEditing(false);