Commit 8040b0b5 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Bug 28316 - Не изменяется заголовок диаграммы во фрейме, если она находится в группе

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60685 954022d7-b5bf-4e40-9824-e11837661b57
parent ddb1d72a
......@@ -124,22 +124,30 @@ DrawingObjectsController.prototype.editChart = function(binary)
var bin_object = {"binary":binary};
var chart_space = this.getChartSpace2(bin_object, null);
chart_space.setParent(this.drawingObjects);
var by_types;
var by_types, i;
by_types = getObjectsByTypesFromArr(this.selectedObjects, true);
if(by_types.charts.length === 1)
var aSelectedCharts = [];
for(i = 0; i < by_types.charts.length; ++i)
{
if(by_types.charts[0].group)
if(by_types.charts[i].selected)
{
var parent_group = by_types.charts[0].group;
var major_group = by_types.charts[0].getMainGroup();
for(var i = parent_group.spTree.length -1; i > -1; --i)
aSelectedCharts.push(by_types.charts[i]);
}
}
if(aSelectedCharts.length === 1)
{
if(aSelectedCharts[0].group)
{
var parent_group = aSelectedCharts[0].group;
var major_group = aSelectedCharts[0].getMainGroup();
for(i = parent_group.spTree.length -1; i > -1; --i)
{
if(parent_group.spTree[i] === by_types.charts[0])
if(parent_group.spTree[i] === aSelectedCharts[0])
{
parent_group.removeFromSpTreeByPos(i);
chart_space.setGroup(parent_group);
chart_space.spPr.xfrm.setOffX(by_types.charts[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(by_types.charts[0].spPr.xfrm.offY);
chart_space.spPr.xfrm.setOffX(aSelectedCharts[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(aSelectedCharts[0].spPr.xfrm.offY);
parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize();
major_group.recalculate();
......@@ -156,9 +164,9 @@ DrawingObjectsController.prototype.editChart = function(binary)
}
else
{
chart_space.spPr.xfrm.setOffX(by_types.charts[0].x);
chart_space.spPr.xfrm.setOffY(by_types.charts[0].y);
var pos = by_types.charts[0].deleteDrawingBase();
chart_space.spPr.xfrm.setOffX(aSelectedCharts[0].x);
chart_space.spPr.xfrm.setOffY(aSelectedCharts[0].y);
var pos = aSelectedCharts[0].deleteDrawingBase();
chart_space.addToDrawingObjects(pos);
this.resetSelection();
this.selectObject(chart_space, this.drawingObjects.num);
......
......@@ -583,20 +583,30 @@ CGraphicObjects.prototype =
var by_types;
by_types = getObjectsByTypesFromArr(this.selectedObjects, true);
if(by_types.charts.length === 1)
var aSelectedCharts = [];
for(i = 0; i < by_types.charts.length; ++i)
{
if(by_types.charts[i].selected)
{
aSelectedCharts.push(by_types.charts[i]);
}
}
if(aSelectedCharts.length === 1)
{
if(by_types.charts[0].group)
if(aSelectedCharts[0].group)
{
var parent_group = by_types.charts[0].group;
var major_group = by_types.charts[0].getMainGroup();
var parent_group = aSelectedCharts[0].group;
var major_group = aSelectedCharts[0].getMainGroup();
for(var i = parent_group.spTree.length -1; i > -1; --i)
{
if(parent_group.spTree[i] === by_types.charts[0])
if(parent_group.spTree[i] === aSelectedCharts[0])
{
parent_group.removeFromSpTreeByPos(i);
chart_space.setGroup(parent_group);
chart_space.spPr.xfrm.setOffX(by_types.charts[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(by_types.charts[0].spPr.xfrm.offY);
chart_space.spPr.xfrm.setOffX(aSelectedCharts[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(aSelectedCharts[0].spPr.xfrm.offY);
parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize();
//TODO: возможно следует нормализовать самую старшую группу
......@@ -634,24 +644,24 @@ CGraphicObjects.prototype =
{
chart_space.spPr.xfrm.setOffX(0);
chart_space.spPr.xfrm.setOffY(0);
select_start_page = by_types.charts[0].selectStartPage;
chart_space.setParent(by_types.charts[0].parent);
if(by_types.charts[0].parent.Is_Inline())
select_start_page = aSelectedCharts[0].selectStartPage;
chart_space.setParent(aSelectedCharts[0].parent);
if(aSelectedCharts[0].parent.Is_Inline())
{
by_types.charts[0].parent.Set_GraphicObject(chart_space);
aSelectedCharts[0].parent.Set_GraphicObject(chart_space);
this.resetSelection();
this.selectObject(chart_space, select_start_page);
by_types.charts[0].parent.OnEnd_ResizeInline(chart_space.spPr.xfrm.extX, chart_space.spPr.xfrm.extY);
aSelectedCharts[0].parent.OnEnd_ResizeInline(chart_space.spPr.xfrm.extX, chart_space.spPr.xfrm.extY);
}
else
{
parent_paragraph = by_types.charts[0].parent.Get_ParentParagraph();
nearest_pos = this.document.Get_NearestPos(by_types.charts[0].selectStartPage, by_types.charts[0].posX, by_types.charts[0].posY, true, by_types.charts[0].parent);
parent_paragraph = aSelectedCharts[0].parent.Get_ParentParagraph();
nearest_pos = this.document.Get_NearestPos(aSelectedCharts[0].selectStartPage, aSelectedCharts[0].posX, aSelectedCharts[0].posY, true, aSelectedCharts[0].parent);
nearest_pos.Paragraph.Check_NearestPos(nearest_pos);
by_types.charts[0].parent.Remove_FromDocument(false);
by_types.charts[0].parent.Set_GraphicObject(chart_space);
by_types.charts[0].parent.Set_XYForAdd(by_types.charts[0].posX, by_types.charts[0].posY, nearest_pos, by_types.charts[0].selectStartPage);
by_types.charts[0].parent.Add_ToDocument2(parent_paragraph);
aSelectedCharts[0].parent.Remove_FromDocument(false);
aSelectedCharts[0].parent.Set_GraphicObject(chart_space);
aSelectedCharts[0].parent.Set_XYForAdd(aSelectedCharts[0].posX, aSelectedCharts[0].posY, nearest_pos, aSelectedCharts[0].selectStartPage);
aSelectedCharts[0].parent.Add_ToDocument2(parent_paragraph);
this.resetSelection();
this.selectObject(chart_space, select_start_page);
this.document.Recalculate();
......
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