X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce7fe42e848cc0c9058dae906c3a7bded50681e6..f363cee882672e147340240cf0bb194a68e37833:/src/common/webview.cpp diff --git a/src/common/webview.cpp b/src/common/webview.cpp index 96435027c9..afaf3ffd09 100644 --- a/src/common/webview.cpp +++ b/src/common/webview.cpp @@ -2,7 +2,6 @@ // Name: webview.cpp // Purpose: Common interface and events for web view component // Author: Marianne Gagnon -// Id: $Id$ // Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -89,9 +88,8 @@ void wxWebView::RegisterFactory(const wxString& backend, // static wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backend) { - // Initialise the map if needed - if(m_factoryMap.empty()) - InitFactoryMap(); + // Initialise the map, it checks internally for existing factories + InitFactoryMap(); return m_factoryMap.find(backend); } @@ -100,10 +98,12 @@ wxStringWebViewFactoryMap::iterator wxWebView::FindFactory(const wxString &backe void wxWebView::InitFactoryMap() { #ifdef __WXMSW__ - RegisterFactory(wxWebViewBackendIE, wxSharedPtr + if(m_factoryMap.find(wxWebViewBackendIE) == m_factoryMap.end()) + RegisterFactory(wxWebViewBackendIE, wxSharedPtr (new wxWebViewFactoryIE)); #else - RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr + if(m_factoryMap.find(wxWebViewBackendWebKit) == m_factoryMap.end()) + RegisterFactory(wxWebViewBackendWebKit, wxSharedPtr (new wxWebViewFactoryWebKit)); #endif }