Commit 44c22388 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

29191 [Copy&Paste] Ошибка в консоле после копирования фигуры с таблицей из CDE в CPE

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62133 954022d7-b5bf-4e40-9824-e11837661b57
parent 658338ad
...@@ -229,6 +229,8 @@ function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent) ...@@ -229,6 +229,8 @@ function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent)
var _new_parent = isRealObject(newParent) ? newParent : paragraph.Parent; var _new_parent = isRealObject(newParent) ? newParent : paragraph.Parent;
var new_paragraph = new Paragraph(_drawing_document, _new_parent, 0, 0, 0, 0, 0, true); var new_paragraph = new Paragraph(_drawing_document, _new_parent, 0, 0, 0, 0, 0, true);
if(!(paragraph instanceof Paragraph))
return new_paragraph;
var oCopyPr = paragraph.Pr.Copy(); var oCopyPr = paragraph.Pr.Copy();
oCopyPr.ContextualSpacing = undefined; oCopyPr.ContextualSpacing = undefined;
...@@ -468,11 +470,15 @@ CShape.prototype = ...@@ -468,11 +470,15 @@ CShape.prototype =
new_content.Internal_Content_RemoveAll(); new_content.Internal_Content_RemoveAll();
var paragraphs = this.textBoxContent.Content; var paragraphs = this.textBoxContent.Content;
var index = 0;
for(var i = 0; i < paragraphs.length; ++i) for(var i = 0; i < paragraphs.length; ++i)
{ {
var cur_par = paragraphs[i]; var cur_par = paragraphs[i];
var new_paragraph = ConvertParagraphToPPTX(cur_par, drawingDocument, new_content); if(cur_par instanceof Paragraph)
new_content.Internal_Content_Add( i, new_paragraph, false ); {
var new_paragraph = ConvertParagraphToPPTX(cur_par, drawingDocument, new_content);
new_content.Internal_Content_Add( index++, new_paragraph, false );
}
} }
tx_body.setContent(new_content); tx_body.setContent(new_content);
c.setTxBody(tx_body); c.setTxBody(tx_body);
......
...@@ -4812,10 +4812,15 @@ PasteProcessor.prototype = ...@@ -4812,10 +4812,15 @@ PasteProcessor.prototype =
{ {
var cDocumentContent = table.Content[i].Content[j].Content; var cDocumentContent = table.Content[i].Content[j].Content;
cDocumentContent.bPresentation = true; cDocumentContent.bPresentation = true;
var nIndex = 0;
for(var n = 0; n < cDocumentContent.Content.length; n++) for(var n = 0; n < cDocumentContent.Content.length; n++)
{ {
cDocumentContent.Content[n] = ConvertParagraphToPPTX(cDocumentContent.Content[n]); if(cDocumentContent.Content[n] instanceof Paragraph)
{
cDocumentContent.Content[nIndex] = ConvertParagraphToPPTX(cDocumentContent.Content[nIndex]);
++nIndex;
}
} }
} }
} }
......
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