Backout pavlov's last change which broken list boxes. Some items would
display as garbage. git-svn-id: svn://10.0.0.236/trunk@33440 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
22d37fa34a
commit
44bc8fa19b
@ -119,9 +119,11 @@ NS_METHOD nsListBox::SetMultipleSelection(PRBool aMultipleSelections)
|
||||
|
||||
NS_METHOD nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
||||
{
|
||||
gchar *buf = aItem.ToNewCString();
|
||||
|
||||
if (mCList) {
|
||||
gchar *text[2];
|
||||
text[0] = (gchar*)((const char *)nsAutoCString(aItem));
|
||||
text[0] = buf;
|
||||
text[1] = (gchar*)NULL;
|
||||
gtk_clist_insert(GTK_CLIST(mCList), (int)aPosition, text);
|
||||
|
||||
@ -130,6 +132,8 @@ NS_METHOD nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
||||
gtk_clist_set_row_data(GTK_CLIST(mCList), aPosition, (gpointer)&aItem);
|
||||
}
|
||||
|
||||
delete [] buf;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user