Commit 2c89b3f9 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@49650 954022d7-b5bf-4e40-9824-e11837661b57
parent 2f9a34cd
...@@ -53,7 +53,7 @@ function ChartStyleManager() { ...@@ -53,7 +53,7 @@ function ChartStyleManager() {
// Methods // Methods
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
_this.init = function(theme, colorScheme) { _this.init = function(options) {
_this.colorMap = []; _this.colorMap = [];
var api_doc = window["editor"]; var api_doc = window["editor"];
...@@ -62,11 +62,11 @@ function ChartStyleManager() { ...@@ -62,11 +62,11 @@ function ChartStyleManager() {
if ( api_sheet ) if ( api_sheet )
themeColors = api_sheet.GuiControlColorsMap; themeColors = api_sheet.GuiControlColorsMap;
else else
themeColors = getDocColors(api_doc); themeColors = getDocColors(api_doc, options);
function getDocColors(api) { function getDocColors(api, options) {
var _theme = theme ? theme : api.WordControl.m_oLogicDocument.theme; var _theme = api.WordControl.m_oLogicDocument.theme;
var _clrMap = colorScheme ? colorScheme : api.WordControl.m_oLogicDocument.clrSchemeMap.color_map; var _clrMap = api.WordControl.m_oLogicDocument.clrSchemeMap ? api.WordControl.m_oLogicDocument.clrSchemeMap.color_map : undefined;
var arr_colors = new Array(10); var arr_colors = new Array(10);
var rgba = {R:0, G:0, B:0, A:255}; var rgba = {R:0, G:0, B:0, A:255};
...@@ -79,7 +79,10 @@ function ChartStyleManager() { ...@@ -79,7 +79,10 @@ function ChartStyleManager() {
for (var i = 0; i < _count; ++i) for (var i = 0; i < _count; ++i)
{ {
color.color.id = array_colors_types[i]; color.color.id = array_colors_types[i];
if(!options)
color.Calculate(_theme, _clrMap, rgba); color.Calculate(_theme, _clrMap, rgba);
else
color.Calculate(options.theme, options.slide, options.layout, options.master, {R:0, G:0, B:0, A:255});
var _rgba = color.RGBA; var _rgba = color.RGBA;
arr_colors[i] = new CColor(_rgba.R, _rgba.G, _rgba.B); arr_colors[i] = new CColor(_rgba.R, _rgba.G, _rgba.B);
...@@ -992,7 +995,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options) ...@@ -992,7 +995,7 @@ function insertChart(chart, activeWorkSheet, width, height, isNewChart, options)
var api_sheet = window["Asc"]["editor"]; var api_sheet = window["Asc"]["editor"];
var styleManager = api_doc ? api_doc.chartStyleManager : api_sheet.chartStyleManager; var styleManager = api_doc ? api_doc.chartStyleManager : api_sheet.chartStyleManager;
if ( !styleManager.isReady() ) if ( !styleManager.isReady() )
styleManager.init(); styleManager.init(options);
arrBaseColors = styleManager.getBaseColors( parseInt(chart.styleId) ); arrBaseColors = styleManager.getBaseColors( parseInt(chart.styleId) );
var arrFormatAdobeLabels = []; var arrFormatAdobeLabels = [];
......
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