From a977376af3ab98aeac4ed638f2e9adc495494007 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 24 Jul 2012 20:45:10 +0000 Subject: [PATCH] No real changes, just avoid overloaded virtual wxWebView::SetPage(). Instead, have two public non-virtual SetPage() methods forwarding to a private DoSetPage(), as usual. This avoids the need for "using wxWebView::SetPage" which is needed to avoid warnings about hiding the other base class virtual when implementing one of them and which was forgotten in wxMSW version resulting in warnings when using g++ to compile it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/webview_webkit.h | 4 +--- include/wx/msw/webview_ie.h | 5 +++-- include/wx/osx/webview_webkit.h | 6 ++---- include/wx/webview.h | 12 +++++++++--- src/gtk/webview_webkit.cpp | 2 +- src/msw/webview_ie.cpp | 2 +- src/osx/webview_webkit.mm | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/wx/gtk/webview_webkit.h b/include/wx/gtk/webview_webkit.h index 2ac7eab691..a4e89fc313 100644 --- a/include/wx/gtk/webview_webkit.h +++ b/include/wx/gtk/webview_webkit.h @@ -73,9 +73,6 @@ public: virtual wxString GetCurrentTitle() const; virtual wxString GetPageSource() const; virtual wxString GetPageText() const; - //We do not want to hide the other overloads - using wxWebView::SetPage; - virtual void SetPage(const wxString& html, const wxString& baseUrl); virtual void Print(); virtual bool IsBusy() const; @@ -132,6 +129,7 @@ public: bool m_guard; protected: + virtual void DoSetPage(const wxString& html, const wxString& baseUrl); virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; diff --git a/include/wx/msw/webview_ie.h b/include/wx/msw/webview_ie.h index cced6f7822..ccc1acce4c 100644 --- a/include/wx/msw/webview_ie.h +++ b/include/wx/msw/webview_ie.h @@ -303,8 +303,6 @@ public: virtual void Print(); - virtual void SetPage(const wxString& html, const wxString& baseUrl); - virtual wxWebViewZoom GetZoom() const; virtual void SetZoom(wxWebViewZoom zoom); @@ -356,6 +354,9 @@ public: DECLARE_EVENT_TABLE(); +protected: + virtual void DoSetPage(const wxString& html, const wxString& baseUrl); + private: wxIEContainer* m_container; wxAutomationObject m_ie; diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 3edc601c84..281530f53a 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -59,10 +59,6 @@ public: virtual wxString GetPageSource() const; virtual wxString GetPageText() const; - //We do not want to hide the other overloads - using wxWebView::SetPage; - virtual void SetPage(const wxString& html, const wxString& baseUrl); - virtual void Print(); virtual void LoadURL(const wxString& url); @@ -143,6 +139,8 @@ public: bool m_busy; protected: + virtual void DoSetPage(const wxString& html, const wxString& baseUrl); + DECLARE_EVENT_TABLE() void MacVisibilityChanged(); diff --git a/include/wx/webview.h b/include/wx/webview.h index b69aa96214..4173f2e2f9 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -127,12 +127,15 @@ public: virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT) = 0; virtual void RunScript(const wxString& javascript) = 0; virtual void SetEditable(bool enable = true) = 0; - virtual void SetPage(const wxString& html, const wxString& baseUrl) = 0; - virtual void SetPage(wxInputStream& html, wxString baseUrl) + void SetPage(const wxString& html, const wxString& baseUrl) + { + DoSetPage(html, baseUrl); + } + void SetPage(wxInputStream& html, wxString baseUrl) { wxStringOutputStream stream; stream.Write(html); - SetPage(stream.GetString(), baseUrl); + DoSetPage(stream.GetString(), baseUrl); } virtual void Stop() = 0; @@ -176,6 +179,9 @@ public: virtual void Undo() = 0; virtual void Redo() = 0; +protected: + virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0; + wxDECLARE_ABSTRACT_CLASS(wxWebView); }; diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 2f276abb0c..af8cb03255 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -777,7 +777,7 @@ bool wxWebViewWebKit::CanSetZoomType(wxWebViewZoomType) const return true; } -void wxWebViewWebKit::SetPage(const wxString& html, const wxString& baseUri) +void wxWebViewWebKit::DoSetPage(const wxString& html, const wxString& baseUri) { webkit_web_view_load_string (m_web_view, html.mb_str(wxConvUTF8), diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 0420a58c26..5797f01c78 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -105,7 +105,7 @@ void wxWebViewIE::LoadURL(const wxString& url) m_ie.CallMethod("Navigate", wxConvertStringToOle(url)); } -void wxWebViewIE::SetPage(const wxString& html, const wxString& baseUrl) +void wxWebViewIE::DoSetPage(const wxString& html, const wxString& baseUrl) { BSTR bstr = SysAllocString(OLESTR("")); SAFEARRAY *psaStrings = SafeArrayCreateVector(VT_VARIANT, 0, 1); diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 883fba00f2..fb8796e4ef 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -823,7 +823,7 @@ void wxWebViewWebKit::SetZoom(wxWebViewZoom zoom) } -void wxWebViewWebKit::SetPage(const wxString& src, const wxString& baseUrl) +void wxWebViewWebKit::DoSetPage(const wxString& src, const wxString& baseUrl) { if ( !m_webView ) return; -- 2.45.2