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)
{ {
this.selection.groupSelection.selectedObjects[0].theme = this.getTheme(); by_types.charts[0].theme = this.getTheme();
this.selection.groupSelection.selectedObjects[0].colorMapOverride = this.getColorMapOverride(); by_types.charts[0].colorMapOverride = this.getColorMapOverride();
this.selection.groupSelection.selectedObjects[0].DocumentUrl = this.getDocumentUrl(); by_types.charts[0].DocumentUrl = this.getDocumentUrl();
ExecuteNoHistory(function() ExecuteNoHistory(function()
{ {
CheckSpPrXfrm2(this.selection.groupSelection.selectedObjects[0]); CheckSpPrXfrm2(by_types.charts[0]);
}, this, []); }, this, []);
return this.selection.groupSelection.selectedObjects[0]; return by_types.charts[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,34 +111,41 @@ DrawingObjectsController.prototype.editChart = function(binary) ...@@ -111,34 +111,41 @@ 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; {
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) for(var i = parent_group.spTree.length -1; i > -1; --i)
{ {
if(parent_group.spTree[i] === this.selection.groupSelection.selectedObjects[0]) if(parent_group.spTree[i] === by_types.charts[0])
{ {
parent_group.removeFromSpTreeByPos(i); parent_group.removeFromSpTreeByPos(i);
chart_space.setGroup(parent_group); chart_space.setGroup(parent_group);
chart_space.spPr.xfrm.setOffX(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offX); chart_space.spPr.xfrm.setOffX(by_types.charts[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offY); chart_space.spPr.xfrm.setOffY(by_types.charts[0].spPr.xfrm.offY);
parent_group.addToSpTree(i, chart_space); parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize(); parent_group.updateCoordinatesAfterInternalResize();
major_group.recalculate(); major_group.recalculate();
if(this.selection.groupSelection)
{
this.selection.groupSelection.resetSelection(); this.selection.groupSelection.resetSelection();
this.selection.groupSelection.selectObject(chart_space, this.drawingObjects.num); this.selection.groupSelection.selectObject(chart_space, this.drawingObjects.num);
}
this.startRecalculate(); this.startRecalculate();
this.sendGraphicObjectProps(); this.sendGraphicObjectProps();
return; return;
} }
} }
} }
else if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace) else
{ {
chart_space.spPr.xfrm.setOffX(this.selectedObjects[0].x); chart_space.spPr.xfrm.setOffX(by_types.charts[0].x);
chart_space.spPr.xfrm.setOffY(this.selectedObjects[0].y); chart_space.spPr.xfrm.setOffY(by_types.charts[0].y);
var pos = this.selectedObjects[0].deleteDrawingBase(); var pos = by_types.charts[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);
...@@ -146,6 +153,7 @@ DrawingObjectsController.prototype.editChart = function(binary) ...@@ -146,6 +153,7 @@ DrawingObjectsController.prototype.editChart = function(binary)
this.sendGraphicObjectProps(); this.sendGraphicObjectProps();
this.updateOverlay(); this.updateOverlay();
} }
}
}; };
DrawingObjectsController.prototype.handleSlideComments = function(e, x, y, pageIndex) DrawingObjectsController.prototype.handleSlideComments = function(e, x, y, pageIndex)
......
...@@ -581,18 +581,24 @@ CGraphicObjects.prototype = ...@@ -581,18 +581,24 @@ 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; {
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) for(var i = parent_group.spTree.length -1; i > -1; --i)
{ {
if(parent_group.spTree[i] === this.selection.groupSelection.selectedObjects[0]) if(parent_group.spTree[i] === by_types.charts[0])
{ {
parent_group.removeFromSpTreeByPos(i); parent_group.removeFromSpTreeByPos(i);
chart_space.setGroup(parent_group); chart_space.setGroup(parent_group);
chart_space.spPr.xfrm.setOffX(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offX); chart_space.spPr.xfrm.setOffX(by_types.charts[0].spPr.xfrm.offX);
chart_space.spPr.xfrm.setOffY(this.selection.groupSelection.selectedObjects[0].spPr.xfrm.offY); chart_space.spPr.xfrm.setOffY(by_types.charts[0].spPr.xfrm.offY);
parent_group.addToSpTree(i, chart_space); parent_group.addToSpTree(i, chart_space);
parent_group.updateCoordinatesAfterInternalResize(); parent_group.updateCoordinatesAfterInternalResize();
//TODO: возможно следует нормализовать самую старшую группу //TODO: возможно следует нормализовать самую старшую группу
...@@ -614,43 +620,47 @@ CGraphicObjects.prototype = ...@@ -614,43 +620,47 @@ CGraphicObjects.prototype =
major_group.parent.Set_XYForAdd(major_group.posX,major_group.posY, nearest_pos, major_group.selectStartPage); major_group.parent.Set_XYForAdd(major_group.posX,major_group.posY, nearest_pos, major_group.selectStartPage);
major_group.parent.Add_ToDocument2(parent_paragraph); major_group.parent.Add_ToDocument2(parent_paragraph);
} }
if(this.selection.groupSelection)
{
select_start_page = this.selection.groupSelection.selectedObjects[0].selectStartPage; select_start_page = this.selection.groupSelection.selectedObjects[0].selectStartPage;
this.selection.groupSelection.resetSelection(); this.selection.groupSelection.resetSelection();
this.selection.groupSelection.selectObject(chart_space, select_start_page); this.selection.groupSelection.selectObject(chart_space, select_start_page);
}
this.document.Recalculate(); this.document.Recalculate();
this.document.Document_UpdateInterfaceState(); this.document.Document_UpdateInterfaceState();
return; return;
} }
} }
} }
else if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace) else
{ {
chart_space.spPr.xfrm.setOffX(0); chart_space.spPr.xfrm.setOffX(0);
chart_space.spPr.xfrm.setOffY(0); chart_space.spPr.xfrm.setOffY(0);
select_start_page = this.selectedObjects[0].selectStartPage; select_start_page = by_types.charts[0].selectStartPage;
chart_space.setParent(this.selectedObjects[0].parent); chart_space.setParent(by_types.charts[0].parent);
if(this.selectedObjects[0].parent.Is_Inline()) if(by_types.charts[0].parent.Is_Inline())
{ {
this.selectedObjects[0].parent.Set_GraphicObject(chart_space); 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.selectedObjects[0].parent.OnEnd_ResizeInline(chart_space.spPr.xfrm.extX, chart_space.spPr.xfrm.extY); by_types.charts[0].parent.OnEnd_ResizeInline(chart_space.spPr.xfrm.extX, chart_space.spPr.xfrm.extY);
} }
else else
{ {
parent_paragraph = this.selectedObjects[0].parent.Get_ParentParagraph(); parent_paragraph = by_types.charts[0].parent.Get_ParentParagraph();
nearest_pos = this.document.Get_NearestPos(this.selectedObjects[0].selectStartPage,this.selectedObjects[0].posX, this.selectedObjects[0].posY, true, this.selectedObjects[0].parent); 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); nearest_pos.Paragraph.Check_NearestPos(nearest_pos);
this.selectedObjects[0].parent.Remove_FromDocument(false); by_types.charts[0].parent.Remove_FromDocument(false);
this.selectedObjects[0].parent.Set_GraphicObject(chart_space); by_types.charts[0].parent.Set_GraphicObject(chart_space);
this.selectedObjects[0].parent.Set_XYForAdd(this.selectedObjects[0].posX, this.selectedObjects[0].posY, nearest_pos, this.selectedObjects[0].selectStartPage); by_types.charts[0].parent.Set_XYForAdd(by_types.charts[0].posX, by_types.charts[0].posY, nearest_pos, by_types.charts[0].selectStartPage);
this.selectedObjects[0].parent.Add_ToDocument2(parent_paragraph); by_types.charts[0].parent.Add_ToDocument2(parent_paragraph);
this.resetSelection(); this.resetSelection();
this.selectObject(chart_space, select_start_page); this.selectObject(chart_space, select_start_page);
this.document.Recalculate(); 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