X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcairo.c;h=dc5cf94ca3cbf1115835b68d19bcd4993c4cce78;hb=672776c201a00e1a667d37a957e7d2211300d48a;hp=81aeddc15f4094b4ed88511605323b3007f1bd54;hpb=507ebaea36737618ef8265a60cd3e9005d9f3457;p=pspp diff --git a/src/output/cairo.c b/src/output/cairo.c index 81aeddc15f..dc5cf94ca3 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -607,13 +607,6 @@ xr_submit (struct output_driver *driver, const struct output_item *item) { struct xr_driver *xr = xr_driver_cast (driver); - if (item->type == OUTPUT_ITEM_PAGE_SETUP) - { - if (!xr->pager) - xr_update_page_setup (driver, item->page_setup); - return; - } - if (!xr->pager) { xr->pager = xr_pager_create (xr->page_style, xr->fsm_style); @@ -627,6 +620,15 @@ xr_submit (struct output_driver *driver, const struct output_item *item) xr_pager_add_page (xr->pager, cairo_create (xr->drawing_surface)); } } + +static void +xr_setup (struct output_driver *driver, const struct page_setup *ps) +{ + struct xr_driver *xr = xr_driver_cast (driver); + + if (!xr->pager) + xr_update_page_setup (driver, ps); +} struct output_driver_factory pdf_driver_factory = { "pdf", "pspp.pdf", xr_pdf_create }; @@ -642,5 +644,6 @@ static const struct output_driver_class cairo_driver_class = .name = "cairo", .destroy = xr_destroy, .submit = xr_submit, + .setup = xr_setup, .handles_groups = true, };