Commit 72ce161e authored by SergeyLuzyanin's avatar SergeyLuzyanin

presentation sections

parent 7ac730b9
...@@ -1253,6 +1253,7 @@ ...@@ -1253,6 +1253,7 @@
window['AscDFH'].historyitem_type_NotesMaster = 1128 << 16; window['AscDFH'].historyitem_type_NotesMaster = 1128 << 16;
window['AscDFH'].historyitem_type_Notes = 1129 << 16; window['AscDFH'].historyitem_type_Notes = 1129 << 16;
window['AscDFH'].historyitem_type_Cnx = 1130 << 16; window['AscDFH'].historyitem_type_Cnx = 1130 << 16;
window['AscDFH'].historyitem_type_PresentationSection = 1131 << 16;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
...@@ -1711,6 +1712,8 @@ ...@@ -1711,6 +1712,8 @@
window['AscDFH'].historyitem_Presentation_ChangeColorScheme = window['AscDFH'].historyitem_type_Presentation | 6; window['AscDFH'].historyitem_Presentation_ChangeColorScheme = window['AscDFH'].historyitem_type_Presentation | 6;
window['AscDFH'].historyitem_Presentation_SetShowPr = window['AscDFH'].historyitem_type_Presentation | 7; window['AscDFH'].historyitem_Presentation_SetShowPr = window['AscDFH'].historyitem_type_Presentation | 7;
window['AscDFH'].historyitem_Presentation_SetDefaultTextStyle = window['AscDFH'].historyitem_type_Presentation | 8; window['AscDFH'].historyitem_Presentation_SetDefaultTextStyle = window['AscDFH'].historyitem_type_Presentation | 8;
window['AscDFH'].historyitem_Presentation_AddSection = window['AscDFH'].historyitem_type_Presentation | 9;
window['AscDFH'].historyitem_Presentation_RemoveSection = window['AscDFH'].historyitem_type_Presentation | 10;
window['AscDFH'].historyitem_ColorMod_SetName = window['AscDFH'].historyitem_type_ColorMod | 1; window['AscDFH'].historyitem_ColorMod_SetName = window['AscDFH'].historyitem_type_ColorMod | 1;
window['AscDFH'].historyitem_ColorMod_SetVal = window['AscDFH'].historyitem_type_ColorMod | 2; window['AscDFH'].historyitem_ColorMod_SetVal = window['AscDFH'].historyitem_type_ColorMod | 2;
...@@ -2587,6 +2590,10 @@ ...@@ -2587,6 +2590,10 @@
window['AscDFH'].historyitem_NotesSetSlide = window['AscDFH'].historyitem_type_Notes | 8; window['AscDFH'].historyitem_NotesSetSlide = window['AscDFH'].historyitem_type_Notes | 8;
window['AscDFH'].historyitem_NotesSetNotesMaster = window['AscDFH'].historyitem_type_Notes | 9; window['AscDFH'].historyitem_NotesSetNotesMaster = window['AscDFH'].historyitem_type_Notes | 9;
window['AscDFH'].historyitem_PresentationSectionSetName = window['AscDFH'].historyitem_type_PresentationSection | 1;
window['AscDFH'].historyitem_PresentationSectionSetGuid = window['AscDFH'].historyitem_type_PresentationSection | 2;
window['AscDFH'].historyitem_PresentationSectionSetStartIndex = window['AscDFH'].historyitem_type_PresentationSection | 3;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
...@@ -272,6 +272,10 @@ ...@@ -272,6 +272,10 @@
this.m_oFactoryClass[AscDFH.historyitem_type_SlideMaster] = AscCommonSlide.MasterSlide; this.m_oFactoryClass[AscDFH.historyitem_type_SlideMaster] = AscCommonSlide.MasterSlide;
this.m_oFactoryClass[AscDFH.historyitem_type_SlideComments] = AscCommonSlide.SlideComments; this.m_oFactoryClass[AscDFH.historyitem_type_SlideComments] = AscCommonSlide.SlideComments;
this.m_oFactoryClass[AscDFH.historyitem_type_PropLocker] = AscCommonSlide.PropLocker; this.m_oFactoryClass[AscDFH.historyitem_type_PropLocker] = AscCommonSlide.PropLocker;
this.m_oFactoryClass[AscDFH.historyitem_type_NotesMaster] = AscCommonSlide.CNotesMaster;
this.m_oFactoryClass[AscDFH.historyitem_type_Notes] = AscCommonSlide.CNotes;
this.m_oFactoryClass[AscDFH.historyitem_type_PresentationSection] = AscCommonSlide.CPrSection;
this.m_oFactoryClass[AscDFH.historyitem_type_NotesMaster] = AscCommonSlide.PropLocker;
} }
this.m_oFactoryClass[AscDFH.historyitem_type_Theme] = AscFormat.CTheme; this.m_oFactoryClass[AscDFH.historyitem_type_Theme] = AscFormat.CTheme;
......
...@@ -230,6 +230,46 @@ function CreatePresentationTableStyles(Styles, IdMap) ...@@ -230,6 +230,46 @@ function CreatePresentationTableStyles(Styles, IdMap)
} }
function CPrSection(){
this.name = null;
this.startIndex = null;
this.guid = null;
this.Id = AscCommon.g_oIdCounter.Get_NewId();
AscCommon.g_oTableId.Add(this, this.Id);
}
CPrSection.prototype.getObjectType = function () {
return AscDFH.historyitem_type_PresentationSection;
};
CPrSection.prototype.Get_Id = function () {
return this.Id;
};
CPrSection.prototype.Write_ToBinary2 = function(w){
w.WriteLong(this.getObjectType());
w.WriteString2(this.Get_Id());
};
CPrSection.prototype.Read_FromBinary2 = function(r){
this.Id = r.GetString2();
};
CPrSection.prototype.setName = function(pr){
History.Add(new AscDFH.CChangesDrawingsString(this, AscDFH.historyitem_PresentationSectionSetName, this.name, pr));
this.name = pr;
};
CPrSection.prototype.setStartIndex = function(pr){
History.Add(new AscDFH.CChangesDrawingsLong(this, AscDFH.historyitem_PresentationSectionSetStartIndex, this.startIndex, pr));
this.startIndex = pr;
};
CPrSection.prototype.setGuid = function(pr){
History.Add(new AscDFH.CChangesDrawingsString(this, AscDFH.historyitem_PresentationSectionSetGuid, this.guid, pr));
this.guid = pr;
};
CPrSection.prototype.Read_FromBinary2 = function(r){
this.Id = r.GetString2();
};
function CShowPr(){ function CShowPr(){
this.browse = undefined; this.browse = undefined;
this.kiosk = undefined; //{restart: uInt} this.kiosk = undefined; //{restart: uInt}
...@@ -384,6 +424,14 @@ AscDFH.changesFactory[AscDFH.historyitem_Presentation_RemoveSlide] = AscDFH.CCha ...@@ -384,6 +424,14 @@ AscDFH.changesFactory[AscDFH.historyitem_Presentation_RemoveSlide] = AscDFH.CCha
AscDFH.changesFactory[AscDFH.historyitem_Presentation_AddSlide] = AscDFH.CChangesDrawingsContentPresentation ; AscDFH.changesFactory[AscDFH.historyitem_Presentation_AddSlide] = AscDFH.CChangesDrawingsContentPresentation ;
AscDFH.changesFactory[AscDFH.historyitem_Presentation_SetDefaultTextStyle] = AscDFH.CChangesDrawingsObjectNoId; AscDFH.changesFactory[AscDFH.historyitem_Presentation_SetDefaultTextStyle] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_PresentationSectionSetName] = AscDFH.CChangesDrawingsString;
AscDFH.changesFactory[AscDFH.historyitem_PresentationSectionSetStartIndex] = AscDFH.CChangesDrawingsLong;
AscDFH.changesFactory[AscDFH.historyitem_PresentationSectionSetGuid] = AscDFH.CChangesDrawingsString;
AscDFH.drawingsChangesMap[AscDFH.historyitem_PresentationSectionSetName] = function(oClass, value){oClass.name = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_PresentationSectionSetStartIndex] = function(oClass, value){oClass.startIndex = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_PresentationSectionSetGuid] = function(oClass, value){oClass.guid = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_Presentation_SetShowPr] = function(oClass, value){oClass.showPr = value;}; AscDFH.drawingsChangesMap[AscDFH.historyitem_Presentation_SetShowPr] = function(oClass, value){oClass.showPr = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_Presentation_SlideSize] = function(oClass, value){oClass.Width = value.a; oClass.Height = value.b; oClass.changeSlideSizeFunction(oClass.Width, oClass.Height);}; AscDFH.drawingsChangesMap[AscDFH.historyitem_Presentation_SlideSize] = function(oClass, value){oClass.Width = value.a; oClass.Height = value.b; oClass.changeSlideSizeFunction(oClass.Width, oClass.Height);};
AscDFH.drawingsChangesMap[AscDFH.historyitem_Presentation_SetDefaultTextStyle] = function(oClass, value){oClass.defaultTextStyle = value;}; AscDFH.drawingsChangesMap[AscDFH.historyitem_Presentation_SetDefaultTextStyle] = function(oClass, value){oClass.defaultTextStyle = value;};
...@@ -503,6 +551,8 @@ function CPresentation(DrawingDocument) ...@@ -503,6 +551,8 @@ function CPresentation(DrawingDocument)
this.Spelling = new CDocumentSpelling(); this.Spelling = new CDocumentSpelling();
this.Sections = [];//array of CPrSection
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора) // Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
...@@ -553,6 +603,17 @@ CPresentation.prototype = ...@@ -553,6 +603,17 @@ CPresentation.prototype =
this.defaultTextStyle = oStyle; this.defaultTextStyle = oStyle;
}, },
addSection: function(pos, pr){
History.Add(new AscDFH.CChangesDrawingsContent(this, AscDFH.historyitem_Presentation_AddSection, pos, [pr], true));
this.Sections.splice(pos, 0, pr);
},
removeSection: function(pos){
History.Add(new AscDFH.CChangesDrawingsContent(this, AscDFH.historyitem_Presentation_AddSection, pos, [pr], true));
this.Sections.splice(pos, 0, pr);
},
Set_DefaultLanguage: function(NewLangId) Set_DefaultLanguage: function(NewLangId)
{ {
var oTextStyle = this.defaultTextStyle ? this.defaultTextStyle.createDuplicate() : new AscFormat.TextListStyle(); var oTextStyle = this.defaultTextStyle ? this.defaultTextStyle.createDuplicate() : new AscFormat.TextListStyle();
...@@ -5794,3 +5855,4 @@ function collectSelectedObjects(aSpTree, aCollectArray, bRecursive, oIdMap) ...@@ -5794,3 +5855,4 @@ function collectSelectedObjects(aSpTree, aCollectArray, bRecursive, oIdMap)
//------------------------------------------------------------export---------------------------------------------------- //------------------------------------------------------------export----------------------------------------------------
window['AscCommonSlide'] = window['AscCommonSlide'] || {}; window['AscCommonSlide'] = window['AscCommonSlide'] || {};
window['AscCommonSlide'].CPresentation = CPresentation; window['AscCommonSlide'].CPresentation = CPresentation;
window['AscCommonSlide'].CPrSection = CPrSection;
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