• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revision3a03fdd1aca8dea0157d7d096f31613377acfd31 (tree)
Zeit2007-03-29 19:23:40
AutorLars Clausen <lclausen@src....>
CommiterLars Clausen

Log Message

Version 0.96.1

svn path=/branches/dia_0_96/; revision=3657

Ändern Zusammenfassung

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,30 @@
1-2007-03-26 Hans Breuer <hans@breuer.org>
1+2007-03-29 Lars Clausen <lars@raeder.dk>
22
3- * bindings/* : dia/lib bindings with the help of SWIG, for details
4- see: http://mail.gnome.org/archives/dia-list/2007-March/msg00092.html
3+ * NEWS:
4+ * RELEASE-PROCESS:
5+ * config.h.win32:
6+ * doc/en/dia.xml:
7+ * doc/pl/dia.xml:
8+ * doc/eu/dia.xml:
9+ * configure.in: Release 0.96.1 is a brown-bag release for empty
10+ initial line problem in shapes, and a couple other bugs.
11+
12+ * app/diapsrenderer.c (draw_text_line): Use language-independent
13+ float conversion in new text rendering code. Fixes bug #424052.
14+
15+ * plug-ins/vdx/vdx-import.c: Updated to version 0.9.4 to fix shape
16+ problems and text errors. Fixes bug #417956.
17+
18+ * lib/text.c (text_key_event): Treat keypad enter like return.
19+ Fixes bug #423480.
20+
21+ * plug-ins/dxf/dxf-import.c: Load closed polyline as polygon,
22+ patch from Ben Abbott fixes font height problems. Fixes bug #421250.
23+
24+2007-03-28 Lars Clausen <lars@raeder.dk>
25+
26+ * objects/custom/custom_object.c (custom_update_data): Use newer
27+ way to get text ascent. Fixes bug #423351.
528
629 2007-03-25 Lars Clausen <lars@raeder.dk>
730
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
1+dia-0.96.1: 29-Mar-2007
2+
3+ * Brown-bag release with five bugfixes, one of them critical: Empty
4+ initial lines in shapes crashes Dia (#421250).
5+
16 dia-0.96: 25-Mar-2007
27
38 * Final release of 0.96.
--- a/app/diapsrenderer.c
+++ b/app/diapsrenderer.c
@@ -719,6 +719,7 @@ draw_text_line(DiaRenderer *self,
719719 gchar *text = text_line_get_string(text_line);
720720 int n_chars = g_utf8_strlen(text, -1);
721721 real adjust;
722+ gchar sw_buf[DTOSTR_BUF_SIZE];
722723
723724 if (1 > n_chars)
724725 return;
@@ -743,7 +744,8 @@ draw_text_line(DiaRenderer *self,
743744 width = text_line_get_width(text_line);
744745
745746 /* Find the difference in length */
746- fprintf(renderer->file, "dup sw %f exch sub \n", width);
747+ fprintf(renderer->file, "dup sw %s exch sub \n",
748+ psrenderer_dtostr(sw_buf, (gdouble) width));
747749
748750 /* Divide by number of chars and set up for ashow */
749751 fprintf(renderer->file, "%d div exch 0.0 exch \n", n_chars);
--- a/config.h.win32
+++ b/config.h.win32
@@ -18,7 +18,7 @@
1818 #undef LOCALEDIR /* needs to be calculated at runtime */
1919 /* NOT: #define LOCALEDIR "../lib/locale" */
2020
21-#define VERSION "0.96"
21+#define VERSION "0.96.1"
2222
2323 /*
2424 * We are linking libxml as DLL with either msvc or mingw, but this
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
11 dnl Process this -*- autoconf -*- file with autoconf to produce a
22 dnl configure script.
3-AC_INIT(dia, 0.96, http://bugzilla.gnome.org/enter_bug.cgi?product=dia)
3+AC_INIT(dia, 0.96.1, http://bugzilla.gnome.org/enter_bug.cgi?product=dia)
44 AC_CONFIG_SRCDIR(app/diagram.c)
55 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
66
--- a/doc/en/dia.xml
+++ b/doc/en/dia.xml
@@ -8,7 +8,7 @@
88
99 [
1010
11- <!ENTITY VERSION "0.96">
11+ <!ENTITY VERSION "0.96.1">
1212
1313 <!ENTITY INTRODUCTION SYSTEM "intro.xml">
1414
--- a/doc/eu/dia.xml
+++ b/doc/eu/dia.xml
@@ -4,7 +4,7 @@
44
55 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd" [
66
7- <!ENTITY VERSION "0.96">
7+ <!ENTITY VERSION "0.96.1">
88
99 <!ENTITY INTRODUCTION SYSTEM "intro.xml">
1010
--- a/doc/pl/dia.xml
+++ b/doc/pl/dia.xml
@@ -1,7 +1,7 @@
11 <?xml version="1.0" encoding="iso-8859-1"?>
22
33 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd"[
4-<!ENTITY VERSION "0.96">
4+<!ENTITY VERSION "0.96.1">
55 <!ENTITY INTRODUCTION SYSTEM "intro.xml">
66 <!ENTITY QUICKSTART SYSTEM "usage-quickstart.xml">
77 <!ENTITY CANVAS SYSTEM "usage-canvas.xml">
--- a/lib/text.c
+++ b/lib/text.c
@@ -884,6 +884,7 @@ text_key_event(Focus *focus, guint keyval, const gchar *str, int strlen,
884884 text_delete_backward(text);
885885 break;
886886 case GDK_Return:
887+ case GDK_KP_Enter:
887888 return_val = TRUE;
888889 *change = text_create_change(text, TYPE_SPLIT_ROW, 'Q',
889890 text->cursor_pos, text->cursor_row);
--- a/plug-ins/dxf/dxf-import.c
+++ b/plug-ins/dxf/dxf-import.c
@@ -552,10 +552,7 @@ DiaObject *read_entity_polyline_dxf(FILE *filedxf, DxfData *data, DiagramData *d
552552
553553 if( closed )
554554 {
555- ++points;
556- p = g_realloc( p, sizeof( Point ) * points );
557- p[points-1].x = p[0].x;
558- p[points-1].y = p[0].y;
555+ otype = object_get_type("Standard - Polygon");
559556 }
560557
561558 pcd->num_points = points;
@@ -941,7 +938,7 @@ DiaObject *read_entity_text_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
941938 height = atof(data->value) * coord_scale * measure_scale;
942939 /*printf( "text height %f\n", height );*/
943940 break;
944- case 62:
941+ case 62:
945942 colour = atoi(data->value);
946943 text_colour.red = acad_pal[colour].r / 255.0;
947944 text_colour.green = acad_pal[colour].g / 255.0;
@@ -994,7 +991,7 @@ DiaObject *read_entity_text_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
994991 } while(codedxf != 0);
995992 setlocale(LC_NUMERIC,old_locale);
996993
997- location.y += y_offset * height;
994+ location.y += y_offset * height;
998995
999996 text_obj = otype->ops->create(&location, otype->default_user_data,
1000997 &h1, &h2);
@@ -1010,6 +1007,7 @@ DiaObject *read_entity_text_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
10101007 tprop->attr.position.y = location.y;
10111008
10121009 attributes_get_default_font(&tprop->attr.font, &tprop->attr.height);
1010+ tprop->attr.height = height;
10131011 tprop->attr.color = text_colour;
10141012
10151013 text_obj->ops->set_props(text_obj, props);
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -97,7 +97,11 @@ create_standard_line(Point *points,
9797 &h1, &h2);
9898
9999 props = prop_list_from_descs(vdx_line_prop_descs, pdtpp_true);
100- g_assert(props->len == 4);
100+ if (props->len != 4)
101+ {
102+ g_debug("create_standard_line() - props->len != 4");
103+ return 0;
104+ }
101105
102106 ptprop = g_ptr_array_index(props,0);
103107 ptprop->point_data = points[0];
@@ -216,8 +220,12 @@ vdx_parse_color(const char *s, const VDXDocument *theDoc)
216220 if (theDoc->Colors && i < theDoc->Colors->len)
217221 return g_array_index(theDoc->Colors, Color, i);
218222 }
219- message_warning(_("Couldn't read color: %s\n"), s);
220- g_debug("Couldn't read color: %s", s);
223+ /* Colour 0 is always black, so don't warn (OmniGraffle) */
224+ if (*s != '0')
225+ {
226+ message_warning(_("Couldn't read color: %s\n"), s);
227+ g_debug("Couldn't read color: %s", s);
228+ }
221229 return c;
222230 }
223231
@@ -381,7 +389,13 @@ find_child(unsigned int type, const void *p)
381389 {
382390 struct vdx_any *Any = (struct vdx_any *)p;
383391 GSList *child;
384- g_assert(p);
392+
393+ if (!p)
394+ {
395+ g_debug("find_child called with p=0");
396+ return 0;
397+ }
398+
385399 for(child = Any->children; child; child = child->next)
386400 {
387401 struct vdx_any *Any_child = (struct vdx_any *)child->data;
@@ -403,7 +417,12 @@ find_child_next(unsigned int type, const void *p, const void *given)
403417 struct vdx_any *Any = (struct vdx_any *)p;
404418 GSList *child;
405419 gboolean found_given = FALSE;
406- g_assert(p);
420+
421+ if (!p)
422+ {
423+ g_debug("find_child_next() called with p=0");
424+ return 0;
425+ }
407426 for(child = Any->children; child; child = child->next)
408427 {
409428 struct vdx_any *Any_child = (struct vdx_any *)child->data;
@@ -448,14 +467,17 @@ get_style_child(unsigned int type, unsigned int style, VDXDocument* theDoc)
448467 {
449468 struct vdx_StyleSheet theSheet;
450469 struct vdx_any *Any;
451- if (!theDoc->StyleSheets)
452- {
453- g_debug("Unknown stylesheet reference");
454- return 0;
455- }
456470 while(1)
457471 {
458- g_assert(theDoc->StyleSheets && style < theDoc->StyleSheets->len);
472+ if (!theDoc->StyleSheets || style >= theDoc->StyleSheets->len)
473+ {
474+ /* Ignore style 0 for OmniGraffle */
475+ if (style)
476+ {
477+ g_debug("Unknown stylesheet reference: %d", style);
478+ }
479+ return 0;
480+ }
459481 theSheet = g_array_index(theDoc->StyleSheets,
460482 struct vdx_StyleSheet, style);
461483 Any = find_child(type, &theSheet);
@@ -486,7 +508,12 @@ get_shape_by_id(unsigned int id, struct vdx_Shapes *Shapes, unsigned int depth)
486508 struct vdx_Shape *Shape;
487509 struct vdx_Shapes *SubShapes;
488510 GSList *child;
489- g_assert(Shapes);
511+
512+ if (!Shapes)
513+ {
514+ g_debug("get_shape_by_id() called with Shapes=0");
515+ return 0;
516+ }
490517
491518 /* A Master has a list of Shapes */
492519 for(child = Shapes->children; child; child = child->next)
@@ -529,7 +556,12 @@ get_master_shape(unsigned int master, unsigned int shape, VDXDocument* theDoc)
529556 struct vdx_Master theMaster;
530557 struct vdx_Shapes *Shapes;
531558
532- g_assert(master < theDoc->Masters->len);
559+ if (!theDoc->Masters || master >= theDoc->Masters->len)
560+ {
561+ g_debug("Unknown master reference");
562+ return 0;
563+ }
564+
533565 if (theDoc->debug_comments)
534566 g_debug("Looking for Master %d Shape %d", master, shape);
535567 theMaster = g_array_index(theDoc->Masters,
@@ -586,7 +618,11 @@ vdx_simple_properties(DiaObject *obj,
586618 ColorProperty *cprop = 0;
587619 unsigned int debug_id;
588620
589- g_assert(props->len == 2);
621+ if (props->len != 2)
622+ {
623+ g_debug("vdx_simple_properties() - props->len != 4");
624+ return;
625+ }
590626
591627 if (Line)
592628 {
@@ -711,6 +747,12 @@ apply_XForm(Point p, const struct vdx_XForm *XForm)
711747 double sin_theta, cos_theta;
712748
713749 /* Remove the offset of the rotation pin from the object */
750+ if (!XForm)
751+ {
752+ g_debug("apply_XForm() called with XForm=0");
753+ return q;
754+ }
755+
714756 q.x -= XForm->LocPinX;
715757 q.y -= XForm->LocPinY;
716758
@@ -771,6 +813,11 @@ make_arrow(const struct vdx_Line *Line, char start_end,
771813 double size = 0;
772814 unsigned int type = 0;
773815
816+ if (!Line)
817+ {
818+ g_debug("make_arrow() called with Line=0");
819+ return 0;
820+ }
774821 a->type = ARROW_FILLED_TRIANGLE;
775822
776823 if (start_end == 's')
@@ -823,17 +870,18 @@ plot_polyline(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
823870 struct vdx_ArcTo *ArcTo;
824871 struct vdx_any *Any;
825872 Point *points, p;
826- unsigned int num_points = 0;
873+ unsigned int num_points = 1;
827874 unsigned int count = 0;
828875 Arrow* start_arrow_p = NULL;
829876 Arrow* end_arrow_p = NULL;
830877 gboolean done = FALSE;
831878
832879 if (theDoc->debug_comments) g_debug("plot_polyline()");
833- if ((Geom->NoFill || (Fill && !Fill->FillPattern)) &&
834- (Geom->NoLine || (Line && !Line->LinePattern)))
880+ if (!Geom || ((Geom->NoFill || (Fill && !Fill->FillPattern)) &&
881+ (Geom->NoLine || (Line && !Line->LinePattern))))
835882 {
836883 *more = 0;
884+ if (theDoc->debug_comments) g_debug("Nothing to plot");
837885 return 0;
838886 }
839887
@@ -854,6 +902,12 @@ plot_polyline(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
854902 LineTo = (struct vdx_LineTo*)(item->data);
855903 if (LineTo->Del) continue;
856904 p.x = LineTo->X; p.y = LineTo->Y;
905+ if (!count)
906+ {
907+ /* Use current as start point */
908+ points[count++] =
909+ dia_point(apply_XForm(*current, XForm), theDoc);
910+ }
857911 break;
858912 case vdx_types_MoveTo:
859913 MoveTo = (struct vdx_MoveTo*)(item->data);
@@ -867,11 +921,6 @@ plot_polyline(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
867921 done = TRUE;
868922 break;
869923 }
870- else
871- {
872- num_points--;
873- continue;
874- }
875924 }
876925 break;
877926 default:
@@ -908,7 +957,8 @@ plot_polyline(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
908957
909958 if (count > 2)
910959 {
911- if (Geom->NoFill)
960+ /* If we had to break the Geom partway, it's not a polygon */
961+ if (Geom->NoFill || done)
912962 {
913963 /* Yes, it is end_arrow followed by start_arrow */
914964 newobj = create_standard_polyline(count, points,
@@ -928,6 +978,7 @@ plot_polyline(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
928978 }
929979 else
930980 {
981+ /* Don't plot lines with only one point */
931982 if (theDoc->debug_comments)
932983 g_debug("Empty polyline");
933984 }
@@ -1017,6 +1068,12 @@ arc_to_ellipticalarc(struct vdx_ArcTo *ArcTo, const Point *Start,
10171068 Point perp;
10181069 double length;
10191070
1071+ if (!EllipticalArcTo || !ArcTo || !Start)
1072+ {
1073+ g_debug("arc_to_ellipticalarc() called with null parameters");
1074+ return FALSE;
1075+ }
1076+
10201077 EllipticalArcTo->type = vdx_types_EllipticalArcTo;
10211078 EllipticalArcTo->children = 0;
10221079
@@ -1082,6 +1139,12 @@ ellipticalarc_to_bezier(Point p0, Point p3, Point p4, double C, double D,
10821139
10831140 double a, b, c, d, e, f, g; /* Scratch variables */
10841141
1142+ if (!p1 || !p2)
1143+ {
1144+ g_debug("ellipticalarc_to_bezier() called with null parameters");
1145+ return FALSE;
1146+ }
1147+
10851148 /* We assume the arc is not degenerate:
10861149 p0 != p4 != p3 != p0, 0 < D < infty
10871150 */
@@ -1423,7 +1486,7 @@ plot_bezier(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
14231486 if (!all_lines)
14241487 {
14251488 /* It's a Bezier */
1426- if (Geom->NoFill)
1489+ if (Geom && Geom->NoFill)
14271490 {
14281491 /* Yes, it is end then start arrow */
14291492 newobj = create_standard_bezierline(num_points, bezpoints,
@@ -1450,7 +1513,7 @@ plot_bezier(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
14501513
14511514 if (count > 2)
14521515 {
1453- if (Geom->NoFill)
1516+ if (Geom && Geom->NoFill)
14541517 {
14551518 /* Yes, it is end_arrow followed by start_arrow */
14561519 newobj = create_standard_polyline(count, points,
@@ -1498,6 +1561,12 @@ NURBS_N(unsigned int i, unsigned int k, float u, unsigned int n,
14981561 {
14991562 float sum = 0.0;
15001563
1564+ if (! knot)
1565+ {
1566+ g_debug("NURBS_N() called with knot=0");
1567+ return sum;
1568+ }
1569+
15011570 if (k == 0)
15021571 {
15031572 if (knot[i] <= u && u < knot[i+1])
@@ -1542,7 +1611,13 @@ NURBS_C(unsigned int k, float u, unsigned int n,
15421611 float bottom = 0;
15431612 unsigned int i;
15441613 float N_i_k;
1545- Point p;
1614+ Point p = {0, 0};
1615+
1616+ if (!knot || !weight || !control)
1617+ {
1618+ g_debug("NURBS_C() called with null parameters");
1619+ return p;
1620+ }
15461621
15471622 for(i=0; i<=n; i++)
15481623 {
@@ -1608,8 +1683,8 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
16081683 unsigned int steps = 40;
16091684 float start_u, step_u;
16101685
1611- if(theDoc->debug_comments)
1612- g_debug("plot_nurbs()");
1686+ if (theDoc->debug_comments)
1687+ g_debug("plot_nurbs(), current x=%f y=%f", current->x, current->y);
16131688
16141689 item = *more;
16151690 Any = (struct vdx_any *)(item->data);
@@ -1620,6 +1695,8 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
16201695 current->x = MoveTo->X;
16211696 current->y = MoveTo->Y;
16221697 begin = *current;
1698+ if (theDoc->debug_comments)
1699+ g_debug("MoveTo x=%f y=%f", begin.x, begin.y);
16231700 item = item->next;
16241701 Any = (struct vdx_any *)(item->data);
16251702 *more = item;
@@ -1627,6 +1704,7 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
16271704
16281705 if (Any->type == vdx_types_NURBSTo)
16291706 {
1707+ if (theDoc->debug_comments) g_debug("NURBSTo");
16301708 NURBSTo = (struct vdx_NURBSTo*)(item->data);
16311709
16321710 /* E holds the NURBS formula */
@@ -1688,25 +1766,25 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
16881766 i = 0;
16891767 while(c && *c && i < n)
16901768 {
1691- g_assert(c);
1769+ if (!c) break;
16921770 control[i].x = atof(++c);
16931771 current->x = control[i].x;
16941772 /* xType = 0 means X is proportion of Width */
16951773 if (xType == 0) control[i].x *= XForm->Width;
16961774 c = strchr(c, ',');
16971775
1698- g_assert(c);
1776+ if (!c) break;
16991777 control[i].y = atof(++c);
17001778 current->y = control[i].y;
17011779 /* yType = 0 means Y is proportion of Height */
17021780 if (yType == 0) control[i].y *= XForm->Height;
17031781 c = strchr(c, ',');
17041782
1705- g_assert(c);
1783+ if (!c) break;
17061784 knot[i] = atof(++c);
17071785 c = strchr(c, ',');
17081786
1709- g_assert(c);
1787+ if (!c) break;
17101788 weight[i] = atof(++c);
17111789 c = strchr(c, ',');
17121790 i++;
@@ -1717,6 +1795,7 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
17171795 {
17181796 if (Any->type == vdx_types_SplineStart)
17191797 {
1798+ if (theDoc->debug_comments) g_debug("SplineStart");
17201799 SplineStart = (struct vdx_SplineStart*)(item->data);
17211800 item2 = item;
17221801 n = 1;
@@ -1829,7 +1908,8 @@ plot_nurbs(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
18291908 {
18301909 points[num_points-1] = dia_point(apply_XForm(end, XForm), theDoc);
18311910 if (theDoc->debug_comments)
1832- g_debug("Point %d VDX x=%f y=%f", num_points-1, end.x, end.y);
1911+ g_debug("End Point %d VDX x=%f y=%f", num_points-1, end.x, end.y);
1912+ *current = end;
18331913 }
18341914
18351915 if (theDoc->debug_comments)
@@ -1875,6 +1955,12 @@ write_base64_file(const char *filename, const char *b64)
18751955 char buf[4]; /* For 4 decoded 6-bit chunks */
18761956 unsigned int buf_len = 0;
18771957
1958+ if (!filename || !b64)
1959+ {
1960+ g_debug("write_base64_file() called with null parameters");
1961+ return;
1962+ }
1963+
18781964 f = g_fopen(filename, "w+b");
18791965 if (!f)
18801966 {
@@ -2068,6 +2154,7 @@ plot_geom(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
20682154 {
20692155 const GSList *item;
20702156 gboolean all_lines = TRUE; /* Flag for line/polyline */
2157+ gboolean has_nurbs = FALSE; /* Flag for NURBS */
20712158 unsigned int num_steps = 0; /* Flag for poly */
20722159 struct vdx_any *last_point = 0;
20732160 unsigned int dia_type_choice = vdx_dia_any;
@@ -2076,7 +2163,7 @@ plot_geom(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
20762163 struct vdx_ArcTo *ArcTo;
20772164
20782165 /* Is it disabled? */
2079- if (Geom->NoShow)
2166+ if (!Geom || Geom->NoShow)
20802167 {
20812168 if (theDoc->debug_comments)
20822169 g_debug("NoShow");
@@ -2103,6 +2190,11 @@ plot_geom(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
21032190 if (ArcTo->Del) continue;
21042191 all_lines = FALSE;
21052192 break;
2193+ case vdx_types_NURBSTo:
2194+ case vdx_types_SplineKnot:
2195+ has_nurbs = TRUE;
2196+ all_lines = FALSE;
2197+ break;
21062198 default:
21072199 all_lines = FALSE;
21082200 }
@@ -2141,7 +2233,7 @@ plot_geom(const struct vdx_Geom *Geom, const struct vdx_XForm *XForm,
21412233 if (Geom->NoFill) { dia_type_choice = vdx_dia_bezier; }
21422234 else { dia_type_choice = vdx_dia_beziergon; }
21432235 /* Unless it's a spline */
2144- if (last_point->type == vdx_types_SplineKnot)
2236+ if (last_point->type == vdx_types_SplineKnot || has_nurbs)
21452237 dia_type_choice = vdx_dia_nurbs;
21462238 }
21472239
@@ -2203,8 +2295,13 @@ plot_text(const struct vdx_Text *Text, const struct vdx_XForm *XForm,
22032295 double height;
22042296 char *font_name = 0;
22052297 DiaFontStyle style = 0;
2298+ DiaFont *font = 0;
22062299
2207- if (!Char || !text) { g_debug("Not enough info for text"); return 0; }
2300+ if (!Text || !Char || !text || !XForm)
2301+ {
2302+ g_debug("Not enough info for text");
2303+ return 0;
2304+ }
22082305 p.x = 0; p.y = 0;
22092306
22102307 /* Setup position for horizontal alignment */
@@ -2316,11 +2413,17 @@ plot_text(const struct vdx_Text *Text, const struct vdx_XForm *XForm,
23162413 font_name = FaceName.Name;
23172414 }
23182415 }
2319- tprop->attr.font = dia_font_new(font_name, style, height);
2416+
2417+ font = dia_font_new_from_legacy_name(font_name);
2418+ dia_font_set_weight(font, DIA_FONT_STYLE_GET_WEIGHT(style));
2419+ dia_font_set_slant(font, DIA_FONT_STYLE_GET_SLANT(style));
2420+ dia_font_set_height(font, height);
2421+ tprop->attr.font = font;
2422+
23202423 if (theDoc->debug_comments)
2321- g_debug("Text: %s at %f,%f v=%d h=%d s=%.2x",
2424+ g_debug("Text: %s at %f,%f v=%d h=%d s=%.2x f=%s",
23222425 tprop->text_data, p.x, p.y,
2323- eprop->enum_data, tprop->attr.alignment, style);
2426+ eprop->enum_data, tprop->attr.alignment, style, font_name);
23242427
23252428 tprop->attr.height = height;
23262429 tprop->attr.color = Char->Color;
@@ -2359,6 +2462,11 @@ vdx_plot_shape(struct vdx_Shape *Shape, GSList *objects,
23592462 const GSList *more = 0;
23602463 Point current = {0, 0};
23612464
2465+ if (!Shape)
2466+ {
2467+ g_debug("vdx_plot_shape() called with Shape=0");
2468+ return 0;
2469+ }
23622470 theDoc->shape_id = Shape->ID;
23632471 if (Shape->Del)
23642472 {
@@ -2701,6 +2809,12 @@ vdx_setup_layers(struct vdx_PageSheet* PageSheet, VDXDocument* theDoc,
27012809
27022810 /* What layers are on this page? */
27032811
2812+ if (!PageSheet)
2813+ {
2814+ g_debug("vdx_setup_layers() called with PageSheet=0");
2815+ return;
2816+ }
2817+
27042818 for (child = PageSheet->children; child; child = child->next)
27052819 {
27062820 if (!child || !child->data) continue;