[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

kevino at webkit.org kevino at webkit.org
Wed Dec 22 13:54:10 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 687bee7bb86f29975f177cb46d260e9b07b08fae
Author: kevino at webkit.org <kevino at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 29 04:06:18 2010 +0000

    [wx] wxMSW build fix. Don't use multiple inheritance in PopupMenuWx to avoid debug build
    compiler error about ambiguity over which new override (wx's or FastAllocBase's) to use.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7a3049c..5b81b16 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-28  Kevin Ollivier  <kevino at theolliviers.com>
+
+        [wx] wxMSW build fix. Don't use multiple inheritance in PopupMenuWx to avoid debug build
+        compiler error about ambiguity over which new override (wx's or FastAllocBase's) to use.
+
+        * platform/wx/PopupMenuWx.cpp:
+        (WebCore::PopupMenuEventHandler::PopupMenuEventHandler):
+        (WebCore::PopupMenuEventHandler::OnMenuItemSelected):
+        (WebCore::PopupMenuWx::PopupMenuWx):
+        (WebCore::PopupMenuWx::show):
+        * platform/wx/PopupMenuWx.h:
+
 2010-09-28  Xiaomei Ji  <xji at chromium.org>
 
         Reviewed by NOBODY (revert unsquashed git commits)
diff --git a/WebCore/platform/wx/PopupMenuWx.cpp b/WebCore/platform/wx/PopupMenuWx.cpp
index e88d1e5..b850ef5 100644
--- a/WebCore/platform/wx/PopupMenuWx.cpp
+++ b/WebCore/platform/wx/PopupMenuWx.cpp
@@ -38,14 +38,34 @@
 
 static int s_menuStartId = wxNewId();
 
+namespace WebCore {
+
+class PopupMenuEventHandler : public wxEvtHandler
+{
+public:
+    PopupMenuEventHandler(PopupMenuClient* client) :
+        m_client(client)
+    {}
+
+    void OnMenuItemSelected(wxCommandEvent& event)
+    {
+        if (m_client) {
+            m_client->valueChanged(event.GetId() - s_menuStartId);
+            m_client->popupDidHide();
+        }
+        // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
+    }
 
+private:
+    PopupMenuClient* m_client;
 
-namespace WebCore {
+};
 
 PopupMenuWx::PopupMenuWx(PopupMenuClient* client)
     : m_popupClient(client)
-    , m_menu(NULL)
+    , m_menu(0)
 {
+    PopupMenuEventHandler m_popupHandler(client);
 }
 
 PopupMenuWx::~PopupMenuWx()
@@ -69,6 +89,7 @@ void PopupMenuWx::show(const IntRect& r, FrameView* v, int index)
     if (nativeWin) {
         // construct the menu
         m_menu = new wxMenu();
+
         int size = client()->listSize();
         for (int i = 0; i < size; i++) {
             int id = s_menuStartId + i;
@@ -84,19 +105,10 @@ void PopupMenuWx::show(const IntRect& r, FrameView* v, int index)
                     m_menu->Append(s_menuStartId + i, client()->itemText(i));
             }
         }
-        nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuWx::OnMenuItemSelected), 0, this);
+        nativeWin->Connect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
         nativeWin->PopupMenu(m_menu, r.x() - v->scrollX(), r.y() - v->scrollY());
-        nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuWx::OnMenuItemSelected), 0, this);
-    }
-}
-
-void PopupMenuWx::OnMenuItemSelected(wxCommandEvent& event)
-{
-    if (client()) {
-        client()->valueChanged(event.GetId() - s_menuStartId);
-        client()->popupDidHide();
+        nativeWin->Disconnect(s_menuStartId, s_menuStartId + (size-1), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuEventHandler::OnMenuItemSelected), 0, m_popupHandler);
     }
-    // TODO: Do we need to call Disconnect here? Do we have a ref to the native window still?
 }
 
 void PopupMenuWx::hide()
diff --git a/WebCore/platform/wx/PopupMenuWx.h b/WebCore/platform/wx/PopupMenuWx.h
index c2573fc..ad947a7 100644
--- a/WebCore/platform/wx/PopupMenuWx.h
+++ b/WebCore/platform/wx/PopupMenuWx.h
@@ -37,9 +37,10 @@ class wxMenu;
 namespace WebCore {
 
 class FrameView;
+class PopupMenuEventHandler;
 class Scrollbar;
 
-class PopupMenuWx : public PopupMenu, public wxEvtHandler {
+class PopupMenuWx : public PopupMenu {
 public:
     PopupMenuWx(PopupMenuClient*);
     ~PopupMenuWx();
@@ -55,6 +56,7 @@ private:
 
     PopupMenuClient* m_popupClient;
     wxMenu* m_menu;
+    PopupMenuEventHandler* m_popupHandler;
 };
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list