Commit 80ab337f authored by GoshaZotov's avatar GoshaZotov

changes into getBinaryForCopy

wsview->specialPaste
parent f44f33aa
...@@ -295,6 +295,11 @@ ...@@ -295,6 +295,11 @@
var t = this; var t = this;
t.pasteProcessor.clean(); t.pasteProcessor.clean();
if(null === this.specialPasteProps)
{
this.pasteProcessor.oSpecialPaste.activeRange = ws.model.selectionRange.clone(ws.model);
}
switch (_format) switch (_format)
{ {
case AscCommon.c_oAscClipboardDataFormat.HtmlElement: case AscCommon.c_oAscClipboardDataFormat.HtmlElement:
...@@ -402,7 +407,7 @@ ...@@ -402,7 +407,7 @@
return {base64: sBase64, html: container.innerHTML}; return {base64: sBase64, html: container.innerHTML};
}, },
getBinaryForCopy: function(worksheet) getBinaryForCopy: function(worksheet, activeRange)
{ {
var objectRender = worksheet.objectRender; var objectRender = worksheet.objectRender;
var isIntoShape = objectRender.controller.getTargetDocContent(); var isIntoShape = objectRender.controller.getTargetDocContent();
...@@ -418,7 +423,8 @@ ...@@ -418,7 +423,8 @@
pptx_content_writer.Start_UseFullUrl(); pptx_content_writer.Start_UseFullUrl();
// ToDo multiselect ? // ToDo multiselect ?
var oBinaryFileWriter = new AscCommonExcel.BinaryFileWriter(worksheet.model.workbook, worksheet.model.selectionRange.getLast()); var selectionRange = activeRange ? activeRange : worksheet.model.selectionRange.getLast();
var oBinaryFileWriter = new AscCommonExcel.BinaryFileWriter(worksheet.model.workbook, selectionRange);
sBase64 = "xslData;" + oBinaryFileWriter.Write(); sBase64 = "xslData;" + oBinaryFileWriter.Write();
pptx_content_writer.End_UseFullUrl(); pptx_content_writer.End_UseFullUrl();
......
...@@ -8704,9 +8704,13 @@ ...@@ -8704,9 +8704,13 @@
} else { } else {
newRange = this._pasteFromHTML(val, true); newRange = this._pasteFromHTML(val, true);
} }
var sBinary = window["Asc"]["editor"].wb.clipboard.copyProcessor.getBinaryForCopy(this);
if(!window["Asc"]["editor"].wb.clipboard.specialPasteProps)
{
var sBinary = window["Asc"]["editor"].wb.clipboard.copyProcessor.getBinaryForCopy(this, newRange);
window["Asc"]["editor"].wb.clipboard.pasteProcessor.oSpecialPaste.undoBinary = sBinary; window["Asc"]["editor"].wb.clipboard.pasteProcessor.oSpecialPaste.undoBinary = sBinary;
//this.oSpecialPaste.undoImgsId; //this.oSpecialPaste.undoImgsId;
}
checkRange = [newRange]; checkRange = [newRange];
} }
...@@ -8722,6 +8726,12 @@ ...@@ -8722,6 +8726,12 @@
//откатываемся до того, что было до вставки //откатываемся до того, что было до вставки
if(api.wb.clipboard.pasteProcessor.oSpecialPaste.undoBinary) if(api.wb.clipboard.pasteProcessor.oSpecialPaste.undoBinary)
{ {
var tempProps = new AscCommonExcel.SpecialPasteProps();
api.wb.clipboard.specialPasteProps = tempProps;
//меняем activeRange
this.model.selectionRange = api.wb.clipboard.pasteProcessor.oSpecialPaste.activeRange.clone(this.model);
//откатываем данные в ячейках //откатываем данные в ячейках
api.wb.clipboard.pasteProcessor.pasteFromBinary(this, api.wb.clipboard.pasteProcessor.oSpecialPaste.undoBinary); api.wb.clipboard.pasteProcessor.pasteFromBinary(this, api.wb.clipboard.pasteProcessor.oSpecialPaste.undoBinary);
...@@ -8730,11 +8740,12 @@ ...@@ -8730,11 +8740,12 @@
} }
//далее специальная вставка //далее специальная вставка
if(api.wb.clipboard.pasteProcessor.oSpecialPaste.oPreSpecialPasteData)
{
var tempProps = new AscCommonExcel.SpecialPasteProps(); var tempProps = new AscCommonExcel.SpecialPasteProps();
tempProps.setProps(props); tempProps.setProps(props);
api.wb.clipboard.specialPasteProps = tempProps; api.wb.clipboard.specialPasteProps = tempProps;
if(api.wb.clipboard.pasteProcessor.oSpecialPaste.oPreSpecialPasteData)
{
var oPreSpecialPasteData = api.wb.clipboard.pasteProcessor.oSpecialPaste.oPreSpecialPasteData; var oPreSpecialPasteData = api.wb.clipboard.pasteProcessor.oSpecialPaste.oPreSpecialPasteData;
api.wb.clipboard.pasteData(this, oPreSpecialPasteData._format, oPreSpecialPasteData.data1, oPreSpecialPasteData.data2, oPreSpecialPasteData.text_data); api.wb.clipboard.pasteData(this, oPreSpecialPasteData._format, oPreSpecialPasteData.data1, oPreSpecialPasteData.data2, oPreSpecialPasteData.text_data);
} }
...@@ -9479,7 +9490,7 @@ ...@@ -9479,7 +9490,7 @@
var skipFormat = null; var skipFormat = null;
var noSkipVal = null; var noSkipVal = null;
rangeStyle.value = newVal.getValue(); rangeStyle.val = newVal.getValue();
var value2 = newVal.getValue2(); var value2 = newVal.getValue2();
for (var nF = 0; nF < value2.length; nF++) { for (var nF = 0; nF < value2.length; nF++) {
if (value2[nF] && value2[nF].sId) { if (value2[nF] && value2[nF].sId) {
...@@ -9581,11 +9592,11 @@ ...@@ -9581,11 +9592,11 @@
{ {
arrFormula.push(rangeStyle.formula); arrFormula.push(rangeStyle.formula);
} }
else if(rangeStyle.cellValueData) else if(rangeStyle.cellValueData && specialPasteProps.font)
{ {
rangeStyle.cellValueData.cell.setValueData(rangeStyle.cellValueData.valueData); rangeStyle.cellValueData.cell.setValueData(rangeStyle.cellValueData.valueData);
} }
else if(rangeStyle.value2) else if(rangeStyle.value2 && specialPasteProps.font)
{ {
if(formulaProps) if(formulaProps)
{ {
......
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