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()
}
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);
}
......
......@@ -47,9 +47,6 @@ function Path(extrusionOk, fill, stroke, w, h)
} */
return duplicate;
};
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
}
Path.prototype = {
......
This diff is collapsed.
......@@ -2,7 +2,6 @@
var CLASS_TYPE_CHART_DATA = 9999;
function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument, group)
{
this.parent = parent;
this.document = document;
this.group = isRealObject(group) ? group : null;
......@@ -50,6 +49,10 @@ function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument,
g_oTableId.Add(this, this.Id);
this.bFirstRecalc = true;
if(isRealObject(parent))
{
this.setParent(parent);
}
}
......@@ -272,14 +275,6 @@ CChartAsGroup.prototype =
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)
......@@ -2119,31 +2114,22 @@ CChartAsGroup.prototype =
},
setParent: function(paraDrawing)
setParent: function(parent)
{
var data = {Type: historyitem_SetParent};
if(isRealObject(this.parent))
{
data.oldParent = this.parent.Get_Id();
}
else
{
data.oldParent = null;
}
History.Add(this, {Type:historyitem_SetShapeParent, Old: this.parent, New: parent});
this.parent = parent;
},
if(isRealObject(paraDrawing))
{
data.newParent = paraDrawing.Get_Id();
}
else
setGroup: function(group)
{
data.newParent = null;
}
History.Add(this, data);
this.parent = paraDrawing;
History.Add(this, {Type: historyitem_SetSpGroup, oldPr: this.group, newPr: group});
this.group = group;
},
Undo: function(data)
{
switch(data.Type)
......@@ -2237,6 +2223,16 @@ CChartAsGroup.prototype =
this.recalcInfo.recalculateTransformText = true;
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;
},
......@@ -2330,6 +2326,16 @@ CChartAsGroup.prototype =
this.recalcInfo.recalculateTransformText = true;
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;
},
......@@ -2399,6 +2405,24 @@ CChartAsGroup.prototype =
data.newBodyPr.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;
}
}
},
......@@ -2493,6 +2517,27 @@ CChartAsGroup.prototype =
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;
}
......
......@@ -15,7 +15,7 @@ function CChartTitle(chartGroup, type)
this.txPr = null;
this.isDefaultText = false;
this.txBody = null;
this.txBody = new CTextBody(this);
this.x = null;
this.y = null;
......@@ -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)
{
switch(data.Type)
......@@ -1012,6 +1022,14 @@ CChartTitle.prototype =
}
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;
},
......@@ -1032,6 +1050,14 @@ CChartTitle.prototype =
}
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;
},
......@@ -1054,6 +1080,11 @@ CChartTitle.prototype =
}
break;
}
case historyitem_SetShapeBodyPr:
{
data.newBodyPr.Write_ToBinary2(w);
break;
}
}
},
......@@ -1078,6 +1109,16 @@ CChartTitle.prototype =
}
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;
}
......
......@@ -150,6 +150,14 @@ function CTableId()
case historyitem_type_Image : Element = new CImageShape(); break;
case historyitem_type_GroupShapes : Element = new CGroupShape(); 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);
......
This diff is collapsed.
function CGroupShape(parent)
{
this.parent = parent;
this.group = null;
this.drawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
this.spLocks = null;
this.useBgFill = null;
this.nvSpPr = null;
this.nvGrpSpPr = null;
this.spPr = new CSpPr();
this.spTree = [];
......@@ -48,11 +47,22 @@ function CGroupShape(parent)
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
if(isRealObject(parent))
{
this.setParent(parent);
}
}
CGroupShape.prototype =
{
setParent: function(parent)
{
History.Add(this, {Type:historyitem_SetShapeParent, Old: this.parent, New: parent});
this.parent = parent;
},
isSimpleObject: function()
{
return false;
......@@ -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)
{
switch(data.Type)
......@@ -1239,7 +1275,33 @@ CGroupShape.prototype =
this.spPr.xfrm.flipH = data.oldFlipH;
this.spPr.xfrm.flipV = data.oldFlipV;
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;
......@@ -1298,7 +1360,34 @@ CGroupShape.prototype =
this.spPr.xfrm.flipH = data.newFlipH;
this.spPr.xfrm.flipV = data.newFlipV;
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;
......@@ -1339,7 +1428,52 @@ CGroupShape.prototype =
{
w.WriteBool(data.newFlipH);
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 =
this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = 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;
......@@ -1390,8 +1576,13 @@ CGroupShape.prototype =
},
Write_ToBinary2: function(w)
{},
{
w.WriteLng(historyitem_type_GroupShapes);
w.WriteString2(this.Id);
},
Read_FromBinary2: function(r)
{}
{
this.Id = r.GetString2();
}
};
\ No newline at end of file
function CImageShape(parent)
{
this.parent = parent;
this.group = null;
this.drawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
......@@ -51,6 +50,10 @@ function CImageShape(parent)
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add( this, this.Id );
if(isRealObject(parent))
{
this.setParent(parent);
}
}
......@@ -1002,6 +1005,44 @@ CImageShape.prototype =
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)
{
switch(data.Type)
......@@ -1041,6 +1082,37 @@ CImageShape.prototype =
this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = 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;
......@@ -1084,6 +1156,38 @@ CImageShape.prototype =
this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = 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;
......@@ -1118,6 +1222,64 @@ CImageShape.prototype =
{
w.WriteBool(data.newFlipH);
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 =
this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = 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;
......
......@@ -485,4 +485,38 @@ function SlideLayout(slideMaster)
_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)
Paragraph.prototype =
{
setPresentationBullet: function(bullet)
{
History.Add(this, {Type:historyitem_Paragraph_PresentationBullet, oldPr: this.bullet, newPr: bullet});
this.bullet = bullet;
},
GetType : function()
{
return type_Paragraph;
......@@ -335,6 +341,15 @@ Paragraph.prototype =
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)
Internal_Content_Add : function (Pos, Item)
......@@ -11169,6 +11184,12 @@ Paragraph.prototype =
this.CompiledPr.NeedRecalc = true;
break;
}
case historyitem_Paragraph_PresentationBullet:
{
this.bullet = Data.oldPr;
break;
}
}
this.RecalcInfo.Set_Type_0(pararecalc_0_All);
......@@ -11523,6 +11544,12 @@ Paragraph.prototype =
this.CompiledPr.NeedRecalc = true;
break;
}
case historyitem_Paragraph_PresentationBullet:
{
this.bullet = Data.newPr;
break;
}
}
this.RecalcInfo.Set_Type_0(pararecalc_0_All);
......@@ -12120,6 +12147,15 @@ Paragraph.prototype =
break;
}
case historyitem_Paragraph_PresentationBullet:
{
w.WriteBool(isRealObject(Data.newPr));
if(isRealObject(Data.newPr))
{
Data.newPr.Write_ToBinary2(Writer);
}
break;
}
}
return Writer;
......@@ -12762,6 +12798,20 @@ Paragraph.prototype =
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 diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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;
function CTextBody(shape)
{
this.shape = shape;
this.bodyPr = new CBodyPr();
this.lstStyle = new TextListStyle();
this.content = new CDocumentContent(this, editor.WordControl.m_oLogicDocument.DrawingDocument, 0, 0, 0, 20000, false, false);
this.content2 = null;
this.compiledBodyPr = new CBodyPr();
this.recalcInfo =
......@@ -111,6 +108,12 @@ function CTextBody(shape)
this.bRecalculateNumbering = true;
this.Id = g_oIdCounter.Get_NewId();
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 =
......@@ -121,7 +124,36 @@ CTextBody.prototype =
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()
{
......@@ -382,23 +414,134 @@ CTextBody.prototype =
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()
{},
......
This diff is collapsed.
......@@ -53,6 +53,9 @@ var historyitem_Paragraph_Borders_Top = 30; // Изменяем н
var historyitem_Paragraph_Pr = 31; // Изменяем свойства полностью
var historyitem_Paragraph_PresentationPr_Bullet = 32; // Изменяем свойства нумерации у параграфа в презентации
var historyitem_Paragraph_PresentationPr_Level = 33; // Изменяем уровень параграфа в презентациях
var historyitem_Paragraph_FramePr = 34; // Изменяем настройки рамки
var historyitem_Paragraph_PresentationBullet = 35; // Изменяем уровень параграфа в презентациях
// Типы изменений в классе ParaTextPr
var historyitem_TextPr_Change = 1; // Изменяем настройку
......@@ -212,6 +215,23 @@ var historyitem_AddToSlideSpTree = 1;
var historyitem_AddSlideLocks = 2;
var historyitem_ChangeBg = 3;
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;
var historyitem_SetShapeSetLine= 8;
var historyitem_SetShapeSetGeometry = 9;
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
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;
var historyitem_type_GrObjects = 26;
var historyitem_type_Hyperlink = 27;
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)
......
This diff is collapsed.
......@@ -151,6 +151,8 @@ function NullState(drawingObjectsController, drawingObjects)
return;
}
else if(hit_in_text_rect)
{
if(e.Button !== g_mouse_button_right || this.drawingObjectsController.State === this || (this.drawingObjectsController.State.textObject !== cur_drawing))
{
this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController);
......@@ -158,6 +160,19 @@ function NullState(drawingObjectsController, drawingObjects)
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;
}
}
......@@ -1422,9 +1437,12 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
};
this.onMouseUp = function(e, x, y)
{
if(!(e.Button === g_mouse_button_right && this.textObject.pointInSelectedText(x, y)))
{
this.textObject.selectionSetEnd(e, x, y);
this.drawingObjectsController.updateSelectionState();
}
};
this.onKeyDown = function(e)
......
......@@ -5098,6 +5098,12 @@ CTextPr.prototype =
Flags |= 2097152;
}
Writer.WriteBool(isRealObject(this.unifill));
if(isRealObject(this.unifill))
{
this.unifill.Write_ToBinary2(Writer);
}
var EndPos = Writer.GetCurPosition();
Writer.Seek( StartPos );
Writer.WriteLong( Flags );
......@@ -5207,6 +5213,12 @@ CTextPr.prototype =
// Lang
if ( Flags & 2097152 )
this.Lang.Read_FromBinary( Reader );
if(Reader.GetBool())
{
this.unifill = new CUniFill();
this.unifill.Read_FromBinary2(Reader);
}
},
Check_NeedRecalc : function()
......
......@@ -271,7 +271,7 @@ function NewShapeTrack(drawingObjects, presetGeom, startX, startY)
else
shape.initDefaultTextRect(this.x, this.y, this.extX, this.extY, false, false);
shape.select(this.drawingObjects.graphicObjects);
drawingObjects.addSp(shape);
drawingObjects.shapeAdd(drawingObjects.cSld.spTree.length, shape);
this.drawingObjects.graphicObjects.State.resultObject = shape;
};
}
\ No newline at end of file
This diff is collapsed.
......@@ -126,6 +126,8 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/commonDefines.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/Serialize2.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script>
......
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