X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fprint-op.c;h=e7a964801c295f407daa38f29c7e73a9fdc0469c;hb=98d8954fffe00c2f48dc30d9191c0c9c27e7dba9;hp=2c78f488978042944b1382ba6cb22bfd031e2335;hpb=39f4c44e000d410b4f63ab1fcdc4b04273ff0a83;p=glabels diff --git a/src/print-op.c b/src/print-op.c index 2c78f488..e7a96480 100644 --- a/src/print-op.c +++ b/src/print-op.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include "print.h" #include "label.h" @@ -106,7 +106,7 @@ static void draw_page_cb (GtkPrintOperation *operation, /*****************************************************************************/ /* Boilerplate object stuff. */ /*****************************************************************************/ -G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION); +G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION) static void @@ -183,13 +183,15 @@ gl_print_op_construct (glPrintOp *op, glLabel *label) { glMerge *merge = NULL; + const lglTemplate *template; const lglTemplateFrame *frame; op->priv->label = label; op->priv->force_outline_flag = FALSE; - merge = gl_label_get_merge (label); - frame = (lglTemplateFrame *)label->template->frames->data; + merge = gl_label_get_merge (label); + template = gl_label_get_template (label); + frame = (lglTemplateFrame *)template->frames->data; op->priv->merge_flag = (merge != NULL); op->priv->n_sheets = 1; @@ -385,13 +387,15 @@ static void set_page_size (glPrintOp *op, glLabel *label) { - GtkPaperSize *psize; - GtkPageSetup *su; - lglPaper *paper; + const lglTemplate *template; + GtkPaperSize *psize; + GtkPageSetup *su; + lglPaper *paper; gl_debug (DEBUG_PRINT, "begin"); - paper = lgl_db_lookup_paper_from_id (label->template->paper_id); + template = gl_label_get_template (label); + paper = lgl_db_lookup_paper_from_id (template->paper_id); if (!paper) { @@ -406,12 +410,12 @@ set_page_size (glPrintOp *op, { psize = gtk_paper_size_new_custom (paper->id, paper->name, - label->template->page_width, - label->template->page_height, + template->page_width, + template->page_height, GTK_UNIT_POINTS); gl_debug (DEBUG_PRINT, "Using custom size = %g x %g points", - label->template->page_width, - label->template->page_height); + template->page_width, + template->page_height); } else