Kaydet (Commit) 49b5c067 authored tarafından Enrico Tröger's avatar Enrico Tröger

Allow an empty value for the date format in the print settings to omit the…

Allow an empty value for the date format in the print settings to omit the date/time string in the print header.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3599 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 38185ff6
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
not the current one). This should speed up file saving a little bit, not the current one). This should speed up file saving a little bit,
especially with remote files. especially with remote files.
Remove now unnecessary calls to tm_workspace_update(). Remove now unnecessary calls to tm_workspace_update().
* src/printing.c:
Allow an empty value for the date format in the print settings to
omit the date/time string in the print header.
2009-02-20 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> 2009-02-20 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
......
...@@ -275,12 +275,15 @@ static void add_page_header(PangoLayout *layout, cairo_t *cr, DocInfo *dinfo, gi ...@@ -275,12 +275,15 @@ static void add_page_header(PangoLayout *layout, cairo_t *cr, DocInfo *dinfo, gi
g_free(data); g_free(data);
datetime = utils_get_date_time(printing_prefs.page_header_datefmt, &(dinfo->print_time)); datetime = utils_get_date_time(printing_prefs.page_header_datefmt, &(dinfo->print_time));
data = g_strdup_printf("<b>%s</b>", datetime); if (NZV(datetime))
pango_layout_set_markup(layout, data, -1); {
pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT); data = g_strdup_printf("<b>%s</b>", datetime);
cairo_move_to(cr, 2, dinfo->line_height * 1.5); pango_layout_set_markup(layout, data, -1);
pango_cairo_show_layout(cr, layout); pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT);
g_free(data); cairo_move_to(cr, 2, dinfo->line_height * 1.5);
pango_cairo_show_layout(cr, layout);
g_free(data);
}
g_free(datetime); g_free(datetime);
/* reset layout and re-position cairo context */ /* reset layout and re-position cairo context */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment