Bug 134295: Make position() work together with xsl:sort again. This will put back some problems with attribute-nodes, but those problems should be much less common then the current situation.

r=peterv sr=jst
This commit is contained in:
sicking%bigfoot.com 2002-05-17 22:25:06 +00:00
Родитель f27fd6f6a7
Коммит 72102bc2fd
1 изменённых файлов: 10 добавлений и 7 удалений

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

@ -319,14 +319,17 @@ void NodeSet::reverse()
* @param aNode the Node to get the index for
* @return index of specified node or -1 if the node does not exist
*/
MBool NodeSet::indexOf(Node* aNode) const
int NodeSet::indexOf(Node* aNode) const
{
// XXX evaluate cost of this
// Workaround to fix the fact that attributes can't be
// pointer-compared
MBool nonDup;
int pos = findPosition(aNode, 0, mElementCount - 1, nonDup);
return nonDup ? -1 : pos;
// XXX this doesn't fully work since attribute-nodes are broken
// and can't be pointer-compared. However it's the best we can
// do for now.
int i;
for (i = 0; i < mElementCount; ++i) {
if (mElements[i] == aNode)
return i;
}
return -1;
}
/*