Exemple #1
0
/**
 * rows_height_update:
 * @sheet:  The sheet,
 * @range:  The range whose rows should be resized.
 * @shrink: If set to FALSE, rows will never shrink!
 *
 * Use this function having changed the font size to auto
 * resize the row heights to make the text fit nicely.
 **/
void
rows_height_update (Sheet *sheet, GnmRange const * range, gboolean shrink)
{
	/* FIXME : this needs to check font sizes and contents rather than
	 * just contents.  Empty cells will cause resize also */
	colrow_autofit (sheet, range, FALSE, FALSE,
			FALSE, !shrink,
			NULL, NULL);
}
Exemple #2
0
void
colrow_autofit_col (Sheet *sheet, GnmRange *r)
{
	colrow_autofit (sheet, r, TRUE, TRUE,
			TRUE, FALSE, NULL, NULL);
	sheet_foreach_cell_in_range (sheet, CELL_ITER_IGNORE_BLANK,
				     r->start.col, 0,
				     r->end.col, gnm_sheet_get_last_row (sheet),
				     (CellIterFunc) &cb_clear_variable_width_content,
				     NULL);
}
Exemple #3
0
static void
resize_columns (Sheet *sheet)
{
	GnmRange r;

	if (gnm_debug_flag ("stf"))
		g_printerr ("Auto-fitting columns...\n");

	/* If we have lots of rows, auto-fitting will take a very long
	   time.  It is probably better to look at only, say, 1000 rows
	   of data.  */
	range_init_full_sheet (&r, sheet);
	r.end.row = MIN (r.end.row, 1000);

	colrow_autofit (sheet, &r, TRUE,
			TRUE, /* Ignore strings */
			TRUE, /* Don't shrink */
			TRUE, /* Don't shrink */
			NULL, NULL);
	if (gnm_debug_flag ("stf"))
		g_printerr ("Auto-fitting columns...  done\n");

	sheet_queue_respan (sheet, 0, gnm_sheet_get_last_row (sheet));
}
Exemple #4
0
void
colrow_autofit_row (Sheet *sheet, GnmRange *r)
{
	colrow_autofit (sheet, r, FALSE, FALSE,
			TRUE, FALSE, NULL, NULL);
}