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

правка бага 21090 - [CoEdit] Не вставляется копия автофигуры добавленная другим пользователем

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51079 954022d7-b5bf-4e40-9824-e11837661b57
parent e50289ea
......@@ -502,6 +502,16 @@ CGeometry.prototype=
Write_ToBinary2: function(Writer)
{
var w = Writer;
var count = 0;
for(var key in this.avLst)
{
++count;
}
w.WriteLong(count);
for(key in this.avLst)
{
w.WriteString2(key);
}
var gd_lst_info_count = this.gdLstInfo.length;
Writer.WriteLong(gd_lst_info_count);
......@@ -530,16 +540,7 @@ CGeometry.prototype=
}
WriteObjectLong(w, this.gdLst);
var count = 0;
for(var key in this.avLst)
{
++count;
}
w.WriteLong(count);
for(key in this.avLst)
{
w.WriteString2(key);
}
var cnx_lst_count = this.cnxLstInfo.length;
......@@ -762,6 +763,11 @@ CGeometry.prototype=
Read_FromBinary2: function(Reader)
{
var r = Reader;
var count = r.GetLong();
for(index = 0; index < count; ++index)
{
this.avLst[r.GetString2()] = true;
}
var gd_lst_info_count = Reader.GetLong();
for(var index = 0; index < gd_lst_info_count; ++index)
{
......@@ -777,18 +783,19 @@ CGeometry.prototype=
if(r.GetBool())
gd_info.z = r.GetString2();
this.gdLstInfo.push(gd_info);
if(this.avLst[gd_info.name])
{
this.AddAdj(gd_info.name, gd_info.formula, gd_info.x, gd_info.y, gd_info.z)
}
else
{
this.AddGuide(gd_info.name, gd_info.formula, gd_info.x, gd_info.y, gd_info.z)
}
}
this.gdLst = ReadObjectLong(r);
var count = r.GetLong();
for(index = 0; index < count; ++index)
{
this.avLst[r.GetString2()] = true;
}
var cnx_lst_count = Reader.GetLong();
for(index = 0; index < cnx_lst_count; ++index)
{
......@@ -823,7 +830,7 @@ CGeometry.prototype=
if(r.GetBool())
o.posY = r.GetString2();
this.ahXYLstInfo.push(o);
this.AddHandleXY(o.gdRefX, o.minX, o.maxX, o.gdRefY, o.minY, o.maxY, o.posX, o.posY);
}
for(index = 0; index < ah_xy_count; ++index)
......@@ -884,7 +891,8 @@ CGeometry.prototype=
if(r.GetBool())
o.posY = r.GetString2();
this.ahPolarLstInfo.push(o);
this.AddHandlePolar(o.gdRefAng, o.minAng, o.maxAng, o.gdRefR, o.minR, o.maxR, o.posX, o.posY);
}
for(index = 0; index < ah_polar_count; ++index)
......@@ -920,14 +928,16 @@ CGeometry.prototype=
var path_count = Reader.GetLong();
for(index = 0; index < path_count; ++index)
{
this.pathLst[index] = new Path();
this.pathLst[index].Read_FromBinary2(Reader);
var new_path = new Path();
new_path.Read_FromBinary2(Reader);
this.AddPath(new_path);
}
if(r.GetBool())
{
this.preset = r.GetString2();
}
this.rectS = ReadObjectString(r);
var rectS = ReadObjectString(r);
this.AddRect(rectS.l, rectS.t, rectS.r, rectS.b);
this.rect = ReadObjectDouble(r);
},
......
......@@ -148,9 +148,9 @@ Path.prototype = {
Read_FromBinary2: function(Reader)
{
this.stroke = Reader.GetBool();
this.setStroke( Reader.GetBool());
this.extrusionOk = Reader.GetBool();
this.fill = Reader.GetString2();
this.setFill(Reader.GetString2());
var flag = Reader.GetBool();
if(flag)
......@@ -160,6 +160,10 @@ Path.prototype = {
if(flag)
this.pathH = Reader.GetLong();
if(isRealNumber(this.pathH && this.pathW))
{
this.setWH(this.pathW, this.pathH);
}
flag = Reader.GetBool();
if(flag)
this.divPW = Reader.GetDouble();
......@@ -189,7 +193,19 @@ Path.prototype = {
{
c.X = read_function.call(Reader);
c.Y = read_function.call(Reader);
for(var key in c)
{
if(!isNaN(parseInt(c[key], 10)))
c[key] = parseInt(c[key], 10);
}
if(id === moveTo)
{
this.moveTo(c.X, c.Y);
}
else
{
this.lnTo(c.X, c.Y);
}
break;
}
case bezier3:
......@@ -198,6 +214,12 @@ Path.prototype = {
c.Y0 = read_function.call(Reader);
c.X1 = read_function.call(Reader);
c.Y1 = read_function.call(Reader);
for(var key in c)
{
if(!isNaN(parseInt(c[key], 10)))
c[key] = parseInt(c[key], 10);
}
this.quadBezTo(c.X0, c.Y0, c.X1, c.Y1);
break;
}
case bezier4:
......@@ -208,6 +230,12 @@ Path.prototype = {
c.Y1 = read_function.call(Reader);
c.X2 = read_function.call(Reader);
c.Y2 = read_function.call(Reader);
for(var key in c)
{
if(!isNaN(parseInt(c[key], 10)))
c[key] = parseInt(c[key], 10);
}
this.cubicBezTo(c.X0, c.Y0, c.X1, c.Y1, c.X2, c.Y2);
break;
}
case arcTo:
......@@ -216,20 +244,22 @@ Path.prototype = {
c.wR = read_function.call(Reader);
c.stAng = read_function.call(Reader);
c.swAng = read_function.call(Reader);
for(var key in c)
{
if(!isNaN(parseInt(c[key], 10)))
c[key] = parseInt(c[key], 10);
}
this.arcTo(c.wR, c.hR, c.stAng, c.swAng);
break;
}
case close:
{
this.close();
break;
}
}
for(var key in c)
{
if(!isNaN(parseInt(c[key], 10)))
c[key] = parseInt(c[key], 10);
}
this.ArrPathCommandInfo.push(c);
//this.ArrPathCommandInfo.push(c);
}
for(index = 0; index < path_command_count; ++index)
{
......
......@@ -140,7 +140,8 @@ function CShape(drawingBase, drawingObjects, legendEntry)
{
recalculateTransform: true,
recalculateBrush: true,
recalculatePen: true
recalculatePen: true,
recalculateGeometry: true
};
this.x = null;
......@@ -1124,6 +1125,15 @@ CShape.prototype =
this.spPr.geometry.Init(5, 5);
},
setGeometry: function(geometry)
{
var oldId = this.spPr.geometry ? this.spPr.geometry.Get_Id() : null;
this.spPr.geometry = geometry;
var newId = this.spPr.geometry.Get_Id();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetPresetGeometry, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldId, newId)));
},
setRecalculateAll: function()
{
this.recalcInfo =
......@@ -2858,6 +2868,7 @@ CShape.prototype =
case historyitem_AutoShapes_SetPresetGeometry:
{
this.spPr.geometry = g_oTableId.Get_ById(data.newValue);
this.spPr.geometry.Init(5, 5);
break;
}
case historyitem_AutoShapes_RecalculateTransformRedo:
......@@ -3087,7 +3098,8 @@ CShape.prototype =
{
var geometry = new CGeometry();
geometry.Read_FromBinary2(Reader);
this.setPresetGeometry(geometry.preset);
geometry.Init(5, 5);
this.setGeometry(geometry);
}
flag = Reader.GetBool();
......
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