summaryrefslogtreecommitdiff
path: root/buildable-regression.patch
blob: 332ca90ccff5f52592a470e12b56aaab58622039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
diff --git a/gtk/gtkcelllayout.c b/gtk/gtkcelllayout.c
index d0ff6ca..3fd59ad 100644
--- a/gtk/gtkcelllayout.c
+++ b/gtk/gtkcelllayout.c
@@ -807,37 +807,35 @@ cell_packing_end_element (GMarkupParseContext *context,
   CellPackingSubParserData *parser_data = (CellPackingSubParserData*)user_data;
   GtkCellArea *area;
 
-  /* Append the translated strings */
-  if (parser_data->string->len)
-    {
-      area = gtk_cell_layout_get_area (parser_data->cell_layout);
+  area = gtk_cell_layout_get_area (parser_data->cell_layout);
 
-      if (area)
+  if (area)
+    {
+      /* translate the string */
+      if (parser_data->string->len && parser_data->translatable)
 	{
-	  if (parser_data->translatable)
-	    {
-	      gchar *translated;
-	      const gchar* domain;
-
-	      domain = gtk_builder_get_translation_domain (parser_data->builder);
-
-	      translated = _gtk_builder_parser_translate (domain,
-							  parser_data->context,
-							  parser_data->string->str);
-	      g_string_set_size (parser_data->string, 0);
-	      g_string_append (parser_data->string, translated);
-	    }
-
-	  gtk_cell_layout_buildable_set_cell_property (area, 
-						       parser_data->builder,
-						       parser_data->renderer,
-						       parser_data->cell_prop_name,
-						       parser_data->string->str);
+	  gchar *translated;
+	  const gchar* domain;
+
+	  domain = gtk_builder_get_translation_domain (parser_data->builder);
+
+	  translated = _gtk_builder_parser_translate (domain,
+						      parser_data->context,
+						      parser_data->string->str);
+	  g_string_set_size (parser_data->string, 0);
+	  g_string_append (parser_data->string, translated);
 	}
-      else
-	g_warning ("%s does not have an internal GtkCellArea class and cannot apply child cell properties",
-		   g_type_name (G_OBJECT_TYPE (parser_data->cell_layout)));
+
+      if (parser_data->cell_prop_name)
+	gtk_cell_layout_buildable_set_cell_property (area, 
+						     parser_data->builder,
+						     parser_data->renderer,
+						     parser_data->cell_prop_name,
+						     parser_data->string->str);
     }
+  else
+    g_warning ("%s does not have an internal GtkCellArea class and cannot apply child cell properties",
+	       g_type_name (G_OBJECT_TYPE (parser_data->cell_layout)));
 
   g_string_set_size (parser_data->string, 0);
   g_free (parser_data->cell_prop_name);
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 5bf6f4d..18f046c 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -643,30 +643,28 @@ attributes_end_element (GMarkupParseContext *context,
 {
   PackingPropertiesData *parser_data = (PackingPropertiesData*)user_data;
 
-  /* Append the translated strings */
-  if (parser_data->string->len)
+  /* translate the string */
+  if (parser_data->string->len && parser_data->translatable)
     {
-      if (parser_data->translatable)
-	{
-	  gchar *translated;
-	  const gchar* domain;
-
-	  domain = gtk_builder_get_translation_domain (parser_data->builder);
-
-	  translated = _gtk_builder_parser_translate (domain,
-						      parser_data->context,
-						      parser_data->string->str);
-	  g_string_set_size (parser_data->string, 0);
-	  g_string_append (parser_data->string, translated);
-	}
-
-      gtk_container_buildable_set_child_property (parser_data->container,
-						  parser_data->builder,
-						  parser_data->child,
-						  parser_data->child_prop_name,
+      gchar *translated;
+      const gchar* domain;
+
+      domain = gtk_builder_get_translation_domain (parser_data->builder);
+
+      translated = _gtk_builder_parser_translate (domain,
+						  parser_data->context,
 						  parser_data->string->str);
+      g_string_set_size (parser_data->string, 0);
+      g_string_append (parser_data->string, translated);
     }
 
+  if (parser_data->child_prop_name)
+    gtk_container_buildable_set_child_property (parser_data->container,
+						parser_data->builder,
+						parser_data->child,
+						parser_data->child_prop_name,
+						parser_data->string->str);
+
   g_string_set_size (parser_data->string, 0);
   g_free (parser_data->child_prop_name);
   g_free (parser_data->context);
bgstack15