Commit 0824f20f authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

PresProps

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66762 954022d7-b5bf-4e40-9824-e11837661b57
parent 0b7fd45d
......@@ -548,6 +548,12 @@ function BinaryPPTYLoader()
s.Seek2(_main_tables["6"]);
this.presentation.TableStyles = this.ReadTableStyles();
}
if (undefined != _main_tables["7"])
{
// presprops
s.Seek2(_main_tables["7"]);
this.ReadPresProps(this.presentation);
}
}
if (undefined != _main_tables["20"])
......@@ -911,6 +917,235 @@ function BinaryPPTYLoader()
{
return null;
}
this.ReadPresProps = function(presentation)
{
var s = this.stream;
var _type = s.GetUChar();
var _rec_start = s.cur;
var _end_rec = _rec_start + s.GetLong() + 4;
while (s.cur < _end_rec)
{
var _at = s.GetUChar();
switch (_at)
{
case 0:
{
s.SkipRecord();
break;
}
case 1:
{
presentation.showPr = this.ReadShowPr();
break;
}
default:
break;
}
}
s.Seek2(_end_rec);
}
this.ReadShowPr = function()
{
var showPr = new CShowPr();
var s = this.stream;
var _rec_start = s.cur;
var _end_rec = _rec_start + s.GetLong() + 4;
s.Skip2(1); // start attributes
while (true)
{
var _at = s.GetUChar();
if (_at == g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
showPr.loop = s.GetBool();
break;
}
case 1:
{
showPr.showAnimation = s.GetBool();
break;
}
case 2:
{
showPr.showNarration = s.GetBool();
break;
}
case 3:
{
showPr.useTimings = s.GetBool();
break;
}
default:
break;
}
}
while (s.cur < _end_rec)
{
var _at = s.GetUChar();
switch (_at)
{
case 0:
{
//todo browseShowScrollbar
showPr.browse = true;
s.SkipRecord();
break;
}
case 1:
{
this.ReadShowPrCustShow(showPr);
break;
}
case 2:
{
this.ReadShowPrKiosk(showPr);
break;
}
case 3:
{
showPr.penClr = this.ReadUniColor();
break;
}
case 4:
{
showPr.present = true;
s.SkipRecord();
break;
}
case 5:
{
if (!showPr.show){
showPr.show = {showAll: null, range: null, custShow: null};
}
showPr.show.showAll = true;
s.SkipRecord();
break;
}
case 6:
{
this.ReadShowPrSldRg(showPr);
break;
}
default:
break;
}
}
s.Seek2(_end_rec);
return showPr;
}
this.ReadShowPrCustShow = function(showPr)
{
var s = this.stream;
var _rec_start = s.cur;
var _end_rec = _rec_start + s.GetLong() + 4;
s.Skip2(1); // start attributes
while (true)
{
var _at = s.GetUChar();
if (_at == g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
if (!showPr.show){
showPr.show = {showAll: null, range: null, custShow: null};
}
showPr.show.custShow = s.GetLong();
break;
}
default:
break;
}
}
s.Seek2(_end_rec);
}
this.ReadShowPrKiosk = function(showPr)
{
showPr.kiosk = {restart: null};
var s = this.stream;
var _rec_start = s.cur;
var _end_rec = _rec_start + s.GetLong() + 4;
s.Skip2(1); // start attributes
while (true)
{
var _at = s.GetUChar();
if (_at == g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
showPr.kiosk.restart = s.GetLong();
break;
}
default:
break;
}
}
s.Seek2(_end_rec);
}
this.ReadShowPrSldRg = function(showPr)
{
if (!showPr.show){
showPr.show = {showAll: null, range: null, custShow: null};
}
showPr.show.range = {start: null, end: null};
var s = this.stream;
var _rec_start = s.cur;
var _end_rec = _rec_start + s.GetLong() + 4;
s.Skip2(1); // start attributes
while (true)
{
var _at = s.GetUChar();
if (_at == g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
showPr.show.range.start = s.GetLong();
break;
}
case 1:
{
showPr.show.range.end = s.GetLong();
break;
}
default:
break;
}
}
s.Seek2(_end_rec);
}
this.ReadTableStyles = function()
{
//var _styles = this.presentation.globalTableStyles;
......
......@@ -8,6 +8,7 @@ var c_oMainTables = {
ViewProps : 4,
VmlDrawing : 5,
TableStyles : 6,
PresProps : 7,
Themes : 20,
ThemeOverride : 21,
......@@ -430,7 +431,10 @@ function CBinaryFileWriter()
// ViewProps
if (presentation.ViewProps)
this.WriteViewProps(presentation.ViewProps);
// PresProps
this.WritePresProps(presentation);
// presentation
this.WritePresentation(presentation);
......@@ -769,6 +773,64 @@ function CBinaryFileWriter()
this.StartRecord(c_oMainTables.ViewProps);
this.EndRecord();
}
this.WritePresProps = function(presentation)
{
this.StartMainRecord(c_oMainTables.PresProps);
this.StartRecord(c_oMainTables.PresProps);
//showPr
var showPr = presentation.showPr;
if (showPr) {
this.StartRecord(1);
this.WriteUChar(g_nodeAttributeStart);
this._WriteBool2(0, showPr.loop);
this._WriteBool2(1, showPr.showAnimation);
this._WriteBool2(2, showPr.showNarration);
this._WriteBool2(3, showPr.useTimings);
this.WriteUChar(g_nodeAttributeEnd);
if (showPr.browse) {
this.StartRecord(0);
//todo browseShowScrollbar
this.EndRecord();
}
if (showPr.show && null != showPr.show.custShow) {
this.StartRecord(1);
this.WriteUChar(g_nodeAttributeStart);
this._WriteInt2(0, showPr.show.custShow);
this.WriteUChar(g_nodeAttributeEnd);
this.EndRecord();
}
if (showPr.kiosk) {
this.StartRecord(2);
this.WriteUChar(g_nodeAttributeStart);
this._WriteInt2(0, showPr.kiosk.restart);
this.WriteUChar(g_nodeAttributeEnd);
this.EndRecord();
}
this.WriteRecord1(3, showPr.penClr, this.WriteUniColor);
if (showPr.present) {
this.StartRecord(4);
this.EndRecord();
}
if (showPr.show && null != showPr.show.showAll) {
this.StartRecord(5);
this.EndRecord();
}
if (showPr.show.range && null != showPr.show.range.start && null != showPr.show.range.end) {
this.StartRecord(6);
this.WriteUChar(g_nodeAttributeStart);
this._WriteInt2(0, showPr.show.range.start);
this._WriteInt2(1, showPr.show.range.end);
this.WriteUChar(g_nodeAttributeEnd);
this.EndRecord();
}
this.EndRecord();
}
this.EndRecord();
}
this.WritePresentation = function(presentation)
{
......
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