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