Commit a0bbd7e0 authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander.Trofimov

Для w:object реализовано чтение картинки из бинарника

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60184 954022d7-b5bf-4e40-9824-e11837661b57
parent a1f573a6
...@@ -7688,26 +7688,10 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7688,26 +7688,10 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
} }
else if(c_oSerRunType.pptxDrawing === type) else if(c_oSerRunType.pptxDrawing === type)
{ {
var doc = this.Document; var oDrawing = new Object();
var oParaDrawing = new ParaDrawing(null, null, null, doc.DrawingDocument, doc, oParStruct.paragraph); this.ReadDrawing (type, length, oParStruct, oDrawing, res);
res = this.bcr.Read2(length, function(t, l){ if(null != oDrawing.content.GraphicObj)
return oThis.ReadPptxDrawing(t, l, oParaDrawing); oNewElem = oDrawing.content;
});
if(null != oParaDrawing.SimplePos)
oParaDrawing.setSimplePos(oParaDrawing.SimplePos.Use, oParaDrawing.SimplePos.X, oParaDrawing.SimplePos.Y);
if(null != oParaDrawing.Extent)
oParaDrawing.setExtent(oParaDrawing.Extent.W, oParaDrawing.Extent.H);
if(null != oParaDrawing.wrappingPolygon)
oParaDrawing.addWrapPolygon(oParaDrawing.wrappingPolygon);
if(editor.WordControl.m_oLogicDocument.DrawingObjects)
editor.WordControl.m_oLogicDocument.DrawingObjects.arrForCalculateAfterOpen.push(oParaDrawing);
oParaDrawing.init();
//TODO некорректная проверка typeof
if(drawing_Anchor == oParaDrawing.DrawingType && typeof History.RecalcData_Add === "function")
History.RecalcData_Add( { Type : historyrecalctype_Flow, Data : oParaDrawing});
if(null != oParaDrawing.GraphicObj)
oNewElem = oParaDrawing;
} }
else if(c_oSerRunType.table === type) else if(c_oSerRunType.table === type)
{ {
...@@ -7786,6 +7770,30 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7786,6 +7770,30 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
} }
return res; return res;
}; };
this.ReadDrawing = function (type, length, oParStruct, oDrawing, res)
{
var oThis = this;
var doc = this.Document;
var oParaDrawing = new ParaDrawing(null, null, null, doc.DrawingDocument, doc, oParStruct.paragraph);
res = this.bcr.Read2(length, function(t, l){
return oThis.ReadPptxDrawing(t, l, oParaDrawing);
});
if(null != oParaDrawing.SimplePos)
oParaDrawing.setSimplePos(oParaDrawing.SimplePos.Use, oParaDrawing.SimplePos.X, oParaDrawing.SimplePos.Y);
if(null != oParaDrawing.Extent)
oParaDrawing.setExtent(oParaDrawing.Extent.W, oParaDrawing.Extent.H);
if(null != oParaDrawing.wrappingPolygon)
oParaDrawing.addWrapPolygon(oParaDrawing.wrappingPolygon);
if(editor.WordControl.m_oLogicDocument.DrawingObjects)
editor.WordControl.m_oLogicDocument.DrawingObjects.arrForCalculateAfterOpen.push(oParaDrawing);
oParaDrawing.init();
//TODO некорректная проверка typeof
if(drawing_Anchor == oParaDrawing.DrawingType && typeof History.RecalcData_Add === "function")
History.RecalcData_Add( { Type : historyrecalctype_Flow, Data : oParaDrawing});
oDrawing.content = oParaDrawing;
}
this.ReadObject = function (type, length, oParStruct) this.ReadObject = function (type, length, oParStruct)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
...@@ -7802,6 +7810,19 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7802,6 +7810,19 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
}); });
} }
} }
else if(c_oSerRunType.pptxDrawing === type)
{
var oNewElem = null;
var oDrawing = new Object();
this.ReadDrawing (type, length, oParStruct, oDrawing, res);
if(null != oDrawing.content.GraphicObj)
oNewElem = oDrawing.content;
var oNewRun = new ParaRun(oParStruct.paragraph);
oNewRun.Add_ToContent(0, oNewElem, false);
oParStruct.addToContent(oNewRun);
}
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
......
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