Commit 64835b94 authored by Morten Welinder's avatar Morten Welinder

More renaming...

parent 2c09e027
......@@ -343,7 +343,7 @@ applix_read_typefaces (ApplixReadState *state)
return FALSE;
}
static GnmStyleColor *
static GnmColor *
applix_get_color (ApplixReadState *state, char **buf)
{
/* Skip 'FG' or 'BG' */
......@@ -371,10 +371,10 @@ applix_get_precision (char const *val)
return 2;
}
static GnmMStyle *
static GnmStyle *
applix_parse_style (ApplixReadState *state, unsigned char **buffer)
{
GnmMStyle *style;
GnmStyle *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' ) {
GnmStyleColor *color = applix_get_color (state, &sep);
GnmColor *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' ) {
GnmStyleColor *color = applix_get_color (state, &sep);
GnmColor *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') {
GnmStyleColor *color = applix_get_color (state, &sep);
GnmColor *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
};
GnmStyleColor *color;
GnmColor *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;
GnmMStyle *style;
GnmStyle *style;
while (NULL != (ptr = applix_get_line (state))) {
if (!a_strncmp (ptr, "Attr Table End"))
......@@ -988,7 +988,7 @@ static int
applix_read_cells (ApplixReadState *state)
{
Sheet *sheet;
GnmMStyle *style;
GnmStyle *style;
GnmCell *cell;
GnmCellPos pos;
GnmParseError perr;
......@@ -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) {
GnmMStyle *style = g_ptr_array_index(state->attrs, attr_index-2);
GnmStyle *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 ?? */
......
......@@ -234,7 +234,7 @@ BC_R(ai)(XLChartHandler const *handle,
/* Rest are 0 */
if (flags&0x01) {
GnmStyleFormat *fmt = ms_container_get_fmt (&s->container,
GnmFormat *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)
{
GnmStyleFormat *fmt = ms_container_get_fmt (&s->container,
GnmFormat *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 GnmStyleFormat *
static GnmFormat *
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);
}
GnmStyleFormat *
GnmFormat *
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);
GnmStyleFormat * (*get_fmt) (MSContainer const *container, guint16 indx);
GnmFormat * (*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);
GnmStyleFormat *ms_container_get_fmt (MSContainer const *container, guint16 indx);
GnmFormat *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 GnmStyleFormat *
static GnmFormat *
excel_wb_get_fmt (ExcelWorkbook *ewb, guint16 idx)
{
char const *ans = NULL;
......@@ -182,13 +182,13 @@ ms_sheet_get_sheet (MSContainer const *container)
return ((ExcelReadSheet const *)container)->sheet;
}
static GnmStyleFormat *
static GnmFormat *
ms_sheet_get_fmt (MSContainer const *container, guint16 indx)
{
return excel_wb_get_fmt (container->ewb, indx);
}
static GnmStyleColor *
static GnmColor *
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 */
GnmStyleColor *color;
GnmColor *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 */
GnmStyleColor *fill_color = NULL;
GnmStyleColor *outline_color;
GnmColor *fill_color = NULL;
GnmColor *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 */
GnmStyleColor *color = NULL;
GnmColor *color = NULL;
so = g_object_new (sheet_object_text_get_type (), NULL);
......@@ -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 (GnmStyleColor *, entries);
pal->gnum_cols = g_new (GnmColor *, 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 (GnmStyleColor *, len);
pal->gnum_cols = g_new (GnmColor *, 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;
}
GnmStyleColor *
GnmColor *
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, {
GnmStyleColor *sc = pal->gnum_cols[idx];
GnmColor *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 GnmMStyle *
static GnmStyle *
excel_get_style_from_xf (ExcelReadSheet *esheet, guint16 xfidx)
{
BiffXFData const *xf = excel_get_xf (esheet, xfidx);
BiffFontData const *fd;
GnmStyleColor *pattern_color, *back_color, *font_color;
GnmColor *pattern_color, *back_color, *font_color;
int pattern_index, back_index, font_index;
GnmMStyle *mstyle;
GnmStyle *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++) {
GnmMStyle *tmp = mstyle;
GnmStyle *tmp = mstyle;
MStyleElementType const t = MSTYLE_BORDER_TOP + i;
int const color_index = xf->border_color[i];
GnmStyleColor *color;
GnmColor *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)
{
GnmMStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
GnmStyle * 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;
GnmMStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
GnmStyle * const mstyle = excel_get_style_from_xf (esheet, xfidx);
if (mstyle == NULL)
return;
......@@ -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 GnmStyleFormat *
static GnmFormat *
ms_wb_get_fmt (MSContainer const *container, guint16 indx)
{
return excel_wb_get_fmt (((ExcelWorkbook *)container), indx);
......@@ -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;
GnmStyleColor *color;
GnmStyleColor *text_color;
GnmColor *color;
GnmColor *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)) {
GnmStyleColor *pattern_color;
GnmColor *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;
GnmMStyle *mstyle;
GnmStyle *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) {
GnmMStyle *style = mstyle_new ();
GnmStyle *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 */
GnmMStyle *mstyle= excel_get_style_from_xf (esheet, 15);
GnmStyle *mstyle= excel_get_style_from_xf (esheet, 15);
if (mstyle != NULL) {
GnmRange r;
sheet_style_set_range (esheet->sheet,
......
......@@ -74,7 +74,7 @@ typedef struct {
int *green;
int *blue;
int length;
GnmStyleColor **gnum_cols;
GnmColor **gnum_cols;
} ExcelPalette;
typedef struct {
......@@ -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);
GnmStyleColor *excel_palette_get (ExcelPalette const *pal, gint idx);
GnmColor *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 (GnmStyleColor const *c);
static guint style_color_to_rgb888 (GnmColor 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);
GnmStyleColor *sheet_auto = sheet_style_get_auto_pattern_color (sheet);
GnmStyleColor *default_auto = style_color_auto_pattern ();
GnmColor *sheet_auto = sheet_style_get_auto_pattern_color (sheet);
GnmColor *default_auto = style_color_auto_pattern ();
guint32 biff_pat_col = 0x40; /* default grid color index == auto */
if (sheet->display_formulas)
......@@ -1019,10 +1019,10 @@ palette_color_to_int (ExcelPaletteEntry const *c)
}
/**
* Convert GnmStyleColor to guint representation used in BIFF file
* Convert GnmColor to guint representation used in BIFF file
**/
static guint
style_color_to_rgb888 (GnmStyleColor const *c)
style_color_to_rgb888 (GnmColor 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, GnmStyleColor const *c)
put_color (ExcelWriteState *ewb, GnmColor 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, GnmStyleColor const *c)
* Add colors in mstyle to palette
**/
static void
put_colors (GnmMStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
put_colors (GnmStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
{
int i;
GnmStyleBorder const *b;
GnmBorder 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 GnmStyleFont and a color.
* consists of a GnmFont and a color.
*
* Style color is *not* unrefed. This is correct
**/
static ExcelFont *
excel_font_new (GnmMStyle *st)
excel_font_new (GnmStyle *st)
{
ExcelFont *f;
GnmStyleColor *c;
GnmColor *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 (GnmMStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
put_font (GnmStyle *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 (GnmStyleFormat *format, gboolean was_added, gint index,
after_put_format (GnmFormat *format, gboolean was_added, gint index,
char const *tmpl)
{
if (was_added) {
......@@ -1559,7 +1559,7 @@ formats_free (ExcelWriteState *ewb)
}
}
static GnmStyleFormat const *
static GnmFormat 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, GnmStyleFormat const *format)
formats_get_index (ExcelWriteState *ewb, GnmFormat const *format)
{
return two_way_table_key_to_idx (ewb->formats.two_way_table, format);
}
......@@ -1580,9 +1580,9 @@ formats_get_index (ExcelWriteState *ewb, GnmStyleFormat const *format)
* Style format is *not* unrefed. This is correct
**/
static void
put_format (GnmMStyle *mstyle, gconstpointer dummy, ExcelWriteState *ewb)
put_format (GnmStyle *mstyle, gconstpointer dummy, ExcelWriteState *ewb)
{
GnmStyleFormat *fmt = mstyle_get_format (mstyle);
GnmFormat *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];
GnmStyleFormat const *sf = formats_get_format (ewb, fidx);
GnmFormat 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 GnmMStyle of esheet
* Get default GnmStyle 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 GnmMStyle *
static GnmStyle *
get_default_mstyle (void)
{
return mstyle_new_default ();
}
/**
* Initialize XF/GnmMStyle table.
* Initialize XF/GnmStyle table.
*
* The table records MStyles. For each GnmMStyle, an XF record will be
* The table records MStyles. For each GnmStyle, an XF record will be
* written to file.
**/
static void
......@@ -1698,14 +1698,14 @@ xf_free (ExcelWriteState *ewb)
/**
* Get an mstyle, given index
**/
static GnmMStyle *
static GnmStyle *
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 (GnmMStyle *st, gboolean was_added, gint index, gconstpointer dummy)
after_put_mstyle (GnmStyle *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 (GnmMStyle *st, gboolean was_added, gint index, gconstpointer d
}
/**
* Add an GnmMStyle to table if it is not already there.
* Add an GnmStyle to table if it is not already there.
**/
static gint
put_mstyle (ExcelWriteState *ewb, GnmMStyle *st)
put_mstyle (ExcelWriteState *ewb, GnmStyle *st)
{
return two_way_table_put (ewb->xf.two_way_table, st, TRUE,
(AfterPutFunc) after_put_mstyle, NULL);
}
static void
cb_accum_styles (GnmMStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
cb_accum_styles (GnmStyle *st, gconstpointer dummy, ExcelWriteState *ewb)
{
put_mstyle (ewb, st);
}
......@@ -1888,8 +1888,8 @@ rotation_to_excel (int rotation, MsBiffVersion ver)
* the same autocolors over and over.
*/
static guint16
style_color_to_pal_index (GnmStyleColor *color, ExcelWriteState *ewb,
GnmStyleColor *auto_back, GnmStyleColor *auto_font)
style_color_to_pal_index (GnmColor *color, ExcelWriteState *ewb,
GnmColor *auto_back, GnmColor *auto_font)
{
guint16 idx;
......@@ -1920,7 +1920,7 @@ style_color_to_pal_index (GnmStyleColor *color, ExcelWriteState *ewb,
* others. Can we use the actual default style as XF 0?
**/
static void
get_xf_differences (ExcelWriteState *ewb, BiffXFData *xfd, GnmMStyle *parentst)
get_xf_differences (ExcelWriteState *ewb, BiffXFData *xfd, GnmStyle *parentst)
{
int i;
......@@ -1989,15 +1989,15 @@ log_xf_data (ExcelWriteState *ewb, BiffXFData *xfd, int idx)
#endif
static void
build_xf_data (ExcelWriteState *ewb, BiffXFData *xfd, GnmMStyle *st)
build_xf_data (ExcelWriteState *ewb, BiffXFData *xfd, GnmStyle *st)
{
ExcelFont *f;
GnmStyleBorder const *b;
GnmBorder const *b;
int pat;
GnmStyleColor *pattern_color;
GnmStyleColor *back_color;
GnmStyleColor *auto_back = style_color_auto_back ();
GnmStyleColor *auto_font = style_color_auto_font ();
GnmColor *pattern_color;
GnmColor *back_color;
GnmColor *auto_back = style_color_auto_back ();
GnmColor *auto_font = style_color_auto_font ();
int i;
memset (xfd, 0, sizeof *xfd);
......@@ -2256,7 +2256,7 @@ excel_write_XFs (ExcelWriteState *ewb)
TwoWayTable *twt = ewb->xf.two_way_table;
unsigned nxf = twt->idx_to_key->len;
unsigned i;
GnmMStyle *st;
GnmStyle *st;
/* it is more compact to just spew the default representations than
* to store a readable form, and generate the constant data.
......@@ -2806,7 +2806,7 @@ excel_write_margin (BiffPut *bp, guint16 op, double points)
* Utility
*/
static double
style_get_char_width (GnmMStyle const *style, gboolean is_default)
style_get_char_width (GnmStyle const *style, gboolean is_default)
{
return lookup_font_base_char_width (
mstyle_get_font_name (style), 20. * mstyle_get_font_size (style),
......@@ -2831,7 +2831,7 @@ excel_write_DEFCOLWIDTH (BiffPut *bp, ExcelWriteSheet *esheet)
guint8 *data;
guint16 width;
double def_font_width, width_chars;
GnmMStyle *def_style;
GnmStyle *def_style;
/* Use the 'Normal' Style which is by definition the 0th */
def_style = sheet_style_default (esheet->gnum_sheet);
......@@ -2862,7 +2862,7 @@ excel_write_COLINFO (BiffPut *bp, ExcelWriteSheet *esheet,
ColRowInfo const *ci, int last_index, guint16 xf_index)
{
guint8 *data;
GnmMStyle *style = two_way_table_idx_to_key (
GnmStyle *style = two_way_table_idx_to_key (
esheet->ewb->xf.two_way_table, xf_index);
double width_chars
= ci->size_pts / style_get_char_width (style, FALSE);
......@@ -3582,7 +3582,7 @@ static guint32
excel_sheet_write_block (ExcelWriteSheet *esheet, guint32 begin, int nrows,
GArray *dbcells)
{
GnmMStyle *mstyle;
GnmStyle *mstyle;
ExcelWriteState *ewb = esheet->ewb;
int max_col = esheet->max_col;
int col, row, max_row;
......
......@@ -20,9 +20,9 @@ typedef struct {
} ExcelSheetPair;
typedef struct {
/* Don't use GnmStyleFont. In the case where a font does not exist on the
* display system it does the wrong thing. GnmMStyle can contain an
* invalid font. GnmStyleFont gets remapped to the default
/* Don't use GnmFont. In the case where a font does not exist on the
* display system it does the wrong thing. GnmStyle can contain an
* invalid font. GnmFont gets remapped to the default
*/
guint32 color;
char const *font_name;
......@@ -41,7 +41,7 @@ typedef struct {
guint32 boundsheetPos;
gint32 max_col, max_row;
guint16 col_xf [SHEET_MAX_COLS];
GnmMStyle *col_style [SHEET_MAX_COLS];
GnmStyle *col_style [SHEET_MAX_COLS];
GnmStyleList *validations;
} ExcelWriteSheet;
......@@ -55,7 +55,7 @@ struct _ExcelWriteState {
struct {
TwoWayTable *two_way_table;
GnmMStyle *default_style;
GnmStyle *default_style;
} xf;
struct {
TwoWayTable *two_way_table;
......
......@@ -26,7 +26,7 @@
typedef struct _BiffXFData {
guint16 font_idx;
guint16 format_idx;
GnmStyleFormat *style_format;
GnmFormat *style_format;
gboolean hidden;
gboolean locked;
MsBiffXfType xftype; /* -- Very important field... */
......@@ -46,7 +46,7 @@ typedef struct _BiffXFData {
guint16 pat_backgnd_col;
guint16 differences;
GnmMStyle *mstyle;
GnmStyle *mstyle;
} BiffXFData;
#endif
......@@ -122,7 +122,7 @@ static const translate_t translate_table[] = {
};
static GnmValue *
translate_cell_format (GnmStyleFormat const *format)
translate_cell_format (GnmFormat const *format)
{
int i;
char *fmt;
......@@ -153,8 +153,8 @@ translate_cell_format (GnmStyleFormat const *format)
static FormatCharacteristics
retrieve_format_info (Sheet *sheet, int col, int row)
{
GnmMStyle *mstyle = sheet_style_get (sheet, col, row);
GnmStyleFormat *format = mstyle_get_format (mstyle);
GnmStyle *mstyle = sheet_style_get (sheet, col, row);
GnmFormat *format = mstyle_get_format (mstyle);
return format->family_info;
}
......@@ -244,7 +244,7 @@ gnumeric_cell (FunctionEvalInfo *ei, GnmValue **argv)
/* from CELL */
/* Backwards compatibility w/123 - unnecessary */
} else if (!g_ascii_strcasecmp (info_type, "format")) {
GnmMStyle const *mstyle =
GnmStyle const *mstyle =
sheet_style_get (ei->pos->sheet, ref->col, ref->row);
return translate_cell_format (mstyle_get_format (mstyle));
......@@ -263,7 +263,7 @@ gnumeric_cell (FunctionEvalInfo *ei, GnmValue **argv)