mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 01:00:50 +01:00
[escher] Fix layout count verification in ExprLayField::handleEvWText
Change-Id: Ie56e61aa10c907c6ab0dac8814b9ed46aac669f8
This commit is contained in:
committed by
EmilieNumworks
parent
6035bd904b
commit
bde05b3d8b
@@ -215,7 +215,8 @@ int ExpressionLayoutField::writeTextInBuffer(char * buffer, int bufferLength) {
|
||||
}
|
||||
|
||||
bool ExpressionLayoutField::handleEventWithText(const char * text, bool indentation) {
|
||||
if (m_contentView.expressionView()->numberOfLayouts() >= k_maxNumberOfLayouts) {
|
||||
int currentNumberOfLayouts = m_contentView.expressionView()->numberOfLayouts();
|
||||
if (currentNumberOfLayouts >= k_maxNumberOfLayouts) {
|
||||
return true;
|
||||
}
|
||||
Poincare::Expression * resultExpression = Poincare::Expression::parse(text);
|
||||
@@ -224,7 +225,7 @@ bool ExpressionLayoutField::handleEventWithText(const char * text, bool indentat
|
||||
}
|
||||
Poincare::ExpressionLayout * resultLayout = resultExpression->createLayout();
|
||||
delete resultExpression;
|
||||
if (resultLayout->numberOfDescendants(true) >= k_maxNumberOfLayouts) {
|
||||
if (currentNumberOfLayouts + resultLayout->numberOfDescendants(true) >= k_maxNumberOfLayouts) {
|
||||
delete resultLayout;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user