Commit f4e7d018 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix bugs in open/saving tables in presentation

parent b86f6286
......@@ -6008,6 +6008,11 @@ 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();
......@@ -6025,7 +6030,9 @@ function BinaryPPTYLoader()
fMaxBottomBorder = oBorders.Bottom.Size;
}
}
row.Set_Height(Math.max(1, fRowHeight - fMaxTopMargin - fMaxBottomMargin - fMaxTopBorder - fMaxBottomBorder), Asc.linerule_AtLeast);
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)
{
......
......@@ -3180,7 +3180,7 @@ function CBinaryFileWriter()
fMaxBottomBorder = oBorders.Bottom.Size;
}
}
oThis._WriteInt1(0, ( (row.Pr.Height.Value + fMaxBottomMargin + fMaxTopMargin + fMaxTopBorder + fMaxBottomBorder) * 36000) >> 0);
oThis._WriteInt1(0, ( (row.Pr.Height.Value + fMaxBottomMargin + fMaxTopMargin + fMaxTopBorder/2 + fMaxBottomBorder/2) * 36000) >> 0);
}
oThis.WriteUChar(g_nodeAttributeEnd);
......
......@@ -1382,21 +1382,29 @@ CPresentation.prototype =
Check_GraphicFrameRowHeight: function(grFrame)
{
grFrame.recalculate();
var content = grFrame.graphicObject.Content, i;
var content = grFrame.graphicObject.Content, i, j;
for(i = 0; i < content.length; ++i)
{
var ResultHeight;
ResultHeight = content[i].Height;
var FirstCell = content[i].Content[0];
if(FirstCell)
{
var oMargins = FirstCell.Get_Margins();
if(oMargins)
{
ResultHeight -= (oMargins.Top.W + oMargins.Bottom.W);
var row = content[i];
var fMaxTopMargin = 0, fMaxBottomMargin = 0, fMaxTopBorder = 0, fMaxBottomBorder = 0;
for(j = 0; j < row.Content.length; ++j){
var oCell = row.Content[j];
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;
}
}
content[i].Set_Height(ResultHeight, Asc.linerule_AtLeast );
row.Set_Height(row.Height - fMaxTopMargin - fMaxBottomMargin - fMaxTopBorder/2 - fMaxBottomBorder/2, Asc.linerule_AtLeast );
}
},
......
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