[poincare] setExpressionForSymbolName takes a symbol name

This commit is contained in:
Léa Saviot
2018-09-27 11:45:43 +02:00
committed by Émilie Feral
parent 904de27815
commit 31d3a04678
10 changed files with 21 additions and 21 deletions

View File

@@ -79,12 +79,12 @@ bool VariableBoxController::ContentViewController::handleEvent(Ion::Events::Even
}
if (event == Ion::Events::Backspace && m_currentPage != Page::RootMenu) {
if (m_currentPage == Page::Scalar) {
const Symbol symbol('A'+selectedRow());
m_context->setExpressionForSymbolName(Expression(), symbol, *m_context);
const char symbolName[2] = {static_cast<char>('A'+selectedRow()), 0};
m_context->setExpressionForSymbolName(Expression(), symbolName, *m_context);
}
if (m_currentPage == Page::Matrix) {
const Symbol symbol = Symbol::matrixSymbol('0'+(char)selectedRow());
m_context->setExpressionForSymbolName(Expression(), symbol, *m_context);
const Symbol symbol = Symbol::matrixSymbol('0'+(char)selectedRow()); // TODO do not build an expression, just compute its name
m_context->setExpressionForSymbolName(Expression(), symbol.name(), *m_context);
m_matrixLayouts[selectedRow()] = Layout();
}
m_selectableTableView.reloadData();