dia r4268 - in trunk: . lib plug-ins/svg
- From: hans svn gnome org
- To: svn-commits-list gnome org
- Subject: dia r4268 - in trunk: . lib plug-ins/svg
- Date: Sat, 7 Feb 2009 22:53:26 +0000 (UTC)
Author: hans
Date: Sat Feb 7 22:53:26 2009
New Revision: 4268
URL: http://svn.gnome.org/viewvc/dia?rev=4268&view=rev
Log:
2009-02-07 Hans Breuer <hans breuer org>
* lib/dia_svg.c : map special svg font name "sanserif" to special
dia font name "sans"
* lib/dia_image.c(dia_image_get_broken) : was broken
* plug-ins/svg/svg-import.c : don't try to create_standard_image() with
fileanme==NULL, rather set an invalid name. Better than crashing on
<svg:image data="..."/>
* lib/libdia.def : s/dia_image_release/dia_image_unref/
Modified:
trunk/ChangeLog
trunk/lib/dia_image.c
trunk/lib/dia_svg.c
trunk/lib/libdia.def
trunk/plug-ins/svg/svg-import.c
Modified: trunk/lib/dia_image.c
==============================================================================
--- trunk/lib/dia_image.c (original)
+++ trunk/lib/dia_image.c Sat Feb 7 22:53:26 2009
@@ -126,20 +126,21 @@
DiaImage *
dia_image_get_broken(void)
{
- static DiaImage *broken = NULL;
+ static GdkPixbuf *broken = NULL;
+ DiaImage *image;
+ image = DIA_IMAGE(g_object_new(DIA_TYPE_IMAGE, NULL));
if (broken == NULL) {
- broken = DIA_IMAGE(g_object_new(DIA_TYPE_IMAGE, NULL));
- broken->image = gdk_pixbuf_new_from_inline(-1, dia_broken_icon, FALSE, NULL);
- } else {
- gdk_pixbuf_ref(broken->image);
+ /* initial refernce will finally be leaked */
+ broken = gdk_pixbuf_new_from_inline(-1, dia_broken_icon, FALSE, NULL);
}
+ image->image = g_object_ref (broken);
/* Kinda hard to export :) */
- broken->filename = g_strdup("broken");
+ image->filename = g_strdup("<broken>");
#ifdef SCALING_CACHE
- broken->scaled = NULL;
+ image->scaled = NULL;
#endif
- return broken;
+ return image;
}
/** Load an image from file.
Modified: trunk/lib/dia_svg.c
==============================================================================
--- trunk/lib/dia_svg.c (original)
+++ trunk/lib/dia_svg.c Sat Feb 7 22:53:26 2009
@@ -171,7 +171,12 @@
}
temp[i] = '\0';
- if (!over) family = g_strdup(temp);
+ if (!over) {
+ if (strcmp (temp, "sanserif") == 0)
+ family = g_strdup ("sans"); /* special name adaption */
+ else
+ family = g_strdup(temp);
+ }
} else if (!strncmp("font-weight:", ptr, 12)) {
ptr += 12;
while ((ptr[0] != '\0') && g_ascii_isspace(ptr[0])) ptr++;
Modified: trunk/lib/libdia.def
==============================================================================
--- trunk/lib/libdia.def (original)
+++ trunk/lib/libdia.def Sat Feb 7 22:53:26 2009
@@ -253,7 +253,7 @@
dia_image_height
dia_image_load
dia_image_mask_data
- dia_image_release
+ dia_image_unref
dia_image_rgb_data
dia_image_rgba_data
dia_image_rowstride
Modified: trunk/plug-ins/svg/svg-import.c
==============================================================================
--- trunk/plug-ins/svg/svg-import.c (original)
+++ trunk/plug-ins/svg/svg-import.c Sat Feb 7 22:53:26 2009
@@ -704,7 +704,7 @@
filename = g_filename_from_uri((gchar *) str, NULL, NULL);
xmlFree(str);
}
- new_obj = create_standard_image(x, y, width, height, filename);
+ new_obj = create_standard_image(x, y, width, height, filename ? filename : "<broken>");
g_free(filename);
return g_list_append (list, new_obj);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]