[dia] object_save_using_properties() - make the prototype match it's use



commit 3ec41ad64f44ab59e4afb0ed3986547879d448d3
Author: Hans Breuer <hans breuer org>
Date:   Fri Jul 30 16:11:33 2010 +0200

    object_save_using_properties() - make the prototype match it's use
    
    The extra parameter 'int version' was not used in the implementation and it created a signature mismatch with SaveFunc. Stayed un-noticed for years until the first use of the filename parameter.

 lib/object.c                     |    4 +---
 lib/object.h                     |    2 +-
 objects/Misc/diagram_as_object.c |    6 +++---
 3 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/lib/object.c b/lib/object.c
index fdf5cc7..62e819a 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -824,13 +824,11 @@ object_load_using_properties(const DiaObjectType *type,
  *  for an object with normal attributes.
  * @param obj The object to save.
  * @param obj_node The XML structure to save into.
- * @param version The version of the objects structure this will be saved as
- *                (for allowing backwards compatibility).
  * @param filename The name of the file being saved to, for error messages.
  */
 void 
 object_save_using_properties(DiaObject *obj, ObjectNode obj_node, 
-                             int version, const char *filename)
+                             const char *filename)
 {
   object_save_props(obj,obj_node);
 }
diff --git a/lib/object.h b/lib/object.h
index 1fbdb4c..2e0b3be 100644
--- a/lib/object.h
+++ b/lib/object.h
@@ -390,7 +390,7 @@ DiaObject *object_load_using_properties(const DiaObjectType *type,
                                      ObjectNode obj_node, int version,
                                      const char *filename);
 void object_save_using_properties(DiaObject *obj, ObjectNode obj_node, 
-                                  int version, const char *filename);
+                                  const char *filename);
 DiaObject *object_copy_using_properties(DiaObject *obj);
 
 /*****************************************
diff --git a/objects/Misc/diagram_as_object.c b/objects/Misc/diagram_as_object.c
index 42b55ee..63cc7bd 100644
--- a/objects/Misc/diagram_as_object.c
+++ b/objects/Misc/diagram_as_object.c
@@ -351,7 +351,7 @@ _dae_load (ObjectNode obj_node, int version, const char *filename)
     gchar *filename = g_build_filename (dirname, dae->filename, NULL);
     g_free (dae->filename);
     dae->filename = filename;
-    g_free (dirname);    
+    g_free (dirname);
   }
   return obj;
 }
@@ -372,8 +372,8 @@ _dae_save (DiaObject *obj, ObjectNode obj_node, const char *filename)
     }
     g_free (dirname);
   }
-  object_save_using_properties (obj, obj_node, diagram_as_element_type.version, filename);
-  
+  object_save_using_properties (obj, obj_node, filename);
+
   if (saved_path) {
     dae->filename = saved_path;
   }



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