Commit ffbf1f28 authored by GoshaZotov's avatar GoshaZotov

special paste undo data(inside shape)

parent b30d3bb1
...@@ -1370,6 +1370,17 @@ ...@@ -1370,6 +1370,17 @@
var target_doc_content = isIntoShape; var target_doc_content = isIntoShape;
insertContent.Elements = this._convertBeforeInsertIntoShapeContent(worksheet, content, isConvertToPPTX, target_doc_content); insertContent.Elements = this._convertBeforeInsertIntoShapeContent(worksheet, content, isConvertToPPTX, target_doc_content);
//TODO конвертирую в текст без форматирую. пеесмотреть!
var specialPasteProps = window["Asc"]["editor"].wb.clipboard.specialPasteProps;
if(specialPasteProps && !specialPasteProps.format)
{
for(var i = 0; i < insertContent.Elements.length; i++)
{
insertContent.Elements[i].Element.Clear_TextFormatting();
}
}
this._insertSelectedContentIntoShapeContent(worksheet, insertContent, target_doc_content); this._insertSelectedContentIntoShapeContent(worksheet, insertContent, target_doc_content);
History.EndTransaction(); History.EndTransaction();
...@@ -1482,6 +1493,12 @@ ...@@ -1482,6 +1493,12 @@
paragraph.Check_NearestPos(NearPos); paragraph.Check_NearestPos(NearPos);
target_doc_content.Insert_Content(selectedContent, NearPos); target_doc_content.Insert_Content(selectedContent, NearPos);
//TODO записываю активную область после каждой вставки. пересомтреть! не записывать при специальной вставке.
//if(!window["Asc"]["editor"].wb.clipboard.specialPasteStart)
//{
window['AscCommon'].g_clipboardBase.specialPasteUndoData.shapeSelectionState = target_doc_content.Get_SelectionState();
//}
worksheet.objectRender.controller.cursorMoveRight(false, false); worksheet.objectRender.controller.cursorMoveRight(false, false);
var oTargetTextObject = AscFormat.getTargetTextObject(worksheet.objectRender.controller); var oTargetTextObject = AscFormat.getTargetTextObject(worksheet.objectRender.controller);
......
...@@ -8828,6 +8828,14 @@ ...@@ -8828,6 +8828,14 @@
undoPreviousPaste(); undoPreviousPaste();
} }
else if(preSpecialPasteData && preSpecialPasteData.shapeSelectionState)
{
//таким образом удаляю вставляенный фрагмент до специальной вставки
var docContent = this.objectRender.controller.getTargetDocContent(true);
var State = preSpecialPasteData.shapeSelectionState;
docContent.Set_SelectionState(State, State.length - 1);
docContent.Remove(1, true, true);
}
//далее специальная вставка //далее специальная вставка
api.wb.clipboard.specialPasteProps = props; api.wb.clipboard.specialPasteProps = props;
......
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