Commit 2c09e027 authored by Morten Welinder's avatar Morten Welinder

A bit of renaming...

parent 1f4aec80
......@@ -171,7 +171,7 @@ applix_sheetref_parse (char const *start, Sheet **sheet, Workbook const *wb)
}
static char const *
applix_rangeref_parse (GnmRangeRef *res, char const *start, ParsePos const *pp)
applix_rangeref_parse (GnmRangeRef *res, char const *start, GnmParsePos const *pp)
{
char const *ptr = start, *tmp1, *tmp2;
Workbook *wb = pp->wb;
......@@ -343,7 +343,7 @@ applix_read_typefaces (ApplixReadState *state)
return FALSE;
}
static StyleColor *
static GnmStyleColor *
applix_get_color (ApplixReadState *state, char **buf)
{
/* Skip 'FG' or 'BG' */
......@@ -371,10 +371,10 @@ applix_get_precision (char const *val)
return 2;
}
static MStyle *
static GnmMStyle *
applix_parse_style (ApplixReadState *state, unsigned char **buffer)
{
MStyle *style;
GnmMStyle *style;
char *start = *buffer, *tmp = start;
gboolean is_protected = FALSE, is_invisible = FALSE;
char const *format_prefix = NULL, *format_suffix = NULL;
......@@ -616,7 +616,7 @@ applix_parse_style (ApplixReadState *state, unsigned char **buffer)
case 'F' :
if (sep[1] == 'G' ) {
StyleColor *color = applix_get_color (state, &sep);
GnmStyleColor *color = applix_get_color (state, &sep);
if (color == NULL)
return NULL;
mstyle_set_color (style, MSTYLE_COLOR_FORE, color);
......@@ -704,14 +704,14 @@ applix_parse_style (ApplixReadState *state, unsigned char **buffer)
sep = end;
if (sep[0] == 'F' && sep[1] == 'G' ) {
StyleColor *color = applix_get_color (state, &sep);
GnmStyleColor *color = applix_get_color (state, &sep);
if (color == NULL)
return NULL;
mstyle_set_color (style, MSTYLE_COLOR_PATTERN, color);
}
if (sep[0] == 'B' && sep[1] == 'G') {
StyleColor *color = applix_get_color (state, &sep);
GnmStyleColor *color = applix_get_color (state, &sep);
if (color == NULL)
return NULL;
mstyle_set_color (style, MSTYLE_COLOR_BACK, color);
......@@ -726,7 +726,7 @@ applix_parse_style (ApplixReadState *state, unsigned char **buffer)
STYLE_BORDER_DOUBLE
};
StyleColor *color;
GnmStyleColor *color;
MStyleElementType const type =
(sep[0] == 'T') ? MSTYLE_BORDER_TOP :
(sep[0] == 'B') ? MSTYLE_BORDER_BOTTOM :
......@@ -782,7 +782,7 @@ applix_read_attributes (ApplixReadState *state)
{
int count = 0;
unsigned char *ptr, *tmp;
MStyle *style;
GnmMStyle *style;
while (NULL != (ptr = applix_get_line (state))) {
if (!a_strncmp (ptr, "Attr Table End"))
......@@ -988,10 +988,10 @@ static int
applix_read_cells (ApplixReadState *state)
{
Sheet *sheet;
MStyle *style;
GnmMStyle *style;
GnmCell *cell;
GnmCellPos pos;
ParseError perr;
GnmParseError perr;
unsigned char content_type, *tmp, *ptr;
while (NULL != (ptr = applix_get_line (state))) {
......@@ -1023,7 +1023,7 @@ applix_read_cells (ApplixReadState *state)
switch (content_type) {
case ';' : /* First of a shared formula */
case '.' : { /* instance of a shared formula */
ParsePos pos;
GnmParsePos pos;
GnmExpr const *expr;
GnmValue *val = NULL;
GnmRange r;
......@@ -1186,7 +1186,7 @@ applix_read_row_list (ApplixReadState *state, unsigned char *ptr)
return applix_parse_error (state, "Invalid row format end col");
attr_index = strtol (ptr = tmp+1, (char **)&tmp, 10);
if (tmp != ptr && attr_index >= 2 && attr_index < state->attrs->len+2) {
MStyle *style = g_ptr_array_index(state->attrs, attr_index-2);
GnmMStyle *style = g_ptr_array_index(state->attrs, attr_index-2);
mstyle_ref (style);
sheet_style_set_range (sheet, &r, style);
} else if (attr_index != 1) /* TODO : What the hell is attr 1 ?? */
......@@ -1243,7 +1243,7 @@ applix_read_absolute_name (ApplixReadState *state, char *buffer)
{
char *end;
GnmRangeRef ref;
ParsePos pp;
GnmParsePos pp;
GnmExpr const *expr;
/* .ABCDe. Coordinate: A:B2..A:C4 */
......@@ -1275,7 +1275,7 @@ applix_read_relative_name (ApplixReadState *state, char *buffer)
int dummy;
char *end;
GnmRangeRef ref, flag;
ParsePos pp;
GnmParsePos pp;
GnmExpr const *expr;
/* .abcdE. tCol:0 tRow:0 tSheet:0 bCol:1 bRow:2 bSheet: 0 tColAbs:0 tRowAbs:0 tSheetAbs:1 bColAbs:0 bRowAbs:0 bSheetAbs:1 */
......
......@@ -234,7 +234,7 @@ BC_R(ai)(XLChartHandler const *handle,
/* Rest are 0 */
if (flags&0x01) {
StyleFormat *fmt = ms_container_get_fmt (&s->container,
GnmStyleFormat *fmt = ms_container_get_fmt (&s->container,
GSF_LE_GET_GUINT16 (q->data + 4));
d (2, fputs ("Has Custom number format", stderr););
if (fmt != NULL) {
......@@ -839,7 +839,7 @@ static gboolean
BC_R(ifmt)(XLChartHandler const *handle,
XLChartReadState *s, BiffQuery *q)
{
StyleFormat *fmt = ms_container_get_fmt (&s->container,
GnmStyleFormat *fmt = ms_container_get_fmt (&s->container,
GSF_LE_GET_GUINT16 (q->data));
if (fmt != NULL) {
......@@ -1916,7 +1916,7 @@ chart_get_sheet (MSContainer const *container)
return ms_container_sheet (container->parent);
}
static StyleFormat *
static GnmStyleFormat *
chart_get_fmt (MSContainer const *container, guint16 indx)
{
return ms_container_get_fmt (container->parent, indx);
......
......@@ -201,7 +201,7 @@ ms_container_sheet (MSContainer const *c)
return (*c->vtbl->sheet) (c);
}
StyleFormat *
GnmStyleFormat *
ms_container_get_fmt (MSContainer const *c, guint16 indx)
{
g_return_val_if_fail (c != NULL, NULL);
......
......@@ -16,7 +16,7 @@ typedef struct {
GnmExpr const * (*parse_expr) (MSContainer *container,
guint8 const *data, int length);
Sheet * (*sheet) (MSContainer const *container);
StyleFormat * (*get_fmt) (MSContainer const *container, guint16 indx);
GnmStyleFormat * (*get_fmt) (MSContainer const *container, guint16 indx);
} MSContainerClass;
struct _MSContainer {
......@@ -52,6 +52,6 @@ GnmExpr const *ms_container_parse_expr (MSContainer *c,
guint8 const *data, int length);
Sheet *ms_container_sheet (MSContainer const *c);
StyleFormat *ms_container_get_fmt (MSContainer const *container, guint16 indx);
GnmStyleFormat *ms_container_get_fmt (MSContainer const *container, guint16 indx);
#endif /* MS_OFFICE_CONTAINER_H */
......@@ -123,7 +123,7 @@ excel_iconv_open_for_import (guint codepage)
return gsf_msole_iconv_open_for_import (codepage);
}
static StyleFormat *
static GnmStyleFormat *
excel_wb_get_fmt (ExcelWorkbook *ewb, guint16 idx)
{
char const *ans = NULL;
......@@ -156,7 +156,7 @@ ms_sheet_parse_expr_internal (ExcelReadSheet *esheet, guint8 const *data, int le
#if 0
{
char *tmp;
ParsePos pp;
GnmParsePos pp;
Sheet *sheet = esheet->sheet;
Workbook *wb = (sheet == NULL) ? esheet->container.ewb->gnum_wb : NULL;
......@@ -182,13 +182,13 @@ ms_sheet_get_sheet (MSContainer const *container)
return ((ExcelReadSheet const *)container)->sheet;
}
static StyleFormat *
static GnmStyleFormat *
ms_sheet_get_fmt (MSContainer const *container, guint16 indx)
{
return excel_wb_get_fmt (container->ewb, indx);
}
static StyleColor *
static GnmStyleColor *
ms_sheet_map_color (ExcelReadSheet const *esheet, MSObj const *obj, MSObjAttrID id)
{
gushort r, g, b;
......@@ -424,7 +424,7 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
switch (obj->excel_type) {
case 0x01: { /* Line */
StyleColor *color;
GnmStyleColor *color;
MSObjAttr *is_arrow = ms_obj_attr_bag_lookup (obj->attrs,
MS_OBJ_ATTR_ARROW_END);
so = sheet_object_line_new (is_arrow != NULL);
......@@ -437,8 +437,8 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
}
case 0x02:
case 0x03: { /* Box or Oval */
StyleColor *fill_color = NULL;
StyleColor *outline_color;
GnmStyleColor *fill_color = NULL;
GnmStyleColor *outline_color;
so = sheet_object_box_new (obj->excel_type == 3);
if (ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_FILLED))
......@@ -458,7 +458,7 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
case 0x0E: /* Label */
case 0x06: { /* TextBox */
StyleColor *color = NULL;
GnmStyleColor *color = NULL;
so = g_object_new (sheet_object_text_get_type (), NULL);
......@@ -985,7 +985,7 @@ excel_read_EXSST (BiffQuery *q, ExcelWorkbook *ewb)
}
GnmValue *
biff_get_error (EvalPos const *pos, guint8 err)
biff_get_error (GnmEvalPos const *pos, guint8 err)
{
switch (err) {
case 0: return value_new_error_NULL (pos);
......@@ -1336,7 +1336,7 @@ excel_get_default_palette (void)
pal->red = g_new (int, entries);
pal->green = g_new (int, entries);
pal->blue = g_new (int, entries);
pal->gnum_cols = g_new (StyleColor *, entries);
pal->gnum_cols = g_new (GnmStyleColor *, entries);
while (--entries >= 0) {
pal->red[entries] = excel_default_palette[entries].r;
......@@ -1362,7 +1362,7 @@ excel_read_PALETTE (BiffQuery *q, ExcelWorkbook *ewb)
pal->red = g_new (int, len);
pal->green = g_new (int, len);
pal->blue = g_new (int, len);
pal->gnum_cols = g_new (StyleColor *, len);
pal->gnum_cols = g_new (GnmStyleColor *, len);
d (3, fprintf (stderr,"New palette with %d entries\n", len););
......@@ -1382,7 +1382,7 @@ excel_read_PALETTE (BiffQuery *q, ExcelWorkbook *ewb)
ewb->palette = pal;
}
StyleColor *
GnmStyleColor *
excel_palette_get (ExcelPalette const *pal, gint idx)
{
/* return black on failure */
......@@ -1426,7 +1426,7 @@ excel_palette_get (ExcelPalette const *pal, gint idx)
g_return_val_if_fail (pal->gnum_cols[idx],
style_color_black ());
d (1, {
StyleColor *sc = pal->gnum_cols[idx];
GnmStyleColor *sc = pal->gnum_cols[idx];
fprintf (stderr,"New color in slot %d: RGB= %x,%x,%x\n",
idx, sc->color.red, sc->color.green, sc->color.blue);
});
......@@ -1489,14 +1489,14 @@ excel_get_xf (ExcelReadSheet *esheet, int xfidx)
return xf;
}
static MStyle *
static GnmMStyle *
excel_get_style_from_xf (ExcelReadSheet *esheet, guint16 xfidx)
{
BiffXFData const *xf = excel_get_xf (esheet, xfidx);
BiffFontData const *fd;
StyleColor *pattern_color, *back_color, *font_color;
GnmStyleColor *pattern_color, *back_color, *font_color;
int pattern_index, back_index, font_index;
MStyle *mstyle;
GnmMStyle *mstyle;
int i;
d (2, fprintf (stderr,"XF index %d\n", xfidx););
......@@ -1627,10 +1627,10 @@ excel_get_style_from_xf (ExcelReadSheet *esheet, guint16 xfidx)
/* Borders */
for (i = 0; i < STYLE_ORIENT_MAX; i++) {
MStyle *tmp = mstyle;
GnmMStyle *tmp = mstyle;
MStyleElementType const t = MSTYLE_BORDER_TOP + i;
int const color_index = xf->border_color[i];
StyleColor *color;
GnmStyleColor *color;
switch (color_index) {
case 64:
......@@ -1668,7 +1668,7 @@ excel_get_style_from_xf (ExcelReadSheet *esheet, guint16 xfidx)
static void
excel_set_xf (ExcelReadSheet *esheet, int col, int row, guint16 xfidx)
{
MStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
GnmMStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
d (2, fprintf (stderr,"%s!%s%d = xf(%d)\n", esheet->sheet->name_unquoted,
col_name (col), row + 1, xfidx););
......@@ -1685,7 +1685,7 @@ excel_set_xf_segment (ExcelReadSheet *esheet,
int start_row, int end_row, guint16 xfidx)
{
GnmRange range;
MStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
GnmMStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
if (mstyle == NULL)
return;
......@@ -2354,7 +2354,7 @@ excel_read_FORMULA (BiffQuery *q, ExcelReadSheet *esheet)
if (v) {
val = value_new_string_nocopy (v);
} else {
EvalPos ep;
GnmEvalPos ep;
val = value_new_error (eval_pos_init_cell (&ep, cell),
"INVALID STRING");
g_warning ("EXCEL: invalid STRING record in %s",
......@@ -2362,7 +2362,7 @@ excel_read_FORMULA (BiffQuery *q, ExcelReadSheet *esheet)
}
} else {
/* There should be a STRING record here */
EvalPos ep;
GnmEvalPos ep;
val = value_new_error (eval_pos_init_cell (&ep, cell),
"MISSING STRING");
g_warning ("EXCEL: missing STRING record for %s",
......@@ -2372,7 +2372,7 @@ excel_read_FORMULA (BiffQuery *q, ExcelReadSheet *esheet)
/* We MUST have a value */
if (val == NULL) {
EvalPos ep;
GnmEvalPos ep;
val = value_new_error (eval_pos_init_cell (&ep, cell),
"MISSING Value");
g_warning ("EXCEL: Invalid state. Missing Value in %s?",
......@@ -2564,7 +2564,7 @@ ms_wb_parse_expr (MSContainer *container, guint8 const *data, int length)
return ms_sheet_parse_expr_internal (&dummy_sheet, data, length);
}
static StyleFormat *
static GnmStyleFormat *
ms_wb_get_fmt (MSContainer const *container, guint16 indx)
{
return excel_wb_get_fmt (((ExcelWorkbook *)container), indx);
......@@ -2786,7 +2786,7 @@ excel_parse_name (ExcelWorkbook *ewb, Sheet *sheet, char *name,
guint8 const *expr_data, unsigned expr_len,
gboolean link_to_container)
{
ParsePos pp;
GnmParsePos pp;
GnmNamedExpr *nexpr;
GnmExpr const *expr = NULL;
char *err = NULL;
......@@ -2802,7 +2802,7 @@ excel_parse_name (ExcelWorkbook *ewb, Sheet *sheet, char *name,
expr = gnm_expr_new_constant (value_new_error_REF (NULL));
} else d (2, {
char *tmp;
ParsePos pp;
GnmParsePos pp;
tmp = gnm_expr_as_string (expr, parse_pos_init (&pp, ewb->gnum_wb, NULL, 0, 0), gnm_expr_conventions_default);
fprintf (stderr, "%s\n", tmp);
......@@ -3089,7 +3089,7 @@ excel_read_XCT (BiffQuery *q, ExcelWorkbook *ewb)
Sheet *sheet = NULL;
GnmCell *cell;
GnmValue *v;
EvalPos ep;
GnmEvalPos ep;
if (ewb->container.ver >= MS_BIFF_V8) {
guint16 supbook;
......@@ -3275,8 +3275,8 @@ excel_read_tab_color (BiffQuery *q, ExcelReadSheet *esheet)
10 | 0 0 0 XX XX XX XX XX XX XX XX XX XX XX XX | ...************
#endif
guint8 color_index;
StyleColor *color;
StyleColor *text_color;
GnmStyleColor *color;
GnmStyleColor *text_color;
int contrast;
g_return_if_fail (q->length == 20);
......@@ -3851,7 +3851,7 @@ excel_read_WINDOW2 (BiffQuery *q, ExcelReadSheet *esheet, WorkbookView *wb_view)
sv_set_initial_top_left (sv, left_col, top_row);
if (!(options & 0x0020)) {
StyleColor *pattern_color;
GnmStyleColor *pattern_color;
if (esheet->container.ver >= MS_BIFF_V8) {
/* Get style color from palette*/
pattern_color = excel_palette_get (
......@@ -4089,7 +4089,7 @@ excel_read_DV (BiffQuery *q, ExcelReadSheet *esheet)
ValidationType type;
ValidationOp op;
GSList *ptr, *ranges = NULL;
MStyle *mstyle;
GnmMStyle *mstyle;
g_return_if_fail (q->length >= 4);
options = GSF_LE_GET_GUINT32 (q->data);
......@@ -4373,7 +4373,7 @@ excel_read_HLINK (BiffQuery *q, ExcelReadSheet *esheet)
}
if (link != NULL) {
MStyle *style = mstyle_new ();
GnmMStyle *style = mstyle_new ();
mstyle_set_hlink (style, link);
sheet_style_apply_range (esheet->sheet, &r, style);
if (tip != NULL)
......@@ -4713,7 +4713,7 @@ excel_read_sheet (BiffQuery *q, ExcelWorkbook *ewb,
excel_workbook_reset_style(ewb);
} else {
/* Apply the default style */
MStyle *mstyle= excel_get_style_from_xf (esheet, 15);
GnmMStyle *mstyle= excel_get_style_from_xf (esheet, 15);
if (mstyle != NULL) {
GnmRange r;
sheet_style_set_range (esheet->sheet,
......@@ -4821,7 +4821,7 @@ excel_read_sheet (BiffQuery *q, ExcelWorkbook *ewb,
pos.row = EX_GETROW (q);
if (GSF_LE_GET_GUINT8 (q->data + 7)) {
EvalPos ep;
GnmEvalPos ep;
v = biff_get_error (eval_pos_init (&ep, esheet->sheet, &pos), val);
} else
v = value_new_bool (val);
......
......@@ -74,7 +74,7 @@ typedef struct {
int *green;
int *blue;
int length;
StyleColor **gnum_cols;
GnmStyleColor **gnum_cols;
} ExcelPalette;
typedef struct {
......@@ -121,7 +121,7 @@ struct _ExcelWorkbook {
};
char *biff_get_text (guint8 const *ptr, guint32 length, guint32 *byte_length);
GnmValue *biff_get_error (EvalPos const *pos, guint8 const err);
GnmValue *biff_get_error (GnmEvalPos const *pos, guint8 const err);
Sheet *excel_externsheet_v7 (MSContainer const *container, gint16 i);
ExcelExternSheetV8 const *excel_externsheet_v8 (ExcelWorkbook const *wb, gint16 i);
......@@ -132,7 +132,7 @@ void ms_biff_bof_data_destroy (MsBiffBofData * data);
char *ms_biff_get_chars (char const *ptr, guint length,
gboolean use_utf16);
StyleColor *excel_palette_get (ExcelPalette const *pal, gint idx);
GnmStyleColor *excel_palette_get (ExcelPalette const *pal, gint idx);
void excel_read_IMDATA (BiffQuery *q);
......
......@@ -72,7 +72,7 @@
#define N_ELEMENTS_BETWEEN_PROGRESS_UPDATES 20
static guint style_color_to_rgb888 (StyleColor const *c);
static guint style_color_to_rgb888 (GnmStyleColor const *c);
static gint palette_get_index (ExcelWriteState *ewb, guint c);
/**
......@@ -509,8 +509,8 @@ excel_write_WINDOW2 (BiffPut *bp, ExcelWriteSheet *esheet)
GnmCellPos top_left;
Sheet const *sheet = esheet->gnum_sheet;
SheetView const *sv = sheet_get_view (sheet, esheet->ewb->gnum_wb_view);
StyleColor *sheet_auto = sheet_style_get_auto_pattern_color (sheet);
StyleColor *default_auto = style_color_auto_pattern ();
GnmStyleColor *sheet_auto = sheet_style_get_auto_pattern_color (sheet);
GnmStyleColor *default_auto = style_color_auto_pattern ();
guint32 biff_pat_col = 0x40; /* default grid color index == auto */
if (sheet->display_formulas)
......@@ -784,8 +784,8 @@ excel_write_DV (ValInputPair const *vip, gpointer dummy, ExcelWriteSheet *esheet
static void
excel_write_DVAL (BiffPut *bp, ExcelWriteSheet *esheet)
{
StyleList *ptr;
StyleRegion const *sr;
GnmStyleList *ptr;
GnmStyleRegion const *sr;
GHashTable *group;
guint8 *data;
unsigned i;
......@@ -841,8 +841,8 @@ excel_write_DVAL (BiffPut *bp, ExcelWriteSheet *esheet)
static void
excel_write_prep_validations (ExcelWriteSheet *esheet)
{
StyleList *ptr = esheet->validations;
StyleRegion const *sr;
GnmStyleList *ptr = esheet->validations;
GnmStyleRegion const *sr;
GnmValidation const *v;
for (; ptr != NULL ; ptr = ptr->next) {
......@@ -1019,10 +1019,10 @@ palette_color_to_int (ExcelPaletteEntry const *c)
}
/**
* Convert StyleColor to guint representation used in BIFF file
* Convert GnmStyleColor to guint representation used in BIFF file
**/
static guint
style_color_to_rgb888 (StyleColor const *c)
style_color_to_rgb888 (GnmStyleColor const *c)
{
return ((c->color.blue & 0xff00) << 8) + (c->color.green & 0xff00) + (c->color.red >> 8);
......@@ -1110,7 +1110,7 @@ palette_get_index (ExcelWriteState *ewb, guint c)
* Add a color to palette if it is not already there
**/
static void
put_color (ExcelWriteState *ewb, StyleColor const *c)
put_color (ExcelWriteState *ewb, GnmStyleColor const *c)
{
TwoWayTable *twt = ewb->pal.two_way_table;
gpointer pc = GUINT_TO_POINTER (style_color_to_rgb888 (c));
......@@ -1129,10 +1129,10 @@ put_color (ExcelWriteState *ewb, StyleColor const *c)
* Add colors in mstyle to palette
**/
static void
put_colors (MStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
put_colors (GnmMStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
{
int i;
StyleBorder const *b;
GnmStyleBorder const *b;
put_color (ewb, mstyle_get_color (st, MSTYLE_COLOR_FORE));
put_color (ewb, mstyle_get_color (st, MSTYLE_COLOR_BACK));
......@@ -1268,15 +1268,15 @@ excel_font_to_string (ExcelFont const *f)
*
* Make an ExcelFont.
* In, Excel, the foreground color is a font attribute. ExcelFont
* consists of a StyleFont and a color.
* consists of a GnmStyleFont and a color.
*
* Style color is *not* unrefed. This is correct
**/
static ExcelFont *
excel_font_new (MStyle *st)
excel_font_new (GnmMStyle *st)
{
ExcelFont *f;
StyleColor *c;
GnmStyleColor *c;
if (!st)
return NULL;
......@@ -1386,7 +1386,7 @@ after_put_font (ExcelFont *f, gboolean was_added, gint index, gconstpointer dumm
* Add a font to table if it is not already there.
**/
static void
put_font (MStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
put_font (GnmMStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
{
TwoWayTable *twt = ewb->fonts.two_way_table;
ExcelFont *f = excel_font_new (st);
......@@ -1517,7 +1517,7 @@ excel_write_FONTs (BiffPut *bp, ExcelWriteState *ewb)
* format is added. Free resources when it was already there.
**/
static void
after_put_format (StyleFormat *format, gboolean was_added, gint index,
after_put_format (GnmStyleFormat *format, gboolean was_added, gint index,
char const *tmpl)
{
if (was_added) {
......@@ -1559,7 +1559,7 @@ formats_free (ExcelWriteState *ewb)
}
}
static StyleFormat const *
static GnmStyleFormat const *
formats_get_format (ExcelWriteState *ewb, gint idx)
{
return two_way_table_idx_to_key (ewb->formats.two_way_table, idx);
......@@ -1569,7 +1569,7 @@ formats_get_format (ExcelWriteState *ewb, gint idx)
* Get index of a format
**/
static gint
formats_get_index (ExcelWriteState *ewb, StyleFormat const *format)
formats_get_index (ExcelWriteState *ewb, GnmStyleFormat const *format)
{
return two_way_table_key_to_idx (ewb->formats.two_way_table, format);
}
......@@ -1580,9 +1580,9 @@ formats_get_index (ExcelWriteState *ewb, StyleFormat const *format)
* Style format is *not* unrefed. This is correct
**/
static void
put_format (MStyle *mstyle, gconstpointer dummy, ExcelWriteState *ewb)
put_format (GnmMStyle *mstyle, gconstpointer dummy, ExcelWriteState *ewb)
{
StyleFormat *fmt = mstyle_get_format (mstyle);
GnmStyleFormat *fmt = mstyle_get_format (mstyle);
style_format_ref (fmt);
two_way_table_put (ewb->formats.two_way_table,
(gpointer)fmt, TRUE,
......@@ -1608,7 +1608,7 @@ static void
excel_write_FORMAT (ExcelWriteState *ewb, int fidx)
{
guint8 data[64];
StyleFormat const *sf = formats_get_format (ewb, fidx);
GnmStyleFormat const *sf = formats_get_format (ewb, fidx);
char *format = style_format_as_XL (sf, FALSE);
......@@ -1654,22 +1654,22 @@ excel_write_FORMATs (ExcelWriteState *ewb)
}
/**
* Get default MStyle of esheet
* Get default GnmMStyle of esheet
*
* FIXME: This works now. But only because the default style for a
* sheet or workbook can't be changed. Unfortunately, there is no
* proper API for accessing the default style of an existing sheet.
**/
static MStyle *
static GnmMStyle *
get_default_mstyle (void)
{
return mstyle_new_default ();
}
/**
* Initialize XF/MStyle table.
* Initialize XF/GnmMStyle table.
*
* The table records MStyles. For each MStyle, an XF record will be
* The table records MStyles. For each GnmMStyle, an XF record will be
* written to file.
**/
static void
......@@ -1698,14 +1698,14 @@ xf_free (ExcelWriteState *ewb)
/**
* Get an mstyle, given index
**/
static MStyle *
static GnmMStyle *
xf_get_mstyle (ExcelWriteState *ewb, gint idx)
{
return two_way_table_idx_to_key (ewb->xf.two_way_table, idx);
}
static void
after_put_mstyle (MStyle *st, gboolean was_added, gint index, gconstpointer dummy)
after_put_mstyle (GnmMStyle *st, gboolean was_added, gint index, gconstpointer dummy)
{
if (was_added) {
d (1, fprintf (stderr, "Found unique mstyle %d %p\n", index, st); );
......@@ -1713,17 +1713,17 @@ after_put_mstyle (MStyle *st, gboolean was_added, gint index, gconstpointer dumm
}
/**
* Add an MStyle to table if it is not already there.
* Add an GnmMStyle to table if it is not already there.
**/
static gint
put_mstyle (ExcelWriteState *ewb, MStyle *st)
put_mstyle (ExcelWriteState *ewb, GnmMStyle *st)
{
return two_way_table_put (ewb->xf.two_way_table, st, TRUE,
(AfterPutFunc) after_put_mstyle, NULL);
}