- # Copy parameters present in dummy but not in elem
- for node in dummy.childNodes:
- tag = node.tagName
- if tag not in tags:
- elem.appendChild(node.cloneNode(True))
+ # Remove sizeritem child if spacer
+ if className == 'spacer' and xxx.className != 'spacer':
+ sizeritem = elem.parentNode
+ assert sizeritem.getAttribute('class') == 'sizeritem'
+ sizeritem.removeChild(elem)
+ elem.unlink()
+ elem = sizeritem
+ tree.GetPyData(selected).hasChild = false
+ elif xxx.className == 'spacer' and className != 'spacer':
+ # Create sizeritem element
+ assert xxx.parent.isSizer
+ elem.setAttribute('class', 'sizeritem')
+ node = MakeEmptyDOM(className)
+ elem.appendChild(node)
+ # Replace to point to new object
+ xxx = xxxSizerItem(xxx.parent, elem)
+ elem = node
+ tree.SetPyData(selected, xxx)
+ xxx = xxx.child
+ else:
+ # Copy parameters present in dummy but not in elem
+ for node in dummy.childNodes:
+ if node.tagName not in tags: elem.appendChild(node.cloneNode(True))