mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix cell layout bug.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3016 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
980e7386e8
commit
76b4649d32
@ -74,6 +74,7 @@ cell_dimensions_new (gpointer user_data)
|
||||
cd = g_new0 (CellDimensions, 1);
|
||||
|
||||
cd->pixel_width = -1;
|
||||
cd->can_span_over = TRUE;
|
||||
|
||||
return cd;
|
||||
}
|
||||
@ -190,12 +191,17 @@ set_dimensions_pass_one (GnucashSheet *sheet, CellBlock *cursor,
|
||||
cd = g_table_index (dimensions->cell_dimensions,
|
||||
row, col);
|
||||
|
||||
cd->pixel_height = (font->ascent + font->descent +
|
||||
(2 * CELL_VPADDING));
|
||||
|
||||
cb_cell = gnc_cellblock_get_cell (cursor, row, col);
|
||||
|
||||
text = cb_cell->sample_text;
|
||||
if (text != NULL)
|
||||
cd->can_span_over = FALSE;
|
||||
|
||||
if (cd->pixel_width > 0)
|
||||
width = cd->pixel_width;
|
||||
continue;
|
||||
else if (text)
|
||||
{
|
||||
width = gdk_string_width (font, text);
|
||||
@ -205,9 +211,6 @@ set_dimensions_pass_one (GnucashSheet *sheet, CellBlock *cursor,
|
||||
width = 0;
|
||||
|
||||
cd->pixel_width = width;
|
||||
|
||||
cd->pixel_height = (font->ascent + font->descent +
|
||||
(2 * CELL_VPADDING));
|
||||
}
|
||||
|
||||
cd = g_table_index (dimensions->cell_dimensions, row, 0);
|
||||
@ -315,6 +318,9 @@ set_dimensions_pass_two (GnucashSheet *sheet, int default_width)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!cd->can_span_over)
|
||||
continue;
|
||||
|
||||
if (cd_span == NULL)
|
||||
continue;
|
||||
|
||||
|
@ -40,6 +40,8 @@ typedef struct
|
||||
|
||||
gint origin_x;
|
||||
gint origin_y;
|
||||
|
||||
gboolean can_span_over;
|
||||
} CellDimensions;
|
||||
|
||||
typedef struct
|
||||
|
Loading…
Reference in New Issue
Block a user