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 = ...@@ -1195,11 +1195,14 @@ DrawingObjectsController.prototype =
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaTextPr({Unifill: unifill})]); this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaTextPr({Unifill: unifill})]);
}, },
setCellBackgroundColor: function (color) { setCellBackgroundColor: function (color)
var unifill = new CUniFill(); {
unifill.setFill(new CSolidFill()); var fill = new CAscFill();
unifill.fill.setColor(CorrectUniColor(color, null)); fill.type = c_oAscFill.FILL_TYPE_SOLID;
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{fill:CreateAscFill(unifill)}]); fill.fill = new CAscFillSolid();
fill.fill.color = color;
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{fill: fill}]);
}, },
...@@ -1588,7 +1591,6 @@ DrawingObjectsController.prototype = ...@@ -1588,7 +1591,6 @@ DrawingObjectsController.prototype =
this.applyPropsToChartSpace(chartSettings, chart_space); this.applyPropsToChartSpace(chartSettings, chart_space);
chart_space.addToRecalculate(); //TODO chart_space.addToRecalculate(); //TODO
chart_space.setRecalculateInfo();//TODO: обязательно переделать chart_space.setRecalculateInfo();//TODO: обязательно переделать
this.startRecalculate();
} }
}, },
...@@ -1599,22 +1601,55 @@ DrawingObjectsController.prototype = ...@@ -1599,22 +1601,55 @@ DrawingObjectsController.prototype =
var sRange = chartSettings.getRange(); var sRange = chartSettings.getRange();
if(this.drawingObjects && this.drawingObjects.getWorksheet && typeof sRange === "string" && sRange.length > 0) if(this.drawingObjects && this.drawingObjects.getWorksheet && typeof sRange === "string" && sRange.length > 0)
{ {
var asc_chart = new asc_CChart();
asc_chart.range.interval = sRange; var ws_view = this.drawingObjects.getWorksheet();
asc_chart.worksheet = this.drawingObjects.getWorksheet(); var parsed_formula = parserHelp.parse3DRef(sRange);
this.drawingObjects.intervalToIntervalObject(asc_chart); var ws = ws_view.model.workbook.getWorksheetByName(parsed_formula.sheet);
if(chartSettings.getInColumns()) var new_bbox;
var range_object = ws.getRange2(parsed_formula.range);
if(range_object)
{ {
asc_chart.range.rows = false; new_bbox = range_object.bbox;
asc_chart.range.columns = true;
} }
else if( parsed_formula && ws && new_bbox )
{ {
asc_chart.range.rows = true;
asc_chart.range.columns = false; 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;
asc_chart.range.columns = true;
}
else
{
asc_chart.range.rows = true;
asc_chart.range.columns = false;
}
asc_chart.rebuildSeries();
chart_space.rebuildSeriesFromAsc(asc_chart);
}
} }
asc_chart.rebuildSeries();
chart_space.rebuildSeriesFromAsc(asc_chart);
} }
if(isRealNumber(style_index) && style_index > 0 && style_index < 49) if(isRealNumber(style_index) && style_index > 0 && style_index < 49)
...@@ -1640,9 +1675,6 @@ DrawingObjectsController.prototype = ...@@ -1640,9 +1675,6 @@ DrawingObjectsController.prototype =
} }
chart.title.setOverlay(title_show_settings === c_oAscChartTitleShowSettings.overlay); chart.title.setOverlay(title_show_settings === c_oAscChartTitleShowSettings.overlay);
} }
//Row/Cols
if(chartSettings.getRowCols() !== null)
chart_space.swapData();
var plot_area = chart.plotArea; var plot_area = chart.plotArea;
//horAxisLabel //horAxisLabel
......
This diff is collapsed.
...@@ -3140,7 +3140,12 @@ CShape.prototype = ...@@ -3140,7 +3140,12 @@ CShape.prototype =
} }
graphics.transform3(transform_text); graphics.transform3(transform_text);
if (graphics.CheckUseFonts2 !== undefined)
graphics.CheckUseFonts2(transform_text);
this.txBody.draw(graphics); this.txBody.draw(graphics);
if (graphics.UncheckUseFonts2 !== undefined)
graphics.UncheckUseFonts2(transform_text);
graphics.SetIntegerGrid(true); graphics.SetIntegerGrid(true);
} }
......
...@@ -4215,7 +4215,7 @@ function CDrawingDocument(drawingObjects) ...@@ -4215,7 +4215,7 @@ function CDrawingDocument(drawingObjects)
for (var j = 0; j < _count_mods; ++j) for (var j = 0; j < _count_mods; ++j)
{ {
var dst_mods = new CColorModifiers(); 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}; var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba); dst_mods.Apply(_rgba);
......
...@@ -4575,7 +4575,7 @@ function CDrawingDocument() ...@@ -4575,7 +4575,7 @@ function CDrawingDocument()
for (var j = 0; j < _count_mods; ++j) for (var j = 0; j < _count_mods; ++j)
{ {
var dst_mods = new CColorModifiers(); 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}; var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba); dst_mods.Apply(_rgba);
......
...@@ -7263,6 +7263,12 @@ CDocument.prototype = ...@@ -7263,6 +7263,12 @@ CDocument.prototype =
return ParaArray; return ParaArray;
}, },
Get_PageSizesByDrawingObjects : function()
{
return this.DrawingObjects.getPageSizesByDrawingObjects();
},
Set_DocumentMargin : function(MarPr) Set_DocumentMargin : function(MarPr)
{ {
// TODO: Document.Set_DocumentOrientation Сделать в зависимости от выделения // TODO: Document.Set_DocumentOrientation Сделать в зависимости от выделения
......
...@@ -280,6 +280,29 @@ CGraphicObjects.prototype = ...@@ -280,6 +280,29 @@ CGraphicObjects.prototype =
getSelectedObjectsByTypes: DrawingObjectsController.prototype.getSelectedObjectsByTypes, 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() Get_Props: function()
{ {
var props_by_types = DrawingObjectsController.prototype.getDrawingProps.call(this); var props_by_types = DrawingObjectsController.prototype.getDrawingProps.call(this);
......
...@@ -202,6 +202,26 @@ function CorrectUniColor(asc_color, unicolor) ...@@ -202,6 +202,26 @@ function CorrectUniColor(asc_color, unicolor)
var _map = editor.WordControl.m_oDrawingDocument.GuiControlColorsMap; var _map = editor.WordControl.m_oDrawingDocument.GuiControlColorsMap;
__mods = GetDefaultMods(_map[_id].r, _map[_id].g, _map[_id].b, _pos, 0); __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) 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