Commit 15accf65 authored by GoshaZotov's avatar GoshaZotov

fix for merged cells(from html)

parent 604cce8e
...@@ -9098,21 +9098,23 @@ ...@@ -9098,21 +9098,23 @@
//for merge //for merge
var isMerged = false; var isMerged = false;
for (var mergeCheck = 0; mergeCheck < mergeArr.length; ++mergeCheck) { for (var mergeCheck = 0; mergeCheck < mergeArr.length; ++mergeCheck) {
var tempRow = r + 1 + autoR * plRow; var tempRow = pasteIntoRow + 1;
var tempCol = c + autoC * plCol + 1; var tempCol = pasteIntoCol + 1;
if (tempRow <= mergeArr[mergeCheck].r2 && tempRow >= mergeArr[mergeCheck].r1 && tempCol <= mergeArr[mergeCheck].c2 && tempCol >= mergeArr[mergeCheck].c1) { if (tempRow <= mergeArr[mergeCheck].r2 && tempRow >= mergeArr[mergeCheck].r1 && tempCol <= mergeArr[mergeCheck].c2 && tempCol >= mergeArr[mergeCheck].c1) {
isMerged = true; isMerged = true;
} }
} }
if ((currentObj.colSpan > 1 || currentObj.rowSpan > 1) && !isMerged) { if ((currentObj.colSpan > 1 || currentObj.rowSpan > 1) && !isMerged) {
pastedRangeProps.offsetLast = {offsetCol: currentObj.colSpan - 1, offsetRow: currentObj.rowSpan - 1}; var offsetCol = currentObj.colSpan - 1;
var offsetRow = currentObj.rowSpan - 1;
pastedRangeProps.offsetLast = {offsetCol: offsetCol, offsetRow: offsetRow};
mergeArr[n] = { mergeArr[n] = {
r1: range.first.row, r2: range.last.row, c1: range.first.col, c2: range.last.col r1: range.first.row, r2: range.last.row + offsetRow, c1: range.first.col, c2: range.last.col + offsetCol
}; };
n++; n++;
if (contentCurrentObj[0] == undefined) { if (contentCurrentObj[0] == undefined) {
pastedRangeProps.val = ''; pastedRangeProps.val = '';
} }
pastedRangeProps.merge = c_oAscMergeOptions.Merge; pastedRangeProps.merge = c_oAscMergeOptions.Merge;
} }
...@@ -9121,11 +9123,11 @@ ...@@ -9121,11 +9123,11 @@
pastedRangeProps.borders = currentObj.borders; pastedRangeProps.borders = currentObj.borders;
} }
//wrap //wrap
pastedRangeProps.wrap = currentObj.wrap; pastedRangeProps.wrap = currentObj.wrap;
//fill //fill
if (currentObj.bc && currentObj.bc.rgb) { if (currentObj.bc && currentObj.bc.rgb) {
pastedRangeProps.fill = currentObj.bc; pastedRangeProps.fill = currentObj.bc;
} }
...@@ -9133,15 +9135,15 @@ ...@@ -9133,15 +9135,15 @@
var link = pasteContent.content[r][c].hyperLink; var link = pasteContent.content[r][c].hyperLink;
if (link) { if (link) {
pastedRangeProps.hyperLink = pasteContent.content[r][c]; pastedRangeProps.hyperLink = pasteContent.content[r][c];
} }
//apply props by cell //apply props by cell
applyPropertiesByRange(range, pastedRangeProps); applyPropertiesByRange(range, pastedRangeProps);
} }
} }
} }
} }
} }
if (isMultiple) { if (isMultiple) {
arn.r2 = lastSelection.r2; arn.r2 = lastSelection.r2;
...@@ -9149,8 +9151,11 @@ ...@@ -9149,8 +9151,11 @@
} }
t.isChanged = true; t.isChanged = true;
var arnFor = [arn, arrFormula]; lastSelection.c2 = arn.c2;
lastSelection.r2 = arn.r2;
var arnFor = [];
arnFor[0] = arn;
arnFor[1] = arrFormula;
return arnFor; return arnFor;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment