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

Bug 25528 - Убрать заливку у автофигур типа "фигурная скобка"

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57612 954022d7-b5bf-4e40-9824-e11837661b57
parent 392aa914
......@@ -7503,13 +7503,35 @@ CShapeStyle.prototype =
};
function CreateDefaultShapeStyle()
{
var LINE_PRESETS_MAP = {};
LINE_PRESETS_MAP["line"] = true;
LINE_PRESETS_MAP["bracePair"] = true;
LINE_PRESETS_MAP["leftBrace"] = true;
LINE_PRESETS_MAP["rightBrace"] = true;
LINE_PRESETS_MAP["bracketPair"] = true;
LINE_PRESETS_MAP["leftBracket"] = true;
LINE_PRESETS_MAP["rightBracket"] = true;
LINE_PRESETS_MAP["bentConnector2"] = true;
LINE_PRESETS_MAP["bentConnector3"] = true;
LINE_PRESETS_MAP["bentConnector4"] = true;
LINE_PRESETS_MAP["bentConnector5"] = true;
LINE_PRESETS_MAP["curvedConnector2"] = true;
LINE_PRESETS_MAP["curvedConnector3"] = true;
LINE_PRESETS_MAP["curvedConnector4"] = true;
LINE_PRESETS_MAP["curvedConnector5"] = true;
LINE_PRESETS_MAP["straightConnector1"] = true;
LINE_PRESETS_MAP["arc"] = true;
function CreateDefaultShapeStyle(preset)
{
var b_line = typeof preset === "string" && LINE_PRESETS_MAP[preset];
var tx_color = b_line;
var unicolor;
var style = new CShapeStyle();
style.setLnRef(new StyleRef());
style.lnRef.setIdx(2);
style.lnRef.setIdx(b_line ? 1 : 2);
unicolor = new CUniColor();
unicolor.setColor(new CSchemeColor());
......@@ -7525,7 +7547,7 @@ function CreateDefaultShapeStyle()
unicolor.setColor(new CSchemeColor());
unicolor.color.setId(g_clr_accent1);
style.setFillRef(new StyleRef());
style.fillRef.setIdx(1);
style.fillRef.setIdx(b_line ? 0 : 1);
style.fillRef.setColor(unicolor);
......@@ -7539,7 +7561,7 @@ function CreateDefaultShapeStyle()
unicolor = new CUniColor();
unicolor.setColor(new CSchemeColor());
unicolor.color.setId(12);
unicolor.color.setId(tx_color ? 15 : 12);
style.setFontRef(new FontRef());
style.fontRef.setIdx(fntStyleInd_minor);
style.fontRef.setColor(unicolor);
......
......@@ -780,7 +780,7 @@ CShape.prototype =
setDefaultStyle: function () {
this.setStyle(CreateDefaultShapeStyle());
this.setStyle(CreateDefaultShapeStyle(this.spPr && this.spPr.geometry ? this.spPr.geometry.preset : null));
},
setDefaultTextRectStyle: function () {
......
......@@ -17,16 +17,30 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
ExecuteNoHistory(function(){
var style;
if(presetGeom.indexOf("WithArrow") > -1)
{
presetGeom = presetGeom.substr(0, presetGeom.length - 9);
this.presetGeom = presetGeom;
this.arrowsCount = 1;
}
if(presetGeom.indexOf("WithTwoArrows") > -1)
{
presetGeom = presetGeom.substr(0, presetGeom.length - 13);
this.presetGeom = presetGeom;
this.arrowsCount = 2;
}
if(presetGeom !== "textRect")
style = CreateDefaultShapeStyle();
style = CreateDefaultShapeStyle(this.presetGeom);
else
style = CreateDefaultTextRectStyle();
var brush = theme.getFillStyle(style.fillRef.idx);
style.fillRef.Color.Calculate(theme, slide, layout, master, {R:0, G: 0, B:0, A:255});
var RGBA = style.fillRef.Color.RGBA;
if (style.fillRef.Color.color != null)
if (style.fillRef.Color.color)
{
if (brush.fill != null && (brush.fill.type == FILL_TYPE_SOLID))
if (brush.fill && (brush.fill.type === FILL_TYPE_SOLID))
{
brush.fill.color = style.fillRef.Color.createDuplicate();
}
......@@ -54,21 +68,6 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
pen.merge(ln);
brush.merge(fill);
}
if(presetGeom.indexOf("WithArrow") > -1)
{
presetGeom = presetGeom.substr(0, presetGeom.length - 9);
this.presetGeom = presetGeom;
this.arrowsCount = 1;
}
if(presetGeom.indexOf("WithTwoArrows") > -1)
{
presetGeom = presetGeom.substr(0, presetGeom.length - 13);
this.presetGeom = presetGeom;
this.arrowsCount = 2;
}
if(this.arrowsCount > 0)
{
......@@ -400,7 +399,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
{
shape.spPr.setGeometry(CreateGeometry(this.presetGeom));
shape.spPr.geometry.setParent(shape.spPr);
shape.setStyle(CreateDefaultShapeStyle());
shape.setStyle(CreateDefaultShapeStyle(this.presetGeom));
if(this.arrowsCount > 0)
{
var ln = new CLn();
......
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