Re: bug in ext_attributes or my xml file?



Hi Hans, could you point me to the bugzilla submission page for dia? Let me do it this way as it'll be easier than working my way through SVN as I have just started using dia on the coding side..

-regards,
-avi



On Tue, Jun 17, 2008 at 3:42 PM, Hans Breuer <hans breuer org> wrote:

Am 17.06.2008 15:26, Avijit Ghosh schrieb:

I think I just figured it out. The way copy / paste works with instances
leads to this behavior. When you drag a new instance from the shape library
creates the new memory. However if you select / paste it seems to be copying
references to the data which accidentally glues them together. If you save
the file and then reload it the instances become separate so this is
obviously a bug.
Your analysis looks pretty valid and is consisten with the my interpretation of the code in objects/custom/custom_object.c(custom_copy),
specifically line 1651 ff:

 if (custom->info->ext_attr_size) /* copy ext area past end */
   memcpy (newcustom + 1, custom + 1, custom->info->ext_attr_size);

assumes every extended atrribute is stored by value, for strings it is just copying the pointer thus 'glueing' the values together. If these copied properties would be modified after the copy it should even crash ;(


> I can go in and fix this if it hasn't been fixed already.
Patches are appreciated, may it can be fixed by delegating part of custom_copy to object_copy_using_properties().

Even if you do not fix the issue please it with a complete enogh example to reproduce in bugzilla.

Thanks,
       Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert
_______________________________________________
Dia-list mailing list
Dia-list gnome org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia




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