Commit Graph

7312 Commits

Author SHA1 Message Date
Émilie Feral
978766f2e4 [code] Use strlcpy instead of memcpy to avoid invalid read 2018-11-23 12:04:09 +01:00
Léa Saviot
8101847d65 [poincare] Token: initialize text to "" 2018-11-23 12:04:09 +01:00
Léa Saviot
4d54834815 [poincare] Parser: avoid reading out of bound
popToken is called from parseUntil and from parseStore. It should be
responsible for not reading out of bound buffer
2018-11-23 12:04:09 +01:00
Émilie Feral
01e67dbdc0 [apps/probability] Fix law parameters display in calculation step 2018-11-23 12:04:09 +01:00
Émilie Feral
cffb144c41 [poincare] Power: fix one-child addition while reducing power 2018-11-23 12:04:09 +01:00
Émilie Feral
61b629db92 [poincare] Parser: avoid reading out of buffer 2018-11-23 12:04:09 +01:00
Émilie Feral
34e2524a83 [ion] Storage: use strncmp instead of strcmp
When building with -fsanitize=address, strcmp is wrapped in a version
that returns only +1, -1 or 0.
2018-11-23 12:04:09 +01:00
Léa Saviot
584f6d6f6b [poincare] Add parsing test on 1E2E3 2018-11-23 12:04:09 +01:00
Léa Saviot
f5586b3d36 [apps] Clean the syntax error warning displaying 2018-11-23 12:04:09 +01:00
Léa Saviot
97d7955d15 [poincare] Alpha lock when renaming function 2018-11-23 12:04:08 +01:00
Léa Saviot
95af0cf231 [apps] Fix cursor position when inserting function in Linear Edition 2018-11-23 12:04:08 +01:00
Léa Saviot
51ddba058f [apps] Add test about Calculation output: 2x-x should just display x 2018-11-23 12:04:08 +01:00
Léa Saviot
70707a9985 [poincare] Infinity::Name() gives "inf" 2018-11-23 12:04:08 +01:00
Léa Saviot
5e404736b3 [poincare] LayoutHelper::String second parameter is a length, not size 2018-11-23 12:04:08 +01:00
Léa Saviot
a289d77425 [apps/calculation] Fix non returning method 2018-11-23 12:04:08 +01:00
Léa Saviot
63e83c246b [poincare] Undefined::Name() gives "undef" 2018-11-23 12:04:08 +01:00
Léa Saviot
1cb9d5445c [apps/calculation] Do not display approximate output if it is undef 2018-11-23 12:04:08 +01:00
Émilie Feral
55bfffcb9b [poincare] Expression: fix isApproximate and IsMatrix to expand
Function encountered
2018-11-23 12:04:08 +01:00
Émilie Feral
19b3a8a479 [poincare] Factorize 'expand' and 'matches' methods between Symbol and
Function
2018-11-23 12:04:08 +01:00
Émilie Feral
721cd59227 [poincare] Add tests on User Variable
- test isApproximate on Symbols and Functions
- test IsMatrix on Symbols and Functions
2018-11-23 12:04:08 +01:00
Léa Saviot
860553b735 [escher] Fix cursor position in textfield
The cursor was not in the right place in TextFieldWithExtension
2018-11-23 12:04:08 +01:00
Léa Saviot
71c848e7df [apps] Reinit inputFormulaView text before edition 2018-11-23 12:04:08 +01:00
Léa Saviot
824ffd9c21 [escher] Fix TextField::setText update of draftTextLength and cursorLoc 2018-11-23 12:04:08 +01:00
Léa Saviot
8b87a6a893 [escher] Fix bug after memory exception 2018-11-23 12:04:08 +01:00
Léa Saviot
5f4c94af67 [escher] Fix TextField::handleEvent bug 2018-11-23 12:04:08 +01:00
Léa Saviot
f6804c2d67 [apps] Use ExpressionFieldDelegateApp methods in Calculation::App
For methods textFieldDidReceiveEvent and layoutFieldDidReceiveEvent
2018-11-23 12:04:08 +01:00
Léa Saviot
48d281e44d [apps] Do not allow store expressions except in Calculation 2018-11-23 12:04:08 +01:00
Émilie Feral
c01d66c77b [poincare] Change name: replaceReplaceableSymbols -->
shallowReplaceReplaceableSymbols
2018-11-23 12:04:08 +01:00
Émilie Feral
e80512f362 [poincare] Context::expressionForSymbol takes a boolean notifying that
we want a copy or not
2018-11-23 12:04:08 +01:00
Émilie Feral
b44c5e6d05 [shared] Change name: StorageExpressionModel::expressionWithSymbol -->
expressionClone
2018-11-23 12:04:08 +01:00
Émilie Feral
90befab6ce [shared] Change name: StorageExpressionModel::expression --> expressionReduced 2018-11-23 12:04:08 +01:00
Émilie Feral
05083e76af [poincare] Clean Symbol 2018-11-23 12:04:08 +01:00
Émilie Feral
ac6f7346e0 [poincare] Fix Function: expand and replace child before getting
properties
2018-11-23 12:04:08 +01:00
Émilie Feral
fb57ac73d7 [poincare] add tests on Function properties 2018-11-23 12:04:08 +01:00
Émilie Feral
6530d87805 [poincare] Test: divide store tests in store and user variable tests 2018-11-23 12:04:08 +01:00
Émilie Feral
dd4a83fc59 [poincare] Store: add tests on composed functions 2018-11-23 12:04:08 +01:00
Émilie Feral
55048ab907 [poincare] VariableContext::expressionForSymbol returns a clone of its
kept value to unable any modification of its value (without calling
setExpressionForSymbol).

All contexts::expressionForSymbol return new Expression that can be tempered with.
2018-11-23 12:04:08 +01:00
Émilie Feral
a6ad7484a0 [poincare] FunctionNode: pay attention to parent context with UnknownX value to
avoid overriding it.

For example, when evaluating the expression 'f(x)' in a context where x =
2 and f: x-->x^2.
2018-11-23 12:04:08 +01:00
Émilie Feral
bd09638b68 [poincare] Add tests to Store: f(x+1)+f(x-1) 2018-11-23 12:04:08 +01:00
Émilie Feral
e516c9d544 [poincare] Helper: add a function to check approximateWithValueForSymbol 2018-11-23 12:04:08 +01:00
Émilie Feral
e042279471 [poincare] Function: fix replaceReplaceableSymbols 2018-11-23 12:04:08 +01:00
Léa Saviot
3397dbd039 [apps] Clean regression/graph_controller files 2018-11-23 12:04:08 +01:00
Léa Saviot
e3935fd9c0 [apps] Factorize closestCurveIndexVertically from Regression and Graph 2018-11-23 12:04:08 +01:00
Émilie Feral
acdb4ca357 [poincare] Expression::ExpressionWithoutSymbol does not take into
account SystemSymbol (UnknownX)
2018-11-23 12:04:08 +01:00
Émilie Feral
140ccbfa77 [poincare] Add tests on composed functions 2018-11-23 12:04:08 +01:00
Léa Saviot
28189aadac [apps/regression] Fix selection problem when 2 regressions are equal
When going down, the cursor would loop between the 2 equal regressions
without going to lower regressions
2018-11-23 12:04:08 +01:00
Léa Saviot
3ccd1aabf4 [apps] Fix StorageFunctionGraphController::moveCursorVertically 2018-11-23 12:04:08 +01:00
Léa Saviot
e9974a7e7a [apps/graph] Fix vertical move on intersecting functions
When two functions are equal, there was a bug when moving the selection
up or down in the graph (the cursor would skip one function)
2018-11-23 12:04:08 +01:00
Émilie Feral
2d36f02053 [apps] VariableBoxController: fix bug in right layouts of variable cells.
When the last dislayed page of VariableBoxController was 'Function', the
next time we displayed the symbol page, the expressions on the right of
cells were false the one of functions.
2018-11-23 12:04:08 +01:00
Émilie Feral
17abf68de1 [shared] StorageExpressionModel: memoize the fact that the expression is
circular to avoid lagging when approximating the model multiple times.
2018-11-23 12:04:08 +01:00