gnumeric r16476 - in trunk: . src src/dialogs



Author: mortenw
Date: Thu Mar 27 22:35:44 2008
New Revision: 16476
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16476&view=rev

Log:
2008-03-27  Morten Welinder  <terra gnome org>

	* src/expr.c (gnm_expr_top_is_array_corner): New function.  (I
	have plans for gnm_expr_top_get_array_corner.)



Modified:
   trunk/ChangeLog
   trunk/src/cell.c
   trunk/src/clipboard.c
   trunk/src/dialogs/dialog-preferences.c
   trunk/src/expr.c
   trunk/src/expr.h
   trunk/src/xml-sax-write.c

Modified: trunk/src/cell.c
==============================================================================
--- trunk/src/cell.c	(original)
+++ trunk/src/cell.c	Thu Mar 27 22:35:44 2008
@@ -427,7 +427,7 @@
 gnm_cell_is_array (GnmCell const *cell)
 {
 	return cell != NULL && gnm_cell_has_expr (cell) &&
-		(gnm_expr_top_get_array_corner (cell->base.texpr) ||
+		(gnm_expr_top_is_array_corner (cell->base.texpr) ||
 		 gnm_expr_top_is_array_elem (cell->base.texpr));
 }
 

Modified: trunk/src/clipboard.c
==============================================================================
--- trunk/src/clipboard.c	(original)
+++ trunk/src/clipboard.c	Thu Mar 27 22:35:44 2008
@@ -220,7 +220,7 @@
 						gnm_expr_top_unref (relo);
 					relo = trelo;
 				}
-			} else if (!relo && gnm_expr_top_get_array_corner (src->texpr)) {
+			} else if (!relo && gnm_expr_top_is_array_corner (src->texpr)) {
 				/* We must not share array expressions.  */
 				relo = gnm_expr_top_new (gnm_expr_copy (src->texpr->expr));
 			}

Modified: trunk/src/dialogs/dialog-preferences.c
==============================================================================
--- trunk/src/dialogs/dialog-preferences.c	(original)
+++ trunk/src/dialogs/dialog-preferences.c	Thu Mar 27 22:35:44 2008
@@ -765,7 +765,7 @@
 	{N_("Header/Footer"), GTK_STOCK_ITALIC,		 "0",  &pref_font_hf_initializer,	NULL},
 	{N_("Sorting"),       GTK_STOCK_SORT_ASCENDING,  "3", &pref_sort_page_initializer,	NULL},
 	{N_("Screen"),        GTK_STOCK_PREFERENCES,     "5", &pref_screen_page_initializer,	NULL},
-	{NULL, NULL, NULL, NULL, NULL, NULL},
+	{NULL, NULL, NULL, NULL, NULL },
 };
 
 static void

Modified: trunk/src/expr.c
==============================================================================
--- trunk/src/expr.c	(original)
+++ trunk/src/expr.c	Thu Mar 27 22:35:44 2008
@@ -2810,7 +2810,7 @@
 
 	res = gnm_expr_top_relocate (texpr, &rinfo, FALSE);
 	if (!res) {
-		if (gnm_expr_top_get_array_corner (texpr))
+		if (gnm_expr_top_is_array_corner (texpr))
 			res = gnm_expr_top_new (gnm_expr_copy (texpr->expr));
 		else
 			gnm_expr_top_ref ((res = texpr));
@@ -2928,6 +2928,13 @@
 }
 
 gboolean
+gnm_expr_top_is_array_corner (GnmExprTop const *texpr)
+{
+	g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+	return GNM_EXPR_GET_OPER (texpr->expr) == GNM_EXPR_OP_ARRAY_CORNER;
+}
+
+gboolean
 gnm_expr_top_is_array_elem (GnmExprTop const *texpr)
 {
 	g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);

Modified: trunk/src/expr.h
==============================================================================
--- trunk/src/expr.h	(original)
+++ trunk/src/expr.h	Thu Mar 27 22:35:44 2008
@@ -118,6 +118,7 @@
 gboolean	gnm_expr_top_is_err		(GnmExprTop const *texpr, GnmStdError e);
 gboolean 	gnm_expr_top_is_rangeref	(GnmExprTop const *texpr);
 gboolean	gnm_expr_top_is_array_elem	(GnmExprTop const *texpr);
+gboolean	gnm_expr_top_is_array_corner	(GnmExprTop const *texpr);
 GnmExprArrayCorner const *gnm_expr_top_get_array_corner (GnmExprTop const *texpr);
 GnmValue       *gnm_expr_top_get_range		(GnmExprTop const *texpr);
 GSList	       *gnm_expr_top_get_ranges		(GnmExprTop const *texpr);

Modified: trunk/src/xml-sax-write.c
==============================================================================
--- trunk/src/xml-sax-write.c	(original)
+++ trunk/src/xml-sax-write.c	Thu Mar 27 22:35:44 2008
@@ -754,7 +754,7 @@
 
 	/* As of version 0.53 we save the size of the array as attributes */
 	/* As of version 0.57 the attributes are in the Cell not the Content */
-	if (texpr && gnm_expr_top_get_array_corner (texpr)) {
+	if (texpr && gnm_expr_top_is_array_corner (texpr)) {
 		gsf_xml_out_add_int (state->output, "Rows", texpr->expr->array_corner.rows);
 		gsf_xml_out_add_int (state->output, "Cols", texpr->expr->array_corner.cols);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]