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) {
}
asc_CChart.prototype = {
asc_getType: function() { return this.type; },
asc_setType: function(type) { this.type = type; },
......@@ -851,48 +852,100 @@ asc_CChart.prototype = {
switch (type) {
case historyitem_Chart_ChangeType:
// type, subType, styleId
case historyitem_Chart_Type:
this.type = data.oldValue;
break;
case historyitem_Chart_ChangeSubType:
case historyitem_Chart_SubType:
this.subType = data.oldValue;
break;
case historyitem_Chart_ChangeShowValue:
case historyitem_Chart_Style:
this.styleId = data.oldValue;
break;
// showValue, showBorder
case historyitem_Chart_IsShowValue:
this.bShowValue = data.oldValue;
break;
case historyitem_Chart_ChangeShowBorder:
case historyitem_Chart_IsShowBorder:
this.bShowBorder = data.oldValue;
break;
case historyitem_Chart_ChangeStyle:
this.styleId = data.oldValue;
break;
case historyitem_Chart_ChangeRange:
this.range = new asc_CChartRange(data.oldValue);
// range
case historyitem_Chart_RangeInterval:
this.range.interval = data.oldValue;
if ( this.worksheet ) {
this.range.intervalObject = convertFormula(this.range.interval, this.worksheet);
this.rebuildSeries();
}
break;
case historyitem_Chart_ChangeHeader:
this.header = new asc_CChartHeader(data.oldValue);
case historyitem_Chart_RangeRowColumns:
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;
case historyitem_Chart_ChangeAxisX:
this.xAxis = new asc_CChartAxisX(data.oldValue);
// legend
case historyitem_Chart_LegendPosition:
this.legend.position = data.oldValue;
break;
case historyitem_Chart_ChangeAxisY:
this.yAxis = new asc_CChartAxisY(data.oldValue);
case historyitem_Chart_LegendIsShow:
this.legend.bShow = data.oldValue;
break;
case historyitem_Chart_ChangeLegend:
this.legend = new asc_CChartLegend(data.oldValue);
case historyitem_Chart_LegendIsOverlay:
this.legend.bOverlay = data.oldValue;
break;
}
......@@ -904,50 +957,101 @@ asc_CChart.prototype = {
Redo: function(type, data) {
// type, subType, styleId
switch (type) {
case historyitem_Chart_ChangeType:
case historyitem_Chart_Type:
this.type = data.newValue;
break;
case historyitem_Chart_ChangeSubType:
case historyitem_Chart_SubType:
this.subType = data.newValue;
break;
case historyitem_Chart_ChangeShowValue:
case historyitem_Chart_Style:
this.styleId = data.newValue;
break;
// showValue, showBorder
case historyitem_Chart_IsShowValue:
this.bShowValue = data.newValue;
break;
case historyitem_Chart_ChangeShowBorder:
case historyitem_Chart_IsShowBorder:
this.bShowBorder = data.newValue;
break;
case historyitem_Chart_ChangeStyle:
this.styleId = data.newValue;
break;
case historyitem_Chart_ChangeRange:
this.range = new asc_CChartRange(data.newValue);
// range
case historyitem_Chart_RangeInterval:
this.range.interval = data.newValue;
if ( this.worksheet ) {
this.range.intervalObject = convertFormula(this.range.interval, this.worksheet);
this.rebuildSeries();
}
break;
case historyitem_Chart_ChangeHeader:
this.header = new asc_CChartHeader(data.newValue);
case historyitem_Chart_RangeRowColumns:
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;
case historyitem_Chart_ChangeAxisX:
this.xAxis = new asc_CChartAxisX(data.newValue);
// legend
case historyitem_Chart_LegendPosition:
this.legend.position = data.newValue;
break;
case historyitem_Chart_ChangeAxisY:
this.yAxis = new asc_CChartAxisY(data.newValue);
case historyitem_Chart_LegendIsShow:
this.legend.bShow = data.newValue;
break;
case historyitem_Chart_ChangeLegend:
this.legend = new asc_CChartLegend(data.newValue);
case historyitem_Chart_LegendIsOverlay:
this.legend.bOverlay = data.newValue;
break;
}
if ( this.worksheet ) {
......@@ -3332,8 +3436,6 @@ function DrawingObjects() {
_this.editChartDrawingObject = function(chart) {
if ( chart ) {
_this.controller.editChartDrawingObjects(chart);
chart.rebuildSeries();
chart.range.intervalObject = convertFormula(chart.range.interval, worksheet);
_this.showDrawingObjects(false);
}
}
......
......@@ -794,7 +794,7 @@ DrawingObjectsController.prototype =
chart_props = new asc_CImgProperty();
chart_props.fromGroup = true;
chart_props.ChartProperties = c_obj.chart;
chart_props.ChartProperties = new asc_CChart(c_obj.chart);
}
else
{
......@@ -905,7 +905,7 @@ DrawingObjectsController.prototype =
chart_props = new asc_CImgProperty();
chart_props.Width = c_obj.extX;
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())
......@@ -1166,7 +1166,7 @@ DrawingObjectsController.prototype =
}
if(ArrGlyph[i].isChart() && isRealObject(props.ChartProperties))
{
ArrGlyph[i].chart = props.ChartProperties;
ArrGlyph[i].setChart(props.ChartProperties, true);
ArrGlyph[i].recalculate();
}
......
This diff is collapsed.
......@@ -75,17 +75,36 @@ var historyitem_Cell_SetQuotePrefix = 20;
var historyitem_Cell_Angle = 21;
var historyitem_Cell_Style = 22;
var historyitem_Chart_ChangeType = 1;
var historyitem_Chart_ChangeSubType = 2;
var historyitem_Chart_ChangeShowValue = 3;
var historyitem_Chart_ChangeShowBorder = 4;
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;
// Chart
var historyitem_Chart_Type = 1;
var historyitem_Chart_SubType = 2;
var historyitem_Chart_Style = 3;
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_Extents = 2;
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