Change PopupMenuClient::listSize to return an int to appease warnings from MSVC /W3
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2007 17:50:16 +0000 (17:50 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2007 17:50:16 +0000 (17:50 +0000)
Reviewed by John.

No regression test possible.

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* platform/PopupMenuClient.h:
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::calculatePositionAndSize):
(WebCore::PopupMenu::focusFirst):
(WebCore::PopupMenu::focusLast):
(WebCore::PopupMenu::down):
(WebCore::PopupMenu::up):
(WebCore::PopupMenu::paint):
* rendering/RenderMenuList.cpp:
* rendering/RenderMenuList.h:
* rendering/RenderTextControl.cpp:
* rendering/RenderTextControl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23876 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp
WebCore/platform/PopupMenuClient.h
WebCore/platform/win/PopupMenuWin.cpp
WebCore/rendering/RenderMenuList.cpp
WebCore/rendering/RenderMenuList.h
WebCore/rendering/RenderTextControl.cpp
WebCore/rendering/RenderTextControl.h

index 642f196f28777d5de5287267b2fd50f06e0c4174..239c0086ca17d7e8a346e57792916a3dc8b36b54 100644 (file)
@@ -1,3 +1,26 @@
+2007-06-29  Adam Roben  <aroben@apple.com>
+
+        Change PopupMenuClient::listSize to return an int to appease warnings from MSVC /W3
+
+        Reviewed by John.
+
+        No regression test possible.
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        * platform/PopupMenuClient.h:
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenu::calculatePositionAndSize):
+        (WebCore::PopupMenu::focusFirst):
+        (WebCore::PopupMenu::focusLast):
+        (WebCore::PopupMenu::down):
+        (WebCore::PopupMenu::up):
+        (WebCore::PopupMenu::paint):
+        * rendering/RenderMenuList.cpp:
+        * rendering/RenderMenuList.h:
+        * rendering/RenderTextControl.cpp:
+        * rendering/RenderTextControl.h:
+
 2007-06-29  Adam Roben  <aroben@apple.com>
 
         Fix two typos spotted by MSVC /W3
index 32c6e1ff3fdd3df6ad407ef9855094883bd4c0d4..adf161997ac39daf096b0cb5578ae9f544554d70 100644 (file)
@@ -644,7 +644,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
 #else
         int listIndex = optionToListIndex(selectedIndex());
         if (keyIdentifier == "Down" || keyIdentifier == "Right") {
-            size_t size = listItems().size();
+            int size = listItems().size();
             for (listIndex += 1;
                  listIndex >= 0 && listIndex < size && (listItems()[listIndex]->disabled() || !listItems()[listIndex]->hasTagName(optionTag));
                  ++listIndex);
@@ -653,7 +653,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
                 setSelectedIndex(listToOptionIndex(listIndex));
             handled = true;
         } else if (keyIdentifier == "Up" || keyIdentifier == "Left") {
-            size_t size = listItems().size();
+            int size = listItems().size();
             for (listIndex -= 1;
                  listIndex >= 0 && listIndex < size && (listItems()[listIndex]->disabled() || !listItems()[listIndex]->hasTagName(optionTag));
                  --listIndex);
index b4fe3ce59a2e2de8333c2ebabb4ac9a938975cfb..e2dbecb3062d86b2844f275d155d223eb60ece0f 100644 (file)
@@ -39,7 +39,7 @@ public:
     virtual Document* clientDocument() const = 0;
     virtual int clientPaddingLeft() const = 0;
     virtual int clientPaddingRight() const = 0;
-    virtual unsigned listSize() const = 0;
+    virtual int listSize() const = 0;
     virtual int selectedIndex() const = 0;
     virtual void hidePopup() = 0;
     virtual bool itemIsSeparator(unsigned listIndex) const = 0;
index fcbb8639d0017e61c831cbc12756b297d33ac7e3..f98f8a40da9218c836788793ab3e0eece328dc2f 100644 (file)
@@ -168,7 +168,7 @@ void PopupMenu::calculatePositionAndSize(const IntRect& r, FrameView* v)
     rScreenCoords.setLocation(location);
 
     // First, determine the popup's height
-    size_t itemCount = client()->listSize();
+    int itemCount = client()->listSize();
     m_itemHeight = client()->clientStyle()->font().height() + optionSpacingMiddle;
     int naturalHeight = m_itemHeight * itemCount;
     int popupHeight = min(maxPopupHeight, naturalHeight);
@@ -279,7 +279,7 @@ void PopupMenu::focusFirst()
     if (!client())
         return;
 
-    size_t size = client()->listSize();
+    int size = client()->listSize();
 
     for (int i = 0; i < size; ++i)
         if (client()->itemIsEnabled(i)) {
@@ -293,7 +293,7 @@ void PopupMenu::focusLast()
     if (!client())
         return;
 
-    size_t size = client()->listSize();
+    int size = client()->listSize();
 
     for (int i = size - 1; i > 0; --i)
         if (client()->itemIsEnabled(i)) {
@@ -307,7 +307,7 @@ bool PopupMenu::down(unsigned lines)
     if (!client())
         return false;
 
-    size_t size = client()->listSize();
+    int size = client()->listSize();
 
     int lastSelectableIndex, selectedListIndex;
     lastSelectableIndex = selectedListIndex = focusedIndex();
@@ -326,7 +326,7 @@ bool PopupMenu::up(unsigned lines)
     if (!client())
         return false;
 
-    size_t size = client()->listSize();
+    int size = client()->listSize();
 
     int lastSelectableIndex, selectedListIndex;
     lastSelectableIndex = selectedListIndex = focusedIndex();
@@ -452,7 +452,7 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc)
 
     GraphicsContext context(m_DC);
 
-    size_t itemCount = client()->listSize();
+    int itemCount = client()->listSize();
 
     // listRect is the damageRect translated into the coordinates of the entire menu list (which is itemCount * m_itemHeight pixels tall)
     IntRect listRect = damageRect;
index d540fece2f27d63e28a227e0912c084f184a03fd..d7950b5862508d34a7779c4c13e0956be6228b03 100644 (file)
@@ -337,7 +337,7 @@ int RenderMenuList::clientPaddingRight() const
     return paddingRight();
 }
 
-unsigned RenderMenuList::listSize() const
+int RenderMenuList::listSize() const
 {
     HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
     return select->listItems().size();
index 5e4008bff6e4866de3db285656666499bec4e31e..a453f814734ccd8a49d8ae169c15baaf326a5c4e 100644 (file)
@@ -76,7 +76,7 @@ private:
     virtual Document* clientDocument() const;
     virtual int clientPaddingLeft() const;
     virtual int clientPaddingRight() const;
-    virtual unsigned listSize() const;
+    virtual int listSize() const;
     virtual int selectedIndex() const;
     virtual bool itemIsSeparator(unsigned listIndex) const;
     virtual bool itemIsLabel(unsigned listIndex) const;
index 2396297b9539e3545fde6545e8d925d10ebc3d7f..0d42fc2bfd1aa4b5499978b34d57c1e0a6bffab8 100644 (file)
@@ -915,7 +915,7 @@ void RenderTextControl::hidePopup()
 
 void RenderTextControl::valueChanged(unsigned listIndex, bool fireEvents)
 {
-    ASSERT(listIndex < listSize());
+    ASSERT(static_cast<int>(listIndex) < listSize());
     HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
     if (listIndex == (listSize() - 1)) {
         if (fireEvents) {
@@ -937,7 +937,7 @@ void RenderTextControl::valueChanged(unsigned listIndex, bool fireEvents)
 
 String RenderTextControl::itemText(unsigned listIndex) const
 {
-    unsigned size = listSize();
+    int size = listSize();
     if (size == 1) {
         ASSERT(!listIndex);
         return searchMenuNoRecentSearchesText();
@@ -983,7 +983,7 @@ int RenderTextControl::clientPaddingRight() const
     return paddingRight() + m_cancelButton->renderer()->width();
 }
 
-unsigned RenderTextControl::listSize() const
+int RenderTextControl::listSize() const
 {
     // If there are no recent searches, then our menu will have 1 "No recent searches" item.
     if (!m_recentSearches.size())
index 1701bcfb910b4436d29e4f899c416e38c65fcdb0..fb9eb2b6b7377ae3817790cd61de9be8c9e46491 100644 (file)
@@ -105,7 +105,7 @@ private:
     virtual Document* clientDocument() const;
     virtual int clientPaddingLeft() const;
     virtual int clientPaddingRight() const;
-    virtual unsigned listSize() const;
+    virtual int listSize() const;
     virtual int selectedIndex() const;
     virtual bool itemIsSeparator(unsigned listIndex) const;
     virtual bool itemIsLabel(unsigned listIndex) const;