Revision: 3339
Author: ferguson.sebastian
Date: Thu Feb 25 11:49:57 2010
Log: Fixed a bug that caused a column to be removed and added again when
adding another column. This was causing columns to be moved around when
they should not have been, and it crashed a client session as soon as a
second column was added.
http://code.google.com/p/power-architect/source/detail?r=3339
Modified:
/trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java Mon Feb
8 10:12:47 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/ColumnEditPanel.java Thu Feb
25 11:49:57 2010
@@ -691,9 +691,9 @@
}
if (componentEnabledMap.get(colInPK).isSelected()) {
- if (colInPK.isSelected()) {
+ if (colInPK.isSelected() && !column.isPrimaryKey()) {
column.getParent().addToPK(column);
- } else {
+ } else if (!colInPK.isSelected() &&
column.isPrimaryKey()) {
column.getParent().moveAfterPK(column);
}
}