summaryrefslogtreecommitdiff
path: root/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-10 20:47:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-11 11:20:43 +0200
commit2d582244680e7f6dec6e4a466e276f93ccb01dc9 (patch)
treeb0e880ddfb3ce1ea2f47151b648e7fbb55132f08 /libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx
parent74012c48d99634a7556a86f77e9522024f2afdb2 (diff)
loplugin:flatten
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx
index df4146628cc1..fef712ceef0a 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx
@@ -27,28 +27,28 @@ void btn_clicked(GtkWidget* pButton, gpointer)
GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(pButton));
GtkToolButton* pItem = GTK_TOOL_BUTTON(pButton);
const gchar* label = gtk_tool_button_get_label(pItem);
- if (gtv_application_window_get_toolbar_broadcast(window) && g_str_has_prefix(label, ".uno:"))
- {
- std::string aArguments;
- if (g_strcmp0(label, ".uno:InsertAnnotation") == 0)
- {
- std::map<std::string, std::string> aEntries;
- aEntries["Text"] = "";
- GtvHelpers::userPromptDialog(GTK_WINDOW(window), "Insert Comment", aEntries);
+ if (!(gtv_application_window_get_toolbar_broadcast(window) && g_str_has_prefix(label, ".uno:")))
+ return;
- boost::property_tree::ptree aTree;
- aTree.put(boost::property_tree::ptree::path_type(g_strconcat("Text", "/", "type", nullptr), '/'), "string");
- aTree.put(boost::property_tree::ptree::path_type(g_strconcat("Text", "/", "value", nullptr), '/'), aEntries["Text"]);
+ std::string aArguments;
+ if (g_strcmp0(label, ".uno:InsertAnnotation") == 0)
+ {
+ std::map<std::string, std::string> aEntries;
+ aEntries["Text"] = "";
+ GtvHelpers::userPromptDialog(GTK_WINDOW(window), "Insert Comment", aEntries);
- std::stringstream aStream;
- boost::property_tree::write_json(aStream, aTree);
- aArguments = aStream.str();
- }
+ boost::property_tree::ptree aTree;
+ aTree.put(boost::property_tree::ptree::path_type(g_strconcat("Text", "/", "type", nullptr), '/'), "string");
+ aTree.put(boost::property_tree::ptree::path_type(g_strconcat("Text", "/", "value", nullptr), '/'), aEntries["Text"]);
- bool bNotify = g_strcmp0(label, ".uno:Save") == 0;
- if (window->lokdocview)
- lok_doc_view_post_command(LOK_DOC_VIEW(window->lokdocview), label, aArguments.c_str(), bNotify);
+ std::stringstream aStream;
+ boost::property_tree::write_json(aStream, aTree);
+ aArguments = aStream.str();
}
+
+ bool bNotify = g_strcmp0(label, ".uno:Save") == 0;
+ if (window->lokdocview)
+ lok_doc_view_post_command(LOK_DOC_VIEW(window->lokdocview), label, aArguments.c_str(), bNotify);
}
void doCopy(GtkWidget* pButton, gpointer /*pItem*/)