Commit 731929c3 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Поиск в презентациях

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58587 954022d7-b5bf-4e40-9824-e11837661b57
parent eecf969b
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
"../../Word/Editor/Table.js", "../../Word/Editor/Table.js",
"../../Word/Editor/Math.js", "../../Word/Editor/Math.js",
"../../Word/Editor/Spelling.js", "../../Word/Editor/Spelling.js",
"../../Word/Editor/Search.js",
"../../Word/Editor/FontClassification.js", "../../Word/Editor/FontClassification.js",
"../../PowerPoint/Editor/Format/ShapePrototype.js", "../../PowerPoint/Editor/Format/ShapePrototype.js",
"../../PowerPoint/Editor/Format/ImagePrototype.js", "../../PowerPoint/Editor/Format/ImagePrototype.js",
......
...@@ -247,24 +247,6 @@ CGroupShape.prototype = ...@@ -247,24 +247,6 @@ CGroupShape.prototype =
} }
}, },
getSearchResults : function(str, num)
{
var commonSearchResults = [];
for(var i = 0; i< this.arrGraphicObjects.length; ++i)
{
var searchResults;
if((searchResults = this.arrGraphicObjects[i].getSearchResults(str, i))!=null)
{
for(var j = 0; j < searchResults.length; ++j)
{
searchResults[j].shapeIndex = i;
}
commonSearchResults = commonSearchResults.concat(searchResults)
}
}
return commonSearchResults.length > 0 ? commonSearchResults : null;
},
getBoundsInGroup: function() getBoundsInGroup: function()
{ {
return getBoundsInGroup(this); return getBoundsInGroup(this);
......
...@@ -121,10 +121,6 @@ CImageShape.prototype = ...@@ -121,10 +121,6 @@ CImageShape.prototype =
return this.blipFill.RasterImageId; return this.blipFill.RasterImageId;
return null; return null;
}, },
getSearchResults: function()
{
return null;
},
isSimpleObject: function() isSimpleObject: function()
{ {
return true; return true;
......
...@@ -526,12 +526,24 @@ CShape.prototype = ...@@ -526,12 +526,24 @@ CShape.prototype =
this.textBoxContent.Search(Str, Props, SearchEngine, Type); this.textBoxContent.Search(Str, Props, SearchEngine, Type);
dd.EndSearchTransform(); dd.EndSearchTransform();
} }
else if(this.txBody && this.txBody.content)
{
//var dd = this.getDrawingDocument();
//dd.StartSearchTransform(this.transformText);
this.txBody.content.Search(Str, Props, SearchEngine, Type);
//dd.EndSearchTransform();
}
}, },
Search_GetId : function(bNext, bCurrent) Search_GetId : function(bNext, bCurrent)
{ {
if(this.textBoxContent) if(this.textBoxContent)
return this.textBoxContent.Search_GetId(bNext, bCurrent); return this.textBoxContent.Search_GetId(bNext, bCurrent);
else if(this.txBody && this.txBody.content)
{
return this.txBody.content.Search_GetId(bNext, bCurrent);
}
return null; return null;
}, },
......
...@@ -117,11 +117,6 @@ function CTextBody() ...@@ -117,11 +117,6 @@ function CTextBody()
CTextBody.prototype = CTextBody.prototype =
{ {
getSearchResults : function(str)
{
return this.content != null ? this.content.getSearchResults(str) : [];
},
createDuplicate: function() createDuplicate: function()
{ {
var ret = new CTextBody(); var ret = new CTextBody();
......
...@@ -154,6 +154,24 @@ CGraphicFrame.prototype = ...@@ -154,6 +154,24 @@ CGraphicFrame.prototype =
return historyitem_type_GraphicFrame; return historyitem_type_GraphicFrame;
}, },
Search : function(Str, Props, SearchEngine, Type)
{
if(this.graphicObject)
{
this.graphicObject.Search(Str, Props, SearchEngine, Type);
}
},
Search_GetId : function(bNext, bCurrent)
{
if(this.graphicObject)
{
return this.graphicObject.Search_GetId(bNext, bCurrent);
}
return null;
},
copy: function() copy: function()
{ {
var ret = new CGraphicFrame(); var ret = new CGraphicFrame();
...@@ -227,67 +245,6 @@ CGraphicFrame.prototype = ...@@ -227,67 +245,6 @@ CGraphicFrame.prototype =
} }
}, },
getSearchResults: function(str)
{
if(this.graphicObject instanceof CTable)
{
var ret = [];
var rows = this.graphicObject.Content;
for(var i = 0; i < rows.length; ++i)
{
var cells = rows[i].Content;
for(var j = 0; j < cells.length; ++j)
{
var cell = cells[j];
var s_arr = cell.Content.getSearchResults(str);
if(Array.isArray(s_arr) && s_arr.length > 0)
{
for(var t = 0; t < s_arr.length; ++t)
{
var s = {};
s.id = STATES_ID_TEXT_ADD;
s.textObject = this;
var TableState = {};
TableState.Selection =
{
Start : true,
Use : true,
StartPos :
{
Pos : { Row : i, Cell : j },
X : this.graphicObject.Selection.StartPos.X,
Y : this.graphicObject.Selection.StartPos.Y
},
EndPos :
{
Pos : { Row : i, Cell : j },
X : this.graphicObject.Selection.EndPos.X,
Y : this.graphicObject.Selection.EndPos.Y
},
Type : table_Selection_Text,
Data : null,
Type2 : table_Selection_Common,
Data2 : null
};
TableState.Selection.Data = [];
TableState.CurCell = { Row : i, Cell : j};
s_arr[t].push( TableState );
s.textSelectionState = s_arr[t];
ret.push(s);
}
}
}
}
return ret;
}
return [];
},
hitInPath: function() hitInPath: function()
{ {
return false; return false;
...@@ -771,15 +728,17 @@ CGraphicFrame.prototype = ...@@ -771,15 +728,17 @@ CGraphicFrame.prototype =
if(this.group) if(this.group)
{ {
var main_group = this.group.getMainGroup(); var main_group = this.group.getMainGroup();
this.parent.graphicObjects.selectObject(main_group, this.parent.num); this.parent.graphicObjects.selectObject(main_group, 0);
main_group.selectObject(this, this.parent.num); main_group.selectObject(this, this.parent.num);
main_group.selection.textSelection = this; main_group.selection.textSelection = this;
} }
else else
{ {
this.parent.graphicObjects.selectObject(this, this.parent.num); this.parent.graphicObjects.selectObject(this, 0);
this.parent.graphicObjects.selection.textSelection = this; this.parent.graphicObjects.selection.textSelection = this;
} }
editor.WordControl.m_oLogicDocument.Set_CurPage(this.parent.num);
editor.WordControl.GoToPage(this.parent.num);
} }
}, },
......
...@@ -44,6 +44,8 @@ CImageShape.prototype.recalcBrush = function() ...@@ -44,6 +44,8 @@ CImageShape.prototype.recalcBrush = function()
this.recalcInfo.recalculateBrush = true; this.recalcInfo.recalculateBrush = true;
}; };
CImageShape.prototype.recalcPen = function() CImageShape.prototype.recalcPen = function()
{ {
this.recalcInfo.recalculatePen = true; this.recalcInfo.recalculatePen = true;
......
This diff is collapsed.
...@@ -742,6 +742,32 @@ CShape.prototype.getIsSingleBody = function(x, y) ...@@ -742,6 +742,32 @@ CShape.prototype.getIsSingleBody = function(x, y)
return true; return true;
}; };
CShape.prototype.Set_CurrentElement = function(bUpdate, pageIndex)
{
if(this.parent)
{
var drawing_objects = this.parent.graphicObjects;
drawing_objects.resetSelection();
if(this.group)
{
var main_group = this.group.getMainGroup();
drawing_objects.selectObject(main_group, 0);
main_group.selectObject(this, 0);
main_group.selection.textSelection = this;
drawing_objects.selection.groupSelection = main_group;
}
else
{
drawing_objects.selectObject(this, 0);
drawing_objects.selection.textSelection = this;
}
//var content = this.getDocContent();
//content && content.Set_StartPage(this.parent.num);
editor.WordControl.m_oLogicDocument.Set_CurPage(this.parent.num);
editor.WordControl.GoToPage(this.parent.num);
}
};
CTextBody.prototype.Get_Worksheet = function() CTextBody.prototype.Get_Worksheet = function()
{ {
return this.parent && this.parent.Get_Worksheet && this.parent.Get_Worksheet(); return this.parent && this.parent.Get_Worksheet && this.parent.Get_Worksheet();
......
...@@ -121,6 +121,49 @@ Slide.prototype = ...@@ -121,6 +121,49 @@ Slide.prototype =
}, },
Search: function( Str, Props, Engine, Type )
{
var sp_tree = this.cSld.spTree;
for(var i = 0; i < sp_tree.length; ++i)
{
sp_tree[i].Search(Str, Props, Engine, Type);
}
},
Search_GetId: function(isNext, StartPos)
{
var sp_tree = this.cSld.spTree, i, Id;
if(isNext)
{
for(i = StartPos; i < sp_tree.length; ++i)
{
if(sp_tree[i].Search_GetId)
{
Id = sp_tree[i].Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
}
}
else
{
for(i = StartPos; i > -1; --i)
{
if(sp_tree[i].Search_GetId)
{
Id = sp_tree[i].Search_GetId(isNext, false);
if(Id !== null)
{
return Id;
}
}
}
}
return null;
},
getMatchingShape: function(type, idx, bSingleBody) getMatchingShape: function(type, idx, bSingleBody)
{ {
var _input_reduced_type; var _input_reduced_type;
......
...@@ -1660,8 +1660,18 @@ asc_docs_api.prototype.stopSearchText = function(){ ...@@ -1660,8 +1660,18 @@ asc_docs_api.prototype.stopSearchText = function(){
this.WordControl.m_oLogicDocument.Search_Stop(); this.WordControl.m_oLogicDocument.Search_Stop();
} }
asc_docs_api.prototype.findText = function(text, scanForward){ asc_docs_api.prototype.findText = function(text, isNext){
return this.WordControl.m_oLogicDocument.findText(text, scanForward);
var SearchEngine = editor.WordControl.m_oLogicDocument.Search(text, {MatchCase: false});
var Id = this.WordControl.m_oLogicDocument.Search_GetId( isNext );
if ( null != Id )
this.WordControl.m_oLogicDocument.Search_Select( Id );
return SearchEngine.Count;
//return this.WordControl.m_oLogicDocument.findText(text, scanForward);
} }
asc_docs_api.prototype.asc_searchEnabled = function(bIsEnabled) asc_docs_api.prototype.asc_searchEnabled = function(bIsEnabled)
......
...@@ -219,6 +219,7 @@ ...@@ -219,6 +219,7 @@
<script src="../../../../OfficeWeb/Word/Editor/Table.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Table.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Math.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Math.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Spelling.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Spelling.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Search.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/FontClassification.js"></script> <script src="../../../../OfficeWeb/Word/Editor/FontClassification.js"></script>
......
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