diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-12 21:53:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-13 15:06:42 +0100 |
commit | 913d34ec6b8fdb2796f76ce90fee51ade2051189 (patch) | |
tree | 261aefa505e7d71ad38c9d5b2ae0cfe92e9738c8 /libreofficekit/qa | |
parent | eea0879cdf1b40e6ce424dd97b58e2a84846ad79 (diff) |
Extend loplugin:salbool to loplugin:fakebool
...checking for unnecessary uses of more "fake bool" types.
In the past, some of the checks involving the types of variables or data
members, or the return types of functions, issued warnings that required
surrounding code to be changed too (e.g., when changing the signature of a
function whose address was taken). These checks have been tightened now to not
warn in such cases (which avoids warnings that require changes to additional
code, or changes that might even be impossible to make, at the cost of being
less aggressive about removing all unnecessary uses of those "fake bool" types).
Change-Id: I70eb75039817cda34ed611387ee27dc5f36a3e2e
Reviewed-on: https://gerrit.libreoffice.org/82554
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'libreofficekit/qa')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx | 2 | ||||
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx index ee75100464f3..68c3e881caa4 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx @@ -101,7 +101,7 @@ static void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& r cairo_show_text(pCairo, rText.c_str()); } -static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo) +static bool gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo) { GtvCalcHeaderBar* self = GTV_CALC_HEADER_BAR(pWidget); GtvCalcHeaderBarPrivate& priv = getPrivate(GTV_CALC_HEADER_BAR(self)); diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx index 73d945420ab0..4a9df33d6ba2 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx @@ -43,7 +43,7 @@ static gboolean destroyLokDialog(GtkWidget* pWidget, gpointer userdata) void LOKDocViewSigHandlers::editChanged(LOKDocView* pDocView, gboolean bWasEdit, gpointer) { GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(pDocView))); - gboolean bEdit = lok_doc_view_get_edit(LOK_DOC_VIEW(window->lokdocview)); + bool bEdit = lok_doc_view_get_edit(LOK_DOC_VIEW(window->lokdocview)); g_info("signalEdit: %d -> %d", bWasEdit, bEdit); // Let the main toolbar know, so that it can enable disable the button @@ -64,8 +64,8 @@ void LOKDocViewSigHandlers::commandChanged(LOKDocView* pDocView, char* pPayload, if (pItem != nullptr) { if (aValue == "true" || aValue == "false") { - gboolean bEdit = aValue == "true"; - if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem)) != bEdit) + bool bEdit = aValue == "true"; + if (bool(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem))) != bEdit) { // Avoid invoking lok_doc_view_post_command(). // FIXME: maybe block/unblock the signal (see @@ -76,7 +76,7 @@ void LOKDocViewSigHandlers::commandChanged(LOKDocView* pDocView, char* pPayload, } } else if (aValue == "enabled" || aValue == "disabled") { - gboolean bSensitive = aValue == "enabled"; + bool bSensitive = aValue == "enabled"; gtk_widget_set_sensitive(GTK_WIDGET(pItem), bSensitive); // Remember state, so in case edit is disable and enabled |