summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-10 17:17:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-10 16:43:36 +0000
commit65731b68bdc67d5be1b459eea7919ec6ca26c4bc (patch)
treea603c2f72540f5261186a4dac0d7f568f31cb6e5 /libreofficekit
parent6bca1cd1e47039878684105db537a120a39c3675 (diff)
gtktiledviewer: fix runtime warnings caused by .uno:InsertAnnotation button
It's a GtkToolButton, but not a GtkToggleToolButton, so don't cast command buttons down unconditionally. Change-Id: Ie7c9bdf6fa8725363e40c1544f4e1e835a559f3a Reviewed-on: https://gerrit.libreoffice.org/26171 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 8a3099ebd8ad..1c68e81144d2 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -777,12 +777,15 @@ static void signalCommand(LOKDocView* pLOKDocView, char* pPayload, gpointer /*pD
{
GtkToolItem* pItem = rWindow.m_aCommandNameToolItems[aKey];
gboolean bEdit = aValue == "true";
- if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem)) != bEdit)
+ if (GTK_IS_TOGGLE_TOOL_BUTTON(pItem))
{
- // Avoid invoking lok_doc_view_post_command().
- rWindow.m_bToolItemBroadcast = false;
- gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(pItem), bEdit);
- rWindow.m_bToolItemBroadcast = true;
+ if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(pItem)) != bEdit)
+ {
+ // Avoid invoking lok_doc_view_post_command().
+ rWindow.m_bToolItemBroadcast = false;
+ gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(pItem), bEdit);
+ rWindow.m_bToolItemBroadcast = true;
+ }
}
}
}