]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcelllayout.c
textview: Use GtkSelectionWindow for touch text selection
[~andy/gtk] / gtk / gtkcelllayout.c
index d0ff6caacce10ac8c6afb5d789ea969655ede7ff..f9e0ce8d061d7f402d6974bb58dee2ce7c5cdea0 100644 (file)
@@ -12,9 +12,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /**
@@ -23,7 +21,7 @@
  * @Title: GtkCellLayout
  *
  * #GtkCellLayout is an interface to be implemented by all objects which
- * want to provide a #GtkTreeViewColumn-like API for packing cells, setting
+ * want to provide a #GtkTreeViewColumn<!-- -->-like API for packing cells, setting
  * attributes and data funcs.
  *
  * One of the notable features provided by implementations of GtkCellLayout
@@ -40,7 +38,7 @@
  * <title>GtkCellLayouts as GtkBuildable</title>
  * <para>
  * Implementations of GtkCellLayout which also implement the GtkBuildable
- * interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry,
+ * interface (#GtkCellView, #GtkIconView, #GtkComboBox,
  * #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects
  * as &lt;child&gt; elements in UI definitions. They support a custom
  * &lt;attributes&gt; element for their children, which can contain
@@ -449,7 +447,7 @@ gtk_cell_layout_set_attributesv (GtkCellLayout   *cell_layout,
  * gtk_cell_layout_set_attributes:
  * @cell_layout: a #GtkCellLayout
  * @cell: a #GtkCellRenderer
- * @Varargs: a %NULL-terminated list of attributes
+ * @...: a %NULL-terminated list of attributes
  *
  * Sets the attributes in list as the attributes of @cell_layout.
  *
@@ -711,7 +709,7 @@ gtk_cell_layout_buildable_set_cell_property (GtkCellArea     *area,
                                             const gchar     *value)
 {
   GParamSpec *pspec;
-  GValue gvalue = { 0, };
+  GValue gvalue = G_VALUE_INIT;
   GError *error = NULL;
 
   pspec = gtk_cell_area_class_find_cell_property (GTK_CELL_AREA_GET_CLASS (area), name);
@@ -807,37 +805,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);