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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49803 954022d7-b5bf-4e40-9824-e11837661b57
parent 43b14ed8
...@@ -1984,7 +1984,7 @@ function CDrawingDocument() ...@@ -1984,7 +1984,7 @@ function CDrawingDocument()
} }
this.SelectClear = function() this.SelectClear = function()
{ {
for (var i = 0; i < this.SlidesCount; i++) for (var i = 0; i < this.m_oLogicDocument.Slides.length; i++)
{ {
this.m_oLogicDocument.Slides[i].selectionArray.splice(0, this.m_oLogicDocument.Slides[i].selectionArray.length); this.m_oLogicDocument.Slides[i].selectionArray.splice(0, this.m_oLogicDocument.Slides[i].selectionArray.length);
} }
......
...@@ -47,9 +47,6 @@ function Path(extrusionOk, fill, stroke, w, h) ...@@ -47,9 +47,6 @@ function Path(extrusionOk, fill, stroke, w, h)
} */ } */
return duplicate; return duplicate;
}; };
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
} }
Path.prototype = { Path.prototype = {
......
This diff is collapsed.
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
var CLASS_TYPE_CHART_DATA = 9999; var CLASS_TYPE_CHART_DATA = 9999;
function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument, group) function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument, group)
{ {
this.parent = parent;
this.document = document; this.document = document;
this.group = isRealObject(group) ? group : null; this.group = isRealObject(group) ? group : null;
...@@ -50,6 +49,10 @@ function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument, ...@@ -50,6 +49,10 @@ function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument,
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
this.bFirstRecalc = true; this.bFirstRecalc = true;
if(isRealObject(parent))
{
this.setParent(parent);
}
} }
...@@ -272,14 +275,6 @@ CChartAsGroup.prototype = ...@@ -272,14 +275,6 @@ CChartAsGroup.prototype =
return false; return false;
}, },
setGroup: function(group)
{
var oldId = isRealObject(this.group) ? this.group.Get_Id() : null;
var newId = isRealObject(group) ? group.Get_Id() : null;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_SetGroup, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(oldId, newId)));
this.group = group;
},
hitInInnerArea: function(x, y) hitInInnerArea: function(x, y)
...@@ -2119,31 +2114,22 @@ CChartAsGroup.prototype = ...@@ -2119,31 +2114,22 @@ CChartAsGroup.prototype =
}, },
setParent: function(paraDrawing) setParent: function(parent)
{ {
var data = {Type: historyitem_SetParent}; History.Add(this, {Type:historyitem_SetShapeParent, Old: this.parent, New: parent});
if(isRealObject(this.parent)) this.parent = parent;
{ },
data.oldParent = this.parent.Get_Id();
}
else
{
data.oldParent = null;
}
if(isRealObject(paraDrawing))
{
data.newParent = paraDrawing.Get_Id(); setGroup: function(group)
} {
else History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group});
{ this.group = group;
data.newParent = null;
}
History.Add(this, data);
this.parent = paraDrawing;
}, },
Undo: function(data) Undo: function(data)
{ {
switch(data.Type) switch(data.Type)
...@@ -2237,6 +2223,16 @@ CChartAsGroup.prototype = ...@@ -2237,6 +2223,16 @@ CChartAsGroup.prototype =
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetSpGroup:
{
this.group = data.oldPr;
break;
}
case historyitem_SetShapeParent:
{
this.parent = data.Old;
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}, },
...@@ -2330,6 +2326,16 @@ CChartAsGroup.prototype = ...@@ -2330,6 +2326,16 @@ CChartAsGroup.prototype =
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetSpGroup:
{
this.group = data.newPr;
break;
}
case historyitem_SetShapeParent:
{
this.parent = data.New;
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}, },
...@@ -2399,6 +2405,24 @@ CChartAsGroup.prototype = ...@@ -2399,6 +2405,24 @@ CChartAsGroup.prototype =
data.newBodyPr.Write_ToBinary2(w); data.newBodyPr.Write_ToBinary2(w);
break; break;
} }
case historyitem_SetSpGroup:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
w.WriteSring2(data.newPr.Get_Id());
}
break;
}
case historyitem_SetShapeParent:
{
w.WriteBool(isRealObject(data.New));
if(isRealObject(data.New))
{
w.WriteString2(data.New.Id);
}
break;
}
} }
}, },
...@@ -2493,6 +2517,27 @@ CChartAsGroup.prototype = ...@@ -2493,6 +2517,27 @@ CChartAsGroup.prototype =
break; break;
} }
case historyitem_SetSpGroup:
{
if(r.GetBool())
{
this.group = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.group = null;
}
break;
}
case historyitem_SetShapeParent:
{
if(r.GetBool())
{
this.parent = g_oTableId.Get_ById(r.GetString2());
}
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
} }
......
...@@ -15,7 +15,7 @@ function CChartTitle(chartGroup, type) ...@@ -15,7 +15,7 @@ function CChartTitle(chartGroup, type)
this.txPr = null; this.txPr = null;
this.isDefaultText = false; this.isDefaultText = false;
this.txBody = null; this.txBody = new CTextBody(this);
this.x = null; this.x = null;
this.y = null; this.y = null;
...@@ -996,6 +996,16 @@ CChartTitle.prototype = ...@@ -996,6 +996,16 @@ CChartTitle.prototype =
}, },
setBodyPr: function(bodyPr)
{
var old_body_pr = this.txBody.bodyPr;
this.txBody.bodyPr = bodyPr;
var new_body_pr = this.txBody.bodyPr.createDuplicate();
History.Add(this, {Type: historyitem_SetShapeBodyPr, oldBodyPr: old_body_pr, newBodyPr: new_body_pr});
this.txBody.recalcInfo.recalculateBodyPr = true;
},
Undo: function(data) Undo: function(data)
{ {
switch(data.Type) switch(data.Type)
...@@ -1012,6 +1022,14 @@ CChartTitle.prototype = ...@@ -1012,6 +1022,14 @@ CChartTitle.prototype =
} }
break; break;
} }
case historyitem_SetShapeBodyPr:
{
this.txBody.bodyPr = data.oldBodyPr.createDuplicate();
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup;
}, },
...@@ -1032,6 +1050,14 @@ CChartTitle.prototype = ...@@ -1032,6 +1050,14 @@ CChartTitle.prototype =
} }
break; break;
} }
case historyitem_SetShapeBodyPr:
{
this.txBody.bodyPr = data.newBodyPr.createDuplicate();
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup;
}, },
...@@ -1054,6 +1080,11 @@ CChartTitle.prototype = ...@@ -1054,6 +1080,11 @@ CChartTitle.prototype =
} }
break; break;
} }
case historyitem_SetShapeBodyPr:
{
data.newBodyPr.Write_ToBinary2(w);
break;
}
} }
}, },
...@@ -1078,6 +1109,16 @@ CChartTitle.prototype = ...@@ -1078,6 +1109,16 @@ CChartTitle.prototype =
} }
break; break;
} }
case historyitem_SetShapeBodyPr:
{
this.txBody.bodyPr = new CBodyPr();
this.txBody.bodyPr.Read_FromBinary2(r);
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this.chartGroup;
} }
......
...@@ -150,6 +150,14 @@ function CTableId() ...@@ -150,6 +150,14 @@ function CTableId()
case historyitem_type_Image : Element = new CImageShape(); break; case historyitem_type_Image : Element = new CImageShape(); break;
case historyitem_type_GroupShapes : Element = new CGroupShape(); break; case historyitem_type_GroupShapes : Element = new CGroupShape(); break;
case historyitem_type_Chart : Element = new CChartData(true); break; case historyitem_type_Chart : Element = new CChartData(true); break;
case historyitem_type_Slide : Element = new Slide(); break;
case historyitem_type_PropLocker : Element = new PropLocker(); break;
case historyitem_type_Layout : Element = new SlideLayout(); break;
case historyitem_type_TextBody : Element = new CTextBody(); break;
case historyitem_type_GraphicFrame : Element = new CGraphicFrame(); break;
} }
Element.Read_FromBinary2(Reader); Element.Read_FromBinary2(Reader);
......
This diff is collapsed.
function CGroupShape(parent) function CGroupShape(parent)
{ {
this.parent = parent;
this.group = null; this.group = null;
this.drawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument; this.drawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
this.spLocks = null; this.spLocks = null;
this.useBgFill = null; this.useBgFill = null;
this.nvSpPr = null; this.nvGrpSpPr = null;
this.spPr = new CSpPr(); this.spPr = new CSpPr();
this.spTree = []; this.spTree = [];
...@@ -48,11 +47,22 @@ function CGroupShape(parent) ...@@ -48,11 +47,22 @@ function CGroupShape(parent)
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
if(isRealObject(parent))
{
this.setParent(parent);
}
} }
CGroupShape.prototype = CGroupShape.prototype =
{ {
setParent: function(parent)
{
History.Add(this, {Type:historyitem_SetShapeParent, Old: this.parent, New: parent});
this.parent = parent;
},
isSimpleObject: function() isSimpleObject: function()
{ {
return false; return false;
...@@ -1188,6 +1198,32 @@ CGroupShape.prototype = ...@@ -1188,6 +1198,32 @@ CGroupShape.prototype =
}, },
setNvSpPr: function(pr)
{
History.Add(this, {Type: historyitem_SetSetNvSpPr, oldPr: this.nvGrpSpPr, newPr: pr});
this.nvGrpSpPr = pr;
},
setSpPr: function(spPr)
{
History.Add(this, {Type:historyitem_SetSetSpPr, oldPr: this.spPr, newPr: spPr});
this.spPr = spPr;
},
setGroup: function(group)
{
History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group});
this.group = group;
},
addToSpTree: function(pos, item)
{
History.Add(this, {Type: historyitem_AddToGroupSpTree, pos: pos, item: item});
this.spTree.splice(pos, 0, item);
},
Undo: function(data) Undo: function(data)
{ {
switch(data.Type) switch(data.Type)
...@@ -1239,7 +1275,33 @@ CGroupShape.prototype = ...@@ -1239,7 +1275,33 @@ CGroupShape.prototype =
this.spPr.xfrm.flipH = data.oldFlipH; this.spPr.xfrm.flipH = data.oldFlipH;
this.spPr.xfrm.flipV = data.oldFlipV; this.spPr.xfrm.flipV = data.oldFlipV;
this.recalcTransform(); this.recalcTransform();
break;
}
case historyitem_SetSetNvSpPr:
{
this.nvGrpSpPr = data.oldPr;
break;
}
case historyitem_SetSetSpPr:
{
this.spPr = data.oldPr;
break;
}
case historyitem_AddToGroupSpTree:
{
this.spTree.splice(data.pos, 1);
break;
}
case historyitem_SetSpGroup:
{
this.group = data.oldPr;
break;
}
case historyitem_SetShapeParent:
{
this.parent = data.Old;
break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
...@@ -1298,7 +1360,34 @@ CGroupShape.prototype = ...@@ -1298,7 +1360,34 @@ CGroupShape.prototype =
this.spPr.xfrm.flipH = data.newFlipH; this.spPr.xfrm.flipH = data.newFlipH;
this.spPr.xfrm.flipV = data.newFlipV; this.spPr.xfrm.flipV = data.newFlipV;
this.recalcTransform(); this.recalcTransform();
break;
}
case historyitem_SetSetNvSpPr:
{
this.nvGrpSpPr = data.newPr;
break;
}
case historyitem_SetSetSpPr:
{
this.spPr = data.newPr;
break;
}
case historyitem_AddToGroupSpTree:
{
this.spTree.splice(data.pos, 0, data.item);
break;
}
case historyitem_SetSpGroup:
{
this.group = data.newPr;
break;
}
case historyitem_SetShapeParent:
{
this.parent = data.New;
break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
...@@ -1339,7 +1428,52 @@ CGroupShape.prototype = ...@@ -1339,7 +1428,52 @@ CGroupShape.prototype =
{ {
w.WriteBool(data.newFlipH); w.WriteBool(data.newFlipH);
w.WriteBool(data.newFlipV); w.WriteBool(data.newFlipV);
break;
}
case historyitem_SetSetNvSpPr:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_SetSetSpPr:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_AddToGroupSpTree:
{
w.WriteLong(data.pos);
w.WriteString2(data.item.Get_Id());
break;
}
case historyitem_SetSpGroup:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
w.WriteSring2(data.newPr.Get_Id());
}
break;
} }
case historyitem_SetShapeParent:
{
w.WriteBool(isRealObject(data.New));
if(isRealObject(data.New))
{
w.WriteString2(data.New.Id);
}
break;
}
} }
}, },
...@@ -1383,6 +1517,58 @@ CGroupShape.prototype = ...@@ -1383,6 +1517,58 @@ CGroupShape.prototype =
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
break;
}
case historyitem_SetSetNvSpPr:
{
if(r.GetBool())
{
this.nvGrpSpPr = new UniNvPr();
this.nvGrpSpPr.Read_FromBinary2(r);
}
else
{
this.nvGrpSpPr = null;
}
break;
}
case historyitem_SetSetSpPr:
{
this.spPr = new CSpPr();
if(r.GetBool())
{
this.spPr.Read_FromBinary2(r);
}
break;
}
case historyitem_AddToGroupSpTree:
{
var pos = r.GetLong();
var item = g_oTableId.Get_ById(r.GetString2());
this.spTree.splice(pos, 0, item);
break;
}
case historyitem_SetSpGroup:
{
if(r.GetBool())
{
this.group = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.group = null;
}
break;
}
case historyitem_SetShapeParent:
{
if(r.GetBool())
{
this.parent = g_oTableId.Get_ById(r.GetString2());
}
break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
...@@ -1390,8 +1576,13 @@ CGroupShape.prototype = ...@@ -1390,8 +1576,13 @@ CGroupShape.prototype =
}, },
Write_ToBinary2: function(w) Write_ToBinary2: function(w)
{}, {
w.WriteLng(historyitem_type_GroupShapes);
w.WriteString2(this.Id);
},
Read_FromBinary2: function(r) Read_FromBinary2: function(r)
{} {
this.Id = r.GetString2();
}
}; };
\ No newline at end of file
function CImageShape(parent) function CImageShape(parent)
{ {
this.parent = parent;
this.group = null; this.group = null;
this.drawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument; this.drawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
...@@ -51,6 +50,10 @@ function CImageShape(parent) ...@@ -51,6 +50,10 @@ function CImageShape(parent)
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
if(isRealObject(parent))
{
this.setParent(parent);
}
} }
...@@ -1002,6 +1005,44 @@ CImageShape.prototype = ...@@ -1002,6 +1005,44 @@ CImageShape.prototype =
return (north_number - cardDirection + 8)%8; return (north_number - cardDirection + 8)%8;
}, },
setNvSpPr: function(pr)
{
History.Add(this, {Type: historyitem_SetSetNvSpPr, oldPr: this.nvPicPr, newPr: pr});
this.nvPicPr = pr;
},
setSpPr: function(spPr)
{
History.Add(this, {Type:historyitem_SetSetSpPr, oldPr: this.spPr, newPr: spPr});
this.spPr = spPr;
},
setStyle: function(style)
{
History.Add(this, {Type:historyitem_SetSetStyle, oldPr: this.style, newPr:style});
this.style = style;
},
setBlipFill: function(blipFill)
{
History.Add(this, {Type:historyitem_SetBlipFill, oldPr: this.blipFill, newPr:blipFill});
this.blipFill = blipFill;
},
setGroup: function(group)
{
History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group});
this.group = group;
},
setParent: function(parent)
{
History.Add(this, {Type:historyitem_SetShapeParent, Old: this.parent, New: parent});
this.parent = parent;
},
Undo: function(data) Undo: function(data)
{ {
switch(data.Type) switch(data.Type)
...@@ -1041,6 +1082,37 @@ CImageShape.prototype = ...@@ -1041,6 +1082,37 @@ CImageShape.prototype =
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateGeometry = true; this.recalcInfo.recalculateGeometry = true;
break;
}
case historyitem_SetSetNvSpPr:
{
this.nvPicPr = data.oldPr;
break;
}
case historyitem_SetSetSpPr:
{
this.spPr = data.oldPr;
break;
}
case historyitem_SetSetStyle:
{
this.style = data.oldPr;
break;
}
case historyitem_SetBlipFill:
{
this.blipFill = data.oldPr;
break;
}
case historyitem_SetSpGroup:
{
this.group = data.oldPr;
break;
}
case historyitem_SetShapeParent:
{
this.parent = data.New;
break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
...@@ -1084,6 +1156,38 @@ CImageShape.prototype = ...@@ -1084,6 +1156,38 @@ CImageShape.prototype =
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
break;
}
case historyitem_SetSetNvSpPr:
{
this.nvPicPr = data.newPr;
break;
}
case historyitem_SetSetSpPr:
{
this.spPr = data.newPr;
break;
}
case historyitem_SetSetStyle:
{
this.style = data.newPr;
break;
}
case historyitem_SetBlipFill:
{
this.blipFill = data.newPr;
break;
}
case historyitem_SetSpGroup:
{
this.group = data.newPr;
break;
}
case historyitem_SetShapeParent:
{
this.parent = data.New;
break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
...@@ -1118,6 +1222,64 @@ CImageShape.prototype = ...@@ -1118,6 +1222,64 @@ CImageShape.prototype =
{ {
w.WriteBool(data.newFlipH); w.WriteBool(data.newFlipH);
w.WriteBool(data.newFlipV); w.WriteBool(data.newFlipV);
break;
}
case historyitem_SetSetNvSpPr:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_SetSetSpPr:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_SetSetStyle:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_SetBlipFill:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
case historyitem_SetSpGroup:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
w.WriteSring2(data.newPr.Get_Id());
}
break;
}
case historyitem_SetShapeParent:
{
w.WriteBool(isRealObject(data.New));
if(isRealObject(data.New))
{
w.WriteString2(data.New.Id);
}
break;
} }
} }
}, },
...@@ -1161,6 +1323,78 @@ CImageShape.prototype = ...@@ -1161,6 +1323,78 @@ CImageShape.prototype =
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
break;
}
case historyitem_SetSetNvSpPr:
{
if(r.GetBool())
{
this.nvPicPr = new UniNvPr();
this.nvPicPr.Read_FromBinary2(r);
}
else
{
this.nvPicPr = null;
}
break;
}
case historyitem_SetSetSpPr:
{
this.spPr = new CSpPr();
if(r.GetBool())
{
this.spPr.Read_FromBinary2(r);
}
break;
}
case historyitem_SetSetStyle:
{
if(r.GetBool())
{
this.style = new CShapeStyle();
this.style.Read_FromBinary2(r);
}
else
{
this.style = null;
}
break;
}
case historyitem_SetBlipFill:
{
if(r.GetBool())
{
this.blipFill = new CUniFill();
this.blipFill.Read_FromBinary2(r);
}
else
{
this.blipFill = null;
}
break;
}
case historyitem_SetSpGroup:
{
if(r.GetBool())
{
this.group = g_oTableId.Get_ById(r.GetString2());
}
else
{
this.group = null;
}
break;
}
case historyitem_SetShapeParent:
{
if(r.GetBool())
{
this.parent = g_oTableId.Get_ById(r.GetString2());
}
break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
......
...@@ -485,4 +485,38 @@ function SlideLayout(slideMaster) ...@@ -485,4 +485,38 @@ function SlideLayout(slideMaster)
_shapes[_shape_index].recalculate(); _shapes[_shape_index].recalculate();
} }
}; };
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
} }
SlideLayout.prototype =
{
Get_Id: function()
{
return this.Id;
},
Write_ToBinary2: function(w)
{
w.WriteLong(historyitem_type_Layout);
w.WriteString2(this.Id);
},
Read_FromBinary2: function(r)
{
this.Id = r.GetString2();
},
Save_Changes: function(data, w)
{
},
Load_Changes: function(r)
{
}
};
...@@ -120,6 +120,12 @@ function Paragraph(DrawingDocument, Parent, PageNum, X, Y, XLimit, YLimit) ...@@ -120,6 +120,12 @@ function Paragraph(DrawingDocument, Parent, PageNum, X, Y, XLimit, YLimit)
Paragraph.prototype = Paragraph.prototype =
{ {
setPresentationBullet: function(bullet)
{
History.Add(this, {Type:historyitem_Paragraph_PresentationBullet, oldPr: this.bullet, newPr: bullet});
this.bullet = bullet;
},
GetType : function() GetType : function()
{ {
return type_Paragraph; return type_Paragraph;
...@@ -335,6 +341,15 @@ Paragraph.prototype = ...@@ -335,6 +341,15 @@ Paragraph.prototype =
OtherParagraph.Style_Add( this.Style_Get(), true ); OtherParagraph.Style_Add( this.Style_Get(), true );
}, },
Set_Pr : function(oNewPr)
{
var Pr_old = this.Pr;
var Pr_new = oNewPr;
History.Add( this, { Type : historyitem_Paragraph_Pr, Old : Pr_old, New : Pr_new } );
this.Pr = oNewPr;
},
// Добавляем элемент в содержимое параграфа. (Здесь передвигаются все позиции // Добавляем элемент в содержимое параграфа. (Здесь передвигаются все позиции
// CurPos.ContentPos, Selection.StartPos, Selection.EndPos) // CurPos.ContentPos, Selection.StartPos, Selection.EndPos)
Internal_Content_Add : function (Pos, Item) Internal_Content_Add : function (Pos, Item)
...@@ -11169,6 +11184,12 @@ Paragraph.prototype = ...@@ -11169,6 +11184,12 @@ Paragraph.prototype =
this.CompiledPr.NeedRecalc = true; this.CompiledPr.NeedRecalc = true;
break; break;
} }
case historyitem_Paragraph_PresentationBullet:
{
this.bullet = Data.oldPr;
break;
}
} }
this.RecalcInfo.Set_Type_0(pararecalc_0_All); this.RecalcInfo.Set_Type_0(pararecalc_0_All);
...@@ -11523,6 +11544,12 @@ Paragraph.prototype = ...@@ -11523,6 +11544,12 @@ Paragraph.prototype =
this.CompiledPr.NeedRecalc = true; this.CompiledPr.NeedRecalc = true;
break; break;
} }
case historyitem_Paragraph_PresentationBullet:
{
this.bullet = Data.newPr;
break;
}
} }
this.RecalcInfo.Set_Type_0(pararecalc_0_All); this.RecalcInfo.Set_Type_0(pararecalc_0_All);
...@@ -12120,6 +12147,15 @@ Paragraph.prototype = ...@@ -12120,6 +12147,15 @@ Paragraph.prototype =
break; break;
} }
case historyitem_Paragraph_PresentationBullet:
{
w.WriteBool(isRealObject(Data.newPr));
if(isRealObject(Data.newPr))
{
Data.newPr.Write_ToBinary2(Writer);
}
break;
}
} }
return Writer; return Writer;
...@@ -12762,6 +12798,20 @@ Paragraph.prototype = ...@@ -12762,6 +12798,20 @@ Paragraph.prototype =
break; break;
} }
case historyitem_Paragraph_PresentationBullet:
{
if(Reader.GetBool())
{
this.bullet = new CBullet();
this.bullet.Read_FromBinary2(Reader);
}
else
{
this.bullet = undefined;
}
break;
}
} }
this.RecalcInfo.Set_Type_0(pararecalc_0_All); this.RecalcInfo.Set_Type_0(pararecalc_0_All);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -358,4 +358,27 @@ function MasterSlide(presentation, theme) ...@@ -358,4 +358,27 @@ function MasterSlide(presentation, theme)
} }
}; };
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
} }
MasterSlide.prototype =
{
Get_Id: function()
{
return this.Id;
},
Write_ToBinary2: function(w)
{},
Read_FromBinary2: function(r)
{},
Save_Changes: function()
{},
Load_Changes: function()
{}
};
...@@ -93,13 +93,10 @@ var nTWTSquare = 1; ...@@ -93,13 +93,10 @@ var nTWTSquare = 1;
function CTextBody(shape) function CTextBody(shape)
{ {
this.shape = shape;
this.bodyPr = new CBodyPr(); this.bodyPr = new CBodyPr();
this.lstStyle = new TextListStyle(); this.lstStyle = new TextListStyle();
this.content = new CDocumentContent(this, editor.WordControl.m_oLogicDocument.DrawingDocument, 0, 0, 0, 20000, false, false);
this.content2 = null; this.content2 = null;
this.compiledBodyPr = new CBodyPr(); this.compiledBodyPr = new CBodyPr();
this.recalcInfo = this.recalcInfo =
...@@ -111,6 +108,12 @@ function CTextBody(shape) ...@@ -111,6 +108,12 @@ function CTextBody(shape)
this.bRecalculateNumbering = true; this.bRecalculateNumbering = true;
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
if(isRealObject(shape))
{
this.setShape(shape);
this.setDocContent(new CDocumentContent(this, editor.WordControl.m_oLogicDocument.DrawingDocument, 0, 0, 0, 20000, false, false));
}
} }
CTextBody.prototype = CTextBody.prototype =
...@@ -121,8 +124,37 @@ CTextBody.prototype = ...@@ -121,8 +124,37 @@ CTextBody.prototype =
return this.Id; return this.Id;
}, },
setLstStyle: function(lstStyle)
{
History.Add(this, {Type:historyitem_SetLstStyle, oldPr: this.lstStyle, newPr: lstStyle});
this.lstStyle = lstStyle;
},
setShape: function(shape)
{
History.Add(this, {Type:historyitem_SetShape, oldPr: this.shape, newPr: shape});
this.shape = shape;
},
setDocContent: function(docContent)
{
History.Add(this, {Type:historyitem_SetDocContent, oldPr: this.content, newPr: docContent});
this.content = docContent;
},
Write_ToBinary2: function(w)
{
w.WriteLong(historyitem_type_TextBody);
w.WriteString2(this.Id);
},
Read_FromBinary2: function(r)
{
this.Id = r.GetString2();
},
recalculate: function() recalculate: function()
{ {
...@@ -382,23 +414,134 @@ CTextBody.prototype = ...@@ -382,23 +414,134 @@ CTextBody.prototype =
readFromBinaryDocContent(this.content, r); readFromBinaryDocContent(this.content, r);
}, },
Undo: function() Undo: function(data)
{}, {
switch(data.Type)
{
case historyitem_SetShape:
{
this.shape = data.oldPr;
break;
}
Redo: function() case historyitem_SetDocContent:
{}, {
this.content = data.oldPr;
break;
}
case historyitem_SetLstStyle:
{
this.lstStyle = data.oldPr;
break;
}
Write_ToBinary2: function() }
{}, },
Read_FromBinary2: function() Redo: function(data)
{}, {
switch(data.Type)
{
case historyitem_SetShape:
{
this.shape = data.newPr;
break;
}
Save_Changes: function() case historyitem_SetDocContent:
{}, {
this.content = data.newPr;
break;
}
Load_Changes: function() case historyitem_SetLstStyle:
{}, {
this.lstStyle = data.newPr;
break;
}
}
},
Save_Changes: function(data, w)
{
w.WriteLong(historyitem_type_TextBody);
w.WriteLong(data.Type);
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.WriteString2(data.newPr)
}
break;
}
case historyitem_SetLstStyle:
{
w.WriteBool(isRealObject(data.newPr));
if(isRealObject(data.newPr))
{
data.newPr.Write_ToBinary2(w);
}
break;
}
}
},
Load_Changes: function(r)
{
if(r.GetLong() === historyitem_type_TextBody)
{
var type = r.GetLong();
switch(type)
{
case historyitem_SetShape:
{
if(r.GetBool())
{
this.shape = g_oTableId.Get_ById(r.GetString2());
}
break;
}
case historyitem_SetDocContent:
{
if(r.GetBool())
{
this.content = g_oTableId.Get_ById(r.GetString2());
}
break;
}
case historyitem_SetLstStyle:
{
if(r.GetBool())
{
this.lstStyle = new TextListStyle();
this.lstStyle.Read_FromBinary2(r);
}
else
{
this.lstStyle = null;
}
break;
}
}
}
},
Refresh_RecalcData2: function() Refresh_RecalcData2: function()
{}, {},
......
This diff is collapsed.
...@@ -53,6 +53,9 @@ var historyitem_Paragraph_Borders_Top = 30; // Изменяем н ...@@ -53,6 +53,9 @@ var historyitem_Paragraph_Borders_Top = 30; // Изменяем н
var historyitem_Paragraph_Pr = 31; // Изменяем свойства полностью var historyitem_Paragraph_Pr = 31; // Изменяем свойства полностью
var historyitem_Paragraph_PresentationPr_Bullet = 32; // Изменяем свойства нумерации у параграфа в презентации var historyitem_Paragraph_PresentationPr_Bullet = 32; // Изменяем свойства нумерации у параграфа в презентации
var historyitem_Paragraph_PresentationPr_Level = 33; // Изменяем уровень параграфа в презентациях var historyitem_Paragraph_PresentationPr_Level = 33; // Изменяем уровень параграфа в презентациях
var historyitem_Paragraph_FramePr = 34; // Изменяем настройки рамки
var historyitem_Paragraph_PresentationBullet = 35; // Изменяем уровень параграфа в презентациях
// Типы изменений в классе ParaTextPr // Типы изменений в классе ParaTextPr
var historyitem_TextPr_Change = 1; // Изменяем настройку var historyitem_TextPr_Change = 1; // Изменяем настройку
...@@ -212,6 +215,23 @@ var historyitem_AddToSlideSpTree = 1; ...@@ -212,6 +215,23 @@ var historyitem_AddToSlideSpTree = 1;
var historyitem_AddSlideLocks = 2; var historyitem_AddSlideLocks = 2;
var historyitem_ChangeBg = 3; var historyitem_ChangeBg = 3;
var historyitem_ChangeTiming = 4; var historyitem_ChangeTiming = 4;
var historyitem_SetLayout = 5;
var historyitem_SetSlideNum = 6;
var historyitem_ShapeAdd = 7;
var historyitem_SetCSldName = 8;
var historyitem_SetClrMapOverride = 9;
var historyitem_SetShow = 10;
var historyitem_SetShowPhAnim = 11;
var historyitem_SetShowMasterSp = 12;
//Изменения в классе PropLocker
var historyitem_PropLockerSetId = 0;
...@@ -274,10 +294,32 @@ var historyitem_SetShapeSetFill = 7; ...@@ -274,10 +294,32 @@ var historyitem_SetShapeSetFill = 7;
var historyitem_SetShapeSetLine= 8; var historyitem_SetShapeSetLine= 8;
var historyitem_SetShapeSetGeometry = 9; var historyitem_SetShapeSetGeometry = 9;
var historyitem_SetShapeBodyPr = 10; var historyitem_SetShapeBodyPr = 10;
var historyitem_SetSetNvSpPr = 11;
var historyitem_SetSetSpPr = 12;
var historyitem_SetSetStyle = 13;
var historyitem_SetTextBody = 14;
var historyitem_SetBlipFill = 15;
var historyitem_AddToGroupSpTree = 16;
var historyitem_SetSpGroup = 17;
var historyitem_SetSpParent = 18;
//Типы изменений в классе CChartAsGroup //Типы изменений в классе CChartAsGroup
var historyitem_SetCahrtLayout = 0; var historyitem_SetCahrtLayout = 1000;
//Типы изменений в классе TexBody
var historyitem_SetShape = 0;
var historyitem_SetDocContent = 1;
var historyitem_SetLstStyle = 2;
...@@ -354,6 +396,17 @@ var historyitem_type_HdrFtrGrObjects = 25; ...@@ -354,6 +396,17 @@ var historyitem_type_HdrFtrGrObjects = 25;
var historyitem_type_GrObjects = 26; var historyitem_type_GrObjects = 26;
var historyitem_type_Hyperlink = 27; var historyitem_type_Hyperlink = 27;
var historyitem_type_ChartTitle = 28; var historyitem_type_ChartTitle = 28;
var historyitem_type_PropLocker = 29;
var historyitem_type_Slide = 30;
var historyitem_type_Layout = 31;
var historyitem_type_TextBody = 32;
var historyitem_type_GraphicFrame = 33;
function CHistory(Document) function CHistory(Document)
......
This diff is collapsed.
...@@ -152,12 +152,27 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -152,12 +152,27 @@ function NullState(drawingObjectsController, drawingObjects)
} }
else if(hit_in_text_rect) else if(hit_in_text_rect)
{ {
this.drawingObjectsController.resetSelection(); if(e.Button !== g_mouse_button_right || this.drawingObjectsController.State === this || (this.drawingObjectsController.State.textObject !== cur_drawing))
cur_drawing.select(this.drawingObjectsController); {
cur_drawing.selectionSetStart(e, x, y); this.drawingObjectsController.resetSelection();
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, cur_drawing)); cur_drawing.select(this.drawingObjectsController);
if(e.ClickCount < 2) cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.updateSelectionState(editor.WordControl.m_oLogicDocument.DrawingDocument); this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, cur_drawing));
if(e.ClickCount < 2)
this.drawingObjectsController.updateSelectionState(editor.WordControl.m_oLogicDocument.DrawingDocument);
}
else
{
if(e.Button === g_mouse_button_right && this.drawingObjectsController.State.textObject && this.drawingObjectsController.State.textObject === cur_drawing && !(cur_drawing.pointInSelectedText(x, y)))
{
this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController);
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, cur_drawing));
if(e.ClickCount < 2)
this.drawingObjectsController.updateSelectionState(editor.WordControl.m_oLogicDocument.DrawingDocument);
}
}
return; return;
} }
} }
...@@ -1423,8 +1438,11 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject) ...@@ -1423,8 +1438,11 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
this.onMouseUp = function(e, x, y) this.onMouseUp = function(e, x, y)
{ {
this.textObject.selectionSetEnd(e, x, y); if(!(e.Button === g_mouse_button_right && this.textObject.pointInSelectedText(x, y)))
this.drawingObjectsController.updateSelectionState(); {
this.textObject.selectionSetEnd(e, x, y);
this.drawingObjectsController.updateSelectionState();
}
}; };
this.onKeyDown = function(e) this.onKeyDown = function(e)
......
This diff is collapsed.
...@@ -271,7 +271,7 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY) ...@@ -271,7 +271,7 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
else else
shape.initDefaultTextRect(this.x, this.y, this.extX, this.extY, false, false); shape.initDefaultTextRect(this.x, this.y, this.extX, this.extY, false, false);
shape.select(this.drawingObjects.graphicObjects); shape.select(this.drawingObjects.graphicObjects);
drawingObjects.addSp(shape); drawingObjects.shapeAdd(drawingObjects.cSld.spTree.length, shape);
this.drawingObjects.graphicObjects.State.resultObject = shape; this.drawingObjects.graphicObjects.State.resultObject = shape;
}; };
} }
\ No newline at end of file
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