Commit 3d7cb789 authored by SergeyLuzyanin's avatar SergeyLuzyanin

creating notes

parent 3bd43e04
......@@ -87,11 +87,6 @@ CShape.prototype.Is_UseInDocument = function(){
return false;
};
CShape.prototype.isEmptyPlaceholder = function()
{
return false;
};
CShape.prototype.getTextArtPreviewManager = function()
{
return Asc["editor"].textArtPreviewManager;
......
......@@ -6827,6 +6827,9 @@ DrawingObjectsController.prototype =
setSelectionState: function( state, stateIndex )
{
if(!Array.isArray(state)){
return;
}
var _state_index = AscFormat.isRealNumber(stateIndex) ? stateIndex : state.length-1;
var selection_state = state[_state_index];
this.clearPreTrackObjects();
......@@ -6865,11 +6868,13 @@ DrawingObjectsController.prototype =
}
else
{
for(var i = 0; i < selection_state.selection.length; ++i)
{
if(!selection_state.selection[i].object.bDeleted)
if(Array.isArray(selection_state.selection)){
for(var i = 0; i < selection_state.selection.length; ++i)
{
this.selectObject(selection_state.selection[i].object, selection_state.selection[i].pageIndex);
if(!selection_state.selection[i].object.bDeleted)
{
this.selectObject(selection_state.selection[i].object, selection_state.selection[i].pageIndex);
}
}
}
}
......
......@@ -279,11 +279,6 @@ CGraphicFrame.prototype.copy= function()
return ret;
};
CGraphicFrame.prototype.isEmptyPlaceholder= function()
{
return false;
};
CGraphicFrame.prototype.getAllFonts= function(fonts)
{
if(this.graphicObject)
......
......@@ -853,6 +853,10 @@
{
return 1;
};
CGraphicObjectBase.prototype.isEmptyPlaceholder = function()
{
return false;
};
CGraphicObjectBase.prototype.Restart_CheckSpelling = function()
{
......
......@@ -1200,11 +1200,6 @@ function CGroupShape()
return null;
};
CGroupShape.prototype.isEmptyPlaceholder = function ()
{
return false;
};
CGroupShape.prototype.getCompiledFill = function()
{
this.compiledFill = null;
......
......@@ -195,11 +195,6 @@ CImageShape.prototype.isPlaceholder = function()
return this.nvPicPr != null && this.nvPicPr.nvPr != undefined && this.nvPicPr.nvPr.ph != undefined;
};
CImageShape.prototype.isEmptyPlaceholder = function ()
{
return false;
};
CImageShape.prototype.isShape = function()
{
return false;
......
......@@ -773,11 +773,15 @@ if(typeof CPresentation !== "undefined")
AscCommon.CollaborativeEditing.OnStart_CheckLock();
var oController = this.GetCurrentController();
if(!oController){
return false;
}
if(CheckType === AscCommon.changestype_Drawing_Props)
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var selected_objects = cur_slide.graphicObjects.selectedObjects;
var selected_objects = oController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{
var check_obj =
......@@ -919,7 +923,7 @@ if(typeof CPresentation !== "undefined")
{
if(cur_slide.deleteLock.Lock.Type !== locktype_Mine && cur_slide.deleteLock.Lock.Type !== locktype_None)
return true;
var selected_objects = cur_slide.graphicObjects.selectedObjects;
var selected_objects = oController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{
var check_obj =
......
......@@ -717,16 +717,31 @@ function BinaryPPTYLoader()
this.presentation.slideMasters[0] = AscFormat.GenerateDefaultMasterSlide(this.presentation.themes[0]);
this.presentation.slideLayouts[0] = this.presentation.slideMasters[0].sldLayoutLst[0];
}
if(this.presentation.slideMasters[0].sldLayoutLst.length === 0){
if(this.presentation.slideMasters[0].sldLayoutLst.length === 0)
{
this.presentation.slideMasters[0].sldLayoutLst[0] = AscFormat.GenerateDefaultSlideLayout(this.presentation.slideMasters[0]);
this.presentation.slideLayouts[0] = this.presentation.slideMasters[0].sldLayoutLst[0];
}
if (this.presentation.Slides.length == 0)
{
this.presentation.Slides[0] = AscFormat.GenerateDefaultSlide(this.presentation.slideLayouts[0]);
this.presentation.Slides[0] = AscCommonSlide.GenerateDefaultSlide(this.presentation.slideLayouts[0]);
}
if(this.presentation.notesMasters.length === 0)
{
this.presentation.notesMasters[0] = AscCommonSlide.CreateNotesMaster();
this.presentation.notesMasters[0].setTheme(this.presentation.themes[0]);
}
var _slides = this.presentation.Slides;
var _slide;
for(var i = 0; i < _slides.length; ++i)
{
_slide = _slides[i];
if(!_slide.notes){
_slide.setNotes(AscCommonSlide.CreateNotes());
_slide.notes.setSlide(_slide);
_slide.notes.setNotesMaster(this.presentation.notesMasters[0]);
}
}
//var _editor = this.Api;
//_editor.sync_InitEditorThemes(_editor.ThemeLoader.Themes.EditorThemes, _editor.ThemeLoader.Themes.DocumentThemes);
}
......
......@@ -507,7 +507,7 @@ function CBinaryFileWriter()
for (var i = 0; i < _slide_count; i++)
{
_dst_slides[i] = _slides[i];
if(_slides[i].notes)
if(_slides[i].notes && !_slides[i].notes.isEmptyBody())
{
_dst_notes.push(_slides[i].notes);
}
......
......@@ -248,9 +248,19 @@
};
CNotes.prototype.isEmptyBody = function(){
var oBodyShape = this.getBodyShape();
if(!oBodyShape){
return true;
}
return oBodyShape.isEmptyPlaceholder();
};
function CreateNotes(){
var oN = new CNotes();
var oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
var oNvSpPr = new AscFormat.UniNvPr();
var oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(2);
......@@ -268,6 +278,7 @@
oN.addToSpTreeToPos(0, oSp);
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(3);
......@@ -289,6 +300,7 @@
oN.addToSpTreeToPos(1, oSp);
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(4);
......
......@@ -161,6 +161,7 @@
oNM.changeBackground(oBG);
var oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
var oNvSpPr = new AscFormat.UniNvPr();
var oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(2);
......@@ -173,8 +174,8 @@
oSp.setLockValue(AscFormat.LOCKS_MASKS.noGrp, true);
oSp.setSpPr(new AscFormat.CSpPr());
oSp.spPr.setParent(oSp);
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.setXfrm(new AscFormat.CXfrm());
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.xfrm.setOffX(0);
oSp.spPr.xfrm.setOffY(0);
oSp.spPr.xfrm.setExtX(2971800/36000);
......@@ -202,6 +203,7 @@
//endParaPr
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(3);
......@@ -214,8 +216,8 @@
oSp.setLockValue(AscFormat.LOCKS_MASKS.noGrp, true);
oSp.setSpPr(new AscFormat.CSpPr());
oSp.spPr.setParent(oSp);
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.setXfrm(new AscFormat.CXfrm());
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.xfrm.setOffX(3884613/36000);
oSp.spPr.xfrm.setOffY(0);
oSp.spPr.xfrm.setExtX(2971800/36000);
......@@ -243,6 +245,7 @@
oNM.addToSpTreeToPos(1, oSp);
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(3);
......@@ -255,8 +258,8 @@
oSp.setLockValue(AscFormat.LOCKS_MASKS.noGrp, true);
oSp.setSpPr(new AscFormat.CSpPr());
oSp.spPr.setParent(oSp);
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.setXfrm(new AscFormat.CXfrm());
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.xfrm.setOffX(3884613/36000);
oSp.spPr.xfrm.setOffY(0);
oSp.spPr.xfrm.setExtX(2971800/36000);
......@@ -284,6 +287,7 @@
oNM.addToSpTreeToPos(2, oSp);
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(5);
......@@ -297,8 +301,8 @@
oSp.setLockValue(AscFormat.LOCKS_MASKS.noGrp, true);
oSp.setSpPr(new AscFormat.CSpPr());
oSp.spPr.setParent(oSp);
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.setXfrm(new AscFormat.CXfrm());
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.xfrm.setOffX(685800/36000);
oSp.spPr.xfrm.setOffY(4400550/36000);
oSp.spPr.xfrm.setExtX(5486400/36000);
......@@ -322,6 +326,7 @@
oNM.addToSpTreeToPos(3, oSp);
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(6);
......@@ -335,8 +340,8 @@
oSp.setLockValue(AscFormat.LOCKS_MASKS.noGrp, true);
oSp.setSpPr(new AscFormat.CSpPr());
oSp.spPr.setParent(oSp);
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.setXfrm(new AscFormat.CXfrm());
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.xfrm.setOffX(0);
oSp.spPr.xfrm.setOffY(8685213/36000);
oSp.spPr.xfrm.setExtX(2971800/36000);
......@@ -364,6 +369,7 @@
oNM.addToSpTreeToPos(4, oSp);
oSp = new AscFormat.CShape();
oSp.setBDeleted(false);
oNvSpPr = new AscFormat.UniNvPr();
oCNvPr = oNvSpPr.cNvPr;
oCNvPr.setId(7);
......@@ -377,8 +383,8 @@
oSp.setLockValue(AscFormat.LOCKS_MASKS.noGrp, true);
oSp.setSpPr(new AscFormat.CSpPr());
oSp.spPr.setParent(oSp);
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.setXfrm(new AscFormat.CXfrm());
oSp.spPr.xfrm.setParent(oSp.spPr);
oSp.spPr.xfrm.setOffX(3884613/36000);
oSp.spPr.xfrm.setOffY(8685213/36000);
oSp.spPr.xfrm.setExtX(2971800/36000);
......@@ -430,9 +436,9 @@
oTxLstStyle.levels[0].DefaultRunPr.FontSize = 12;
oTxLstStyle.levels[0].DefaultRunPr.Unifill = AscFormat.CreateUniFillSchemeColorWidthTint(15, 0);
oTxLstStyle.levels[0].DefaultRunPr.RFonts.Ascii.Name = "+mn-lt";
oTxLstStyle.levels[0].DefaultRunPr.RFonts.EastAsia.Name = "+mn-ea";
oTxLstStyle.levels[0].DefaultRunPr.RFonts.CS.Name = "+mn-cd";
oTxLstStyle.levels[0].DefaultRunPr.RFonts.Ascii = {Name :"+mn-lt", Index: -1};
oTxLstStyle.levels[0].DefaultRunPr.RFonts.EastAsia = {Name :"+mn-ea", Index: -1};
oTxLstStyle.levels[0].DefaultRunPr.RFonts.CS = {Name :"+mn-cs", Index: -1};
oTxLstStyle.levels[1] = oTxLstStyle.levels[0].Copy();
oTxLstStyle.levels[1].Ind.Left = 457200/36000;
......
......@@ -2038,8 +2038,8 @@ CPresentation.prototype =
}
if(this.FocusOnNotes){
var oCurSlide = this.Slides[this.CurPage];
if(oCurSlide.notesShape){
oCurSlide.notesShape.paragraphAdd(ParaItem, bRecalculate);
if(oCurSlide.notes){
oCurSlide.notes.graphicObjects.paragraphAdd(ParaItem, bRecalculate);
bRecalculate = false;
}
}
......@@ -2639,7 +2639,7 @@ CPresentation.prototype =
var oTargetTextObject = AscFormat.getTargetTextObject(oDrawingObjects);
var bNeedRedraw;
if(oTargetTextObject && oTargetTextObject.isEmptyPlaceholder && oTargetTextObject.isEmptyPlaceholder())
if(oTargetTextObject.isEmptyPlaceholder())
{
bNeedRedraw = true;
}
......@@ -5045,7 +5045,7 @@ CPresentation.prototype =
slide.setLayout(layout);
for(var j = slide.cSld.spTree.length-1; j > -1 ; --j)
{
if(slide.cSld.spTree[j].isEmptyPlaceholder && slide.cSld.spTree[j].isEmptyPlaceholder())
if(slide.cSld.spTree[j].isEmptyPlaceholder())
{
slide.removeFromSpTreeById(slide.cSld.spTree[j].Get_Id());
}
......
......@@ -108,10 +108,6 @@ CShape.prototype.recalcBrush = function()
this.recalcInfo.recalculateBrush = true;
};
CShape.prototype.isEmptyPlaceholder = function()
{
return false;
};
CShape.prototype.recalcPen = function()
{
......
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