Commit b8f3c912 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

rename enums

2011-11-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/widgets/gnm-validation-combo-view.c: rename enums
	* src/widgets/widget-font-selector.c: rename enums

2011-11-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/dialogs/dialog-cell-format.c: rename enums
	* src/dialogs/dialog-scenarios.c: rename enums

2011-11-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/tools/analysis-anova.c: rename enums
	* src/tools/analysis-chi-squared.c: rename enums
	* src/tools/analysis-principal-components.c: rename enums
	* src/tools/analysis-tools.c: rename enums

2011-11-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/cell-draw.c: rename enums
	* src/cellspan.c: rename enums
	* src/commands.c: rename enums
	* src/item-edit.c: rename enums
	* src/mstyle.c: rename enums
	* src/rendered-value.c: rename enums
	* src/style.c: rename enums
	* src/style.h: rename enums
	* src/validation.c: rename enums
	* src/validation.h: rename enums
	* src/wbc-gtk-actions.c: rename enums
	* src/wbc-gtk-edit.c: rename enums
	* src/wbc-gtk.c: rename enums
	* src/workbook-cmd-format.c: rename enums
	* src/workbook-view.c: rename enums
	* src/xml-sax-read.c: rename enums
	* src/xml-sax-write.c: rename enums
parent ca44ce15
2011-11-22 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/cell-draw.c: rename enums
* src/cellspan.c: rename enums
* src/commands.c: rename enums
* src/item-edit.c: rename enums
* src/mstyle.c: rename enums
* src/rendered-value.c: rename enums
* src/style.c: rename enums
* src/style.h: rename enums
* src/validation.c: rename enums
* src/validation.h: rename enums
* src/wbc-gtk-actions.c: rename enums
* src/wbc-gtk-edit.c: rename enums
* src/wbc-gtk.c: rename enums
* src/workbook-cmd-format.c: rename enums
* src/workbook-view.c: rename enums
* src/xml-sax-read.c: rename enums
* src/xml-sax-write.c: rename enums
2011-11-22 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/style.c (gnm_align_h_get_type): new
......
......@@ -518,10 +518,10 @@ applix_parse_style (ApplixReadState *state, unsigned char **buffer)
if (g_ascii_isdigit (*sep)) {
GnmHAlign a;
switch (*sep) {
case '1' : a = HALIGN_LEFT; break;
case '2' : a = HALIGN_RIGHT; break;
case '3' : a = HALIGN_CENTER; break;
case '4' : a = HALIGN_FILL; break;
case '1' : a = GNM_HALIGN_LEFT; break;
case '2' : a = GNM_HALIGN_RIGHT; break;
case '3' : a = GNM_HALIGN_CENTER; break;
case '4' : a = GNM_HALIGN_FILL; break;
default :
applix_parse_error (state, "Unknown horizontal alignment '%c'", *sep);
return NULL;
......@@ -531,9 +531,9 @@ applix_parse_style (ApplixReadState *state, unsigned char **buffer)
} else if (*sep == 'V') {
GnmVAlign a;
switch (sep[1]) {
case 'T' : a = VALIGN_TOP; break;
case 'C' : a = VALIGN_CENTER; break;
case 'B' : a = VALIGN_BOTTOM; break;
case 'T' : a = GNM_VALIGN_TOP; break;
case 'C' : a = GNM_VALIGN_CENTER; break;
case 'B' : a = GNM_VALIGN_BOTTOM; break;
default :
applix_parse_error (state, "Unknown vertical alignment '%c'", *sep);
return NULL;
......
......@@ -562,21 +562,21 @@ static void
xl_xml_alignment (GsfXMLIn *xin, xmlChar const **attrs)
{
static EnumVal const valignments [] = {
{ "Bottom", VALIGN_BOTTOM },
{ "Center", VALIGN_CENTER },
{ "Distributed", VALIGN_DISTRIBUTED },
{ "Justify", VALIGN_JUSTIFY },
{ "Top", VALIGN_TOP },
{ "Bottom", GNM_VALIGN_BOTTOM },
{ "Center", GNM_VALIGN_CENTER },
{ "Distributed", GNM_VALIGN_DISTRIBUTED },
{ "Justify", GNM_VALIGN_JUSTIFY },
{ "Top", GNM_VALIGN_TOP },
{ NULL, 0 }
};
static EnumVal const halignments [] = {
{ "Center", HALIGN_CENTER },
{ "CenterAcrossSelection", HALIGN_CENTER_ACROSS_SELECTION },
{ "Distributed", HALIGN_DISTRIBUTED },
{ "Fill", HALIGN_FILL },
{ "Justify", HALIGN_JUSTIFY },
{ "Left", HALIGN_LEFT },
{ "Right", HALIGN_RIGHT },
{ "Center", GNM_HALIGN_CENTER },
{ "CenterAcrossSelection", GNM_HALIGN_CENTER_ACROSS_SELECTION },
{ "Distributed", GNM_HALIGN_DISTRIBUTED },
{ "Fill", GNM_HALIGN_FILL },
{ "Justify", GNM_HALIGN_JUSTIFY },
{ "Left", GNM_HALIGN_LEFT },
{ "Right", GNM_HALIGN_RIGHT },
{ NULL, 0 }
};
......
......@@ -2406,21 +2406,21 @@ excel_read_XF_OLD (BiffQuery *q, GnmXLImporter *importer)
xf->shrink_to_fit = FALSE;
xf->halign = HALIGN_GENERAL;
xf->halign = GNM_HALIGN_GENERAL;
data = (importer->ver >= MS_BIFF_V3) ? q->data[4] : q->data[3];
switch (data & 0x07) {
default :
case 0: xf->halign = HALIGN_GENERAL; break;
case 1: xf->halign = HALIGN_LEFT; break;
case 2: xf->halign = HALIGN_CENTER; break;
case 3: xf->halign = HALIGN_RIGHT; break;
case 4: xf->halign = HALIGN_FILL; break;
case 5: xf->halign = HALIGN_JUSTIFY; break;
case 6: xf->halign = HALIGN_CENTER_ACROSS_SELECTION; break;
case 0: xf->halign = GNM_HALIGN_GENERAL; break;
case 1: xf->halign = GNM_HALIGN_LEFT; break;
case 2: xf->halign = GNM_HALIGN_CENTER; break;
case 3: xf->halign = GNM_HALIGN_RIGHT; break;
case 4: xf->halign = GNM_HALIGN_FILL; break;
case 5: xf->halign = GNM_HALIGN_JUSTIFY; break;
case 6: xf->halign = GNM_HALIGN_CENTER_ACROSS_SELECTION; break;
}
xf->valign = VALIGN_BOTTOM;
xf->valign = GNM_VALIGN_BOTTOM;
xf->rotation = 0;
xf->indent = 0;
xf->differences = 0;
......@@ -2429,10 +2429,10 @@ excel_read_XF_OLD (BiffQuery *q, GnmXLImporter *importer)
if (importer->ver >= MS_BIFF_V4) {
xf->wrap_text = (data & 0x0008) != 0;
switch (data & 0x30) {
case 0x00: xf->valign = VALIGN_TOP; break;
case 0x10: xf->valign = VALIGN_CENTER; break;
case 0x00: xf->valign = GNM_VALIGN_TOP; break;
case 0x10: xf->valign = GNM_VALIGN_CENTER; break;
default :
case 0x20: xf->valign = VALIGN_BOTTOM; break;
case 0x20: xf->valign = GNM_VALIGN_BOTTOM; break;
}
switch (data & 0xc0) {
case 0x00: xf->rotation = 0; break;
......@@ -2443,7 +2443,7 @@ excel_read_XF_OLD (BiffQuery *q, GnmXLImporter *importer)
} else if (importer->ver >= MS_BIFF_V3) {
xf->wrap_text = (data & 0x0008) != 0;
if (xf->wrap_text)
xf->valign = VALIGN_TOP;
xf->valign = GNM_VALIGN_TOP;
}
if (importer->ver >= MS_BIFF_V3) {
......@@ -2534,12 +2534,12 @@ excel_read_XF (BiffQuery *q, GnmXLImporter *importer)
data = GSF_LE_GET_GUINT16 (q->data + 6);
subdata = data & 0x0007;
switch (subdata) {
case 0: xf->halign = HALIGN_GENERAL; break;
case 1: xf->halign = HALIGN_LEFT; break;
case 2: xf->halign = HALIGN_CENTER; break;
case 3: xf->halign = HALIGN_RIGHT; break;
case 4: xf->halign = HALIGN_FILL; break;
case 5: xf->halign = HALIGN_JUSTIFY; break;
case 0: xf->halign = GNM_HALIGN_GENERAL; break;
case 1: xf->halign = GNM_HALIGN_LEFT; break;
case 2: xf->halign = GNM_HALIGN_CENTER; break;
case 3: xf->halign = GNM_HALIGN_RIGHT; break;
case 4: xf->halign = GNM_HALIGN_FILL; break;
case 5: xf->halign = GNM_HALIGN_JUSTIFY; break;
case 6:
/*
* All adjacent blank cells with this type of alignment
......@@ -2547,26 +2547,26 @@ excel_read_XF (BiffQuery *q, GnmXLImporter *importer)
* normally and the span is adjusted if contents are changed.
* Use center for now.
*/
xf->halign = HALIGN_CENTER_ACROSS_SELECTION;
xf->halign = GNM_HALIGN_CENTER_ACROSS_SELECTION;
break;
/* no idea what this does */
case 7 : xf->halign = HALIGN_DISTRIBUTED; break;
case 7 : xf->halign = GNM_HALIGN_DISTRIBUTED; break;
default:
xf->halign = HALIGN_JUSTIFY;
xf->halign = GNM_HALIGN_JUSTIFY;
g_printerr ("Unknown halign %d\n", subdata);
break;
}
xf->wrap_text = (data & 0x0008) != 0;
subdata = (data & 0x0070) >> 4;
switch (subdata) {
case 0: xf->valign = VALIGN_TOP; break;
case 1: xf->valign = VALIGN_CENTER; break;
case 2: xf->valign = VALIGN_BOTTOM; break;
case 3: xf->valign = VALIGN_JUSTIFY; break;
case 0: xf->valign = GNM_VALIGN_TOP; break;
case 1: xf->valign = GNM_VALIGN_CENTER; break;
case 2: xf->valign = GNM_VALIGN_BOTTOM; break;
case 3: xf->valign = GNM_VALIGN_JUSTIFY; break;
/* What does this do ?? */
case 4: xf->valign = VALIGN_DISTRIBUTED; break;
case 4: xf->valign = GNM_VALIGN_DISTRIBUTED; break;
default:
g_printerr ("Unknown valign %d\n", subdata);
break;
......@@ -5563,43 +5563,43 @@ excel_read_DV (BiffQuery *q, ExcelReadSheet *esheet)
* is easier to read.
*/
switch (options & 0x0f) {
case 0 : type = VALIDATION_TYPE_ANY; break;
case 1 : type = VALIDATION_TYPE_AS_INT; break;
case 2 : type = VALIDATION_TYPE_AS_NUMBER; break;
case 3 : type = VALIDATION_TYPE_IN_LIST; break;
case 4 : type = VALIDATION_TYPE_AS_DATE; break;
case 5 : type = VALIDATION_TYPE_AS_TIME; break;
case 6 : type = VALIDATION_TYPE_TEXT_LENGTH; break;
case 7 : type = VALIDATION_TYPE_CUSTOM; break;
case 0 : type = GNM_VALIDATION_TYPE_ANY; break;
case 1 : type = GNM_VALIDATION_TYPE_AS_INT; break;
case 2 : type = GNM_VALIDATION_TYPE_AS_NUMBER; break;
case 3 : type = GNM_VALIDATION_TYPE_IN_LIST; break;
case 4 : type = GNM_VALIDATION_TYPE_AS_DATE; break;
case 5 : type = GNM_VALIDATION_TYPE_AS_TIME; break;
case 6 : type = GNM_VALIDATION_TYPE_TEXT_LENGTH; break;
case 7 : type = GNM_VALIDATION_TYPE_CUSTOM; break;
default :
g_warning ("EXCEL : Unknown constraint type %d", options & 0x0f);
return;
}
switch ((options >> 4) & 0x07) {
case 0 : style = VALIDATION_STYLE_STOP; break;
case 1 : style = VALIDATION_STYLE_WARNING; break;
case 2 : style = VALIDATION_STYLE_INFO; break;
case 0 : style = GNM_VALIDATION_STYLE_STOP; break;
case 1 : style = GNM_VALIDATION_STYLE_WARNING; break;
case 2 : style = GNM_VALIDATION_STYLE_INFO; break;
default :
g_warning ("EXCEL : Unknown validation style %d",
(options >> 4) & 0x07);
return;
}
if (!(options & 0x80000))
style = VALIDATION_STYLE_NONE;
style = GNM_VALIDATION_STYLE_NONE;
if (type == VALIDATION_TYPE_CUSTOM || type == VALIDATION_TYPE_IN_LIST)
op = VALIDATION_OP_NONE;
if (type == GNM_VALIDATION_TYPE_CUSTOM || type == GNM_VALIDATION_TYPE_IN_LIST)
op = GNM_VALIDATION_OP_NONE;
else
switch ((options >> 20) & 0x0f) {
case 0: op = VALIDATION_OP_BETWEEN; break;
case 1: op = VALIDATION_OP_NOT_BETWEEN; break;
case 2: op = VALIDATION_OP_EQUAL; break;
case 3: op = VALIDATION_OP_NOT_EQUAL; break;
case 4: op = VALIDATION_OP_GT; break;
case 5: op = VALIDATION_OP_LT; break;
case 6: op = VALIDATION_OP_GTE; break;
case 7: op = VALIDATION_OP_LTE; break;
case 0: op = GNM_VALIDATION_OP_BETWEEN; break;
case 1: op = GNM_VALIDATION_OP_NOT_BETWEEN; break;
case 2: op = GNM_VALIDATION_OP_EQUAL; break;
case 3: op = GNM_VALIDATION_OP_NOT_EQUAL; break;
case 4: op = GNM_VALIDATION_OP_GT; break;
case 5: op = GNM_VALIDATION_OP_LT; break;
case 6: op = GNM_VALIDATION_OP_GTE; break;
case 7: op = GNM_VALIDATION_OP_LTE; break;
default :
g_warning ("EXCEL : Unknown constraint operator %d",
(options >> 20) & 0x0f);
......
......@@ -1175,37 +1175,37 @@ excel_write_DV (XLValInputPair const *vip, gpointer dummy, ExcelWriteSheet *eshe
options = 0;
if (vip->v != NULL) {
switch (vip->v->type) {
case VALIDATION_TYPE_ANY: options = 0; break;
case VALIDATION_TYPE_AS_INT: options = 1; break;
case VALIDATION_TYPE_AS_NUMBER: options = 2; break;
case VALIDATION_TYPE_IN_LIST: options = 3; break;
case VALIDATION_TYPE_AS_DATE: options = 4; break;
case VALIDATION_TYPE_AS_TIME: options = 5; break;
case VALIDATION_TYPE_TEXT_LENGTH: options = 6; break;
case VALIDATION_TYPE_CUSTOM: options = 7; break;
case GNM_VALIDATION_TYPE_ANY: options = 0; break;
case GNM_VALIDATION_TYPE_AS_INT: options = 1; break;
case GNM_VALIDATION_TYPE_AS_NUMBER: options = 2; break;
case GNM_VALIDATION_TYPE_IN_LIST: options = 3; break;
case GNM_VALIDATION_TYPE_AS_DATE: options = 4; break;
case GNM_VALIDATION_TYPE_AS_TIME: options = 5; break;
case GNM_VALIDATION_TYPE_TEXT_LENGTH: options = 6; break;
case GNM_VALIDATION_TYPE_CUSTOM: options = 7; break;
default : g_warning ("EXCEL : Unknown constraint type %d",
vip->v->type);
}
switch (vip->v->style) {
case VALIDATION_STYLE_NONE: break;
case VALIDATION_STYLE_STOP: options |= (0 << 4); break;
case VALIDATION_STYLE_WARNING: options |= (1 << 4); break;
case VALIDATION_STYLE_INFO: options |= (2 << 4); break;
case GNM_VALIDATION_STYLE_NONE: break;
case GNM_VALIDATION_STYLE_STOP: options |= (0 << 4); break;
case GNM_VALIDATION_STYLE_WARNING: options |= (1 << 4); break;
case GNM_VALIDATION_STYLE_INFO: options |= (2 << 4); break;
default : g_warning ("EXCEL : Unknown validation style %d",
vip->v->style);
}
switch (vip->v->op) {
case VALIDATION_OP_NONE:
case VALIDATION_OP_BETWEEN: options |= (0 << 20); break;
case VALIDATION_OP_NOT_BETWEEN: options |= (1 << 20); break;
case VALIDATION_OP_EQUAL: options |= (2 << 20); break;
case VALIDATION_OP_NOT_EQUAL: options |= (3 << 20); break;
case VALIDATION_OP_GT: options |= (4 << 20); break;
case VALIDATION_OP_LT: options |= (5 << 20); break;
case VALIDATION_OP_GTE: options |= (6 << 20); break;
case VALIDATION_OP_LTE: options |= (7 << 20); break;
case GNM_VALIDATION_OP_NONE:
case GNM_VALIDATION_OP_BETWEEN: options |= (0 << 20); break;
case GNM_VALIDATION_OP_NOT_BETWEEN: options |= (1 << 20); break;
case GNM_VALIDATION_OP_EQUAL: options |= (2 << 20); break;
case GNM_VALIDATION_OP_NOT_EQUAL: options |= (3 << 20); break;
case GNM_VALIDATION_OP_GT: options |= (4 << 20); break;
case GNM_VALIDATION_OP_LT: options |= (5 << 20); break;
case GNM_VALIDATION_OP_GTE: options |= (6 << 20); break;
case GNM_VALIDATION_OP_LTE: options |= (7 << 20); break;
default : g_warning ("EXCEL : Unknown constraint operator %d",
vip->v->op);
}
......@@ -1214,7 +1214,7 @@ excel_write_DV (XLValInputPair const *vip, gpointer dummy, ExcelWriteSheet *eshe
/* XL suppesses the dropdown rather than vice versa */
if (!vip->v->use_dropdown)
options |= 0x200;
if (vip->v->style != VALIDATION_STYLE_NONE)
if (vip->v->style != GNM_VALIDATION_STYLE_NONE)
options |= 0x80000;
}
......@@ -2608,28 +2608,28 @@ halign_to_excel (GnmHAlign halign)
guint ialign;
switch (halign) {
case HALIGN_GENERAL:
case GNM_HALIGN_GENERAL:
ialign = MS_BIFF_H_A_GENERAL;
break;
case HALIGN_LEFT:
case GNM_HALIGN_LEFT:
ialign = MS_BIFF_H_A_LEFT;
break;
case HALIGN_RIGHT:
case GNM_HALIGN_RIGHT:
ialign = MS_BIFF_H_A_RIGHT;
break;
case HALIGN_CENTER:
case GNM_HALIGN_CENTER:
ialign = MS_BIFF_H_A_CENTER;
break;
case HALIGN_FILL:
case GNM_HALIGN_FILL:
ialign = MS_BIFF_H_A_FILL;
break;
case HALIGN_JUSTIFY:
case GNM_HALIGN_JUSTIFY:
ialign = MS_BIFF_H_A_JUSTIFTY;
break;
case HALIGN_CENTER_ACROSS_SELECTION:
case GNM_HALIGN_CENTER_ACROSS_SELECTION:
ialign = MS_BIFF_H_A_CENTER_ACROSS_SELECTION;
break;
case HALIGN_DISTRIBUTED:
case GNM_HALIGN_DISTRIBUTED:
ialign = MS_BIFF_H_A_DISTRIBUTED;
break;
default:
......@@ -2645,19 +2645,19 @@ valign_to_excel (GnmVAlign valign)
guint ialign;
switch (valign) {
case VALIGN_TOP:
case GNM_VALIGN_TOP:
ialign = MS_BIFF_V_A_TOP;
break;
case VALIGN_BOTTOM:
case GNM_VALIGN_BOTTOM:
ialign = MS_BIFF_V_A_BOTTOM;
break;
case VALIGN_CENTER:
case GNM_VALIGN_CENTER:
ialign = MS_BIFF_V_A_CENTER;
break;
case VALIGN_JUSTIFY:
case GNM_VALIGN_JUSTIFY:
ialign = MS_BIFF_V_A_JUSTIFY;
break;
case VALIGN_DISTRIBUTED:
case GNM_VALIGN_DISTRIBUTED:
ialign = MS_BIFF_V_A_DISTRIBUTED;
break;
default:
......@@ -2720,7 +2720,7 @@ get_xf_differences (BiffXFData *xfd, GnmStyle const *parentst)
xfd->differences |= 1 << MS_BIFF_D_FONT_BIT;
/* hmm. documentation doesn't say that alignment bit is
affected by vertical alignment, but it's a reasonable guess */
if (xfd->halign != HALIGN_GENERAL || xfd->valign != VALIGN_TOP
if (xfd->halign != GNM_HALIGN_GENERAL || xfd->valign != GNM_VALIGN_TOP
|| xfd->wrap_text)
xfd->differences |= 1 << MS_BIFF_D_ALIGN_BIT;
for (i = 0; i < STYLE_ORIENT_MAX; i++) {
......
......@@ -1638,31 +1638,31 @@ static void
xlsx_CT_DataValidation_begin (GsfXMLIn *xin, xmlChar const **attrs)
{
static EnumVal const val_styles[] = {
{ "stop", VALIDATION_STYLE_STOP },
{ "warning", VALIDATION_STYLE_WARNING },
{ "information", VALIDATION_STYLE_INFO },
{ "stop", GNM_VALIDATION_STYLE_STOP },
{ "warning", GNM_VALIDATION_STYLE_WARNING },
{ "information", GNM_VALIDATION_STYLE_INFO },
{ NULL, 0 }
};
static EnumVal const val_types[] = {
{ "none", VALIDATION_TYPE_ANY },
{ "whole", VALIDATION_TYPE_AS_INT },
{ "decimal", VALIDATION_TYPE_AS_NUMBER },
{ "list", VALIDATION_TYPE_IN_LIST },
{ "date", VALIDATION_TYPE_AS_DATE },
{ "time", VALIDATION_TYPE_AS_TIME },
{ "textLength", VALIDATION_TYPE_TEXT_LENGTH },
{ "custom", VALIDATION_TYPE_CUSTOM },
{ "none", GNM_VALIDATION_TYPE_ANY },
{ "whole", GNM_VALIDATION_TYPE_AS_INT },
{ "decimal", GNM_VALIDATION_TYPE_AS_NUMBER },
{ "list", GNM_VALIDATION_TYPE_IN_LIST },
{ "date", GNM_VALIDATION_TYPE_AS_DATE },
{ "time", GNM_VALIDATION_TYPE_AS_TIME },
{ "textLength", GNM_VALIDATION_TYPE_TEXT_LENGTH },
{ "custom", GNM_VALIDATION_TYPE_CUSTOM },
{ NULL, 0 }
};
static EnumVal const val_ops[] = {
{ "between", VALIDATION_OP_BETWEEN },
{ "notBetween", VALIDATION_OP_NOT_BETWEEN },
{ "equal", VALIDATION_OP_EQUAL },
{ "notEqual", VALIDATION_OP_NOT_EQUAL },
{ "lessThan", VALIDATION_OP_LT },
{ "lessThanOrEqual", VALIDATION_OP_LTE },
{ "greaterThan", VALIDATION_OP_GT },
{ "greaterThanOrEqual", VALIDATION_OP_GTE },
{ "between", GNM_VALIDATION_OP_BETWEEN },
{ "notBetween", GNM_VALIDATION_OP_NOT_BETWEEN },
{ "equal", GNM_VALIDATION_OP_EQUAL },
{ "notEqual", GNM_VALIDATION_OP_NOT_EQUAL },
{ "lessThan", GNM_VALIDATION_OP_LT },
{ "lessThanOrEqual", GNM_VALIDATION_OP_LTE },
{ "greaterThan", GNM_VALIDATION_OP_GT },
{ "greaterThanOrEqual", GNM_VALIDATION_OP_GTE },
{ NULL, 0 }
};
#if 0
......@@ -1684,9 +1684,9 @@ xlsx_CT_DataValidation_begin (GsfXMLIn *xin, xmlChar const **attrs)
XLSXReadState *state = (XLSXReadState *)xin->user_state;
/* defaults */
ValidationStyle val_style = VALIDATION_STYLE_STOP;
ValidationType val_type = VALIDATION_TYPE_ANY;
ValidationOp val_op = VALIDATION_OP_BETWEEN;
ValidationStyle val_style = GNM_VALIDATION_STYLE_STOP;
ValidationType val_type = GNM_VALIDATION_TYPE_ANY;
ValidationOp val_op = GNM_VALIDATION_OP_BETWEEN;
gboolean allowBlank = FALSE;
gboolean showDropDown = FALSE;
gboolean showInputMessage = FALSE;
......@@ -3896,29 +3896,29 @@ static void
xlsx_xf_align (GsfXMLIn *xin, xmlChar const **attrs)
{
static EnumVal const haligns[] = {
{ "general" , HALIGN_GENERAL },
{ "left" , HALIGN_LEFT },
{ "center" , HALIGN_CENTER },
{ "right" , HALIGN_RIGHT },
{ "fill" , HALIGN_FILL },
{ "justify" , HALIGN_JUSTIFY },
{ "centerContinuous" , HALIGN_CENTER_ACROSS_SELECTION },
{ "distributed" , HALIGN_DISTRIBUTED },
{ "general" , GNM_HALIGN_GENERAL },
{ "left" , GNM_HALIGN_LEFT },
{ "center" , GNM_HALIGN_CENTER },
{ "right" , GNM_HALIGN_RIGHT },
{ "fill" , GNM_HALIGN_FILL },
{ "justify" , GNM_HALIGN_JUSTIFY },
{ "centerContinuous" , GNM_HALIGN_CENTER_ACROSS_SELECTION },
{ "distributed" , GNM_HALIGN_DISTRIBUTED },
{ NULL, 0 }
};
static EnumVal const valigns[] = {
{ "top", VALIGN_TOP },
{ "center", VALIGN_CENTER },
{ "bottom", VALIGN_BOTTOM },
{ "justify", VALIGN_JUSTIFY },
{ "distributed", VALIGN_DISTRIBUTED },
{ "top", GNM_VALIGN_TOP },
{ "center", GNM_VALIGN_CENTER },
{ "bottom", GNM_VALIGN_BOTTOM },
{ "justify", GNM_VALIGN_JUSTIFY },
{ "distributed", GNM_VALIGN_DISTRIBUTED },
{ NULL, 0 }
};
XLSXReadState *state = (XLSXReadState *)xin->user_state;
int halign = HALIGN_GENERAL;
int valign = VALIGN_BOTTOM;
int halign = GNM_HALIGN_GENERAL;
int valign = GNM_VALIGN_BOTTOM;
int rotation = 0, indent = 0;
int wrapText = FALSE, justifyLastLine = FALSE, shrinkToFit = FALSE;
......
......@@ -842,35 +842,35 @@ xlsx_write_style_write_alignment (XLSXWriteState *state, GsfXMLOut *xml,
gsf_xml_out_start_element (xml, "alignment");
if (gnm_style_is_element_set (style, MSTYLE_ALIGN_H)) {
switch (gnm_style_get_align_h (style)) {
case HALIGN_LEFT:
case GNM_HALIGN_LEFT:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"left");
break;
case HALIGN_RIGHT:
case GNM_HALIGN_RIGHT:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"right");
break;
case HALIGN_CENTER:
case GNM_HALIGN_CENTER:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"center");
break;
case HALIGN_FILL:
case GNM_HALIGN_FILL:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"fill");
break;
case HALIGN_JUSTIFY:
case GNM_HALIGN_JUSTIFY:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"justify");
break;
case HALIGN_CENTER_ACROSS_SELECTION:
case GNM_HALIGN_CENTER_ACROSS_SELECTION:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"centerContinuous");
break;
case HALIGN_DISTRIBUTED:
case GNM_HALIGN_DISTRIBUTED:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"distributed");
break;
case HALIGN_GENERAL:
case GNM_HALIGN_GENERAL:
default:
gsf_xml_out_add_cstr_unchecked (xml, "horizontal",
"general");
......@@ -879,24 +879,24 @@ xlsx_write_style_write_alignment (XLSXWriteState *state, GsfXMLOut *xml,
}
if (gnm_style_is_element_set (style, MSTYLE_ALIGN_V)) {
switch (gnm_style_get_align_v (style)) {
case VALIGN_TOP:
case GNM_VALIGN_TOP:
gsf_xml_out_add_cstr_unchecked (xml, "vertical",
"top");
break;
case VALIGN_BOTTOM:
case GNM_VALIGN_BOTTOM:
gsf_xml_out_add_cstr_unchecked (xml, "vertical",
"bottom");
break;
case VALIGN_CENTER:
case GNM_VALIGN_CENTER:
gsf_xml_out_add_cstr_unchecked (xml, "vertical",
"center");
break;
case VALIGN_JUSTIFY:
case GNM_VALIGN_JUSTIFY:
gsf_xml_out_add_cstr_unchecked (xml, "vertical",
"justify");
break;
default:
case VALIGN_DISTRIBUTED:
case GNM_VALIGN_DISTRIBUTED:
gsf_xml_out_add_cstr_unchecked (xml, "vertical",
"distributed");
break;
......@@ -1350,14 +1350,14 @@ xlsx_write_validation (XLValInputPair const *vip, gpointer dummy, XLSXClosure *i
tmp = NULL;
switch (vip->v->type) {
default : /* fall back to the default */
case VALIDATION_TYPE_ANY : /* the default "none" */ break;
case VALIDATION_TYPE_AS_INT : tmp = "whole"; break;
case VALIDATION_TYPE_AS_NUMBER : tmp = "decimal"; break;
case VALIDATION_TYPE_IN_LIST : tmp = "list"; break;
case VALIDATION_TYPE_AS_DATE : tmp = "date"; break;
case VALIDATION_TYPE_AS_TIME : tmp = "time"; break;
case VALIDATION_TYPE_TEXT_LENGTH : tmp = "textLength"; break;
case VALIDATION_TYPE_CUSTOM : tmp = "custom"; break;
case GNM_VALIDATION_TYPE_ANY : /* the default "none" */ break;
case GNM_VALIDATION_TYPE_AS_INT : tmp = "whole"; break;
case GNM_VALIDATION_TYPE_AS_NUMBER : tmp = "decimal"; break;
case GNM_VALIDATION_TYPE_IN_LIST : tmp = "list"; break;
case GNM_VALIDATION_TYPE_AS_DATE : tmp = "date"; break;
case GNM_VALIDATION_TYPE_AS_TIME : tmp = "time"; break;
case GNM_VALIDATION_TYPE_TEXT_LENGTH : tmp = "textLength"; break;
case GNM_VALIDATION_TYPE_CUSTOM : tmp = "custom"; break;
}
if (NULL != tmp)
gsf_xml_out_add_cstr_unchecked (info->xml, "type", tmp);
......@@ -1365,14 +1365,14 @@ xlsx_write_validation (XLValInputPair const *vip, gpointer dummy, XLSXClosure *i
tmp = NULL;
switch (vip->v->op) {
default : /* fall back to the default */
case VALIDATION_OP_BETWEEN : /* the default "between" */ break;
case VALIDATION_OP_NOT_BETWEEN: tmp = "notBetween"; break;
case VALIDATION_OP_EQUAL : tmp = "equal"; break;
case VALIDATION_OP_NOT_EQUAL : tmp = "notEqual"; break;
case VALIDATION_OP_LT : tmp = "lessThan"; break;
case VALIDATION_OP_GT : tmp = "greaterThan"; break;
case VALIDATION_OP_LTE : tmp = "lessThanOrEqual"; break;
case VALIDATION_OP_GTE : tmp = "greaterThanOrEqual"; break;
case GNM_VALIDATION_OP_BETWEEN : /* the default "between" */ break;
case GNM_VALIDATION_OP_NOT_BETWEEN: tmp = "notBetween"; break;
case GNM_VALIDATION_OP_EQUAL : tmp = "equal"; break;
case GNM_VALIDATION_OP_NOT_EQUAL : tmp = "notEqual"; break;
case GNM_VALIDATION_OP_LT : tmp = "lessThan"; break;
case GNM_VALIDATION_OP_GT : tmp = "greaterThan"; break;
case GNM_VALIDATION_OP_LTE : tmp = "lessThanOrEqual"; break;
case GNM_VALIDATION_OP_GTE : tmp = "greaterThanOrEqual"; break;
}
if (NULL != tmp)
gsf_xml_out_add_cstr_unchecked (info->xml, "operator", tmp);
......@@ -1380,9 +1380,9 @@ xlsx_write_validation (XLValInputPair const *vip, gpointer dummy, XLSXClosure *i
tmp = NULL;
switch (vip->v->style) {
default : /* fall back to the default */
case VALIDATION_STYLE_STOP : /* "stop" the default */ break;
case VALIDATION_STYLE_WARNING : tmp = "warning"; break;
case VALIDATION_STYLE_INFO : tmp = "information"; break;
case GNM_VALIDATION_STYLE_STOP : /* "stop" the default */ break;
case GNM_VALIDATION_STYLE_WARNING : tmp = "warning"; break;
case GNM_VALIDATION_STYLE_INFO : tmp = "information"; break;
}
if (NULL != tmp)
gsf_xml_out_add_cstr_unchecked (info->xml, "errorStyle", tmp);
......
......@@ -283,15 +283,15 @@ gnumeric_cell (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (cell && cell->value && VALUE_IS_STRING (cell->value)) {
switch (gnm_style_get_align_h (mstyle)) {
case HALIGN_GENERAL:
case HALIGN_LEFT:
case HALIGN_JUSTIFY:
case HALIGN_DISTRIBUTED:
case GNM_HALIGN_GENERAL:
case GNM_HALIGN_LEFT:
case GNM_HALIGN_JUSTIFY:
case GNM_HALIGN_DISTRIBUTED:
return value_new_string ("'");
case HALIGN_RIGHT: return value_new_string ("\"");
case HALIGN_CENTER_ACROSS_SELECTION:
case HALIGN_CENTER: return value_new_string ("^");
case HALIGN_FILL: return value_new_string ("\\");
case GNM_HALIGN_RIGHT: return value_new_string ("\"");
case GNM_HALIGN_CENTER_ACROSS_SELECTION:
case GNM_HALIGN_CENTER: return value_new_string ("^");
case GNM_HALIGN_FILL: return value_new_string ("\\");
default : return value_new_string ("");
}
}
......
......@@ -493,35 +493,35 @@ write_cell (GsfOutput *output, Sheet *sheet, gint row, gint col, html_version_t
if (cell != NULL) {
switch (gnm_style_get_align_v (style)) {
case VALIGN_TOP:
case GNM_VALIGN_TOP:
gsf_output_puts (output, " valign=\"top\" ");
break;
case VALIGN_BOTTOM:
case GNM_VALIGN_BOTTOM:
gsf_output_puts (output, " valign=\"bottom\" ");
break;
case VALIGN_DISTRIBUTED:
case VALIGN_CENTER:
case GNM_VALIGN_DISTRIBUTED:
case GNM_VALIGN_CENTER:
gsf_output_puts (output, " valign=\"center\" ");
break;
case VALIGN_JUSTIFY:
case GNM_VALIGN_JUSTIFY:
gsf_output_puts (output, " valign=\"baseline\" ");
break;
default:
break;