[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:16:10 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 112f9557a4927a965143bee4364a9e1fb97fa97b
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jun 1 06:07:07 2002 +0000

    	Fix infinite loop while cancelling bug that was caused by dictionary
    	iterators not getting updated when keys are removed.
    
    	* kwq/KWQPtrDictImpl.mm:
    	(KWQPtrDictPrivate::KWQPtrDictPrivate): Set iterators list to 0.
    	(KWQPtrDictPrivate::~KWQPtrDictPrivate): Tell iterators dict is gone.
    	(KWQPtrDictImpl::remove): Tell each iterator that the item was removed.
    	(KWQPtrDictIteratorPrivate::KWQPtrDictIteratorPrivate): Insert the
    	iterator into a list with a head stored in the dict.
    	(KWQPtrDictIteratorPrivate::~KWQPtrDictIteratorPrivate): Remove the
    	iterator from the list.
    	(KWQPtrDictIteratorPrivate::remove): Remove the key from the iterator's
    	private storage.
    	(KWQPtrDictIteratorPrivate::dictDestroyed): Clear out the dict pointer
    	and set the count to 0.
    
    	* kwq/KWQPtrDictImpl.h: Move private classes out so they can get at each
    	other without being friends of each other.
    
    	* kwq/qt/qptrdict.h: Simplify a bit.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1251 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index c8805fd..39b36f2 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,28 @@
 2002-05-31  Darin Adler  <darin at apple.com>
 
+	Fix infinite loop while cancelling bug that was caused by dictionary
+	iterators not getting updated when keys are removed.
+
+	* kwq/KWQPtrDictImpl.mm:
+	(KWQPtrDictPrivate::KWQPtrDictPrivate): Set iterators list to 0.
+	(KWQPtrDictPrivate::~KWQPtrDictPrivate): Tell iterators dict is gone.
+	(KWQPtrDictImpl::remove): Tell each iterator that the item was removed.
+	(KWQPtrDictIteratorPrivate::KWQPtrDictIteratorPrivate): Insert the
+	iterator into a list with a head stored in the dict.
+	(KWQPtrDictIteratorPrivate::~KWQPtrDictIteratorPrivate): Remove the
+	iterator from the list.
+	(KWQPtrDictIteratorPrivate::remove): Remove the key from the iterator's
+	private storage.
+	(KWQPtrDictIteratorPrivate::dictDestroyed): Clear out the dict pointer
+	and set the count to 0.
+
+	* kwq/KWQPtrDictImpl.h: Move private classes out so they can get at each
+	other without being friends of each other.
+
+	* kwq/qt/qptrdict.h: Simplify a bit.
+
+2002-05-31  Darin Adler  <darin at apple.com>
+
 	* khtml/khtmlview.h: Add KWQKHTMLPartImpl as friend class, remove khtml_part.h
 	include that we added inside APPLE_CHANGES.
 
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c8805fd..39b36f2 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,28 @@
 2002-05-31  Darin Adler  <darin at apple.com>
 
+	Fix infinite loop while cancelling bug that was caused by dictionary
+	iterators not getting updated when keys are removed.
+
+	* kwq/KWQPtrDictImpl.mm:
+	(KWQPtrDictPrivate::KWQPtrDictPrivate): Set iterators list to 0.
+	(KWQPtrDictPrivate::~KWQPtrDictPrivate): Tell iterators dict is gone.
+	(KWQPtrDictImpl::remove): Tell each iterator that the item was removed.
+	(KWQPtrDictIteratorPrivate::KWQPtrDictIteratorPrivate): Insert the
+	iterator into a list with a head stored in the dict.
+	(KWQPtrDictIteratorPrivate::~KWQPtrDictIteratorPrivate): Remove the
+	iterator from the list.
+	(KWQPtrDictIteratorPrivate::remove): Remove the key from the iterator's
+	private storage.
+	(KWQPtrDictIteratorPrivate::dictDestroyed): Clear out the dict pointer
+	and set the count to 0.
+
+	* kwq/KWQPtrDictImpl.h: Move private classes out so they can get at each
+	other without being friends of each other.
+
+	* kwq/qt/qptrdict.h: Simplify a bit.
+
+2002-05-31  Darin Adler  <darin at apple.com>
+
 	* khtml/khtmlview.h: Add KWQKHTMLPartImpl as friend class, remove khtml_part.h
 	include that we added inside APPLE_CHANGES.
 
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c8805fd..39b36f2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,28 @@
 2002-05-31  Darin Adler  <darin at apple.com>
 
+	Fix infinite loop while cancelling bug that was caused by dictionary
+	iterators not getting updated when keys are removed.
+
+	* kwq/KWQPtrDictImpl.mm:
+	(KWQPtrDictPrivate::KWQPtrDictPrivate): Set iterators list to 0.
+	(KWQPtrDictPrivate::~KWQPtrDictPrivate): Tell iterators dict is gone.
+	(KWQPtrDictImpl::remove): Tell each iterator that the item was removed.
+	(KWQPtrDictIteratorPrivate::KWQPtrDictIteratorPrivate): Insert the
+	iterator into a list with a head stored in the dict.
+	(KWQPtrDictIteratorPrivate::~KWQPtrDictIteratorPrivate): Remove the
+	iterator from the list.
+	(KWQPtrDictIteratorPrivate::remove): Remove the key from the iterator's
+	private storage.
+	(KWQPtrDictIteratorPrivate::dictDestroyed): Clear out the dict pointer
+	and set the count to 0.
+
+	* kwq/KWQPtrDictImpl.h: Move private classes out so they can get at each
+	other without being friends of each other.
+
+	* kwq/qt/qptrdict.h: Simplify a bit.
+
+2002-05-31  Darin Adler  <darin at apple.com>
+
 	* khtml/khtmlview.h: Add KWQKHTMLPartImpl as friend class, remove khtml_part.h
 	include that we added inside APPLE_CHANGES.
 
diff --git a/WebCore/kwq/KWQPtrDict.h b/WebCore/kwq/KWQPtrDict.h
index cc3a9d6..5cf99cf 100644
--- a/WebCore/kwq/KWQPtrDict.h
+++ b/WebCore/kwq/KWQPtrDict.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,16 +26,6 @@
 #ifndef QPTRDICT_H_
 #define QPTRDICT_H_
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// USING_BORROWED_QPTRDICT =====================================================
-
-#ifdef USING_BORROWED_QPTRDICT
-#include <_qptrdict.h>
-#else
-
 #include <KWQDef.h>
 #include <qcollection.h>
 
@@ -43,99 +33,43 @@
 
 template <class T> class QPtrDictIterator;
 
-// class QPtrDict ==============================================================
-
 template <class T> class QPtrDict : public QPtrCollection {
 public:
-
-    // typedefs ----------------------------------------------------------------
-    // enums -------------------------------------------------------------------
-    // constants ---------------------------------------------------------------
-    // static member functions -------------------------------------------------
-
-    // constructors, copy constructors, and destructors ------------------------
-
     QPtrDict(int size=17) : impl(size, deleteFunc) {}
-    QPtrDict(const QPtrDict<T> &pd) : QPtrCollection(pd), impl(pd.impl) {}
     virtual ~QPtrDict() { impl.clear(del_item); }
 
-    // member functions --------------------------------------------------------
-
     virtual void clear() { impl.clear(del_item); }
     virtual uint count() const { return impl.count(); }
 
     T *take(void *key) { return (T *)impl.take(key); }
-    void insert(void *key, const T *value) { impl.insert(key, (void *)value); }
+    void insert(void *key, T *value) { impl.insert(key, value); }
     bool remove(void *key) { return impl.remove(key, del_item); }
 
-    // operators ---------------------------------------------------------------
-
     QPtrDict<T> &operator=(const QPtrDict<T> &pd) { impl.assign(pd.impl,del_item); QPtrCollection::operator=(pd); return *this; }
     T *operator[](void *key) const { return (T *)impl.find(key); } 
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
  private:
-    static void deleteFunc(void *item) {
-	delete (T *)item;
-    }
+    static void deleteFunc(void *item) { delete (T *)item; }
 
     KWQPtrDictImpl impl;
-
+    
     friend class QPtrDictIterator<T>;
-}; // class QPtrDict ===========================================================
-
-
-// class QPtrDictIterator ======================================================
+};
 
 template<class T> class QPtrDictIterator {
 public:
-
-    // typedefs ----------------------------------------------------------------
-    // enums -------------------------------------------------------------------
-    // constants ---------------------------------------------------------------
-    // static member functions -------------------------------------------------
-
-    // constructors, copy constructors, and destructors ------------------------
-
-// add no-arg constructor
-#ifdef _KWQ_PEDANTIC_
-    QPtrDictIterator() {}
-#endif
-
-    QPtrDictIterator(const QPtrDict<T> &pd) : impl(pd.impl) {}
-    ~QPtrDictIterator() {}
-
-    // member functions --------------------------------------------------------
-
+    QPtrDictIterator(const QPtrDict<T> &pd) : impl(pd.impl) { }
     uint count() { return impl.count(); }
     T *current() const { return (T *)impl.current(); }
     void *currentKey() const { return impl.currentKey(); }
 
-    // operators ---------------------------------------------------------------
-
-    T *operator++() { return (T *)(++impl); }
-
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
+    T *operator++() { return (T *)++impl; }
 
 private:
     KWQPtrDictIteratorImpl impl;
 
-// add copy constructor
-// this private declaration prevents copying
-#ifdef _KWQ_PEDANTIC_
     QPtrDictIterator(const QPtrDictIterator &);
-#endif
-
-// add assignment operator 
-// this private declaration prevents assignment
-#ifdef _KWQ_PEDANTIC_
     QPtrDictIterator &operator=(const QPtrDictIterator &);
-#endif
-
-}; // class QPtrDictIterator ===================================================
-
-#endif // USING_BORROWED_QPTRDICT
+};
 
 #endif
diff --git a/WebCore/kwq/KWQPtrDictImpl.h b/WebCore/kwq/KWQPtrDictImpl.h
index 0c55f36..f2094fb 100644
--- a/WebCore/kwq/KWQPtrDictImpl.h
+++ b/WebCore/kwq/KWQPtrDictImpl.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,15 +26,14 @@
 #ifndef KWQ_PTRDICT_IMPL_H
 #define KWQ_PTRDICT_IMPL_H
 
-#include <config.h>
 #include <KWQDef.h>
 
-#ifndef USING_BORROWED_PTRQDICT
-
 #include <stddef.h>
 
 #include <CoreFoundation/CFDictionary.h>
 
+class KWQPtrDictPrivate;
+    
 class KWQPtrDictImpl
 {
  public:
@@ -51,17 +50,18 @@ class KWQPtrDictImpl
     void *find(void *key) const;
 
     KWQPtrDictImpl &assign(const KWQPtrDictImpl &pdi, bool deleteItems);
+    
  private:
-    void KWQPtrDictImpl::swap(KWQPtrDictImpl &di);
+    void swap(KWQPtrDictImpl &di);
 
-    class KWQPtrDictPrivate;
-    
     KWQPtrDictPrivate *d;
-
+    
     friend class KWQPtrDictIteratorImpl;
 };
 
 
+class KWQPtrDictIteratorPrivate;
+    
 class KWQPtrDictIteratorImpl {
  public:
     KWQPtrDictIteratorImpl(const KWQPtrDictImpl &pdi);
@@ -70,16 +70,12 @@ class KWQPtrDictIteratorImpl {
     uint count() const;
     void *current() const;
     void *currentKey() const;
-    void *KWQPtrDictIteratorImpl::toFirst();
+    void *toFirst();
 
     void *operator++();
- private:
-    class KWQPtrDictIteratorPrivate;
     
+ private:
     KWQPtrDictIteratorPrivate *d;
 };
 
-
-#endif
-
 #endif
diff --git a/WebCore/kwq/KWQPtrDictImpl.mm b/WebCore/kwq/KWQPtrDictImpl.mm
index df706a4..3c8b081 100644
--- a/WebCore/kwq/KWQPtrDictImpl.mm
+++ b/WebCore/kwq/KWQPtrDictImpl.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -25,43 +25,60 @@
 
 #include <KWQPtrDictImpl.h>
 
-#ifndef USING_BORROWED_QPTRDICT
-
 #include <new>
 
 typedef void (* DeleteFunction) (void *);
 
-class KWQPtrDictImpl::KWQPtrDictPrivate
+class KWQPtrDictPrivate
 {
 public:
     KWQPtrDictPrivate(int size, DeleteFunction, const CFDictionaryKeyCallBacks *cfdkcb);
-    KWQPtrDictPrivate(KWQPtrDictPrivate &dp);
+    KWQPtrDictPrivate(const KWQPtrDictPrivate &dp);
     ~KWQPtrDictPrivate();
     
     CFMutableDictionaryRef cfdict;
     DeleteFunction del;
+    KWQPtrDictIteratorPrivate *iterators;
+};
+
+class KWQPtrDictIteratorPrivate
+{
+public:
+    KWQPtrDictIteratorPrivate(KWQPtrDictPrivate *);
+    ~KWQPtrDictIteratorPrivate();
+    
+    void remove(void *key);
+    void dictDestroyed();
+    
+    uint count;
+    uint pos;
+    void **keys;
+    void **values;
+    KWQPtrDictPrivate *dict;
+    KWQPtrDictIteratorPrivate *next;
+    KWQPtrDictIteratorPrivate *prev;
 };
 
-KWQPtrDictImpl::KWQPtrDictPrivate::KWQPtrDictPrivate(int size, DeleteFunction deleteFunc, const CFDictionaryKeyCallBacks *cfdkcb) :
+
+KWQPtrDictPrivate::KWQPtrDictPrivate(int size, DeleteFunction deleteFunc, const CFDictionaryKeyCallBacks *cfdkcb) :
     cfdict(CFDictionaryCreateMutable(NULL, 0, cfdkcb, NULL)),
-    del(deleteFunc)
+    del(deleteFunc),
+    iterators(0)
 {
-    if (cfdict == NULL) {
-	throw std::bad_alloc();
-    }
 }
 
-KWQPtrDictImpl::KWQPtrDictPrivate::KWQPtrDictPrivate(KWQPtrDictPrivate &dp) :     
+KWQPtrDictPrivate::KWQPtrDictPrivate(const KWQPtrDictPrivate &dp) :     
     cfdict(CFDictionaryCreateMutableCopy(NULL, 0, dp.cfdict)),
-    del(dp.del)
+    del(dp.del),
+    iterators(0)
 {
-    if (cfdict == NULL) {
-	throw std::bad_alloc();
-    }
 }
 
-KWQPtrDictImpl::KWQPtrDictPrivate::~KWQPtrDictPrivate()
+KWQPtrDictPrivate::~KWQPtrDictPrivate()
 {
+    for (KWQPtrDictIteratorPrivate *it = d->iterators; it; it = it->next) {
+        it->dictDestroyed();
+    }
     CFRelease(cfdict);
 }
 
@@ -105,22 +122,25 @@ uint KWQPtrDictImpl::count() const
 void KWQPtrDictImpl::insert(void *key, const void *value)
 {
     CFDictionarySetValue(d->cfdict, key, value);
-
 }
 
 bool KWQPtrDictImpl::remove(void *key, bool deleteItem)
 {
-    void *value = (void *)CFDictionaryGetValue(d->cfdict, key);
+    void *value = find(key);
 
-    if (value == nil) {
+    if (!value) {
 	return false;
     }
 
     CFDictionaryRemoveValue(d->cfdict, key);
-	
+    
     if (deleteItem) {
 	d->del(value);
     }
+    
+    for (KWQPtrDictIteratorPrivate *it = d->iterators; it; it = it->next) {
+        it->remove(key);
+    }
 
     return true;
 }
@@ -164,36 +184,40 @@ void *KWQPtrDictImpl::take(void *key)
 
 
 
-class KWQPtrDictIteratorImpl::KWQPtrDictIteratorPrivate
-{
-public:
-    KWQPtrDictIteratorPrivate(CFMutableDictionaryRef cfdict);
-    ~KWQPtrDictIteratorPrivate();
-    uint count;
-    uint pos;
-    void **keys;
-    void **values;
-};
-
-
-KWQPtrDictIteratorImpl::KWQPtrDictIteratorPrivate::KWQPtrDictIteratorPrivate(CFMutableDictionaryRef cfdict) :
-    count(CFDictionaryGetCount(cfdict)),
+KWQPtrDictIteratorPrivate::KWQPtrDictIteratorPrivate(KWQPtrDictPrivate *d) :
+    count(CFDictionaryGetCount(d->cfdict)),
     pos(0),
-    keys(new void*[count]),
-    values(new void*[count])
+    keys(new void * [count]),
+    values(new void * [count]),
+    dict(d),
+    next(d->iterators),
+    prev(0)
 {
-    CFDictionaryGetKeysAndValues(cfdict, (const void **)keys, (const void **)values);
+    d->iterators = this;
+    if (next) {
+        next->prev = this;
+    }
+    
+    CFDictionaryGetKeysAndValues(d->cfdict, (const void **)keys, (const void **)values);
 }
 
-KWQPtrDictIteratorImpl::KWQPtrDictIteratorPrivate::~KWQPtrDictIteratorPrivate()
+KWQPtrDictIteratorPrivate::~KWQPtrDictIteratorPrivate()
 {
-    delete keys;
-    delete values;
+    if (prev) {
+        prev->next = next;
+    } else if (dict) {
+        dict->iterators = next;
+    }
+    if (next) {
+        next->prev = prev;
+    }
+    
+    delete [] keys;
+    delete [] values;
 }
 
-
 KWQPtrDictIteratorImpl::KWQPtrDictIteratorImpl(const KWQPtrDictImpl &di) : 
-    d(new KWQPtrDictIteratorImpl::KWQPtrDictIteratorPrivate(di.d->cfdict))
+    d(new KWQPtrDictIteratorPrivate(di.d))
 {
 }
 
@@ -215,7 +239,7 @@ void *KWQPtrDictIteratorImpl::current() const
     return d->values[d->pos];
 }
 
-void * KWQPtrDictIteratorImpl::currentKey() const
+void *KWQPtrDictIteratorImpl::currentKey() const
 {
     if (d->pos >= d->count) {
 	return NULL;
@@ -231,8 +255,28 @@ void *KWQPtrDictIteratorImpl::toFirst()
 
 void *KWQPtrDictIteratorImpl::operator++()
 {
-    ++(d->pos);
+    ++d->pos;
     return current();
 }
 
-#endif
+void KWQPtrDictIteratorPrivate::remove(void *key)
+{
+    for (uint i = 0; i < count; ) {
+        if (keys[i] != key) {
+            ++i;
+        } else {
+            --count;
+            if (pos > i) {
+                --pos;
+            }
+            memmove(&keys[i], &keys[i+1], sizeof(keys[i]) * (count - i));
+            memmove(&values[i], &values[i+1], sizeof(values[i]) * (count - i));
+        }
+    }
+}
+
+void KWQPtrDictIteratorPrivate::dictDestroyed()
+{
+    count = 0;
+    dict = 0;
+}
diff --git a/WebCore/kwq/qt/qptrdict.h b/WebCore/kwq/qt/qptrdict.h
index cc3a9d6..5cf99cf 100644
--- a/WebCore/kwq/qt/qptrdict.h
+++ b/WebCore/kwq/qt/qptrdict.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,16 +26,6 @@
 #ifndef QPTRDICT_H_
 #define QPTRDICT_H_
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// USING_BORROWED_QPTRDICT =====================================================
-
-#ifdef USING_BORROWED_QPTRDICT
-#include <_qptrdict.h>
-#else
-
 #include <KWQDef.h>
 #include <qcollection.h>
 
@@ -43,99 +33,43 @@
 
 template <class T> class QPtrDictIterator;
 
-// class QPtrDict ==============================================================
-
 template <class T> class QPtrDict : public QPtrCollection {
 public:
-
-    // typedefs ----------------------------------------------------------------
-    // enums -------------------------------------------------------------------
-    // constants ---------------------------------------------------------------
-    // static member functions -------------------------------------------------
-
-    // constructors, copy constructors, and destructors ------------------------
-
     QPtrDict(int size=17) : impl(size, deleteFunc) {}
-    QPtrDict(const QPtrDict<T> &pd) : QPtrCollection(pd), impl(pd.impl) {}
     virtual ~QPtrDict() { impl.clear(del_item); }
 
-    // member functions --------------------------------------------------------
-
     virtual void clear() { impl.clear(del_item); }
     virtual uint count() const { return impl.count(); }
 
     T *take(void *key) { return (T *)impl.take(key); }
-    void insert(void *key, const T *value) { impl.insert(key, (void *)value); }
+    void insert(void *key, T *value) { impl.insert(key, value); }
     bool remove(void *key) { return impl.remove(key, del_item); }
 
-    // operators ---------------------------------------------------------------
-
     QPtrDict<T> &operator=(const QPtrDict<T> &pd) { impl.assign(pd.impl,del_item); QPtrCollection::operator=(pd); return *this; }
     T *operator[](void *key) const { return (T *)impl.find(key); } 
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
  private:
-    static void deleteFunc(void *item) {
-	delete (T *)item;
-    }
+    static void deleteFunc(void *item) { delete (T *)item; }
 
     KWQPtrDictImpl impl;
-
+    
     friend class QPtrDictIterator<T>;
-}; // class QPtrDict ===========================================================
-
-
-// class QPtrDictIterator ======================================================
+};
 
 template<class T> class QPtrDictIterator {
 public:
-
-    // typedefs ----------------------------------------------------------------
-    // enums -------------------------------------------------------------------
-    // constants ---------------------------------------------------------------
-    // static member functions -------------------------------------------------
-
-    // constructors, copy constructors, and destructors ------------------------
-
-// add no-arg constructor
-#ifdef _KWQ_PEDANTIC_
-    QPtrDictIterator() {}
-#endif
-
-    QPtrDictIterator(const QPtrDict<T> &pd) : impl(pd.impl) {}
-    ~QPtrDictIterator() {}
-
-    // member functions --------------------------------------------------------
-
+    QPtrDictIterator(const QPtrDict<T> &pd) : impl(pd.impl) { }
     uint count() { return impl.count(); }
     T *current() const { return (T *)impl.current(); }
     void *currentKey() const { return impl.currentKey(); }
 
-    // operators ---------------------------------------------------------------
-
-    T *operator++() { return (T *)(++impl); }
-
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
+    T *operator++() { return (T *)++impl; }
 
 private:
     KWQPtrDictIteratorImpl impl;
 
-// add copy constructor
-// this private declaration prevents copying
-#ifdef _KWQ_PEDANTIC_
     QPtrDictIterator(const QPtrDictIterator &);
-#endif
-
-// add assignment operator 
-// this private declaration prevents assignment
-#ifdef _KWQ_PEDANTIC_
     QPtrDictIterator &operator=(const QPtrDictIterator &);
-#endif
-
-}; // class QPtrDictIterator ===================================================
-
-#endif // USING_BORROWED_QPTRDICT
+};
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list