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

Bug 27436 - JS Error при копировании Chart или Image с Tight-Thought Wrapping

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59509 954022d7-b5bf-4e40-9824-e11837661b57
parent 2b6006d4
......@@ -4027,78 +4027,79 @@ function DrawingObjects() {
_this.updateSizeDrawingObjects = function(target) {
ExecuteNoHistory(function(){
// ExecuteNoHistory(function(){
if(History.TurnOffHistory > 0)
return;
var i, bNeedRecalc = false, drawingObject, coords, cellTo;
if(target.target === c_oTargetType.RowResize)
{
for (i = 0; i < aObjects.length; i++) {
drawingObject = aObjects[i];
var i, bNeedRecalc = false, drawingObject, coords, cellTo;
if(target.target === c_oTargetType.RowResize)
{
for (i = 0; i < aObjects.length; i++) {
drawingObject = aObjects[i];
if(drawingObject.from.row >= target.row)
{
coords = _this.coordsManager.calculateCoords(drawingObject.from);
CheckSpPrXfrm(drawingObject.graphicObject);
if(drawingObject.from.row >= target.row)
var rot = isRealNumber(drawingObject.graphicObject.spPr.xfrm.rot) ? drawingObject.graphicObject.spPr.xfrm.rot : 0;
rot = normalizeRotate(rot);
if ((rot >= 0 && rot < Math.PI * 0.25)
|| (rot > 3 * Math.PI * 0.25 && rot < 5 * Math.PI * 0.25)
|| (rot > 7 * Math.PI * 0.25 && rot < 2 * Math.PI))
{
coords = _this.coordsManager.calculateCoords(drawingObject.from);
CheckSpPrXfrm(drawingObject.graphicObject);
var rot = isRealNumber(drawingObject.graphicObject.spPr.xfrm.rot) ? drawingObject.graphicObject.spPr.xfrm.rot : 0;
rot = normalizeRotate(rot);
if ((rot >= 0 && rot < Math.PI * 0.25)
|| (rot > 3 * Math.PI * 0.25 && rot < 5 * Math.PI * 0.25)
|| (rot > 7 * Math.PI * 0.25 && rot < 2 * Math.PI))
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x));
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y));
}
else
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x) - drawingObject.graphicObject.spPr.xfrm.extX/2 + drawingObject.graphicObject.spPr.xfrm.extY/2);
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y) - drawingObject.graphicObject.spPr.xfrm.extY/2 + drawingObject.graphicObject.spPr.xfrm.extX/2);
}
//drawingObject.graphicObject.spPr.xfrm.setOffX( pxToMm(coords.x));
//drawingObject.graphicObject.spPr.xfrm.setOffY( pxToMm(coords.y) );
drawingObject.graphicObject.checkDrawingBaseCoords();
bNeedRecalc = true;
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x));
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y));
}
else
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x) - drawingObject.graphicObject.spPr.xfrm.extX/2 + drawingObject.graphicObject.spPr.xfrm.extY/2);
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y) - drawingObject.graphicObject.spPr.xfrm.extY/2 + drawingObject.graphicObject.spPr.xfrm.extX/2);
}
//drawingObject.graphicObject.spPr.xfrm.setOffX( pxToMm(coords.x));
//drawingObject.graphicObject.spPr.xfrm.setOffY( pxToMm(coords.y) );
drawingObject.graphicObject.checkDrawingBaseCoords();
bNeedRecalc = true;
}
}
else
{
for (i = 0; i < aObjects.length; i++) {
drawingObject = aObjects[i];
if(drawingObject.from.col >= target.col)
{
coords = _this.coordsManager.calculateCoords(drawingObject.from);
CheckSpPrXfrm(drawingObject.graphicObject);
}
else
{
for (i = 0; i < aObjects.length; i++) {
drawingObject = aObjects[i];
var rot = isRealNumber(drawingObject.graphicObject.spPr.xfrm.rot) ? drawingObject.graphicObject.spPr.xfrm.rot : 0;
rot = normalizeRotate(rot);
if ((rot >= 0 && rot < Math.PI * 0.25)
|| (rot > 3 * Math.PI * 0.25 && rot < 5 * Math.PI * 0.25)
|| (rot > 7 * Math.PI * 0.25 && rot < 2 * Math.PI))
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x));
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y));
}
else
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x) - drawingObject.graphicObject.spPr.xfrm.extX/2 + drawingObject.graphicObject.spPr.xfrm.extY/2);
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y) - drawingObject.graphicObject.spPr.xfrm.extY/2 + drawingObject.graphicObject.spPr.xfrm.extX/2);
}
if(drawingObject.from.col >= target.col)
{
coords = _this.coordsManager.calculateCoords(drawingObject.from);
CheckSpPrXfrm(drawingObject.graphicObject);
//drawingObject.graphicObject.spPr.xfrm.setOffX( pxToMm(coords.x));
//drawingObject.graphicObject.spPr.xfrm.setOffY( pxToMm(coords.y) );
drawingObject.graphicObject.checkDrawingBaseCoords();
bNeedRecalc = true;
var rot = isRealNumber(drawingObject.graphicObject.spPr.xfrm.rot) ? drawingObject.graphicObject.spPr.xfrm.rot : 0;
rot = normalizeRotate(rot);
if ((rot >= 0 && rot < Math.PI * 0.25)
|| (rot > 3 * Math.PI * 0.25 && rot < 5 * Math.PI * 0.25)
|| (rot > 7 * Math.PI * 0.25 && rot < 2 * Math.PI))
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x));
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y));
}
else
{
drawingObject.graphicObject.spPr.xfrm.setOffX(pxToMm(coords.x) - drawingObject.graphicObject.spPr.xfrm.extX/2 + drawingObject.graphicObject.spPr.xfrm.extY/2);
drawingObject.graphicObject.spPr.xfrm.setOffY(pxToMm(coords.y) - drawingObject.graphicObject.spPr.xfrm.extY/2 + drawingObject.graphicObject.spPr.xfrm.extX/2);
}
//drawingObject.graphicObject.spPr.xfrm.setOffX( pxToMm(coords.x));
//drawingObject.graphicObject.spPr.xfrm.setOffY( pxToMm(coords.y) );
drawingObject.graphicObject.checkDrawingBaseCoords();
bNeedRecalc = true;
}
}
if(bNeedRecalc)
{
_this.controller.recalculate2();
_this.showDrawingObjects(true);
}
}, _this, []);
}
if(bNeedRecalc)
{
_this.controller.recalculate2();
_this.showDrawingObjects(true);
}
// }, _this, []);
};
_this.checkCursorDrawingObject = function(x, y) {
......
......@@ -1057,6 +1057,7 @@ CGraphicObjects.prototype =
selectedObjects[i].recalculate();
drawing = new ParaDrawing(0, 0, selectedObjects[i].copy(), this.document.DrawingDocument, this.document, null);
drawing.Set_DrawingType(selectedObjects[i].parent.DrawingType);
drawing.GraphicObj.setParent(drawing);
drawing.Update_Size(selectedObjects[i].bounds.w, selectedObjects[i].bounds.h);
if(selectedObjects[i].parent.DrawingType === drawing_Anchor)
{
......
......@@ -113,6 +113,10 @@ CWrapPolygon.prototype =
var cur_max_x;
var cur_min_x;
var point_count = this.calculatedPoints.length;
if(point_count === 0)
{
return {max: null, min: null};
}
for(var point_index = 1; point_index < point_count; ++point_index)
{
var point0 = this.calculatedPoints[point_index-1];
......
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