Commit 3f281415 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 29516 - Созданная в редакторе презентация открывается в MS PowerPoint с ошибками

Поправлены баги с копированием текстартов между редакторами.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63747 954022d7-b5bf-4e40-9824-e11837661b57
parent 6817106d
......@@ -4612,11 +4612,6 @@ CUniFill.prototype =
this.fill && this.fill.convertToWordMods();
},
getCalcFill: function()
{
return this;
},
getObjectType: function()
{
......@@ -10780,6 +10775,11 @@ CBg.prototype =
{
this.bgPr.Write_ToBinary(w);
}
w.WriteBool(isRealObject(this.bgRef));
if(isRealObject(this.bgRef))
{
this.bgRef.Write_ToBinary(w);
}
},
Read_FromBinary: function(r)
......@@ -10789,6 +10789,11 @@ CBg.prototype =
this.bgPr = new CBgPr();
this.bgPr.Read_FromBinary(r);
}
if(r.GetBool())
{
this.bgRef = new StyleRef();
this.bgRef.Read_FromBinary(r);
}
},
Undo: function(data)
......
......@@ -223,6 +223,11 @@ function CopyRunToPPTX(Run, Paragraph, bHyper)
}
RunPr.Underline = true;
}
if(RunPr.TextFill)
{
RunPr.Unifill = RunPr.TextFill;
RunPr.TextFill = undefined;
}
NewRun.Set_Pr( RunPr );
......@@ -269,6 +274,12 @@ function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent)
new_paragraph.Set_Pr(oCopyPr);
var oNewEndPr = paragraph.TextPr.Value.Copy();
if(oNewEndPr.TextFill)
{
oNewEndPr.Unifill = oNewEndPr.TextFill;
oNewEndPr.TextFill = undefined;
}
new_paragraph.TextPr.Set_Value( paragraph.TextPr.Value );
new_paragraph.Internal_Content_Remove2(0, new_paragraph.Content.length);
var Count = paragraph.Content.length;
......@@ -316,10 +327,111 @@ function ConvertParagraphToWord(paragraph, docContent)
var oldFlag = paragraph.bFromDocument;
paragraph.bFromDocument = true;
var new_paragraph = paragraph.Copy(_docContent);
CheckWordParagraphContent(new_paragraph.Content);
var NewRPr = CheckWordRunPr(new_paragraph.TextPr.Value);
if(NewRPr)
{
new_paragraph.TextPr.Apply_TextPr(NewRPr);
}
paragraph.bFromDocument = oldFlag;
return new_paragraph;
}
function CheckWordRunPr(Pr)
{
var NewRPr = null;
if(Pr.Unifill && Pr.Unifill.fill )
{
switch(Pr.Unifill.fill.type)
{
case FILL_TYPE_SOLID:
{
if(Pr.Unifill.fill.color && Pr.Unifill.fill.color.color)
{
switch(Pr.Unifill.fill.color.color.type)
{
case c_oAscColor.COLOR_TYPE_SCHEME:
{
if(Pr.Unifill.fill.color.Mods && Pr.Unifill.fill.color.Mods.Mods.length !== 0)
{
if(!Pr.Unifill.fill.color.canConvertPPTXModsToWord())
{
NewRPr = Pr.Copy();
NewRPr.TextFill = NewRPr.Unifill;
NewRPr.Unifill = undefined;
}
else
{
NewRPr = Pr.Copy();
NewRPr.Unifill.convertToWordMods();
}
}
break;
}
case c_oAscColor.COLOR_TYPE_SRGB:
{
NewRPr = Pr.Copy();
var RGBA = Pr.Unifill.fill.color.color.RGBA;
NewRPr.Color = new CDocumentColor(RGBA.R, RGBA.G, RGBA.B);
NewRPr.Unifill = undefined;
break;
}
default:
{
NewRPr = Pr.Copy();
NewRPr.TextFill = NewRPr.Unifill;
NewRPr.Unifill = undefined;
}
}
}
break;
}
case FILL_TYPE_PATT:
case FILL_TYPE_BLIP:
{
NewRPr = Pr.Copy();
NewRPr.TextFill = CreateUnfilFromRGB(0, 0, 0);
NewRPr.Unifill = undefined;
break;
}
default :
{
NewRPr = Pr.Copy();
NewRPr.TextFill = NewRPr.Unifill;
NewRPr.Unifill = undefined;
break;
}
}
}
return NewRPr;
}
function CheckWordParagraphContent(aContent)
{
for(var i = 0; i < aContent.length; ++i)
{
var oItem = aContent[i];
switch(oItem.Type)
{
case para_Run:
{
var NewRPr = CheckWordRunPr(oItem.Pr);
if(NewRPr)
{
oItem.Set_Pr(NewRPr);
}
break;
}
case para_Hyperlink:
{
CheckWordParagraphContent(oItem.Content);
break;
}
}
}
}
function RecalculateDocContentByMaxLine(oDocContent, dMaxWidth, bNeedRecalcAllDrawings)
{
......@@ -2213,6 +2325,11 @@ CShape.prototype =
return this.checkAutofit(true) || this.checkContentWordArt(this.getDocContent()) || this.getBodyPr().prstTxWarp != null;
},
checkExtentsByAutofit: function(oShape)
{
},
recalculateLocalTransform: function(transform)
{
......
......@@ -3320,6 +3320,7 @@ CPresentation.prototype =
this.Check_GraphicFrameRowHeight(Content.Drawings[i].Drawing);
}
Content.Drawings[i].Drawing.addToDrawingObjects();
Content.Drawings[i].Drawing.checkExtentsByDocContent && Content.Drawings[i].Drawing.checkExtentsByDocContent();
this.Slides[this.CurPage].graphicObjects.selectObject(Content.Drawings[i].Drawing, 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