# HG changeset patch # User Thinker K.F. Li # Date 1295095683 -28800 # Node ID 922d1caf66326f56dec76a554a362095dc013f5a # Parent e2d2532c311531cda08758f77b8b799b80111e8c Revert to changeset #0442ae9c2ac2 for domview.py. - revert copy_group_children() and rm_frames() to #0442ae9c2ac2. diff -r e2d2532c3115 -r 922d1caf6632 pyink/domview.py --- a/pyink/domview.py Sat Jan 15 18:32:33 2011 +0800 +++ b/pyink/domview.py Sat Jan 15 20:48:03 2011 +0800 @@ -705,18 +705,13 @@ if end < frame_idx: continue - + if start > last_rm: # this scene is at right side self.chg_scene_node(scene_node, start=(start - num), end=(end - num)) - elif start >= frame_idx: - self.rm_scene_node_n_group(scene_node) - pass else: # this scene is covered by removing range - self.chg_scene_node(scene_node, - start=start, - end=(end - num)) + self.rm_scene_node_n_group(scene_node) pass pass pass @@ -731,12 +726,15 @@ def copy_group_children(self, src_group, dst_group): # Search for the duplicated group doc = self._doc + + dup_group = src_group.duplicate(doc) + old_nodes = _DOM_iterator(src_group) + new_nodes = _DOM_iterator(dup_group) new_gids = set() for old_node in old_nodes: old_node_id = old_node.getAttribute('id') - new_node = doc.createElement("svg:use") - new_node.setAttribute("xlink:href",'#'+old_node_id) + new_node = new_nodes.next() new_node.setAttribute('ns0:duplicate-src', old_node_id) # @@ -752,8 +750,12 @@ pass new_gids.add(gid) new_node.setAttribute('id', gid) - dst_group.appendChild(new_node) pass + + for child in dup_group.childList(): + dup_group.removeChild(child) # prevent from crash + dst_group.append(child) + pass pass pass