diff --git a/ChangeLog b/ChangeLog index 5f170e109b..2d587dc160 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-19 Sven Neumann + + * plug-ins/common/svg.c: fixed handling of librsvg API change, + based on a patch by S. Mukund (bug #314400). + 2005-12-18 Manish Singh * plug-ins/script-fu/siod-wrapper.c: Finish the reverting here. diff --git a/plug-ins/common/svg.c b/plug-ins/common/svg.c index 893ea259f3..0507c361ef 100644 --- a/plug-ins/common/svg.c +++ b/plug-ins/common/svg.c @@ -417,6 +417,25 @@ load_set_size_callback (gint *width, } } +static RsvgHandle * +load_rsvg_handle_new (gdouble xres, + gdouble yres) +{ + RsvgHandle *handle = rsvg_handle_new (); + +#if (((LIBRSVG_MAJOR_VERSION == 2) && (LIBRSVG_MINOR_VERSION == 13) && \ + ((LIBRSVG_MICRO_VERSION == 0) || \ + (LIBRSVG_MICRO_VERSION == 1) || \ + (LIBRSVG_MICRO_VERSION == 2))) || \ + ((LIBRSVG_MAJOR_VERSION == 2) && (LIBRSVG_MINOR_VERSION == 11) && \ + (LIBRSVG_MICRO_VERSION == 0))) + rsvg_handle_set_dpi (handle, xres, yres); +#else + rsvg_handle_set_dpi_x_y (handle, xres, yres); +#endif + + return handle; +} /* This function renders a pixbuf from an SVG file according to vals. */ static GdkPixbuf * @@ -436,13 +455,7 @@ load_rsvg_pixbuf (const gchar *filename, g_io_channel_set_encoding (io, NULL, NULL); - handle = rsvg_handle_new (); - -#if (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION < 99) - rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution); -#else - rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution); -#endif + handle = load_rsvg_handle_new (vals->resolution, vals->resolution); rsvg_handle_set_size_callback (handle, load_set_size_callback, vals, NULL); @@ -538,13 +551,7 @@ load_rsvg_size (const gchar *filename, g_io_channel_set_encoding (io, NULL, NULL); - handle = rsvg_handle_new (); - -#if (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION < 99) - rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution); -#else - rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution); -#endif + handle = load_rsvg_handle_new (vals->resolution, vals->resolution); rsvg_handle_set_size_callback (handle, load_get_size_callback, vals, NULL);