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
af1a6dcd
Commit
af1a6dcd
authored
Aug 05, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new class for working with PageCount field.
parent
7fc0a0d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
1 deletion
+99
-1
word/Editor/ParagraphContent.js
word/Editor/ParagraphContent.js
+99
-1
No files found.
word/Editor/ParagraphContent.js
View file @
af1a6dcd
...
@@ -104,7 +104,7 @@ var para_FootnoteReference = 0x0039; // Ссылка на сноску
...
@@ -104,7 +104,7 @@ var para_FootnoteReference = 0x0039; // Ссылка на сноску
var
para_FootnoteRef
=
0x0040
;
// Номер сноски (должен быть только внутри сноски)
var
para_FootnoteRef
=
0x0040
;
// Номер сноски (должен быть только внутри сноски)
var
para_Separator
=
0x0041
;
// Разделить, который используется для сносок
var
para_Separator
=
0x0041
;
// Разделить, который используется для сносок
var
para_ContinuationSeparator
=
0x0042
;
// Большой разделитель, который используется для сносок
var
para_ContinuationSeparator
=
0x0042
;
// Большой разделитель, который используется для сносок
var
para_PageCount
=
0x0043
;
// Количество страниц
var
break_Line
=
0x01
;
var
break_Line
=
0x01
;
var
break_Page
=
0x02
;
var
break_Page
=
0x02
;
...
@@ -7810,6 +7810,104 @@ ParaContinuationSeparator.prototype.Update_Width = function(PRS)
...
@@ -7810,6 +7810,104 @@ ParaContinuationSeparator.prototype.Update_Width = function(PRS)
this
.
WidthVisible
=
nWidth
;
this
.
WidthVisible
=
nWidth
;
};
};
function
ParaPageCount
()
{
this
.
FontKoef
=
1
;
this
.
NumWidths
=
[];
this
.
Widths
=
[];
this
.
String
=
[];
}
AscCommon
.
extendClass
(
ParaPageCount
,
CRunElementBase
);
ParaPageCount
.
prototype
.
Type
=
para_PageCount
;
ParaPageCount
.
prototype
.
Copy
=
function
()
{
return
new
ParaPageCount
();
};
ParaPageCount
.
prototype
.
Is_RealContent
=
function
()
{
return
true
;
};
ParaPageCount
.
prototype
.
Can_AddNumbering
=
function
()
{
return
true
;
};
ParaPageCount
.
prototype
.
Measure
=
function
(
Context
,
TextPr
)
{
this
.
FontKoef
=
TextPr
.
Get_FontKoef
();
Context
.
SetFontSlot
(
fontslot_ASCII
,
this
.
FontKoef
);
for
(
var
Index
=
0
;
Index
<
10
;
Index
++
)
{
this
.
NumWidths
[
Index
]
=
Context
.
Measure
(
""
+
Index
).
Width
;
}
this
.
Width
=
0
;
this
.
Height
=
0
;
this
.
WidthVisible
=
0
;
};
ParaPageCount
.
prototype
.
Draw
=
function
(
X
,
Y
,
Context
)
{
var
Len
=
this
.
String
.
length
;
var
_X
=
X
;
var
_Y
=
Y
;
Context
.
SetFontSlot
(
fontslot_ASCII
,
this
.
FontKoef
);
for
(
var
Index
=
0
;
Index
<
Len
;
Index
++
)
{
var
Char
=
this
.
String
.
charAt
(
Index
);
Context
.
FillText
(
_X
,
_Y
,
Char
);
_X
+=
this
.
Widths
[
Index
];
}
};
ParaPageCount
.
prototype
.
Set_Page
=
function
(
PageNum
)
{
this
.
String
=
""
+
PageNum
;
var
Len
=
this
.
String
.
length
;
var
RealWidth
=
0
;
for
(
var
Index
=
0
;
Index
<
Len
;
Index
++
)
{
var
Char
=
parseInt
(
this
.
String
.
charAt
(
Index
));
this
.
Widths
[
Index
]
=
this
.
NumWidths
[
Char
];
RealWidth
+=
this
.
NumWidths
[
Char
];
}
this
.
Width
=
RealWidth
;
this
.
WidthVisible
=
RealWidth
;
};
// Save_RecalculateObject : function(Copy)
// {
// return new CPageNumRecalculateObject(this.Type, this.Widths, this.String, this.Width, Copy);
// },
//
// Load_RecalculateObject : function(RecalcObj)
// {
// this.Widths = RecalcObj.Widths;
// this.String = RecalcObj.String;
//
// this.Width = RecalcObj.Width;
// this.WidthVisible = this.Width;
// },
//
// Prepare_RecalculateObject : function()
// {
// this.Widths = [];
// this.String = "";
// },
// Document_CreateFontCharMap : function(FontCharMap)
// {
// var sValue = "1234567890";
// for ( var Index = 0; Index < sValue.length; Index++ )
// {
// var Char = sValue.charAt(Index);
// FontCharMap.AddChar( Char );
// }
// },
function
ParagraphContent_Read_FromBinary
(
Reader
)
function
ParagraphContent_Read_FromBinary
(
Reader
)
{
{
var
ElementType
=
Reader
.
GetLong
();
var
ElementType
=
Reader
.
GetLong
();
...
...
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