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,10 +22159,25 @@ CTitle.prototype =
Set_CurrentElement: function(bUpdate, pageIndex)
{
var chart = this.chart;
if(typeof editor !== "undefined" && editor && editor.WordControl && chart)
var chart = this.chart, controller;
if(chart && typeof editor !== "undefined" && editor && editor.WordControl && editor.WordControl.m_oLogicDocument)
{
var bDocument = false, bPresentation = false, drawing_objects;
if(editor.WordControl.m_oLogicDocument instanceof CDocument)
{
bDocument = true;
drawing_objects = editor.WordControl.m_oLogicDocument.DrawingObjects;
}
else if(editor.WordControl.m_oLogicDocument instanceof CPresentation)
{
bPresentation = true;
if(chart.parent)
{
drawing_objects = chart.parent.graphicObject;
}
}
if(drawing_objects)
{
var drawing_objects = editor.WordControl.m_oLogicDocument.DrawingObjects;
drawing_objects.resetSelection();
var para_drawing;
if(chart.group)
......@@ -22185,6 +22200,9 @@ CTitle.prototype =
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)
{
......@@ -22196,6 +22214,9 @@ CTitle.prototype =
drawing_objects.document.CurPos.Type = docpostype_DrawingObjects;
}
}
}
}
},
createDuplicate: function()
......@@ -24576,6 +24597,13 @@ function CreateTextBodyFromString(str, drawingDocument, parent)
function CreateDocContentFromString(str, drawingDocument, parent)
{
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)
{
var ch = str[i];
......@@ -24598,7 +24626,6 @@ function CreateDocContentFromString(str, drawingDocument, parent)
content.Paragraph_Add(new ParaSpace(1), false );
}
}
return content;
}
function CValAxisLabels(chart)
......
......@@ -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()
{
ExecuteNoHistory(function()
......
......@@ -6788,9 +6788,18 @@ function BinaryPPTYLoader()
_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;
var str_field = txbody.getFieldText(_last_field_type, this.TempMainObject);
if(str_field.length > 0)
{
txbody.textFieldFlag = true;
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;
}
......@@ -6813,7 +6822,7 @@ function BinaryPPTYLoader()
txbody = shape.txPr;
else
{
shape.txPr = new CTextBody(shape);
shape.txPr = new CTextBody();
txbody = shape.txPr;
}
var s = this.stream;
......@@ -6866,12 +6875,13 @@ function BinaryPPTYLoader()
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;
}
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