Ticket #77 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Corrupted model when using undo manager

Reported by: arj..@yirdis.nl Assigned to: arj..@yirdis.nl
Priority: critical Milestone: Gaphor 0.13.0
Component: Gaphor Version:
Keywords: Cc:

Description

We're still not free of trouble with the undo manager.

Try this: create two Class items and create an Association between them. Move one end of the association item so the relationship is removed.

Now undo:

Error while pre-updating item <gaphor.diagram.klass.ClassItem object at 0x016701
10>
Traceback (most recent call last):
  File "c:\workspace\python\gaphas\gaphas\canvas.py", line 374, in _pre_update_i
tems
    item.pre_update(c)
  File ".\gaphor\diagram\classifier.py", line 294, in pre_update_compartment
    comp.pre_update(context)
  File ".\gaphor\diagram\classifier.py", line 63, in pre_update
    item.pre_update(context)
  File ".\gaphor\diagram\feature.py", line 118, in pre_update
    self.update_size(self.subject.render(), context)
  File ".\gaphor\diagram\feature.py", line 57, in update_size
    self.width, self.height = text_extents(cr, text)
  File "C:\workspace\python\gaphas\gaphas\util.py", line 28, in text_extents
    x_bear, y_bear, width, height, x_adv, y_adv = cr.text_extents(text)
TypeError: Context.text_extents() argument must be a string or unicode object
Error while pre-updating item <gaphor.diagram.klass.ClassItem object at 0x017318
70>

In this case the problem is that one end of the association is handled by the classifier, but seen acts as an association end.

The order in which operations need to be undone is important.

Possible solution is to postpone event notification until the transaction is committed.

Attachments

Change History

10/02/07 05:15:31 changed by arj..@yirdis.nl

  • status changed from new to assigned.

Okay, now part of it works as of [2155].

10/02/07 05:16:54 changed by arj..@yirdis.nl

The Association end's subject is not set properly on undo and for some reason the disconnect functionality behaves weird (disconnecting the handle but not releasing the constraints).

10/07/07 23:38:32 changed by arj..@yirdis.nl

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [2160]) Use gaphas' Handle.connection_data property. Fix #77.


Add/Change #77 (Corrupted model when using undo manager)




Action