Commit 102feaf5 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

убрал возможность добавления каких-либо объектов на удаленный другим пользователем личт (Bug 25424)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57301 954022d7-b5bf-4e40-9824-e11837661b57
parent cc3cb1c5
......@@ -2398,7 +2398,7 @@ function DrawingObjects() {
_this.addImageDrawingObject = function(imageUrl, options) {
_this.controller.resetSelection();
if ( imageUrl && !_this.isViewerMode() ) {
var _image = api.ImageLoader.LoadImage(imageUrl, 1);
......@@ -2467,9 +2467,15 @@ function DrawingObjects() {
var coordsFrom = _this.coordsManager.calculateCoords(drawingObject.from);
var coordsTo = _this.coordsManager.calculateCoords(drawingObject.to);
// CImage
_this.objectLocker.reset();
_this.objectLocker.addObjectId("1");
_this.objectLocker.checkObjects(function(bLock){
if(bLock !== true)
return;
_this.controller.resetSelection();
_this.controller.addImageFromParams(_image.src, pxToMm(coordsFrom.x), pxToMm(coordsFrom.y), pxToMm(coordsTo.x - coordsFrom.x), pxToMm(coordsTo.y - coordsFrom.y));
});
}
worksheet.model.workbook.handlers.trigger("asc_onEndAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
......@@ -2550,7 +2556,14 @@ function DrawingObjects() {
return;
}
return _this.controller.addChartDrawingObject(chart);
_this.objectLocker.reset();
_this.objectLocker.addObjectId("1");
_this.objectLocker.checkObjects(function(bLock){
if(bLock)
{
_this.controller.addChartDrawingObject(chart);
}
});
}
else if ( isObject(chart) && chart["binary"] )
{
......
......@@ -44,9 +44,18 @@ StartAddNewShape.prototype =
onMouseUp: function(e, x, y)
{
if(this.bStart)
{
this.drawingObjects.drawingObjects.objectLocker.reset();
this.drawingObjects.drawingObjects.objectLocker.addObjectId("1");
var oThis = this;
var track = oThis.drawingObjects.arrTrackObjects[0];
this.drawingObjects.drawingObjects.objectLocker.checkObjects(function(bLock){
if(bLock)
{
History.Create_NewPoint();
var shape = this.drawingObjects.arrTrackObjects[0].getShape(false, this.drawingObjects.getDrawingDocument(), this.drawingObjects.drawingObjects);
var shape = track.getShape(false, oThis.drawingObjects.getDrawingDocument(), oThis.drawingObjects.drawingObjects);
if(shape.spPr.xfrm.offX < 0)
{
shape.spPr.xfrm.setOffX(0);
......@@ -55,27 +64,24 @@ StartAddNewShape.prototype =
{
shape.spPr.xfrm.setOffY(0);
}
shape.setWorksheet(this.drawingObjects.drawingObjects.getWorksheetModel());
shape.setWorksheet(oThis.drawingObjects.drawingObjects.getWorksheetModel());
shape.addToDrawingObjects();
this.drawingObjects.checkChartTextSelection();
this.drawingObjects.resetSelection();
shape.select(this.drawingObjects, 0);
if(this.preset === "textRect")
oThis.drawingObjects.checkChartTextSelection();
oThis.drawingObjects.resetSelection();
shape.select(oThis.drawingObjects, 0);
if(oThis.preset === "textRect")
{
this.drawingObjects.selection.textSelection = shape;
//shape.selectionSetStart(e, x, y, 0);
//shape.selectionSetEnd(e, x, y, 0);
oThis.drawingObjects.selection.textSelection = shape;
}
this.drawingObjects.drawingObjects.objectLocker.reset();
this.drawingObjects.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.drawingObjects.objectLocker.checkObjects(function(bLock){});
this.drawingObjects.startRecalculate();
asc["editor"].asc_endAddShape();
this.drawingObjects.drawingObjects.sendGraphicObjectProps();
oThis.drawingObjects.startRecalculate();
oThis.drawingObjects.drawingObjects.sendGraphicObjectProps();
}
});
}
this.drawingObjects.clearTrackObjects();
this.drawingObjects.drawingObjects.showDrawingObjects(true);
this.drawingObjects.updateOverlay();
asc["editor"].asc_endAddShape();
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
}
};
......
......@@ -65,6 +65,8 @@ function addToDrawings(worksheet, graphic, position, lockByDefault)
var drawingObject = drawingObjects.createDrawingObject();
drawingObject.graphicObject = graphic;
graphic.setDrawingBase(drawingObject);
if(!worksheet)
return;
var ret, aObjects = worksheet.Drawings;
if (isRealNumber(position)) {
aObjects.splice(position, 0, drawingObject);
......
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