[Jsxe-cvs] SF.net SVN: jsxe: [1268] tags/05pre3/jsxe
Status: Inactive
Brought to you by:
ian_lewis
|
From: <ian...@us...> - 2006-10-24 07:45:26
|
Revision: 1268
http://svn.sourceforge.net/jsxe/?rev=1268&view=rev
Author: ian_lewis
Date: 2006-10-24 00:45:16 -0700 (Tue, 24 Oct 2006)
Log Message:
-----------
Fixed bug 1582667
Modified Paths:
--------------
tags/05pre3/jsxe/Changelog
tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java
Modified: tags/05pre3/jsxe/Changelog
===================================================================
--- tags/05pre3/jsxe/Changelog 2006-10-24 05:24:10 UTC (rev 1267)
+++ tags/05pre3/jsxe/Changelog 2006-10-24 07:45:16 UTC (rev 1268)
@@ -1,3 +1,8 @@
+10/24/2006 Ian Lewis <Ian...@me...>
+
+ * Fixed bug 1582667. Now if you drag and drop a node onto itself it doesn't
+ delete the node.
+
08/31/2006 Ian Lewis <Ian...@me...>
* Added new ContextSpecificActions to replace ViewSpecificActions. Now
Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java
===================================================================
--- tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java 2006-10-24 05:24:10 UTC (rev 1267)
+++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java 2006-10-24 07:45:16 UTC (rev 1268)
@@ -530,11 +530,11 @@
}
} else {
-
/*
if the node is already contained in this node
then we are effectively moving the node.
*/
+ boolean differentParent = false;
if (m_children.contains(node)) {
if (location > m_children.indexOf(node)) {
location -= 1;
@@ -543,13 +543,7 @@
m_children.remove(node);
addUndoableEdit(new RemoveNodeChange(this, node, index));
} else {
- //Remove from previous parent
- AdapterNode previousParent = node.getParentNode();
- if (previousParent != this) {
- if (previousParent != null) {
- previousParent.removeChild(node);
- }
- }
+ differentParent = true;
}
if (location >= m_children.size()) {
m_domNode.appendChild(node.getNode());
@@ -560,6 +554,19 @@
m_children.add(location, node);
}
+ /*
+ Only remove from previous parent if the previous parent
+ is different from the new one.
+ */
+ if (differentParent) {
+ AdapterNode previousParent = node.getParentNode();
+ if (previousParent != this) {
+ if (previousParent != null) {
+ previousParent.removeChild(node);
+ }
+ }
+ }
+
node.setParent(this);
fireNodeAdded(this, node, location);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|