Commit b30d3bb1 authored by GoshaZotov's avatar GoshaZotov

for special paste into shape content

parent 025ce72a
...@@ -1373,6 +1373,36 @@ ...@@ -1373,6 +1373,36 @@
this._insertSelectedContentIntoShapeContent(worksheet, insertContent, target_doc_content); this._insertSelectedContentIntoShapeContent(worksheet, insertContent, target_doc_content);
History.EndTransaction(); History.EndTransaction();
//for special paste
if(!window["Asc"]["editor"].wb.clipboard.specialPasteStart)
{
var sProps = Asc.c_oSpecialPasteProps;
var curParPos = isIntoShape.Content[isIntoShape.CurPos.ContentPos].CurPos;
var curShape = isIntoShape.Parent.parent;
var asc_getcvt = Asc.getCvtRatio;
var mmToPx = asc_getcvt(3/*px*/, 0/*pt*/, worksheet._getPPIX());
var ptToPx = asc_getcvt(1/*px*/, 0/*pt*/, worksheet._getPPIX());
var cellsLeftPx = worksheet.cellsLeft * ptToPx;
var cellsTopPx = worksheet.cellsTop * ptToPx;
var offsetXPx = worksheet.cols[worksheet.visibleRange.c1].left * ptToPx - cellsLeftPx;
var offsetYPx = worksheet.rows[worksheet.visibleRange.r1].top * ptToPx - cellsTopPx;
var x_curParPosPx = curParPos.X * mmToPx;
var x_curShapePosPx = curShape.x * mmToPx + cellsLeftPx;
var xPos = x_curParPosPx + x_curShapePosPx - offsetXPx;
var y_curParPosPx = curParPos.Y * mmToPx;
var y_curShapePosPx = curShape.y * mmToPx + cellsTopPx;
var yPos = y_curParPosPx + y_curShapePosPx - offsetYPx;
var position = {x: xPos, y: yPos};
var allowedSpecialPasteProps = [sProps.sourceformatting, sProps.destinationFormatting];
worksheet.showSpecialPasteOptions(allowedSpecialPasteProps, null, position);
}
}, },
_convertBeforeInsertIntoShapeContent: function(worksheet, content, isConvertToPPTX, target_doc_content) _convertBeforeInsertIntoShapeContent: function(worksheet, content, isConvertToPPTX, target_doc_content)
...@@ -2548,6 +2578,14 @@ ...@@ -2548,6 +2578,14 @@
} }
window["Asc"]["editor"].wb.clipboard.end_paste(); window["Asc"]["editor"].wb.clipboard.end_paste();
//for special paste
if(!window["Asc"]["editor"].wb.clipboard.specialPasteStart)
{
var sProps = Asc.c_oSpecialPasteProps;
var allowedSpecialPasteProps = [sProps.sourceformatting, sProps.destinationFormatting];
//worksheet.showSpecialPasteOptions(allowedSpecialPasteProps);
}
}; };
worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback); worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback);
......
...@@ -9807,19 +9807,29 @@ ...@@ -9807,19 +9807,29 @@
} }
}; };
WorksheetView.prototype.showSpecialPasteOptions = function(props, range) WorksheetView.prototype.showSpecialPasteOptions = function(props, range, positionShapeContent)
{ {
var _clipboard = window["Asc"]["editor"].wb.clipboard; var _clipboard = window["Asc"]["editor"].wb.clipboard;
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions(); var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
_clipboard.specialPasteRange = range; _clipboard.specialPasteRange = range;
var isVisible = null !== this.getCellVisibleRange(range.c2, range.r2); var cellCoord;
var cellCoord = this.getCellCoord(range.c2, range.r2); if(!positionShapeContent)
if(!isVisible)
{ {
cellCoord._x = -1; var isVisible = null !== this.getCellVisibleRange(range.c2, range.r2);
cellCoord._y = -1; cellCoord = this.getCellCoord(range.c2, range.r2);
if(!isVisible)
{
cellCoord._x = -1;
cellCoord._y = -1;
}
} }
else
{
//var isVisible = null !== this.getCellVisibleRange(range.c2, range.r2);
cellCoord = new AscCommon.asc_CRect( positionShapeContent.x, positionShapeContent.y, 0, 0 );
}
specialPasteShowOptions.asc_setOptions(props); specialPasteShowOptions.asc_setOptions(props);
specialPasteShowOptions.asc_setCellCoord(cellCoord); specialPasteShowOptions.asc_setCellCoord(cellCoord);
......
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