Commit 5a3014aa authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50199 954022d7-b5bf-4e40-9824-e11837661b57
parent 8eb7d0e7
......@@ -248,13 +248,13 @@ function Spline(drawingObjects)
xMax = max_x;
yMin = min_y;
yMax = max_y;
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");
for(i = 0; i< this.path.length; ++i)
......@@ -282,10 +282,8 @@ function Spline(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;
};
this.addPathCommand = function(pathCommand)
......
......@@ -1121,6 +1121,7 @@ var changestype_MoveComment = 68;
var changestype_AddSp = 69;
var changestype_AddComment = 70;
var changestype_Layout = 71;
var changestype_AddShape = 71;
......
......@@ -6400,6 +6400,20 @@ CPresentation.prototype =
}
}
if(CheckType === changestype_AddShape)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var check_obj =
{
"type": c_oAscLockTypeElemPresentation.Object,
"slideId": slide_id,
"objId": AdditionalData.Get_Id(),
"guid": AdditionalData.Get_Id()
};
AdditionalData.Lock.Check(check_obj);
}
if(CheckType === changestype_AddSp || CheckType === changestype_AddComment)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
......
......@@ -3348,6 +3348,16 @@ CShape.prototype =
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setGeometry: function(geometry)
{
var old_geometry = this.spPr.geometry;
var new_geometry = geometry;
this.spPr.geometry = geometry;
History.Add(this, {Type: historyitem_SetShapeSetGeometry, oldGeometry: old_geometry, newGeometry: new_geometry});
this.recalcInfo.recalculateGeometry = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
changeFill : function(unifill)
{
......
......@@ -3827,8 +3827,15 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st
{
if(e.ClickCount >= 2)
{
this.spline.createShape(null, this.drawingObjects);
var sp = this.spline.createShape(null, this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate();
}
this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay();
......@@ -3882,8 +3889,15 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st
{
if(e.ClickCount >= 2)
{
this.spline.createShape(this.drawingObjects);
var sp = this.spline.createShape(this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate();
}
this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay();
......@@ -3971,8 +3985,15 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline)
{
if(e.ClickCount >= 2)
{
this.spline.createShape(this.drawingObjects);
var sp = this.spline.createShape(this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate();
}
this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay();
......@@ -4079,8 +4100,15 @@ function SplineBezierState5(drawingObjectsController, drawingObjects, startX, st
{
if(e.ClickCount >= 2)
{
this.spline.createShape(this.drawingObjects);
var sp = this.spline.createShape(this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate();
}
this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
......@@ -4257,7 +4285,15 @@ function PolyLineAddState2(drawingObjectsController, drawingObjects, minDistance
{
if(this.polyline.arrPoint.length > 1)
{
this.polyline.createShape();
var sp = this.polyline.createShape();
var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate();
}
}
this.drawingObjectsController.clearTrackObjects();
......@@ -4398,7 +4434,15 @@ function AddPolyLine2State3(drawingObjectsController, drawingObjects, polyline)
this.polyline.arrPoint.push({x: x, y: y});
if(e.ClickCount > 1)
{
this.polyline.createShape();
var sp = this.polyline.createShape();
var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate();
}
this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
......
......@@ -101,7 +101,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;
}
......@@ -132,12 +133,12 @@ function PolyLine (drawingObjects)
var shape = new CShape(null, this.drawingObjects);
var shape = new CShape(this.drawingObjects);
shape.setPosition(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");
......@@ -150,11 +151,9 @@ function PolyLine (drawingObjects)
{
geometry.AddPathCommand(6);
}
geometry.Init( xMax-xMin, yMax-yMin);
shape.spPr.geometry = geometry;
shape.setGeometry(geometry);
shape.recalculate();
this.drawingObjects.addGraphicObject(shape);
return shape;
}
}
......
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