From 4e55fca038a61f0a9579261f107778aad4f81918 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 15 Jun 2017 09:50:26 -0700 Subject: [PATCH] Use explicit conversion to bool --- src/gtk/webview_webkit.cpp | 18 +++++++++--------- src/gtk/webview_webkit2.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 44c95e3dab..ac2159811f 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -581,13 +581,13 @@ void wxWebViewWebKit::GoForward() bool wxWebViewWebKit::CanGoBack() const { - return webkit_web_view_can_go_back(m_web_view); + return webkit_web_view_can_go_back(m_web_view) != 0; } bool wxWebViewWebKit::CanGoForward() const { - return webkit_web_view_can_go_forward(m_web_view); + return webkit_web_view_can_go_forward(m_web_view) != 0; } void wxWebViewWebKit::ClearHistory() @@ -664,17 +664,17 @@ void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr item) bool wxWebViewWebKit::CanCut() const { - return webkit_web_view_can_cut_clipboard(m_web_view); + return webkit_web_view_can_cut_clipboard(m_web_view) != 0; } bool wxWebViewWebKit::CanCopy() const { - return webkit_web_view_can_copy_clipboard(m_web_view); + return webkit_web_view_can_copy_clipboard(m_web_view) != 0; } bool wxWebViewWebKit::CanPaste() const { - return webkit_web_view_can_paste_clipboard(m_web_view); + return webkit_web_view_can_paste_clipboard(m_web_view) != 0; } void wxWebViewWebKit::Cut() @@ -694,12 +694,12 @@ void wxWebViewWebKit::Paste() bool wxWebViewWebKit::CanUndo() const { - return webkit_web_view_can_undo(m_web_view); + return webkit_web_view_can_undo(m_web_view) != 0; } bool wxWebViewWebKit::CanRedo() const { - return webkit_web_view_can_redo(m_web_view); + return webkit_web_view_can_redo(m_web_view) != 0; } void wxWebViewWebKit::Undo() @@ -877,7 +877,7 @@ void wxWebViewWebKit::SetEditable(bool enable) bool wxWebViewWebKit::IsEditable() const { - return webkit_web_view_get_editable(m_web_view); + return webkit_web_view_get_editable(m_web_view) != 0; } void wxWebViewWebKit::DeleteSelection() @@ -887,7 +887,7 @@ void wxWebViewWebKit::DeleteSelection() bool wxWebViewWebKit::HasSelection() const { - return webkit_web_view_has_selection(m_web_view); + return webkit_web_view_has_selection(m_web_view) != 0; } void wxWebViewWebKit::SelectAll() diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp index 4b63eb79f0..3122d8b47f 100644 --- a/src/gtk/webview_webkit2.cpp +++ b/src/gtk/webview_webkit2.cpp @@ -632,13 +632,13 @@ void wxWebViewWebKit::GoForward() bool wxWebViewWebKit::CanGoBack() const { - return webkit_web_view_can_go_back(m_web_view); + return webkit_web_view_can_go_back(m_web_view) != 0; } bool wxWebViewWebKit::CanGoForward() const { - return webkit_web_view_can_go_forward(m_web_view); + return webkit_web_view_can_go_forward(m_web_view) != 0; } void wxWebViewWebKit::ClearHistory() @@ -731,7 +731,7 @@ bool wxWebViewWebKit::CanExecuteEditingCommand(const gchar* command) const NULL); g_object_unref(result); - return can_execute; + return can_execute != 0; } bool wxWebViewWebKit::CanCut() const @@ -962,7 +962,7 @@ bool wxWebViewWebKit::IsEditable() const { gboolean editable; g_object_get(m_web_view, "editable", &editable, NULL); - return editable; + return editable != 0; } void wxWebViewWebKit::DeleteSelection() @@ -997,7 +997,7 @@ bool wxWebViewWebKit::HasSelection() const gboolean has_selection = FALSE; g_variant_get(retval, "(b)", &has_selection); g_variant_unref(retval); - return has_selection; + return has_selection != 0; } } return false;