Skip to content

Commit

Permalink
fix special paste
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry-Ilyushechkin committed Feb 24, 2025
1 parent dc93c88 commit b193ce8
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions apps/spreadsheeteditor/main/app/controller/DocumentHolderExt.js
Original file line number Diff line number Diff line change
Expand Up @@ -3308,12 +3308,12 @@ define([], function () {
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaWithoutBorders] = [me.txtPasteBorders, 0];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaColumnWidth] = [me.txtPasteColWidths, 0];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.mergeConditionalFormating] = [me.txtPasteMerge, 0];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = [me.txtPasteTranspose, 0];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyValues] = [me.txtPasteValues, 1];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueNumberFormat] = [me.txtPasteValNumFormat, 1];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueAllFormating] = [me.txtPasteValFormat, 1];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormating] = [me.txtPasteFormat, 2];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.link] = [me.txtPasteLink, 2];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = [me.txtPasteTranspose, 2];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = [me.txtPastePicture, 2];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.linkedPicture] = [me.txtPasteLinkPicture, 2];
me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = [me.txtPasteSourceFormat, 2];
Expand Down Expand Up @@ -3345,14 +3345,18 @@ define([], function () {
groups[i] = [];
}

var importText;
var importText, pasteItem;

_.each(pasteItems, function(menuItem, index) {
if (menuItem === Asc.c_oSpecialPasteProps.paste) {
return;
}

if (menuItem == Asc.c_oSpecialPasteProps.useTextImport) {
if (menuItem == Asc.c_oSpecialPasteProps.paste) {
pasteItem = new Common.UI.MenuItem({
caption: me._arrSpecialPaste[menuItem][0] + (me.hkSpecPaste[menuItem] ? ' (' + me.hkSpecPaste[menuItem] + ')' : ''),
value: menuItem,
checkable: true,
toggleGroup: 'specialPasteGroup'
}).on('click', _.bind(me.onSpecialPasteItemClick, me));
me._arrSpecialPaste[menuItem][2] = pasteItem;
} else if (menuItem == Asc.c_oSpecialPasteProps.useTextImport) {
importText = new Common.UI.MenuItem({
caption: me._arrSpecialPaste[menuItem][0] + (me.hkSpecPaste[menuItem] ? ' (' + me.hkSpecPaste[menuItem] + ')' : ''),
value: menuItem,
Expand All @@ -3372,14 +3376,11 @@ define([], function () {
}
});
var groupTitles = [me.txtFormula, me.txtValue, me.txtOther];

menu.addItem(new Common.UI.MenuItem({
caption: me.txtPaste + ' (P)',
value: 'paste',
checkable: true,
toggleGroup: 'specialPasteGroup'
}).on('click', _.bind(me.onSpecialPasteItemClick, me)));


if (pasteItem) {
menu.addItem(pasteItem);
}

for (var i = 0; i < 3; i++) {
if (groups[i].length > 0) {
if (menu.items.length > 0) {
Expand Down

0 comments on commit b193ce8

Please sign in to comment.