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

(2.0.0.136): AVSOfficeDocxFile2

paragraph FramePr чтение/запись

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48376 954022d7-b5bf-4e40-9824-e11837661b57
parent e853ca75
......@@ -165,7 +165,8 @@ var c_oSerProp_pPrType = {
pPr_rPr: 26,
pBdr: 27,
Spacing_BeforeAuto: 28,
Spacing_AfterAuto: 29
Spacing_AfterAuto: 29,
FramePr: 30
};
var c_oSerProp_rPrType = {
Bold:0,
......@@ -449,6 +450,22 @@ var c_oSer_ClrSchemeMappingType = {
T1: 10,
T2: 11
};
var c_oSer_FramePrType = {
DropCap: 0,
H: 1,
HAnchor: 2,
HRule: 3,
HSpace: 4,
Lines: 5,
VAnchor: 6,
VSpace: 7,
W: 8,
Wrap: 9,
X: 10,
XAlign: 11,
Y: 12,
YAlign: 13
};
var ETblStyleOverrideType = {
tblstyleoverridetypeBand1Horz: 0,
tblstyleoverridetypeBand1Vert: 1,
......@@ -878,6 +895,13 @@ function Binary_pPrWriter(memory, oNumIdMap)
this.memory.WriteByte(c_oSerProp_pPrType.pBdr);
this.memory.WriteByte(c_oSerPropLenType.Variable);
this.bs.WriteItemWithLength(function(){oThis.bs.WriteBorders(pPr.Brd);});
}
//FramePr
if(null != pPr.FramePr)
{
this.memory.WriteByte(c_oSerProp_pPrType.FramePr);
this.memory.WriteByte(c_oSerPropLenType.Variable);
this.bs.WriteItemWithLength(function(){oThis.WriteFramePr(pPr.FramePr);});
}
};
this.WriteInd = function(Ind)
......@@ -995,6 +1019,93 @@ function Binary_pPrWriter(memory, oNumIdMap)
this.memory.WriteLong(id);
}
};
this.WriteFramePr = function(oFramePr)
{
if(null != oFramePr.DropCap)
{
this.memory.WriteByte(c_oSer_FramePrType.DropCap);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.DropCap);
}
if(null != oFramePr.H)
{
this.memory.WriteByte(c_oSer_FramePrType.H);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(g_dKoef_mm_to_twips * oFramePr.H);
}
if(null != oFramePr.HAnchor)
{
this.memory.WriteByte(c_oSer_FramePrType.HAnchor);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.HAnchor);
}
if(null != oFramePr.HRule)
{
this.memory.WriteByte(c_oSer_FramePrType.HRule);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.HRule);
}
if(null != oFramePr.HSpace)
{
this.memory.WriteByte(c_oSer_FramePrType.HSpace);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(g_dKoef_mm_to_twips * oFramePr.HSpace);
}
if(null != oFramePr.Lines)
{
this.memory.WriteByte(c_oSer_FramePrType.Lines);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(oFramePr.Lines);
}
if(null != oFramePr.VAnchor)
{
this.memory.WriteByte(c_oSer_FramePrType.VAnchor);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.VAnchor);
}
if(null != oFramePr.VSpace)
{
this.memory.WriteByte(c_oSer_FramePrType.VSpace);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(g_dKoef_mm_to_twips * oFramePr.VSpace);
}
if(null != oFramePr.W)
{
this.memory.WriteByte(c_oSer_FramePrType.W);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(g_dKoef_mm_to_twips * oFramePr.W);
}
if(null != oFramePr.Wrap)
{
this.memory.WriteByte(c_oSer_FramePrType.Wrap);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.Wrap);
}
if(null != oFramePr.X)
{
this.memory.WriteByte(c_oSer_FramePrType.X);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(g_dKoef_mm_to_twips * oFramePr.X);
}
if(null != oFramePr.XAlign)
{
this.memory.WriteByte(c_oSer_FramePrType.XAlign);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.XAlign);
}
if(null != oFramePr.Y)
{
this.memory.WriteByte(c_oSer_FramePrType.Y);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(g_dKoef_mm_to_twips * oFramePr.Y);
}
if(null != oFramePr.YAlign)
{
this.memory.WriteByte(c_oSer_FramePrType.YAlign);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(oFramePr.YAlign);
}
};
};
function Binary_rPrWriter(memory)
{
......@@ -3502,6 +3613,12 @@ function Binary_pPrReader(doc, stream, oDocxNum)
res = this.brPrr.Read(length, this.paragraph.TextPr.Value);
else
res = c_oSerConstants.ReadUnknown;
break;
case c_oSerProp_pPrType.FramePr:
pPr.FramePr = new CFramePr();
res = this.bcr.Read2(length, function(t, l){
return oThis.ReadFramePr(t, l, pPr.FramePr);
});
break;
default:
res = c_oSerConstants.ReadUnknown;
......@@ -3693,6 +3810,41 @@ function Binary_pPrReader(doc, stream, oDocxNum)
res = c_oSerConstants.ReadUnknown;
return res;
};
this.ReadFramePr = function(type, length, oFramePr)
{
var res = c_oSerConstants.ReadOk;
if(c_oSer_FramePrType.DropCap == type)
oFramePr.DropCap = this.stream.GetUChar();
else if(c_oSer_FramePrType.H == type)
oFramePr.H = g_dKoef_twips_to_mm * this.stream.GetULongLE();
else if(c_oSer_FramePrType.HAnchor == type)
oFramePr.HAnchor = this.stream.GetUChar();
else if(c_oSer_FramePrType.HRule == type)
oFramePr.HRule = this.stream.GetUChar();
else if(c_oSer_FramePrType.HSpace == type)
oFramePr.HSpace = g_dKoef_twips_to_mm * this.stream.GetULongLE();
else if(c_oSer_FramePrType.Lines == type)
oFramePr.Lines = this.stream.GetULongLE();
else if(c_oSer_FramePrType.VAnchor == type)
oFramePr.VAnchor = this.stream.GetUChar();
else if(c_oSer_FramePrType.VSpace == type)
oFramePr.VSpace = g_dKoef_twips_to_mm * this.stream.GetULongLE();
else if(c_oSer_FramePrType.W == type)
oFramePr.W = g_dKoef_twips_to_mm * this.stream.GetULongLE();
else if(c_oSer_FramePrType.Wrap == type)
oFramePr.Wrap = this.stream.GetUChar();
else if(c_oSer_FramePrType.X == type)
oFramePr.X = g_dKoef_twips_to_mm * this.stream.GetULongLE();
else if(c_oSer_FramePrType.XAlign == type)
oFramePr.XAlign = this.stream.GetUChar();
else if(c_oSer_FramePrType.Y == type)
oFramePr.Y = g_dKoef_twips_to_mm * this.stream.GetULongLE();
else if(c_oSer_FramePrType.YAlign == type)
oFramePr.YAlign = this.stream.GetUChar();
else
res = c_oSerConstants.ReadUnknown;
return res;
};
};
function Binary_rPrReader(doc, stream)
{
......
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