Commit 5e7f5ded authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 33863

parent 3a09861e
......@@ -1124,7 +1124,10 @@
_convertBeforeInsertIntoShapeContent: function(worksheet, content, isConvertToPPTX, target_doc_content)
{
var elements = [], selectedElement, element;
var bRemoveHyperlink = false;
if(target_doc_content && target_doc_content.Is_ChartTitleContent && target_doc_content.Is_ChartTitleContent()){
bRemoveHyperlink = true;
}
for(var i = 0; i < content.length; i++)
{
selectedElement = new CSelectedElement();
......@@ -1132,7 +1135,7 @@
if(type_Paragraph === element.GetType())//paragraph
{
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(element, worksheet.model.DrawingDocument, target_doc_content, true);
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(element, worksheet.model.DrawingDocument, target_doc_content, true, bRemoveHyperlink);
elements.push(selectedElement);
}
else if(type_Table === element.GetType())//table
......@@ -1143,7 +1146,7 @@
for(var j = 0; j < paragraphs.length; j++)
{
selectedElement = new CSelectedElement();
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(paragraphs[j], worksheet.model.DrawingDocument, target_doc_content);
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(paragraphs[j], worksheet.model.DrawingDocument, target_doc_content, true, bRemoveHyperlink);
elements.push(selectedElement);
}
}
......
......@@ -425,6 +425,14 @@
return false;
};
CDrawingDocContent.prototype.Is_ChartTitleContent = function(){
if(this.Parent instanceof AscFormat.CTextBody &&
this.Parent.parent instanceof AscFormat.CTitle){
return true;
}
return false;
};
CDrawingDocContent.prototype.Selection_Draw_Page = function(PageIndex){
var CurPage = PageIndex;
if (CurPage < 0 || CurPage >= this.Pages.length)
......
......@@ -261,7 +261,7 @@ function CopyRunToPPTX(Run, Paragraph, bHyper)
return NewRun;
}
function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent, bIsAddMath)
function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent, bIsAddMath, bRemoveHyperlink)
{
var _drawing_document = isRealObject(drawingDocument) ? drawingDocument : paragraph.DrawingDocument;
var _new_parent = isRealObject(newParent) ? newParent : paragraph.Parent;
......@@ -308,9 +308,23 @@ function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent, bIsAddMat
new_paragraph.Internal_Content_Add(new_paragraph.Content.length, CopyRunToPPTX(Item, new_paragraph), false);
}
else if(Item.Type === para_Hyperlink)
{
if(bRemoveHyperlink === true)
{
for(var j = 0; j < Item.Content.length; ++j)
{
if(Item.Content[j].Type === para_Run)
{
new_paragraph.Internal_Content_Add(new_paragraph.Content.length, CopyRunToPPTX(Item.Content[j], new_paragraph), false);
}
}
}
else
{
new_paragraph.Internal_Content_Add(new_paragraph.Content.length, ConvertHyperlinkToPPTX(Item, new_paragraph), false);
}
}
else if(true === bIsAddMath && Item.Type === para_Math)
{
new_paragraph.Internal_Content_Add(new_paragraph.Content.length, Item.Copy(), false);
......
......@@ -2501,7 +2501,7 @@ PasteProcessor.prototype =
{
if(type_Paragraph === aContent.content[i].Get_Type())
{
newContent.push(AscFormat.ConvertParagraphToPPTX(aContent.content[i], this.oDocument.DrawingDocument, this.oDocument));
newContent.push(AscFormat.ConvertParagraphToPPTX(aContent.content[i], this.oDocument.DrawingDocument, this.oDocument, false, true));
}
}
......@@ -2587,7 +2587,7 @@ PasteProcessor.prototype =
element.Get_AllDrawingObjects(drawings);
if(type_Paragraph == element.GetType())//paragraph
{
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(element, null, null, true);
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(element, null, null, true, false);
elements.push(selectedElement);
}
else if(type_Table == element.GetType())//table
......@@ -3879,7 +3879,7 @@ PasteProcessor.prototype =
{
if(cDocumentContent.Content[n] instanceof Paragraph)
{
cDocumentContent.Content[nIndex] = AscFormat.ConvertParagraphToPPTX(cDocumentContent.Content[nIndex]);
cDocumentContent.Content[nIndex] = AscFormat.ConvertParagraphToPPTX(cDocumentContent.Content[nIndex], null, null, true, false);
++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