[Libreoffice-commits] core.git: libreofficekit/qa

Pranav Kant pranavk at collabora.co.uk
Tue Jan 31 14:10:07 UTC 2017


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 96f597acf70ce52f2bdb59c85dd052be54b8d629
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Jan 31 19:35:49 2017 +0530

    gtktiledviewer: gtk version checks
    
    There is no major harm in excluding these lines of code on
    platforms with older gtk.
    
    Change-Id: Ica3f1e2b4f60f0bab55254632663ace7b4c61d4d

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 4307426..675341f 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -258,8 +258,9 @@ static void userPromptDialog(GtkWidget* pDocView, const std::string& aTitle, std
     for (const auto& entry : aEntries)
     {
         GtkWidget* pEntry = gtk_entry_new();
+#if GTK_CHECK_VERSION(3,2,0)
         gtk_entry_set_placeholder_text(GTK_ENTRY(pEntry), entry.first.c_str());
-
+#endif
         gtk_container_add(GTK_CONTAINER(pEntryArea), pEntry);
     }
 
@@ -447,9 +448,11 @@ gboolean CommentsSidebar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfigu
             gtk_container_add(GTK_CONTAINER(rWindow.m_pMainHBox), rWindow.m_pCommentsSidebar->m_pMainVBox);
 
             rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton = gtk_button_new_with_label(".uno:ViewAnnotations");
+#if GTK_CHECK_VERSION(3,12,0)
             // Hack to make sidebar grid wide enough to not need any horizontal scrollbar
             gtk_widget_set_margin_start(rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton, 20);
             gtk_widget_set_margin_end(rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton, 20);
+#endif
             gtk_container_add(GTK_CONTAINER(rWindow.m_pCommentsSidebar->m_pMainVBox), rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton);
             g_signal_connect(rWindow.m_pCommentsSidebar->m_pViewAnnotationsButton, "clicked", G_CALLBACK(CommentsSidebar::unoViewAnnotations), nullptr);
 
@@ -691,15 +694,21 @@ static void addMoreUnoParam(GtkWidget* /*pWidget*/, gpointer userdata)
 
     GtkWidget* pTypeEntry = gtk_entry_new();
     gtk_box_pack_start(GTK_BOX(pParamContainer), pTypeEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
     gtk_entry_set_placeholder_text(GTK_ENTRY(pTypeEntry), "Param type (Eg. boolean, string etc.)");
+#endif
 
     GtkWidget* pNameEntry = gtk_entry_new();
     gtk_box_pack_start(GTK_BOX(pParamContainer), pNameEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
     gtk_entry_set_placeholder_text(GTK_ENTRY(pNameEntry), "Param name");
+#endif
 
     GtkWidget* pValueEntry = gtk_entry_new();
     gtk_box_pack_start(GTK_BOX(pParamContainer), pValueEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
     gtk_entry_set_placeholder_text(GTK_ENTRY(pValueEntry), "Param value");
+#endif
 
     GtkWidget* pRemoveButton = gtk_button_new_from_icon_name("list-remove-symbolic", GTK_ICON_SIZE_BUTTON);
     g_signal_connect(pRemoveButton, "clicked", G_CALLBACK(removeUnoParam), pUnoParamAreaBox);
@@ -942,8 +951,9 @@ static void unoCommandDebugger(GtkWidget* pButton, gpointer /* pItem */)
 
     GtkWidget* pUnoCmdEntry = gtk_entry_new ();
     gtk_box_pack_start(GTK_BOX(pUnoCmdAreaBox), pUnoCmdEntry, TRUE, TRUE, 2);
+#if GTK_CHECK_VERSION(3,2,0)
     gtk_entry_set_placeholder_text(GTK_ENTRY(pUnoCmdEntry), "UNO command (Eg. Bold, Italic etc.)");
-
+#endif
     GtkWidget* pUnoParamAreaBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     gtk_box_pack_start(GTK_BOX(pDialogMessageArea), pUnoParamAreaBox, TRUE, TRUE, 2);
 


More information about the Libreoffice-commits mailing list