[dia] Fix typos and document potential side-effect of DiaObject::move()



commit 513964533a41a0ba0d5b71b33f5e37ec52b42b3b
Author: Hans Breuer <hans breuer org>
Date:   Tue Sep 9 21:35:06 2014 +0200

    Fix typos and document potential side-effect of DiaObject::move()
    
    The recent crash with "UML - Component Feature" could have been avoided by
    using the trik to make an object update it's data. With the test this is
    not wanted. Ideally we would not need that trick anywhere.

 plug-ins/wpg/wpg.c   |    4 ++--
 tests/test-objects.c |   13 ++++++++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/wpg/wpg.c b/plug-ins/wpg/wpg.c
index cce227e..fc1a49a 100644
--- a/plug-ins/wpg/wpg.c
+++ b/plug-ins/wpg/wpg.c
@@ -202,7 +202,7 @@ WriteRecHead(WpgRenderer *renderer, WPG_Type Type, guint32 Size)
     rh.Dummy = 0xFF;
     rh.Size  = Size;
 
-    /* To avoid problems with stucture packing this struct
+    /* To avoid problems with structure packing this struct
      * is written in parts ...
      */
     fwrite(&rh, sizeof(guint8), 2, renderer->file);
@@ -727,7 +727,7 @@ draw_bezier(DiaRenderer *self,
 
   /* WPG's Poly Curve is a cubic bezier compatible with Dia's bezier.
    * http://www.fileformat.info/format/wpg/egff.htm
-   * could lead to the assumption of ony quadratic bezier support,
+   * could lead to the assumption of only quadratic bezier support,
    * but that's not the case.
    */
   pts[0].x = SCX( points[0].p1.x);
diff --git a/tests/test-objects.c b/tests/test-objects.c
index bca9523..a12df4a 100644
--- a/tests/test-objects.c
+++ b/tests/test-objects.c
@@ -433,7 +433,7 @@ _test_connectionpoint_consistency (gconstpointer user_data)
        * - the main point should be within the object, which can't work for
        *   an object consisting of only lines ...
        * - some main points where just placed automatically and got fixed
-       *   after idntified with this check
+       *   after identified with this check
        */
       if (   strcmp (type->name, "chemeng - coil") == 0
           || strcmp (type->name, "chemeng - coilv") == 0
@@ -564,6 +564,17 @@ _test_object_menu (gconstpointer user_data)
           * The object parameter is deprecated, but still necessary!
           */
          (change->revert)(change, o);
+#if 0
+         /* XXX: Even more needs to be done to keep sane objects, see object_change_revert()
+          * in app/undo.c. AFAICT this is only needed to compensate for orthconn_set_points()
+          * while that does not update the object itself.
+          */
+         {
+           /* Make sure object updates its data: */
+           Point p = o->position;
+           (o->ops->move)(o,&p);
+         }
+#endif
          _object_change_free(change);
        }
       }


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