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

првака бага 22505 - [Charts] Ошибка в консоли при клике ПКМ по диаграмме в группе

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52961 954022d7-b5bf-4e40-9824-e11837661b57
parent a7b41b35
...@@ -200,6 +200,18 @@ CGroupShape.prototype = ...@@ -200,6 +200,18 @@ CGroupShape.prototype =
return false; return false;
}, },
setDiagram: function(chartPr)
{
var bRecalc = false;
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setDiagram)
{
this.spTree[i].setDiagram(chartPr);
}
}
},
recalcAll: function() recalcAll: function()
{ {
this.recalcInfo = this.recalcInfo =
......
...@@ -850,7 +850,7 @@ CGraphicObjects.prototype = { ...@@ -850,7 +850,7 @@ CGraphicObjects.prototype = {
} }
default : default :
{ {
if(this.State.id === STATES_ID_GROUP || this.State.id === STATES_ID_TEXT_ADD_IN_GROUP) if(this.State.group instanceof CGroupShape)
{ {
by_types = this.State.group.getSelectedArraysByTypes(); by_types = this.State.group.getSelectedArraysByTypes();
} }
...@@ -1004,6 +1004,39 @@ CGraphicObjects.prototype = { ...@@ -1004,6 +1004,39 @@ CGraphicObjects.prototype = {
} }
} }
var charts = arr_by_types.charts;
for(var j = 0; j < charts.length; ++j)
{
if(!isRealObject(chart_props))
{
chart_props = {fromGroup: true};
chart_props.ChartProperties = charts[j].chart;
chart_props.Width = charts[j].extX;
chart_props.Height = charts[j].extY;
}
else
{
chart_props.chart = null;
chart_props.severalCharts = true;
if(chart_props.severalChartTypes !== true)
{
if(!(chart_props.ChartProperties.type === charts[j].chart.type && chart_props.ChartProperties.subType === charts[j].chart.subType) )
chart_props.severalChartTypes = true;
}
if(chart_props.severalChartStyles !== true)
{
if(chart_props.ChartProperties.styleId !== charts[j].chart.styleId )
chart_props.severalChartStyles = true;
}
if(chart_props.Width !== charts[j].extX || chart_props.Height !== charts[j].extY)
{
chart_props.Width = null;
chart_props.Height = null;
}
}
}
if(image_props) if(image_props)
{ {
if(cur_group.Lock.Is_Locked()) if(cur_group.Lock.Is_Locked())
...@@ -1025,6 +1058,13 @@ CGraphicObjects.prototype = { ...@@ -1025,6 +1058,13 @@ CGraphicObjects.prototype = {
para_props.Locked = true; para_props.Locked = true;
} }
} }
if(chart_props)
{
if(cur_group.Lock.Is_Locked())
{
cur_group.Locked = true;
}
}
} }
var tables = by_types.tables; var tables = by_types.tables;
...@@ -1784,19 +1824,52 @@ CGraphicObjects.prototype = { ...@@ -1784,19 +1824,52 @@ CGraphicObjects.prototype = {
getChartObject: function() getChartObject: function()
{ {
var selected_arr = this.selectedObjects; if(!(this.State.group instanceof CGroupShape))
if(this.State.group)
{ {
selected_objects = this.State.group.selectedObjects; var by_types = this.getSelectedArraysByTypes();
if(selected_objects.length === 1 && selected_objects[0] instanceof CChartAsGroup) if(by_types.charts.length === 1)
{ {
return selected_objects[0]; if(by_types.groups.length === 0)
return by_types.charts[0];
if(by_types.groups.length > 0)
{
for(var i = 0; i < by_types.groups.length; ++i)
{
var group_by_types = by_types.groups[i].getArraysByTypes();
if(group_by_types.charts.length > 0)
break;
}
if(i === by_types.groups.length)
return by_types.charts[0];
}
}
else if(by_types.charts.length === 0 && by_types.groups.length > 0)
{
var chart_for_ret;
for(var i = 0; i < by_types.groups.length; ++i)
{
var group_by_types = by_types.groups[i].getArraysByTypes();
if(group_by_types.charts.length === 1)
{
if(!chart_for_ret)
chart_for_ret = group_by_types.charts[0];
else
break;
}
else if(group_by_types.charts.length > 1)
{
break;
}
}
if(chart_for_ret)
return chart_for_ret;
} }
} }
for(var i = 0; i < selected_arr.length; ++i) else
{ {
if(selected_arr[i].chart != null) var by_types = this.State.group.getSelectedArraysByTypes();
return selected_arr[i]; if(by_types.charts.length === 1)
return by_types.charts[0];
} }
History.TurnOff(); History.TurnOff();
var ret = new CChartAsGroup(); var ret = new CChartAsGroup();
...@@ -2046,7 +2119,6 @@ CGraphicObjects.prototype = { ...@@ -2046,7 +2119,6 @@ CGraphicObjects.prototype = {
{ {
var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects; var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects;
if(isRealNumber(properties.Width) && isRealNumber(properties.Height)) if(isRealNumber(properties.Width) && isRealNumber(properties.Height))
{ {
if(this.State.group) if(this.State.group)
...@@ -2095,7 +2167,7 @@ CGraphicObjects.prototype = { ...@@ -2095,7 +2167,7 @@ CGraphicObjects.prototype = {
if(selectedObjects[i].isImage && selectedObjects[i].isImage() && selectedObjects[i].setBlipFill) if(selectedObjects[i].isImage && selectedObjects[i].isImage() && selectedObjects[i].setBlipFill)
{ {
var b_f = selectedObjects[i].blipFill.createDuplicate(); var b_f = selectedObjects[i].blipFill.createDuplicate();
b_f.fill.RasterImageId = properties.ImageUrl b_f.fill.RasterImageId = properties.ImageUrl;
selectedObjects[i].setBlipFill(b_f); selectedObjects[i].setBlipFill(b_f);
} }
} }
...@@ -2107,29 +2179,28 @@ CGraphicObjects.prototype = { ...@@ -2107,29 +2179,28 @@ CGraphicObjects.prototype = {
chartApply: function(properties) chartApply: function(properties)
{ {
switch(this.State.id) var selectedObjects = (this.State.group instanceof CGroupShape) ? this.State.group.selectedObjects : this.selectedObjects;
if(this.State.group)
{ {
case STATES_ID_NULL: this.State.group.normalize();
case STATES_ID_GROUP: }
case STATES_ID_TEXT_ADD: for(var i = 0; i < selectedObjects.length; ++i)
case STATES_ID_TEXT_ADD_IN_GROUP: {
if(selectedObjects[i] instanceof CGroupShape)
{ {
selectedObjects[i].normalize();
var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects; }
if(this.State.group) selectedObjects[i].setDiagram(properties);
{ if(selectedObjects[i] instanceof CGroupShape)
this.State.group.normalize(); {
} selectedObjects[i].updateCoordinatesAfterInternalResize()
for(var i = 0; i < selectedObjects.length; ++i)
{
if(selectedObjects[i].isChart && selectedObjects[i].isChart())
{
selectedObjects[i].setDiagram(properties);
}
}
break;
} }
} }
if(this.State.group)
{
this.State.group.updateCoordinatesAfterInternalResize();
}
}, },
canGroup: function() canGroup: function()
......
...@@ -3949,10 +3949,10 @@ CTableCellPr.prototype = ...@@ -3949,10 +3949,10 @@ CTableCellPr.prototype =
this.GridSpan = 1; this.GridSpan = 1;
this.Shd = new CDocumentShd(); this.Shd = new CDocumentShd();
this.TableCellMar = null; this.TableCellMar = null;
this.TableCellBorders.Bottom = new CDocumentBorder(); this.TableCellBorders.Bottom = undefined;
this.TableCellBorders.Left = new CDocumentBorder(); this.TableCellBorders.Left = undefined;
this.TableCellBorders.Right = new CDocumentBorder(); this.TableCellBorders.Right = undefined;
this.TableCellBorders.Top = new CDocumentBorder(); this.TableCellBorders.Top = undefined;
this.TableCellW = new CTableMeasurement(tblwidth_Auto, 0); this.TableCellW = new CTableMeasurement(tblwidth_Auto, 0);
this.VAlign = vertalignjc_Top; this.VAlign = vertalignjc_Top;
this.VMerge = vmerge_Restart; this.VMerge = vmerge_Restart;
......
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