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

различные баги

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56506 954022d7-b5bf-4e40-9824-e11837661b57
parent 66668b88
......@@ -36,6 +36,14 @@ function convertFormula(formula, ws) {
return range;
}
function DrawingBounds(minX, maxX, minY, maxY)
{
this.minX = minX;
this.maxX = maxX;
this.minY = minY;
this.maxY = maxY;
}
function convertFormula2(formula, ws) {
var range = null;
......@@ -3432,6 +3440,20 @@ function DrawingObjects() {
}
};
_this.getDrawingObjectsBounds = function()
{
var arr_x = [], arr_y = [], bounds;
for(var i = 0; i < aObjects.length; ++i)
{
bounds = aObjects[i].graphicObject.bounds;
arr_x.push(bounds.l);
arr_x.push(bounds.r);
arr_y.push(bounds.t);
arr_y.push(bounds.b);
}
return new DrawingBounds(Math.min.apply(Math, arr_x), Math.max.apply(Math, arr_x), Math.min.apply(Math, arr_y), Math.max.apply(Math, arr_y));
};
//-----------------------------------------------------------------------------------
// Drawing objects
//-----------------------------------------------------------------------------------
......
......@@ -698,26 +698,53 @@ function ChartPreviewManager() {
settings.putLegendPos(c_oAscChartLegendShowSettings.none);
settings.putHorGridLines(c_oAscGridLinesSettings.none);
settings.putVertGridLines(c_oAscGridLinesSettings.none);
var vert_axis_settings = new asc_ValAxisSettings();
var val_ax_props = new asc_ValAxisSettings();
val_ax_props.putMinValRule(c_oAscValAxisRule.auto);
val_ax_props.putMaxValRule(c_oAscValAxisRule.auto);
val_ax_props.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);
val_ax_props.putInvertValOrder(false);
val_ax_props.putDispUnitsRule(c_oAscValAxUnits.none);
val_ax_props.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);
val_ax_props.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);
val_ax_props.putCrossesRule(c_oAscCrossesRule.auto);
var cat_ax_props = new asc_CatAxisSettings();
cat_ax_props.putIntervalBetweenLabelsRule(c_oAscBetweenLabelsRule.auto);
cat_ax_props.putLabelsPosition(c_oAscLabelsPosition.betweenDivisions);
cat_ax_props.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);
cat_ax_props.putLabelsAxisDistance(100);
cat_ax_props.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);
cat_ax_props.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);
cat_ax_props.putIntervalBetweenTick(1);
cat_ax_props.putCrossesRule(c_oAscCrossesRule.auto);
var vert_axis_settings, hor_axis_settings;
switch(asc_chart.type)
{
case "HBar":
{
vert_axis_settings = cat_ax_props;
hor_axis_settings = val_ax_props;
break;
}
case "Scatter":
{
vert_axis_settings = val_ax_props;
hor_axis_settings = val_ax_props;
break;
}
default :
{
vert_axis_settings = val_ax_props;
hor_axis_settings = cat_ax_props;
break;
}
}
settings.putVertAxisProps(vert_axis_settings);
vert_axis_settings.putMinValRule(c_oAscValAxisRule.auto);
vert_axis_settings.putMaxValRule(c_oAscValAxisRule.auto);
vert_axis_settings.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);
vert_axis_settings.putInvertValOrder(false);
vert_axis_settings.putDispUnitsRule(c_oAscValAxUnits.none);
vert_axis_settings.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);
vert_axis_settings.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);
vert_axis_settings.putCrossesRule(c_oAscCrossesRule.auto);
var hor_axis_settings = new asc_CatAxisSettings();
settings.putHorAxisProps(hor_axis_settings);
hor_axis_settings.putIntervalBetweenLabelsRule(c_oAscBetweenLabelsRule.auto);
hor_axis_settings.putLabelsPosition(c_oAscLabelsPosition.betweenDivisions);
hor_axis_settings.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);
hor_axis_settings.putLabelsAxisDistance(100);
hor_axis_settings.putMajorTickMark(c_oAscTickMark.TICK_MARK_NONE);
hor_axis_settings.putMinorTickMark(c_oAscTickMark.TICK_MARK_NONE);
hor_axis_settings.putIntervalBetweenTick(1);
hor_axis_settings.putCrossesRule(c_oAscCrossesRule.auto);
DrawingObjectsController.prototype.applyPropsToChartSpace(settings, chart_space);
chart_space.setBDeleted(false);
......@@ -775,6 +802,7 @@ function ChartPreviewManager() {
if(chart_space.style !== styleIndex)
{
chart_space.style = styleIndex;
chart_space.recalculateMarkers();
chart_space.recalculateSeriesColors();
}
chart_space.recalculatePenBrush();
......
......@@ -165,6 +165,8 @@ function DrawingObjectsController(drawingObjects)
this.objectsForRecalculate = {};
this.chartForProps = null;
this.handleEventMode = HANDLE_EVENT_MODE_HANDLE;
}
......@@ -204,6 +206,23 @@ DrawingObjectsController.prototype =
}
},
checkChartForProps: function()
{
if(this.chartForProps)
return;
if(this.selection.groupSelection)
{
if(this.selection.groupSelection.selectedObjects.length === 1 && this.selection.groupSelection.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
{
this.chartForProps = this.selection.groupSelection.selectedObjects[0];
}
}
else if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
{
this.chartForProps = this.selectedObjects[0];
}
},
resetInternalSelection: function()
{
if(this.selection.groupSelection)
......@@ -1402,6 +1421,25 @@ DrawingObjectsController.prototype =
editChartDrawingObjects: function(chart)
{
if(this.chartForProps)
{
this.resetSelection();
if(this.chartForProps.group)
{
var main_group = this.chartForProps.getMainGroup();
this.selectObject(main_group, 0);
this.selection.groupSelection = main_group;
main_group.selectObject(this.chartForProps, 0);
}
else
{
this.selectObject(this.chartForProps);
}
this.chartForProps = null;
}
if(this.selectedObjects.length === 1
&& (this.selectedObjects[0].isChart()
|| (isRealObject(this.curState.group) && this.curState.group.selectedObjects.length === 1 && this.curState.group.selectedObjects[0].isChart())))
......@@ -1558,6 +1596,27 @@ DrawingObjectsController.prototype =
{
var chart_space = chartSpace;
var style_index = chartSettings.getStyle();
var sRange = chartSettings.getRange();
if(this.drawingObjects && this.drawingObjects.getWorksheet && typeof sRange === "string" && sRange.length > 0)
{
var asc_chart = new asc_CChart();
asc_chart.range.interval = sRange;
asc_chart.worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.intervalToIntervalObject(asc_chart);
if(chartSettings.getInColumns())
{
asc_chart.range.rows = false;
asc_chart.range.columns = true;
}
else
{
asc_chart.range.rows = true;
asc_chart.range.columns = false;
}
asc_chart.rebuildSeries();
chart_space.rebuildSeriesFromAsc(asc_chart);
}
if(isRealNumber(style_index) && style_index > 0 && style_index < 49)
{
chart_space.setStyle(style_index);
......
......@@ -823,30 +823,31 @@ CChartSpace.prototype =
if(this.bbox && this.bbox.seriesBBox)
{
var r1 = this.bbox.seriesBBox.r1, r2 = this.bbox.seriesBBox.r2, c1 = this.bbox.seriesBBox.c1, c2 = this.bbox.seriesBBox.c2;
if(this.bbox.seriesBBox.bVert)
{
ret.bVert = true;
if(this.bbox.catBBox)
{
--r1;
}
if(this.bbox.serBBox)
{
--c1;
}
}
else
{
ret.bVert = false;
if(this.bbox.catBBox)
{
--c1;
}
if(this.bbox.serBBox)
{
--r1;
}
}
ret.bVert = this.bbox.seriesBBox.bVert;
//if(this.bbox.seriesBBox.bVert)
//{
// ret.bVert = true;
// if(this.bbox.catBBox)
// {
// --r1;
// }
// if(this.bbox.serBBox)
// {
// --c1;
// }
//}
//else
//{
// ret.bVert = false;
// if(this.bbox.catBBox)
// {
// --c1;
// }
// if(this.bbox.serBBox)
// {
// --r1;
// }
//}
var startCell = new CellAddress(r1, c1, 0);
var endCell = new CellAddress(r2, c2, 0);
......@@ -5465,6 +5466,16 @@ CChartSpace.prototype =
pts[i].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
for(var j = 0; j < pts.length; ++j)
{
if(pts[j].compiledMarker)
{
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
}
else
{
......@@ -5506,6 +5517,13 @@ CChartSpace.prototype =
pts[j].brush = null;
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
if(pts[j].compiledMarker)
{
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
}
break;
......@@ -5560,6 +5578,13 @@ CChartSpace.prototype =
pts[j].brush = null;
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
if(pts[j].compiledMarker)
{
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
}
break;
......@@ -5657,6 +5682,11 @@ CChartSpace.prototype =
}
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
if(pts[j].compiledMarker)
{
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
}
}
......
......@@ -366,7 +366,10 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(asc_chart, o
this.selectObject(chart, 0);
if(options)
{
var old_range = options.getRange();
options.putRange(null);
this.editChartCallback(options);
options.putRange(old_range);
}
chart.addToRecalculate();
this.startRecalculate();
......
......@@ -10246,8 +10246,8 @@
}
}
}
this._drawSelection();
this.objectRender.controller.checkChartForProps();
};
// Получаем свойство: редактируем мы сейчас или нет
......
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