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

првака бага 19297 - [CoEdit] Ошибка в консоли при попытке переслать диаграмму другому пользователю

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50732 954022d7-b5bf-4e40-9824-e11837661b57
parent e186f9c9
......@@ -149,11 +149,12 @@ function CTableId()
case historyitem_type_Shape : Element = new WordShape(); break;
case historyitem_type_Image : Element = new WordImage(); break;
case historyitem_type_GroupShapes : Element = new WordGroupShapes(); break;
case historyitem_type_Chart : Element = new CChartData(true); break;
case historyitem_type_Chart : Element = new CChartAsGroup(); break;
case historyitem_type_WrapPolygon : Element = new CWrapPolygon(); break;
case historyitem_type_HdrFtrGrObjects : Element = new HeaderFooterGraphicObjects(); break;
case historyitem_type_Style : Element = new CStyle(); break;
case historyitem_type_TextBody : Element = new CTextBody(); break;
case historyitem_type_ChartTitle : Element = new CChartTitle(); break;
}
Element.Read_FromBinary2(Reader);
......
......@@ -1110,7 +1110,9 @@ CGraphicObjects.prototype =
}
var ret = new CChartAsGroup();
g_oTableId.m_bTurnOff = true;
ret.setAscChart(new asc_CChart());
g_oTableId.m_bTurnOff = false;
ret.chart.initDefault();
ret.spPr.xfrm.offX = 0;
ret.spPr.xfrm.offY = 0;
......
......@@ -52,6 +52,100 @@ CChartLayout.prototype =
this.isManual = isManual;
},
createDuplicate: function()
{
var ret = new CChartLayout();
this.isManual = false;
ret.layoutTarget = this.layoutTarget;
ret.xMode = this.xMode;
ret.yMode = this.yMode;
ret.wMode = this.wMode;
ret.hMode = this.hMode;
ret.x = this.x;
ret.y = this.y;
ret.w = this.w;
ret.h = this.h;
return ret;
},
Write_ToBinary2: function(w)
{
w.WriteBool(isRealNumber(this.layoutTarget));
if(isRealNumber(this.layoutTarget))
w.WriteLong(this.layoutTarget);
w.WriteBool(isRealNumber(this.xMode));
if(isRealNumber(this.xMode))
w.WriteLong(this.xMode);
w.WriteBool(isRealNumber(this.yMode));
if(isRealNumber(this.yMode))
w.WriteLong(this.yMode);
w.WriteBool(isRealNumber(this.wMode));
if(isRealNumber(this.wMode))
w.WriteLong(this.wMode);
w.WriteBool(isRealNumber(this.hMode));
if(isRealNumber(this.hMode))
w.WriteLong(this.hMode);
w.WriteBool(isRealNumber(this.x));
if(isRealNumber(this.x))
w.WriteLong(this.x);
w.WriteBool(isRealNumber(this.y));
if(isRealNumber(this.y))
w.WriteLong(this.y);
w.WriteBool(isRealNumber(this.w));
if(isRealNumber(this.w))
w.WriteLong(this.w);
w.WriteBool(isRealNumber(this.h));
if(isRealNumber(this.h))
w.WriteLong(this.h);
},
Read_FromBinary2: function(r)
{
if(r.GetBool())
(this.layoutTarget) = r.GetLong();
if(r.GetBool())
(this.xMode) = r.GetLong();
if(r.GetBool())
(this.yMode) = r.GetLong();
if(r.GetBool())
(this.wMode) = r.GetLong();
if(r.GetBool())
(this.hMode) = r.GetLong();
if(r.GetBool())
(this.x) = r.GetLong();
if(r.GetBool())
(this.y) = r.GetLong();
if(r.GetBool())
(this.w) = r.GetLong();
if(r.GetBool())
(this.h) = r.GetLong();
},
Undo: function(type, data)
{
switch(type)
......
......@@ -21,8 +21,8 @@ function CTextBody(shape)
this.contentHeight = 0;
this.styles = [];
//this.Id = g_oIdCounter.Get_NewId();
//g_oTableId.Add(this, this.Id);
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
if(isRealObject(shape))
{
this.setShape(shape);
......@@ -32,6 +32,21 @@ function CTextBody(shape)
}
CTextBody.prototype =
{
Get_Id: function()
{
return this.Id;
},
Write_ToBinary2: function(w)
{
w.WriteLong(historyitem_type_TextBody);
w.WriteString2(this.Id);
},
Read_FromBinary2: function(r)
{
this.Id = r.GetString2();
},
Is_TopDocument: function()
{
......@@ -548,25 +563,15 @@ CTextBody.prototype =
switch(data.Type)
{
case historyitem_SetShape:
{
w.WriteBool(typeof data.newPr === "string");
if(typeof data.newPr === "string")
{
w.WriteString2(data.newPr)
}
break;
}
case historyitem_SetDocContent:
{
w.WriteBool(typeof data.newPr === "string");
if(typeof data.newPr === "string")
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
w.WriteString2(data.newPr)
w.WriteString2(data.newPr.Get_Id())
}
break;
}
case historyitem_SetLstStyle:
{
w.WriteBool(isRealObject(data.newPr));
......@@ -593,6 +598,10 @@ CTextBody.prototype =
{
this.shape = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.shape = null;
}
break;
}
......@@ -602,6 +611,10 @@ CTextBody.prototype =
{
this.content = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.content = null;
}
break;
}
case historyitem_SetLstStyle:
......@@ -643,9 +656,40 @@ CTextBody.prototype =
readFromBinary: function(r, drawingDocument)
{
this.bodyPr.Read_FromBinary2(r);
readFromBinaryDocContent(this.content, r);
}
var bodyPr = new CBodyPr();
bodyPr.Read_FromBinary2(r);
if(isRealObject(this.parent) && this.parent.setBodyPr)
{
this.parent.setBodyPr(bodyPr);
}
var is_on = History.Is_On();
if(is_on)
{
History.TurnOff();
}
var dc= new CDocumentContent(this, editor.WordControl.m_oDrawingDocument, 0, 0, 0, 0, false, false);
readFromBinaryDocContent(dc, r);
if(is_on)
{
History.TurnOn();
}
for(var i = 0; i < dc.Content.length; ++i)
{
if(i > 0)
{
this.content.Add_NewParagraph()
}
var par = dc.Content[i];
for(var i = 0; i < par.Content.length; ++i)
{
if(par.Content[i].Copy)
this.content.Paragraph_Add(par.Content[i].Copy());
}
}
},
};
......@@ -255,6 +255,19 @@ var historyitem_CalculateAfterCopyInGroup = 33;
var historyitem_SetVerticalShapeAlign = 34;
var historyitem_SetParent = 35;
var historyitem_SetBlipFill = 36;
var historyitem_AutoShapes_AddXAxis = 37;
var historyitem_AutoShapes_AddYAxis = 38;
var historyitem_AutoShapes_AddTitle = 39;
var historyitem_AutoShapes_AddChart = 40;
var historyitem_SetShapeBodyPr = 41;
var historyitem_AutoShapes_SetChartTitleOverlay = 42;
var historyitem_SetCahrtLayout = 43;
var historyitem_AutoShapes_SetChartGroup = 44;
var historyitem_AutoShapes_SetChartTitleType = 45;
var historyitem_SetSetSpPr = 46;
var historyitem_AutoShapes_SetChartTitleTxBody = 47;
var historyitem_AutoShapes_RecalculateAfterResize = 48;
//Типы изменений в классе GraphicObjects
var historyitem_AddHdrFtrGrObjects = 0;
......@@ -359,6 +372,7 @@ var historyitem_type_ChartGroup = 28;
var historyitem_type_Style = 29;
var historyitem_type_Styles = 30;
var historyitem_type_TextBody = 31;
var historyitem_type_ChartTitle = 32;
//Типы изменений в классе CChartAsGroup
......
......@@ -5432,6 +5432,7 @@ ParaDrawing.prototype =
this.document = editor.WordControl.m_oLogicDocument;
this.graphicObjects = editor.WordControl.m_oLogicDocument.DrawingObjects;
this.mainGraphicObjects = editor.WordControl.m_oLogicDocument.DrawingObjects;
this.graphicObjects.objectsMap["_" + this.Get_Id()] = this;
g_oTableId.Add(this, this.Id);
},
......
......@@ -747,9 +747,18 @@ asc_docs_api.prototype.sync_EndCatchSelectedElements = function()
{
if ( this.SelectedObjectsStack[i].Value.ChartProperties )
{
var is_on = History.Is_On();
if(is_on)
{
History.TurnOff();
}
this.chartStyleManager.init();
this.chartPreviewManager.init();
this.asc_fireCallback("asc_onUpdateChartStyles");
if(is_on)
{
History.TurnOn();
}
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