Implemented xxxComment. Due to different minidom XML types (Comments

are not Elements) had to add xxxObject.isElement flag and changed
xxxObject.element variable to xxxObject.node (xxxComment is derived
from xxxObject to minimize changes in processing). More testing is still
needed to verify that things didn't break. Use previous commit (0.1.8-4
release on 2007/03/10) if you need a stable version.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky
2007-03-11 05:08:45 +00:00
parent 047c5f3e6d
commit b372319fa0
9 changed files with 240 additions and 123 deletions

View File

@@ -134,11 +134,11 @@ class UndoReplace:
item = g.tree.ItemAtFullIndex(self.itemIndex)
xxx = g.tree.GetPyData(item)
# Replace with old element
parent = xxx.parent.element
parent = xxx.parent.node
if xxx is self.xxx: # sizeritem or notebookpage - replace child
parent.replaceChild(self.xxx.child.element, xxx.child.element)
parent.replaceChild(self.xxx.child.node, xxx.child.node)
else:
parent.replaceChild(self.xxx.element, xxx.element)
parent.replaceChild(self.xxx.node, xxx.node)
self.xxx.parent = xxx.parent
xxx = self.xxx
g.tree.SetPyData(item, xxx)
@@ -191,9 +191,9 @@ class UndoMove:
((parent.isSizer and not isinstance(xxx, xxxSizerItem)) or \
(isinstance(parent, xxxNotebook) and not isinstance(xxx, xxxNotebookPage)) or \
not (parent.isSizer or isinstance(parent, xxxNotebook))):
elem.removeChild(xxx.child.element) # detach child
elem.removeChild(xxx.child.node) # detach child
elem.unlink() # delete child container
elem = xxx.child.element # replace
elem = xxx.child.node # replace
# This may help garbage collection
xxx.child.parent = None
isChildContainer = False
@@ -227,9 +227,9 @@ class UndoMove:
((parent.isSizer and not isinstance(xxx, xxxSizerItem)) or \
(isinstance(parent, xxxNotebook) and not isinstance(xxx, xxxNotebookPage)) or \
not (parent.isSizer or isinstance(parent, xxxNotebook))):
elem.removeChild(xxx.child.element) # detach child
elem.removeChild(xxx.child.node) # detach child
elem.unlink() # delete child container
elem = xxx.child.element # replace
elem = xxx.child.node # replace
# This may help garbage collection
xxx.child.parent = None
isChildContainer = False