diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index 7ceeca7d4..85189d4cc 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -118,11 +118,35 @@ define([ var me = this; if ('cut' == eventName) { - me.api.Cut(); + var res = me.api.Cut(); + if (!res) { + _view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text : me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } } else if ('copy' == eventName) { - me.api.Copy(); + var res = me.api.Copy(); + if (!res) { + _view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text : me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } } else if ('paste' == eventName) { - me.api.Paste(); + var res = me.api.Paste(); + if (!res) { + _view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } } else if ('merge' == eventName) { me.api.MergeCells(); } else if ('split' == eventName) { @@ -559,7 +583,9 @@ define([ menuMerge: 'Merge Cells', menuSplit: 'Split Cell', menuDeleteTable: 'Delete Table', - menuReviewChange: 'Review Change' + menuReviewChange: 'Review Change', + textCopyCutPasteActions: 'Copy, Cut and Paste Actions', + errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.' } })(), DE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 057e89dde..ae474b44d 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -108,6 +108,8 @@ "DE.Controllers.DocumentHolder.textColumns": "Columns", "DE.Controllers.DocumentHolder.textGuest": "Guest", "DE.Controllers.DocumentHolder.textRows": "Rows", + "DE.Controllers.DocumentHolder.textCopyCutPasteActions": "Copy, Cut and Paste Actions", + "DE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.", "DE.Controllers.EditContainer.textChart": "Chart", "DE.Controllers.EditContainer.textFooter": "Footer", "DE.Controllers.EditContainer.textHeader": "Header", diff --git a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js index 1640f0e7e..9f629e27d 100644 --- a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js @@ -104,11 +104,35 @@ define([ var me = this; if ('cut' == eventName) { - me.api.Cut(); + var res = me.api.Cut(); + if (!res) { + _view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text : me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } } else if ('copy' == eventName) { - me.api.Copy(); + var res = me.api.Copy(); + if (!res) { + _view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text : me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } } else if ('paste' == eventName) { - me.api.Paste(); + var res = me.api.Paste(); + if (!res) { + _view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } } else if ('delete' == eventName) { me.api.asc_Remove(); } else if ('edit' == eventName) { @@ -329,7 +353,9 @@ define([ menuAddLink: 'Add Link', menuOpenLink: 'Open Link', menuMore: 'More', - sheetCancel: 'Cancel' + sheetCancel: 'Cancel', + textCopyCutPasteActions: 'Copy, Cut and Paste Actions', + errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.' } })(), PE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index f9428eff5..93fcf6335 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -39,6 +39,8 @@ "PE.Controllers.DocumentHolder.menuOpenLink": "Open Link", "PE.Controllers.DocumentHolder.menuPaste": "Paste", "PE.Controllers.DocumentHolder.sheetCancel": "Cancel", + "PE.Controllers.DocumentHolder.textCopyCutPasteActions": "Copy, Cut and Paste Actions", + "PE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.", "PE.Controllers.DocumentPreview.txtFinalMessage": "The end of slide preview. Click to exit.", "PE.Controllers.EditContainer.textChart": "Chart", "PE.Controllers.EditContainer.textHyperlink": "Hyperlink", diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 4e38516d8..6b6979587 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -109,9 +109,39 @@ define([ var info = me.api.asc_getCellInfo(); switch (event) { - case 'cut': me.api.asc_Cut(); break; - case 'copy': me.api.asc_Copy(); break; - case 'paste': me.api.asc_Paste(); break; + case 'cut': + var res = me.api.asc_Cut(); + if (!res) { + me.view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text : me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } + break; + case 'copy': + var res = me.api.asc_Copy(); + if (!res) { + me.view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text : me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } + break; + case 'paste': + var res = me.api.asc_Paste(); + if (!res) { + me.view.hideMenu(); + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + buttons: [{text: 'OK'}] + }); + } + break; case 'del': me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All); break; case 'wrap': me.api.asc_setCellTextWrap(true); break; case 'unwrap': me.api.asc_setCellTextWrap(false); break; @@ -390,7 +420,9 @@ define([ menuMore: 'More', sheetCancel: 'Cancel', menuFreezePanes: 'Freeze Panes', - menuUnfreezePanes: 'Unfreeze Panes' + menuUnfreezePanes: 'Unfreeze Panes', + textCopyCutPasteActions: 'Copy, Cut and Paste Actions', + errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.' } })(), SSE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index ce7cdb071..6c95e03b3 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -42,6 +42,8 @@ "SSE.Controllers.DocumentHolder.menuWrap": "Wrap", "SSE.Controllers.DocumentHolder.sheetCancel": "Cancel", "SSE.Controllers.DocumentHolder.warnMergeLostData": "Operation can destroy data in the selected cells.
Continue?", + "SSE.Controllers.DocumentHolder.textCopyCutPasteActions": "Copy, Cut and Paste Actions", + "SSE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.", "SSE.Controllers.EditCell.textAuto": "Auto", "SSE.Controllers.EditCell.textFonts": "Fonts", "SSE.Controllers.EditCell.textPt": "pt",