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
8bd98cc0
Commit
8bd98cc0
authored
Jun 06, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Новые файлы, связанные со сносками, переформатированы на табы.
parent
0701ee69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
70 deletions
+70
-70
word/Editor/FootEndNote.js
word/Editor/FootEndNote.js
+1
-1
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+69
-69
No files found.
word/Editor/FootEndNote.js
View file @
8bd98cc0
...
...
@@ -13,7 +13,7 @@
*/
function
CFootEndnote
(
DocumentController
)
{
CFootEndnote
.
superclass
.
constructor
.
call
(
this
,
DocumentController
,
DocumentController
.
Get_DrawingDocument
(),
0
,
0
,
0
,
0
,
true
,
false
,
false
);
CFootEndnote
.
superclass
.
constructor
.
call
(
this
,
DocumentController
,
DocumentController
.
Get_DrawingDocument
(),
0
,
0
,
0
,
0
,
true
,
false
,
false
);
}
AscCommon
.
extendClass
(
CFootEndnote
,
CDocumentContent
);
\ No newline at end of file
word/Editor/Footnotes.js
View file @
8bd98cc0
...
...
@@ -13,15 +13,16 @@
*/
function
CFootnotesController
(
LogicDocument
)
{
CFootnotesController
.
superclass
.
constructor
.
call
(
this
,
LogicDocument
);
CFootnotesController
.
superclass
.
constructor
.
call
(
this
,
LogicDocument
);
this
.
Id
=
LogicDocument
.
Get_IdCounter
().
Get_NewId
();
this
.
Id
=
LogicDocument
.
Get_IdCounter
().
Get_NewId
();
this
.
Footnote
=
{};
// Список всех сносок с ключом - Id.
this
.
Pages
=
[];
this
.
Footnote
=
{};
// Список всех сносок с ключом - Id.
this
.
Pages
=
[];
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
LogicDocument
.
Get_TableId
().
Add
(
this
,
this
.
Id
);
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
LogicDocument
.
Get_TableId
().
Add
(
this
,
this
.
Id
);
}
AscCommon
.
extendClass
(
CFootnotesController
,
CDocumentControllerBase
);
...
...
@@ -31,7 +32,7 @@ AscCommon.extendClass(CFootnotesController, CDocumentControllerBase);
*/
CFootnotesController
.
prototype
.
Get_Id
=
function
()
{
return
this
.
Id
;
return
this
.
Id
;
};
/**
* Создаем новую сноску.
...
...
@@ -39,9 +40,9 @@ CFootnotesController.prototype.Get_Id = function()
*/
CFootnotesController
.
prototype
.
Create_Footnote
=
function
()
{
var
NewFootnote
=
new
CFootEndnote
(
this
);
this
.
Footnote
[
NewFootnote
.
Get_Id
()]
=
NewFootnote
;
return
NewFootnote
;
var
NewFootnote
=
new
CFootEndnote
(
this
);
this
.
Footnote
[
NewFootnote
.
Get_Id
()]
=
NewFootnote
;
return
NewFootnote
;
};
/**
* Сбрасываем рассчетные данный для заданной страницы.
...
...
@@ -49,36 +50,35 @@ CFootnotesController.prototype.Create_Footnote = function()
*/
CFootnotesController
.
prototype
.
Reset
=
function
(
nPageIndex
)
{
if
(
!
this
.
Pages
[
nPageIndex
])
this
.
Pages
[
nPageIndex
]
=
new
CFootEndnotePage
();
if
(
!
this
.
Pages
[
nPageIndex
])
this
.
Pages
[
nPageIndex
]
=
new
CFootEndnotePage
();
this
.
Pages
[
nPageIndex
].
Reset
();
this
.
Pages
[
nPageIndex
].
Reset
();
};
/**
* Пересчитываем сноски на заданной странице.
*/
CFootnotesController
.
prototype
.
Recalculate
=
function
(
nPageIndex
,
X
,
XLimit
,
Y
,
YLimit
)
{
if
(
!
this
.
Pages
[
nPageIndex
])
this
.
Pages
[
nPageIndex
]
=
new
CFootEndnotePage
();
// Мы пересчет начинаем с 0, потом просто делаем сдвиг, через функцию Shift.
if
(
!
this
.
Pages
[
nPageIndex
])
this
.
Pages
[
nPageIndex
]
=
new
CFootEndnotePage
();
var
CurY
=
Y
;
// Мы пересчет начинаем с 0, потом просто делаем сдвиг, через функцию Shift.
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
Footnote
.
Reset
(
X
,
CurY
,
XLimit
,
10000
);
var
CurY
=
Y
;
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
Footnote
.
Reset
(
X
,
CurY
,
XLimit
,
10000
);
var
CurPage
=
0
;
var
RecalcResult
=
recalcresult2_NextPage
;
while
(
recalcresult2_End
!=
RecalcResult
)
RecalcResult
=
Footnote
.
Recalculate_Page
(
CurPage
++
,
true
);
var
CurPage
=
0
;
var
RecalcResult
=
recalcresult2_NextPage
;
while
(
recalcresult2_End
!=
RecalcResult
)
RecalcResult
=
Footnote
.
Recalculate_Page
(
CurPage
++
,
true
);
var
Bounds
=
Footnote
.
Get_PageBounds
(
0
);
CurY
+=
Bounds
.
Bottom
-
Bounds
.
Top
;
}
var
Bounds
=
Footnote
.
Get_PageBounds
(
0
);
CurY
+=
Bounds
.
Bottom
-
Bounds
.
Top
;
}
};
/**
* Получаем суммарную высоту, занимаемую сносками на заданной странице.
...
...
@@ -86,15 +86,15 @@ CFootnotesController.prototype.Recalculate = function(nPageIndex, X, XLimit, Y,
*/
CFootnotesController
.
prototype
.
Get_Height
=
function
(
nPageIndex
)
{
var
nHeight
=
0
;
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
var
Bounds
=
Footnote
.
Get_PageBounds
(
0
);
nHeight
+=
Bounds
.
Bottom
-
Bounds
.
Top
;
}
return
nHeight
;
var
nHeight
=
0
;
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
var
Bounds
=
Footnote
.
Get_PageBounds
(
0
);
nHeight
+=
Bounds
.
Bottom
-
Bounds
.
Top
;
}
return
nHeight
;
};
/**
* Отрисовываем сноски на заданной странице.
...
...
@@ -103,11 +103,11 @@ CFootnotesController.prototype.Get_Height = function(nPageIndex)
*/
CFootnotesController
.
prototype
.
Draw
=
function
(
nPageIndex
,
pGraphics
)
{
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
Footnote
.
Draw
(
0
,
pGraphics
);
}
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
Footnote
.
Draw
(
0
,
pGraphics
);
}
};
/**
* Сдвигаем все рассчитанные позиции на заданной странице.
...
...
@@ -117,11 +117,11 @@ CFootnotesController.prototype.Draw = function(nPageIndex, pGraphics)
*/
CFootnotesController
.
prototype
.
Shift
=
function
(
nPageIndex
,
dX
,
dY
)
{
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
Footnote
.
Shift
(
0
,
dX
,
dY
);
}
for
(
var
nIndex
=
0
;
nIndex
<
this
.
Pages
[
nPageIndex
].
Elements
.
length
;
++
nIndex
)
{
var
Footnote
=
this
.
Pages
[
nPageIndex
].
Elements
[
nIndex
];
Footnote
.
Shift
(
0
,
dX
,
dY
);
}
};
/**
* Добавляем заданную сноску на страницу для пересчета.
...
...
@@ -130,10 +130,10 @@ CFootnotesController.prototype.Shift = function(nPageIndex, dX, dY)
*/
CFootnotesController
.
prototype
.
Add_FootnoteOnPage
=
function
(
nPageIndex
,
oFootnote
)
{
if
(
!
this
.
Pages
[
nPageIndex
])
this
.
Pages
[
nPageIndex
]
=
new
CFootEndnotePage
();
if
(
!
this
.
Pages
[
nPageIndex
])
this
.
Pages
[
nPageIndex
]
=
new
CFootEndnotePage
();
this
.
Pages
[
nPageIndex
].
Elements
.
push
(
oFootnote
);
this
.
Pages
[
nPageIndex
].
Elements
.
push
(
oFootnote
);
};
/**
* Проверяем, используется заданная сноска в документе.
...
...
@@ -142,33 +142,33 @@ CFootnotesController.prototype.Add_FootnoteOnPage = function(nPageIndex, oFootno
*/
CFootnotesController
.
prototype
.
Is_UseInDocument
=
function
(
sFootnoteId
)
{
// TODO: Надо бы еще проверить, если ли в документе ссылка на данную сноску.
for
(
var
sId
in
this
.
Footnote
)
{
if
(
sId
===
sFootnoteId
)
return
true
;
}
return
false
;
// TODO: Надо бы еще проверить, если ли в документе ссылка на данную сноску.
for
(
var
sId
in
this
.
Footnote
)
{
if
(
sId
===
sFootnoteId
)
return
true
;
}
return
false
;
};
function
CFootEndnotePage
()
{
this
.
X
=
0
;
this
.
Y
=
0
;
this
.
XLimit
=
0
;
this
.
YLimit
=
0
;
this
.
X
=
0
;
this
.
Y
=
0
;
this
.
XLimit
=
0
;
this
.
YLimit
=
0
;
this
.
Elements
=
[];
this
.
Elements
=
[];
}
CFootEndnotePage
.
prototype
.
Reset
=
function
()
{
this
.
X
=
0
;
this
.
Y
=
0
;
this
.
XLimit
=
0
;
this
.
YLimit
=
0
;
this
.
X
=
0
;
this
.
Y
=
0
;
this
.
XLimit
=
0
;
this
.
YLimit
=
0
;
this
.
Elements
=
[];
this
.
Elements
=
[];
};
...
...
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