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() ...@@ -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){ for(i = 0; i < row.Content.length; ++i){
var oCell = row.Content[i]; var oCell = row.Content[i];
var oMargins = oCell.Get_Margins(); var oMargins = oCell.Get_Margins();
...@@ -6025,7 +6030,9 @@ function BinaryPPTYLoader() ...@@ -6025,7 +6030,9 @@ function BinaryPPTYLoader()
fMaxBottomBorder = oBorders.Bottom.Size; 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) if (row.Content.length == _count)
{ {
......
...@@ -3180,7 +3180,7 @@ function CBinaryFileWriter() ...@@ -3180,7 +3180,7 @@ function CBinaryFileWriter()
fMaxBottomBorder = oBorders.Bottom.Size; 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); oThis.WriteUChar(g_nodeAttributeEnd);
......
...@@ -1382,21 +1382,29 @@ CPresentation.prototype = ...@@ -1382,21 +1382,29 @@ CPresentation.prototype =
Check_GraphicFrameRowHeight: function(grFrame) Check_GraphicFrameRowHeight: function(grFrame)
{ {
grFrame.recalculate(); grFrame.recalculate();
var content = grFrame.graphicObject.Content, i; var content = grFrame.graphicObject.Content, i, j;
for(i = 0; i < content.length; ++i) for(i = 0; i < content.length; ++i)
{ {
var ResultHeight; var row = content[i];
ResultHeight = content[i].Height; var fMaxTopMargin = 0, fMaxBottomMargin = 0, fMaxTopBorder = 0, fMaxBottomBorder = 0;
var FirstCell = content[i].Content[0]; for(j = 0; j < row.Content.length; ++j){
if(FirstCell) var oCell = row.Content[j];
{ var oMargins = oCell.Get_Margins();
var oMargins = FirstCell.Get_Margins(); if(oMargins.Bottom.W > fMaxBottomMargin){
if(oMargins) fMaxBottomMargin = oMargins.Bottom.W;
{ }
ResultHeight -= (oMargins.Top.W + 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