Commit 59f2399f authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

x2t:убраны заглушки на открытие/сохранение процентов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68890 954022d7-b5bf-4e40-9824-e11837661b57
parent 813a0539
...@@ -379,7 +379,8 @@ var c_oSerExtent = { ...@@ -379,7 +379,8 @@ var c_oSerExtent = {
var c_oSerPosHV = { var c_oSerPosHV = {
RelativeFrom: 0, RelativeFrom: 0,
Align: 1, Align: 1,
PosOffset: 2 PosOffset: 2,
PctOffset: 3
}; };
var c_oSerSimplePos = { var c_oSerSimplePos = {
X: 0, X: 0,
...@@ -3382,25 +3383,24 @@ Binary_tblPrWriter.prototype = ...@@ -3382,25 +3383,24 @@ Binary_tblPrWriter.prototype =
}, },
WriteW: function(WAfter) WriteW: function(WAfter)
{ {
if(tblwidth_Pct != WAfter.Type) //Type
if(null != WAfter.Type)
{ {
//Type this.memory.WriteByte(c_oSerWidthType.Type);
if(null != WAfter.Type) this.memory.WriteByte(c_oSerPropLenType.Byte);
{ this.memory.WriteByte(WAfter.Type);
this.memory.WriteByte(c_oSerWidthType.Type); }
this.memory.WriteByte(c_oSerPropLenType.Byte); //W
this.memory.WriteByte(WAfter.Type); if(null != WAfter.W)
} {
//W var nVal = WAfter.W;
if(null != WAfter.W) if(tblwidth_Mm == WAfter.Type)
{ nVal = Math.round(g_dKoef_mm_to_twips * WAfter.W);
var nVal = WAfter.W; else if(tblwidth_Pct == WAfter.Type)
if(tblwidth_Mm == WAfter.Type) nVal = Math.round(100 * WAfter.W / 2);
nVal = Math.round(g_dKoef_mm_to_twips * WAfter.W); this.memory.WriteByte(c_oSerWidthType.WDocx);
this.memory.WriteByte(c_oSerWidthType.WDocx); this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteLong(nVal);
this.memory.WriteLong(nVal);
}
} }
}, },
WriteCellPr: function(cellPr, vMerge, cell) WriteCellPr: function(cellPr, vMerge, cell)
...@@ -4359,7 +4359,11 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -4359,7 +4359,11 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
else else
{ {
this.memory.WriteByte(c_oSerPosHV.PosOffset); if (true == PositionH.Percent) {
this.memory.WriteByte(c_oSerPosHV.PctOffset);
} else {
this.memory.WriteByte(c_oSerPosHV.PosOffset);
}
this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble(PositionH.Value); this.memory.WriteDouble(PositionH.Value);
} }
...@@ -7101,6 +7105,8 @@ Binary_tblPrReader.prototype = ...@@ -7101,6 +7105,8 @@ Binary_tblPrReader.prototype =
{ {
if(tblwidth_Mm == input.Type) if(tblwidth_Mm == input.Type)
output.W = g_dKoef_twips_to_mm * input.WDocx; output.W = g_dKoef_twips_to_mm * input.WDocx;
else if(tblwidth_Pct == input.Type)
output.W = 2 * input.WDocx / 100;
else else
output.W = input.WDocx; output.W = input.WDocx;
} }
...@@ -8751,6 +8757,11 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -8751,6 +8757,11 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
PositionH.Align = false; PositionH.Align = false;
PositionH.Value = this.bcr.ReadDouble(); PositionH.Value = this.bcr.ReadDouble();
} }
else if( c_oSerPosHV.PctOffset === type )
{
PositionH.Percent = true;
PositionH.Value = this.bcr.ReadDouble();
}
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