diff --git a/src/register/cellblock.c b/src/register/cellblock.c index 1aab75ed2e..8d2d06c08d 100644 --- a/src/register/cellblock.c +++ b/src/register/cellblock.c @@ -58,7 +58,6 @@ xaccMallocCellBlock (int numrows, int numcols) cellblock->right_traverse_c = NULL; cellblock->left_traverse_r = NULL; cellblock->left_traverse_c = NULL; - cellblock->widths = NULL; cellblock->alignments = NULL; xaccInitCellBlock (cellblock, numrows, numcols); @@ -127,10 +126,7 @@ FreeCellBlockMem (CellBlock *cellblock) cellblock->left_traverse_c = NULL; } - /* free widths, alignments */ - g_free (cellblock->widths); - cellblock->widths = NULL; - + /* free alignments */ g_free (cellblock->alignments); cellblock->alignments = NULL; } @@ -208,13 +204,10 @@ xaccInitCellBlock (CellBlock *cellblock, int numrows, int numcols) cellblock->last_left_reenter_traverse_row = 0; cellblock->last_left_reenter_traverse_col = 0; - cellblock->widths = g_new(short, numcols); cellblock->alignments = g_new(Alignments, numcols); - for (j = 0; j < numcols; j++) { - cellblock->widths[j] = 0; + for (j = 0; j < numcols; j++) cellblock->alignments[j] = ALIGN_RIGHT; - } } /* =================================================== */ diff --git a/src/register/cellblock.h b/src/register/cellblock.h index 5dc0a27673..ebf59dd9df 100644 --- a/src/register/cellblock.h +++ b/src/register/cellblock.h @@ -100,7 +100,6 @@ struct _CellBlock { guint32 passive_bg_color2; /* other attributes */ - short *widths; /* column widths */ Alignments *alignments; /* column text alignments */ short **right_traverse_r; diff --git a/src/register/gnome/gnucash-sheet.c b/src/register/gnome/gnucash-sheet.c index 0d59002bc4..424d587baf 100644 --- a/src/register/gnome/gnucash-sheet.c +++ b/src/register/gnome/gnucash-sheet.c @@ -778,7 +778,7 @@ compute_optimal_width (GnucashSheet *sheet) #endif style = sheet->cursor_style[GNUCASH_CURSOR_HEADER]; - if ((style == NULL) || (style->widths == NULL)) + if ((style == NULL) || (style->dimensions == NULL)) return DEFAULT_REGISTER_WIDTH; sheet->default_width = style->dimensions->width; diff --git a/src/register/gnome/gnucash-sheet.h b/src/register/gnome/gnucash-sheet.h index 9e95b9f73f..9f76d791c1 100644 --- a/src/register/gnome/gnucash-sheet.h +++ b/src/register/gnome/gnucash-sheet.h @@ -89,9 +89,6 @@ typedef struct gint reg_type; gint cursor_type; - /* this one comes from the cellblock */ - gint **widths; /* in characters */ - CellLayoutInfo *layout_info; CellDimensions *dimensions; diff --git a/src/register/gnome/gnucash-style.c b/src/register/gnome/gnucash-style.c index c9f559c9d0..76c192ad3d 100644 --- a/src/register/gnome/gnucash-style.c +++ b/src/register/gnome/gnucash-style.c @@ -1226,7 +1226,6 @@ gnucash_sheet_style_destroy (GnucashSheet *sheet, SheetBlockStyle *style) g_return_if_fail (style != NULL); for ( i = 0; i < style->nrows; i++) { - g_free(style->widths[i]); g_free(style->alignments[i]); g_free(style->fonts[i]); g_free(style->active_bg_color[i]); @@ -1237,7 +1236,6 @@ gnucash_sheet_style_destroy (GnucashSheet *sheet, SheetBlockStyle *style) g_free (style->borders[i]); } - g_free(style->widths); g_free(style->alignments); g_free(style->fonts); g_free(style->active_bg_color); @@ -1280,8 +1278,6 @@ gnucash_sheet_style_recompile(SheetBlockStyle *style, CellBlock *cellblock, for (j = 0; j < style->ncols; j++) { type = cellblock->cell_types[i][j]; - style->widths[i][j] = cellblock->widths[j]; - style->fonts[i][j] = NULL; style->header_font = gnucash_register_font; @@ -1383,8 +1379,7 @@ gnucash_sheet_style_compile (GnucashSheet *sheet, CellBlock *cellblock, g_return_val_if_fail (GNUCASH_IS_SHEET (sheet), NULL); g_return_val_if_fail (cellblock != NULL, NULL); - - sr = (SplitRegister *)sheet->split_register; + sr = sheet->split_register; style = g_new0(SheetBlockStyle, 1); @@ -1394,7 +1389,6 @@ gnucash_sheet_style_compile (GnucashSheet *sheet, CellBlock *cellblock, style->nrows = cellblock->numRows; style->ncols = cellblock->numCols; - style->widths = g_new0(gint *, style->nrows); style->alignments = g_new0 (GtkJustification *, style->nrows); style->fonts = g_new0 (GdkFont **, style->nrows); style->active_bg_color = g_new0 (GdkColor **, style->nrows); @@ -1403,7 +1397,6 @@ gnucash_sheet_style_compile (GnucashSheet *sheet, CellBlock *cellblock, style->borders = g_new0 (int *, style->nrows); for ( i = 0; i < style->nrows; i++) { - style->widths[i] = g_new0(gint, style->ncols); style->alignments[i] = g_new0 (GtkJustification, style->ncols); style->fonts[i] = g_new0 (GdkFont *, style->ncols); style->active_bg_color[i] = g_new0 (GdkColor *, style->ncols); diff --git a/src/register/splitreg.c b/src/register/splitreg.c index e06a5e08e9..1fd5571fd6 100644 --- a/src/register/splitreg.c +++ b/src/register/splitreg.c @@ -103,26 +103,6 @@ static SplitRegisterColors reg_colors = { 0xffffff /* white, header color */ }; - -#define DATE_CELL_WIDTH 11 -#define NUM_CELL_WIDTH 7 -#define ACTN_CELL_WIDTH 7 -#define XFRM_CELL_WIDTH 14 -#define MXFRM_CELL_WIDTH 14 -#define XTO_CELL_WIDTH 14 -#define DESC_CELL_WIDTH 29 -#define MEMO_CELL_WIDTH 29 -#define RECN_CELL_WIDTH 1 -#define DEBT_CELL_WIDTH 12 -#define CRED_CELL_WIDTH 12 -#define NDEBT_CELL_WIDTH 12 -#define NCRED_CELL_WIDTH 12 -#define PRIC_CELL_WIDTH 9 -#define VALU_CELL_WIDTH 10 -#define SHRS_CELL_WIDTH 10 -#define BALN_CELL_WIDTH 12 - - #define DATE_CELL_ALIGN ALIGN_RIGHT #define NUM_CELL_ALIGN ALIGN_LEFT #define ACTN_CELL_ALIGN ALIGN_LEFT @@ -321,9 +301,7 @@ configAction (SplitRegister *reg) if ((0<=row) && (0<=col)) { \ curs->cells [row][col] = (handler); \ curs->cell_types[row][col] = NAME##_CELL; \ - header->widths[col] = NAME##_CELL_WIDTH; \ header->alignments[col] = NAME##_CELL_ALIGN; \ - curs->widths[col] = NAME##_CELL_WIDTH; \ curs->alignments[col] = NAME##_CELL_ALIGN; \ if (hcell) { \ if (row < reg->num_header_rows) { \