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
999a8361
Commit
999a8361
authored
Oct 26, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented "\p" switch for the PAGEREF field.
parent
9908f722
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
1 deletion
+85
-1
word/Editor/Bookmarks.js
word/Editor/Bookmarks.js
+22
-0
word/Editor/Paragraph/ComplexField.js
word/Editor/Paragraph/ComplexField.js
+57
-1
word/Editor/ParagraphContentBase.js
word/Editor/ParagraphContentBase.js
+3
-0
word/Editor/Run.js
word/Editor/Run.js
+3
-0
No files found.
word/Editor/Bookmarks.js
View file @
999a8361
...
...
@@ -52,6 +52,9 @@ function CParagraphBookmark(isStart, sBookmarkId, sBookmarkName)
this
.
BookmarkId
=
sBookmarkId
;
this
.
BookmarkName
=
sBookmarkName
;
this
.
Use
=
true
;
this
.
PageAbs
=
1
;
this
.
X
=
0
;
this
.
Y
=
0
;
AscCommon
.
g_oTableId
.
Add
(
this
,
this
.
Id
);
}
...
...
@@ -67,6 +70,10 @@ CParagraphBookmark.prototype.GetId = function()
{
return
this
.
Id
;
};
CParagraphBookmark
.
prototype
.
Copy
=
function
()
{
return
new
CParagraphBookmark
(
this
.
Start
,
this
.
BookmarkId
,
this
.
BookmarkName
);
};
CParagraphBookmark
.
prototype
.
GetBookmarkId
=
function
()
{
return
this
.
BookmarkId
;
...
...
@@ -91,6 +98,21 @@ CParagraphBookmark.prototype.IsStart = function()
{
return
this
.
Start
;
};
CParagraphBookmark
.
prototype
.
Recalculate_Range
=
function
(
PRS
,
ParaPr
)
{
this
.
PageAbs
=
PRS
.
Paragraph
.
Get_AbsolutePage
(
PRS
.
Page
);
this
.
X
=
PRS
.
X
;
this
.
Y
=
PRS
.
Y
;
};
CParagraphBookmark
.
prototype
.
GetPage
=
function
()
{
return
this
.
PageAbs
;
};
CParagraphBookmark
.
prototype
.
GetXY
=
function
()
{
return
{
X
:
this
.
X
,
Y
:
this
.
Y
};
};
//----------------------------------------------------------------------------------------------------------------------
// Функции совместного редактирования
//----------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/Paragraph/ComplexField.js
View file @
999a8361
...
...
@@ -50,6 +50,9 @@ function ParaFieldChar(Type, LogicDocument)
this
.
CharType
=
undefined
===
Type
?
fldchartype_Begin
:
Type
;
this
.
ComplexField
=
(
this
.
CharType
===
fldchartype_Begin
)
?
new
CComplexField
(
LogicDocument
)
:
null
;
this
.
Run
=
null
;
this
.
X
=
0
;
this
.
Y
=
0
;
this
.
PageAbs
=
0
;
}
ParaFieldChar
.
prototype
=
Object
.
create
(
CRunElementBase
.
prototype
);
ParaFieldChar
.
prototype
.
constructor
=
ParaFieldChar
;
...
...
@@ -111,6 +114,23 @@ ParaFieldChar.prototype.GetRun = function()
{
return
this
.
Run
;
};
ParaFieldChar
.
prototype
.
SetXY
=
function
(
X
,
Y
)
{
this
.
X
=
X
;
this
.
Y
=
Y
;
};
ParaFieldChar
.
prototype
.
GetXY
=
function
()
{
return
{
X
:
this
.
X
,
Y
:
this
.
Y
};
};
ParaFieldChar
.
prototype
.
SetPage
=
function
(
nPage
)
{
this
.
PageAbs
=
nPage
;
};
ParaFieldChar
.
prototype
.
GetPage
=
function
()
{
return
this
.
PageAbs
;
};
function
ParaInstrText
(
value
)
{
...
...
@@ -273,7 +293,43 @@ CComplexField.prototype.Update = function()
{
this
.
LogicDocument
.
Create_NewHistoryPoint
();
this
.
LogicDocument
.
GetBookmarksManager
();
var
oBookmarksManager
=
this
.
LogicDocument
.
GetBookmarksManager
();
var
oBookmark
=
oBookmarksManager
.
GetBookmarkByName
(
this
.
Instruction
.
GetBookmarkName
());
var
sValue
=
"
Error! Bookmark not defined.
"
;
if
(
oBookmark
)
{
var
oStartBookmark
=
oBookmark
[
0
];
var
nBookmarkPage
=
oStartBookmark
.
GetPage
()
+
1
;
if
(
this
.
Instruction
.
IsPositionRelative
())
{
if
(
oStartBookmark
.
GetPage
()
===
this
.
SeparateChar
.
GetPage
())
{
var
oBookmarkXY
=
oStartBookmark
.
GetXY
();
var
oFieldXY
=
this
.
SeparateChar
.
GetXY
();
if
(
Math
.
abs
(
oBookmarkXY
.
Y
-
oFieldXY
.
Y
)
<
0.001
)
sValue
=
oBookmarkXY
.
X
<
oFieldXY
.
X
?
"
above
"
:
"
below
"
;
else
if
(
oBookmarkXY
.
Y
<
oFieldXY
.
Y
)
sValue
=
"
above
"
;
else
sValue
=
"
below
"
;
}
else
{
sValue
=
"
on page
"
+
nBookmarkPage
;
}
}
else
{
sValue
=
(
oStartBookmark
.
GetPage
()
+
1
)
+
""
;
}
}
for
(
var
nIndex
=
0
,
nLen
=
sValue
.
length
;
nIndex
<
nLen
;
++
nIndex
)
{
this
.
LogicDocument
.
AddToParagraph
(
new
ParaText
(
sValue
.
charAt
(
nIndex
)));
}
this
.
LogicDocument
.
Recalculate
();
}
...
...
word/Editor/ParagraphContentBase.js
View file @
999a8361
...
...
@@ -37,6 +37,9 @@ function CParagraphContentBase()
this
.
StartLine
=
-
1
;
this
.
StartRange
=
-
1
;
this
.
Lines
=
[];
this
.
LinesLength
=
0
;
}
CParagraphContentBase
.
prototype
.
CanSplit
=
function
()
{
...
...
word/Editor/Run.js
View file @
999a8361
...
...
@@ -3244,6 +3244,9 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
if
(
PRS
.
IsFastRecalculate
())
break
;
Item
.
SetXY
(
X
+
SpaceLen
+
WordLen
,
PRS
.
Y
);
Item
.
SetPage
(
Para
.
Get_AbsolutePage
(
CurPage
));
Item
.
SetRun
(
this
);
if
(
Item
.
IsBegin
())
{
...
...
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