Commit 687656d7 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

(важно!) переделка записи/чтения на новые шейпы. Презентации тоже

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55984 954022d7-b5bf-4e40-9824-e11837661b57
parent c358ec44
......@@ -4845,23 +4845,22 @@ function BinaryPPTYLoader()
_stream.cur = s.cur;
_stream.size = s.size;
// _chart = new CChartSpace();
// var oBinaryChartReader = new BinaryChartReader(this.stream);
// oBinaryChartReader.ExternalReadCT_ChartSpace(length, _chart);
// if (_xfrm)
// {
// if (_chart.setXfrm)
// {
// _chart.setXfrm(_xfrm.offX, _xfrm.offY, _xfrm.extX, _xfrm.extY, _xfrm.rot, _xfrm.flipH, _xfrm.flipV);
// }
// else
// {
// _chart.setPosition(_xfrm.offX, _xfrm.offY);
// _chart.setExtents(_xfrm.extX, _xfrm.extY);
// }
// }
_chart = new CChartSpace();
var oBinaryChartReader = new BinaryChartReader(this.stream);
oBinaryChartReader.ExternalReadCT_ChartSpace(length, _chart);
if (_xfrm)
{
if (_chart.setXfrm)
{
_chart.setXfrm(_xfrm.offX, _xfrm.offY, _xfrm.extX, _xfrm.extY, _xfrm.rot, _xfrm.flipH, _xfrm.flipV);
}
else
{
_chart.setPosition(_xfrm.offX, _xfrm.offY);
_chart.setExtents(_xfrm.extX, _xfrm.extY);
}
}
s.Seek2(_pos + _length);
break;
}
......@@ -4946,16 +4945,16 @@ function BinaryPPTYLoader()
var _length = s.GetLong();
var _pos = s.cur;
if(typeof CChartAsGroup !== "undefined")
if(typeof CChartSpace !== "undefined")
{
var _stream = new FT_Stream2();
_stream.data = s.data;
_stream.pos = s.pos;
_stream.cur = s.cur;
_stream.size = s.size;
// _chart = new CChartSpace();
// var oBinaryChartReader = new BinaryChartReader(this.stream);
// oBinaryChartReader.ExternalReadCT_ChartSpace(length, _chart);
_chart = new CChartSpace();
var oBinaryChartReader = new BinaryChartReader(this.stream);
oBinaryChartReader.ExternalReadCT_ChartSpace(length, _chart);
}
s.Seek2(_pos + _length);
......
......@@ -1379,26 +1379,36 @@ function CBinaryFileWriter()
for (var i = 0; i < _len; i++)
{
oThis.StartRecord(0);
if (spTree[i] instanceof CShape)
{
oThis.WriteShape(spTree[i]);
}
else if(spTree[i] instanceof CImageShape)
{
oThis.WriteImage(spTree[i]);
}
else if (spTree[i] instanceof CGroupShape)
{
oThis.WriteGroupShape(spTree[i]);
}
else if (spTree[i] instanceof CGraphicFrame && spTree[i].graphicObject instanceof CTable)
{
oThis.WriteTable(spTree[i]);
}
else if (typeof CChartAsGroup != "undefined" && spTree[i] instanceof CChartAsGroup)
switch(spTree[i].getObjectType())
{
oThis.WriteChart(spTree[i]);
case historyitem_type_Shape:
{
oThis.WriteShape(spTree[i]);
break;
}
case historyitem_type_ImageShape:
{
oThis.WriteImage(spTree[i]);
break;
}
case historyitem_type_GroupShape:
{
oThis.WriteGroupShape(spTree[i]);
break;
}
case historyitem_type_ChartSpace:
{
oThis.WriteChart(spTree[i]);
break;
}
default:
{
if (spTree[i] instanceof CGraphicFrame && spTree[i].graphicObject instanceof CTable)
{
oThis.WriteTable(spTree[i]);
}
}
}
oThis.EndRecord();
......@@ -2608,7 +2618,7 @@ function CBinaryFileWriter()
oThis.UseContinueWriter = true;
var oBinaryChartWriter = new BinaryChartWriter(_memory);
oBinaryChartWriter.WriteChartContent(grObj);
oBinaryChartWriter.WriteCT_ChartSpace(grObj);
oThis.ImData = _memory.ImData;
oThis.data = _memory.data;
......@@ -2905,27 +2915,37 @@ function CBinaryFileWriter()
{
oThis.StartRecord(0);
if (spTree[i] instanceof CShape)
switch(spTree[i].getObjectType())
{
oThis.WriteShape(spTree[i]);
}
else if(spTree[i] instanceof CImageShape)
{
oThis.WriteImage(spTree[i]);
}
else if (spTree[i] instanceof CGroupShape)
{
oThis.WriteGroupShape(spTree[i]);
}
else if (spTree[i] instanceof CGraphicFrame && spTree[i].graphicObject instanceof CTable)
{
oThis.WriteTable(spTree[i]);
}
else if (typeof CChartAsGroup != "undefined" && spTree[i] instanceof CChartAsGroup)
{
oThis.WriteChart(spTree[i]);
case historyitem_type_Shape:
{
oThis.WriteShape(spTree[i]);
break;
}
case historyitem_type_ImageShape:
{
oThis.WriteImage(spTree[i]);
break;
}
case historyitem_type_GroupShape:
{
oThis.WriteGroupShape(spTree[i]);
break;
}
case historyitem_type_ChartSpace:
{
oThis.WriteChart(spTree[i]);
break;
}
default:
{
if (spTree[i] instanceof CGraphicFrame && spTree[i].graphicObject instanceof CTable)
{
oThis.WriteTable(spTree[i]);
}
}
}
oThis.EndRecord(0);
}
......
......@@ -1067,25 +1067,35 @@ function CPPTXContentWriter()
_writer.StartRecord(0);
var elem = spTree[i];
if ("undefined" !== typeof(WordShape) && elem instanceof WordShape)
switch(grObject.getObjectType())
{
this.WriteShape(elem, Document, oMapCommentId, oNumIdMap, copyParams);
}
else if ("undefined" !== typeof(CShape) && elem instanceof CShape)
{
this.WriteShape2(elem, Document, oMapCommentId, oNumIdMap, copyParams);
}
else if (("undefined" !== typeof(WordImage) && elem instanceof WordImage) || ("undefined" !== typeof(CImageShape) && elem instanceof CImageShape))
{
this.WriteImage(elem);
}
else if (("undefined" !== typeof(WordGroupShapes) && elem instanceof WordGroupShapes) || ("undefined" !== typeof(CGroupShape) && elem instanceof CGroupShape))
{
this.WriteGroup(elem, Document, oMapCommentId, oNumIdMap, copyParams);
}
else if ("undefined" !== typeof(CChartAsGroup) && elem instanceof CChartAsGroup)
{
this.BinaryFileWriter.WriteChart(elem);
case historyitem_type_Shape:
{
if(grObject.bWordShape)
{
this.WriteShape(elem, Document, oMapCommentId, oNumIdMap, copyParams);
}
else
{
this.WriteShape2(elem, Document, oMapCommentId, oNumIdMap, copyParams);
}
break;
}
case historyitem_type_ImageShape:
{
this.WriteImage(elem);
break;
}
case historyitem_type_GroupShape:
{
this.WriteGroup(elem, Document, oMapCommentId, oNumIdMap, copyParams);
break;
}
case historyitem_type_ChartSpace:
{
this.BinaryFileWriter.WriteChart(elem);
break;
}
}
_writer.EndRecord(0);
......
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