mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/variable_box_controller] Fix expressionLayoutForRecord
This commit is contained in:
committed by
EmilieNumworks
parent
8fe41a8673
commit
686e25ec43
@@ -236,20 +236,20 @@ Layout VariableBoxController::expressionLayoutForRecord(Storage::Record record,
|
||||
assert(m_firstMemoizedLayoutIndex >= 0);
|
||||
}
|
||||
assert(index >= m_firstMemoizedLayoutIndex && index < m_firstMemoizedLayoutIndex + k_maxNumberOfDisplayedRows);
|
||||
Layout result;
|
||||
if (m_layouts[index-m_firstMemoizedLayoutIndex].isUninitialized()) {
|
||||
/* Creating the layout of a very long variable might throw a pool exception.
|
||||
* We want to catch it and return a dummy layout instead, otherwise the user
|
||||
* won't be able to open the variable box again, until she deletes the
|
||||
* problematic variable -> and she has no help to remember its name, as she
|
||||
* can't open the variable box. */
|
||||
Layout result;
|
||||
Poincare::ExceptionCheckpoint ecp;
|
||||
if (ExceptionRun(ecp)) {
|
||||
result = GlobalContext::LayoutForRecord(record);
|
||||
}
|
||||
m_layouts[index-m_firstMemoizedLayoutIndex] = result;
|
||||
}
|
||||
m_layouts[index-m_firstMemoizedLayoutIndex] = result;
|
||||
return result;
|
||||
return m_layouts[index-m_firstMemoizedLayoutIndex];
|
||||
}
|
||||
|
||||
const char * VariableBoxController::extension() const {
|
||||
|
||||
Reference in New Issue
Block a user