Commit 56d244c3 authored by GoshaZotov's avatar GoshaZotov

add class SpecialPasteShowOptions(for send information into menu about special paste options)

parent 176d0b3c
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
* Import * Import
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
var prot;
var c_oAscBorderStyles = AscCommon.c_oAscBorderStyles; var c_oAscBorderStyles = AscCommon.c_oAscBorderStyles;
var c_oAscMaxCellOrCommentLength = Asc.c_oAscMaxCellOrCommentLength; var c_oAscMaxCellOrCommentLength = Asc.c_oAscMaxCellOrCommentLength;
var doc = window.document; var doc = window.document;
...@@ -58,6 +59,22 @@ ...@@ -58,6 +59,22 @@
return "rgb(" + (n >> 16 & 0xFF) + "," + (n >> 8 & 0xFF) + "," + (n & 0xFF) + ")"; return "rgb(" + (n >> 16 & 0xFF) + "," + (n >> 8 & 0xFF) + "," + (n & 0xFF) + ")";
} }
function SpecialPasteShowOptions()
{
this.options = [];
this.cellCoord = null;
}
SpecialPasteShowOptions.prototype = {
constructor: SpecialPasteShowOptions,
asc_setCellCoord : function(val) { this.cellCoord = val; },
asc_setOptions : function(val) { this.options = val; },
asc_getCellCoord : function() { return this.cellCoord; },
asc_getOptions : function(val) { return this.options; }
};
function SpecialPasteProps() function SpecialPasteProps()
{ {
this.cellStyle = true; this.cellStyle = true;
...@@ -174,7 +191,7 @@ ...@@ -174,7 +191,7 @@
this.numFormat = true; this.numFormat = true;
break; break;
} }
case c_oSpecialPasteProps.valuesSourceFormating: case c_oSpecialPasteProps.keepSourceFormating:
{ {
//все кроме формул //все кроме формул
this.formula = null; this.formula = null;
...@@ -4224,5 +4241,10 @@ ...@@ -4224,5 +4241,10 @@
window['AscCommonExcel'] = window['AscCommonExcel'] || {}; window['AscCommonExcel'] = window['AscCommonExcel'] || {};
window["AscCommonExcel"].Clipboard = Clipboard; window["AscCommonExcel"].Clipboard = Clipboard;
window["AscCommonExcel"].SpecialPasteProps = SpecialPasteProps; window["AscCommonExcel"].SpecialPasteProps = SpecialPasteProps;
window["Asc"]["SpecialPasteShowOptions"] = window["Asc"].SpecialPasteShowOptions = SpecialPasteShowOptions;
prot = SpecialPasteShowOptions.prototype;
prot["asc_getCellCoord"] = prot.asc_getCellCoord;
prot["asc_getOptions"] = prot.asc_getOptions;
} }
)(jQuery, window); )(jQuery, window);
...@@ -8938,18 +8938,23 @@ ...@@ -8938,18 +8938,23 @@
History.SetSelectionRedo(oSelection); History.SetSelectionRedo(oSelection);
} }
//for special paste
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
var allowedSpecialPasteProps; var allowedSpecialPasteProps;
var sProps = Asc.c_oSpecialPasteProps; var sProps = Asc.c_oSpecialPasteProps;
if(fromBinary) if(fromBinary)
{ {
allowedSpecialPasteProps = [sProps.formulas, sProps.formulasNumberFormating, sProps.keepSourceFormating, sProps.noBorders, sProps.keepSourceColumnWidths, sProps.transpose, sProps.values, sProps.valuesNumberFormating, sProps.valuesSourceFormating, sProps.formating, sProps.pasteLink, sProps.picture, sProps.linkedPicture]; allowedSpecialPasteProps = [sProps.formulas, sProps.formulasNumberFormating, sProps.keepSourceFormating, sProps.noBorders, sProps.keepSourceColumnWidths, sProps.transpose, sProps.values, sProps.valuesNumberFormating, sProps.keepSourceFormating, sProps.formating, sProps.pasteLink, sProps.picture, sProps.linkedPicture];
} }
else else
{ {
//matchDestinationFormatting - пока не добавляю, так как работает как и values //matchDestinationFormatting - пока не добавляю, так как работает как и values
allowedSpecialPasteProps = [sProps.keepSourceFormating, sProps.values]; allowedSpecialPasteProps = [sProps.keepSourceFormating, sProps.values];
} }
this.handlers.trigger("showSpecialPasteOptions", allowedSpecialPasteProps); specialPasteShowOptions.asc_setOptions(allowedSpecialPasteProps);
var cellCoord = this.getCellCoord(selectData[0].c2, selectData[0].r2);
specialPasteShowOptions.asc_setCellCoord(cellCoord);
this.handlers.trigger("showSpecialPasteOptions", specialPasteShowOptions);
}; };
WorksheetView.prototype._loadDataBeforePaste = function ( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth ) { WorksheetView.prototype._loadDataBeforePaste = function ( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth ) {
......
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