[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:28:29 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6377efc59312cb2264065dcfe924d7938e1dd60d
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 31 21:57:25 2002 +0000

            * kwq/qt/qptrvector.h:
            * kwq/qt/qvector.h:
            * kwq/KWQVectorImpl.h:
            * kwq/KWQVectorImpl.mm:
    	* force-clean-timestamp:
    	New implementation of QVector that does not use CFArray. Should fix some data()
    	anomalies. Shares wierdnesses with the original Qt class.
    
            * WebCore-tests.exp: Remove old QVector entry points and add new ones.
    
            * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::write): Did a tiny optimization
    	by initializing the QString rather than first assigning and then initializing.
    	Also reworded some comments and rearranged code to make it clearer that
    	m_decodingStarted is now used only to decide when to call determineParseMode.
    
            * khtml/css/cssparser.cpp: Removed the APPLE_CHANGES around a change that's
    	fine for non-Apple use as well.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1707 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f2f0adc..0dd9bec 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,23 @@
+2002-07-31  Darin Adler  <darin at apple.com>
+
+        * kwq/qt/qptrvector.h:
+        * kwq/qt/qvector.h:
+        * kwq/KWQVectorImpl.h:
+        * kwq/KWQVectorImpl.mm:
+	* force-clean-timestamp:
+	New implementation of QVector that does not use CFArray. Should fix some data()
+	anomalies. Shares wierdnesses with the original Qt class.
+
+        * WebCore-tests.exp: Remove old QVector entry points and add new ones.
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::write): Did a tiny optimization
+	by initializing the QString rather than first assigning and then initializing.
+	Also reworded some comments and rearranged code to make it clearer that
+	m_decodingStarted is now used only to decide when to call determineParseMode.
+
+        * khtml/css/cssparser.cpp: Removed the APPLE_CHANGES around a change that's
+	fine for non-Apple use as well.
+
 2002-07-30  Maciej Stachowiak  <mjs at apple.com>
 
 	Fixes of various bugs that prevented Alexander from running the
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f2f0adc..0dd9bec 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,23 @@
+2002-07-31  Darin Adler  <darin at apple.com>
+
+        * kwq/qt/qptrvector.h:
+        * kwq/qt/qvector.h:
+        * kwq/KWQVectorImpl.h:
+        * kwq/KWQVectorImpl.mm:
+	* force-clean-timestamp:
+	New implementation of QVector that does not use CFArray. Should fix some data()
+	anomalies. Shares wierdnesses with the original Qt class.
+
+        * WebCore-tests.exp: Remove old QVector entry points and add new ones.
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::write): Did a tiny optimization
+	by initializing the QString rather than first assigning and then initializing.
+	Also reworded some comments and rearranged code to make it clearer that
+	m_decodingStarted is now used only to decide when to call determineParseMode.
+
+        * khtml/css/cssparser.cpp: Removed the APPLE_CHANGES around a change that's
+	fine for non-Apple use as well.
+
 2002-07-30  Maciej Stachowiak  <mjs at apple.com>
 
 	Fixes of various bugs that prevented Alexander from running the
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f2f0adc..0dd9bec 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2002-07-31  Darin Adler  <darin at apple.com>
+
+        * kwq/qt/qptrvector.h:
+        * kwq/qt/qvector.h:
+        * kwq/KWQVectorImpl.h:
+        * kwq/KWQVectorImpl.mm:
+	* force-clean-timestamp:
+	New implementation of QVector that does not use CFArray. Should fix some data()
+	anomalies. Shares wierdnesses with the original Qt class.
+
+        * WebCore-tests.exp: Remove old QVector entry points and add new ones.
+
+        * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::write): Did a tiny optimization
+	by initializing the QString rather than first assigning and then initializing.
+	Also reworded some comments and rearranged code to make it clearer that
+	m_decodingStarted is now used only to decide when to call determineParseMode.
+
+        * khtml/css/cssparser.cpp: Removed the APPLE_CHANGES around a change that's
+	fine for non-Apple use as well.
+
 2002-07-30  Maciej Stachowiak  <mjs at apple.com>
 
 	Fixes of various bugs that prevented Alexander from running the
diff --git a/WebCore/WebCore-tests.exp b/WebCore/WebCore-tests.exp
index 82cf0ed..3f1241b 100644
--- a/WebCore/WebCore-tests.exp
+++ b/WebCore/WebCore-tests.exp
@@ -41,8 +41,8 @@ __ZN12KWQArrayImplC1Emm
 __ZN12KWQArrayImplD1Ev
 __ZN12KWQArrayImplaSERKS_
 __ZN13KWQVectorImpl5clearEb
-__ZN13KWQVectorImpl6insertEjPKvb
 __ZN13KWQVectorImpl6removeEjb
+__ZN13KWQVectorImpl6insertEjPvb
 __ZN13KWQVectorImpl6resizeEjb
 __ZN13KWQVectorImplC1EPFvPvE
 __ZN13KWQVectorImplC1ERKS_
@@ -184,10 +184,6 @@ __ZNK12KWQArrayImpl2atEm
 __ZNK12KWQArrayImpl4dataEv
 __ZNK12KWQArrayImpl4sizeEv
 __ZNK12KWQArrayImpleqERKS_
-__ZNK13KWQVectorImpl2atEi
-__ZNK13KWQVectorImpl4sizeEv
-__ZNK13KWQVectorImpl5countEv
-__ZNK13KWQVectorImpl7isEmptyEv
 __ZNK14KWQPtrDictImpl4findEPv
 __ZNK14KWQPtrDictImpl5countEv
 __ZNK16KWQValueListImpl18containsEqualNodesEP20KWQValueListNodeImplPFbPKS0_S3_E
diff --git a/WebCore/force-clean-timestamp b/WebCore/force-clean-timestamp
index cbb00e5..fb97c17 100644
--- a/WebCore/force-clean-timestamp
+++ b/WebCore/force-clean-timestamp
@@ -1 +1 @@
-QString change 7/29 (and Project Builder bug 3005427)
+QVector change 7/31 (and Project Builder bug 3005427)
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 309bb2f..4bf10b7 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -844,11 +844,7 @@ public:
     bool strictParsing;
 
     QChar getChar() {
-#ifdef APPLE_CHANGES    
       return ( m_yyPos == m_yyIn.length() ) ? QChar('\0') : m_yyIn.at(m_yyPos++);
-#else
-      return ( m_yyPos == m_yyIn.length() ) ? QChar('\0') : m_yyIn.unicode()[m_yyPos++];
-#endif
     }
 
     void startTokenizer( const QString& str, bool _strictParsing ) {
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 6176e6d..21a6406 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -62,7 +62,6 @@ KWQKHTMLPartImpl::KWQKHTMLPartImpl(KHTMLPart *p)
     : part(p)
     , d(part->d)
     , m_redirectionTimer(0)
-    , m_decodingStarted(false)
 {
 }
 
@@ -251,32 +250,29 @@ void KWQKHTMLPartImpl::write( const char *str, int len )
     double start = CFAbsoluteTimeGetCurrent();
 #endif
     
-    // FIXME:  This is very expensive.  We should be using the data object
-    // that represents the document, and only constructing the complete
-    // string when requested.
+    // FIXME: We are putting all the source into this QString for a few bad reasons.
+    // Once those reasons go away, we need to delete this.
     m_documentSource += QString(str, len);
 
-    QString decoded;
-    
-    decoded = d->m_decoder->decode( str, len );
-
-    if(decoded.isEmpty()){
+    QString decoded = d->m_decoder->decode(str, len);
+    if (decoded.isEmpty()) {
         // Check flag to tell whether the load has completed.
         // If we get here, it means that no text encoding was available.
         // Try to process what we have with the default encoding.
         if (d->m_bComplete) {
+            // FIXME: We should get the decoder to give up its raw input since it buffers it
+            // rather than keeping our own copy.
             decoded = m_documentSource;
-        }
-        else {
+        } else {
             fprintf (stderr, "WARNING:  DECODER unable to decode string, length = %d, total length = %d\n", len, m_documentSource.length());
             return;
         }
     }
     
-    if (m_decodingStarted == false)
-	d->m_doc->determineParseMode( decoded );
-   
-    m_decodingStarted = true;
+    if (!m_decodingStarted) {
+	d->m_doc->determineParseMode(decoded);
+        m_decodingStarted = true;
+    }
     
 #if FIGURE_OUT_WHAT_APPLY_CHANGES_DOES
     d->m_doc->applyChanges();
@@ -560,6 +556,7 @@ QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
     return parts;
 }
 
+// FIXME: We should remove this; it's only used by the doomed "View Reconstructed Source" command.
 QString KWQKHTMLPartImpl::documentSource() const
 {
     return m_documentSource;
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 6176e6d..21a6406 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -62,7 +62,6 @@ KWQKHTMLPartImpl::KWQKHTMLPartImpl(KHTMLPart *p)
     : part(p)
     , d(part->d)
     , m_redirectionTimer(0)
-    , m_decodingStarted(false)
 {
 }
 
@@ -251,32 +250,29 @@ void KWQKHTMLPartImpl::write( const char *str, int len )
     double start = CFAbsoluteTimeGetCurrent();
 #endif
     
-    // FIXME:  This is very expensive.  We should be using the data object
-    // that represents the document, and only constructing the complete
-    // string when requested.
+    // FIXME: We are putting all the source into this QString for a few bad reasons.
+    // Once those reasons go away, we need to delete this.
     m_documentSource += QString(str, len);
 
-    QString decoded;
-    
-    decoded = d->m_decoder->decode( str, len );
-
-    if(decoded.isEmpty()){
+    QString decoded = d->m_decoder->decode(str, len);
+    if (decoded.isEmpty()) {
         // Check flag to tell whether the load has completed.
         // If we get here, it means that no text encoding was available.
         // Try to process what we have with the default encoding.
         if (d->m_bComplete) {
+            // FIXME: We should get the decoder to give up its raw input since it buffers it
+            // rather than keeping our own copy.
             decoded = m_documentSource;
-        }
-        else {
+        } else {
             fprintf (stderr, "WARNING:  DECODER unable to decode string, length = %d, total length = %d\n", len, m_documentSource.length());
             return;
         }
     }
     
-    if (m_decodingStarted == false)
-	d->m_doc->determineParseMode( decoded );
-   
-    m_decodingStarted = true;
+    if (!m_decodingStarted) {
+	d->m_doc->determineParseMode(decoded);
+        m_decodingStarted = true;
+    }
     
 #if FIGURE_OUT_WHAT_APPLY_CHANGES_DOES
     d->m_doc->applyChanges();
@@ -560,6 +556,7 @@ QPtrList<KParts::ReadOnlyPart> KWQKHTMLPartImpl::frames() const
     return parts;
 }
 
+// FIXME: We should remove this; it's only used by the doomed "View Reconstructed Source" command.
 QString KWQKHTMLPartImpl::documentSource() const
 {
     return m_documentSource;
diff --git a/WebCore/kwq/KWQPtrVector.h b/WebCore/kwq/KWQPtrVector.h
index ba42067..00c0f18 100644
--- a/WebCore/kwq/KWQPtrVector.h
+++ b/WebCore/kwq/KWQPtrVector.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
@@ -54,13 +54,13 @@ public:
     uint size() const { return impl.size(); }
     bool remove(uint n) { return impl.remove(n, del_item); }
     bool resize(uint size) { return impl.resize(size, del_item); }
-    bool insert(uint n, const T *item) {return impl.insert(n, item, del_item); }
+    bool insert(uint n, T *item) {return impl.insert(n, item, del_item); }
     T *at(int n) const {return (T *)impl.at(n); }
     T **data() {return (T **)impl.data(); }
 
     virtual int compareItems(void *a, void *b) { return a != b; }
 
-    T *operator[](int n) const {return (T *)impl.at(n); }
+    T *operator[](uint n) const {return (T *)impl.at(n); }
     QPtrVector &operator=(const QPtrVector &v) 
     { impl.assign(v.impl,del_item); QPtrCollection::operator=(v); return *this; }
 
diff --git a/WebCore/kwq/KWQVectorImpl.h b/WebCore/kwq/KWQVectorImpl.h
index 2a309a2..2c89818 100644
--- a/WebCore/kwq/KWQVectorImpl.h
+++ b/WebCore/kwq/KWQVectorImpl.h
@@ -30,7 +30,7 @@
 
 class KWQVectorImpl
 {
- public:
+  public:
     KWQVectorImpl(void (*deleteFunc)(void *));
     KWQVectorImpl(uint size, void (*deleteFunc)(void *));
     ~KWQVectorImpl();
@@ -39,22 +39,22 @@ class KWQVectorImpl
     KWQVectorImpl &assign(KWQVectorImpl &vi, bool delItems);
 
     void clear(bool delItems);
-    bool isEmpty() const;
-    uint count() const;
-    uint size() const;
+    bool isEmpty() const { return m_count == 0; }
+    uint count() const { return m_count; }
+    uint size() const { return m_size; }
     bool remove(uint n, bool delItems); 
     bool resize(uint size, bool delItems);
-    bool insert(uint n, const void *item, bool delItems);
-    void *at(int n) const;
-    void **data();
+    bool insert(uint n, void *item, bool delItems);
+    void *at(uint n) const { return m_data[n]; }
+    void **data() { return m_data; }
 
- private:
+  private:
     KWQVectorImpl &operator=(const KWQVectorImpl&);
-    
-    void swap(KWQVectorImpl &di);
 
-    class KWQVectorPrivate;
-    KWQVectorPrivate *d;
+    void **m_data;
+    uint m_size;
+    uint m_count;
+    void (* m_deleteItemFunction)(void *);
 };
 
 #endif
diff --git a/WebCore/kwq/KWQVectorImpl.mm b/WebCore/kwq/KWQVectorImpl.mm
index 77fab6e..54af05c 100644
--- a/WebCore/kwq/KWQVectorImpl.mm
+++ b/WebCore/kwq/KWQVectorImpl.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,216 +25,122 @@
 
 #import <KWQVectorImpl.h>
 
-#ifndef USING_BORROWED_QVECTOR
-
-#import <CoreFoundation/CFArray.h>
-
-#import <new>
-#import <stdlib.h>
-
-#import <Foundation/NSData.h>
-
-class KWQVectorImpl::KWQVectorPrivate
-{
-public:
-    KWQVectorPrivate(int size, void (*deleteFunc)(void *));
-    KWQVectorPrivate(KWQVectorPrivate &vp);
-    ~KWQVectorPrivate();
-    
-    CFMutableArrayRef cfarray;
-    uint size;
-    uint count;
-    uint max;
-    void (*deleteItem)(void *);
-};
-
-KWQVectorImpl::KWQVectorPrivate::KWQVectorPrivate(int sz, void (*deleteFunc)(void *)) :
-    cfarray(CFArrayCreateMutable(NULL, 0, NULL)),
-    size(sz),
-    count(0),
-    max(0),
-    deleteItem(deleteFunc)
-{
-    if (cfarray == NULL) {
-	throw std::bad_alloc();
-    }
-}
-
-KWQVectorImpl::KWQVectorPrivate::KWQVectorPrivate(KWQVectorPrivate &vp) :
-    cfarray(CFArrayCreateMutableCopy(NULL, 0, vp.cfarray)),
-    size(vp.size),
-    count(vp.count),
-    max(vp.max),
-    deleteItem(vp.deleteItem)
-{
-    if (cfarray == NULL) {
-	throw std::bad_alloc();
-    }
-}
-
-KWQVectorImpl::KWQVectorPrivate::~KWQVectorPrivate()
-{
-    CFRelease(cfarray);
-}
-
-
-KWQVectorImpl::KWQVectorImpl(void (*deleteFunc)(void *)) :
-    d(new KWQVectorImpl::KWQVectorPrivate(0, deleteFunc))
+KWQVectorImpl::KWQVectorImpl(void (*f)(void *))
+    : m_data(0), m_size(0), m_count(0), m_deleteItemFunction(f)
 {
 }
 
-KWQVectorImpl::KWQVectorImpl(uint size, void (*deleteFunc)(void *)) :
-    d(new KWQVectorImpl::KWQVectorPrivate(size, deleteFunc))
+KWQVectorImpl::KWQVectorImpl(uint size, void (*f)(void *))
+    : m_data((void **)malloc(size * sizeof(void *)))
+    , m_size(size), m_count(0), m_deleteItemFunction(f)
 {
+    memset(m_data, 0, size * sizeof(void *));
 }
 
-KWQVectorImpl::KWQVectorImpl(const KWQVectorImpl &vi) : 
-    d(new KWQVectorImpl::KWQVectorPrivate(*vi.d))
+KWQVectorImpl::KWQVectorImpl(const KWQVectorImpl &vi)
+    : m_data(vi.m_data ? (void **)malloc(vi.m_size * sizeof(void *)) : 0)
+    , m_size(vi.m_size), m_count(vi.m_count)
+    , m_deleteItemFunction(vi.m_deleteItemFunction)
 {
+    memcpy(m_data, vi.m_data, vi.m_size * sizeof(void *));
 }
 
 KWQVectorImpl::~KWQVectorImpl()
 {
-    delete d;
+    free(m_data);
 }
 
 void KWQVectorImpl::clear(bool delItems)
 {
     if (delItems) {
-	while (d->max > 0) {
-	    d->max--;
-	    void *item = (void *)CFArrayGetValueAtIndex(d->cfarray, d->max);
-	    if (item != NULL) {
-		d->deleteItem(item);
+	for (uint i = 0; i < m_size; ++i) {
+            void *item = m_data[i];
+	    if (item) {
+		m_deleteItemFunction(item);
 	    }
 	}
     }
 
-    CFArrayRemoveAllValues(d->cfarray);
-    d->count = 0;
-    d->max = 0;
-}
-
-bool KWQVectorImpl::isEmpty() const
-{
-    return d->count == 0;
-}
-
-uint KWQVectorImpl::count() const
-{
-    return d->count;
-}
-
-uint KWQVectorImpl::size() const
-{
-    return d->size;
+    free(m_data);
+    m_data = 0;
+    m_size = 0;
+    m_count = 0;
 }
 
 bool KWQVectorImpl::remove(uint n, bool delItems)
 {
-    if (n < d->max) {
-	void *item = (void *)CFArrayGetValueAtIndex(d->cfarray, n);
-	
-	if (item != NULL) {
-	    if (delItems) {
-		d->deleteItem(item);
-	    }
-	    
-	    CFArraySetValueAtIndex(d->cfarray, n, NULL);
-	    
-	    d->count--;
-	}
-	return true;
-    } else {
-	return false;
+    if (n >= m_size) {
+        return false;
+    }
+    
+    void *item = m_data[n];
+    if (item) {
+        if (delItems) {
+            m_deleteItemFunction(item);
+        }
+        --m_count;
     }
+    m_data[n] = 0;
+    return true;
 }
 
 bool KWQVectorImpl::resize(uint size, bool delItems)
 {
-    d->size = size;
+    uint oldSize = m_size;
+    m_size = size;
+    
+    for (uint i = size; i < oldSize; ++i) {
+        void *item = m_data[i];
+        if (item) {
+            if (delItems) {
+                m_deleteItemFunction(item);
+            }
+            --m_count;
+        }
+    }
 
-    while (d->max > size) {
-	d->max--;
-	void *item = (void *)CFArrayGetValueAtIndex(d->cfarray, d->max);
+    m_size = size;
+    m_data = (void **)realloc(m_data, size * sizeof(void *));
 
-	if (item != NULL) {
-	    if (delItems) {
-		d->deleteItem(item);
-	    }
-	    d->count--;
-	}
-	CFArrayRemoveValueAtIndex(d->cfarray, d->max);
+    if (size > oldSize) {
+        memset(&m_data[oldSize], 0, (size - oldSize) * sizeof(void *));
     }
 
     return true;
 }
 
-bool KWQVectorImpl::insert(uint n, const void *item, bool delItems)
+bool KWQVectorImpl::insert(uint n, void *item, bool delItems)
 {
-    if (n >= d->size) {
+    if (n >= m_size) {
 	return false;
     }
 
-    if (n < d->max) {
-	void *item = (void *)CFArrayGetValueAtIndex(d->cfarray, n);
-	if (item != NULL) {
-	    if (delItems) {
-		d->deleteItem((void *)CFArrayGetValueAtIndex(d->cfarray, n));
-	    }
-	} else {
-	    d->count++;
-	}
-    }  else {
-	while (n > d->max) {
-	    CFArraySetValueAtIndex(d->cfarray, d->max, NULL);
-	    d->max++;
-	}
-	d->max++;
-	d->count++;
+    void *oldItem = m_data[n];
+    if (oldItem) {
+        if (delItems) {
+            m_deleteItemFunction(oldItem);
+        }
+        --m_count;
     }
-
-    CFArraySetValueAtIndex(d->cfarray, n, item);
-
-    return true;
-}
-
-void *KWQVectorImpl::at(int n) const
-{
-    if ((unsigned)n >= d->max) {
-	return NULL;
+    
+    m_data[n] = item;
+    if (item) {
+        ++m_count;
     }
-
-    return (void *)CFArrayGetValueAtIndex(d->cfarray, n);
-}
-
-void **KWQVectorImpl::data()
-{
-    int length = CFArrayGetCount(d->cfarray);
-
-    // Use an autoreleased NSMutableData object. This is pure evil.
-    void ** values = (void **) [[[[NSMutableData alloc] initWithLength:length] autorelease] mutableBytes];
-
-    CFArrayGetValues(d->cfarray, CFRangeMake(0, length), (const void **)values);
-    return values;
+    
+    return true;
 }
 
-KWQVectorImpl &KWQVectorImpl::assign (KWQVectorImpl &vi, bool delItems)
+KWQVectorImpl &KWQVectorImpl::assign(KWQVectorImpl &vi, bool delItems)
 {
-    KWQVectorImpl tmp(vi);
-
-    swap(tmp);
+    clear(delItems);
+    
+    m_data = vi.m_data ? (void **)malloc(vi.m_size * sizeof(void *)) : 0;
+    m_size = vi.m_size;
+    m_count = vi.m_count;
+    m_deleteItemFunction = vi.m_deleteItemFunction;
 
+    memcpy(m_data, vi.m_data, vi.m_size * sizeof(void *));
+    
     return *this;
 }
-
-void KWQVectorImpl::KWQVectorImpl::swap(KWQVectorImpl &di)
-{
-    KWQVectorImpl::KWQVectorPrivate *tmp = d;
-    d = di.d;
-    di.d = tmp;
-}
-
-
-#endif
-
diff --git a/WebCore/kwq/qt/qptrvector.h b/WebCore/kwq/qt/qptrvector.h
index 431db90..251974c 100644
--- a/WebCore/kwq/qt/qptrvector.h
+++ b/WebCore/kwq/qt/qptrvector.h
@@ -1,2 +1 @@
-
 #include <qvector.h>
diff --git a/WebCore/kwq/qt/qvector.h b/WebCore/kwq/qt/qvector.h
index ba42067..00c0f18 100644
--- a/WebCore/kwq/qt/qvector.h
+++ b/WebCore/kwq/qt/qvector.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
@@ -54,13 +54,13 @@ public:
     uint size() const { return impl.size(); }
     bool remove(uint n) { return impl.remove(n, del_item); }
     bool resize(uint size) { return impl.resize(size, del_item); }
-    bool insert(uint n, const T *item) {return impl.insert(n, item, del_item); }
+    bool insert(uint n, T *item) {return impl.insert(n, item, del_item); }
     T *at(int n) const {return (T *)impl.at(n); }
     T **data() {return (T **)impl.data(); }
 
     virtual int compareItems(void *a, void *b) { return a != b; }
 
-    T *operator[](int n) const {return (T *)impl.at(n); }
+    T *operator[](uint n) const {return (T *)impl.at(n); }
     QPtrVector &operator=(const QPtrVector &v) 
     { impl.assign(v.impl,del_item); QPtrCollection::operator=(v); return *this; }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list