]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix compiler warnings in the IE backend.
authorSteve Lamerton <steve.lamerton@gmail.com>
Thu, 14 Jul 2011 13:05:12 +0000 (13:05 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Thu, 14 Jul 2011 13:05:12 +0000 (13:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/webview_ie.cpp

index af3742a683fa46707d7e0a9c67079e03f0c8f952..343699581c848678167abb6ad2296c0417467b1f 100644 (file)
@@ -168,21 +168,23 @@ wxString wxWebViewIE::GetPageSource()
     IHTMLDocument2* document = GetDocument();
     IHTMLElement *bodyTag = NULL;
     IHTMLElement *htmlTag = NULL;
     IHTMLDocument2* document = GetDocument();
     IHTMLElement *bodyTag = NULL;
     IHTMLElement *htmlTag = NULL;
-    BSTR bstr;
+    wxString source;
     HRESULT hr = document->get_body(&bodyTag);
     if(SUCCEEDED(hr))
     {
         hr = bodyTag->get_parentElement(&htmlTag);
         if(SUCCEEDED(hr))
         {
     HRESULT hr = document->get_body(&bodyTag);
     if(SUCCEEDED(hr))
     {
         hr = bodyTag->get_parentElement(&htmlTag);
         if(SUCCEEDED(hr))
         {
+            BSTR bstr;
             htmlTag->get_outerHTML(&bstr);
             htmlTag->get_outerHTML(&bstr);
+            source = wxString(bstr);
             htmlTag->Release();
         }
         bodyTag->Release();
     }
 
     document->Release();
             htmlTag->Release();
         }
         bodyTag->Release();
     }
 
     document->Release();
-    return wxString(bstr);
+    return source;
 }
 
 wxWebViewZoom wxWebViewIE::GetZoom()
 }
 
 wxWebViewZoom wxWebViewIE::GetZoom()
@@ -193,6 +195,9 @@ wxWebViewZoom wxWebViewIE::GetZoom()
         return GetIETextZoom();
     else
         wxFAIL;
         return GetIETextZoom();
     else
         wxFAIL;
+
+    //Dummy return to stop compiler warnings
+    return wxWEB_VIEW_ZOOM_MEDIUM;
         
 }
 
         
 }
 
@@ -304,7 +309,7 @@ wxWebViewZoom wxWebViewIE::GetIEOpticalZoom()
     {
         return wxWEB_VIEW_ZOOM_LARGE;
     }
     {
         return wxWEB_VIEW_ZOOM_LARGE;
     }
-    else if (zoom > 145)
+    else /*if (zoom > 145) */ //Using else removes a compiler warning
     {
         return wxWEB_VIEW_ZOOM_LARGEST;
     }
     {
         return wxWEB_VIEW_ZOOM_LARGEST;
     }
@@ -558,12 +563,11 @@ bool wxWebViewIE::IsEditable()
     IHTMLDocument2* document = GetDocument();
     BSTR mode;
     document->get_designMode(&mode);
     IHTMLDocument2* document = GetDocument();
     BSTR mode;
     document->get_designMode(&mode);
+    document->Release();
     if(wxString(mode) == "On")
         return true;
     else
         return false;
     if(wxString(mode) == "On")
         return true;
     else
         return false;
-
-    document->Release();
 }
 
 void wxWebViewIE::SelectAll()
 }
 
 void wxWebViewIE::SelectAll()
@@ -575,15 +579,17 @@ bool wxWebViewIE::HasSelection()
 {
     IHTMLDocument2* document = GetDocument();
     IHTMLSelectionObject* selection;
 {
     IHTMLDocument2* document = GetDocument();
     IHTMLSelectionObject* selection;
-    BSTR type;
+    wxString sel;
     HRESULT hr = document->get_selection(&selection);
     if(SUCCEEDED(hr))
     {
     HRESULT hr = document->get_selection(&selection);
     if(SUCCEEDED(hr))
     {
+        BSTR type;
         selection->get_type(&type);
         selection->get_type(&type);
+        sel = wxString(type);
         selection->Release();
     }
     document->Release();
         selection->Release();
     }
     document->Release();
-    return wxString(type) != "None";
+    return sel != "None";
 }
 
 void wxWebViewIE::DeleteSelection()
 }
 
 void wxWebViewIE::DeleteSelection()
@@ -652,16 +658,18 @@ wxString wxWebViewIE::GetSelectedSource()
 wxString wxWebViewIE::GetPageText()
 {
     IHTMLDocument2* document = GetDocument();
 wxString wxWebViewIE::GetPageText()
 {
     IHTMLDocument2* document = GetDocument();
-    BSTR out;
+    wxString text;
     IHTMLElement* body;
     HRESULT hr = document->get_body(&body);
     if(SUCCEEDED(hr))
     {
     IHTMLElement* body;
     HRESULT hr = document->get_body(&body);
     if(SUCCEEDED(hr))
     {
+        BSTR out;
         body->get_innerText(&out);
         body->get_innerText(&out);
+        text = wxString(out);
         body->Release();
     }
     document->Release();
         body->Release();
     }
     document->Release();
-    return wxString(out);
+    return text;
 }
 
 bool wxWebViewIE::CanExecCommand(wxString command)
 }
 
 bool wxWebViewIE::CanExecCommand(wxString command)