Commit f2d88475 authored by Sergey Luzyanin's avatar Sergey Luzyanin

new collaborative changes

parent 1cb0824b
......@@ -47,7 +47,8 @@
"../common/Drawings/CommonController.js",
"../common/Drawings/States.js",
"../common/Drawings/Format/CreateGeometry.js",
"../common/Drawings/Format/CreateGeometry.js",,
"../common/Drawings/DrawingsChanges.js",
"../common/Drawings/Format/Geometry.js",
"../common/Drawings/Format/Format.js",
"../common/Drawings/Format/GraphicObjectBase.js",
......
......@@ -46,7 +46,8 @@
"../common/Drawings/CommonController.js",
"../common/Drawings/States.js",
"../common/Drawings/Format/CreateGeometry.js",
"../common/Drawings/Format/CreateGeometry.js",,
"../common/Drawings/DrawingsChanges.js",
"../common/Drawings/Format/Geometry.js",
"../common/Drawings/Format/Format.js",
"../common/Drawings/Format/GraphicObjectBase.js",
......
......@@ -49,6 +49,7 @@
"../common/Drawings/CommonController.js",
"../word/Editor/GraphicObjects/DrawingStates.js",
"../common/Drawings/DrawingsChanges.js",
"../common/Drawings/Format/CreateGeometry.js",
"../common/Drawings/Format/Geometry.js",
"../common/Drawings/Format/Format.js",
......
......@@ -121,15 +121,6 @@ CGroupShape.prototype.setDrawingObjects = function(drawingObjects)
}
};
CGroupShape.prototype.setWorksheet = function(worksheet)
{
AscCommon.History.Add(this, {Type: AscDFH.historyitem_AutoShapes_SetWorksheet, oldPr: this.worksheet, newPr: worksheet});
this.worksheet = worksheet;
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].setWorksheet(worksheet);
}
};
CGroupShape.prototype.setDrawingBase = CShape.prototype.setDrawingBase;
CGroupShape.prototype.deleteDrawingBase = CShape.prototype.deleteDrawingBase;
......
......@@ -44,18 +44,6 @@ var G_O_DEFAULT_COLOR_MAP = AscFormat.GenerateDefaultColorMap();
CShape.prototype.setDrawingObjects = function(drawingObjects)
{
};
CShape.prototype.setWorksheet = function(worksheet)
{
History.Add(this, {Type: AscDFH.historyitem_AutoShapes_SetWorksheet, oldPr: this.worksheet, newPr: worksheet});
this.worksheet = worksheet;
if(this.spTree)
{
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].setWorksheet(worksheet);
}
}
};
CShape.prototype.setDrawingBase = function(drawingBase)
{
this.drawingBase = drawingBase;
......@@ -213,13 +201,53 @@ function addToDrawings(worksheet, graphic, position, lockByDefault, anchor)
return ret;
}
function CChangesDrawingObjectsAddToDrawingObjects(Class, Pos){
this.Pos = Pos;
this.Type = AscDFH.historyitem_AutoShapes_AddToDrawingObjects;
CChangesDrawingObjectsAddToDrawingObjects.superclass.constructor.call(this, Class);
}
AscCommon.extendClass(CChangesDrawingObjectsAddToDrawingObjects, AscDFH.CChangesBase);
CChangesDrawingObjectsAddToDrawingObjects.prototype.Undo = function(){
AscFormat.deleteDrawingBase(this.Class.worksheet.Drawings, this.Class.Get_Id());
};
CChangesDrawingObjectsAddToDrawingObjects.prototype.Redo = function(){
AscFormat.addToDrawings(this.Class.worksheet, this.Class, this.Pos);
};
CChangesDrawingObjectsAddToDrawingObjects.prototype.WriteToBinary = function(Writer){
Writer.WriteLong(this.Pos);
};
CChangesDrawingObjectsAddToDrawingObjects.prototype.ReadFromBinary = function(Reader){
this.Pos = Reader.GetLong();
};
AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_AddToDrawingObjects] = CChangesDrawingObjectsAddToDrawingObjects;
function CChangesDrawingObjectsRemoveFromDrawingObjects(Class, Pos){
this.Type = AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects;
this.Pos = Pos;
CChangesDrawingObjectsRemoveFromDrawingObjects.superclass.constructor.call(this, Class);
}
AscCommon.extendClass(CChangesDrawingObjectsRemoveFromDrawingObjects, AscDFH.CChangesBase);
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Undo = function(){
AscFormat.addToDrawings(this.Class.worksheet, this.Class, this.Pos);
};
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.Redo = function(){
AscFormat.deleteDrawingBase(this.Class.worksheet.Drawings, this.Class.Get_Id());
};
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.WriteToBinary = function(Writer){
Writer.WriteLong(this.Pos);
};
CChangesDrawingObjectsRemoveFromDrawingObjects.prototype.ReadFromBinary = function(Reader){
this.Pos = Reader.GetLong();
};
AscDFH.changesFactory[AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects] = CChangesDrawingObjectsRemoveFromDrawingObjects;
CShape.prototype.addToDrawingObjects = function(pos)
{
var position = addToDrawings(this.worksheet, this, pos, /*lockByDefault*/undefined, undefined);
var data = {Type: AscDFH.historyitem_AutoShapes_AddToDrawingObjects, Pos: position};
History.Add(this, data);
this.worksheet.addContentChanges(new AscCommon.CContentChangesElement(AscCommon.contentchanges_Add, data.Pos, 1, data));
//var data = {Type: AscDFH.historyitem_AutoShapes_AddToDrawingObjects, Pos: position};
History.Add(new CChangesDrawingObjectsAddToDrawingObjects(this, position));
//this.worksheet.addContentChanges(new AscCommon.CContentChangesElement(AscCommon.contentchanges_Add, data.Pos, 1, data));
var nv_sp_pr, bNeedSet = false;
switch(this.getObjectType()){
case AscDFH.historyitem_type_Shape:{
......@@ -260,9 +288,9 @@ CShape.prototype.deleteDrawingBase = function()
var position = AscFormat.deleteDrawingBase(this.worksheet.Drawings, this.Get_Id());
if(AscFormat.isRealNumber(position))
{
var data = {Type: AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects, Pos: position};
History.Add(this, data);
this.worksheet.addContentChanges(new AscCommon.CContentChangesElement(AscCommon.contentchanges_Remove, data.Pos, 1, data));
//var data = {Type: AscDFH.historyitem_AutoShapes_RemoveFromDrawingObjects, Pos: position};
History.Add(new CChangesDrawingObjectsRemoveFromDrawingObjects(this, position));
//this.worksheet.addContentChanges(new AscCommon.CContentChangesElement(AscCommon.contentchanges_Remove, data.Pos, 1, data));
}
return position;
};
......@@ -423,10 +451,7 @@ CShape.prototype.handleUpdateGeometry = function()
CShape.prototype.convertPixToMM = function(pix)
{
var drawingObjects = getDrawingObjects_Sp(this);
var val = drawingObjects ? drawingObjects.convertMetric(pix, 0, 3) : 0;
if (AscCommon.AscBrowser.isRetina)
val *= 2;
return val;
return drawingObjects ? drawingObjects.convertMetric(pix, 0, 3) : 0;
};
CShape.prototype.getCanvasContext = function()
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -41,6 +41,20 @@ var HitInLine = AscFormat.HitInLine;
var isRealObject = AscCommon.isRealObject;
var History = AscCommon.History;
window['AscDFH'].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSpPr] = function(oClass, value){oClass.spPr = value;};
window['AscDFH'].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetGraphicObject] = function(oClass, value){oClass.graphicObject = value;};
window['AscDFH'].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetNvSpPr] = function(oClass, value){oClass.nvGraphicFramePr = value;};
window['AscDFH'].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetParent] = function(oClass, value){oClass.parent = value;};
window['AscDFH'].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetGroup] = function(oClass, value){oClass.group = value;};
window['AscDFH'].drawingsChangesMap[AscDFH.historyitem_GraphicFrameSetSetParent] = function(oClass, value){oClass.parent = value;};
AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSpPr] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetGraphicObject] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetNvSpPr] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetParent] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetGroup] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_GraphicFrameSetSetParent] = AscDFH.CChangesDrawingsObject;
function CGraphicFrame()
{
CGraphicFrame.superclass.constructor.call(this);
......@@ -169,14 +183,14 @@ CGraphicFrame.prototype.getDocContent= function()
};
CGraphicFrame.prototype.setSpPr= function(spPr)
{
History.Add(this, {Type:AscDFH.historyitem_GraphicFrameSetSpPr, oldPr: this.spPr, newPr: spPr});
{
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GraphicFrameSetSpPr, this.spPr, spPr));
this.spPr = spPr;
};
CGraphicFrame.prototype.setGraphicObject= function(graphicObject)
{
History.Add(this, {Type: AscDFH.historyitem_GraphicFrameSetGraphicObject, oldPr: this.graphicObject, newPr: graphicObject});
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GraphicFrameSetGraphicObject, this.graphicObject, graphicObject));
this.graphicObject = graphicObject;
if(this.graphicObject)
{
......@@ -186,20 +200,20 @@ CGraphicFrame.prototype.setGraphicObject= function(graphicObject)
};
CGraphicFrame.prototype.setNvSpPr= function(pr)
{
History.Add(this, {Type: AscDFH.historyitem_GraphicFrameSetSetNvSpPr, oldPr: this.nvGraphicFramePr, newPr: pr});
{
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GraphicFrameSetSetNvSpPr, this.nvGraphicFramePr, pr));
this.nvGraphicFramePr = pr;
};
CGraphicFrame.prototype.setParent= function(parent)
{
History.Add(this, {Type:AscDFH.historyitem_GraphicFrameSetSetParent, oldPr: this.parent, newPr: parent});
{
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GraphicFrameSetSetParent, this.parent, parent));
this.parent = parent;
};
CGraphicFrame.prototype.setGroup= function(group)
{
History.Add(this, {Type: AscDFH.historyitem_GraphicFrameSetSetGroup, oldPr: this.group, newPr: group});
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GraphicFrameSetSetGroup, this.group, group));
this.group = group;
};
......@@ -979,7 +993,7 @@ CGraphicFrame.prototype.setParagraphIndent = function(val)
CGraphicFrame.prototype.setParent2 = function(parent)
{
History.Add(this, {Type:AscDFH.historyitem_GraphicFrameSetSetParent, oldPr: this.parent, newPr: parent});
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_GraphicFrameSetSetParent, this.parent, parent));
this.parent = parent;
};
......@@ -1074,175 +1088,6 @@ CGraphicFrame.prototype.Refresh_RecalcData2 = function()
this.addToRecalculate();
};
CGraphicFrame.prototype.Undo = function(data)
{
switch(data.Type)
{
case AscDFH.historyitem_AutoShapes_SetLocks:
{
this.locks = data.oldPr;
break;
}
case AscDFH.historyitem_ShapeSetBDeleted:
{
this.bDeleted = data.oldPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetSpPr :
{
this.spPr = data.oldPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetGraphicObject:
{
this.graphicObject = data.oldPr;
if(this.graphicObject)
{
this.graphicObject.Index = 0;
this.graphicObject.Parent = this;
}
break;
}
case AscDFH.historyitem_GraphicFrameSetSetNvSpPr :
{
this.nvGraphicFramePr = data.oldPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetSetParent :
{
this.parent = data.oldPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetSetGroup :
{
this.group = data.oldPr;
break;
}
}
};
CGraphicFrame.prototype.Redo = function(data)
{
switch(data.Type)
{
case AscDFH.historyitem_AutoShapes_SetLocks:
{
this.locks = data.newPr;
break;
}
case AscDFH.historyitem_ShapeSetBDeleted:
{
this.bDeleted = data.newPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetSpPr :
{
this.spPr = data.newPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetGraphicObject:
{
this.graphicObject = data.newPr;
if(this.graphicObject)
{
this.graphicObject.Index = 0;
this.graphicObject.Parent = this;
}
break;
}
case AscDFH.historyitem_GraphicFrameSetSetNvSpPr :
{
this.nvGraphicFramePr = data.newPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetSetParent :
{
this.parent = data.newPr;
break;
}
case AscDFH.historyitem_GraphicFrameSetSetGroup :
{
this.group = data.newPr;
break;
}
}
};
CGraphicFrame.prototype.Save_Changes = function(data, w)
{
w.WriteLong(data.Type);
switch(data.Type)
{
case AscDFH.historyitem_AutoShapes_SetLocks:
{
w.WriteLong(data.newPr);
break;
}
case AscDFH.historyitem_GraphicFrameSetSpPr :
case AscDFH.historyitem_GraphicFrameSetGraphicObject :
case AscDFH.historyitem_GraphicFrameSetSetNvSpPr :
case AscDFH.historyitem_GraphicFrameSetSetParent :
case AscDFH.historyitem_GraphicFrameSetSetGroup :
{
AscFormat.writeObject(w, data.newPr);
break;
}
case AscDFH.historyitem_ShapeSetBDeleted:
{
AscFormat.writeBool(w, data.newPr);
break;
}
}
};
CGraphicFrame.prototype.Load_Changes = function(r)
{
var type = r.GetLong();
switch(type)
{
case AscDFH.historyitem_AutoShapes_SetLocks:
{
this.locks = r.GetLong();
break;
}
case AscDFH.historyitem_ShapeSetBDeleted:
{
this.bDeleted = AscFormat.readBool(r);
break;
}
case AscDFH.historyitem_GraphicFrameSetSpPr :
{
this.spPr = AscFormat.readObject(r);
break;
}
case AscDFH.historyitem_GraphicFrameSetGraphicObject:
{
this.graphicObject = AscFormat.readObject(r);
if(this.graphicObject)
{
this.graphicObject.Index = 0;
this.graphicObject.Parent = this;
}
break;
}
case AscDFH.historyitem_GraphicFrameSetSetNvSpPr :
{
this.nvGraphicFramePr = AscFormat.readObject(r);
break;
}
case AscDFH.historyitem_GraphicFrameSetSetParent :
{
this.parent = AscFormat.readObject(r);
break;
}
case AscDFH.historyitem_GraphicFrameSetSetGroup :
{
this.group = AscFormat.readObject(r);
break;
}
}
};
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].CGraphicFrame = CGraphicFrame;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -38,6 +38,36 @@
* @param {undefined} undefined
*/
function (window, undefined) {
function COleSize(w, h){
this.w = w;
this.h = h;
}
COleSize.prototype.Write_ToBinary = function(Writer){
Writer.WriteLong(this.w);
Writer.WriteLong(this.h);
};
COleSize.prototype.Read_FromBinary = function(Reader){
this.w = Reader.GetLong();
this.h = Reader.GetLong();
};
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetData] = AscDFH.CChangesDrawingsString;
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetApplicationId] = AscDFH.CChangesDrawingsString;
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetPixSizes] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetData] = function(oClass, value){oClass.m_sData = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetApplicationId] = function(oClass, value){oClass.m_sApplicationId = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetPixSizes] = function(oClass, value){
if(value){
oClass.m_nPixWidth = value.w;
oClass.m_nPixHeight = value.h;
}
};
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ImageShapeSetPixSizes] = COleSize;
function COleObject()
{
COleObject.superclass.constructor.call(this);
......@@ -47,8 +77,6 @@ function (window, undefined) {
this.m_nPixHeight = null;
this.m_fDefaultSizeX = null;
this.m_fDefaultSizeY = null;
this.Id = AscCommon.g_oIdCounter.Get_NewId();
AscCommon.g_oTableId.Add( this, this.Id );
}
AscCommon.extendClass(COleObject, AscFormat.CImageShape);
......@@ -58,17 +86,17 @@ function (window, undefined) {
};
COleObject.prototype.setData = function(sData)
{
AscCommon.History.Add(this, {Type:AscDFH.historyitem_ImageShapeSetData, oldData: this.m_sData, newData: sData});
AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this, AscDFH.historyitem_ImageShapeSetData, this.m_sData, sData));
this.m_sData = sData;
};
COleObject.prototype.setApplicationId = function(sApplicationId)
{
AscCommon.History.Add(this, {Type:AscDFH.historyitem_ImageShapeSetApplicationId, oldId: this.m_sApplicationId, newId: sApplicationId});
AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this, AscDFH.historyitem_ImageShapeSetApplicationId, this.m_sApplicationId, sApplicationId));
this.m_sApplicationId = sApplicationId;
};
COleObject.prototype.setPixSizes = function(nPixWidth, nPixHeight)
{
AscCommon.History.Add(this, {Type: AscDFH.historyitem_ImageShapeSetPixSizes, oldPr: {w: this.m_nPixWidth, h: this.m_nPixHeight}, newPr: {w: nPixWidth, h: nPixHeight}});
AscCommon.History.Add(new AscDFH.CChangesDrawingsObjectNoId(this, AscDFH.historyitem_ImageShapeSetPixSizes, new COleSize(this.m_nPixWidth, this.m_nPixHeight), new COleSize(nPixWidth, nPixHeight)));
this.m_nPixWidth = nPixWidth;
this.m_nPixHeight = nPixHeight;
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -76,6 +76,22 @@ field_months[0][11] = "декабря";
//-----------------------------
AscDFH.changesFactory[AscDFH.historyitem_TextBodySetParent] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_TextBodySetBodyPr] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_TextBodySetContent] = AscDFH.CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_TextBodySetLstStyle] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetParent] = function(oClass, value){oClass.parent = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetBodyPr] = function(oClass, value){oClass.bodyPr = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetContent] = function(oClass, value){oClass.content = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_TextBodySetLstStyle] = function(oClass, value){oClass.lstStyle = value;};
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_TextBodySetBodyPr] = AscFormat.CBodyPr;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_TextBodySetLstStyle] = AscFormat.TextListStyle;
function CTextBody()
{
this.bodyPr = null;
......@@ -91,8 +107,6 @@ function CTextBody()
recalculateBodyPr: true,
recalculateContent2: true
};
this.textPropsForRecalc = [];
this.bRecalculateNumbering = true;
this.Id = AscCommon.g_oIdCounter.Get_NewId();
AscCommon.g_oTableId.Add(this, this.Id);
}
......@@ -163,13 +177,13 @@ CTextBody.prototype =
setParent: function(pr)
{
History.Add(this, {Type: AscDFH.historyitem_TextBodySetParent, oldPr: this.parent, newPr: pr});
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_TextBodySetParent, this.parent, pr));
this.parent = pr;
},
setBodyPr: function(pr)
{
History.Add(this, {Type: AscDFH.historyitem_TextBodySetBodyPr, oldPr: this.bodyPr, newPr: pr});
History.Add(new AscDFH.CChangesDrawingsObjectNoId(this, AscDFH.historyitem_TextBodySetBodyPr, this.bodyPr, pr));
this.bodyPr = pr;
if(this.parent && this.parent.recalcInfo)
{
......@@ -192,13 +206,13 @@ CTextBody.prototype =
setContent: function(pr)
{
History.Add(this, {Type: AscDFH.historyitem_TextBodySetContent, oldPr: this.content, newPr: pr});
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_TextBodySetContent, this.content, pr));
this.content = pr;
},
setLstStyle: function(lstStyle)
{
History.Add(this, {Type:AscDFH.historyitem_TextBodySetLstStyle, oldPr: this.lstStyle, newPr: lstStyle});
History.Add(new AscDFH.CChangesDrawingsObjectNoId(this, AscDFH.historyitem_TextBodySetLstStyle, this.lstStyle, lstStyle));
this.lstStyle = lstStyle;
},
......@@ -207,151 +221,6 @@ CTextBody.prototype =
return AscDFH.historyitem_type_TextBody;
},
Undo: function(data)
{
switch(data.Type)
{
case AscDFH.historyitem_TextBodySetParent:
{
this.parent = data.oldPr;
break;
}
case AscDFH.historyitem_TextBodySetBodyPr:
{
this.bodyPr = data.oldPr;
if(this.parent && this.parent.parent && this.parent.parent.parent && this.parent.parent.parent.parent && this.parent.parent.parent.parent.parent && this.parent.parent.parent.parent.parent.handleUpdateInternalChart)
{
this.parent.parent.parent.parent.parent.handleUpdateInternalChart();
}
break;
}
case AscDFH.historyitem_TextBodySetContent:
{
this.content = data.oldPr;
break;
}
case AscDFH.historyitem_TextBodySetLstStyle:
{
this.lstStyle = data.oldPr;
break;
}
}
},
Redo: function(data)
{
switch(data.Type)
{
case AscDFH.historyitem_TextBodySetParent:
{
this.parent = data.newPr;
break;
}
case AscDFH.historyitem_TextBodySetBodyPr:
{
this.bodyPr = data.newPr;
if(this.parent && this.parent.parent && this.parent.parent.parent && this.parent.parent.parent.parent && this.parent.parent.parent.parent.parent && this.parent.parent.parent.parent.parent.handleUpdateInternalChart)
{
this.parent.parent.parent.parent.parent.handleUpdateInternalChart();
}
break;
}
case AscDFH.historyitem_TextBodySetContent:
{
this.content = data.newPr;
break;
}
case AscDFH.historyitem_TextBodySetLstStyle:
{
this.lstStyle = data.newPr;
break;
}
}
},
Save_Changes: function(data, w)
{
w.WriteLong(AscDFH.historyitem_type_TextBody);
w.WriteLong(data.Type);
switch(data.Type)
{
case AscDFH.historyitem_TextBodySetParent:
case AscDFH.historyitem_TextBodySetContent:
{
AscFormat.writeObject(w, data.newPr);
break;
}
case AscDFH.historyitem_TextBodySetBodyPr:
case AscDFH.historyitem_TextBodySetLstStyle:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary(w);
}
break;
}
}
},
Load_Changes: function(r)
{
if(r.GetLong() === AscDFH.historyitem_type_TextBody)
{
var type = r.GetLong();
switch(type)
{
case AscDFH.historyitem_TextBodySetParent:
{
this.parent = AscFormat.readObject(r);
break;
}
case AscDFH.historyitem_TextBodySetBodyPr:
{
if(r.GetBool())
{
this.bodyPr = new AscFormat.CBodyPr();
this.bodyPr.Read_FromBinary(r);
}
else
{
this.bodyPr = null;
}
if(this.parent && this.parent.parent && this.parent.parent.parent && this.parent.parent.parent.parent && this.parent.parent.parent.parent.parent && this.parent.parent.parent.parent.parent.handleUpdateInternalChart)
{
this.parent.parent.parent.parent.parent.handleUpdateInternalChart();
}
break;
}
case AscDFH.historyitem_TextBodySetContent:
{
this.content = AscFormat.readObject(r);
break;
}
case AscDFH.historyitem_TextBodySetLstStyle:
{
if(r.GetBool())
{
this.lstStyle = new AscFormat.TextListStyle();
this.lstStyle.Read_FromBinary(r);
}
else
{
this.lstStyle = null;
}
break;
}
}
}
},
Write_ToBinary2: function(w)
{
w.WriteLong(AscDFH.historyitem_type_TextBody);
......
......@@ -826,7 +826,7 @@ function Chart3dAdjustTrack(oChartSpace, numHandle, startX, startY)
deltaAng = 90*(ty - this.startY)/(this.chartSizes.h/2);
this.view3D.rotX = StratRotX + deltaAng;
if(oChartSpace.chart.plotArea && oChartSpace.chart.plotArea.chart && oChartSpace.chart.plotArea.chart.getObjectType() === AscDFH.historyitem_type_PieChart){
if(oChartSpace.chart.plotArea && oChartSpace.chart.plotArea.charts[0] && oChartSpace.chart.plotArea.charts[0].getObjectType() === AscDFH.historyitem_type_PieChart){
if(this.view3D.rotX < 0){
this.view3D.rotX = 0;
}
......
This diff is collapsed.
......@@ -1884,9 +1884,9 @@ BinaryChartWriter.prototype.WriteCT_StrData = function (oVal) {
oThis.WriteCT_UnsignedInt(oVal.ptCount);
});
}
if (null != oVal.pt) {
for (var i = 0, length = oVal.pt.length; i < length; ++i) {
var oCurVal = oVal.pt[i];
if (null != oVal.pts) {
for (var i = 0, length = oVal.pts.length; i < length; ++i) {
var oCurVal = oVal.pts[i];
if (null != oCurVal) {
this.bs.WriteItem(c_oserct_strdataPT, function () {
oThis.WriteCT_StrVal(oCurVal);
......
......@@ -3383,13 +3383,13 @@ function BinaryPPTYLoader()
break;
if (0 == _at)
hf.dt = s.GetBool();
hf.setDt(s.GetBool());
else if (1 == _at)
hf.ftr = s.GetBool();
hf.setFtr(s.GetBool());
else if (2 == _at)
hf.hdr = s.GetBool();
hf.setHdr(s.GetBool());
else if (3 == _at)
hf.sldNum = s.GetBool();
hf.setSldNum(s.GetBool());
}
s.Seek2(_e);
......
This diff is collapsed.
......@@ -119,15 +119,7 @@ CGroupShape.prototype.setDrawingObjects = function(drawingObjects)
}
};
CGroupShape.prototype.setWorksheet = function(worksheet)
{
AscCommon.History.Add(this, {Type: AscDFH.historyitem_AutoShapes_SetWorksheet, oldPr: this.worksheet, newPr: worksheet});
this.worksheet = worksheet;
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].setWorksheet(worksheet);
}
};
CGroupShape.prototype.setDrawingBase = CShape.prototype.setDrawingBase;
CGroupShape.prototype.deleteDrawingBase = CShape.prototype.deleteDrawingBase;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -398,7 +398,7 @@
if(this.Presentation){
var width = nWidth/36000.0;
var height = nHeight/36000.0;
History.Add(this.Presentation, {Type: AscDFH.historyitem_Presentation_SlideSize, oldW: this.Presentation.Width, newW: width, oldH: this.Presentation.Height, newH: height});
History.Add(new AscDFH.CChangesDrawingsObjectNoId(this.Presentation, AscDFH.historyitem_Presentation_SlideSize, new AscFormat.CDrawingBaseCoordsWritable(this.Presentation.Width, this.Presentation.Height), new AscFromat.CDrawingBaseCoordsWritable(width, height)));
this.Presentation.Width = width;
this.Presentation.Height = height;
this.Presentation.changeSlideSizeFunction(this.Presentation.Width, this.Presentation.Height);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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