Commit 45f4c9d1 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

рефакторинг

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55986 954022d7-b5bf-4e40-9824-e11837661b57
parent d8a27eda
...@@ -1495,33 +1495,7 @@ ...@@ -1495,33 +1495,7 @@
return newArr; return newArr;
}, },
_editorPasteExec: function (worksheet, node, isText,onlyFromLocalStorage) _pasteFromBinary: function(worksheet, node, onlyFromLocalStorage)
{
if(node == undefined)
return;
var pasteFragment = node;
var t = this;
if(isOnlyLocalBufferSafari && navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('mac'))
onlyFromLocalStorage = true;
//если находимся внутри шейпа
if(worksheet.objectRender.controller.curState.textObject && worksheet.objectRender.controller.curState.textObject.txBody)
{
if(onlyFromLocalStorage)
{
if(t.lStorage && t.lStorage.htmlInShape)
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(t.lStorage.htmlInShape);
}
else
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(node);
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
}
//****binary****
if(copyPasteUseBinary)
{ {
var base64 = null; var base64 = null;
if(onlyFromLocalStorage) if(onlyFromLocalStorage)
...@@ -1530,15 +1504,15 @@ ...@@ -1530,15 +1504,15 @@
{ {
if(t.lStorage.htmlInShape) if(t.lStorage.htmlInShape)
{ {
node = t.lStorage.htmlInShape; return t.lStorage.htmlInShape;
pasteFragment = node;
} }
else else
{ {
worksheet.setSelectionInfo('paste',t,false,true); worksheet.setSelectionInfo('paste',t,false,true);
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
return; return true;
} }
} }
else else
...@@ -1570,7 +1544,8 @@ ...@@ -1570,7 +1544,8 @@
} }
} }
} }
if(base64 != null)
if(base64 != null)//from excel
{ {
var oBinaryFileReader = new Asc.BinaryFileReader(null, true); var oBinaryFileReader = new Asc.BinaryFileReader(null, true);
var tempWorkbook = new Workbook; var tempWorkbook = new Workbook;
...@@ -1592,18 +1567,67 @@ ...@@ -1592,18 +1567,67 @@
} }
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
return;
return true;
}
} }
} else if (base64FromWord && copyPasteFromWordUseBinary) { else if (base64FromWord && copyPasteFromWordUseBinary)//from word
{
var pasteData = this.ReadFromBinaryWord(base64FromWord); var pasteData = this.ReadFromBinaryWord(base64FromWord);
var pasteFromBinaryWord = new Asc.pasteFromBinaryWord(this, worksheet); var pasteFromBinaryWord = new Asc.pasteFromBinaryWord(this, worksheet);
pasteFromBinaryWord._paste(worksheet, pasteData); pasteFromBinaryWord._paste(worksheet, pasteData);
window.GlobalPasteFlag = false; window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0; window.GlobalPasteFlagCounter = 0;
return true;
};
return false;
},
_editorPasteExec: function (worksheet, node, isText,onlyFromLocalStorage)
{
if(node == undefined)
return; return;
var pasteFragment = node;
var t = this;
if(isOnlyLocalBufferSafari && navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('mac'))
onlyFromLocalStorage = true;
//если находимся внутри шейпа
if(worksheet.objectRender.controller.curState.textObject && worksheet.objectRender.controller.curState.textObject.txBody)
{
if(onlyFromLocalStorage)
{
if(t.lStorage && t.lStorage.htmlInShape)
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(t.lStorage.htmlInShape);
} }
else
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(node);
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
} }
//****binary****
var binaryResult;
if(copyPasteUseBinary)
{
binaryResult = this._pasteFromBinary(worksheet, node, onlyFromLocalStorage);
if(binaryResult === true)
return;
else if(binaryResult !== false && binaryResult != undefined)
{
pasteFragment = binaryResult;
node = binaryResult;
};
};
if(activateLocalStorage) if(activateLocalStorage)
{ {
//в случае вставки по нажатию на правую кнопку мыши //в случае вставки по нажатию на правую кнопку мыши
......
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