[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 05:58:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b5ab776522feb25b9b3ee818859ce7bc129d4ee8
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Mar 23 21:39:23 2002 +0000

            Fixed problem with extra empty items in menus.
    
    	* src/kwq/KWQComboBox.mm: (QComboBox::insertItem): Add back logic that puts
            an item in a certain position. Even though this is called insertItem, the
            behavior is to replace an item at a certain position.
    	* src/kwq/KWQKComboBox.mm: (KComboBox::setSize): No need to fill the
            array with empty strings; just a waste of time based on how we do things.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@821 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index d0512c5..8c42353 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,13 @@
+2002-03-23  Darin Adler  <darin at apple.com>
+
+        Fixed problem with extra empty items in menus.
+
+	* src/kwq/KWQComboBox.mm: (QComboBox::insertItem): Add back logic that puts
+        an item in a certain position. Even though this is called insertItem, the
+        behavior is to replace an item at a certain position.
+	* src/kwq/KWQKComboBox.mm: (KComboBox::setSize): No need to fill the
+        array with empty strings; just a waste of time based on how we do things.
+
 2002-03-22  Darin Adler  <darin at apple.com>
 
 	* src/kdelibs/khtml/java/Makefile.am:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d0512c5..8c42353 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2002-03-23  Darin Adler  <darin at apple.com>
+
+        Fixed problem with extra empty items in menus.
+
+	* src/kwq/KWQComboBox.mm: (QComboBox::insertItem): Add back logic that puts
+        an item in a certain position. Even though this is called insertItem, the
+        behavior is to replace an item at a certain position.
+	* src/kwq/KWQKComboBox.mm: (KComboBox::setSize): No need to fill the
+        array with empty strings; just a waste of time based on how we do things.
+
 2002-03-22  Darin Adler  <darin at apple.com>
 
 	* src/kdelibs/khtml/java/Makefile.am:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d0512c5..8c42353 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2002-03-23  Darin Adler  <darin at apple.com>
+
+        Fixed problem with extra empty items in menus.
+
+	* src/kwq/KWQComboBox.mm: (QComboBox::insertItem): Add back logic that puts
+        an item in a certain position. Even though this is called insertItem, the
+        behavior is to replace an item at a certain position.
+	* src/kwq/KWQKComboBox.mm: (KComboBox::setSize): No need to fill the
+        array with empty strings; just a waste of time based on how we do things.
+
 2002-03-22  Darin Adler  <darin at apple.com>
 
 	* src/kdelibs/khtml/java/Makefile.am:
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 70b59f9..1961019 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -90,36 +90,16 @@ bool QComboBox::eventFilter(QObject *object, QEvent *event)
 
 void QComboBox::insertItem(const QString &text, int index)
 {
-#ifdef SLOW_AS_POOP
-    KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
-    
-    if (index < 0)
-        index = count();
-
-    NSMutableArray *newItems;
-    unsigned int i, _count;
-    
-    newItems = [[NSMutableArray alloc] init];
-    _count = (index+1 > count()) ? index+1 : count();
-    [comboBox removeAllItems];
-    for (i = 0; i < _count; i++){
-        if (i == (unsigned int)index)
-            [newItems addObject: QSTRING_TO_NSSTRING (text)];
-        else if (i < [items count])
-            [newItems addObject: [items objectAtIndex: i]];
-        else
-            [newItems addObject: @""];
-        [comboBox addItemWithTitle: [NSString stringWithFormat: @"%d", i]]; 
-    }
-    // Hack to allow multiple items with same name.   Ugh.
-    for (i = 0; i < _count; i++){
-        [[comboBox itemAtIndex: i] setTitle: [newItems objectAtIndex: i]];
+    int numItems = [items count];
+    if (index < 0 || index == numItems)
+        [items addObject:QSTRING_TO_NSSTRING(text)];
+    else {
+        while (index >= numItems) {
+            [items addObject: @""];
+            ++numItems;
+        }
+        [items replaceObjectAtIndex:index withObject:QSTRING_TO_NSSTRING(text)];
     }
-    [items release];
-    items = newItems;
-#else
-    [items insertObject: QSTRING_TO_NSSTRING (text) atIndex: index];
-#endif
 }
 
 
diff --git a/WebCore/kwq/KWQKComboBox.mm b/WebCore/kwq/KWQKComboBox.mm
index 1090599..49608d9 100644
--- a/WebCore/kwq/KWQKComboBox.mm
+++ b/WebCore/kwq/KWQKComboBox.mm
@@ -69,15 +69,10 @@ void KComboBox::doneLoading()
     [numberedItems release];
 }
 
+
 void KComboBox::setSize(int size)
 {
-    int i; 
     NSMutableArray *newItems = [[NSMutableArray alloc] initWithCapacity: size];
-    
-    for (i = 0; i < size; i++){
-        [newItems addObject: @""];
-    }
-    
     [items release];
     items = newItems;
 }
diff --git a/WebCore/src/kwq/KWQComboBox.mm b/WebCore/src/kwq/KWQComboBox.mm
index 70b59f9..1961019 100644
--- a/WebCore/src/kwq/KWQComboBox.mm
+++ b/WebCore/src/kwq/KWQComboBox.mm
@@ -90,36 +90,16 @@ bool QComboBox::eventFilter(QObject *object, QEvent *event)
 
 void QComboBox::insertItem(const QString &text, int index)
 {
-#ifdef SLOW_AS_POOP
-    KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
-    
-    if (index < 0)
-        index = count();
-
-    NSMutableArray *newItems;
-    unsigned int i, _count;
-    
-    newItems = [[NSMutableArray alloc] init];
-    _count = (index+1 > count()) ? index+1 : count();
-    [comboBox removeAllItems];
-    for (i = 0; i < _count; i++){
-        if (i == (unsigned int)index)
-            [newItems addObject: QSTRING_TO_NSSTRING (text)];
-        else if (i < [items count])
-            [newItems addObject: [items objectAtIndex: i]];
-        else
-            [newItems addObject: @""];
-        [comboBox addItemWithTitle: [NSString stringWithFormat: @"%d", i]]; 
-    }
-    // Hack to allow multiple items with same name.   Ugh.
-    for (i = 0; i < _count; i++){
-        [[comboBox itemAtIndex: i] setTitle: [newItems objectAtIndex: i]];
+    int numItems = [items count];
+    if (index < 0 || index == numItems)
+        [items addObject:QSTRING_TO_NSSTRING(text)];
+    else {
+        while (index >= numItems) {
+            [items addObject: @""];
+            ++numItems;
+        }
+        [items replaceObjectAtIndex:index withObject:QSTRING_TO_NSSTRING(text)];
     }
-    [items release];
-    items = newItems;
-#else
-    [items insertObject: QSTRING_TO_NSSTRING (text) atIndex: index];
-#endif
 }
 
 
diff --git a/WebCore/src/kwq/KWQKComboBox.mm b/WebCore/src/kwq/KWQKComboBox.mm
index 1090599..49608d9 100644
--- a/WebCore/src/kwq/KWQKComboBox.mm
+++ b/WebCore/src/kwq/KWQKComboBox.mm
@@ -69,15 +69,10 @@ void KComboBox::doneLoading()
     [numberedItems release];
 }
 
+
 void KComboBox::setSize(int size)
 {
-    int i; 
     NSMutableArray *newItems = [[NSMutableArray alloc] initWithCapacity: size];
-    
-    for (i = 0; i < size; i++){
-        [newItems addObject: @""];
-    }
-    
     [items release];
     items = newItems;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list