Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
a8897a64
Commit
a8897a64
authored
Oct 14, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
field NUMPAGES
parent
1058b8a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
word/Editor/Field.js
word/Editor/Field.js
+1
-0
word/Editor/Serialize2.js
word/Editor/Serialize2.js
+16
-4
No files found.
word/Editor/Field.js
View file @
a8897a64
...
...
@@ -38,6 +38,7 @@ var History = AscCommon.History;
var
fieldtype_UNKNOWN
=
0x0000
;
var
fieldtype_MERGEFIELD
=
0x0001
;
var
fieldtype_PAGENUM
=
0x0002
;
var
fieldtype_PAGECOUNT
=
0x0003
;
/**
*
...
...
word/Editor/Serialize2.js
View file @
a8897a64
...
...
@@ -4332,7 +4332,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
var
aRunRanges
=
[];
for
(
var
i
=
ParaStart
;
i
<
ParaEnd
&&
i
<
oRun
.
Content
.
length
;
i
++
)
{
var
item
=
oRun
.
Content
[
i
];
if
(
item
.
Type
==
para_PageNum
)
{
if
(
item
.
Type
==
para_PageNum
||
item
.
Type
==
para_PageCount
)
{
var
elem
;
if
(
nPrevIndex
<
i
)
elem
=
{
nStart
:
nPrevIndex
,
nEnd
:
i
,
pageNum
:
item
};
...
...
@@ -4358,7 +4358,12 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
});
}
if
(
null
!=
elem
.
pageNum
)
{
var
Instr
=
"
PAGE
\\
* MERGEFORMAT
"
;
var
Instr
;
if
(
elem
.
pageNum
.
Type
==
para_PageNum
)
{
Instr
=
"
PAGE
\\
* MERGEFORMAT
"
;
}
else
{
Instr
=
"
NUMPAGES
\\
* MERGEFORMAT
"
;
}
this
.
bs
.
WriteItem
(
c_oSerParType
.
FldSimple
,
function
(){
oThis
.
WriteFldSimple
(
Instr
,
function
(){
oThis
.
WriteRun2
(
function
()
{
//всегда что-то пишем, потому что если ничего нет в w:t, то и не применяются настройки
...
...
@@ -9179,6 +9184,9 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, curFoo
else
if
(
"
PAGE
"
==
sFieldType
){
oRes
=
new
ParaField
(
fieldtype_PAGENUM
,
aArguments
,
aSwitches
);
}
else
if
(
"
NUMPAGES
"
==
sFieldType
){
oRes
=
new
ParaField
(
fieldtype_PAGECOUNT
,
aArguments
,
aSwitches
);
}
else
if
(
"
MERGEFIELD
"
==
sFieldType
){
oRes
=
new
ParaField
(
fieldtype_MERGEFIELD
,
aArguments
,
aSwitches
);
if
(
editor
)
...
...
@@ -13277,13 +13285,17 @@ OpenParStruct.prototype = {
this
.
cur
=
this
.
stack
[
this
.
stack
.
length
-
1
];
var
elem
=
oPrevElem
.
elem
;
if
(
null
!=
elem
&&
elem
.
Content
)
{
if
(
para_Field
==
elem
.
Get_Type
()
&&
fieldtype_PAGENUM
==
elem
.
Get_FieldType
(
))
{
if
(
para_Field
==
elem
.
Get_Type
()
&&
(
fieldtype_PAGENUM
==
elem
.
Get_FieldType
()
||
fieldtype_PAGECOUNT
==
elem
.
Get_FieldType
()
))
{
var
oNewRun
=
new
ParaRun
(
this
.
paragraph
);
var
rPr
=
getStyleFirstRun
(
elem
);
if
(
rPr
)
{
oNewRun
.
Set_Pr
(
rPr
);
}
if
(
fieldtype_PAGENUM
==
elem
.
Get_FieldType
())
{
oNewRun
.
Add_ToContent
(
0
,
new
ParaPageNum
());
}
else
{
oNewRun
.
Add_ToContent
(
0
,
new
ParaPageCount
());
}
this
.
addToContent
(
oNewRun
);
}
else
if
(
elem
.
Content
.
length
>
0
)
{
this
.
addToContent
(
elem
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment