Bug 337854 crash [@ nsTreeContentView::GetCell].

Patch by alfred.peng@sun.com.
neil: review+
roc: superreview+
This commit is contained in:
leon.sha%sun.com 2006-05-22 03:21:57 +00:00
Родитель 20bfe96707
Коммит 4cb998cedd
2 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -1463,9 +1463,9 @@ nsXULTreeBuilder::GetTemplateActionCellFor(PRInt32 aRow,
nsCOMPtr<nsIContent> row;
GetTemplateActionRowFor(aRow, getter_AddRefs(row));
if (row) {
const PRUnichar* colID;
nsCOMPtr<nsIAtom> colAtom;
PRInt32 colIndex;
aCol->GetIdConst(&colID);
aCol->GetAtom(getter_AddRefs(colAtom));
aCol->GetIndex(&colIndex);
PRUint32 count = row->GetChildCount();
@ -1475,10 +1475,9 @@ nsXULTreeBuilder::GetTemplateActionCellFor(PRInt32 aRow,
if (child->NodeInfo()->Equals(nsXULAtoms::treecell,
kNameSpaceID_XUL)) {
if (colID[0] != 0 &&
if (colAtom &&
child->AttrValueIs(kNameSpaceID_None, nsXULAtoms::ref,
nsDependentString(colID),
eCaseMatters)) {
colAtom, eCaseMatters)) {
*aResult = child;
break;
}

Просмотреть файл

@ -1449,9 +1449,9 @@ nsTreeContentView::UpdateParentIndexes(PRInt32 aIndex, PRInt32 aSkip, PRInt32 aC
nsIContent*
nsTreeContentView::GetCell(nsIContent* aContainer, nsITreeColumn* aCol)
{
const PRUnichar* colID;
nsCOMPtr<nsIAtom> colAtom;
PRInt32 colIndex;
aCol->GetIdConst(&colID);
aCol->GetAtom(getter_AddRefs(colAtom));
aCol->GetIndex(&colIndex);
// Traverse through cells, try to find the cell by "ref" attribute or by cell
@ -1463,9 +1463,8 @@ nsTreeContentView::GetCell(nsIContent* aContainer, nsITreeColumn* aCol)
nsCOMPtr<nsIContent> cell = *iter;
if (cell->Tag() == nsXULAtoms::treecell) {
if (colID[0] != 0 && cell->AttrValueIs(kNameSpaceID_None, nsXULAtoms::ref,
nsDependentString(colID),
eCaseMatters)) {
if (colAtom && cell->AttrValueIs(kNameSpaceID_None, nsXULAtoms::ref,
colAtom, eCaseMatters)) {
result = cell;
break;
}