[dia] Bug 623262 - Dynamic Grid setting not saved in diagram file



commit d700fc115846b974b7b0d168fdc6c83a75989897
Author: Hans Breuer <hans breuer org>
Date:   Fri Jul 30 22:27:20 2010 +0200

    Bug 623262 - Dynamic Grid setting not saved in diagram file
    
    *  When opening a file, the file's Dynamic Grid setting will take precedence
    over the default Dynamic Grid setting (from the Preferences dialog).
    
    *  When creating a new file, the default Dynamic Grid setting will be applied.
    
    In both cases, the value set in the "Diagram Properties" dialog will be incorporated into the diagram file.
    
    Patch from "J. Edwards <jheiv jheiv com>"

 app/load_save.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/app/load_save.c b/app/load_save.c
index 3c135d0..c2a37d9 100644
--- a/app/load_save.c
+++ b/app/load_save.c
@@ -555,6 +555,10 @@ diagram_data_load(const char *filename, DiagramData *data, void* user_data)
     if (attr != NULL) {
       gridinfo = attribute_first_data(attr);
 
+      attr = composite_find_attribute(gridinfo, "dynamic");
+      if (attr != NULL)
+         diagram->grid.dynamic = data_boolean(attribute_first_data(attr));
+
       attr = composite_find_attribute(gridinfo, "width_x");
       if (attr != NULL)
         diagram->grid.width_x = data_real(attribute_first_data(attr));
@@ -891,6 +895,8 @@ diagram_data_write_doc(DiagramData *data, const char *filename)
   if (diagram) {
     attr = new_attribute((ObjectNode)tree, "grid");
     gridinfo = data_add_composite(attr, "grid");
+    data_add_boolean(composite_add_attribute(gridinfo, "dynamic"),
+          diagram->grid.dynamic);
     data_add_real(composite_add_attribute(gridinfo, "width_x"),
 		  diagram->grid.width_x);
     data_add_real(composite_add_attribute(gridinfo, "width_y"),



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