Commit a204ddda 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@56854 954022d7-b5bf-4e40-9824-e11837661b57
parent ce30a9fc
......@@ -21538,6 +21538,71 @@ CTitle.prototype =
this.parent && this.parent.Refresh_RecalcData2 && this.parent.Refresh_RecalcData2(pageIndex, this);
},
Search : function(Str, Props, SearchEngine, Type)
{
var content = this.getDocContent();
if(content && this.tx && this.tx.rich)
{
var dd = this.getDrawingDocument();
dd.StartSearchTransform( this.transformText);
content.Search(Str, Props, SearchEngine, Type);
dd.EndSearchTransform();
}
},
Search_GetId : function(bNext, bCurrent)
{
var content = this.getDocContent();
if(content && this.tx && this.tx.rich)
{
return content.Search_GetId(bNext, bCurrent);
}
return null;
},
Set_CurrentElement: function(bUpdate, pageIndex)
{
var chart = this.chart;
if(editor && editor.WordControl && chart)
{
var drawing_objects = editor.WordControl.m_oLogicDocument.DrawingObjects;
drawing_objects.resetSelection();
var para_drawing;
if(chart.group)
{
var main_group = chart.group.getMainGroup();
drawing_objects.selectObject(main_group, pageIndex);
main_group.selectObject(chart, pageIndex);
main_group.selection.chartSelection = chart;
chart.selection.textSelection = this;
chart.selection.title = this;
drawing_objects.selection.groupSelection = main_group;
para_drawing = main_group.parent;
}
else
{
drawing_objects.selectObject(chart, pageIndex);
drawing_objects.selection.chartSelection = chart;
chart.selection.textSelection = this;
chart.selection.title = this;
para_drawing = chart.parent;
}
var hdr_ftr = para_drawing.DocumentContent.Is_HdrFtr(true);
if(hdr_ftr)
{
hdr_ftr.Content.CurPos.Type = docpostype_DrawingObjects;
hdr_ftr.Set_CurrentElement(bUpdate);
}
else
{
drawing_objects.document.CurPos.Type = docpostype_DrawingObjects;
}
}
},
createDuplicate: function()
{
var c = new CTitle();
......
......@@ -8085,8 +8085,66 @@ CChartSpace.prototype =
break;
}
}
}
},
Search : function(Str, Props, SearchEngine, Type)
{
var titles = this.getAllTitles();
for(var i = 0; i < titles.length; ++i)
{
titles[i].Search(Str, Props, SearchEngine, Type)
}
},
Search_GetId : function(bNext, bCurrent)
{
var Current = -1;
var titles = this.getAllTitles();
var Len = titles.length;
var Id = null;
if ( true === bCurrent )
{
for(var i = 0; i < Len; ++i)
{
if(titles[i] === this.selection.textSelection)
{
Current = i;
break;
}
}
}
if ( true === bNext )
{
var Start = ( -1 !== Current ? Current : 0 );
for ( var i = Start; i < Len; i++ )
{
if ( titles[i].Search_GetId )
{
Id = titles[i].Search_GetId(true, i === Current ? true : false);
if ( null !== Id )
return Id;
}
}
}
else
{
var Start = ( -1 !== Current ? Current : Len - 1 );
for ( var i = Start; i >= 0; i-- )
{
if (titles[i].Search_GetId )
{
Id = titles[i].Search_GetId(false, i === Current ? true : false);
if ( null !== Id )
return Id;
}
}
}
return null;
}
};
......
......@@ -885,6 +885,19 @@ CTextBody.prototype =
return new CNumbering();
},
Set_CurrentElement: function(bUpdate, pageIndex)
{
if(this.parent.Set_CurrentElement)
{
this.parent.Set_CurrentElement(bUpdate, pageIndex);
}
},
checkDocContent: function()
{
this.parent && this.parent.checkDocContent && this.parent.checkDocContent();
},
getBodyPr: function()
{
if(this.recalcInfo.recalculateBodyPr)
......@@ -976,8 +989,6 @@ CTextBody.prototype =
{},
Set_CurrentElement: function()
{},
writeToBinary: function(w)
{
this.bodyPr.Write_ToBinary2(w);
......
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