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

(2.0.0.165): ASCOfficeDocxFile2

Чтение/Запись sectionType, pageNumeType

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55639 954022d7-b5bf-4e40-9824-e11837661b57
parent 76f9b0ff
...@@ -234,11 +234,16 @@ var c_oSerProp_secPrType = { ...@@ -234,11 +234,16 @@ var c_oSerProp_secPrType = {
setting: 2, setting: 2,
headers: 3, headers: 3,
footers: 4, footers: 4,
hdrftrelem: 5 hdrftrelem: 5,
pageNumType: 6
}; };
var c_oSerProp_secPrSettingsType = { var c_oSerProp_secPrSettingsType = {
titlePg: 0, titlePg: 0,
EvenAndOddHeaders: 1 EvenAndOddHeaders: 1,
SectionType: 2
};
var c_oSerProp_secPrPageNumType = {
start: 0
}; };
var c_oSerParType = { var c_oSerParType = {
Par:0, Par:0,
...@@ -635,6 +640,13 @@ var ETblLayoutType = { ...@@ -635,6 +640,13 @@ var ETblLayoutType = {
tbllayouttypeAutofit: 1, tbllayouttypeAutofit: 1,
tbllayouttypeFixed: 2 tbllayouttypeFixed: 2
}; };
var ESectionMark = {
sectionmarkContinious: 0,
sectionmarkEvenPage: 1,
sectionmarkNextColumn: 2,
sectionmarkNextPage: 3,
sectionmarkOddPage: 4
};
var g_sErrorCharCountMessage = "g_sErrorCharCountMessage"; var g_sErrorCharCountMessage = "g_sErrorCharCountMessage";
var g_nErrorCharCount = 30000; var g_nErrorCharCount = 30000;
...@@ -1340,6 +1352,9 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter) ...@@ -1340,6 +1352,9 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter)
//footer //footer
if(null != sectPr.FooterFirst || null != sectPr.FooterEven || null != sectPr.FooterDefault) if(null != sectPr.FooterFirst || null != sectPr.FooterEven || null != sectPr.FooterDefault)
this.bs.WriteItem(c_oSerProp_secPrType.footers, function(){oThis.WriteFtr(sectPr);}); this.bs.WriteItem(c_oSerProp_secPrType.footers, function(){oThis.WriteFtr(sectPr);});
var PageNumType = sectPr.Get_PageNum_Start();
if(-1 != PageNumType)
this.bs.WriteItem(c_oSerProp_secPrType.pageNumType, function(){oThis.WritePageNumType(PageNumType);});
}; };
this.WritePageSize = function(sectPr, oDocument) this.WritePageSize = function(sectPr, oDocument)
{ {
...@@ -1402,6 +1417,21 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter) ...@@ -1402,6 +1417,21 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter)
this.memory.WriteByte(c_oSerPropLenType.Byte); this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(EvenAndOddHeaders); this.memory.WriteBool(EvenAndOddHeaders);
} }
var nFormatType = null;
switch(sectPr.Get_Type())
{
case section_type_Continuous: nFormatType = ESectionMark.sectionmarkContinious;break;
case section_type_EvenPage: nFormatType = ESectionMark.sectionmarkEvenPage;break;
case section_type_Column: nFormatType = ESectionMark.sectionmarkNextColumn;break;
case section_type_NextPage: nFormatType = ESectionMark.sectionmarkNextPage;break;
case section_type_OddPage: nFormatType = ESectionMark.sectionmarkOddPage;break;
}
if(null != nFormatType)
{
this.memory.WriteByte(c_oSerProp_secPrSettingsType.SectionType);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(nFormatType);
}
}; };
this.WriteHdr = function(sectPr) this.WriteHdr = function(sectPr)
{ {
...@@ -1447,6 +1477,11 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter) ...@@ -1447,6 +1477,11 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter)
} }
} }
} }
this.WritePageNumType = function(PageNumType)
{
var oThis = this;
this.bs.WriteItem(c_oSerProp_secPrPageNumType.start, function(){oThis.memory.WriteLong(PageNumType);});
}
}; };
function Binary_rPrWriter(memory) function Binary_rPrWriter(memory)
{ {
...@@ -5967,6 +6002,12 @@ function Binary_pPrReader(doc, oReadResult, stream) ...@@ -5967,6 +6002,12 @@ function Binary_pPrReader(doc, oReadResult, stream)
res = this.bcr.Read1(length, function(t, l){ res = this.bcr.Read1(length, function(t, l){
return oThis.Read_pgHdrFtr(t, l, oSectPr, oThis.oReadResult.footers, false); return oThis.Read_pgHdrFtr(t, l, oSectPr, oThis.oReadResult.footers, false);
}); });
}
else if( c_oSerProp_secPrType.pageNumType === type )
{
res = this.bcr.Read1(length, function(t, l){
return oThis.Read_pageNumType(t, l, oSectPr);
});
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
...@@ -5983,6 +6024,20 @@ function Binary_pPrReader(doc, oReadResult, stream) ...@@ -5983,6 +6024,20 @@ function Binary_pPrReader(doc, oReadResult, stream)
else if( c_oSerProp_secPrSettingsType.EvenAndOddHeaders === type ) else if( c_oSerProp_secPrSettingsType.EvenAndOddHeaders === type )
{ {
oAdditional.EvenAndOddHeaders = this.stream.GetBool(); oAdditional.EvenAndOddHeaders = this.stream.GetBool();
}
else if( c_oSerProp_secPrSettingsType.SectionType === type )
{
var nEditorType = null;
switch(this.stream.GetByte())
{
case ESectionMark.sectionmarkContinious: nEditorType = section_type_Continuous;break;
case ESectionMark.sectionmarkEvenPage: nEditorType = section_type_EvenPage;break;
case ESectionMark.sectionmarkNextColumn: nEditorType = section_type_Column;break;
case ESectionMark.sectionmarkNextPage: nEditorType = section_type_NextPage;break;
case ESectionMark.sectionmarkOddPage: nEditorType = section_type_OddPage;break;
}
if(null != nEditorType)
oSectPr.Set_Type(nEditorType);
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
...@@ -6072,6 +6127,18 @@ function Binary_pPrReader(doc, oReadResult, stream) ...@@ -6072,6 +6127,18 @@ function Binary_pPrReader(doc, oReadResult, stream)
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
} }
this.Read_pageNumType = function(type, length, oSectPr)
{
var res = c_oSerConstants.ReadOk;
var oThis = this;
if( c_oSerProp_secPrPageNumType.start === type )
{
oSectPr.Set_PageNum_Start(this.stream.GetULongLE());
}
else
res = c_oSerConstants.ReadUnknown;
return res;
}
}; };
function Binary_rPrReader(doc, stream) 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