Merge changes Icf56a238,I95999d57

* changes:
  [apps/shared] Fix bug: do not turn off editing mode when selection has not changed in editable cell table view controller
  [poincare] Correct trigo evalutation
This commit is contained in:
Émilie Feral
2017-03-02 15:32:54 +01:00
committed by Gerrit
4 changed files with 21 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);