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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50078 954022d7-b5bf-4e40-9824-e11837661b57
parent 042d6ac8
......@@ -3309,6 +3309,55 @@ function FontCollection()
this.latin = null;
this.ea = null;
this.cs = null;
this.Write_ToBinary2 = function(w)
{
w.WriteBool((typeof this.latin === "string"));
if((typeof this.latin === "string"))
{
w.WriteString2(this.latin);
}
w.WriteBool((typeof this.ea === "string"));
if((typeof this.ea === "string"))
{
w.WriteString2(this.ea);
}
w.WriteBool((typeof this.cs === "string"));
if((typeof this.cs === "string"))
{
w.WriteString2(this.cs);
}
};
this.Read_FromBinary2 = function(r)
{
if(r.GetBool())
{
this.latin = r.GetString2();
}
else
{
this.latin = null;
}
if(r.GetBool())
{
this.ea = r.GetString2();
}
else
{
this.ea = null;
}
if(r.GetBool())
{
this.cs = r.GetString2();
}
else
{
this.cs = null;
}
};
}
function FontScheme()
......@@ -3317,6 +3366,18 @@ function FontScheme()
this.majorFont = new FontCollection();
this.minorFont = new FontCollection();
this.Write_ToBinary2 = function(w)
{
this.majorFont.Write_ToBinary2(w);
this.minorFont.Write_ToBinary2(w);
};
this.Read_FromBinary2 = function(r)
{
this.majorFont.Read_FromBinary2(r);
this.minorFont.Read_FromBinary2(r);
};
}
function FmtScheme()
......@@ -3346,6 +3407,51 @@ function FmtScheme()
return null;
}
this.Write_ToBinary2 = function(w)
{
w.WriteString2(this.name);
w.WriteLong(this.fillStyleLst.length);
for(var i = 0; i < this.fillStyleLst.length; ++i)
{
this.fillStyleLst[i].Write_ToBinary2(w);
}
w.WriteLong(this.lnStyleLst.length);
for(var i = 0; i < this.lnStyleLst.length; ++i)
{
this.lnStyleLst[i].Write_ToBinary2(w);
}
w.WriteLong(this.bgFillStyleLst.length);
for(var i = 0; i < this.bgFillStyleLst.length; ++i)
{
this.bgFillStyleLst[i].Write_ToBinary2(w);
}
};
this.Read_FromBinary2 = function(r)
{
this.name = r.GetString2();
var c = r.GetLong();
for(var i = 0; i < c; ++i)
{
this.fillStyleLst[i] = new CUniFill();
this.fillStyleLst[i].Read_FromBinary2(r);
}
c = r.GetLong();
for(i = 0; i < c; ++i)
{
this.lnStyleLst[i] = new CLn();
this.lnStyleLst[i].Read_FromBinary2(r);
}
c = r.GetLong();
for(i = 0; i < c; ++i)
{
this.bgFillStyleLst[i] = new CUniFill();
this.bgFillStyleLst[i].Read_FromBinary2(r);
}
};
}
function ThemeElements()
......@@ -3393,6 +3499,18 @@ function CTheme()
this.themeElements.clrScheme = clrScheme;
};
this.setFontScheme = function(fontScheme)
{
History.Add(this, {Type: historyitem_ChangeFontScheme, oldPr: this.themeElements.clrScheme, newPr: clrScheme});
this.themeElements.fontScheme = fontScheme;
};
this.setFormatScheme = function(fmtScheme)
{
History.Add(this, {Type: historyitem_ChangeFmtScheme, oldPr: this.themeElements.clrScheme, newPr: clrScheme});
this.themeElements.fmtScheme = fmtScheme;
};
this.Refresh_RecalcData= function()
{
var slides = editor.WordControl.m_oLogicDocument.Slides;
......@@ -3417,6 +3535,17 @@ function CTheme()
this.themeElements.clrScheme = data.oldPr;
break;
}
case historyitem_ChangeFontScheme:
{
this.themeElements.fontScheme = data.oldPr;
break;
}
case historyitem_ChangeFmtScheme:
{
this.themeElements.fmtScheme = data.oldPr;
break;
}
}
};
......@@ -3429,6 +3558,17 @@ function CTheme()
this.themeElements.clrScheme = data.newPr;
break;
}
case historyitem_ChangeFontScheme:
{
this.themeElements.fontScheme = data.newPr;
break;
}
case historyitem_ChangeFmtScheme:
{
this.themeElements.fmtScheme = data.newPr;
break;
}
}
};
......@@ -3450,6 +3590,8 @@ function CTheme()
switch(data.Type)
{
case historyitem_ChangeColorScheme:
case historyitem_ChangeFontScheme:
case historyitem_ChangeFmtScheme:
{
data.newPr.Write_ToBinary2(w);
break;
......@@ -3477,6 +3619,37 @@ function CTheme()
slide.recalcAllColors();
}
}
break;
}
case historyitem_ChangeFontScheme:
{
this.themeElements.fontScheme = new FontScheme();
this.themeElements.fontScheme.Read_FromBinary2(r);
var slides = editor.WordControl.m_oLogicDocument.Slides;
for(var i = 0; i < slides.length; ++i)
{
var slide = slides[i];
if(slide.Layout && slide.Layout.Master && slide.Layout.Master.Theme === this)
{
slide.recalcAllColors();
}
}
break;
}
case historyitem_ChangeFmtScheme:
{
this.themeElements.fmtScheme = new FmtScheme();
this.themeElements.fmtScheme.Read_FromBinary2(r);
var slides = editor.WordControl.m_oLogicDocument.Slides;
for(var i = 0; i < slides.length; ++i)
{
var slide = slides[i];
if(slide.Layout && slide.Layout.Master && slide.Layout.Master.Theme === this)
{
slide.recalcAllColors();
}
}
break;
}
}
}
......
......@@ -1095,7 +1095,7 @@ function CCollaborativeEditing()
}
var CollaborativeEditing = null;
var CollaborativeEditing = new CCollaborativeEditing();
var changestype_None = 0; // Ничего не происходит с выделенным элементом (проверка идет через дополнительный параметр)
var changestype_Paragraph_Content = 1; // Добавление/удаление элементов в параграф
......
......@@ -239,8 +239,7 @@ function CPresentation(DrawingDocument)
this.TableId = new CTableId();
g_oTableId = this.TableId;
this.CollaborativeEditing = new CCollaborativeEditing();
CollaborativeEditing = this.CollaborativeEditing;
this.CollaborativeEditing = CollaborativeEditing;
//------------------------------------------------------------------------
this.Id = g_oIdCounter.Get_NewId();
......@@ -5883,6 +5882,8 @@ CPresentation.prototype =
}
},
changeTheme : function(themeInfo)
{
if(this.viewMode === true)
......
......@@ -381,6 +381,26 @@ MasterSlide.prototype =
this.recalcAll();
},
shapeAdd: function(pos, item)
{
History.Add(this, {Type: historyitem_ShapeAdd, pos: pos, item: item});
this.cSld.spTree.splice(pos, 0, item);
},
changeBackground: function(bg)
{
History.Add(this, {Type: historyitem_ChangeBg, oldBg: this.cSld.Bg ? this.cSld.Bg.createFullCopy() : null, newBg: bg});
this.cSld.Bg = bg.createFullCopy();
this.recalcInfo.recalculateBackground = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setCSldName: function(name)
{
History.Add(this, {Type: historyitem_SetCSldName,oldName: this.cSld.name, newName: name});
this.cSld.name = name;
},
recalcAll: function()
{
for(var i = 0; i < this.cSld.spTree.length; ++i)
......
......@@ -333,6 +333,9 @@ var historyitem_SetLstStyle = 2;
//Типы изменений в классе CTheme
var historyitem_ChangeColorScheme = 0;
var historyitem_ChangeFontScheme = 1;
var historyitem_ChangeFmtScheme = 2;
......@@ -340,7 +343,6 @@ var historyitem_ChangeColorScheme = 0;
//Типы изменений в классе GraphicObjects
var historyitem_AddHdrFtrGrObjects = 0;
var historyitem_ChangeColorScheme = 1;
//Типы изменений в классе HeaderFooterGraphicObjects
var historyitem_AddHdr = 0;
......
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