Commit 986faa4b authored by konovalovsergey's avatar konovalovsergey

pageCount from field.Get_SelectedText()

parent a8897a64
...@@ -4359,10 +4359,10 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -4359,10 +4359,10 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
} }
if (null != elem.pageNum) { if (null != elem.pageNum) {
var Instr; var Instr;
if (elem.pageNum.Type == para_PageNum) { if (elem.pageNum.Type == para_PageCount) {
Instr = "PAGE \\* MERGEFORMAT";
} else {
Instr = "NUMPAGES \\* MERGEFORMAT"; Instr = "NUMPAGES \\* MERGEFORMAT";
} else {
Instr = "PAGE \\* MERGEFORMAT";
} }
this.bs.WriteItem(c_oSerParType.FldSimple, function(){oThis.WriteFldSimple(Instr, function(){ this.bs.WriteItem(c_oSerParType.FldSimple, function(){oThis.WriteFldSimple(Instr, function(){
oThis.WriteRun2(function () { oThis.WriteRun2(function () {
...@@ -4371,7 +4371,9 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa ...@@ -4371,7 +4371,9 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var numText = '1'; var numText = '1';
if (null != elem.pageNum.String && "string" == typeof(elem.pageNum.String)) { if (null != elem.pageNum.String && "string" == typeof(elem.pageNum.String)) {
numText = elem.pageNum.String; numText = elem.pageNum.String;
} } else if (elem.pageNum.Type == para_PageCount && null != elem.pageNum.PageCount) {
numText = elem.pageNum.PageCount.toString();
}
oThis.WriteText(numText, delText); oThis.WriteText(numText, delText);
}, oRun); }, oRun);
});}); });});
...@@ -13294,7 +13296,8 @@ OpenParStruct.prototype = { ...@@ -13294,7 +13296,8 @@ OpenParStruct.prototype = {
if (fieldtype_PAGENUM == elem.Get_FieldType()) { if (fieldtype_PAGENUM == elem.Get_FieldType()) {
oNewRun.Add_ToContent(0, new ParaPageNum()); oNewRun.Add_ToContent(0, new ParaPageNum());
} else { } else {
oNewRun.Add_ToContent(0, new ParaPageCount()); var pageCount = parseInt(elem.Get_SelectedText(true));
oNewRun.Add_ToContent(0, new ParaPageCount(isNaN(pageCount) ? undefined : pageCount));
} }
this.addToContent(oNewRun); this.addToContent(oNewRun);
} else if(elem.Content.length > 0) { } else if(elem.Content.length > 0) {
......
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