Commit cee3aff6 authored by SergeyLuzyanin's avatar SergeyLuzyanin

notes typing

parent 845e7699
...@@ -1029,10 +1029,16 @@ CPresentation.prototype = ...@@ -1029,10 +1029,16 @@ CPresentation.prototype =
var Res = Para.Recalculate_FastRange( SimpleChanges ); var Res = Para.Recalculate_FastRange( SimpleChanges );
if ( -1 !== Res ) if ( -1 !== Res )
{ {
if( this.Slides[this.CurPage]) var oCurSlide = this.Slides[this.CurPage];
{ if( oCurSlide){
this.DrawingDocument.OnRecalculatePage(this.CurPage, this.Slides[this.CurPage]); if(!this.FocusOnNotes){
this.DrawingDocument.OnEndRecalculate(); this.DrawingDocument.OnRecalculatePage(this.CurPage, oCurSlide);
this.DrawingDocument.OnEndRecalculate();
}
else{
this.DrawingDocument.Notes_OnRecalculate(this.CurPage, oCurSlide.NotesWidth, oCurSlide.getNotesHeight());
}
} }
History.Get_RecalcData(); History.Get_RecalcData();
History.Reset_RecalcIndex(); History.Reset_RecalcIndex();
...@@ -1054,6 +1060,7 @@ CPresentation.prototype = ...@@ -1054,6 +1060,7 @@ CPresentation.prototype =
var _RecalcData = RecalcData ? RecalcData : History.Get_RecalcData(), key, recalcMap, bSync = true, i, bRedrawAllSlides = false, aToRedrawSlides = [], redrawSlideIndexMap = {}, slideIndex; var _RecalcData = RecalcData ? RecalcData : History.Get_RecalcData(), key, recalcMap, bSync = true, i, bRedrawAllSlides = false, aToRedrawSlides = [], redrawSlideIndexMap = {}, slideIndex;
this.updateSlideIndexes(); this.updateSlideIndexes();
var b_check_layout = false; var b_check_layout = false;
var bRedrawNotes = false;
if(_RecalcData.Drawings.All || _RecalcData.Drawings.ThemeInfo) if(_RecalcData.Drawings.All || _RecalcData.Drawings.ThemeInfo)
{ {
b_check_layout = true; b_check_layout = true;
...@@ -1124,14 +1131,19 @@ CPresentation.prototype = ...@@ -1124,14 +1131,19 @@ CPresentation.prototype =
} }
else else
{ {
var oCurNotesShape = null;
if(this.Slides[this.CurPage]){
oCurNotesShape = this.Slides[this.CurPage].notesShape;
}
for(key in _RecalcData.Drawings.Map) for(key in _RecalcData.Drawings.Map)
{ {
if(_RecalcData.Drawings.Map.hasOwnProperty(key)) if(_RecalcData.Drawings.Map.hasOwnProperty(key))
{ {
_RecalcData.Drawings.Map[key].recalculate(); var oDrawingObject = _RecalcData.Drawings.Map[key];
if(_RecalcData.Drawings.Map[key].getSlideIndex) oDrawingObject.recalculate();
if(oDrawingObject.getSlideIndex)
{ {
slideIndex = _RecalcData.Drawings.Map[key].getSlideIndex(); slideIndex = oDrawingObject.getSlideIndex();
if(slideIndex !== null) if(slideIndex !== null)
{ {
if(redrawSlideIndexMap[slideIndex] !== true ) if(redrawSlideIndexMap[slideIndex] !== true )
...@@ -1140,6 +1152,11 @@ CPresentation.prototype = ...@@ -1140,6 +1152,11 @@ CPresentation.prototype =
aToRedrawSlides.push(slideIndex); aToRedrawSlides.push(slideIndex);
} }
} }
else{
if(oCurNotesShape && oCurNotesShape === oDrawingObject){
bRedrawNotes = true;
}
}
} }
} }
} }
...@@ -1164,6 +1181,9 @@ CPresentation.prototype = ...@@ -1164,6 +1181,9 @@ CPresentation.prototype =
} }
} }
this.DrawingDocument.OnEndRecalculate(); this.DrawingDocument.OnEndRecalculate();
if(bRedrawNotes){
this.DrawingDocument.Notes_OnRecalculate(this.CurPage, this.Slides[this.CurPage].NotesWidth, this.Slides[this.CurPage].getNotesHeight());
}
} }
if(!this.Slides[this.CurPage]) if(!this.Slides[this.CurPage])
{ {
...@@ -1196,8 +1216,17 @@ CPresentation.prototype = ...@@ -1196,8 +1216,17 @@ CPresentation.prototype =
this.bNeedUpdateTh = false; this.bNeedUpdateTh = false;
} }
} }
if(this.Slides[this.CurPage]) if(this.Slides[this.CurPage]){
this.Slides[this.CurPage].graphicObjects.updateSelectionState(); if(!this.FocusOnNotes){
this.Slides[this.CurPage].graphicObjects.updateSelectionState();
}
else{
if(this.Slides[this.CurPage].notesShape){
this.Slides[this.CurPage].notesShape.updateSelectionState();
}
}
}
for(i = 0; i < this.slidesToUnlock.length; ++i) for(i = 0; i < this.slidesToUnlock.length; ++i)
{ {
this.DrawingDocument.UnLockSlide(this.slidesToUnlock[i]); this.DrawingDocument.UnLockSlide(this.slidesToUnlock[i]);
...@@ -1933,26 +1962,24 @@ CPresentation.prototype = ...@@ -1933,26 +1962,24 @@ CPresentation.prototype =
oMathShape.txBody.content.MoveCursorToStartPos(false); oMathShape.txBody.content.MoveCursorToStartPos(false);
} }
} }
this.Slides[this.CurPage].graphicObjects.paragraphAdd(ParaItem, bRecalculate); if(this.FocusOnNotes){
if(AscFormat.getTargetTextObject(this.Slides[this.CurPage].graphicObjects) instanceof AscFormat.CGraphicFrame){ var oCurSlide = this.Slides[this.CurPage];
bRecalculate = false; if(oCurSlide.notesShape){
oCurSlide.notesShape.paragraphAdd(ParaItem, bRecalculate);
bRecalculate = false;
}
} }
if(oMathShape) else{
{ this.Slides[this.CurPage].graphicObjects.paragraphAdd(ParaItem, bRecalculate);
//var oContent = oMathShape.txBody.content; if(AscFormat.getTargetTextObject(this.Slides[this.CurPage].graphicObjects) instanceof AscFormat.CGraphicFrame){
//var oTextPr = new CTextPr(); bRecalculate = false;
//oTextPr.RFonts.Ascii = {Name: "Cambria Math", Index: -1}; }
//oTextPr.RFonts.HAnsi = {Name: "Cambria Math", Index: -1}; if(oMathShape)
//oTextPr.RFonts.CS = {Name: "Cambria Math", Index: -1}; {
//oTextPr.RFonts.EastAsia = {Name: "Cambria Math", Index: -1}; oMathShape.checkExtentsByDocContent();
//oContent.Set_ApplyToAll(true); oMathShape.spPr.xfrm.setOffX((this.Slides[this.CurPage].Width - oMathShape.spPr.xfrm.extX)/2);
//oContent.AddToParagraph(new ParaTextPr(oTextPr)); oMathShape.spPr.xfrm.setOffY((this.Slides[this.CurPage].Height - oMathShape.spPr.xfrm.extY)/2);
//oContent.Set_ApplyToAll(false); }
oMathShape.checkExtentsByDocContent();
oMathShape.spPr.xfrm.setOffX((this.Slides[this.CurPage].Width - oMathShape.spPr.xfrm.extX)/2);
oMathShape.spPr.xfrm.setOffY((this.Slides[this.CurPage].Height - oMathShape.spPr.xfrm.extY)/2);
} }
if(false === bRecalculate){ if(false === bRecalculate){
this.Recalculate(); this.Recalculate();
...@@ -3112,8 +3139,14 @@ CPresentation.prototype = ...@@ -3112,8 +3139,14 @@ CPresentation.prototype =
if ( true === editor.isViewMode ) if ( true === editor.isViewMode )
return false; return false;
if(!this.Slides[this.CurPage] || !this.Slides[this.CurPage].graphicObjects || this.Slides[this.CurPage].graphicObjects.selectedObjects.length === 0) var oCurSlide = this.Slides[this.CurPage];
{ if(!oCurSlide || !oCurSlide.graphicObjects){
return;
}
if(!this.FocusOnNotes && oCurSlide.graphicObjects.selectedObjects.length === 0){
return;
}
if(this.FocusOnNotes && !oCurSlide.notesShape){
return; return;
} }
var Code; var Code;
...@@ -3241,10 +3274,13 @@ CPresentation.prototype = ...@@ -3241,10 +3274,13 @@ CPresentation.prototype =
Notes_OnMouseDown : function(e, X, Y) Notes_OnMouseDown : function(e, X, Y)
{ {
var bFocusOnSlide = !this.FocusOnNotes;
this.FocusOnNotes = true; this.FocusOnNotes = true;
var oCurSlide = this.Slides[this.CurPage]; var oCurSlide = this.Slides[this.CurPage];
if(oCurSlide){ if(oCurSlide){
oCurSlide.resetSelection(true, false); if(bFocusOnSlide){
oCurSlide.graphicObjects.resetSelection(true, false);
}
if(oCurSlide.notesShape){ if(oCurSlide.notesShape){
oCurSlide.notesShape.selectionSetStart(e, X, Y, this.CurPage); oCurSlide.notesShape.selectionSetStart(e, X, Y, this.CurPage);
this.Notes_UpdateSelectionState(); this.Notes_UpdateSelectionState();
......
...@@ -99,7 +99,7 @@ CShape.prototype.setDrawingBase = function(drawingBase) ...@@ -99,7 +99,7 @@ CShape.prototype.setDrawingBase = function(drawingBase)
CShape.prototype.getDrawingObjectsController = function() CShape.prototype.getDrawingObjectsController = function()
{ {
if(this.parent && this.parent.getObjectType() === AscDFH.historyitem_type_Slide) if(this.parent && (this.parent.getObjectType() === AscDFH.historyitem_type_Slide || this.parent.getObjectType() === AscDFH.historyitem_type_Notes))
{ {
return this.parent.graphicObjects; return this.parent.graphicObjects;
} }
......
...@@ -1044,6 +1044,8 @@ Slide.prototype = ...@@ -1044,6 +1044,8 @@ Slide.prototype =
this.notesShape = this.notes.getBodyShape(); this.notesShape = this.notes.getBodyShape();
} }
if(this.notesShape){ if(this.notesShape){
this.notes.graphicObjects.selectObject(this.notesShape, 0);
this.notes.graphicObjects.selection.textSelection = this.notesShape;
var oDocContent = this.notesShape.getDocContent(); var oDocContent = this.notesShape.getDocContent();
if(oDocContent){ if(oDocContent){
this.notesShape.transformText.tx = 3; this.notesShape.transformText.tx = 3;
......
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