[gnumeric] Validation: namespace fixes.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Validation: namespace fixes.
- Date: Thu, 17 May 2012 18:01:36 +0000 (UTC)
commit 55c6449b2066ac23b97542b35c34d25fe8df70e5
Author: Morten Welinder <terra gnome org>
Date: Thu May 17 14:01:21 2012 -0400
Validation: namespace fixes.
ChangeLog | 2 +
plugins/excel/ms-excel-read.c | 2 +-
plugins/excel/xlsx-read.c | 8 +++---
plugins/openoffice/openoffice-read.c | 10 +++---
src/dialogs/dialog-cell-format.c | 2 +-
src/mstyle.c | 4 +-
src/validation.c | 36 ++++++++++++------------
src/validation.h | 48 ++++++++++++++++++---------------
src/wbc-gtk-edit.c | 6 ++--
src/xml-sax-read.c | 2 +-
10 files changed, 63 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 70ea2e6..abafb52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2012-05-17 Morten Welinder <terra gnome org>
+ * src/validation.h: Grand rename into gnm_ namespace.
+
* src/validation.c (gnm_validation_dup, gnm_validation_get_sheet)
(gnm_validation_set_sheet): New functions.
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 312f885..96aee43 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -5523,7 +5523,7 @@ excel_read_DV (BiffQuery *q, ExcelReadSheet *esheet)
mstyle = gnm_style_new ();
gnm_style_set_validation
(mstyle,
- validation_new (style, type, op,
+ gnm_validation_new (style, type, op,
esheet->sheet,
error_title, error_msg,
texpr1,
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 79e371a..38b7ac3 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1744,7 +1744,7 @@ xlsx_CT_DataValidation_begin (GsfXMLIn *xin, xmlChar const **attrs)
if (showErrorMessage) {
GnmRange const *r = state->validation_regions->data;
state->pos = r->start;
- state->validation = validation_new
+ state->validation = gnm_validation_new
(val_style, val_type, val_op,
state->sheet,
errorTitle, error,
@@ -1764,10 +1764,10 @@ xlsx_CT_DataValidation_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
GSList *ptr;
if (NULL != state->validation &&
- NULL != (err = validation_is_ok (state->validation))) {
+ NULL != (err = gnm_validation_is_ok (state->validation))) {
xlsx_warning (xin, _("Ignoring invalid data validation because : %s"),
_(err->message));
- validation_unref (state->validation);
+ gnm_validation_unref (state->validation);
state->validation = NULL;
}
@@ -1810,7 +1810,7 @@ xlsx_validation_expr (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
state->pos.col, state->pos.row);
texpr = xlsx_parse_expr (xin, xin->content->str, &pp);
if (NULL != texpr) {
- validation_set_expr (state->validation, texpr,
+ gnm_validation_set_expr (state->validation, texpr,
xin->node->user_data.v_int);
gnm_expr_top_unref (texpr);
}
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 6787d6e..7b8a5f9 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2290,7 +2290,7 @@ odf_validation_new_list (GsfXMLIn *xin, odf_validation_t *val, guint offset)
val->f_type);
if (texpr != NULL)
- validation = validation_new (val->style,
+ validation = gnm_validation_new (val->style,
GNM_VALIDATION_TYPE_IN_LIST,
GNM_VALIDATION_OP_NONE,
state->pos.sheet,
@@ -2339,7 +2339,7 @@ odf_validation_new_single_expr (GsfXMLIn *xin, odf_validation_t *val,
val->f_type);
if (texpr != NULL)
- return validation_new (val->style,
+ return gnm_validation_new (val->style,
val_type,
val_op,
state->pos.sheet,
@@ -2413,7 +2413,7 @@ odf_validation_new_pair_expr (GsfXMLIn *xin, odf_validation_t *val,
val->f_type);
if (texpr_b != NULL)
- return validation_new (val->style,
+ return gnm_validation_new (val->style,
val_type,
val_op,
state->pos.sheet,
@@ -2564,14 +2564,14 @@ odf_validations_translate (GsfXMLIn *xin, char const *name)
(xin, val, 0, GNM_VALIDATION_TYPE_ANY);
if (validation != NULL) {
GError *err;
- if (NULL == (err = validation_is_ok (validation)))
+ if (NULL == (err = gnm_validation_is_ok (validation)))
return validation;
else {
oo_warning (xin,
_("Ignoring invalid data "
"validation because : %s"),
_(err->message));
- validation_unref (validation);
+ gnm_validation_unref (validation);
return NULL;
}
}
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index b40d8bf..030f9d2 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -1606,7 +1606,7 @@ validation_rebuild_validation (FormatState *state)
gboolean use_dropdown = gtk_toggle_button_get_active (state->validation.use_dropdown);
gnm_style_set_validation
(state->result,
- validation_new
+ gnm_validation_new
(style, type, op,
state->sheet,
title, msg,
diff --git a/src/mstyle.c b/src/mstyle.c
index 69eec06..e93a3d9 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -432,7 +432,7 @@ elem_assign_contents (GnmStyle *dst, GnmStyle const *src, GnmStyleElement elem)
case MSTYLE_CONTENTS_HIDDEN: dst->contents_hidden = src->contents_hidden; return;
case MSTYLE_VALIDATION:
if ((dst->validation = src->validation))
- validation_ref (dst->validation);
+ gnm_validation_ref (dst->validation);
return;
case MSTYLE_HLINK:
if ((dst->hlink = src->hlink))
@@ -471,7 +471,7 @@ elem_clear_contents (GnmStyle *style, GnmStyleElement elem)
case MSTYLE_FORMAT: go_format_unref (style->format); return;
case MSTYLE_VALIDATION:
if (style->validation)
- validation_unref (style->validation);
+ gnm_validation_unref (style->validation);
return;
case MSTYLE_HLINK:
if (style->hlink)
diff --git a/src/validation.c b/src/validation.c
index 740b8d9..03e3a5a 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -92,7 +92,7 @@ gnm_validation_combo_finalize (GObject *object)
GnmValidationCombo *vcombo = GNM_VALIDATION_COMBO (object);
if (NULL != vcombo->validation) {
- validation_unref (vcombo->validation);
+ gnm_validation_unref (vcombo->validation);
vcombo->validation = NULL;
}
@@ -135,7 +135,7 @@ gnm_validation_combo_new (GnmValidation const *val, SheetView *sv)
g_return_val_if_fail (sv != NULL, NULL);
vcombo = g_object_new (GNM_VALIDATION_COMBO_TYPE, "sheet-view", sv, NULL);
- validation_ref (vcombo->validation = val);
+ gnm_validation_ref (vcombo->validation = val);
return SHEET_OBJECT (vcombo);
}
@@ -231,20 +231,20 @@ gnm_validation_op_get_type (void)
/***************************************************************************/
/**
- * validation_new :
+ * gnm_validation_new :
* @title : will be copied.
* @msg : will be copied.
* @texpr0 : absorb the reference to the expression (optionally %NULL).
* @texpr1 : absorb the reference to the expression (optionally %NULL).
*
* Does _NOT_ require all necessary information to be set here.
- * validation_set_expr can be used to change the expressions after creation,
- * and validation_is_ok can be used to ensure that things are properly setup.
+ * gnm_validation_set_expr can be used to change the expressions after creation,
+ * and gnm_validation_is_ok can be used to ensure that things are properly setup.
*
* Returns a new @GnmValidation object that needs to be unrefed.
**/
GnmValidation *
-validation_new (ValidationStyle style,
+gnm_validation_new (ValidationStyle style,
ValidationType type,
ValidationOp op,
Sheet *sheet,
@@ -316,26 +316,26 @@ gnm_validation_dup (GnmValidation *v)
g_return_val_if_fail (v != NULL, NULL);
- dst = validation_new (v->style, v->type, v->op,
+ dst = gnm_validation_new (v->style, v->type, v->op,
gnm_validation_get_sheet (v),
v->title ? v->title->str : NULL,
v->msg ? v->msg->str : NULL,
NULL, NULL,
v->allow_blank, v->use_dropdown);
for (i = 0; i < 2; i++)
- validation_set_expr (dst, v->deps[i].texpr, i);
+ gnm_validation_set_expr (dst, v->deps[i].texpr, i);
return dst;
}
void
-validation_ref (GnmValidation const *v)
+gnm_validation_ref (GnmValidation const *v)
{
g_return_if_fail (v != NULL);
((GnmValidation *)v)->ref_count++;
}
void
-validation_unref (GnmValidation const *val)
+gnm_validation_unref (GnmValidation const *val)
{
GnmValidation *v = (GnmValidation *)val;
@@ -381,16 +381,16 @@ gnm_validation_set_sheet (GnmValidation *v, Sheet *sheet)
/**
- * validation_set_expr :
+ * gnm_validation_set_expr :
* @v : #GnmValidation
* @texpr : #GnmExprTop
* @indx : 0 or 1
*
- * Assign an expression to a validation. validation_is_ok can be used to
+ * Assign an expression to a validation. gnm_validation_is_ok can be used to
* verify that @v has all of the required information.
**/
void
-validation_set_expr (GnmValidation *v,
+gnm_validation_set_expr (GnmValidation *v,
GnmExprTop const *texpr, unsigned indx)
{
g_return_if_fail (indx <= 1);
@@ -399,7 +399,7 @@ validation_set_expr (GnmValidation *v,
}
GError *
-validation_is_ok (GnmValidation const *v)
+gnm_validation_is_ok (GnmValidation const *v)
{
unsigned nops, i;
@@ -460,7 +460,7 @@ cb_validate_custom (GnmValueIter const *v_iter, GnmValue const *target)
} while (0)
/**
- * validation_eval:
+ * gnm_validation_eval:
* @wbc :
* @mstyle :
* @sheet :
@@ -468,7 +468,7 @@ cb_validate_custom (GnmValueIter const *v_iter, GnmValue const *target)
* validation set in the GnmStyle if applicable.
**/
ValidationStatus
-validation_eval (WorkbookControl *wbc, GnmStyle const *mstyle,
+gnm_validation_eval (WorkbookControl *wbc, GnmStyle const *mstyle,
Sheet *sheet, GnmCellPos const *pos, gboolean *showed_dialog)
{
GnmValidation const *v;
@@ -663,7 +663,7 @@ validation_eval_range_cb (GnmCellIter const *iter, validation_eval_t *closure)
(closure->sheet, iter->pp.eval.col, iter->pp.eval.row);
if (mstyle != NULL) {
- status = validation_eval (closure->wbc, mstyle,
+ status = gnm_validation_eval (closure->wbc, mstyle,
closure->sheet, &iter->pp.eval,
&showed_dialog);
if (closure->showed_dialog)
@@ -679,7 +679,7 @@ validation_eval_range_cb (GnmCellIter const *iter, validation_eval_t *closure)
}
ValidationStatus
-validation_eval_range (WorkbookControl *wbc,
+gnm_validation_eval_range (WorkbookControl *wbc,
Sheet *sheet, GnmCellPos const *pos, GnmRange const *r,
gboolean *showed_dialog)
{
diff --git a/src/validation.h b/src/validation.h
index 67bb133..112dee7 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -64,32 +64,36 @@ GType gnm_validation_op_get_type (void);
#define GNM_VALIDATION_OP_TYPE (gnm_validation_op_get_type ())
-GnmValidation *validation_new (ValidationStyle style,
- ValidationType type,
- ValidationOp op,
- Sheet *sheet,
- char const *title, char const *msg,
- GnmExprTop const *texpr0,
- GnmExprTop const *texpr1,
- gboolean allow_blank, gboolean use_dropdown);
-GnmValidation *gnm_validation_dup (GnmValidation *v);
-
-void validation_ref (GnmValidation const *v);
-void validation_unref (GnmValidation const *v);
-
-void validation_set_expr (GnmValidation *v,
- GnmExprTop const *texpr, unsigned indx);
-GError *validation_is_ok (GnmValidation const *v);
+GnmValidation *gnm_validation_new (ValidationStyle style,
+ ValidationType type,
+ ValidationOp op,
+ Sheet *sheet,
+ char const *title, char const *msg,
+ GnmExprTop const *texpr0,
+ GnmExprTop const *texpr1,
+ gboolean allow_blank,
+ gboolean use_dropdown);
+GnmValidation *gnm_validation_dup (GnmValidation *v);
+
+void gnm_validation_ref (GnmValidation const *v);
+void gnm_validation_unref (GnmValidation const *v);
+
+void gnm_validation_set_expr (GnmValidation *v,
+ GnmExprTop const *texpr, unsigned indx);
+GError *gnm_validation_is_ok (GnmValidation const *v);
Sheet *gnm_validation_get_sheet (GnmValidation *v);
void gnm_validation_set_sheet (GnmValidation *v, Sheet *sheet);
-ValidationStatus validation_eval (WorkbookControl *wbc, GnmStyle const *mstyle,
- Sheet *sheet, GnmCellPos const *pos,
- gboolean *showed_dialog);
-ValidationStatus validation_eval_range (WorkbookControl *wbc,
- Sheet *sheet, GnmCellPos const *pos, GnmRange const *r,
- gboolean *showed_dialog);
+ValidationStatus gnm_validation_eval (WorkbookControl *wbc,
+ GnmStyle const *mstyle,
+ Sheet *sheet, GnmCellPos const *pos,
+ gboolean *showed_dialog);
+ValidationStatus gnm_validation_eval_range (WorkbookControl *wbc,
+ Sheet *sheet,
+ GnmCellPos const *pos,
+ GnmRange const *r,
+ gboolean *showed_dialog);
G_END_DECLS
diff --git a/src/wbc-gtk-edit.c b/src/wbc-gtk-edit.c
index 8145857..4f1527b 100644
--- a/src/wbc-gtk-edit.c
+++ b/src/wbc-gtk-edit.c
@@ -339,7 +339,7 @@ wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
GnmRange *r = l->data;
/* We do this separately since there may be overlap between ranges */
sheet_range_set_text (&pp, r, txt);
- valid = validation_eval_range (wbc, sheet, &sv->edit_pos, r,
+ valid = gnm_validation_eval_range (wbc, sheet, &sv->edit_pos, r,
showed_dialog);
if (valid != GNM_VALIDATION_STATUS_VALID)
break;
@@ -358,7 +358,7 @@ wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
texpr);
sheet_region_queue_recalc (sheet, r);
}
- valid = validation_eval_range (wbc, sheet, &sv->edit_pos, r,
+ valid = gnm_validation_eval_range (wbc, sheet, &sv->edit_pos, r,
showed_dialog);
break;
}
@@ -374,7 +374,7 @@ wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
sv->edit_pos.col,
sv->edit_pos.row);
sheet_cell_set_text (cell, txt, NULL);
- valid = validation_eval (wbc, mstyle, sheet, &sv->edit_pos, showed_dialog);
+ valid = gnm_validation_eval (wbc, mstyle, sheet, &sv->edit_pos, showed_dialog);
break;
}
case (WBC_EDIT_REJECT):
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index b438bff..a7a3427 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -1626,7 +1626,7 @@ xml_sax_validation_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
xml_sax_must_have_style (state);
gnm_style_set_validation (state->style,
- validation_new (state->validation.style,
+ gnm_validation_new (state->validation.style,
state->validation.type,
state->validation.op,
state->sheet,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]