Various fixes and improvements, backported from Pro version. Code by Erik Zandvliet.

This commit is contained in:
Thulinma 2015-11-05 17:05:21 +01:00
parent 5cce37c521
commit b28a619fc6
13 changed files with 383 additions and 550 deletions

View file

@ -657,12 +657,13 @@ JSON::Value & JSON::Value::operator[](const char * i) {
/// Retrieves or sets the JSON::Value at this position in the array.
/// Converts destructively to array if not already an array.
JSON::Value & JSON::Value::operator[](unsigned int i) {
static JSON::Value empty;
if (myType != ARRAY) {
null();
myType = ARRAY;
}
while (i >= arrVal.size()) {
append(new JSON::Value());
append(empty);
}
return *arrVal[i];
}