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

Баги с изменением диапазона диаграмм. Разные color mods для разных...

Баги с изменением диапазона диаграмм. Разные  color mods для разных редакторов. Get_PageSizesByDrawingObjects у CDocument

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56536 954022d7-b5bf-4e40-9824-e11837661b57
parent cf217760
This diff is collapsed.
......@@ -1195,11 +1195,14 @@ DrawingObjectsController.prototype =
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaTextPr({Unifill: unifill})]);
},
setCellBackgroundColor: function (color) {
var unifill = new CUniFill();
unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor(color, null));
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{fill:CreateAscFill(unifill)}]);
setCellBackgroundColor: function (color)
{
var fill = new CAscFill();
fill.type = c_oAscFill.FILL_TYPE_SOLID;
fill.fill = new CAscFillSolid();
fill.fill.color = color;
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{fill: fill}]);
},
......@@ -1588,7 +1591,6 @@ DrawingObjectsController.prototype =
this.applyPropsToChartSpace(chartSettings, chart_space);
chart_space.addToRecalculate(); //TODO
chart_space.setRecalculateInfo();//TODO: обязательно переделать
this.startRecalculate();
}
},
......@@ -1598,11 +1600,41 @@ DrawingObjectsController.prototype =
var style_index = chartSettings.getStyle();
var sRange = chartSettings.getRange();
if(this.drawingObjects && this.drawingObjects.getWorksheet && typeof sRange === "string" && sRange.length > 0)
{
var ws_view = this.drawingObjects.getWorksheet();
var parsed_formula = parserHelp.parse3DRef(sRange);
var ws = ws_view.model.workbook.getWorksheetByName(parsed_formula.sheet);
var new_bbox;
var range_object = ws.getRange2(parsed_formula.range);
if(range_object)
{
new_bbox = range_object.bbox;
}
if( parsed_formula && ws && new_bbox )
{
var b_equal_bbox = chart_space.bbox.seriesBBox.r1 === new_bbox.r1
&& chart_space.bbox.seriesBBox.r2 === new_bbox.r2
&& chart_space.bbox.seriesBBox.c1 === new_bbox.c1
&& chart_space.bbox.seriesBBox.c2 === new_bbox.c2;
var b_equal_ws = chart_space.bbox.worksheet === ws;
var b_equal_vert = chartSettings.getInColumns() === !chart_space.bbox.seriesBBox.bVert;
if(!(chart_space.bbox && chart_space.bbox.seriesBBox && b_equal_ws
&& b_equal_bbox && b_equal_vert))
{
var asc_chart = new asc_CChart();
asc_chart.range.interval = sRange;
asc_chart.worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.intervalToIntervalObject(asc_chart);
if(chart_space.bbox && b_equal_bbox && b_equal_ws && !b_equal_vert)
{
if(chart_space.bbox.catBBox)
asc_chart.range.serHeadersBBox = {r1: chart_space.bbox.catBBox.r1, r2: chart_space.bbox.catBBox.r2, c1: chart_space.bbox.catBBox.c1, c2: chart_space.bbox.catBBox.c2};
if(chart_space.bbox.serBBox)
asc_chart.range.catHeadersBBox = {r1: chart_space.bbox.serBBox.r1, r2: chart_space.bbox.serBBox.r2, c1: chart_space.bbox.serBBox.c1, c2: chart_space.bbox.serBBox.c2};
}
if(chartSettings.getInColumns())
{
asc_chart.range.rows = false;
......@@ -1617,6 +1649,9 @@ DrawingObjectsController.prototype =
chart_space.rebuildSeriesFromAsc(asc_chart);
}
}
}
if(isRealNumber(style_index) && style_index > 0 && style_index < 49)
{
chart_space.setStyle(style_index);
......@@ -1640,9 +1675,6 @@ DrawingObjectsController.prototype =
}
chart.title.setOverlay(title_show_settings === c_oAscChartTitleShowSettings.overlay);
}
//Row/Cols
if(chartSettings.getRowCols() !== null)
chart_space.swapData();
var plot_area = chart.plotArea;
//horAxisLabel
......
This diff is collapsed.
......@@ -3140,7 +3140,12 @@ CShape.prototype =
}
graphics.transform3(transform_text);
if (graphics.CheckUseFonts2 !== undefined)
graphics.CheckUseFonts2(transform_text);
this.txBody.draw(graphics);
if (graphics.UncheckUseFonts2 !== undefined)
graphics.UncheckUseFonts2(transform_text);
graphics.SetIntegerGrid(true);
}
......
......@@ -4215,7 +4215,7 @@ function CDrawingDocument(drawingObjects)
for (var j = 0; j < _count_mods; ++j)
{
var dst_mods = new CColorModifiers();
dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0));
dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 2));
var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba);
......
......@@ -4575,7 +4575,7 @@ function CDrawingDocument()
for (var j = 0; j < _count_mods; ++j)
{
var dst_mods = new CColorModifiers();
dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0));
dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 1));
var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba);
......
......@@ -7263,6 +7263,12 @@ CDocument.prototype =
return ParaArray;
},
Get_PageSizesByDrawingObjects : function()
{
return this.DrawingObjects.getPageSizesByDrawingObjects();
},
Set_DocumentMargin : function(MarPr)
{
// TODO: Document.Set_DocumentOrientation Сделать в зависимости от выделения
......
......@@ -280,6 +280,29 @@ CGraphicObjects.prototype =
getSelectedObjectsByTypes: DrawingObjectsController.prototype.getSelectedObjectsByTypes,
getPageSizesByDrawingObjects: function()
{
var aW = [], aH = [];
var aBPages = [];
var page_limits;
if(this.selectedObjects.length > 0)
{
for(var i = 0; i < this.selectedObjects.length; ++i)
{
if(!aBPages[this.selectedObjects[i].selectStartPage])
{
page_limits = this.document.Get_PageLimits(this.selectedObjects[i].selectStartPage);
aW.push(page_limits.XLimit);
aH.push(page_limits.YLimit);
aBPages[this.selectedObjects[i].selectStartPage] = true;
}
}
return {W: Math.min.apply(Math, aW), H: Math.min.apply(Math, aH)};
}
page_limits = this.document.Get_PageLimits(0);
return {W: page_limits.XLimit, H: page_limits.YLimit};
},
Get_Props: function()
{
var props_by_types = DrawingObjectsController.prototype.getDrawingProps.call(this);
......
......@@ -202,6 +202,26 @@ function CorrectUniColor(asc_color, unicolor)
var _map = editor.WordControl.m_oDrawingDocument.GuiControlColorsMap;
__mods = GetDefaultMods(_map[_id].r, _map[_id].g, _map[_id].b, _pos, 0);
}
else
{
var _editor = window["Asc"] && window["Asc"]["editor"];
if (_editor && _editor.wbModel)
{
var _theme = _editor.wbModel.theme;
var _clrMap = _editor.wbModel.clrSchemeMap;
if (_theme && _clrMap)
{
var _schemeClr = new CSchemeColor();
_schemeClr.id = array_colors_types[_id];
var _rgba = {R:0, G:0, B:0, A:255};
_schemeClr.Calculate(_theme, _clrMap.color_map, _rgba);
__mods = GetDefaultMods(_schemeClr.RGBA.R, _schemeClr.RGBA.G, _schemeClr.RGBA.B, _pos, 2);
}
}
}
if (null != __mods)
{
......
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