Commit 6befae03 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

убрал чтение тега alt, ранее использовавшееся для copy/paste графических объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57272 954022d7-b5bf-4e40-9824-e11837661b57
parent 79478d52
......@@ -4015,112 +4015,6 @@ PasteProcessor.prototype =
var src = node.getAttribute("src");
if(src)
this.oImages[src] = src;
var binary_shape = node.getAttribute("alt");
if(binary_shape)
{
var b_history_is_on = History.Is_On();
if(b_history_is_on)
History.TurnOff();
var sub;
var checkSheetsData;
if(typeof binary_shape === "string")
{
sub = binary_shape.substr(0, 12);
//чтобы не возникало ошибок при copy/paste из word в excel
checkSheetsData = binary_shape.substring(12, 18);
}
if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" || sub === "TeamLabChart" || sub === "TeamLabGroup") && checkSheetsData != "Sheets" && g_bIsDocumentCopyPaste)
{
var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length);
var first_string = null;
if(reader !== null && typeof reader === "object")
{
first_string = sub;
}
var Drawing;
var src_string;
switch(first_string)
{
case "TeamLabImage":
case "TeamLabChart":
{
Drawing = CreateParaDrawingFromBinary(reader, true);
if(isRealObject(Drawing)
&& isRealObject(Drawing.GraphicObj)
&& isRealObject(Drawing.GraphicObj.blipFill)
&& typeof Drawing.GraphicObj.blipFill.RasterImageId === "string")
{
src_string = Drawing.GraphicObj.blipFill.RasterImageId;
if(typeof src_string === "string")
this.oImages[src_string] = src_string;
}
break;
}
case "TeamLabShape":
case "TeamLabGroup":
{
Drawing = CreateParaDrawingFromBinary(reader, true);
if(isRealObject(Drawing) && isRealObject(Drawing.GraphicObj))
{
if(typeof Drawing.GraphicObj.isShape === "function" && Drawing.GraphicObj.isShape() === true)
{
if(isRealObject(Drawing.GraphicObj.spPr)
&& isRealObject(Drawing.GraphicObj.spPr.Fill)
&& isRealObject(Drawing.GraphicObj.spPr.Fill.fill)
&& typeof Drawing.GraphicObj.spPr.Fill.fill.RasterImageId === "string")
{
src_string = Drawing.GraphicObj.spPr.Fill.fill.RasterImageId;
if(typeof src_string === "string")
this.oImages[src_string] = src_string;
}
}
if(typeof Drawing.GraphicObj.isGroup === "function" && Drawing.GraphicObj.isGroup() === true)
{
var sp_tree = Drawing.GraphicObj.getSpTree2();
if(Array.isArray(sp_tree))
{
for(var index = 0; index < sp_tree.length; ++index)
{
var sp = sp_tree[index];
if(isRealObject(sp))
{
if(typeof sp.isImage === "function" && sp.isImage())
{
if(isRealObject(sp.blipFill) && typeof sp.blipFill.RasterImageId === "string")
{
src_string = sp.blipFill.RasterImageId;
if(typeof src_string === "string")
this.oImages[src_string] = src_string;
}
}
if(typeof sp.isShape === "function" && sp.isShape())
{
if(isRealObject(sp.spPr)
&& isRealObject(sp.spPr.Fill)
&& isRealObject(sp.spPr.Fill.fill)
&& typeof sp.spPr.Fill.fill.RasterImageId === "string")
{
src_string = sp.spPr.Fill.fill.RasterImageId;
if(typeof src_string === "string")
this.oImages[src_string] = src_string;
}
}
}
}
}
}
}
break;
}
}
}
if(b_history_is_on)
History.TurnOn();
}
}
}
for(var i = 0, length = node.childNodes.length; i < length; i++)
......@@ -5709,73 +5603,8 @@ PasteProcessor.prototype =
var oDrawingDocument = this.oDocument.DrawingDocument;
if(oTargetDocument && oDrawingDocument)
{
var binary_shape = node.getAttribute("alt");
var sub;
var checkSheetsData;
if(typeof binary_shape === "string")
{
sub = binary_shape.substr(0, 12);
//чтобы не возникало ошибок при copy/paste из word в excel
checkSheetsData = binary_shape.substring(12, 18);
}
if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" || sub === "TeamLabChart" || sub === "TeamLabGroup") && checkSheetsData != "Sheets")
{
var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length);
if(isRealObject(reader))
reader.oImages = this.oImages;
var first_string = null;
if(reader !== null && typeof reader === "object")
{
first_string = sub;
}
var Drawing;
switch(first_string)
{
case "TeamLabImage":
case "TeamLabChart":
{
Drawing = CreateParaDrawingFromBinary(reader);
break;
}
case "TeamLabShape":
case "TeamLabGroup":
{
if(this.oDocument.Is_TopDocument())
Drawing = CreateParaDrawingFromBinary(reader);
else
{
var cur_parent = this.oDocument;
if(cur_parent.Is_TableCellContent())
{
while(isRealObject(cur_parent) && cur_parent.Is_TableCellContent())
{
cur_parent = cur_parent.Parent.Row.Table.Parent;
}
}
if(cur_parent.Parent instanceof WordShape)
{
Drawing = CreateImageFromBinary(sSrc);
}
else
{
Drawing = CreateParaDrawingFromBinary(reader);
}
}
break;
}
default :
{
Drawing = CreateImageFromBinary(sSrc);
break;
}
}
}
else
{
Drawing = CreateImageFromBinary(sSrc, nWidth, nHeight);
// oTargetDocument.DrawingObjects.Add( Drawing );
}
Drawing = CreateImageFromBinary(sSrc, nWidth, nHeight);
// oTargetDocument.DrawingObjects.Add( Drawing );
this._Paragraph_Add( Drawing );
......@@ -5783,102 +5612,7 @@ PasteProcessor.prototype =
}
}
}
else if (nWidth && nHeight && AscBrowser.isIE)
{
var binary_shape = node.getAttribute("alt");
if (typeof binary_shape === "string")
{
nWidth = nWidth * g_dKoef_pix_to_mm;
nHeight = nHeight * g_dKoef_pix_to_mm;
//��������� � this.dMaxWidth
var bUseScaleKoef = this.bUseScaleKoef;
var dScaleKoef = this.dScaleKoef;
if(nWidth * dScaleKoef > this.dMaxWidth)
{
dScaleKoef = dScaleKoef * this.dMaxWidth / nWidth;
bUseScaleKoef = true;
}
if(bUseScaleKoef)
{
var dTemp = nWidth;
nWidth *= dScaleKoef;
nHeight *= dScaleKoef;
}
var oTargetDocument = this.oDocument;
var oDrawingDocument = this.oDocument.DrawingDocument;
if(oTargetDocument && oDrawingDocument)
{
var sub;
var checkSheetsData;
if(typeof binary_shape === "string")
{
sub = binary_shape.substr(0, 12);
//чтобы не возникало ошибок при copy/paste из word в excel
checkSheetsData = binary_shape.substring(12, 18);
}
if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" || sub === "TeamLabChart" || sub === "TeamLabGroup") && checkSheetsData != 'Sheets')
{
var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length);
if(isRealObject(reader))
reader.oImages = this.oImages;
var first_string = null;
if(reader !== null && typeof reader === "object")
{
first_string = sub;
}
var Drawing;
switch(first_string)
{
case "TeamLabImage":
case "TeamLabChart":
{
Drawing = CreateParaDrawingFromBinary(reader);
this._Paragraph_Add( Drawing );
break;
}
case "TeamLabShape":
case "TeamLabGroup":
{
if(this.oDocument.Is_TopDocument())
Drawing = CreateParaDrawingFromBinary(reader);
else
{
var cur_parent = this.oDocument;
if(cur_parent.Is_TableCellContent())
{
while(isRealObject(cur_parent) && cur_parent.Is_TableCellContent())
{
cur_parent = cur_parent.Parent.Row.Table.Parent;
}
}
if(cur_parent.Parent instanceof WordShape)
{
Drawing = CreateParaDrawingFromBinary(reader);
var bounds = Drawing.getBounds();
Drawing = CreateImageFromBinary2(Drawing.GraphicObj.getBase64Img(), bounds.r - bounds.l, bounds.b - bounds.t);
}
else
{
Drawing = CreateParaDrawingFromBinary(reader);
}
}
this._Paragraph_Add( Drawing );
break;
}
/* default :
{
Drawing = CreateImageFromBinary(sSrc);
break;
} */
}
}
//oDocument.Add_InlineImage(nWidth, nHeight, img);
}
}
}
return bAddParagraph;
}
else
......
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