[apps/*/expression_model_list_controller] editExpression sets text instead of InputViewController::edit

This commit is contained in:
Ruben Dashyan
2019-07-26 16:24:19 +02:00
committed by LeaNumworks
parent 7d9f479f3c
commit 1d966ce23c
4 changed files with 12 additions and 17 deletions

View File

@@ -223,16 +223,15 @@ void ExpressionModelListController::reinitSelectedExpression(ExpiringPointer<Exp
}
void ExpressionModelListController::editExpression(Ion::Events::Event event) {
char * initialText = nullptr;
constexpr int initialTextContentMaxSize = Constant::MaxSerializedExpressionSize;
char initialTextContent[initialTextContentMaxSize];
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
Ion::Storage::Record record = modelStore()->recordAtIndex(modelIndexForRow(selectedRow()));
ExpiringPointer<ExpressionModelHandle> model = modelStore()->modelForRecord(record);
constexpr size_t initialTextContentMaxSize = Constant::MaxSerializedExpressionSize;
char initialTextContent[initialTextContentMaxSize];
model->text(initialTextContent, initialTextContentMaxSize);
initialText = initialTextContent;
inputController()->setTextBody(initialTextContent);
}
inputController()->edit(this, event, this, initialText,
inputController()->edit(this, event, this,
[](void * context, void * sender){
ExpressionModelListController * myController = static_cast<ExpressionModelListController *>(context);
InputViewController * myInputViewController = (InputViewController *)sender;