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

Bug 25451 - Изменять цвет заголовка диаграммы при изменении цветовой схемы диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60514 954022d7-b5bf-4e40-9824-e11837661b57
parent 2b57e6a8
......@@ -209,17 +209,6 @@ CDLbl.prototype =
return this.spPr && this.spPr.Fill ? this.spPr.Fill.transparent : null;
},
getTextWidth: function()
{
},
getTextHeight: function()
{
},
recalculate: function()
{
......@@ -615,17 +604,14 @@ CDLbl.prototype =
var style = new CStyle("dataLblStyle", null, null, null);
var text_pr = new CTextPr();
text_pr.FontSize = 10;
text_pr.Unifill = CreateUnfilFromRGB(0,0,0);
var parent_objects;
if(this.chart)
if(this.chart && isRealNumber(this.chart.style) && this.chart.style > 40)
{
parent_objects = this.chart.getParentObjects();
text_pr.Unifill = CreateUnfilFromRGB(255, 255, 255);
}
else if(this.parent)
else
{
parent_objects = this.parent.getParentObjects();
text_pr.Unifill = CreateUnfilFromRGB(0,0,0);
}
var theme = parent_objects.theme;
var para_pr = new CParaPr();
para_pr.Jc = align_Center;
......@@ -634,10 +620,6 @@ CDLbl.prototype =
para_pr.Spacing.Line = 1;
para_pr.Spacing.LineRule = linerule_Auto;
style.ParaPr = para_pr;
var minor_font = theme.themeElements.fontScheme.minorFont;
text_pr.RFonts.Set_FromObject(
{
Ascii: {
......@@ -659,7 +641,6 @@ CDLbl.prototype =
}
);
style.TextPr = text_pr;
var chart_text_pr;
if(this.chart && this.chart.txPr
......@@ -22350,6 +22331,19 @@ CTitle.prototype =
this.parent && this.parent.Refresh_RecalcData2 && this.parent.Refresh_RecalcData2(pageIndex, this);
},
checkAfterChangeTheme: function()
{
this.recalcInfo.recalculateTxBody = true;
this.recalcInfo.recalcTransform = true;
this.recalcInfo.recalcTransformText = true;
this.recalcInfo.recalcContent = true;
this.recalcInfo.recalculateContent = true;
if(this.tx && this.tx.rich && this.tx.rich.content)
{
this.tx.rich.content.Recalc_AllParagraphs_CompiledPr();
}
},
Search : function(Str, Props, SearchEngine, Type)
{
......@@ -22476,8 +22470,6 @@ CTitle.prototype =
this.Id = r.GetString2();
},
paragraphAdd: function(paraItem, bRecalculate)
{
var content = this.getDocContent();
......@@ -22620,21 +22612,6 @@ CTitle.prototype =
},
draw: function(graphics)
{
if(this.chart)
{
//graphics.SetIntegerGrid(false);
//graphics.p_width(70);
//graphics.transform3(this.chart.transform, false);
//graphics.p_color(0, 0, 0, 255);
//graphics._s();
//graphics._m(this.x, this.y);
//graphics._l(this.x + this.extX, this.y + 0);
//graphics._l(this.x + this.extX, this.y + this.extY);
//graphics._l(this.x + 0, this.y + this.extY);
//graphics._z();
//graphics.ds();
//graphics.SetIntegerGrid(true);
}
CDLbl.prototype.draw.call(this, graphics);
},
......@@ -22643,10 +22620,11 @@ CTitle.prototype =
recalculatePen: CShape.prototype.recalculatePen,
recalculateBrush: CShape.prototype.recalculateBrush,
updateSelectionState: CShape.prototype.updateSelectionState,
updateSelectionState: CShape.prototype.updateSelectionState,
checkShapeChildTransform: CDLbl.prototype.checkShapeChildTransform,
updatePosition: function(x, y)
{
this.posX = x;
......@@ -22699,7 +22677,9 @@ CTitle.prototype =
},
getStyles: CDLbl.prototype.getStyles,
Get_Theme: CDLbl.prototype.Get_Theme,
Get_ColorMap: CDLbl.prototype.Get_ColorMap,
recalculateStyle: CDLbl.prototype.recalculateStyle,
......@@ -22712,7 +22692,6 @@ CTitle.prototype =
recalculateContent: CDLbl.prototype.recalculateContent,
recalculate: function()
{
ExecuteNoHistory(function()
......
......@@ -7272,100 +7272,90 @@ CChartSpace.prototype =
}
},
recalculateGridLines: function()
calcGridLine: function(defaultStyle, spPr, subtleLine, parents)
{
if(this.chart && this.chart.plotArea)
if(spPr)
{
var calcMajorMinorGridLines = function (axis, defaultStyle, subtleLine, parents)
var compiled_grid_lines = new CLn();
compiled_grid_lines.merge(subtleLine);
// if(compiled_grid_lines.Fill && compiled_grid_lines.Fill.fill && compiled_grid_lines.Fill.fill.color && compiled_grid_lines.Fill.fill.color.Mods)
// {
// compiled_grid_lines.Fill.fill.color.Mods.Mods.length = 0;
// }
if(!compiled_grid_lines.Fill)
{
if(!axis)
return;
function calcGridLine(defaultStyle, spPr, subtleLine, parents)
{
if(spPr)
{
var compiled_grid_lines = new CLn();
compiled_grid_lines.merge(subtleLine);
// if(compiled_grid_lines.Fill && compiled_grid_lines.Fill.fill && compiled_grid_lines.Fill.fill.color && compiled_grid_lines.Fill.fill.color.Mods)
// {
// compiled_grid_lines.Fill.fill.color.Mods.Mods.length = 0;
// }
if(!compiled_grid_lines.Fill)
{
compiled_grid_lines.setFill(new CUniFill());
}
//if(compiled_grid_lines.Fill && compiled_grid_lines.Fill.fill && compiled_grid_lines.Fill.fill.color && compiled_grid_lines.Fill.fill.color.Mods)
//{
// compiled_grid_lines.Fill.fill.color.Mods.Mods.length = 0;
//}
compiled_grid_lines.Fill.merge(defaultStyle);
compiled_grid_lines.setFill(new CUniFill());
}
//if(compiled_grid_lines.Fill && compiled_grid_lines.Fill.fill && compiled_grid_lines.Fill.fill.color && compiled_grid_lines.Fill.fill.color.Mods)
//{
// compiled_grid_lines.Fill.fill.color.Mods.Mods.length = 0;
//}
compiled_grid_lines.Fill.merge(defaultStyle);
if(subtleLine.Fill && subtleLine.Fill.fill && subtleLine.Fill.fill.color && subtleLine.Fill.fill.color.Mods
&& compiled_grid_lines.Fill && compiled_grid_lines.Fill.fill && compiled_grid_lines.Fill.fill.color)
{
compiled_grid_lines.Fill.fill.color.Mods = subtleLine.Fill.fill.color.Mods.createDuplicate();
}
compiled_grid_lines.merge(spPr.ln);
compiled_grid_lines.calculate(parents.theme, parents.slide, parents.layout, parents.master, {R: 0, G: 0, B: 0, A: 255});
checkBlackUnifill(compiled_grid_lines.Fill, true);
return compiled_grid_lines;
}
return null;
}
axis.compiledMajorGridLines = calcGridLine(defaultStyle.axisAndMajorGridLines, axis.majorGridlines, subtleLine, parents);
axis.compiledMinorGridLines = calcGridLine(defaultStyle.minorGridlines, axis.minorGridlines, subtleLine, parents);
};
var default_style = CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);
var parent_objects = this.getParentObjects();
var RGBA = {R:0, G:0, B:0, A: 255};
var subtle_line;
if(parent_objects.theme && parent_objects.theme.themeElements
&& parent_objects.theme.themeElements.fmtScheme
&& parent_objects.theme.themeElements.fmtScheme.lnStyleLst)
if(subtleLine.Fill && subtleLine.Fill.fill && subtleLine.Fill.fill.color && subtleLine.Fill.fill.color.Mods
&& compiled_grid_lines.Fill && compiled_grid_lines.Fill.fill && compiled_grid_lines.Fill.fill.color)
{
subtle_line = parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0];
compiled_grid_lines.Fill.fill.color.Mods = subtleLine.Fill.fill.color.Mods.createDuplicate();
}
calcMajorMinorGridLines(this.chart.plotArea.valAx, default_style, subtle_line, parent_objects);
calcMajorMinorGridLines(this.chart.plotArea.catAx, default_style, subtle_line, parent_objects);
compiled_grid_lines.merge(spPr.ln);
compiled_grid_lines.calculate(parents.theme, parents.slide, parents.layout, parents.master, {R: 0, G: 0, B: 0, A: 255});
checkBlackUnifill(compiled_grid_lines.Fill, true);
return compiled_grid_lines;
}
return null;
},
getNeedColorCount: function()
calcMajorMinorGridLines: function (axis, defaultStyle, subtleLine, parents)
{
var b_vary_markers = this.chart.plotArea.chart instanceof CDoughnutChart || this.chart.plotArea.chart instanceof CPieChart || (this.chart.plotArea.chart.varyColors && this.chart.plotArea.chart.series.length === 1);
var need_colors;
if(!b_vary_markers)
if(!axis)
return;
axis.compiledMajorGridLines = this.calcGridLine(defaultStyle.axisAndMajorGridLines, axis.majorGridlines, subtleLine, parents);
axis.compiledMinorGridLines = this.calcGridLine(defaultStyle.minorGridlines, axis.minorGridlines, subtleLine, parents);
},
handleTitlesAfterChangeTheme: function()
{
if(this.chart && this.chart.title)
{
return this.chart.plotArea.chart.series.length;
this.chart.title.checkAfterChangeTheme();
}
else
if(this.chart && this.chart.plotArea)
{
if(this.chart.plotArea.chart.series[0].val)
var hor_axis = this.chart.plotArea.getHorizontalAxis();
if(hor_axis && hor_axis.title)
{
return this.chart.plotArea.chart.series[0].val.numRef.numCache.pts.length;
hor_axis.checkAfterChangeTheme();
}
else
var vert_axis = this.chart.plotArea.getVerticalAxis();
if(vert_axis && vert_axis.title)
{
if(this.chart.plotArea.chart.series[0].yVal)
{
return this.chart.plotArea.chart.series[0].yVal.numRef.numCache.pts.length;
}
else
{
return 0;
}
vert_axis.title.checkAfterChangeTheme();
}
}
},
hitToAdjustment: function()
recalculateGridLines: function()
{
return {hit: false};
if(this.chart && this.chart.plotArea)
{
var default_style = CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);
var parent_objects = this.getParentObjects();
var subtle_line;
if(parent_objects.theme && parent_objects.theme.themeElements
&& parent_objects.theme.themeElements.fmtScheme
&& parent_objects.theme.themeElements.fmtScheme.lnStyleLst)
{
subtle_line = parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0];
}
this.calcMajorMinorGridLines(this.chart.plotArea.valAx, default_style, subtle_line, parent_objects);
this.calcMajorMinorGridLines(this.chart.plotArea.catAx, default_style, subtle_line, parent_objects);
}
},
hitInWorkArea: function()
hitToAdjustment: function()
{
return false;
return {hit: false};
},
recalculateAxisLabels: function()
......
......@@ -155,6 +155,9 @@ CChartSpace.prototype.handleUpdateStyle = function()
this.recalcInfo.recalculatePen = true;
this.recalcInfo.recalculateHiLowLines = true;
this.recalcInfo.recalculateUpDownBars = true;
this.handleTitlesAfterChangeTheme();
this.recalcInfo.recalculateAxisLabels = true;
this.recalcInfo.recalculateAxisVal = true;
this.addToRecalculate();
};
......
......@@ -260,6 +260,9 @@ CChartSpace.prototype.handleUpdateStyle = function()
this.recalcInfo.recalculatePen = true;
this.recalcInfo.recalculateHiLowLines = true;
this.recalcInfo.recalculateUpDownBars = true;
this.handleTitlesAfterChangeTheme();
this.recalcInfo.recalculateAxisLabels = true;
this.recalcInfo.recalculateAxisVal = true;
this.addToRecalculate();
};
CChartSpace.prototype.handleUpdateFill = function()
......
......@@ -297,6 +297,7 @@ CShape.prototype.handleUpdateTheme = function()
this.recalcStyle && this.recalcStyle();
this.recalcInfo.recalculateTextStyles && (this.recalcInfo.recalculateTextStyles = [true, true, true, true, true, true, true, true, true]);
this.recalcBounds && this.recalcBounds();
this.handleTitlesAfterChangeTheme && this.handleTitlesAfterChangeTheme();
if(Array.isArray(this.spTree))
{
for(var i = 0; i < this.spTree.length; ++i)
......
......@@ -180,6 +180,9 @@ CChartSpace.prototype.handleUpdateStyle = function()
this.recalcInfo.recalculatePen = true;
this.recalcInfo.recalculateHiLowLines = true;
this.recalcInfo.recalculateUpDownBars = true;
this.handleTitlesAfterChangeTheme();
this.recalcInfo.recalculateAxisLabels = true;
this.recalcInfo.recalculateAxisVal = true;
this.addToRecalculate();
};
CChartSpace.prototype.canGroup = CShape.prototype.canGroup;
......@@ -546,10 +549,10 @@ CChartSpace.prototype.updateTransformMatrix = function()
};
CChartSpace.prototype.getArrayWrapIntervals = CShape.prototype.getArrayWrapIntervals;
CChartSpace.prototype.select = CShape.prototype.select;
CChartSpace.prototype.Refresh_RecalcData = function(data)
{
this.addToRecalculate();
};
//CChartSpace.prototype.Refresh_RecalcData = function(data)
//{
// this.addToRecalculate();
//};
function CreateUnifillSolidFillSchemeColor(colorId, tintOrShade)
{
......
......@@ -2325,6 +2325,7 @@ CGraphicObjects.prototype =
History.Create_NewPoint();
this.selectedObjects[0].parent.Set_WrappingType(WRAPPING_TYPE_TIGHT);
this.document.Recalculate();
this.document.Document_UpdateInterfaceState();
}
}
this.resetInternalSelection();
......
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