Commit d7bb0d60 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50211 954022d7-b5bf-4e40-9824-e11837661b57
parent 99c77470
......@@ -19,7 +19,7 @@ function PolyLine (drawingObjects)
&& isRealObject(this.style) && isRealObject(this.style.lnRef) && isRealNumber(this.style.lnRef.idx)
&& isRealObject(this.style.lnRef.Color) && typeof this.style.lnRef.Color.Calculate === "function")
{
_calculated_line = _theme.getLnStyle(this.style.lnRef.idx);
_calculated_line = theme.getLnStyle(this.style.lnRef.idx);
this.style.lnRef.Color.Calculate(theme, slide, layout, masterSlide, RGBA);
RGBA = this.style.lnRef.Color.RGBA;
}
......@@ -103,7 +103,8 @@ function PolyLine (drawingObjects)
{
var dx = this.arrPoint[0].x - this.arrPoint[this.arrPoint.length-1].x;
var dy = this.arrPoint[0].y - this.arrPoint[this.arrPoint.length-1].y;
if(Math.sqrt(dx*dx +dy*dy) < this.drawingObjects.convertMetric(3, 0, 3))
var dd = editor.WordControl.m_oDrawingDocument;
if(Math.sqrt(dx*dx +dy*dy) < dd.GetMMPerDot(3))
{
bClosed = true;
}
......@@ -134,12 +135,12 @@ function PolyLine (drawingObjects)
var shape = new CShape(null, this.drawingObjects);
var shape = new CShape(this.drawingObjects);
shape.setPosition(xMin, yMin);
shape.setOffset(xMin, yMin);
shape.setExtents(xMax-xMin, yMax-yMin);
shape.setStyle(CreateDefaultShapeStyle());
var geometry = new CGeometry();
var geometry = new Geometry();
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin);
geometry.AddRect("l", "t", "r", "b");
......@@ -152,11 +153,8 @@ function PolyLine (drawingObjects)
{
geometry.AddPathCommand(6);
}
geometry.Init( xMax-xMin, yMax-yMin);
shape.spPr.geometry = geometry;
shape.recalculate();
this.drawingObjects.addGraphicObject(shape);
shape.setGeometry(geometry);
return shape;
}
}
......
......@@ -59,6 +59,9 @@ function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument,
CChartAsGroup.prototype =
{
getAllFonts: function()
{},
getSearchResults: function()
{
return null;
......
......@@ -223,11 +223,37 @@ CShape.prototype =
},
initDefault: function(x, y, extX, extY, flipH, flipV, presetGeom)
initDefault: function(x, y, extX, extY, flipH, flipV, presetGeom, arrowsCount)
{
this.setXfrm(x, y, extX, extY, 0, flipH, flipV);
this.setPresetGeometry(presetGeom);
this.setDefaultStyle();
if(arrowsCount === 1 || arrowsCount === 2)
{
switch (arrowsCount)
{
case 1:
{
var ln = new CLn();
ln.tailEnd = new EndArrow();
ln.tailEnd.type = LineEndType.Arrow;
ln.tailEnd.len = LineEndSize.Mid;
break;
}
case 2:
{
var ln = new CLn();
ln.tailEnd = new EndArrow();
ln.tailEnd.type = LineEndType.Arrow;
ln.tailEnd.len = LineEndSize.Mid;
ln.headEnd = new EndArrow();
ln.headEnd.type = LineEndType.Arrow;
ln.headEnd.len = LineEndSize.Mid;
break;
}
}
this.setLine(ln);
}
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
......@@ -3396,6 +3422,19 @@ CShape.prototype =
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setLine: function(line)
{
var old_line = this.spPr.ln;
var new_line = line;
this.spPr.ln = line;
History.Add(this, {Type: historyitem_SetShapeSetLine, oldLine: old_line, newLine: new_line});
this.recalcInfo.recalculateLine = true;
this.recalcInfo.recalculatePen = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
transformPointRelativeShape: function(x, y)
{
......
......@@ -16,10 +16,9 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
this.y = null;
this.extX = null;
this.extY = null;
this.arrowsCount = 0;
this.transform = new CMatrix();
var geometry = CreateGeometry(presetGeom !== "textRect" ? presetGeom : "rect");
geometry.Init(5, 5);
var theme = drawingObjects.Layout.Master.Theme;
......@@ -65,6 +64,22 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
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;
}
var geometry = CreateGeometry(presetGeom !== "textRect" ? presetGeom : "rect");
geometry.Init(5, 5);
pen.Fill.calculate(theme, drawingObjects, drawingObjects.Layout, drawingObjects.Layout.Master, RGBA);
brush.calculate(theme, drawingObjects, drawingObjects.Layout, drawingObjects.Layout.Master, RGBA);
......@@ -267,7 +282,7 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
var shape = new CShape(null, this.drawingObjects);
shape.setParent(drawingObjects);
if(this.presetGeom !== "textRect")
shape.initDefault(this.x, this.y, this.extX, this.extY, false, false, this.presetGeom);
shape.initDefault(this.x, this.y, this.extX, this.extY, false, false, this.presetGeom, this.arrowsCount);
else
shape.initDefaultTextRect(this.x, this.y, this.extX, this.extY, false, false);
shape.select(this.drawingObjects.graphicObjects);
......
......@@ -840,7 +840,7 @@ function CreateAscStroke(ln, _canChangeArrows)
var _c = _fill.colors;
if (_c != 0)
{
ret.color = CreateAscColor(_fill.colors[0]);
ret.color = CreateAscColor(_fill.colors[0].color);
ret.type = c_oAscStrokeType.STROKE_COLOR;
}
......
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