summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-16 12:21:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-16 12:21:20 +0100
commit45b82d9f6d99fb059039f1ef05060b364aecb104 (patch)
treeb9cef5a040d5c6382cc7b0ca7091b04bb120d501
parent144b5e68106415d2e9a4a6a51e259d329a695d5f (diff)
libreofficekit: various loplugin fixes
Change-Id: I317f8f5397bfeb9c0d6ecaaa656cb31e66eece0b
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx2
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx16
2 files changed, 10 insertions, 8 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 92ffdd489ea0..716bcc26c6d5 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -112,7 +112,7 @@ void toggleEditing(GtkWidget* /*pButton*/, gpointer /*pItem*/)
{
LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView);
bool bActive = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pEnableEditing));
- if (lok_docview_get_edit(pLOKDocView) != bActive)
+ if (bool(lok_docview_get_edit(pLOKDocView)) != bActive)
lok_docview_set_edit(pLOKDocView, bActive);
}
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 1f542b5034ec..c0f2130fad80 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -29,8 +29,8 @@
// Number of handles around a graphic selection.
#define GRAPHIC_HANDLE_COUNT 8
-static void lok_docview_class_init( LOKDocViewClass* pClass );
-static void lok_docview_init( LOKDocView* pDocView );
+static void lok_docview_class_init( gpointer );
+static void lok_docview_init( GTypeInstance *, gpointer );
static float pixelToTwip(float nInput);
static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpointer pData);
@@ -301,8 +301,8 @@ SAL_DLLPUBLIC_EXPORT guint lok_docview_get_type()
pName,
sizeof( LOKDocView ),
sizeof( LOKDocViewClass ),
- (GtkClassInitFunc) lok_docview_class_init,
- (GtkObjectInitFunc) lok_docview_init,
+ lok_docview_class_init,
+ lok_docview_init,
NULL,
NULL,
(GtkClassInitFunc) NULL
@@ -321,8 +321,9 @@ enum
static guint docview_signals[LAST_SIGNAL] = { 0 };
-static void lok_docview_class_init( LOKDocViewClass* pClass )
+static void lok_docview_class_init( gpointer ptr )
{
+ LOKDocViewClass* pClass = static_cast<LOKDocViewClass *>(ptr);
GObjectClass *gobject_class = G_OBJECT_CLASS(pClass);
pClass->edit_changed = NULL;
docview_signals[EDIT_CHANGED] =
@@ -336,8 +337,9 @@ static void lok_docview_class_init( LOKDocViewClass* pClass )
G_TYPE_BOOLEAN);
}
-static void lok_docview_init( LOKDocView* pDocView )
+static void lok_docview_init( GTypeInstance *, gpointer ptr )
{
+ LOKDocView* pDocView = static_cast<LOKDocView *>(ptr);
// Gtk ScrolledWindow is apparently not fully initialised yet, we specifically
// have to set the [hv]adjustment to prevent GTK assertions from firing, see
// https://bugzilla.gnome.org/show_bug.cgi?id=438114 for more info.
@@ -878,7 +880,7 @@ static gboolean lok_docview_callback(gpointer pData)
}
break;
default:
- g_assert(0);
+ g_assert(false);
break;
}