From 3e075e587aaa712efb1704478cd1a75131882889 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 2 Oct 2017 23:30:11 +0200 Subject: third batch --- src/extension/internal/gdkpixbuf-input.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/extension/internal/gdkpixbuf-input.cpp') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index e0dc90981..7af7927f2 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include #include @@ -163,14 +165,9 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) void GdkpixbufInput::init(void) { - GSList * formatlist, * formatlisthead; - - /* \todo I'm not sure if I need to free this list */ - for (formatlist = formatlisthead = gdk_pixbuf_get_formats(); - formatlist != NULL; - formatlist = g_slist_next(formatlist)) { - - GdkPixbufFormat *pixformat = (GdkPixbufFormat *)formatlist->data; + static std::vector< Gdk::PixbufFormat > formatlist = Gdk::Pixbuf::get_formats(); + for (auto i: formatlist) { + GdkPixbufFormat *pixformat = i.gobj(); gchar *name = gdk_pixbuf_format_get_name(pixformat); gchar *description = gdk_pixbuf_format_get_description(pixformat); @@ -240,8 +237,6 @@ GdkpixbufInput::init(void) g_strfreev(mimetypes); g_strfreev(extensions); } - - g_slist_free(formatlisthead); } } } } /* namespace Inkscape, Extension, Implementation */ -- cgit v1.2.3 From 8ef37560aeca3d38db6603ca573929b19ea90105 Mon Sep 17 00:00:00 2001 From: Jan Lingscheid Date: Mon, 16 Oct 2017 13:28:28 +0200 Subject: Replace boost::scoped_ptr This replaces all usage of boost::scoped_ptr with std::unique_ptr. Also removes the corresponding includes. --- src/extension/internal/gdkpixbuf-input.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/extension/internal/gdkpixbuf-input.cpp') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 7af7927f2..26e6531dd 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include #include "dir-util.h" @@ -65,7 +64,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) bool embed = ( link.compare( "embed" ) == 0 ); SPDocument *doc = NULL; - boost::scoped_ptr pb(Inkscape::Pixbuf::create_from_file(uri)); + std::unique_ptr pb(Inkscape::Pixbuf::create_from_file(uri)); // TODO: the pixbuf is created again from the base64-encoded attribute in SPImage. // Find a way to create the pixbuf only once. -- cgit v1.2.3