[dia] Load std-props-test.dia without complaints



commit 585402380562cf79adaeacdaba1c378bacbc7e5b
Author: Hans Breuer <hans breuer org>
Date:   Sun Jul 22 16:02:19 2012 +0200

    Load std-props-test.dia without complaints
    
    Have to call dia_context_set_filename() to make the diagram
    loader find it's external images. Still open how errors
    should be reported ...

 objects/Misc/diagram_as_object.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/objects/Misc/diagram_as_object.c b/objects/Misc/diagram_as_object.c
index ed19ad2..6354e56 100644
--- a/objects/Misc/diagram_as_object.c
+++ b/objects/Misc/diagram_as_object.c
@@ -210,6 +210,7 @@ _dae_draw(DiagramAsElement *dae, DiaRenderer *renderer)
 	  if (ef) {
 	    DiaContext *ctx = dia_context_new ("Diagram as Object");
 
+	    dia_context_set_filename (ctx, imgfname);
 	    if (ef->export_func (dae->data, ctx, imgfname, dae->filename, ef->user_data)) {
 	      DiaImage *tmp_image = dia_image_load (imgfname);
 
@@ -256,11 +257,13 @@ _dae_update_data(DiagramAsElement *dae)
     if (inf) {
       DiaContext *ctx = dia_context_new (diagram_as_element_type.name);
 
+      dia_context_set_filename (ctx, dae->filename);
       if (inf->import_func(dae->filename, dae->data, ctx, inf->user_data)) {
         dae->scale = dae->element.width / (dae->data->extents.right - dae->data->extents.left);
         dae->element.height = (dae->data->extents.bottom - dae->data->extents.top) * dae->scale;
         dae->mtime = statbuf.st_mtime;
       }
+      /* FIXME: where to put the message in case of an error? */
       dia_context_release (ctx);
     }
     /* invalidate possibly cached image */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]