Commit a0872ad6 authored by SergeyLuzyanin's avatar SergeyLuzyanin

notes

parent 0474e94b
......@@ -2691,7 +2691,7 @@ CShape.prototype.recalculateLocalTransform = function(transform)
&& AscCommonSlide.CNotes && this.parent && this.parent instanceof AscCommonSlide.CNotes){
bNotesShape = true;
this.x = 0;
this.y = 0;
this.y = editor.WordControl.m_oLogicDocument.Height;
this.extX = this.parent.getWidth();
this.extY = 2000;
this.rot = 0;
......
......@@ -59,6 +59,9 @@
this.kind = AscFormat.TYPE_KIND.NOTES;
this.Id = AscCommon.g_oIdCounter.Get_NewId();
AscCommon.g_oTableId.Add(this, this.Id);
this.graphicObjects = new AscFormat.DrawingObjectsController(this);
}
CNotes.prototype.getObjectType = function(){
......@@ -135,21 +138,23 @@
return GetNotesWidth();
};
CNotes.prototype.recalculate = function(){
CNotes.prototype.getBodyShape = function(){
var aSpTree = this.cSld.spTree;
for(var i = 0; i < aSpTree.length; ++i){
var sp = aSpTree[i];
if(sp.isPlaceholder()){
if(sp.getPlaceholderType() === AscFormat.phType_body){
sp.recalculate();
return;
return sp;
}
}
}
return null;
};
CNotes.prototype.recalculate = function(){
};
CNotes.prototype.draw = function(graphics){
return;
var aSpTree = this.cSld.spTree;
for(var i = 0; i < aSpTree.length; ++i){
var sp = aSpTree[i];
......@@ -165,4 +170,5 @@
window['AscCommonSlide'] = window['AscCommonSlide'] || {};
window['AscCommonSlide'].CNotes = CNotes;
window['AscCommonSlide'].GetNotesWidth = GetNotesWidth;
})();
......@@ -3226,6 +3226,31 @@ CPresentation.prototype =
},
notes_OnMouseDown : function(e, X, Y)
{
},
notes_OnMouseUp : function(e, X, Y)
{
},
notes_OnMouseMove : function(e, X, Y)
{
},
notes_OnKeyDown: function(e){
},
notes_OnKeyPress: function(e){
},
OnUpdateSize: function(){
},
Get_TableStyleForPara : function()
{
......
......@@ -464,7 +464,6 @@ CShape.prototype.recalculate = function ()
var check_slide_placeholder = !this.isPlaceholder() || (this.parent && (this.parent.getObjectType() === AscDFH.historyitem_type_Slide || this.parent.getObjectType() === AscDFH.historyitem_type_Notes));
AscFormat.ExecuteNoHistory(function(){
if (this.recalcInfo.recalculateBrush) {
this.recalculateBrush();
this.recalcInfo.recalculateBrush = false;
......
......@@ -200,6 +200,8 @@ function Slide(presentation, slideLayout, slideNum)
g_oTableId.Add(this, this.Id);
this.notesShape = null;
this.lastLayoutType = null;
this.lastLayoutMatchingName = null;
this.lastLayoutName = null;
......@@ -932,9 +934,7 @@ Slide.prototype =
this.recalculateSpTree();
this.recalcInfo.recalculateSpTree = false;
}
if(this.notes){
this.notes.recalculate();
}
this.recalculateNotesShape();
this.cachedImage = null;
},
......@@ -1009,6 +1009,28 @@ Slide.prototype =
this.cSld.spTree[i].recalculate();
},
recalculateNotesShape: function(){
AscFormat.ExecuteNoHistory(function(){
if(!this.notes){
this.notesShape = null;//ToDo: Create notes body shape
}
else{
this.notesShape = this.notes.getBodyShape();
}
if(this.notesShape){
var oDocContent = this.notesShape.getDocContent();
if(oDocContent){
this.notesShape.transformText.tx = 3;
this.notesShape.transformText.ty = 3;
this.notesShape.invertTransformText = AscCommon.global_MatrixTransformer.Invert(this.notesShape.transformText);
var Width = AscCommonSlide.GetNotesWidth();
oDocContent.Reset(0, 0, Width, 2000);
oDocContent.Recalculate_Page(0, true);
}
}
}, this, []);
},
draw: function(graphics)
{
DrawBackground(graphics, this.backgroundFill, this.Width, this.Height);
......@@ -1032,8 +1054,9 @@ Slide.prototype =
comments[i].draw(graphics);
}
}
if(this.notes){
this.notes.draw(graphics);
return;
if(this.notesShape){
this.notesShape.draw(graphics);
}
},
......
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