Commit 3cad6ab0 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix crash, when we insert table from presentation editor into doc or spreadsheet editors

parent 038f33c9
......@@ -1151,7 +1151,7 @@
//отдельная обработка для вставки таблички из презентаций
if(data.Drawings.length === 1 && typeof CGraphicFrame !== "undefined" && drawingObject.graphicObject instanceof CGraphicFrame)
if(data.Drawings.length === 1 && typeof AscFormat.CGraphicFrame !== "undefined" && drawingObject.graphicObject instanceof AscFormat.CGraphicFrame)
{
//вставляем табличку из презентаций
var oPasteFromBinaryWord = new pasteFromBinaryWord(this, ws);
......
......@@ -6008,48 +6008,32 @@ function BinaryPPTYLoader()
}
}
var bLoadVal = AscCommon.g_oIdCounter.m_bLoad;
var bRead = AscCommon.g_oIdCounter.m_bRead;
AscCommon.g_oIdCounter.m_bLoad = false;
AscCommon.g_oIdCounter.m_bRead = false;
for(i = 0; i < row.Content.length; ++i){
var oCell = row.Content[i];
var oMargins = oCell.Get_Margins();
if(oMargins.Bottom.W > fMaxBottomMargin){
fMaxBottomMargin = oMargins.Bottom.W;
}
if(oMargins.Top.W > fMaxTopMargin){
fMaxTopMargin = oMargins.Top.W;
}
var oBorders = oCell.Get_Borders();
if(oBorders.Top.Size > fMaxTopBorder){
fMaxTopBorder = oBorders.Top.Size;
}
if(oBorders.Bottom.Size > fMaxBottomBorder){
fMaxBottomBorder = oBorders.Bottom.Size;
}
}
AscCommon.g_oIdCounter.m_bLoad = bLoadVal;
AscCommon.g_oIdCounter.m_bRead = bRead;
row.Set_Height(Math.max(1, fRowHeight - fMaxTopMargin - fMaxBottomMargin - fMaxTopBorder/2 - fMaxBottomBorder/2), Asc.linerule_AtLeast);
/*
if (row.Content.length == _count)
{
for (var i = 0; i < _count; i++)
{
s.Skip2(1);
var bIsNoHMerge = this.ReadCell(row.Content[i]);
if (bIsNoHMerge === false)
{
row.Remove_Cell(i);
i--;
_count--;
if(this.presentation && Array.isArray(this.presentation.Slides)){
var bLoadVal = AscCommon.g_oIdCounter.m_bLoad;
var bRead = AscCommon.g_oIdCounter.m_bRead;
AscCommon.g_oIdCounter.m_bLoad = false;
AscCommon.g_oIdCounter.m_bRead = false;
for(i = 0; i < row.Content.length; ++i){
var oCell = row.Content[i];
var oMargins = oCell.Get_Margins();
if(oMargins.Bottom.W > fMaxBottomMargin){
fMaxBottomMargin = oMargins.Bottom.W;
}
if(oMargins.Top.W > fMaxTopMargin){
fMaxTopMargin = oMargins.Top.W;
}
var oBorders = oCell.Get_Borders();
if(oBorders.Top.Size > fMaxTopBorder){
fMaxTopBorder = oBorders.Top.Size;
}
if(oBorders.Bottom.Size > fMaxBottomBorder){
fMaxBottomBorder = oBorders.Bottom.Size;
}
}
AscCommon.g_oIdCounter.m_bLoad = bLoadVal;
AscCommon.g_oIdCounter.m_bRead = bRead;
row.Set_Height(Math.max(1, fRowHeight - fMaxTopMargin - fMaxBottomMargin - fMaxTopBorder/2 - fMaxBottomBorder/2), Asc.linerule_AtLeast);
}
*/
s.Seek2(_end_rec);
}
......
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