summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
+ }
}
}
}