Revision 46390 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java

View differences:

DefaultFeatureStore.java
223 223
    private int mode = MODE_QUERY;
224 224
    private long versionOfUpdate = 0;
225 225
    private boolean hasStrongChanges = true;
226
    private boolean hasInserts = true;
227 226

  
228 227
    private DefaultDataManager dataManager = null;
229 228

  
......
1269 1268

  
1270 1269
        mode = MODE_QUERY;
1271 1270
        hasStrongChanges = true; // Lo deja a true por si las moscas
1272
        hasInserts = true;
1273 1271

  
1274 1272
        this.editingSessionCode = null;
1275 1273
    }
......
1313 1311
                            spatialManager, featureTypeManager);
1314 1312
                    this.mode = MODE_FULLEDIT;
1315 1313
                    hasStrongChanges = false;
1316
                    hasInserts = false;
1317 1314
                    notifyChange(FeatureStoreNotification.AFTER_STARTEDITING, newSessionCode, this.mode);
1318 1315
                    break;
1319 1316

  
......
1329 1326
                    invalidateIndexes();
1330 1327
                    this.provider.beginAppend();
1331 1328
                    this.mode = MODE_APPEND;
1332
                    hasInserts = false;
1333 1329
                    notifyChange(FeatureStoreNotification.AFTER_STARTEDITING,
1334 1330
                            newSessionCode, this.mode);
1335 1331
                    break;
......
1347 1343
                    this.editingSessionCode = newSessionCode;
1348 1344
                    invalidateIndexes();
1349 1345
                    this.mode = MODE_PASS_THROUGH;
1350
                    hasInserts = false;
1351 1346
                    notifyChange(FeatureStoreNotification.AFTER_STARTEDITING,
1352 1347
                            newSessionCode, this.mode);
1353 1348
                    break;
......
1631 1626
                    feature.validate(CHECK_RULES_AT_EDITING);
1632 1627
                    provider.append(((DefaultEditableFeature) feature).getData());
1633 1628
                    hasStrongChanges = true;
1634
                    hasInserts = true;
1635 1629
                    notifyChange(FeatureStoreNotification.AFTER_INSERT, feature);
1636 1630
                    break;
1637 1631

  
......
1685 1679
        spatialManager.insertFeature(newFeature);
1686 1680

  
1687 1681
        hasStrongChanges = true;
1688
        hasInserts = true;
1689 1682
        notifyChange(FeatureStoreNotification.AFTER_INSERT, feature);
1690 1683
    }
1691 1684

  
......
1897 1890
                case MODE_FULLEDIT:
1898 1891
                    boolean clearSelection = this.hasStrongChanges;
1899 1892
                    if (this.selection instanceof FeatureReferenceSelection) {
1900
                        clearSelection = this.hasInserts;
1893
                        clearSelection = this.hasStrongChanges || this.featureManager.hasNews();
1901 1894
                    }
1902
                    if (notifyChange(FeatureStoreNotification.BEFORE_CANCELEDITING).isCanceled()) {
1895
                    if (notifyChange(FeatureStoreNotification.BEFORE_CANCELEDITING,this.editingSessionCode).isCanceled()) {
1903 1896
                        return;
1904 1897
                    }
1905 1898
                    exitEditingMode();
......
1907 1900
                        ((FeatureSelection) this.getSelection()).deselectAll();
1908 1901
                    }
1909 1902
                    updateIndexes();
1910
                    notifyChange(FeatureStoreNotification.AFTER_CANCELEDITING);
1903
                    notifyChange(FeatureStoreNotification.AFTER_CANCELEDITING,this.editingSessionCode);
1911 1904
                    break;
1912 1905

  
1913 1906
                case MODE_PASS_THROUGH:
......
2183 2176
                    exitEditingMode();
2184 2177
                    invalidateIndexes();
2185 2178
                    this.provider.beginAppend();
2186
                    hasInserts = false;
2187 2179
                    break;
2188 2180

  
2189 2181
                case MODE_FULLEDIT:
......
2208 2200
                                    spatialManager, featureTypeManager);
2209 2201
                    featureCount = null;
2210 2202
                    hasStrongChanges = false;
2211
                    hasInserts = false;
2212 2203
                    break;
2213 2204
            }
2214 2205
        } catch (Exception e) {

Also available in: Unified diff