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

Bug 26169 - [Conversion] Ошибка при открытии документа, содержащего автофигуру "произвольная лииня"

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58521 954022d7-b5bf-4e40-9824-e11837661b57
parent 1969d577
...@@ -422,7 +422,14 @@ Path.prototype = { ...@@ -422,7 +422,14 @@ Path.prototype = {
var ch, cw; var ch, cw;
if(this.pathW!=undefined) if(this.pathW!=undefined)
{ {
cw = (gdLst["w"]/this.pathW); if(this.pathW > MOVE_DELTA)
{
cw = (gdLst["w"]/this.pathW);
}
else
{
cw = 0;
}
} }
else else
{ {
...@@ -430,7 +437,14 @@ Path.prototype = { ...@@ -430,7 +437,14 @@ Path.prototype = {
} }
if(this.pathH!=undefined) if(this.pathH!=undefined)
{ {
ch = (gdLst["h"]/this.pathH); if(this.pathH > MOVE_DELTA)
{
ch = (gdLst["h"]/this.pathH);
}
else
{
ch = 0;
}
} }
else else
{ {
......
...@@ -174,12 +174,35 @@ function PolyLine (drawingObjects, theme, master, layout, slide, pageIndex) ...@@ -174,12 +174,35 @@ function PolyLine (drawingObjects, theme, master, layout, slide, pageIndex)
shape.setStyle(CreateDefaultShapeStyle()); shape.setStyle(CreateDefaultShapeStyle());
var geometry = new Geometry(); var geometry = new Geometry();
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin);
var w = xMax - xMin, h = yMax-yMin;
var kw, kh, pathW, pathH;
if(w > 0)
{
pathW = 43200;
kw = 43200/ w
}
else
{
pathW = 0;
kw = 0;
}
if(h > 0)
{
pathH = 43200;
kh = 43200 / h;
}
else
{
pathH = 0;
kh = 0;
}
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, pathW, pathH);
geometry.AddRect("l", "t", "r", "b"); geometry.AddRect("l", "t", "r", "b");
geometry.AddPathCommand(1, (this.arrPoint[0].x - xMin) + "", (this.arrPoint[0].y - yMin) + ""); geometry.AddPathCommand(1, (((this.arrPoint[0].x - xMin) * kw) >> 0) + "", (((this.arrPoint[0].y - yMin) * kh) >> 0) + "");
for(i = 1; i< _n; ++i) for(i = 1; i< _n; ++i)
{ {
geometry.AddPathCommand(2, (this.arrPoint[i].x - xMin) + "", (this.arrPoint[i].y - yMin) + ""); geometry.AddPathCommand(2, (((this.arrPoint[i].x - xMin) * kw) >> 0) + "", (((this.arrPoint[i].y - yMin) * kh) >> 0) + "");
} }
if(bClosed) if(bClosed)
{ {
......
...@@ -271,7 +271,29 @@ function Spline(drawingObjects, theme, master, layout, slide, pageIndex) ...@@ -271,7 +271,29 @@ function Spline(drawingObjects, theme, master, layout, slide, pageIndex)
shape.setStyle(CreateDefaultShapeStyle()); shape.setStyle(CreateDefaultShapeStyle());
var geometry = new Geometry(); var geometry = new Geometry();
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin); var w = xMax - xMin, h = yMax-yMin;
var kw, kh, pathW, pathH;
if(w > 0)
{
pathW = 43200;
kw = 43200/ w
}
else
{
pathW = 0;
kw = 0;
}
if(h > 0)
{
pathH = 43200;
kh = 43200 / h;
}
else
{
pathH = 0;
kh = 0;
}
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, pathW, pathH);
geometry.AddRect("l", "t", "r", "b"); geometry.AddRect("l", "t", "r", "b");
for(i = 0; i< this.path.length; ++i) for(i = 0; i< this.path.length; ++i)
{ {
...@@ -279,17 +301,17 @@ function Spline(drawingObjects, theme, master, layout, slide, pageIndex) ...@@ -279,17 +301,17 @@ function Spline(drawingObjects, theme, master, layout, slide, pageIndex)
{ {
case 0 : case 0 :
{ {
geometry.AddPathCommand(1, (this.path[i].x - xMin) + "", (this.path[i].y - yMin) + ""); geometry.AddPathCommand(1, (((this.path[i].x - xMin) * kw) >> 0) + "", (((this.path[i].y - yMin) * kh) >> 0) + "");
break; break;
} }
case 1 : case 1 :
{ {
geometry.AddPathCommand(2, (this.path[i].x - xMin) + "", (this.path[i].y - yMin) + ""); geometry.AddPathCommand(2, (((this.path[i].x - xMin) * kw) >> 0) + "", (((this.path[i].y - yMin) * kh) >> 0) + "");
break; break;
} }
case 2: case 2:
{ {
geometry.AddPathCommand(5, (this.path[i].x1 - xMin) + "", (this.path[i].y1 - yMin) + "", (this.path[i].x2 - xMin) + "", (this.path[i].y2 - yMin) + "", (this.path[i].x3 - xMin) + "", (this.path[i].y3 - yMin) + ""); geometry.AddPathCommand(5, (((this.path[i].x1 - xMin) * kw) >> 0) + "", (((this.path[i].y1 - yMin) * kh) >> 0) + "", (((this.path[i].x2 - xMin)* kw) >> 0) + "", (((this.path[i].y2 - yMin) * kh) >> 0) + "", (((this.path[i].x3 - xMin) * kw) >> 0) + "", (((this.path[i].y3 - yMin) * kh) >> 0) + "");
break; break;
} }
} }
......
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