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

правка бага 20600 - [CoEdit] Ошибка в консоли при посылке автофигуры с текстом

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51643 954022d7-b5bf-4e40-9824-e11837661b57
parent b0b94bbc
......@@ -1497,6 +1497,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
t.asyncServerIdEndLoaded ();
};
this.CoAuthoringApi.onSetIndexUser = function (e) {
g_oIdCounter.Set_UserId("" + e);
};
this.CoAuthoringApi.onStartCoAuthoring = function (isStartEvent) {
t.startCollaborationEditing();
......
......@@ -472,7 +472,7 @@ CChartAsGroup.prototype =
setChart: function(chart, isCollaborative)
{
var sheetId = this.drawingObjects.getWorksheet().model.Id;
var sheetId = this.drawingObjects.getWorksheet() ? this.drawingObjects.getWorksheet().model.Id : null;
if ( !(isCollaborative === true) ) {
History.Create_NewPoint();
......@@ -2105,29 +2105,122 @@ CChartAsGroup.prototype =
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{
this.group = group;
this.setGroup(group);
this.setDrawingObjects(drawingObjects);
this.drawingObjects = drawingObjects;
if(r.GetBool())
{
this.chartTitle = new CChartTitle(this, CHART_TITLE_TYPE_TITLE);
this.addTitle(new CChartTitle(this, CHART_TITLE_TYPE_TITLE));
this.chartTitle.drawingObjects = drawingObjects;
this.chartTitle.readFromBinary(r);
}
if(r.GetBool())
{
this.vAxisTitle = new CChartTitle(this, CHART_TITLE_TYPE_V_AXIS);
this.addYAxis(new CChartTitle(this, CHART_TITLE_TYPE_V_AXIS));
this.vAxisTitle.drawingObjects = drawingObjects;
this.vAxisTitle.readFromBinary(r);
}
if(r.GetBool())
{
this.hAxisTitle = new CChartTitle(this, CHART_TITLE_TYPE_H_AXIS);
this.addXAxis(new CChartTitle(this, CHART_TITLE_TYPE_H_AXIS));
this.hAxisTitle.drawingObjects = drawingObjects;
this.hAxisTitle.readFromBinary(r);
}
this.chart = new asc_CChart();
this.setAscChart(new asc_CChart());
this.chart.Read_FromBinary2(r, false);
this.spPr.Read_FromBinary2(r);
this.setChart(this.chart, true);
//this.spPr.Read_FromBinary2(r);
//*********************
this.spPr.bwMode = r.GetBool();
r.GetBool();
this.setXfrmObject(new CXfrm());
var Reader = r;
var offX, offY, extX, extY, flipH, flipV, rot;
var flag = Reader.GetBool();
if(flag)
offX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
offY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extY = Reader.GetDouble();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipH = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipV = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
rot = Reader.GetDouble();
if(isRealNumber(offX) && isRealNumber(offY))
this.setPosition(offX, offY);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
this.setFlips(flipH, flipV);
if(isRealNumber(rot))
this.setRotate(rot);
var flag = Reader.GetBool();
if(flag)
{
var geometry = new CGeometry();
geometry.Read_FromBinary2(Reader);
geometry.Init(5, 5);
this.setGeometry(geometry);
}
flag = Reader.GetBool();
if(flag)
{
var Fill = new CUniFill();
Fill.Read_FromBinary2(Reader);
// this.setUniFill(Fill);
}
flag = Reader.GetBool();
if(flag)
{
var ln = new CLn();
ln.Read_FromBinary2(Reader);
//this.setUniLine(ln);
}
//***********************************
if(isRealNumber(x) && isRealNumber(y))
this.spPr.xfrm.setPosition(x, y);
this.init();
},
......
......@@ -231,7 +231,7 @@ CDocumentContent.prototype =
setDrawingDocument: function(drawingDocument)
{
var oldValue = isRealObject(this.DrawingDocument) && isRealObject(this.DrawingDocument.drawingObjects) ? this.DrawingDocument.drawingObjects.getWorksheet().model.getId() : null;
var newValue = isRealObject(drawingDocument) && isRealObject(drawingDocument.drawingObjects) ? drawingDocument.drawingObjects.getWorksheet().model.getId() : null;
var newValue = isRealObject(drawingDocument) && isRealObject(drawingDocument.drawingObjects) && drawingDocument.drawingObjects.getWorksheet() ? drawingDocument.drawingObjects.getWorksheet().model.getId() : null;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddDrawingDocument, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
this.DrawingDocument = drawingDocument;
......
......@@ -148,7 +148,7 @@ Paragraph.prototype =
setDrawingDocument: function(drawingDocument)
{
var oldValue = isRealObject(this.DrawingDocument) && isRealObject(this.DrawingDocument.drawingObjects) ? this.DrawingDocument.drawingObjects.getWorksheet().model.getId() : null;
var newValue = isRealObject(drawingDocument) && isRealObject(drawingDocument.drawingObjects) ? drawingDocument.drawingObjects.getWorksheet().model.getId() : null;
var newValue = isRealObject(drawingDocument) && isRealObject(drawingDocument.drawingObjects ) && drawingDocument.drawingObjects.getWorksheet() ? drawingDocument.drawingObjects.getWorksheet().model.getId() : null;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_AddDrawingDocument, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldValue, newValue)));
this.DrawingDocument = drawingDocument;
......
......@@ -445,15 +445,24 @@ function NullState(drawingObjectsController, drawingObjects)
var selected_objects = this.drawingObjectsController.selectedObjects;
if(selected_objects.length === 1 && selected_objects[0].isShape())
{
if(isRealNumber(e.charCode))
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(selected_objects[0].Get_Id());
var drawingObjects = this.drawingObjects;
var text_object = selected_objects[0];
var callback = function(bLock)
{
selected_objects[0].paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, selected_objects[0]));
this.drawingObjects.showDrawingObjects(true);
this.drawingObjectsController.updateSelectionState();
this.drawingObjects.OnUpdateOverlay();
if(bLock)
{
History.Create_NewPoint();
text_object.paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
drawingObjects.showDrawingObjects(true);
text_object.updateSelectionState(drawingObjects.drawingDocument);
}
};
}
//worksheet.collaborativeEditing.onEndCheckLock(callback);
this.drawingObjects.objectLocker.checkObjects(callback);
}
}
......
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