Commit 37ff11f4 authored by GoshaZotov's avatar GoshaZotov

change function _pasteFromHTML

parent 15accf65
......@@ -8938,7 +8938,7 @@
//проверка на наличие части объединённой ячейки в области куда осуществляем вставку
for (var rFirst = arn.r1; rFirst < rMax; ++rFirst) {
for (var cFirst = arn.c1; cFirst < cMax; ++cFirst) {
range = t.model.getRange3(rFirst, cFirst, rFirst, cFirst);
var range = t.model.getRange3(rFirst, cFirst, rFirst, cFirst);
var merged = range.hasMerged();
if (merged) {
if (merged.r1 < arn.r1 || merged.r2 > rMax - 1 || merged.c1 < arn.c1 || merged.c2 > cMax - 1) {
......@@ -9058,19 +9058,11 @@
};
var mergeArr = [];
for (var autoR = 0; autoR < maxARow; ++autoR) {
for (var autoC = 0; autoC < maxACol; ++autoC) {
for (var r = 0; r < rMax; ++r) {
for (var c = 0; c < pasteContent.content[r].length; ++c) {
if (undefined !== pasteContent.content[r][c]) {
var pasteIntoRow = r + autoR * plRow + arn.r1;
var pasteIntoCol = c + autoC * plCol + arn.c1;
var range = t.model.getRange3(pasteIntoRow, pasteIntoCol, pasteIntoRow, pasteIntoCol);
var putInsertedCellIntoRange = function(row, col, currentObj)
{
var pastedRangeProps = {};
var currentObj = pasteContent.content[r][c];
var contentCurrentObj = currentObj.content;
var range = t.model.getRange3(row, col, row, col);
//value
if (contentCurrentObj.length === 1) {
......@@ -9098,8 +9090,8 @@
//for merge
var isMerged = false;
for (var mergeCheck = 0; mergeCheck < mergeArr.length; ++mergeCheck) {
var tempRow = pasteIntoRow + 1;
var tempCol = pasteIntoCol + 1;
var tempRow = row + 1;
var tempCol = col + 1;
if (tempRow <= mergeArr[mergeCheck].r2 && tempRow >= mergeArr[mergeCheck].r1 && tempCol <= mergeArr[mergeCheck].c2 && tempCol >= mergeArr[mergeCheck].c1) {
isMerged = true;
}
......@@ -9132,13 +9124,26 @@
}
//hyperlink
var link = pasteContent.content[r][c].hyperLink;
var link = currentObj.hyperLink;
if (link) {
pastedRangeProps.hyperLink = pasteContent.content[r][c];
pastedRangeProps.hyperLink = currentObj;
}
//apply props by cell
applyPropertiesByRange(range, pastedRangeProps);
};
for (var autoR = 0; autoR < maxARow; ++autoR) {
for (var autoC = 0; autoC < maxACol; ++autoC) {
for (var r = 0; r < rMax; ++r) {
for (var c = 0; c < pasteContent.content[r].length; ++c) {
if (undefined !== pasteContent.content[r][c]) {
var pasteIntoRow = r + autoR * plRow + arn.r1;
var pasteIntoCol = c + autoC * plCol + arn.c1;
var currentObj = pasteContent.content[r][c];
putInsertedCellIntoRange(pasteIntoRow, pasteIntoCol, currentObj);
}
}
}
......
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