diff --git a/cell/view/WorksheetView.js b/cell/view/WorksheetView.js index 853b0f96ed11d1f76238123eba46b9a8f7bfa711..1a4a5df3f3d8fea86af059db673a2d5efe96d2f6 100644 --- a/cell/view/WorksheetView.js +++ b/cell/view/WorksheetView.js @@ -9546,12 +9546,24 @@ } pastedRangeProps.offsetLast = {offsetCol: offsetCol, offsetRow: offsetRow}; - mergeArr.push(new Asc.Range( - curMerge.c1 + arn.c1 - activeCellsPasteFragment.c1 + colDiff, - curMerge.r1 + arn.r1 - activeCellsPasteFragment.r1 + rowDiff, - curMerge.c2 + arn.c1 - activeCellsPasteFragment.c1 + colDiff, - curMerge.r2 + arn.r1 - activeCellsPasteFragment.r1 + rowDiff - )); + if(specialPasteProps.transpose) + { + mergeArr.push(new Asc.Range( + curMerge.c1 + arn.c1 - activeCellsPasteFragment.r1 + colDiff, + curMerge.r1 + arn.r1 - activeCellsPasteFragment.c1 + rowDiff, + curMerge.c2 + arn.c1 - activeCellsPasteFragment.r1 + colDiff, + curMerge.r2 + arn.r1 - activeCellsPasteFragment.c1 + rowDiff + )); + } + else + { + mergeArr.push(new Asc.Range( + curMerge.c1 + arn.c1 - activeCellsPasteFragment.c1 + colDiff, + curMerge.r1 + arn.r1 - activeCellsPasteFragment.r1 + rowDiff, + curMerge.c2 + arn.c1 - activeCellsPasteFragment.c1 + colDiff, + curMerge.r2 + arn.r1 - activeCellsPasteFragment.r1 + rowDiff + )); + } } } else { @@ -9683,6 +9695,7 @@ var curMerge = newVal.hasMerged(); if(curMerge && specialPasteProps.transpose) { + curMerge = curMerge.clone(); var r1 = curMerge.r1; var r2 = curMerge.r2; var c1 = curMerge.c1;