Properly append new row in Array::addRow(), check if entries exist.
Fixes bug #110 git-svn-id: http://voip.null.ro/svn/yate@5778 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
53d8b79fd8
commit
7b65e9296e
|
@ -62,11 +62,17 @@ bool Array::addRow(ObjList* row, int index)
|
|||
if (index > m_rows)
|
||||
return false;
|
||||
for (int i=0; i<m_columns; i++) {
|
||||
ObjList* list = static_cast<ObjList*>(m_obj[i]);
|
||||
if (!list)
|
||||
continue;
|
||||
GenObject* item = row ? (*row)[i] : 0;
|
||||
if (index == m_rows)
|
||||
((*(ObjList *)(m_obj[i]))+index)->append(item,false);
|
||||
else
|
||||
((*(ObjList *)(m_obj[i]))+index)->insert(item,false);
|
||||
list->append(item,false);
|
||||
else {
|
||||
list = (*list) + index;
|
||||
if (list)
|
||||
list->insert(item,false);
|
||||
}
|
||||
}
|
||||
m_rows++;
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue