Commit bddf7657 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov

- Доработки для Undo/Redo диаграмм(отдельно каждое свойство)

- Undo/Redo при смене свойств диаграммы из правой панели

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49012 954022d7-b5bf-4e40-9824-e11837661b57
parent 514f6227
...@@ -656,6 +656,7 @@ function asc_CChart(object) { ...@@ -656,6 +656,7 @@ function asc_CChart(object) {
} }
asc_CChart.prototype = { asc_CChart.prototype = {
asc_getType: function() { return this.type; }, asc_getType: function() { return this.type; },
asc_setType: function(type) { this.type = type; }, asc_setType: function(type) { this.type = type; },
...@@ -851,48 +852,100 @@ asc_CChart.prototype = { ...@@ -851,48 +852,100 @@ asc_CChart.prototype = {
switch (type) { switch (type) {
case historyitem_Chart_ChangeType: // type, subType, styleId
case historyitem_Chart_Type:
this.type = data.oldValue; this.type = data.oldValue;
break; break;
case historyitem_Chart_ChangeSubType: case historyitem_Chart_SubType:
this.subType = data.oldValue; this.subType = data.oldValue;
break; break;
case historyitem_Chart_ChangeShowValue: case historyitem_Chart_Style:
this.styleId = data.oldValue;
break;
// showValue, showBorder
case historyitem_Chart_IsShowValue:
this.bShowValue = data.oldValue; this.bShowValue = data.oldValue;
break; break;
case historyitem_Chart_ChangeShowBorder: case historyitem_Chart_IsShowBorder:
this.bShowBorder = data.oldValue; this.bShowBorder = data.oldValue;
break; break;
case historyitem_Chart_ChangeStyle: // range
this.styleId = data.oldValue; case historyitem_Chart_RangeInterval:
break; this.range.interval = data.oldValue;
case historyitem_Chart_ChangeRange:
this.range = new asc_CChartRange(data.oldValue);
if ( this.worksheet ) { if ( this.worksheet ) {
this.range.intervalObject = convertFormula(this.range.interval, this.worksheet); this.range.intervalObject = convertFormula(this.range.interval, this.worksheet);
this.rebuildSeries(); this.rebuildSeries();
} }
break; break;
case historyitem_Chart_ChangeHeader: case historyitem_Chart_RangeRowColumns:
this.header = new asc_CChartHeader(data.oldValue); this.range.rows = data.oldValue;
this.range.columns = !data.oldValue;
break;
// header
case historyitem_Chart_HeaderTitle:
this.header.title = data.oldValue;
break;
case historyitem_Chart_HeaderSubTitle:
this.header.subTitle = data.oldValue;
break;
case historyitem_Chart_IsDefaultHeaderTitle:
this.header.bDefaultTitle = data.oldValue;
break;
// xAxis
case historyitem_Chart_xAxisTitle:
this.xAxis.title = data.oldValue;
break;
case historyitem_Chart_xAxisIsDefaultTitle:
this.xAxis.bDefaultTitle = data.oldValue;
break;
case historyitem_Chart_xAxisIsShow:
this.xAxis.bShow = data.oldValue;
break;
case historyitem_Chart_xAxisIsGrid:
this.xAxis.bGrid = data.oldValue;
break;
// yAxis
case historyitem_Chart_yAxisTitle:
this.yAxis.title = data.oldValue;
break;
case historyitem_Chart_yAxisIsDefaultTitle:
this.yAxis.bDefaultTitle = data.oldValue;
break;
case historyitem_Chart_yAxisIsShow:
this.yAxis.bShow = data.oldValue;
break;
case historyitem_Chart_yAxisIsGrid:
this.yAxis.bGrid = data.oldValue;
break; break;
case historyitem_Chart_ChangeAxisX: // legend
this.xAxis = new asc_CChartAxisX(data.oldValue); case historyitem_Chart_LegendPosition:
this.legend.position = data.oldValue;
break; break;
case historyitem_Chart_ChangeAxisY: case historyitem_Chart_LegendIsShow:
this.yAxis = new asc_CChartAxisY(data.oldValue); this.legend.bShow = data.oldValue;
break; break;
case historyitem_Chart_ChangeLegend: case historyitem_Chart_LegendIsOverlay:
this.legend = new asc_CChartLegend(data.oldValue); this.legend.bOverlay = data.oldValue;
break; break;
} }
...@@ -904,50 +957,101 @@ asc_CChart.prototype = { ...@@ -904,50 +957,101 @@ asc_CChart.prototype = {
Redo: function(type, data) { Redo: function(type, data) {
// type, subType, styleId
switch (type) { switch (type) {
case historyitem_Chart_Type:
case historyitem_Chart_ChangeType:
this.type = data.newValue; this.type = data.newValue;
break; break;
case historyitem_Chart_ChangeSubType: case historyitem_Chart_SubType:
this.subType = data.newValue; this.subType = data.newValue;
break; break;
case historyitem_Chart_ChangeShowValue: case historyitem_Chart_Style:
this.styleId = data.newValue;
break;
// showValue, showBorder
case historyitem_Chart_IsShowValue:
this.bShowValue = data.newValue; this.bShowValue = data.newValue;
break; break;
case historyitem_Chart_ChangeShowBorder: case historyitem_Chart_IsShowBorder:
this.bShowBorder = data.newValue; this.bShowBorder = data.newValue;
break; break;
case historyitem_Chart_ChangeStyle: // range
this.styleId = data.newValue; case historyitem_Chart_RangeInterval:
break; this.range.interval = data.newValue;
case historyitem_Chart_ChangeRange:
this.range = new asc_CChartRange(data.newValue);
if ( this.worksheet ) { if ( this.worksheet ) {
this.range.intervalObject = convertFormula(this.range.interval, this.worksheet); this.range.intervalObject = convertFormula(this.range.interval, this.worksheet);
this.rebuildSeries(); this.rebuildSeries();
} }
break; break;
case historyitem_Chart_ChangeHeader: case historyitem_Chart_RangeRowColumns:
this.header = new asc_CChartHeader(data.newValue); this.range.rows = data.newValue;
this.range.columns = !data.newValue;
break;
// header
case historyitem_Chart_HeaderTitle:
this.header.title = data.newValue;
break;
case historyitem_Chart_HeaderSubTitle:
this.header.subTitle = data.newValue;
break;
case historyitem_Chart_IsDefaultHeaderTitle:
this.header.bDefaultTitle = data.newValue;
break;
// xAxis
case historyitem_Chart_xAxisTitle:
this.xAxis.title = data.newValue;
break;
case historyitem_Chart_xAxisIsDefaultTitle:
this.xAxis.bDefaultTitle = data.newValue;
break;
case historyitem_Chart_xAxisIsShow:
this.xAxis.bShow = data.newValue;
break;
case historyitem_Chart_xAxisIsGrid:
this.xAxis.bGrid = data.newValue;
break;
// yAxis
case historyitem_Chart_yAxisTitle:
this.yAxis.title = data.newValue;
break;
case historyitem_Chart_yAxisIsDefaultTitle:
this.yAxis.bDefaultTitle = data.newValue;
break;
case historyitem_Chart_yAxisIsShow:
this.yAxis.bShow = data.newValue;
break;
case historyitem_Chart_yAxisIsGrid:
this.yAxis.bGrid = data.newValue;
break; break;
case historyitem_Chart_ChangeAxisX: // legend
this.xAxis = new asc_CChartAxisX(data.newValue); case historyitem_Chart_LegendPosition:
this.legend.position = data.newValue;
break; break;
case historyitem_Chart_ChangeAxisY: case historyitem_Chart_LegendIsShow:
this.yAxis = new asc_CChartAxisY(data.newValue); this.legend.bShow = data.newValue;
break; break;
case historyitem_Chart_ChangeLegend: case historyitem_Chart_LegendIsOverlay:
this.legend = new asc_CChartLegend(data.newValue); this.legend.bOverlay = data.newValue;
break; break;
} }
if ( this.worksheet ) { if ( this.worksheet ) {
...@@ -3332,8 +3436,6 @@ function DrawingObjects() { ...@@ -3332,8 +3436,6 @@ function DrawingObjects() {
_this.editChartDrawingObject = function(chart) { _this.editChartDrawingObject = function(chart) {
if ( chart ) { if ( chart ) {
_this.controller.editChartDrawingObjects(chart); _this.controller.editChartDrawingObjects(chart);
chart.rebuildSeries();
chart.range.intervalObject = convertFormula(chart.range.interval, worksheet);
_this.showDrawingObjects(false); _this.showDrawingObjects(false);
} }
} }
......
...@@ -794,7 +794,7 @@ DrawingObjectsController.prototype = ...@@ -794,7 +794,7 @@ DrawingObjectsController.prototype =
chart_props = new asc_CImgProperty(); chart_props = new asc_CImgProperty();
chart_props.fromGroup = true; chart_props.fromGroup = true;
chart_props.ChartProperties = c_obj.chart; chart_props.ChartProperties = new asc_CChart(c_obj.chart);
} }
else else
{ {
...@@ -905,7 +905,7 @@ DrawingObjectsController.prototype = ...@@ -905,7 +905,7 @@ DrawingObjectsController.prototype =
chart_props = new asc_CImgProperty(); chart_props = new asc_CImgProperty();
chart_props.Width = c_obj.extX; chart_props.Width = c_obj.extX;
chart_props.Height = c_obj.extY; chart_props.Height = c_obj.extY;
chart_props.ChartProperties = c_obj.chart; chart_props.ChartProperties = new asc_CChart(c_obj.chart);
} }
} }
if (c_obj.isGroup()) if (c_obj.isGroup())
...@@ -1166,7 +1166,7 @@ DrawingObjectsController.prototype = ...@@ -1166,7 +1166,7 @@ DrawingObjectsController.prototype =
} }
if(ArrGlyph[i].isChart() && isRealObject(props.ChartProperties)) if(ArrGlyph[i].isChart() && isRealObject(props.ChartProperties))
{ {
ArrGlyph[i].chart = props.ChartProperties; ArrGlyph[i].setChart(props.ChartProperties, true);
ArrGlyph[i].recalculate(); ArrGlyph[i].recalculate();
} }
......
This diff is collapsed.
...@@ -75,17 +75,36 @@ var historyitem_Cell_SetQuotePrefix = 20; ...@@ -75,17 +75,36 @@ var historyitem_Cell_SetQuotePrefix = 20;
var historyitem_Cell_Angle = 21; var historyitem_Cell_Angle = 21;
var historyitem_Cell_Style = 22; var historyitem_Cell_Style = 22;
var historyitem_Chart_ChangeType = 1; // Chart
var historyitem_Chart_ChangeSubType = 2; var historyitem_Chart_Type = 1;
var historyitem_Chart_ChangeShowValue = 3; var historyitem_Chart_SubType = 2;
var historyitem_Chart_ChangeShowBorder = 4; var historyitem_Chart_Style = 3;
var historyitem_Chart_ChangeStyle = 5;
var historyitem_Chart_ChangeRange = 6;
var historyitem_Chart_ChangeHeader = 7;
var historyitem_Chart_ChangeAxisX = 8;
var historyitem_Chart_ChangeAxisY = 9;
var historyitem_Chart_ChangeLegend = 10;
var historyitem_Chart_IsShowValue = 10;
var historyitem_Chart_IsShowBorder = 11;
var historyitem_Chart_RangeInterval = 20;
var historyitem_Chart_RangeRowColumns = 21;
var historyitem_Chart_HeaderTitle = 30;
var historyitem_Chart_HeaderSubTitle = 31;
var historyitem_Chart_IsDefaultHeaderTitle = 32;
var historyitem_Chart_xAxisTitle = 40;
var historyitem_Chart_xAxisIsDefaultTitle = 41;
var historyitem_Chart_xAxisIsShow = 42;
var historyitem_Chart_xAxisIsGrid = 43;
var historyitem_Chart_yAxisTitle = 50;
var historyitem_Chart_yAxisIsDefaultTitle = 51;
var historyitem_Chart_yAxisIsShow = 52;
var historyitem_Chart_yAxisIsGrid = 53;
var historyitem_Chart_LegendPosition = 60;
var historyitem_Chart_LegendIsShow = 61;
var historyitem_Chart_LegendIsOverlay = 62;
// AutoShapes
var historyitem_AutoShapes_Offset = 1; var historyitem_AutoShapes_Offset = 1;
var historyitem_AutoShapes_Extents = 2; var historyitem_AutoShapes_Extents = 2;
var historyitem_AutoShapes_Child_Offset = 3; var historyitem_AutoShapes_Child_Offset = 3;
......
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