mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare] LayoutHelper::String second parameter is a length, not size
This commit is contained in:
@@ -84,8 +84,8 @@ void VariableBoxEmptyController::setType(Type type) {
|
||||
messages[0] = I18n::Message::EmptyExpressionBox0;
|
||||
messages[1] = I18n::Message::EmptyExpressionBox1;
|
||||
messages[2] = I18n::Message::EmptyExpressionBox2;
|
||||
char storeExpression[] = {'3', Ion::Charset::Sto, 'A', 0};
|
||||
layout = LayoutHelper::String(storeExpression, sizeof(storeExpression)-1, VariableBoxEmptyView::k_font);
|
||||
char storeExpression[] = {'3', Ion::Charset::Sto, 'A'};
|
||||
layout = LayoutHelper::String(storeExpression, sizeof(storeExpression), VariableBoxEmptyView::k_font);
|
||||
break;
|
||||
}
|
||||
case Type::Functions:
|
||||
@@ -93,8 +93,8 @@ void VariableBoxEmptyController::setType(Type type) {
|
||||
messages[0] = I18n::Message::EmptyFunctionBox0;
|
||||
messages[1] = I18n::Message::EmptyFunctionBox1;
|
||||
messages[2] = I18n::Message::EmptyFunctionBox2;
|
||||
char storeFunction[] = {'3', '+', Graph::StorageCartesianFunctionStore::Symbol(), Ion::Charset::Sto, 'f', '(', Graph::StorageCartesianFunctionStore::Symbol(), ')', 0};
|
||||
layout = LayoutHelper::String(storeFunction, sizeof(storeFunction)-1, VariableBoxEmptyView::k_font);
|
||||
char storeFunction[] = {'3', '+', Graph::StorageCartesianFunctionStore::Symbol(), Ion::Charset::Sto, 'f', '(', Graph::StorageCartesianFunctionStore::Symbol(), ')'};
|
||||
layout = LayoutHelper::String(storeFunction, sizeof(storeFunction), VariableBoxEmptyView::k_font);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace LayoutHelper {
|
||||
|
||||
/* Create special layouts */
|
||||
Layout Parentheses(Layout layout, bool cloneLayout);
|
||||
HorizontalLayout String(const char * buffer, int bufferSize, const KDFont * font = KDFont::LargeFont);
|
||||
HorizontalLayout String(const char * buffer, int bufferLen, const KDFont * font = KDFont::LargeFont);
|
||||
Layout Logarithm(Layout argument, Layout index);
|
||||
};
|
||||
|
||||
|
||||
@@ -53,10 +53,10 @@ Layout LayoutHelper::Parentheses(Layout layout, bool cloneLayout) {
|
||||
return result;
|
||||
}
|
||||
|
||||
HorizontalLayout LayoutHelper::String(const char * buffer, int bufferSize, const KDFont * font) {
|
||||
assert(bufferSize > 0);
|
||||
HorizontalLayout LayoutHelper::String(const char * buffer, int bufferLen, const KDFont * font) {
|
||||
assert(bufferLen > 0);
|
||||
HorizontalLayout resultLayout;
|
||||
for (int i = 0; i < bufferSize; i++) {
|
||||
for (int i = 0; i < bufferLen; i++) {
|
||||
resultLayout.addChildAtIndex(CharLayout(buffer[i], font), i, i, nullptr);
|
||||
}
|
||||
return resultLayout;
|
||||
|
||||
@@ -18,7 +18,7 @@ Expression UndefinedNode::setSign(Sign s, Context & context, Preferences::AngleU
|
||||
}
|
||||
|
||||
Layout UndefinedNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
|
||||
return LayoutHelper::String(Undefined::Name(), Undefined::NameSize());
|
||||
return LayoutHelper::String(Undefined::Name(), Undefined::NameSize()-1);
|
||||
}
|
||||
|
||||
int UndefinedNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
|
||||
|
||||
Reference in New Issue
Block a user