diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 7d1fad2c28..3d11783c76 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -232,8 +232,8 @@ wxString wxWebViewIE::GetPageSource() const if(SUCCEEDED(hr)) { BSTR bstr; - htmlTag->get_outerHTML(&bstr); - source = wxString(bstr); + if ( htmlTag->get_outerHTML(&bstr) == S_OK ) + source = wxString(bstr); } } return source; @@ -573,16 +573,15 @@ wxString wxWebViewIE::GetCurrentTitle() const { wxCOMPtr document(GetDocument()); + wxString s; if(document) { BSTR title; - document->get_nameProp(&title); - return wxString(title); - } - else - { - return ""; + if ( document->get_nameProp(&title) == S_OK ) + s = title; } + + return s; } bool wxWebViewIE::CanCut() const @@ -707,16 +706,13 @@ bool wxWebViewIE::IsEditable() const if(document) { BSTR mode; - document->get_designMode(&mode); - if(wxString(mode) == "On") - return true; - else - return false; - } - else - { - return false; + if ( document->get_designMode(&mode) == S_OK ) + { + if ( wxString(mode) == "On" ) + return true; + } } + return false; } void wxWebViewIE::SelectAll() @@ -736,8 +732,8 @@ bool wxWebViewIE::HasSelection() const if(SUCCEEDED(hr)) { BSTR type; - selection->get_type(&type); - sel = wxString(type); + if ( selection->get_type(&type) == S_OK ) + sel = wxString(type); } return sel != "None"; } @@ -772,8 +768,8 @@ wxString wxWebViewIE::GetSelectedText() const if(SUCCEEDED(hr)) { BSTR text; - range->get_text(&text); - selected = wxString(text); + if ( range->get_text(&text) == S_OK ) + selected = wxString(text); } } } @@ -805,8 +801,8 @@ wxString wxWebViewIE::GetSelectedSource() const if(SUCCEEDED(hr)) { BSTR text; - range->get_htmlText(&text); - selected = wxString(text); + if ( range->get_htmlText(&text) == S_OK ) + selected = wxString(text); } } } @@ -846,8 +842,8 @@ wxString wxWebViewIE::GetPageText() const if(SUCCEEDED(hr)) { BSTR out; - body->get_innerText(&out); - text = wxString(out); + if ( body->get_innerText(&out) == S_OK ) + text = wxString(out); } return text; }