Submitted by: eseidel
Reviewed by: mjs
* kwq/KWQListImpl.h:
* kwq/KWQListImpl.mm:
(KWQListImpl::findRef): Added to support
KDOM::NodeImpl::compareDocumentPosition(NodeImpl *other)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9577
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-07-03 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by mjs.
+
+ * kwq/KWQListImpl.h:
+ * kwq/KWQListImpl.mm:
+ (KWQListImpl::findRef): Added to support
+ KDOM::NodeImpl::compareDocumentPosition(NodeImpl *other)
+
2005-07-03 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
void prepend(const void *item);
uint containsRef(const void *item) const;
+ int findRef(const void *item);
KWQListImpl &assign(const KWQListImpl &impl, bool deleteItems);
return count;
}
+// Only used for KDOM::NodeImpl::compareDocumentPosition(NodeImpl *other)
+// remove when no longer needed.
+int KWQListImpl::findRef(const void *item)
+{
+ KWQListNode *node = head;
+ int index = 0;
+
+ while (node != NULL && item != node->data) {
+ node = node->next;
+ index++;
+ }
+
+ cur = node;
+
+ if (node == NULL) {
+ return -1;
+ }
+
+ return index;
+}
+
KWQListImpl &KWQListImpl::assign(const KWQListImpl &impl, bool deleteItems)
{
clear(deleteItems);