Quellcode durchsuchen

CDB: Revert previous changes

LeoVgr vor 5 Monaten
Ursprung
Commit
0d28f7872d
1 geänderte Dateien mit 22 neuen und 33 gelöschten Zeilen
  1. 22 33
      hide/comp/cdb/Editor.hx

+ 22 - 33
hide/comp/cdb/Editor.hx

@@ -775,43 +775,32 @@ class Editor extends Component {
 
 			beginChanges();
 
-			if (data.length == 1) {
-				// Manage copy one cell into severals that are selected
-				for (c in targetCells) {
-					if( !c.table.canEditColumn(c.column.name) || Editor.getColumnProps(c.column).copyPasteImmutable)
-						continue;
-					setValue(data[0], sheet.lines[c.line.index], clipboard.schema[0], c.column);
-					toRefresh.push(c);
+			if( data.length == 1 && cursor.y != cursor.y )
+				data = [data[0]];
+			for( obj1 in data ) {
+				if( posY == sheet.lines.length ) {
+					if( !cursor.table.canInsert() ) break;
+					sheet.newLine();
+					fullRefresh = true;
 				}
-			}
-			else {
-				if( data.length == 1 && cursor.y != cursor.y )
-					data = [data[0]];
-				for( obj1 in data ) {
-					if( posY == sheet.lines.length ) {
-						if( !cursor.table.canInsert() ) break;
-						sheet.newLine();
-						fullRefresh = true;
-					}
-					var obj2 = sheet.lines[posY];
-					for( cid in 0...clipboard.schema.length ) {
-						var c1 = clipboard.schema[cid];
-						var c2 = columns[cid + posX];
-						if( c2 == null ) continue;
-						var p = Editor.getColumnProps(c2);
-
-						if( !cursor.table.canEditColumn(c2.name) || p.copyPasteImmutable)
-							continue;
+				var obj2 = sheet.lines[posY];
+				for( cid in 0...clipboard.schema.length ) {
+					var c1 = clipboard.schema[cid];
+					var c2 = columns[cid + posX];
+					if( c2 == null ) continue;
+					var p = Editor.getColumnProps(c2);
 
-						setValue(obj1, obj2, c1, c2);
+					if( !cursor.table.canEditColumn(c2.name) || p.copyPasteImmutable)
+						continue;
 
-						if( c2.type == TList || c2.type == TProperties )
-							fullRefresh = true;
-						if( !fullRefresh )
-							toRefresh.push(allLines[posY].cells[cid + posX]);
-					}
-					posY++;
+					setValue(obj1, obj2, c1, c2);
+
+					if( c2.type == TList || c2.type == TProperties )
+						fullRefresh = true;
+					if( !fullRefresh )
+						toRefresh.push(allLines[posY].cells[cid + posX]);
 				}
+				posY++;
 			}
 		}
 		formulas.evaluateAll(realSheet);