Commit ad5bd150 authored by Oleg Korshul's avatar Oleg Korshul

copy/paste desktop editor

parent eec7703c
......@@ -454,70 +454,31 @@ var editor;
};
spreadsheet_api.prototype.asc_Copy = function() {
if (window["AscDesktopEditor"]) {
var _e = {};
_e.ctrlKey = true;
_e.shiftKey = false;
_e.which = 67;
window["AscDesktopEditorButtonMode"] = true;
if (!this.asc_getCellEditMode())
this.controller._onWindowKeyDown(_e);
else
this.wb.cellEditor._onWindowKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Copy"]();
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
};
spreadsheet_api.prototype.asc_Paste = function() {
if (window["AscDesktopEditor"]) {
var _e = {};
_e.ctrlKey = true;
_e.shiftKey = false;
_e.which = 86;
window["AscDesktopEditorButtonMode"] = true;
if (!this.asc_getCellEditMode())
this.controller._onWindowKeyDown(_e);
else
this.wb.cellEditor._onWindowKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Paste"]();
return true;
}
else if (!AscCommon.g_clipboardBase.IsWorking()) {
if (!AscCommon.g_clipboardBase.IsWorking()) {
return AscCommon.g_clipboardBase.Button_Paste();
}
return false;
};
spreadsheet_api.prototype.asc_Cut = function() {
if (window["AscDesktopEditor"]) {
var _e = {};
_e.ctrlKey = true;
_e.shiftKey = false;
_e.which = 88;
window["AscDesktopEditorButtonMode"] = true;
if (!this.asc_getCellEditMode())
this.controller._onWindowKeyDown(_e);
else
this.wb.cellEditor._onWindowKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
if (window["AscDesktopEditor"])
{
window["AscDesktopEditor"]["Cut"]();
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
};
......
......@@ -1819,16 +1819,10 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
var _e = new AscCommon.CKeyboardEvent();
_e.CtrlKey = true;
_e.KeyCode = 67;
window["AscDesktopEditorButtonMode"] = true;
this.WordControl.m_oLogicDocument.OnKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
window["AscDesktopEditor"]["Copy"]();
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
};
asc_docs_api.prototype.Update_ParaTab = function(Default_Tab, ParaTabs)
{
......@@ -1838,30 +1832,28 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
var _e = new AscCommon.CKeyboardEvent();
_e.CtrlKey = true;
_e.KeyCode = 88;
window["AscDesktopEditorButtonMode"] = true;
this.WordControl.m_oLogicDocument.OnKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
window["AscDesktopEditor"]["Cut"]();
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
};
asc_docs_api.prototype.Paste = function()
{
if (window["AscDesktopEditor"])
{
var _e = new AscCommon.CKeyboardEvent();
_e.CtrlKey = true;
_e.KeyCode = 86;
window["AscDesktopEditor"]["Paste"]();
return true;
}
if (!this.WordControl.m_oLogicDocument)
return false;
window["AscDesktopEditorButtonMode"] = true;
this.WordControl.m_oLogicDocument.OnKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content))
{
if (AscCommon.g_clipboardBase.IsWorking())
return false;
return;
return AscCommon.g_clipboardBase.Button_Paste();
}
};
asc_docs_api.prototype.Share = function()
......
......@@ -1863,15 +1863,8 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
var _e = new AscCommon.CKeyboardEvent();
_e.CtrlKey = true;
_e.KeyCode = 67;
window["AscDesktopEditorButtonMode"] = true;
this.WordControl.m_oLogicDocument.OnKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
window["AscDesktopEditor"]["Copy"]();
return true;
}
return AscCommon.g_clipboardBase.Button_Copy();
};
......@@ -1883,15 +1876,8 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
var _e = new AscCommon.CKeyboardEvent();
_e.CtrlKey = true;
_e.KeyCode = 88;
window["AscDesktopEditorButtonMode"] = true;
this.WordControl.m_oLogicDocument.OnKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
window["AscDesktopEditor"]["Cut"]();
return true;
}
return AscCommon.g_clipboardBase.Button_Cut();
};
......@@ -1899,16 +1885,11 @@ background-repeat: no-repeat;\
{
if (window["AscDesktopEditor"])
{
var _e = new AscCommon.CKeyboardEvent();
_e.CtrlKey = true;
_e.KeyCode = 86;
window["AscDesktopEditorButtonMode"] = true;
this.WordControl.m_oLogicDocument.OnKeyDown(_e);
window["AscDesktopEditorButtonMode"] = false;
return;
window["AscDesktopEditor"]["Paste"]();
return true;
}
if (!this.WordControl.m_oLogicDocument)
return false;
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content))
{
......
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