Revision 20470 trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dbf/DBFStore.java

View differences:

DBFStore.java
101 101
	protected void doFinishEdition() throws WriteException, ReadException {
102 102
		IFeaturesWriter writer = getFeaturesWriter();
103 103
        writer.init(this);
104
        writer.updateFeatureType(featureType);
104
        writer.updateFeatureType(getDefaultFeatureType());
105 105
        writer.preProcess();
106 106
        Collection collection=getDataCollection();
107 107
        Iterator iterator=collection.iterator();
......
120 120
		}
121 121
		IFeatureCollection coll;
122 122
		if (order == null){
123
			if (featureManager==null){
123
		if (featureManager==null){
124 124
				coll=new DBFFeatureCollectionBitSet(this,type,filter);
125 125
			}else{
126 126
				coll=new DBFFeatureCollection(featureManager,this,type,filter);
......
137 137
	public IFeature getFeatureByID(IFeatureID id) throws ReadException {
138 138
		if (this.alterMode){
139 139
    		if (featureManager.contains(id)) {
140
    			return featureManager.getFeature(id);
140
    			try {
141
					return featureManager.getFeature(id,this);
142
				} catch (IsNotFeatureSettingException e) {
143
					throw new ReadException(this.getName(),e);
144
				}
141 145
    		}
142 146
    	}
143
		DBFFeature feature=new DBFFeature(featureType,this,((DBFFeatureID)id).getIndex());
147
		DBFFeature feature=new DBFFeature(getDefaultFeatureType(),this,((DBFFeatureID)id).getIndex());
144 148
		return feature;
145 149
//		return getFeatureByPosition(featureType,((DBFFeatureID)id).getIndex());
146 150
	}
......
151 155
	}
152 156

  
153 157
	public IFeatureType getDefaultFeatureType() {
154
		IFeatureType ft = featureType;
155
    	if (isEditing()){
158
		if (isEditing()){
156 159
//    		Aqu? hay que construir un FeatureType con los cambios que se hayan hecho en la edici?n.
157
    		return attributeManager.getFeatureType(ft);
160
    		return attributeManager.getFeatureType();
158 161
    	}
159
        return ft;
162
        return featureType;
160 163
	}
161 164

  
162 165
	public boolean isWithDefaultLegend() {

Also available in: Unified diff