|
|
@ -611,21 +611,24 @@ DataObject_create(const char* name, ModelNode* parent, int arrayElements)
|
|
|
|
self->elementCount = arrayElements;
|
|
|
|
self->elementCount = arrayElements;
|
|
|
|
self->arrayIndex = -1;
|
|
|
|
self->arrayIndex = -1;
|
|
|
|
|
|
|
|
|
|
|
|
if (arrayElements > 0) {
|
|
|
|
if (arrayElements > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < arrayElements; i++) {
|
|
|
|
for (i = 0; i < arrayElements; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
DataObject* arrayElement = (DataObject*) GLOBAL_MALLOC(sizeof(DataObject));
|
|
|
|
DataObject* arrayElement = (DataObject*) GLOBAL_MALLOC(sizeof(DataObject));
|
|
|
|
|
|
|
|
|
|
|
|
if (self) {
|
|
|
|
if (arrayElement)
|
|
|
|
self->name = NULL;
|
|
|
|
{
|
|
|
|
self->modelType = DataObjectModelType;
|
|
|
|
arrayElement->name = NULL;
|
|
|
|
self->firstChild = NULL;
|
|
|
|
arrayElement->modelType = DataObjectModelType;
|
|
|
|
self->parent = parent;
|
|
|
|
arrayElement->firstChild = NULL;
|
|
|
|
self->sibling = NULL;
|
|
|
|
arrayElement->parent = parent;
|
|
|
|
|
|
|
|
arrayElement->sibling = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
self->elementCount = 0;
|
|
|
|
arrayElement->elementCount = 0;
|
|
|
|
self->arrayIndex = i;
|
|
|
|
arrayElement->arrayIndex = i;
|
|
|
|
|
|
|
|
|
|
|
|
DataObject_addChild(self, (ModelNode*) arrayElement);
|
|
|
|
DataObject_addChild(self, (ModelNode*) arrayElement);
|
|
|
|
}
|
|
|
|
}
|
|
|
|