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

Bug 25282 - Ошибка в консоли при удалении диаграммы из группы с двумя автофигурами

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57181 954022d7-b5bf-4e40-9824-e11837661b57
parent 6f3d1511
......@@ -347,3 +347,23 @@ CGroupShape.prototype.recalculateBounds = function()
};
CGroupShape.prototype.getBoundsPos = function()
{
var sp_tree = this.spTree;
var x_arr_max = [], y_arr_max = [], x_arr_min = [], y_arr_min = [];
for(var i = 0; i < sp_tree.length; ++i)
{
var bounds = sp_tree[i].bounds;
var l = bounds.l;
var r = bounds.r;
var t = bounds.t;
var b = bounds.b;
x_arr_max.push(r);
x_arr_min.push(l);
y_arr_max.push(b);
y_arr_min.push(t);
}
return {x: Math.min.apply(Math, x_arr_min), y: Math.min.apply(Math, y_arr_min)};
};
......@@ -1192,32 +1192,31 @@ CGraphicObjects.prototype =
para_pr = parent_para.Get_CompiledPr2(true).ParaPr;
}
}
if(!para_pr)
{
para_pr = new CParaPr();
}
var TextPr = this.getParagraphTextPr();
var theme = this.document.Get_Theme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
if(para_pr)
{
if(TextPr.FontFamily)
var TextPr = this.getParagraphTextPr();
var theme = this.document.Get_Theme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
TextPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(TextPr.FontFamily.Name);
}
if(TextPr.RFonts)
{
if(TextPr.RFonts.Ascii)
TextPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.Ascii.Name);
if(TextPr.RFonts.EastAsia)
TextPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.EastAsia.Name);
if(TextPr.RFonts.HAnsi)
TextPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.HAnsi.Name);
if(TextPr.RFonts.CS)
TextPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.CS.Name);
if(TextPr.FontFamily)
{
TextPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(TextPr.FontFamily.Name);
}
if(TextPr.RFonts)
{
if(TextPr.RFonts.Ascii)
TextPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.Ascii.Name);
if(TextPr.RFonts.EastAsia)
TextPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.EastAsia.Name);
if(TextPr.RFonts.HAnsi)
TextPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.HAnsi.Name);
if(TextPr.RFonts.CS)
TextPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.CS.Name);
}
}
editor.UpdateParagraphProp(para_pr);
editor.UpdateTextPr(TextPr);
}
editor.UpdateParagraphProp(para_pr);
editor.UpdateTextPr(TextPr);
}
},
......@@ -2129,10 +2128,13 @@ CGraphicObjects.prototype =
}
else
{
this.resetInternalSelection();
var new_x, new_y;
new_x = cur_group.x + sp.bounds.x;
new_y = cur_group.y + sp.bounds.y;
sp.recalcBounds();
var pos = cur_group.getBoundsPos();
new_x = cur_group.x + pos.x;
new_y = cur_group.y + pos.y;
cur_group.updateCoordinatesAfterInternalResize();
var nearest_pos = this.document.Get_NearestPos(cur_group.selectStartPage, new_x, new_y, true, para_drawing);
para_drawing.Remove_FromDocument(false);
para_drawing.Set_XYForAdd(new_x, new_y, nearest_pos, cur_group.selectStartPage);
......
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