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

Падение при открытии textFit с гиперссылкой

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60124 954022d7-b5bf-4e40-9824-e11837661b57
parent fcdda1b2
...@@ -477,25 +477,9 @@ CTextBody.prototype = ...@@ -477,25 +477,9 @@ CTextBody.prototype =
new_spacing.After = spc; new_spacing.After = spc;
parg.Set_Spacing(new_spacing); parg.Set_Spacing(new_spacing);
} }
if(isRealNumber(font_scale)) if(isRealNumber(font_scale))
{ {
var par_font_size = parg.Get_CompiledPr(false).TextPr.FontSize; this.checkParagraphContent(parg, font_scale, true);
for(var r = 0; r < parg.Content.length; ++r)
{
var item = parg.Content[r];
if(isRealNumber(item.Pr.FontSize))
{
item.Set_FontSize(Math.round(item.Pr.FontSize*font_scale));
}
else
{
if(r === 0)
{
item.Set_FontSize(Math.round(par_font_size*font_scale));
}
}
}
} }
} }
...@@ -507,6 +491,38 @@ CTextBody.prototype = ...@@ -507,6 +491,38 @@ CTextBody.prototype =
this.bodyPr.textFit = null; this.bodyPr.textFit = null;
}, },
checkParagraphContent: function(parg, fontScale, bParagraph)
{
for(var r = 0; r < parg.Content.length; ++r)
{
var item = parg.Content[r];
switch(item.Type)
{
case para_Run:
{
if(isRealNumber(item.Pr.FontSize))
{
item.Set_FontSize(Math.round(item.Pr.FontSize*fontScale));
}
else if(bParagraph)
{
if(r === 0)
{
var par_font_size = parg.Get_CompiledPr(false).TextPr.FontSize;
item.Set_FontSize(Math.round(par_font_size*fontScale));
}
}
break;
}
case para_Hyperlink:
{
this.checkParagraphContent(item, fontScale, false);
break;
}
}
}
},
Refresh_RecalcData: function() Refresh_RecalcData: function()
{ {
if(this.parent && this.parent.recalcInfo) if(this.parent && this.parent.recalcInfo)
......
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