Commit 14380bc8 authored by SergeyLuzyanin's avatar SergeyLuzyanin

notes search

parent 03afcc94
...@@ -1423,7 +1423,11 @@ CPresentation.prototype = ...@@ -1423,7 +1423,11 @@ CPresentation.prototype =
if(this.Slides.length > 0) if(this.Slides.length > 0)
{ {
var i, Id, content, start_index; var i, Id, content, start_index;
var target_text_object = AscFormat.getTargetTextObject(this.Slides[this.CurPage].graphicObjects); var target_text_object;
var oCommonController = this.GetCurrentController();
if(oCommonController){
target_text_object = AscFormat.getTargetTextObject(oCommonController);
}
if(target_text_object) if(target_text_object)
{ {
if(target_text_object.getObjectType() === AscDFH.historyitem_type_GraphicFrame) if(target_text_object.getObjectType() === AscDFH.historyitem_type_GraphicFrame)
...@@ -1448,6 +1452,7 @@ CPresentation.prototype = ...@@ -1448,6 +1452,7 @@ CPresentation.prototype =
} }
} }
var sp_tree = this.Slides[this.CurPage].cSld.spTree, group_shapes, group_start_index; var sp_tree = this.Slides[this.CurPage].cSld.spTree, group_shapes, group_start_index;
var bSkipCurNotes = false;
if(isNext) if(isNext)
{ {
if(this.Slides[this.CurPage].graphicObjects.selection.groupSelection) if(this.Slides[this.CurPage].graphicObjects.selection.groupSelection)
...@@ -1501,6 +1506,10 @@ CPresentation.prototype = ...@@ -1501,6 +1506,10 @@ CPresentation.prototype =
else if(this.Slides[this.CurPage].graphicObjects.selectedObjects.length === 0) else if(this.Slides[this.CurPage].graphicObjects.selectedObjects.length === 0)
{ {
start_index = 0; start_index = 0;
if(this.FocusOnNotes){
start_index = sp_tree.length;
bSkipCurNotes = true;
}
} }
else else
{ {
...@@ -1522,6 +1531,14 @@ CPresentation.prototype = ...@@ -1522,6 +1531,14 @@ CPresentation.prototype =
{ {
return Id; return Id;
} }
var oCurSlide = this.Slides[this.CurPage];
if(oCurSlide.notesShape && !bSkipCurNotes){
Id = oCurSlide.notesShape.Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
for(i = this.CurPage + 1; i < this.Slides.length; ++i) for(i = this.CurPage + 1; i < this.Slides.length; ++i)
{ {
Id = this.Slides[i].Search_GetId(isNext, 0); Id = this.Slides[i].Search_GetId(isNext, 0);
...@@ -1529,6 +1546,13 @@ CPresentation.prototype = ...@@ -1529,6 +1546,13 @@ CPresentation.prototype =
{ {
return Id; return Id;
} }
if(this.Slides[i].notesShape){
Id = this.Slides[i].notesShape.Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
} }
for(i = 0; i < this.CurPage; ++i) for(i = 0; i < this.CurPage; ++i)
{ {
...@@ -1537,7 +1561,15 @@ CPresentation.prototype = ...@@ -1537,7 +1561,15 @@ CPresentation.prototype =
{ {
return Id; return Id;
} }
if(this.Slides[i].notesShape){
Id = this.Slides[i].notesShape.Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
} }
} }
else else
{ {
...@@ -1586,7 +1618,7 @@ CPresentation.prototype = ...@@ -1586,7 +1618,7 @@ CPresentation.prototype =
} }
if(i === sp_tree.length) if(i === sp_tree.length)
{ {
start_index = sp_tree.length; start_index = -1;
} }
} }
else if(this.Slides[this.CurPage].graphicObjects.selectedObjects.length === 0) else if(this.Slides[this.CurPage].graphicObjects.selectedObjects.length === 0)
...@@ -1615,6 +1647,13 @@ CPresentation.prototype = ...@@ -1615,6 +1647,13 @@ CPresentation.prototype =
} }
for(i = this.CurPage - 1; i > -1; --i) for(i = this.CurPage - 1; i > -1; --i)
{ {
if(this.Slides[i].notesShape){
Id = this.Slides[i].notesShape.Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
Id = this.Slides[i].Search_GetId(isNext, this.Slides[i].cSld.spTree.length - 1); Id = this.Slides[i].Search_GetId(isNext, this.Slides[i].cSld.spTree.length - 1);
if(Id !== null) if(Id !== null)
{ {
...@@ -1623,6 +1662,13 @@ CPresentation.prototype = ...@@ -1623,6 +1662,13 @@ CPresentation.prototype =
} }
for(i = this.Slides.length - 1; i > this.CurPage; --i) for(i = this.Slides.length - 1; i > this.CurPage; --i)
{ {
if(this.Slides[i].notesShape){
Id = this.Slides[i].notesShape.Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
Id = this.Slides[i].Search_GetId(isNext, this.Slides[i].cSld.spTree.length - 1); Id = this.Slides[i].Search_GetId(isNext, this.Slides[i].cSld.spTree.length - 1);
if(Id !== null) if(Id !== null)
{ {
......
...@@ -770,31 +770,42 @@ CShape.prototype.getIsSingleBody = function(x, y) ...@@ -770,31 +770,42 @@ CShape.prototype.getIsSingleBody = function(x, y)
return true; return true;
}; };
CShape.prototype.Set_CurrentElement = function(bUpdate, pageIndex) CShape.prototype.Set_CurrentElement = function(bUpdate, pageIndex){
{ if(this.parent){
if(this.parent)
{
var drawing_objects = this.parent.graphicObjects; var drawing_objects = this.parent.graphicObjects;
drawing_objects.resetSelection(true); drawing_objects.resetSelection(true);
if(this.group) if(this.group){
{
var main_group = this.group.getMainGroup(); var main_group = this.group.getMainGroup();
drawing_objects.selectObject(main_group, 0); drawing_objects.selectObject(main_group, 0);
main_group.selectObject(this, 0); main_group.selectObject(this, 0);
main_group.selection.textSelection = this; main_group.selection.textSelection = this;
drawing_objects.selection.groupSelection = main_group; drawing_objects.selection.groupSelection = main_group;
} }
else else{
{
drawing_objects.selectObject(this, 0); drawing_objects.selectObject(this, 0);
drawing_objects.selection.textSelection = this; drawing_objects.selection.textSelection = this;
} }
//var content = this.getDocContent(); var nSlideNum;
//content && content.Set_StartPage(this.parent.num); if(this.parent instanceof AscCommonSlide.CNotes){
if(editor.WordControl.m_oLogicDocument.CurPage !== this.parent.num) editor.WordControl.m_oLogicDocument.FocusOnNotes = true;
{ if(this.parent.slide){
editor.WordControl.m_oLogicDocument.Set_CurPage(this.parent.num); nSlideNum = this.parent.slide.num;
editor.WordControl.GoToPage(this.parent.num); this.parent.slide.graphicObjects.resetSelection();
}
else{
nSlideNum = 0;
}
}
else{
nSlideNum = this.parent.num;
editor.WordControl.m_oLogicDocument.FocusOnNotes = false;
}
if(editor.WordControl.m_oLogicDocument.CurPage !== nSlideNum){
editor.WordControl.m_oLogicDocument.Set_CurPage(nSlideNum);
editor.WordControl.GoToPage(nSlideNum);
if(this.parent instanceof AscCommonSlide.CNotes){
editor.WordControl.m_oLogicDocument.FocusOnNotes = true;
}
} }
} }
}; };
......
...@@ -303,13 +303,15 @@ Slide.prototype = ...@@ -303,13 +303,15 @@ Slide.prototype =
}, },
Search: function( Str, Props, Engine, Type ) Search: function( Str, Props, Engine, Type ){
{
var sp_tree = this.cSld.spTree; var sp_tree = this.cSld.spTree;
for(var i = 0; i < sp_tree.length; ++i) for(var i = 0; i < sp_tree.length; ++i){
{ if (sp_tree[i].Search){
if (sp_tree[i].Search)
sp_tree[i].Search(Str, Props, Engine, Type); sp_tree[i].Search(Str, Props, Engine, Type);
}
}
if(this.notesShape){
this.notesShape.Search(Str, Props, Engine, Type);
} }
}, },
......
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