Commit 93dee393 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Номера слайдов в презентациях. Переделан метод Set_CurrentElement в CTitle для...

Номера слайдов в презентациях. Переделан метод Set_CurrentElement в CTitle для работы в редакторах документов и презентаций.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59825 954022d7-b5bf-4e40-9824-e11837661b57
parent 2ec1cbe1
...@@ -22159,42 +22159,63 @@ CTitle.prototype = ...@@ -22159,42 +22159,63 @@ CTitle.prototype =
Set_CurrentElement: function(bUpdate, pageIndex) Set_CurrentElement: function(bUpdate, pageIndex)
{ {
var chart = this.chart; var chart = this.chart, controller;
if(typeof editor !== "undefined" && editor && editor.WordControl && chart) if(chart && typeof editor !== "undefined" && editor && editor.WordControl && editor.WordControl.m_oLogicDocument)
{ {
var drawing_objects = editor.WordControl.m_oLogicDocument.DrawingObjects; var bDocument = false, bPresentation = false, drawing_objects;
drawing_objects.resetSelection(); if(editor.WordControl.m_oLogicDocument instanceof CDocument)
var para_drawing;
if(chart.group)
{ {
var main_group = chart.group.getMainGroup(); bDocument = true;
drawing_objects.selectObject(main_group, pageIndex); drawing_objects = editor.WordControl.m_oLogicDocument.DrawingObjects;
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); else if(editor.WordControl.m_oLogicDocument instanceof CPresentation)
if(hdr_ftr)
{ {
hdr_ftr.Content.CurPos.Type = docpostype_DrawingObjects; bPresentation = true;
hdr_ftr.Set_CurrentElement(bUpdate); if(chart.parent)
{
drawing_objects = chart.parent.graphicObject;
}
} }
else if(drawing_objects)
{ {
drawing_objects.document.CurPos.Type = docpostype_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;
}
if(bDocument && para_drawing instanceof ParaDrawing)
{
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;
}
}
} }
} }
}, },
...@@ -24576,6 +24597,13 @@ function CreateTextBodyFromString(str, drawingDocument, parent) ...@@ -24576,6 +24597,13 @@ function CreateTextBodyFromString(str, drawingDocument, parent)
function CreateDocContentFromString(str, drawingDocument, parent) function CreateDocContentFromString(str, drawingDocument, parent)
{ {
var content = new CDocumentContent(parent, drawingDocument, 0, 0, 0, 0, false, false, true); var content = new CDocumentContent(parent, drawingDocument, 0, 0, 0, 0, false, false, true);
AddToContentFromString(content, str);
return content;
}
function AddToContentFromString(content, str)
{
for(var i = 0; i < str.length; ++i) for(var i = 0; i < str.length; ++i)
{ {
var ch = str[i]; var ch = str[i];
...@@ -24598,7 +24626,6 @@ function CreateDocContentFromString(str, drawingDocument, parent) ...@@ -24598,7 +24626,6 @@ function CreateDocContentFromString(str, drawingDocument, parent)
content.Paragraph_Add(new ParaSpace(1), false ); content.Paragraph_Add(new ParaSpace(1), false );
} }
} }
return content;
} }
function CValAxisLabels(chart) function CValAxisLabels(chart)
......
...@@ -371,6 +371,40 @@ CTextBody.prototype = ...@@ -371,6 +371,40 @@ CTextBody.prototype =
}, },
getFieldText: function(fieldType, slide)
{
var ret = "";
if(this.parent && this.parent.isPlaceholder())
{
var _ph_type = this.parent.getPlaceholderType();
switch (_ph_type)
{
case phType_dt :
{
var _cur_date = new Date();
var _cur_year = _cur_date.getFullYear();
var _cur_month = _cur_date.getMonth();
var _cur_month_day = _cur_date.getDate();
//TODO: switch по fieldType
ret += (_cur_month_day > 9 ? _cur_month_day : "0" + _cur_month_day)
+ "." + ((_cur_month +1) > 9 ? (_cur_month + 1) : "0" + (_cur_month +1))
+ "." + _cur_year;
break;
}
case phType_sldNum :
{
if(slide instanceof Slide)
{
ret += "" + (slide.num+1);
}
break;
}
}
}
return ret;
},
recalculateBodyPr: function() recalculateBodyPr: function()
{ {
ExecuteNoHistory(function() ExecuteNoHistory(function()
......
...@@ -6788,9 +6788,18 @@ function BinaryPPTYLoader() ...@@ -6788,9 +6788,18 @@ function BinaryPPTYLoader()
_last_field_type = true; _last_field_type = true;
} }
} }
if(_last_field_type) if((this.TempMainObject instanceof Slide && shape.isPlaceholder() && (shape.getPlaceholderType() === phType_sldNum || shape.getPlaceholderType() === phType_dt)) && _last_field_type)
{ {
txbody.textFieldFlag = true; /// txbody.textFieldFlag = true;
var str_field = txbody.getFieldText(_last_field_type, this.TempMainObject);
if(str_field.length > 0)
{
txbody.content.Internal_Content_RemoveAll();
txbody.content.Internal_Content_Add(txbody.content.Content.length, new Paragraph(txbody.content.DrawingDocument, txbody.content, 0, 0, 0, 0, 0, true));
AddToContentFromString(txbody.content, str_field);
}
} }
break; break;
} }
...@@ -6813,7 +6822,7 @@ function BinaryPPTYLoader() ...@@ -6813,7 +6822,7 @@ function BinaryPPTYLoader()
txbody = shape.txPr; txbody = shape.txPr;
else else
{ {
shape.txPr = new CTextBody(shape); shape.txPr = new CTextBody();
txbody = shape.txPr; txbody = shape.txPr;
} }
var s = this.stream; var s = this.stream;
...@@ -6866,12 +6875,13 @@ function BinaryPPTYLoader() ...@@ -6866,12 +6875,13 @@ function BinaryPPTYLoader()
if(_last_field_type) if(_last_field_type)
{ {
txbody.textFieldFlag = true; // var str_field = txbody.getFieldText(_last_field_type);
// if(str_field.length > 0)
// {
// txbody.content.Internal_Content_RemoveAll();
// AddToContentFromString(txbody.content, str_field);
// }
} }
/*if(History != null)
{
History.TurnOn();
}*/
break; break;
} }
default: default:
......
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