]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/webview_ie.cpp
Enable variadic macros for VC9 and later.
[wxWidgets.git] / src / msw / webview_ie.cpp
index ddfbd362d0da550459654ddfd331126972904ff9..c42c1a00eacdf34a0604d8b13fa0a95419000b23 100644 (file)
@@ -874,12 +874,13 @@ void wxWebViewIE::ExecCommand(wxString command)
 
 IHTMLDocument2* wxWebViewIE::GetDocument() const
 {
-    IDispatch* dispatch;
+    IDispatch* dispatch = NULL;
     HRESULT result = m_webBrowser->get_Document(&dispatch);
-    if(SUCCEEDED(result))
+    if(dispatch && SUCCEEDED(result))
     {
         IHTMLDocument2* document;
         dispatch->QueryInterface(IID_IHTMLDocument2, (void**)&document);
+        dispatch->Release();
         //document is set to null automatically if the interface isn't supported
         return document;
     }
@@ -1400,10 +1401,15 @@ HRESULT DocHostUIHandler::TranslateAccelerator(LPMSG lpMsg,
         //control is down?
         if((GetKeyState(VK_CONTROL) & 0x8000 ))
         {
-            //skip CTRL-N, CTRL-F and CTRL-P
-            if(lpMsg->wParam == 'N' || lpMsg->wParam == 'P' || lpMsg->wParam == 'F')
+            //skip the accelerators used by the control
+            switch(lpMsg->wParam)
             {
-                return S_OK;
+                case 'F':
+                case 'L':
+                case 'N':
+                case 'O':
+                case 'P':
+                    return S_OK;
             }
         }
         //skip F5