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

Bug 28098 - Некорректная отрисовка диаграммы во фрейме, если при открытии его...

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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60319 954022d7-b5bf-4e40-9824-e11837661b57
parent b9f43124
...@@ -4380,33 +4380,17 @@ DrawingObjectsController.prototype = ...@@ -4380,33 +4380,17 @@ DrawingObjectsController.prototype =
} }
else else
{ {
if(this.selection.groupSelection) var by_types = getObjectsByTypesFromArr(this.selection.groupSelection ? this.selection.groupSelection.selectedObjects : this.selectedObjects, true);
if(by_types.charts.length === 1)
{ {
if(this.selection.groupSelection.selectedObjects.length === 1 && this.selection.groupSelection.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace) by_types.charts[0].theme = this.getTheme();
by_types.charts[0].colorMapOverride = this.getColorMapOverride();
by_types.charts[0].DocumentUrl = this.getDocumentUrl();
ExecuteNoHistory(function()
{ {
this.selection.groupSelection.selectedObjects[0].theme = this.getTheme(); CheckSpPrXfrm2(by_types.charts[0]);
this.selection.groupSelection.selectedObjects[0].colorMapOverride = this.getColorMapOverride(); }, this, []);
this.selection.groupSelection.selectedObjects[0].DocumentUrl = this.getDocumentUrl(); return by_types.charts[0];
ExecuteNoHistory(function()
{
CheckSpPrXfrm2(this.selection.groupSelection.selectedObjects[0]);
}, this, []);
return this.selection.groupSelection.selectedObjects[0];
}
}
else
{
if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
{
this.selectedObjects[0].theme = this.getTheme();
this.selectedObjects[0].colorMapOverride = this.getColorMapOverride();
this.selectedObjects[0].DocumentUrl = this.getDocumentUrl();
ExecuteNoHistory(function()
{
CheckSpPrXfrm2(this.selectedObjects[0]);
}, this, []);
return this.selectedObjects[0];
}
} }
} }
return null; return null;
......
...@@ -5149,7 +5149,7 @@ function CompareShapeProperties(shapeProp1, shapeProp2) ...@@ -5149,7 +5149,7 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_result_shape_prop.w = null; _result_shape_prop.w = null;
} }
if(shapeProp1.stroke === null || shapeProp2.stroke === null) if(shapeProp1.stroke == null || shapeProp2.stroke == null)
{ {
_result_shape_prop.stroke = null; _result_shape_prop.stroke = null;
} }
......
...@@ -111,40 +111,48 @@ DrawingObjectsController.prototype.editChart = function(binary) ...@@ -111,40 +111,48 @@ DrawingObjectsController.prototype.editChart = function(binary)
var bin_object = {"binary":binary}; var bin_object = {"binary":binary};
var chart_space = this.getChartSpace2(bin_object, null); var chart_space = this.getChartSpace2(bin_object, null);
chart_space.setParent(this.drawingObjects); chart_space.setParent(this.drawingObjects);
if(this.selection.groupSelection && this.selection.groupSelection.selectedObjects.length === 1 && this.selection.groupSelection.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace) var by_types;
by_types = getObjectsByTypesFromArr(this.selectedObjects, true);
if(by_types.charts.length === 1)
{ {
var parent_group = this.selection.groupSelection.selectedObjects[0].group; if(by_types.charts[0].group)
var major_group = this.selection.groupSelection;
for(var i = parent_group.spTree.length -1; i > -1; --i)
{ {
if(parent_group.spTree[i] === this.selection.groupSelection.selectedObjects[0]) 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)
{ {
parent_group.removeFromSpTreeByPos(i); if(parent_group.spTree[i] === by_types.charts[0])
chart_space.setGroup(parent_group); {
chart_space.spPr.xfrm.setOffX(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offX); parent_group.removeFromSpTreeByPos(i);
chart_space.spPr.xfrm.setOffY(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offY); chart_space.setGroup(parent_group);
parent_group.addToSpTree(i, chart_space); chart_space.spPr.xfrm.setOffX(by_types.charts[0].spPr.xfrm.offX);
parent_group.updateCoordinatesAfterInternalResize(); chart_space.spPr.xfrm.setOffY(by_types.charts[0].spPr.xfrm.offY);
major_group.recalculate(); parent_group.addToSpTree(i, chart_space);
this.selection.groupSelection.resetSelection(); parent_group.updateCoordinatesAfterInternalResize();
this.selection.groupSelection.selectObject(chart_space, this.drawingObjects.num); major_group.recalculate();
this.startRecalculate(); if(this.selection.groupSelection)
this.sendGraphicObjectProps(); {
return; this.selection.groupSelection.resetSelection();
this.selection.groupSelection.selectObject(chart_space, this.drawingObjects.num);
}
this.startRecalculate();
this.sendGraphicObjectProps();
return;
}
} }
} }
} else
else if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace) {
{ chart_space.spPr.xfrm.setOffX(by_types.charts[0].x);
chart_space.spPr.xfrm.setOffX(this.selectedObjects[0].x); chart_space.spPr.xfrm.setOffY(by_types.charts[0].y);
chart_space.spPr.xfrm.setOffY(this.selectedObjects[0].y); var pos = by_types.charts[0].deleteDrawingBase();
var pos = this.selectedObjects[0].deleteDrawingBase(); chart_space.addToDrawingObjects(pos);
chart_space.addToDrawingObjects(pos); this.resetSelection();
this.resetSelection(); this.selectObject(chart_space, this.drawingObjects.num);
this.selectObject(chart_space, this.drawingObjects.num); this.startRecalculate();
this.startRecalculate(); this.sendGraphicObjectProps();
this.sendGraphicObjectProps(); this.updateOverlay();
this.updateOverlay(); }
} }
}; };
......
...@@ -581,75 +581,85 @@ CGraphicObjects.prototype = ...@@ -581,75 +581,85 @@ CGraphicObjects.prototype =
{ {
var bin_object = {"binary":chart}; var bin_object = {"binary":chart};
var chart_space = this.getChartSpace2(bin_object, null), select_start_page, parent_paragraph, nearest_pos; var chart_space = this.getChartSpace2(bin_object, null), select_start_page, parent_paragraph, nearest_pos;
if(this.selection.groupSelection && this.selection.groupSelection.selectedObjects.length === 1 && this.selection.groupSelection.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
var by_types;
by_types = getObjectsByTypesFromArr(this.selectedObjects, true);
if(by_types.charts.length === 1)
{ {
var parent_group = this.selection.groupSelection.selectedObjects[0].group; if(by_types.charts[0].group)
var major_group = this.selection.groupSelection;
for(var i = parent_group.spTree.length -1; i > -1; --i)
{ {
if(parent_group.spTree[i] === this.selection.groupSelection.selectedObjects[0]) 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)
{ {
parent_group.removeFromSpTreeByPos(i); if(parent_group.spTree[i] === by_types.charts[0])
chart_space.setGroup(parent_group);
chart_space.spPr.xfrm.setOffX(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offY);
parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize();
//TODO: возможно следует нормализовать самую старшую группу
major_group.recalculate();
if(major_group.spPr && major_group.spPr.xfrm)
{ {
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);
parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize();
//TODO: возможно следует нормализовать самую старшую группу
major_group.recalculate();
if(major_group.spPr && major_group.spPr.xfrm)
{
}
if(major_group.parent.Is_Inline())
{
major_group.parent.OnEnd_ResizeInline(major_group.bounds.w, major_group.bounds.h);
}
else
{
parent_paragraph = major_group.parent.Get_ParentParagraph();
nearest_pos = this.document.Get_NearestPos(major_group.selectStartPage,major_group.posX + major_group.bounds.x, major_group.posY + major_group.bounds.y, true, major_group.parent);
nearest_pos.Paragraph.Check_NearestPos(nearest_pos);
major_group.parent.Remove_FromDocument(false);
major_group.parent.Set_XYForAdd(major_group.posX,major_group.posY, nearest_pos, major_group.selectStartPage);
major_group.parent.Add_ToDocument2(parent_paragraph);
}
if(this.selection.groupSelection)
{
select_start_page = this.selection.groupSelection.selectedObjects[0].selectStartPage;
this.selection.groupSelection.resetSelection();
this.selection.groupSelection.selectObject(chart_space, select_start_page);
}
this.document.Recalculate();
this.document.Document_UpdateInterfaceState();
return;
} }
if(major_group.parent.Is_Inline())
{
major_group.parent.OnEnd_ResizeInline(major_group.bounds.w, major_group.bounds.h);
}
else
{
parent_paragraph = major_group.parent.Get_ParentParagraph();
nearest_pos = this.document.Get_NearestPos(major_group.selectStartPage,major_group.posX + major_group.bounds.x, major_group.posY + major_group.bounds.y, true, major_group.parent);
nearest_pos.Paragraph.Check_NearestPos(nearest_pos);
major_group.parent.Remove_FromDocument(false);
major_group.parent.Set_XYForAdd(major_group.posX,major_group.posY, nearest_pos, major_group.selectStartPage);
major_group.parent.Add_ToDocument2(parent_paragraph);
}
select_start_page = this.selection.groupSelection.selectedObjects[0].selectStartPage;
this.selection.groupSelection.resetSelection();
this.selection.groupSelection.selectObject(chart_space, select_start_page);
this.document.Recalculate();
this.document.Document_UpdateInterfaceState();
return;
} }
} }
}
else if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
{
chart_space.spPr.xfrm.setOffX(0);
chart_space.spPr.xfrm.setOffY(0);
select_start_page = this.selectedObjects[0].selectStartPage;
chart_space.setParent(this.selectedObjects[0].parent);
if(this.selectedObjects[0].parent.Is_Inline())
{
this.selectedObjects[0].parent.Set_GraphicObject(chart_space);
this.resetSelection();
this.selectObject(chart_space, select_start_page);
this.selectedObjects[0].parent.OnEnd_ResizeInline(chart_space.spPr.xfrm.extX, chart_space.spPr.xfrm.extY);
}
else else
{ {
parent_paragraph = this.selectedObjects[0].parent.Get_ParentParagraph(); chart_space.spPr.xfrm.setOffX(0);
nearest_pos = this.document.Get_NearestPos(this.selectedObjects[0].selectStartPage,this.selectedObjects[0].posX, this.selectedObjects[0].posY, true, this.selectedObjects[0].parent); chart_space.spPr.xfrm.setOffY(0);
nearest_pos.Paragraph.Check_NearestPos(nearest_pos); select_start_page = by_types.charts[0].selectStartPage;
this.selectedObjects[0].parent.Remove_FromDocument(false); chart_space.setParent(by_types.charts[0].parent);
this.selectedObjects[0].parent.Set_GraphicObject(chart_space); if(by_types.charts[0].parent.Is_Inline())
this.selectedObjects[0].parent.Set_XYForAdd(this.selectedObjects[0].posX, this.selectedObjects[0].posY, nearest_pos, this.selectedObjects[0].selectStartPage); {
this.selectedObjects[0].parent.Add_ToDocument2(parent_paragraph); by_types.charts[0].parent.Set_GraphicObject(chart_space);
this.resetSelection(); this.resetSelection();
this.selectObject(chart_space, select_start_page); this.selectObject(chart_space, select_start_page);
this.document.Recalculate(); by_types.charts[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);
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);
this.resetSelection();
this.selectObject(chart_space, select_start_page);
this.document.Recalculate();
}
this.document.Document_UpdateInterfaceState();
} }
this.document.Document_UpdateInterfaceState();
} }
}, },
......
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