Commit 2dcb0418 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

откат(ws.paste() -> ws.setSelectionInfo("paste",...))

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53891 954022d7-b5bf-4e40-9824-e11837661b57
parent dfbff489
...@@ -1440,7 +1440,7 @@ ...@@ -1440,7 +1440,7 @@
} }
else else
{ {
worksheet.paste(t ,false, true); worksheet.setSelectionInfo('paste',t,false,true);
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
return; return;
...@@ -1492,7 +1492,7 @@ ...@@ -1492,7 +1492,7 @@
var newFonts = {}; var newFonts = {};
pasteData.generateFontMap(newFonts); pasteData.generateFontMap(newFonts);
worksheet._loadFonts(newFonts, function() { worksheet._loadFonts(newFonts, function() {
worksheet.paste(pasteData, false, "binary"); worksheet.setSelectionInfo('paste', pasteData, false, "binary");
}); });
} }
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
...@@ -1534,7 +1534,7 @@ ...@@ -1534,7 +1534,7 @@
} }
else else
{ {
worksheet.paste(t, false, true); worksheet.setSelectionInfo('paste',t,false,true);
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
return; return;
...@@ -1558,7 +1558,7 @@ ...@@ -1558,7 +1558,7 @@
} }
else else
{ {
worksheet.paste(t, false, true); worksheet.setSelectionInfo('paste',t,false,true);
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
return; return;
...@@ -1920,7 +1920,7 @@ ...@@ -1920,7 +1920,7 @@
if(!api || (api && !api.isChartEditor)) if(!api || (api && !api.isChartEditor))
aResult.addImages = addImages; aResult.addImages = addImages;
aResult.fontsNew = t.fontsNew; aResult.fontsNew = t.fontsNew;
worksheet.paste(aResult, t); worksheet.setSelectionInfo('paste',aResult,t);
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
}, },
...@@ -3041,7 +3041,7 @@ ...@@ -3041,7 +3041,7 @@
} }
this.aResult.fontsNew = this.fontsNew; this.aResult.fontsNew = this.fontsNew;
worksheet.paste(this.aResult, this); worksheet.setSelectionInfo('paste', this.aResult, this);
}, },
_parseChildren: function(children, activeRange) _parseChildren: function(children, activeRange)
......
...@@ -7441,87 +7441,7 @@ ...@@ -7441,87 +7441,7 @@
case "style": case "style":
range.setCellStyle(val); canChangeColWidth = c_oAscCanChangeColWidth.numbers; break; range.setCellStyle(val); canChangeColWidth = c_oAscCanChangeColWidth.numbers; break;
break; break;
case "hyperlink": case "paste":
if (val && val.hyperlinkModel) {
if (c_oAscHyperlinkType.RangeLink === val.asc_getType()) {
var hyperlinkRangeTmp = t.model.getRange2(val.asc_getRange ());
if (null === hyperlinkRangeTmp) {
bIsUpdate = false;
break;
}
}
val.hyperlinkModel.Ref = range;
range.setHyperlink(val.hyperlinkModel);
// Вставим текст в активную ячейку (а не так, как MSExcel в первую ячейку диапазона)
mc = t.model.getMergedByCell(arn.startRow, arn.startCol);
c = mc ? mc.c1 : arn.startCol;
r = mc ? mc.r1 : arn.startRow;
if (null !== val.asc_getText()) {
t.model.getRange3(r, c, r, c).setValue(val.asc_getText());
// Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(arn);
}
break;
} else {
bIsUpdate = false;
break;
}
default:
bIsUpdate = false;
break;
}
if (bIsUpdate) {
if (callTrigger) { t.handlers.trigger("slowOperation", false); }
t.isChanged = true;
t._updateCellsRange(arn, canChangeColWidth);
}
History.EndTransaction();
};
this._isLockedCells (checkRange, /*subType*/null, onSelectionCallback);
};
WorksheetView.prototype.paste = function (val, onlyActive, isLocal) {
// Проверка глобального лока
if (this.collaborativeEditing.getGlobalLock())
return;
var t = this;
var checkRange = null;
var arn = t.activeRange.clone(true);
var onSelectionCallback = function (isSuccess) {
if (false === isSuccess)
return;
var range;
var canChangeColWidth = c_oAscCanChangeColWidth.none;
var selectionRange;
var bIsUpdate = true;
if (onlyActive) {
range = t.model.getRange3(arn.startRow, arn.startCol, arn.startRow, arn.startCol);
} else {
if (c_oAscSelectionType.RangeMax === arn.type) {
range = t.model.getRange3(/*arn.r1*/0, /*arn.c1*/0, gc_nMaxRow0, gc_nMaxCol0);
} else if (c_oAscSelectionType.RangeCol === arn.type) {
range = t.model.getRange3(/*arn.r1*/0, arn.c1, gc_nMaxRow0, arn.c2);
} else if (c_oAscSelectionType.RangeRow === arn.type) {
range = t.model.getRange3(arn.r1, /*arn.c1*/0, arn.r2, gc_nMaxCol0);
} else {
range = t.model.getRange3(arn.r1, arn.c1, arn.r2, arn.c2);
}
}
var isLargeRange = t._isLargeRange(range), callTrigger = false;
selectionRange = arn.clone();
History.Create_NewPoint();
History.StartTransaction();
var pasteLocal = function () { var pasteLocal = function () {
if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); } if (isLargeRange) { callTrigger = true; t.handlers.trigger("slowOperation", true); }
var selectData; var selectData;
...@@ -7715,16 +7635,55 @@ ...@@ -7715,16 +7635,55 @@
}; };
// Вставляем текст из локального буфера или нет // Вставляем текст из локального буфера или нет
isLocal ? pasteLocal() : pasteNoLocal(); isLocal ? pasteLocal() : pasteNoLocal();
}; return;
case "hyperlink":
if (val && val.hyperlinkModel) {
if (c_oAscHyperlinkType.RangeLink === val.asc_getType()) {
var hyperlinkRangeTmp = t.model.getRange2(val.asc_getRange ());
if (null === hyperlinkRangeTmp) {
bIsUpdate = false;
break;
}
}
val.hyperlinkModel.Ref = range;
range.setHyperlink(val.hyperlinkModel);
// Вставим текст в активную ячейку (а не так, как MSExcel в первую ячейку диапазона)
mc = t.model.getMergedByCell(arn.startRow, arn.startCol);
c = mc ? mc.c1 : arn.startCol;
r = mc ? mc.r1 : arn.startRow;
if (null !== val.asc_getText()) {
t.model.getRange3(r, c, r, c).setValue(val.asc_getText());
// Вызываем функцию пересчета для заголовков форматированной таблицы
t.autoFilters._renameTableColumn(arn);
}
break;
} else {
bIsUpdate = false;
break;
}
// Для paste свой диапазон default:
bIsUpdate = false;
break;
}
if (bIsUpdate) {
if (callTrigger) { t.handlers.trigger("slowOperation", false); }
t.isChanged = true;
t._updateCellsRange(arn, canChangeColWidth);
}
History.EndTransaction();
};
if ("paste" === prop) {
// Для past свой диапазон
if(isLocal === "binary") if(isLocal === "binary")
checkRange = t._pasteFromBinary(val, true); checkRange = t._pasteFromBinary(val, true);
else if(isLocal === true) else if(isLocal === true)
checkRange = t._pasteFromLS(val, true); checkRange = t._pasteFromLS(val, true);
else else
checkRange = t._setInfoAfterPaste(val, onlyActive, true); checkRange = t._setInfoAfterPaste(val, onlyActive, true);
}
this._isLockedCells (checkRange, /*subType*/null, onSelectionCallback); this._isLockedCells (checkRange, /*subType*/null, onSelectionCallback);
}; };
......
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