Commit 8535f99f 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@56392 954022d7-b5bf-4e40-9824-e11837661b57
parent 0059351e
......@@ -916,7 +916,7 @@ DrawingObjectsController.prototype =
var content = this.getTargetDocContent();
if(content)
{
content.Set_PageBreakBefore(Value);
content.Set_ParagraphPageBreakBefore(Value);
}
},
setParagraphKeepLines: function(Value)
......@@ -1368,15 +1368,15 @@ DrawingObjectsController.prototype =
getAscChartObject: function()
{
var chart = null;
for (var i = 0; i < this.selectedObjects.length; i++) {
if ( this.selectedObjects[i].isChart() )
{
this.selectedObjects[i].drObjects = this;
return this.selectedObjects[i];
}
}
return chart;
//var chart = null;
//for (var i = 0; i < this.selectedObjects.length; i++) {
// if ( this.selectedObjects[i].isChart() )
// {
// this.selectedObjects[i].drObjects = this;
// return this.selectedObjects[i];
// }
//}
//return chart;
},
editChartDrawingObjects: function(chart)
......@@ -1510,15 +1510,22 @@ DrawingObjectsController.prototype =
var objects_by_types = this.getSelectedObjectsByTypes();
if(objects_by_types.charts.length === 1)
{
//Style Index
var chart_space = objects_by_types.charts[0];
this.applyPropsToChartSpace(chartSettings, chart_space);
chart_space.addToRecalculate(); //TODO
chart_space.setRecalculateInfo();//TODO: обязательно переделать
this.startRecalculate();
}
},
applyPropsToChartSpace: function(chartSettings, chartSpace)
{
var chart_space = chartSpace;
var style_index = chartSettings.getStyle();
if(isRealNumber(style_index) && style_index > 0 && style_index < 49)
{
chart_space.setStyle(style_index);
}
//Title Settings
var chart = chart_space.chart;
var title_show_settings = chartSettings.getTitle();
......@@ -1698,7 +1705,7 @@ DrawingObjectsController.prototype =
setAxisGridLines(plot_area.getVerticalAxis(), chartSettings.getHorGridLines());
setAxisGridLines(plot_area.getHorizontalAxis(), chartSettings.getVertGridLines());
var chart_type = plot_area.chart;
var chart_type = plot_area.charts[0];
//Data Labels
var data_labels_pos_setting = chartSettings.getDataLabelsPos();
if(isRealNumber(data_labels_pos_setting))
......@@ -1903,7 +1910,7 @@ DrawingObjectsController.prototype =
if(chart_type.getObjectType() !== historyitem_type_PieChart)
{
new_chart_type = new CPieChart();
replaceChart(plot_area, chart_type, new_chart_type)
replaceChart(plot_area, chart_type, new_chart_type);
new_chart_type.setVaryColors(true);
}
break;
......@@ -1913,7 +1920,7 @@ DrawingObjectsController.prototype =
if(chart_type.getObjectType() !== historyitem_type_DoughnutChart)
{
new_chart_type = new CDoughnutChart();
replaceChart(plot_area, chart_type, new_chart_type)
replaceChart(plot_area, chart_type, new_chart_type);
new_chart_type.setVaryColors(true);
new_chart_type.setHoleSize(50);
}
......@@ -1995,7 +2002,7 @@ DrawingObjectsController.prototype =
if(!chartType.dLbls)
chartType.setDLbls(new CDLbls());
return chartType.dLbls;
}
};
if(isRealBool(chartSettings.showCatName))
checkDataLabels(chart_type).setShowCatName(chartSettings.showCatName);
if(isRealBool(chartSettings.showSerName))
......@@ -2006,15 +2013,8 @@ DrawingObjectsController.prototype =
if(typeof chartSettings.separator === "string" && chartSettings.separator.length > 0)
checkDataLabels(chart_type).setSeparator(chartSettings.separator);
}
chart_space.addToRecalculate(); //TODO
chart_space.setRecalculateInfo();//TODO: обязательно переделать
this.startRecalculate();
}
},
getChartProps: function()
{
var objects_by_types = this.getSelectedObjectsByTypes();
......@@ -2026,11 +2026,19 @@ DrawingObjectsController.prototype =
return ret;
},
getPropsFromChart: function(chart_space)
{
var chart = chart_space.chart, plot_area = chart_space.chart.plotArea;
var ret = new asc_ChartSettings();
var range_obj = chart_space.getRangeObjectStr();
if(range_obj)
{
if(typeof range_obj.range === "string" && range_obj.range.length > 0)
{
ret.putRange(range_obj.range);
ret.putInColumns(!range_obj.bVert);
}
}
ret.putStyle(isRealNumber(chart_space.style) ? chart_space.style : null);
ret.putTitle(isRealObject(chart.title) ? (chart.title.overlay ? c_oAscChartTitleShowSettings.overlay : c_oAscChartTitleShowSettings.noOverlay) : c_oAscChartTitleShowSettings.none);
var hor_axis = plot_area.getHorizontalAxis();
......@@ -2105,7 +2113,7 @@ DrawingObjectsController.prototype =
ret.putLegendPos(c_oAscChartLegendShowSettings.none);
}
var chart_type = plot_area.chart;
var chart_type = plot_area.charts[0];
var chart_type_object_type = chart_type.getObjectType();
var calc_chart_type;
......@@ -3814,9 +3822,13 @@ DrawingObjectsController.prototype =
//image_props.Locked = false;//TODO!(props.imageProps.lockType === c_oAscLockTypes.kLockTypeNone);
ret.push(image_props);
}
if (isRealObject(chart_props))
if (isRealObject(props.chartProps) && isRealObject(props.chartProps.chartProps))
{
//Todo: ret.push(chart_props);
chart_props = new asc_CImgProperty();
chart_props.Width = props.chartProps.w;
chart_props.Height = props.chartProps.h;
chart_props.ChartProperties = props.chartProps.chartProps;
ret.push(chart_props);
}
for (var i = 0; i < ret.length; i++)
{
......@@ -5070,10 +5082,10 @@ function CreateImageDrawingObject(imageUrl, options, drawingObjects) {
var coordsFrom = _this.coordsManager.calculateCoords(drawingObject.from);
var coordsTo = _this.coordsManager.calculateCoords(drawingObject.to);
drawingObject.graphicObject = new CImageShape(drawingObject, _this);
drawingObject.graphicObject.initDefault( drawingObjects.convertMetric(coordsFrom.x, 0, 3), drawingObjects.convertMetric(coordsFrom.y, 0, 3), drawingObjects.convertMetric(coordsTo.x - coordsFrom.x, 0, 3), drawingObjects.convertMetric(coordsTo.y - coordsFrom.y, 0, 3), _image.src );
drawingObject.graphicObject = _this.controller.createImage(_image.src, drawingObjects.convertMetric(coordsFrom.x, 0, 3), drawingObjects.convertMetric(coordsFrom.y, 0, 3), drawingObjects.convertMetric(coordsTo.x - coordsFrom.x, 0, 3), drawingObjects.convertMetric(coordsTo.y - coordsFrom.y, 0, 3));
drawingObject.graphicObject.setWorksheet(worksheet.model);
// drawingObject.graphicObject.select(_this.controller);
drawingObject.graphicObject.setDrawingObjects(_this);
//drawingObject.graphicObject.setDrawingObjects(_this);
//drawingObject.graphicObject.addToDrawingObjects();
return drawingObject;
}
......
......@@ -8166,6 +8166,7 @@
a_drawings[j].addToDrawingObjects();
a_drawings[j].select( t.objectRender.controller);
}
t.objectRender.controller.startRecalculate();
}
}
for(var j = 0; j < a_drawings.length; ++j)
......
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