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

(2.0.0.130): AVSOfficeDocxFile2

свойства текста FontHint;BoldCs;ItalicCs;FontSizeCs;Cs;Rtl; на чтение и запись

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47284 954022d7-b5bf-4e40-9824-e11837661b57
parent 8896055e
...@@ -184,7 +184,13 @@ var c_oSerProp_rPrType = { ...@@ -184,7 +184,13 @@ var c_oSerProp_rPrType = {
DStrikeout: 15, DStrikeout: 15,
Caps: 16, Caps: 16,
SmallCaps: 17, SmallCaps: 17,
Position: 18 Position: 18,
FontHint: 19,
BoldCs: 20,
ItalicCs: 21,
FontSizeCs: 22,
Cs: 23,
Rtl: 24
}; };
var c_oSerProp_rowPrType = { var c_oSerProp_rowPrType = {
CantSplit:0, CantSplit:0,
...@@ -466,6 +472,11 @@ var EWmlColorSchemeIndex = { ...@@ -466,6 +472,11 @@ var EWmlColorSchemeIndex = {
wmlcolorschemeindexLight1: 10, wmlcolorschemeindexLight1: 10,
wmlcolorschemeindexLight2: 11 wmlcolorschemeindexLight2: 11
}; };
var EHint = {
hintCs: 0,
hintDefault: 1,
hintEastAsia: 2
};
var g_nodeAttributeStart = 0xFA; var g_nodeAttributeStart = 0xFA;
var g_nodeAttributeEnd = 0xFB; var g_nodeAttributeEnd = 0xFB;
...@@ -1012,24 +1023,46 @@ function Binary_rPrWriter(memory) ...@@ -1012,24 +1023,46 @@ function Binary_rPrWriter(memory)
this.memory.WriteBool(rPr.Strikeout); this.memory.WriteBool(rPr.Strikeout);
} }
//FontFamily //FontFamily
if(null != rPr.FontFamily) if(null != rPr.RFonts)
{
var font = rPr.RFonts;
if(null != font.Ascii)
{ {
var fontname = rPr.FontFamily.Name.toString();
this.memory.WriteByte(c_oSerProp_rPrType.FontAscii); this.memory.WriteByte(c_oSerProp_rPrType.FontAscii);
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(fontname); this.memory.WriteString2(font.Ascii.Name);
}
if(null != font.HAnsi)
{
this.memory.WriteByte(c_oSerProp_rPrType.FontHAnsi); this.memory.WriteByte(c_oSerProp_rPrType.FontHAnsi);
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(fontname); this.memory.WriteString2(font.HAnsi.Name);
}
this.memory.WriteByte(c_oSerProp_rPrType.FontAE); if(null != font.CS)
this.memory.WriteByte(c_oSerPropLenType.Variable); {
this.memory.WriteString2(fontname);
this.memory.WriteByte(c_oSerProp_rPrType.FontCS); this.memory.WriteByte(c_oSerProp_rPrType.FontCS);
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(fontname); this.memory.WriteString2(font.CS.Name);
}
if(null != font.EastAsia)
{
this.memory.WriteByte(c_oSerProp_rPrType.FontAE);
this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(font.EastAsia.Name);
}
if(null != font.Hint)
{
var nHint;
switch(font.Hint)
{
case fonthint_CS:nHint = EHint.hintCs;break;
case fonthint_EastAsia:nHint = EHint.hintEastAsia;break;
default :nHint = EHint.hintDefault;break;
}
this.memory.WriteByte(c_oSerProp_rPrType.FontHint);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(nHint);
}
} }
//FontSize //FontSize
if(null != rPr.FontSize) if(null != rPr.FontSize)
...@@ -1106,6 +1139,41 @@ function Binary_rPrWriter(memory) ...@@ -1106,6 +1139,41 @@ function Binary_rPrWriter(memory)
this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble(rPr.Position); this.memory.WriteDouble(rPr.Position);
} }
//BoldCs
if(null != rPr.BoldCS)
{
this.memory.WriteByte(c_oSerProp_rPrType.BoldCs);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(rPr.BoldCS);
}
//ItalicCS
if(null != rPr.ItalicCS)
{
this.memory.WriteByte(c_oSerProp_rPrType.ItalicCs);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(rPr.ItalicCS);
}
//FontSizeCS
if(null != rPr.FontSizeCS)
{
this.memory.WriteByte(c_oSerProp_rPrType.FontSizeCs);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(rPr.FontSizeCS * 2);
}
//CS
if(null != rPr.CS)
{
this.memory.WriteByte(c_oSerProp_rPrType.Cs);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(rPr.CS);
}
//RTL
if(null != rPr.RTL)
{
this.memory.WriteByte(c_oSerProp_rPrType.Rtl);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(rPr.RTL);
}
}; };
}; };
function Binary_tblPrWriter(memory, oNumIdMap) function Binary_tblPrWriter(memory, oNumIdMap)
...@@ -3667,6 +3735,31 @@ function Binary_rPrReader(doc, stream) ...@@ -3667,6 +3735,31 @@ function Binary_rPrReader(doc, stream)
break; break;
case c_oSerProp_rPrType.Position: case c_oSerProp_rPrType.Position:
rPr.Position = this.bcr.ReadDouble(); rPr.Position = this.bcr.ReadDouble();
break;
case c_oSerProp_rPrType.FontHint:
var nHint;
switch(this.stream.GetUChar())
{
case EHint.hintCs: nHint = fonthint_CS;break;
case EHint.hintEastAsia: nHint = fonthint_EastAsia;break;
default : nHint = fonthint_Default;break;
}
rPr.RFonts.Hint = nHint;
break;
case c_oSerProp_rPrType.BoldCs:
rPr.BoldCS = this.stream.GetBool();
break;
case c_oSerProp_rPrType.ItalicCs:
rPr.ItalicCS = this.stream.GetBool();
break;
case c_oSerProp_rPrType.FontSizeCs:
rPr.FontSizeCS = this.stream.GetULongLE() / 2;
break;
case c_oSerProp_rPrType.Cs:
rPr.CS = this.stream.GetBool();
break;
case c_oSerProp_rPrType.Rtl:
rPr.RTL = this.stream.GetBool();
break; break;
default: default:
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
......
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