|
@@ -775,43 +775,32 @@ class Editor extends Component {
|
|
|
|
|
|
beginChanges();
|
|
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);
|
|
formulas.evaluateAll(realSheet);
|