Commit ad5bd150 authored by Oleg Korshul's avatar Oleg Korshul

copy/paste desktop editor

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