tqdesigner: prevent SEGV from invalid pointer. This resolves issue #97.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Signed-off-by: ormorph <roma251078@mail.ru>
(cherry picked from commit 6e5c7efaca)
r14.1.x
Michele Calgaro 5 months ago
parent ccc0d8e4ef
commit a059b24f5a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1247,7 +1247,10 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
indent--;
ts << makeIndent( indent ) << "</column>" << endl;
}
saveItem( lv->firstChild(), ts, indent - 1 );
if (lv->firstChild())
{
saveItem( lv->firstChild(), ts, indent - 1 );
}
}
#if !defined (TQT_NO_TABLE)
else if ( ::tqt_cast<TQTable*>(obj) ) {
@ -1307,6 +1310,11 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
void Resource::saveItem( TQListViewItem *i, TQTextStream &ts, int indent )
{
if (!i)
{
return;
}
TQListView *lv = i->listView();
while ( i ) {
ts << makeIndent( indent ) << "<item>" << endl;

Loading…
Cancel
Save