~ubuntu-branches/ubuntu/feisty/gnumeric/feisty-updates

« back to all changes in this revision

Viewing changes to src/rendered-value.c

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2006-11-14 14:02:03 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061114140203-iv3j2aii3vch6isl
Tags: 1.7.2-1ubuntu1
* Merge with debian experimental:
  - debian/control, debian/*-gtk-*, debian/rules,
    debian/shlibs.local: Xubuntu changes for
    gtk/gnome multibuild.
  - run intltool-update in po*
  - Build Depend on intltool

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
#include <string.h>
41
41
#include <goffice/utils/go-glib-extras.h>
 
42
#include <goffice/utils/go-font.h>
42
43
 
43
44
#undef DEBUG_BOUNDING_BOX
44
45
 
66
67
                int n = gnm_style_get_indent (mstyle);
67
68
                if (n) {
68
69
                        GnmFont *style_font = gnm_style_get_font (mstyle, context, zoom);
69
 
                        indent = PANGO_PIXELS (n * style_font->metrics->avg_digit_width);
 
70
                        indent = PANGO_PIXELS (n * style_font->go.metrics->avg_digit_width);
70
71
                }
71
72
        }
72
73
        return MIN (indent, 65535);
186
187
        g_return_val_if_fail (cell->value != NULL, NULL);
187
188
        g_return_val_if_fail (context != NULL, NULL);
188
189
 
189
 
        /* Sheet can be NULL when called from preview-grid.c  */
 
190
        /* sheet->workbook can be NULL when called from preview-grid.c  */
190
191
        sheet = cell->base.sheet;
191
192
 
192
193
        displayed_formula =
193
 
                cell_has_expr (cell) && sheet && sheet->display_formulas;
 
194
                cell_has_expr (cell) && sheet->display_formulas;
194
195
 
195
196
        /* Special handling for manual recalc.
196
197
         * If a cell has a new expression and something tries to display it we
333
334
                g_string_free (str, TRUE);
334
335
                fore = 0;
335
336
                res->might_overflow = FALSE;
336
 
        } else if (sheet && sheet->hide_zero && cell_is_zero (cell)) {
 
337
        } else if (sheet->hide_zero && cell_is_zero (cell)) {
337
338
                pango_layout_set_text (layout, "", 0);
338
339
                fore = 0;
339
340
                res->might_overflow = FALSE;
340
341
        } else {
341
342
                int col_width = -1;
342
343
                GOFormat *format = gnm_style_get_format (mstyle);
343
 
                GODateConventions const *date_conv = sheet
 
344
                GODateConventions const *date_conv = sheet->workbook
344
345
                        ? workbook_date_conv (sheet->workbook)
345
346
                        : NULL;
346
347
                GnmFont *font = gnm_style_get_font (mstyle, context, zoom);
370
371
                                col_width_pixels = sheet_col_get_distance_pixels
371
372
                                        (sheet,
372
373
                                         merged->start.col, merged->end.col + 1);
373
 
                        } else
374
 
                                col_width_pixels = cell->col_info->size_pixels;
375
 
                        /* This probably isn't right for the merged case */
376
 
                        col_width_pixels -= (cell->col_info->margin_a +
377
 
                                             cell->col_info->margin_b +
378
 
                                             1);
 
374
                        } else {
 
375
                                ColRowInfo const *ci = sheet_col_get_info (sheet, cell->pos.col);
 
376
                                col_width_pixels = ci->size_pixels;
 
377
                        }
 
378
                        col_width_pixels -= (GNM_COL_MARGIN + GNM_COL_MARGIN + 1);
379
379
                        col_width = col_width_pixels * PANGO_SCALE;
380
380
                }
381
381
 
382
 
                gnm_format_layout (layout, font->metrics, format, cell->value,
 
382
                gnm_format_layout (layout, font->go.metrics, format, cell->value,
383
383
                                   &fore, col_width, date_conv, TRUE);
384
384
        }
385
385
 
472
472
 
473
473
/* Return the value as a single string without format infomation.
474
474
 */
475
 
const char *
 
475
char const *
476
476
rendered_value_get_text (RenderedValue const *rv)
477
477
{
478
478
        g_return_val_if_fail (rv != NULL, "ERROR");