mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/expression_model] Fix text() implementation
This commit is contained in:
committed by
EmilieNumworks
parent
269305c68f
commit
176d55b7fa
@@ -24,14 +24,16 @@ ExpressionModel::ExpressionModel() :
|
||||
|
||||
void ExpressionModel::text(const Storage::Record * record, char * buffer, size_t bufferSize, CodePoint symbol) const {
|
||||
Expression e = expressionClone(record);
|
||||
if (e.isUninitialized() && bufferSize > 0) {
|
||||
buffer[0] = 0;
|
||||
} else {
|
||||
if (symbol != 0 && !e.isUninitialized()) {
|
||||
e = e.replaceSymbolWithExpression(Symbol::Builder(UCodePointUnknown), Symbol::Builder(symbol));
|
||||
if (e.isUninitialized()) {
|
||||
if (bufferSize > 0) {
|
||||
buffer[0] = 0;
|
||||
}
|
||||
e.serialize(buffer, bufferSize);
|
||||
return;
|
||||
}
|
||||
if (symbol != 0) {
|
||||
e = e.replaceSymbolWithExpression(Symbol::Builder(UCodePointUnknown), Symbol::Builder(symbol));
|
||||
}
|
||||
e.serialize(buffer, bufferSize);
|
||||
}
|
||||
|
||||
bool ExpressionModel::isCircularlyDefined(const Storage::Record * record, Poincare::Context * context) const {
|
||||
|
||||
Reference in New Issue
Block a user