bug fix
This commit is contained in:
@@ -568,7 +568,34 @@ CCellCommentator.prototype.isViewerMode = function () {
|
||||
return this.worksheet.handlers.trigger("getViewerMode");
|
||||
};
|
||||
CCellCommentator.prototype.isLockedComment = function (oComment, callbackFunc) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
if (false === this.worksheet.collaborativeEditing.isCoAuthoringExcellEnable()) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
return;
|
||||
}
|
||||
var objectGuid = oComment.asc_getId();
|
||||
if (objectGuid) {
|
||||
var sheetId = CCellCommentator.sStartCommentId;
|
||||
if (!oComment.bDocument) {
|
||||
sheetId += this.worksheet.model.getId();
|
||||
}
|
||||
var lockInfo = this.worksheet.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, objectGuid);
|
||||
if (false === this.worksheet.collaborativeEditing.getCollaborativeEditing()) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
callbackFunc = undefined;
|
||||
}
|
||||
if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeMine, false)) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
return;
|
||||
} else {
|
||||
if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, false)) {
|
||||
Asc.applyFunction(callbackFunc, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.worksheet.collaborativeEditing.onStartCheckLock();
|
||||
this.worksheet.collaborativeEditing.addCheckLock(lockInfo);
|
||||
this.worksheet.collaborativeEditing.onEndCheckLock(callbackFunc);
|
||||
}
|
||||
};
|
||||
CCellCommentator.prototype.moveRangeComments = function (rangeFrom, rangeTo) {
|
||||
if (rangeFrom && rangeTo) {
|
||||
|
||||
@@ -116,6 +116,12 @@ function CIdCounter() {
|
||||
this.Set_Load = function (bValue) {
|
||||
this.m_bLoad = bValue;
|
||||
};
|
||||
this.Clear = function () {
|
||||
this.m_sUserId = null;
|
||||
this.m_bLoad = true;
|
||||
this.m_nIdCounterLoad = 0;
|
||||
this.m_nIdCounterEdit = 0;
|
||||
};
|
||||
}
|
||||
function CTableId() {
|
||||
this.m_aPairs = {};
|
||||
@@ -560,7 +566,12 @@ CTableId.prototype = {
|
||||
}
|
||||
return true;
|
||||
},
|
||||
Unlock: function (Data) {}
|
||||
Unlock: function (Data) {},
|
||||
Clear: function () {
|
||||
this.m_aPairs = {};
|
||||
this.m_bTurnOff = false;
|
||||
this.Add(this, g_oIdCounter.Get_NewId());
|
||||
}
|
||||
};
|
||||
var g_oIdCounter = null;
|
||||
var g_oTableId = null;
|
||||
|
||||
@@ -1402,8 +1402,156 @@ CGraphics.prototype = {
|
||||
this.SetIntegerGrid(false);
|
||||
}
|
||||
},
|
||||
DrawLockParagraph: function (lock_type, x, y1, y2) {},
|
||||
DrawLockObjectRect: function (lock_type, x, y, w, h) {},
|
||||
DrawLockParagraph: function (lock_type, x, y1, y2) {
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeNone || editor.WordControl.m_oDrawingDocument.IsLockObjectsEnable === false || editor.isViewMode) {
|
||||
return;
|
||||
}
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeMine) {
|
||||
this.p_color(22, 156, 0, 255);
|
||||
} else {
|
||||
this.p_color(238, 53, 37, 255);
|
||||
}
|
||||
var _x = this.m_oFullTransform.TransformPointX(x, y1) >> 0;
|
||||
var _xT = this.m_oFullTransform.TransformPointX(x, y2) >> 0;
|
||||
var _y1 = (this.m_oFullTransform.TransformPointY(x, y1) >> 0) + 0.5;
|
||||
var _y2 = (this.m_oFullTransform.TransformPointY(x, y2) >> 0) - 1.5;
|
||||
var ctx = this.m_oContext;
|
||||
if (_x != _xT) {
|
||||
var dKoefMMToPx = 1 / Math.max(this.m_oCoordTransform.sx, 0.001);
|
||||
this.p_width(1000 * dKoefMMToPx);
|
||||
var w_dot = 2 * dKoefMMToPx;
|
||||
var w_dist = 1 * dKoefMMToPx;
|
||||
var w_len_indent = 3;
|
||||
var _interf = editor.WordControl.m_oDrawingDocument.AutoShapesTrack;
|
||||
this._s();
|
||||
_interf.AddLineDash(ctx, x, y1, x, y2, w_dot, w_dist);
|
||||
_interf.AddLineDash(ctx, x, y1, x + w_len_indent, y1, w_dot, w_dist);
|
||||
_interf.AddLineDash(ctx, x, y2, x + w_len_indent, y2, w_dot, w_dist);
|
||||
this.ds();
|
||||
return;
|
||||
}
|
||||
var bIsInt = this.m_bIntegerGrid;
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(true);
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
var w_dot = 2;
|
||||
var w_dist = 1;
|
||||
var w_len_indent = (3 * this.m_oCoordTransform.sx) >> 0;
|
||||
this._s();
|
||||
var y_mem = _y1 - 0.5;
|
||||
while (true) {
|
||||
if ((y_mem + w_dot) > _y2) {
|
||||
break;
|
||||
}
|
||||
ctx.moveTo(_x + 0.5, y_mem);
|
||||
y_mem += w_dot;
|
||||
ctx.lineTo(_x + 0.5, y_mem);
|
||||
y_mem += w_dist;
|
||||
}
|
||||
var x_max = _x + w_len_indent;
|
||||
var x_mem = _x;
|
||||
while (true) {
|
||||
if (x_mem > x_max) {
|
||||
break;
|
||||
}
|
||||
ctx.moveTo(x_mem, _y1);
|
||||
x_mem += w_dot;
|
||||
ctx.lineTo(x_mem, _y1);
|
||||
x_mem += w_dist;
|
||||
}
|
||||
x_mem = _x;
|
||||
while (true) {
|
||||
if (x_mem > x_max) {
|
||||
break;
|
||||
}
|
||||
ctx.moveTo(x_mem, _y2);
|
||||
x_mem += w_dot;
|
||||
ctx.lineTo(x_mem, _y2);
|
||||
x_mem += w_dist;
|
||||
}
|
||||
this.ds();
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(false);
|
||||
}
|
||||
},
|
||||
DrawLockObjectRect: function (lock_type, x, y, w, h) {
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeNone) {
|
||||
return;
|
||||
}
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeMine) {
|
||||
this.p_color(22, 156, 0, 255);
|
||||
} else {
|
||||
this.p_color(238, 53, 37, 255);
|
||||
}
|
||||
var ctx = this.m_oContext;
|
||||
var _m = this.m_oTransform;
|
||||
if (_m.sx != 1 || _m.shx != 0 || _m.shy != 0 || _m.sy != 1) {
|
||||
var dKoefMMToPx = 1 / Math.max(this.m_oCoordTransform.sx, 0.001);
|
||||
this.p_width(1000 * dKoefMMToPx);
|
||||
var w_dot = 2 * dKoefMMToPx;
|
||||
var w_dist = 1 * dKoefMMToPx;
|
||||
var _interf = this.m_oAutoShapesTrack;
|
||||
var eps = 5 * dKoefMMToPx;
|
||||
var _x = x - eps;
|
||||
var _y = y - eps;
|
||||
var _r = x + w + eps;
|
||||
var _b = y + h + eps;
|
||||
this._s();
|
||||
_interf.AddRectDash(ctx, _x, _y, _r, _y, _x, _b, _r, _b, w_dot, w_dist, true);
|
||||
this._s();
|
||||
return;
|
||||
}
|
||||
var bIsInt = this.m_bIntegerGrid;
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(true);
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
var w_dot = 2;
|
||||
var w_dist = 2;
|
||||
var eps = 5;
|
||||
var _x = (this.m_oFullTransform.TransformPointX(x, y) >> 0) - eps + 0.5;
|
||||
var _y = (this.m_oFullTransform.TransformPointY(x, y) >> 0) - eps + 0.5;
|
||||
var _r = (this.m_oFullTransform.TransformPointX(x + w, y + h) >> 0) + eps + 0.5;
|
||||
var _b = (this.m_oFullTransform.TransformPointY(x + w, y + h) >> 0) + eps + 0.5;
|
||||
this._s();
|
||||
for (var i = _x; i < _r; i += w_dist) {
|
||||
ctx.moveTo(i, _y);
|
||||
i += w_dot;
|
||||
if (i > _r) {
|
||||
i = _r;
|
||||
}
|
||||
ctx.lineTo(i, _y);
|
||||
}
|
||||
for (var i = _y; i < _b; i += w_dist) {
|
||||
ctx.moveTo(_r, i);
|
||||
i += w_dot;
|
||||
if (i > _b) {
|
||||
i = _b;
|
||||
}
|
||||
ctx.lineTo(_r, i);
|
||||
}
|
||||
for (var i = _r; i > _x; i -= w_dist) {
|
||||
ctx.moveTo(i, _b);
|
||||
i -= w_dot;
|
||||
if (i < _x) {
|
||||
i = _x;
|
||||
}
|
||||
ctx.lineTo(i, _b);
|
||||
}
|
||||
for (var i = _b; i > _y; i -= w_dist) {
|
||||
ctx.moveTo(_x, i);
|
||||
i -= w_dot;
|
||||
if (i < _y) {
|
||||
i = _y;
|
||||
}
|
||||
ctx.lineTo(_x, i);
|
||||
}
|
||||
this.ds();
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(false);
|
||||
}
|
||||
},
|
||||
DrawEmptyTableLine: function (x1, y1, x2, y2) {
|
||||
if (!editor.isShowTableEmptyLine) {
|
||||
return;
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2015
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
CGraphics.prototype.DrawLockParagraph = function (lock_type, x, y1, y2) {
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeNone || editor.WordControl.m_oDrawingDocument.IsLockObjectsEnable === false || editor.isViewMode) {
|
||||
return;
|
||||
}
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeMine) {
|
||||
this.p_color(22, 156, 0, 255);
|
||||
} else {
|
||||
this.p_color(238, 53, 37, 255);
|
||||
}
|
||||
var _x = this.m_oFullTransform.TransformPointX(x, y1) >> 0;
|
||||
var _xT = this.m_oFullTransform.TransformPointX(x, y2) >> 0;
|
||||
var _y1 = (this.m_oFullTransform.TransformPointY(x, y1) >> 0) + 0.5;
|
||||
var _y2 = (this.m_oFullTransform.TransformPointY(x, y2) >> 0) - 1.5;
|
||||
var ctx = this.m_oContext;
|
||||
if (_x != _xT) {
|
||||
var dKoefMMToPx = 1 / Math.max(this.m_oCoordTransform.sx, 0.001);
|
||||
this.p_width(1000 * dKoefMMToPx);
|
||||
var w_dot = 2 * dKoefMMToPx;
|
||||
var w_dist = 1 * dKoefMMToPx;
|
||||
var w_len_indent = 3;
|
||||
var _interf = editor.WordControl.m_oDrawingDocument.AutoShapesTrack;
|
||||
this._s();
|
||||
_interf.AddLineDash(ctx, x, y1, x, y2, w_dot, w_dist);
|
||||
_interf.AddLineDash(ctx, x, y1, x + w_len_indent, y1, w_dot, w_dist);
|
||||
_interf.AddLineDash(ctx, x, y2, x + w_len_indent, y2, w_dot, w_dist);
|
||||
this.ds();
|
||||
return;
|
||||
}
|
||||
var bIsInt = this.m_bIntegerGrid;
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(true);
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
var w_dot = 2;
|
||||
var w_dist = 1;
|
||||
var w_len_indent = (3 * this.m_oCoordTransform.sx) >> 0;
|
||||
this._s();
|
||||
var y_mem = _y1 - 0.5;
|
||||
while (true) {
|
||||
if ((y_mem + w_dot) > _y2) {
|
||||
break;
|
||||
}
|
||||
ctx.moveTo(_x + 0.5, y_mem);
|
||||
y_mem += w_dot;
|
||||
ctx.lineTo(_x + 0.5, y_mem);
|
||||
y_mem += w_dist;
|
||||
}
|
||||
var x_max = _x + w_len_indent;
|
||||
var x_mem = _x;
|
||||
while (true) {
|
||||
if (x_mem > x_max) {
|
||||
break;
|
||||
}
|
||||
ctx.moveTo(x_mem, _y1);
|
||||
x_mem += w_dot;
|
||||
ctx.lineTo(x_mem, _y1);
|
||||
x_mem += w_dist;
|
||||
}
|
||||
x_mem = _x;
|
||||
while (true) {
|
||||
if (x_mem > x_max) {
|
||||
break;
|
||||
}
|
||||
ctx.moveTo(x_mem, _y2);
|
||||
x_mem += w_dot;
|
||||
ctx.lineTo(x_mem, _y2);
|
||||
x_mem += w_dist;
|
||||
}
|
||||
this.ds();
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(false);
|
||||
}
|
||||
};
|
||||
CGraphics.prototype.DrawLockObjectRect = function (lock_type, x, y, w, h) {
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeNone) {
|
||||
return;
|
||||
}
|
||||
if (lock_type == c_oAscLockTypes.kLockTypeMine) {
|
||||
this.p_color(22, 156, 0, 255);
|
||||
} else {
|
||||
this.p_color(238, 53, 37, 255);
|
||||
}
|
||||
var ctx = this.m_oContext;
|
||||
var _m = this.m_oTransform;
|
||||
if (_m.sx != 1 || _m.shx != 0 || _m.shy != 0 || _m.sy != 1) {
|
||||
var dKoefMMToPx = 1 / Math.max(this.m_oCoordTransform.sx, 0.001);
|
||||
this.p_width(1000 * dKoefMMToPx);
|
||||
var w_dot = 2 * dKoefMMToPx;
|
||||
var w_dist = 1 * dKoefMMToPx;
|
||||
var _interf = this.m_oAutoShapesTrack;
|
||||
var eps = 5 * dKoefMMToPx;
|
||||
var _x = x - eps;
|
||||
var _y = y - eps;
|
||||
var _r = x + w + eps;
|
||||
var _b = y + h + eps;
|
||||
this._s();
|
||||
_interf.AddRectDash(ctx, _x, _y, _r, _y, _x, _b, _r, _b, w_dot, w_dist, true);
|
||||
this._s();
|
||||
return;
|
||||
}
|
||||
var bIsInt = this.m_bIntegerGrid;
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(true);
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
var w_dot = 2;
|
||||
var w_dist = 2;
|
||||
var eps = 5;
|
||||
var _x = (this.m_oFullTransform.TransformPointX(x, y) >> 0) - eps + 0.5;
|
||||
var _y = (this.m_oFullTransform.TransformPointY(x, y) >> 0) - eps + 0.5;
|
||||
var _r = (this.m_oFullTransform.TransformPointX(x + w, y + h) >> 0) + eps + 0.5;
|
||||
var _b = (this.m_oFullTransform.TransformPointY(x + w, y + h) >> 0) + eps + 0.5;
|
||||
this._s();
|
||||
for (var i = _x; i < _r; i += w_dist) {
|
||||
ctx.moveTo(i, _y);
|
||||
i += w_dot;
|
||||
if (i > _r) {
|
||||
i = _r;
|
||||
}
|
||||
ctx.lineTo(i, _y);
|
||||
}
|
||||
for (var i = _y; i < _b; i += w_dist) {
|
||||
ctx.moveTo(_r, i);
|
||||
i += w_dot;
|
||||
if (i > _b) {
|
||||
i = _b;
|
||||
}
|
||||
ctx.lineTo(_r, i);
|
||||
}
|
||||
for (var i = _r; i > _x; i -= w_dist) {
|
||||
ctx.moveTo(i, _b);
|
||||
i -= w_dot;
|
||||
if (i < _x) {
|
||||
i = _x;
|
||||
}
|
||||
ctx.lineTo(i, _b);
|
||||
}
|
||||
for (var i = _b; i > _y; i -= w_dist) {
|
||||
ctx.moveTo(_x, i);
|
||||
i -= w_dot;
|
||||
if (i < _y) {
|
||||
i = _y;
|
||||
}
|
||||
ctx.lineTo(_x, i);
|
||||
}
|
||||
this.ds();
|
||||
if (!bIsInt) {
|
||||
this.SetIntegerGrid(false);
|
||||
}
|
||||
};
|
||||
@@ -977,14 +977,7 @@ CShapeDrawer.prototype = {
|
||||
if (null == this.UniFill.fill.tile) {
|
||||
if (null == this.UniFill.fill.srcRect) {
|
||||
if (this.UniFill.fill.RasterImageId && this.UniFill.fill.RasterImageId.indexOf(".svg") != 0) {
|
||||
this.Graphics.SaveGrState();
|
||||
this.Graphics.StartClipPath();
|
||||
this.Graphics.EndClipPath();
|
||||
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, undefined);
|
||||
bIsFill = false;
|
||||
var _histClip = new CHist_Clip();
|
||||
this.Graphics.GrState.Clips.push(_histClip);
|
||||
this.Graphics.RestoreGrState();
|
||||
this.Graphics.put_brushTexture(getFullImageSrc(this.UniFill.fill.RasterImageId), 0);
|
||||
} else {
|
||||
if (this.UniFill.fill.canvas) {
|
||||
this.Graphics.put_brushTexture(this.UniFill.fill.canvas.toDataURL("image/png"), 0);
|
||||
@@ -993,14 +986,8 @@ CShapeDrawer.prototype = {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.Graphics.SaveGrState();
|
||||
this.Graphics.StartClipPath();
|
||||
this.Graphics.EndClipPath();
|
||||
this.Graphics.drawImage(getFullImageSrc(this.UniFill.fill.RasterImageId), this.min_x, this.min_y, (this.max_x - this.min_x), (this.max_y - this.min_y), undefined, this.UniFill.fill.srcRect);
|
||||
bIsFill = false;
|
||||
var _histClip = new CHist_Clip();
|
||||
this.Graphics.GrState.Clips.push(_histClip);
|
||||
this.Graphics.RestoreGrState();
|
||||
}
|
||||
} else {
|
||||
if (this.UniFill.fill.canvas) {
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2015
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
"use strict";
|
||||
CCellCommentator.prototype.isLockedComment = function (oComment, callbackFunc) {
|
||||
if (false === this.worksheet.collaborativeEditing.isCoAuthoringExcellEnable()) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
return;
|
||||
}
|
||||
var objectGuid = oComment.asc_getId();
|
||||
if (objectGuid) {
|
||||
var sheetId = CCellCommentator.sStartCommentId;
|
||||
if (!oComment.bDocument) {
|
||||
sheetId += this.worksheet.model.getId();
|
||||
}
|
||||
var lockInfo = this.worksheet.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, objectGuid);
|
||||
if (false === this.worksheet.collaborativeEditing.getCollaborativeEditing()) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
callbackFunc = undefined;
|
||||
}
|
||||
if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeMine, false)) {
|
||||
Asc.applyFunction(callbackFunc, true);
|
||||
return;
|
||||
} else {
|
||||
if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, false)) {
|
||||
Asc.applyFunction(callbackFunc, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.worksheet.collaborativeEditing.onStartCheckLock();
|
||||
this.worksheet.collaborativeEditing.addCheckLock(lockInfo);
|
||||
this.worksheet.collaborativeEditing.onEndCheckLock(callbackFunc);
|
||||
}
|
||||
};
|
||||
@@ -224,6 +224,66 @@
|
||||
this.element = undefined;
|
||||
}
|
||||
},
|
||||
copyDesktopEditorButton: function (ElemToSelect, isCut) {
|
||||
if (isCut) {
|
||||
var __oncut = ElemToSelect.oncut;
|
||||
ElemToSelect.oncut = function (e) {
|
||||
ElemToSelect.oncut = __oncut;
|
||||
__oncut = null;
|
||||
var api = window["Asc"]["editor"];
|
||||
if (api.controller.isCellEditMode) {
|
||||
return;
|
||||
}
|
||||
Editor_Copy_Event_Excel(e, ElemToSelect, true, true);
|
||||
var selection = window.getSelection();
|
||||
var rangeToSelect = window.document.createRange();
|
||||
rangeToSelect.selectNodeContents(ElemToSelect);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(rangeToSelect);
|
||||
};
|
||||
ElemToSelect.focus();
|
||||
window["AscDesktopEditor"]["Cut"]();
|
||||
} else {
|
||||
var __oncopy = ElemToSelect.oncopy;
|
||||
ElemToSelect.oncopy = function (e) {
|
||||
ElemToSelect.oncopy = __oncopy;
|
||||
__oncopy = null;
|
||||
var api = window["Asc"]["editor"];
|
||||
if (api.controller.isCellEditMode) {
|
||||
return;
|
||||
}
|
||||
Editor_Copy_Event_Excel(e, ElemToSelect, null, true);
|
||||
var selection = window.getSelection();
|
||||
var rangeToSelect = window.document.createRange();
|
||||
rangeToSelect.selectNodeContents(ElemToSelect);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(rangeToSelect);
|
||||
};
|
||||
ElemToSelect.focus();
|
||||
window["AscDesktopEditor"]["Copy"]();
|
||||
}
|
||||
},
|
||||
pasteDesktopEditorButton: function (ElemToSelect) {
|
||||
var __onpaste = ElemToSelect.onpaste;
|
||||
var selection = window.getSelection();
|
||||
var rangeToSelect = window.document.createRange();
|
||||
rangeToSelect.selectNodeContents(ElemToSelect);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(rangeToSelect);
|
||||
ElemToSelect.onpaste = function (e) {
|
||||
if (!window.GlobalPasteFlag) {
|
||||
return;
|
||||
}
|
||||
ElemToSelect.oncopy = __onpaste;
|
||||
__onpaste = null;
|
||||
var api = window["Asc"]["editor"];
|
||||
var wb = api.wb;
|
||||
var ws = wb.getWorksheet();
|
||||
wb.clipboard._bodyPaste(ws, e);
|
||||
};
|
||||
ElemToSelect.focus();
|
||||
window["AscDesktopEditor"]["Paste"]();
|
||||
},
|
||||
copyRange: function (range, worksheet, isCut) {
|
||||
var t = this;
|
||||
t._cleanElement();
|
||||
@@ -292,6 +352,10 @@
|
||||
}
|
||||
}
|
||||
History.TurnOn();
|
||||
if (window["AscDesktopEditorButtonMode"] === true && window["AscDesktopEditor"]) {
|
||||
this.copyDesktopEditorButton(this.element, isCut);
|
||||
return;
|
||||
}
|
||||
if (AscBrowser.isMozilla) {
|
||||
t._selectElement(t._getStylesSelect);
|
||||
} else {
|
||||
@@ -300,6 +364,37 @@
|
||||
this._endCopyOrPaste();
|
||||
}
|
||||
},
|
||||
_getHtmlBase64: function (range, worksheet, isCut) {
|
||||
var t = this;
|
||||
t._cleanElement();
|
||||
var objectRender = worksheet.objectRender;
|
||||
var isIntoShape = objectRender.controller.getTargetDocContent();
|
||||
var text = t._makeTableNode(range, worksheet, isCut, isIntoShape);
|
||||
if (text == false) {
|
||||
return;
|
||||
}
|
||||
this._startCopyOrPaste();
|
||||
t.element.appendChild(text);
|
||||
History.TurnOff();
|
||||
if (copyPasteUseBinary) {
|
||||
if (isIntoShape) {
|
||||
this.lStorage = {};
|
||||
this.lStorage.htmlInShape = text;
|
||||
} else {
|
||||
var sBase64 = this._getBinaryForCopy(worksheet);
|
||||
if (this.element.children && this.element.children.length == 1 && (window.USER_AGENT_WEBKIT || window.USER_AGENT_SAFARI_MACOS)) {
|
||||
$(this.element.children[0]).css("font-weight", "normal");
|
||||
$(this.element.children[0]).wrap(document.createElement("b"));
|
||||
}
|
||||
if (this.element.children[0]) {
|
||||
$(this.element.children[0]).addClass("xslData;" + sBase64);
|
||||
}
|
||||
this.lStorage = sBase64;
|
||||
}
|
||||
}
|
||||
History.TurnOn();
|
||||
this._endCopyOrPaste();
|
||||
},
|
||||
_getBinaryForCopy: function (worksheet) {
|
||||
var fullUrl = this._getUseFullUrl();
|
||||
window.global_pptx_content_writer.Start_UseFullUrl(fullUrl);
|
||||
@@ -429,10 +524,14 @@
|
||||
},
|
||||
pasteRange: function (worksheet) {
|
||||
var t = this;
|
||||
if (AscBrowser.isMozilla) {
|
||||
t._editorPaste(worksheet, t._getStylesSelect);
|
||||
if (window["AscDesktopEditorButtonMode"] === true && window["AscDesktopEditor"]) {
|
||||
t.pasteDesktopEditorButton(t._editorPasteGetElem(worksheet, true));
|
||||
} else {
|
||||
t._editorPaste(worksheet);
|
||||
if (AscBrowser.isMozilla) {
|
||||
t._editorPaste(worksheet, t._getStylesSelect);
|
||||
} else {
|
||||
t._editorPaste(worksheet);
|
||||
}
|
||||
}
|
||||
},
|
||||
pasteRangeButton: function (worksheet) {
|
||||
@@ -1030,6 +1129,9 @@
|
||||
if (isNaN(oNewItem.format.fs)) {
|
||||
oNewItem.format.fs = 11;
|
||||
}
|
||||
if (oNewItem.format.fs === 0) {
|
||||
oNewItem.format.fs = 1;
|
||||
}
|
||||
oNewItem.format.b = (jqSpanObject.css("font-weight") == "bold");
|
||||
oNewItem.format.i = (jqSpanObject.css("font-style") == "italic");
|
||||
oNewItem.format.u = (jqSpanObject.css("text-decoration") == "underline") ? Asc.EUnderline.underlineSingle : Asc.EUnderline.underlineNone;
|
||||
@@ -1800,7 +1902,7 @@
|
||||
countChild = pasteFragment.children.length;
|
||||
mainChildrens = pasteFragment.children;
|
||||
}
|
||||
if (mainChildrens && mainChildrens.length == 1 && mainChildrens[0].nodeName.toLowerCase() == "b") {
|
||||
if (mainChildrens && mainChildrens.length == 1 && mainChildrens[0] != undefined && mainChildrens[0].nodeName.toLowerCase() == "b" && mainChildrens[0].children[0] != undefined) {
|
||||
mainChildrens = mainChildrens[0].children;
|
||||
}
|
||||
var onlyImages = null;
|
||||
@@ -4568,11 +4670,18 @@ function SafariIntervalFocus2() {
|
||||
}
|
||||
}
|
||||
}
|
||||
function Editor_Copy_Event_Excel(e, ElemToSelect, isCut) {
|
||||
function Editor_Copy_Event_Excel(e, ElemToSelect, isCut, isAlreadyReadyHtml) {
|
||||
var api = window["Asc"]["editor"];
|
||||
var wb = api.wb;
|
||||
var ws = wb.getWorksheet();
|
||||
var sBase64 = wb.clipboard.copyRange(ws.getSelectedRange(), ws, isCut, true);
|
||||
var sBase64;
|
||||
if (!isAlreadyReadyHtml) {
|
||||
if (window["AscDesktopEditorButtonMode"] === true && window["AscDesktopEditor"]) {
|
||||
sBase64 = wb.clipboard._getHtmlBase64(ws.getSelectedRange(), ws, isCut, true);
|
||||
} else {
|
||||
sBase64 = wb.clipboard.copyRange(ws.getSelectedRange(), ws, isCut, true);
|
||||
}
|
||||
}
|
||||
if (isCut) {
|
||||
ws.emptySelection(c_oAscCleanOptions.All);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user