Fix various GCC warnings in wxWebView.
Closes #13532 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -214,7 +214,7 @@ public:
|
|||||||
class ClassFactory : public IClassFactory
|
class ClassFactory : public IClassFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClassFactory(wxSharedPtr<wxWebViewHandler> handler) : m_handler(handler), m_refCount(0) {}
|
ClassFactory(wxSharedPtr<wxWebViewHandler> handler) : m_refCount(0), m_handler(handler) {}
|
||||||
//IUnknown
|
//IUnknown
|
||||||
ULONG STDMETHODCALLTYPE AddRef();
|
ULONG STDMETHODCALLTYPE AddRef();
|
||||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
|
||||||
|
@@ -157,12 +157,15 @@ wxString wxWebViewIE::GetPageSource() const
|
|||||||
|
|
||||||
wxWebViewZoom wxWebViewIE::GetZoom() const
|
wxWebViewZoom wxWebViewIE::GetZoom() const
|
||||||
{
|
{
|
||||||
if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
|
switch( m_zoomType )
|
||||||
return GetIEOpticalZoom();
|
{
|
||||||
else if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_TEXT)
|
case wxWEB_VIEW_ZOOM_TYPE_LAYOUT:
|
||||||
return GetIETextZoom();
|
return GetIEOpticalZoom();
|
||||||
else
|
case wxWEB_VIEW_ZOOM_TYPE_TEXT:
|
||||||
wxFAIL;
|
return GetIETextZoom();
|
||||||
|
default:
|
||||||
|
wxFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
//Dummy return to stop compiler warnings
|
//Dummy return to stop compiler warnings
|
||||||
return wxWEB_VIEW_ZOOM_MEDIUM;
|
return wxWEB_VIEW_ZOOM_MEDIUM;
|
||||||
@@ -171,12 +174,17 @@ wxWebViewZoom wxWebViewIE::GetZoom() const
|
|||||||
|
|
||||||
void wxWebViewIE::SetZoom(wxWebViewZoom zoom)
|
void wxWebViewIE::SetZoom(wxWebViewZoom zoom)
|
||||||
{
|
{
|
||||||
if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
|
switch( m_zoomType )
|
||||||
SetIEOpticalZoom(zoom);
|
{
|
||||||
else if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_TEXT)
|
case wxWEB_VIEW_ZOOM_TYPE_LAYOUT:
|
||||||
SetIETextZoom(zoom);
|
SetIEOpticalZoom(zoom);
|
||||||
else
|
break;
|
||||||
wxFAIL;
|
case wxWEB_VIEW_ZOOM_TYPE_TEXT:
|
||||||
|
SetIETextZoom(zoom);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
wxFAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWebViewIE::SetIETextZoom(wxWebViewZoom level)
|
void wxWebViewIE::SetIETextZoom(wxWebViewZoom level)
|
||||||
@@ -189,9 +197,12 @@ void wxWebViewIE::SetIETextZoom(wxWebViewZoom level)
|
|||||||
V_VT(&zoomVariant) = VT_I4;
|
V_VT(&zoomVariant) = VT_I4;
|
||||||
V_I4(&zoomVariant) = level;
|
V_I4(&zoomVariant) = level;
|
||||||
|
|
||||||
HRESULT result = m_webBrowser->ExecWB(OLECMDID_ZOOM,
|
#if wxDEBUG_LEVEL
|
||||||
OLECMDEXECOPT_DONTPROMPTUSER,
|
HRESULT result =
|
||||||
&zoomVariant, NULL);
|
#endif
|
||||||
|
m_webBrowser->ExecWB(OLECMDID_ZOOM,
|
||||||
|
OLECMDEXECOPT_DONTPROMPTUSER,
|
||||||
|
&zoomVariant, NULL);
|
||||||
wxASSERT(result == S_OK);
|
wxASSERT(result == S_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,9 +212,12 @@ wxWebViewZoom wxWebViewIE::GetIETextZoom() const
|
|||||||
VariantInit (&zoomVariant);
|
VariantInit (&zoomVariant);
|
||||||
V_VT(&zoomVariant) = VT_I4;
|
V_VT(&zoomVariant) = VT_I4;
|
||||||
|
|
||||||
HRESULT result = m_webBrowser->ExecWB(OLECMDID_ZOOM,
|
#if wxDEBUG_LEVEL
|
||||||
OLECMDEXECOPT_DONTPROMPTUSER,
|
HRESULT result =
|
||||||
NULL, &zoomVariant);
|
#endif
|
||||||
|
m_webBrowser->ExecWB(OLECMDID_ZOOM,
|
||||||
|
OLECMDEXECOPT_DONTPROMPTUSER,
|
||||||
|
NULL, &zoomVariant);
|
||||||
wxASSERT(result == S_OK);
|
wxASSERT(result == S_OK);
|
||||||
|
|
||||||
//We can safely cast here as we know that the range matches our enum
|
//We can safely cast here as we know that the range matches our enum
|
||||||
@@ -240,10 +254,13 @@ void wxWebViewIE::SetIEOpticalZoom(wxWebViewZoom level)
|
|||||||
wxFAIL;
|
wxFAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT result = m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
|
#if wxDEBUG_LEVEL
|
||||||
OLECMDEXECOPT_DODEFAULT,
|
HRESULT result =
|
||||||
&zoomVariant,
|
#endif
|
||||||
NULL);
|
m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
|
||||||
|
OLECMDEXECOPT_DODEFAULT,
|
||||||
|
&zoomVariant,
|
||||||
|
NULL);
|
||||||
wxASSERT(result == S_OK);
|
wxASSERT(result == S_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,9 +270,12 @@ wxWebViewZoom wxWebViewIE::GetIEOpticalZoom() const
|
|||||||
VariantInit (&zoomVariant);
|
VariantInit (&zoomVariant);
|
||||||
V_VT(&zoomVariant) = VT_I4;
|
V_VT(&zoomVariant) = VT_I4;
|
||||||
|
|
||||||
HRESULT result = m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
|
#if wxDEBUG_LEVEL
|
||||||
OLECMDEXECOPT_DODEFAULT, NULL,
|
HRESULT result =
|
||||||
&zoomVariant);
|
#endif
|
||||||
|
m_webBrowser->ExecWB((OLECMDID)63 /*OLECMDID_OPTICAL_ZOOM*/,
|
||||||
|
OLECMDEXECOPT_DODEFAULT, NULL,
|
||||||
|
&zoomVariant);
|
||||||
wxASSERT(result == S_OK);
|
wxASSERT(result == S_OK);
|
||||||
|
|
||||||
const int zoom = V_I4(&zoomVariant);
|
const int zoom = V_I4(&zoomVariant);
|
||||||
@@ -432,9 +452,12 @@ void wxWebViewIE::SetOfflineMode(bool offline)
|
|||||||
{
|
{
|
||||||
// FIXME: the wxWidgets docs do not really document what the return
|
// FIXME: the wxWidgets docs do not really document what the return
|
||||||
// parameter of PutProperty is
|
// parameter of PutProperty is
|
||||||
const bool success = m_ie.PutProperty("Offline", (offline ?
|
#if wxDEBUG_LEVEL
|
||||||
VARIANT_TRUE :
|
const bool success =
|
||||||
VARIANT_FALSE));
|
#endif
|
||||||
|
m_ie.PutProperty("Offline", (offline ?
|
||||||
|
VARIANT_TRUE :
|
||||||
|
VARIANT_FALSE));
|
||||||
wxASSERT(success);
|
wxASSERT(success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user