Commit a98fc8de authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 32970

parent abfdb1b4
......@@ -2747,7 +2747,9 @@ PasteProcessor.prototype =
case "Content":
{
var docContent = this.ReadPresentationText(stream);
if(docContent.length === 0){
return;
}
var presentationSelectedContent = new PresentationSelectedContent();
presentationSelectedContent.DocContent = new CSelectedContent();
presentationSelectedContent.DocContent.Elements = docContent;
......
......@@ -3972,28 +3972,30 @@ CPresentation.prototype =
}
else if(Content.DocContent)
{
var target_doc_content = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(true), paragraph, NearPos;
if(target_doc_content)
{
if(target_doc_content.Selection.Use)
if(Content.DocContent.Elements.length > 0){
var target_doc_content = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(true), paragraph, NearPos;
if(target_doc_content)
{
this.Slides[this.CurPage].graphicObjects.removeCallback(1);
if(target_doc_content.Selection.Use)
{
this.Slides[this.CurPage].graphicObjects.removeCallback(1);
}
paragraph = target_doc_content.Content[target_doc_content.CurPos.ContentPos];
if (null != paragraph && type_Paragraph == paragraph.GetType())
{
NearPos = { Paragraph: paragraph, ContentPos: paragraph.Get_ParaContentPos(false, false) };
paragraph.Check_NearestPos(NearPos);
target_doc_content.Insert_Content(Content.DocContent, NearPos);
}
var oTargetTextObject = AscFormat.getTargetTextObject(this.Slides[this.CurPage].graphicObjects);
oTargetTextObject && oTargetTextObject.checkExtentsByDocContent && oTargetTextObject.checkExtentsByDocContent();
}
paragraph = target_doc_content.Content[target_doc_content.CurPos.ContentPos];
if (null != paragraph && type_Paragraph == paragraph.GetType())
else
{
NearPos = { Paragraph: paragraph, ContentPos: paragraph.Get_ParaContentPos(false, false) };
paragraph.Check_NearestPos(NearPos);
target_doc_content.Insert_Content(Content.DocContent, NearPos);
var shape = this.CreateAndAddShapeFromSelectedContent(Content.DocContent);
this.Slides[this.CurPage].graphicObjects.resetSelection();
this.Slides[this.CurPage].graphicObjects.selectObject(shape, 0);
}
var oTargetTextObject = AscFormat.getTargetTextObject(this.Slides[this.CurPage].graphicObjects);
oTargetTextObject && oTargetTextObject.checkExtentsByDocContent && oTargetTextObject.checkExtentsByDocContent();
}
else
{
var shape = this.CreateAndAddShapeFromSelectedContent(Content.DocContent);
this.Slides[this.CurPage].graphicObjects.resetSelection();
this.Slides[this.CurPage].graphicObjects.selectObject(shape, 0);
}
}
}
......
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