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

Bug 28453 - Wrapping Style фигуры tight и through сбрасывается на square после сборки версии

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61135 954022d7-b5bf-4e40-9824-e11837661b57
parent 0415127c
......@@ -351,22 +351,9 @@ CShape.prototype.recalculateText = function()
CShape.prototype.recalculateWrapPolygon = function()
{
if(this.parent)
if(this.parent && this.parent.wrappingPolygon)
{
var wrapping_polygon = this.parent.wrappingPolygon;
if(!wrapping_polygon.edited)
{
if(this.spTree)
{
for(var i = 0; i < this.spTree.length; ++i)
this.spTree[i].recalculate();
}
wrapping_polygon.calculate(this);
}
else
{
wrapping_polygon.calculateRelToAbs(this.localTransform, this);
}
this.parent.wrappingPolygon.calculateRelToAbs(this.localTransform, this);
}
};
......
......@@ -414,7 +414,6 @@ CGraphicObjects.prototype =
{
if(false === this.document.Document_Is_SelectionLocked(changestype_Drawing_Props))
{
History.Create_NewPoint();
if(this.selection.groupSelection)
{
......@@ -434,6 +433,7 @@ CGraphicObjects.prototype =
}
}
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
},
......@@ -576,9 +576,10 @@ CGraphicObjects.prototype =
{
History.Create_NewPoint();
this.applyZIndex(oCheckObject);
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
}
this.document.Recalculate();
},
sendToBack : function()
......@@ -609,9 +610,10 @@ CGraphicObjects.prototype =
{
History.Create_NewPoint();
this.applyZIndex(oCheckObject);
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
}
this.document.Recalculate();
},
bringBackward : function()
......@@ -663,9 +665,10 @@ CGraphicObjects.prototype =
{
History.Create_NewPoint();
this.applyZIndex(oCheckObject);
this.document.Recalculate();
this.document.Document_UpdateUndoRedoState();
}
}
this.document.Recalculate();
},
editChart: function(chart)
......
......@@ -414,7 +414,6 @@ CWrapPolygon.prototype =
var transform = new CMatrix();
var arrEdges = [];
var arrPoints = [];
var polygonsCount = arrPolygons.length;
for(var polygon_index=0; polygon_index < polygonsCount; ++polygon_index)
{
......@@ -449,9 +448,7 @@ CWrapPolygon.prototype =
}
if(arrPoints.length < 2)
{
this.arrPoints.length = 0;
this.relativeArrPoints.length = 0;
return;
return [];
}
arrEdges.sort(function(a, b){return Math.min(a.point1.y, a.point2.y) - Math.min(b.point1.y, b.point2.y)});
arrPoints.sort(function(a, b){return a.y - b.y});
......@@ -593,41 +590,17 @@ CWrapPolygon.prototype =
}
}
this.arrPoints = [];
this.arrPoints.push(left_path_arr[0]);
var aPoints = [];
aPoints.push(left_path_arr[0]);
for(point_index = 0; point_index < right_path_arr.length; ++point_index)
{
this.arrPoints.push(right_path_arr[point_index]);
aPoints.push(right_path_arr[point_index]);
}
for(point_index = left_path_arr.length - 1; point_index > 0; --point_index)
{
this.arrPoints.push(left_path_arr[point_index]);
aPoints.push(left_path_arr[point_index]);
}
var bounds = drawing.parent.getBounds(), oDistance = drawing.parent.Get_Distance();
if(bounds.l < x_min)
this.localLeft = bounds.l - oDistance.L;
else
this.localLeft = x_min - oDistance.L;
if(bounds.r > x_max)
this.localRight = bounds.r + oDistance.R;
else
this.localRight = x_max + oDistance.R;
if(!isRealObject(left_path_arr[0]) || !(typeof left_path_arr[0].y === "number"))
this.localTop = bounds.t - oDistance.T;
else
this.localTop = left_path_arr[0].y - oDistance.T;
if(!isRealObject(left_path_arr[left_path_arr.length - 1]) || !(typeof left_path_arr[left_path_arr.length - 1].y === "number"))
this.localBottom = bounds.b + oDistance.B;
else
this.localBottom = left_path_arr[left_path_arr.length - 1].y + oDistance.B;
this.calculateAbsToRel(drawing.localTransform, drawing);
this.rect_flag = this.isRect();
return this.calculateAbsToRel(drawing, aPoints);
},
calculateRelToAbs: function(transform, drawing)
......@@ -696,35 +669,32 @@ CWrapPolygon.prototype =
this.rect_flag = this.isRect();
},
calculateAbsToRel: function(transform, drawing)
calculateAbsToRel: function(drawing, aPoints)
{
if(this.arrPoints.length === 0)
var relArr = [];
if(aPoints.length === 0)
{
this.relativeArrPoints.length = 0;
return;
return relArr;
}
var transform = drawing.localTransform;
var invert_transform = global_MatrixTransformer.Invert(transform);
var relArr = this.relativeArrPoints;
var absArr = this.arrPoints;
relArr.length = 0;
for(var point_index = 0; point_index < absArr.length; ++point_index)
for(var point_index = 0; point_index < aPoints.length; ++point_index)
{
var abs_point = absArr[point_index];
var abs_point = aPoints[point_index];
var tr_x = invert_transform.TransformPointX(abs_point.x, abs_point.y)*(21600/drawing.extX)>>0;
var tr_y = invert_transform.TransformPointY(abs_point.x, abs_point.y)*(21600/drawing.extY)>>0;
relArr[point_index] = {x: tr_x, y:tr_y};
}
var min_x, max_x, min_y, max_y;
min_x = absArr[0].x;
min_x = aPoints[0].x;
max_x = min_x;
min_y = absArr[0].y;
min_y = aPoints[0].y;
max_y = min_y;
for(point_index = 0; point_index < absArr.length; ++point_index)
for(point_index = 0; point_index < aPoints.length; ++point_index)
{
var absPoint = absArr[point_index];
var absPoint = aPoints[point_index];
if(min_x > absPoint.x)
min_x = absPoint.x;
if(max_x < absPoint.x)
......@@ -735,30 +705,7 @@ CWrapPolygon.prototype =
if(max_y < absPoint.y)
max_y = absPoint.y;
}
var bounds = drawing.parent.getBounds(), oDistance = drawing.parent.Get_Distance();
if(bounds.l < min_x)
this.left = bounds.l - oDistance.L;
else
this.left = min_x - oDistance.L;
if(bounds.r > max_x)
this.right = bounds.r + oDistance.R;
else
this.right = max_x + oDistance.R;
if(bounds.t < min_y)
this.top = bounds.t - oDistance.T;
else
this.top = min_y - oDistance.T;
if(bounds.b > max_y)
this.bottom = bounds.b + oDistance.B;
else
this.bottom = max_y + oDistance.B;
this.rect_flag = this.isRect();
return relArr;
},
updatePosition: function(x, y)
......
......@@ -4162,6 +4162,7 @@ ParaDrawing.prototype =
Set_Props : function(Props)
{
var bCheckWrapPolygon = false;
if ( undefined != Props.WrappingStyle )
{
if ( drawing_Inline === this.DrawingType && c_oAscWrapStyle2.Inline != Props.WrappingStyle && undefined === Props.Paddings )
......@@ -4187,8 +4188,18 @@ ParaDrawing.prototype =
switch ( Props.WrappingStyle )
{
case c_oAscWrapStyle2.Square : this.Set_WrappingType(WRAPPING_TYPE_SQUARE); break;
case c_oAscWrapStyle2.Tight : this.Set_WrappingType(WRAPPING_TYPE_TIGHT); break;
case c_oAscWrapStyle2.Through : this.Set_WrappingType(WRAPPING_TYPE_THROUGH); break;
case c_oAscWrapStyle2.Tight :
{
bCheckWrapPolygon = true;
this.Set_WrappingType(WRAPPING_TYPE_TIGHT);
break;
}
case c_oAscWrapStyle2.Through :
{
this.Set_WrappingType(WRAPPING_TYPE_THROUGH);
bCheckWrapPolygon = true;
break;
}
case c_oAscWrapStyle2.TopAndBottom: this.Set_WrappingType(WRAPPING_TYPE_TOP_AND_BOTTOM); break;
default : this.Set_WrappingType(WRAPPING_TYPE_SQUARE); break;
}
......@@ -4232,6 +4243,10 @@ ParaDrawing.prototype =
{
this.setExtent(newW, newH);
}
if(bCheckWrapPolygon)
{
this.Check_WrapPolygon();
}
},
CheckWH: function()
......@@ -4260,6 +4275,17 @@ ParaDrawing.prototype =
dH = this.GraphicObj.spPr.xfrm.extY;
}
this.setExtent(dW, dH);
this.Check_WrapPolygon();
},
Check_WrapPolygon: function()
{
if((this.wrappingType === WRAPPING_TYPE_TIGHT || this.wrappingType === WRAPPING_TYPE_THROUGH) && this.wrappingPolygon && !this.wrappingPolygon.edited)
{
this.GraphicObj.recalculate();
this.wrappingPolygon.setArrRelPoints(this.wrappingPolygon.calculate(this.GraphicObj));
}
},
Draw : function( X, Y, pGraphics, pageIndex, align)
......@@ -6304,17 +6330,6 @@ ParaDrawing.prototype =
return this.GraphicObj.addComment(commentData);
},
recalculateWrapPolygon: function()
{
if(this.wrappingPolygon)
{
if(this.wrappingPolygon.edited)
this.wrappingPolygon.calculateRelToAbs(this.getTransformMatrix()) ;
else
this.wrappingPolygon.calculate();
}
},
selectionSetStart: function(x, y, event, pageIndex)
{
if(isRealObject(this.GraphicObj) && typeof this.GraphicObj.selectionSetStart === "function")
......
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