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
34881e03
Commit
34881e03
authored
Apr 25, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented working with floating objects in the class CBlockLevelSdt.
parent
30f3d833
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
16 deletions
+54
-16
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+31
-15
word/Editor/DocumentContentBase.js
word/Editor/DocumentContentBase.js
+4
-0
word/Editor/Paragraph/ParaDrawing.js
word/Editor/Paragraph/ParaDrawing.js
+5
-1
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+14
-0
No files found.
word/Editor/DocumentContent.js
View file @
34881e03
...
...
@@ -307,19 +307,28 @@ CDocumentContent.prototype.Get_EmptyHeight = function()
else
return
0
;
};
// Inner = true - запрос пришел из содержимого,
// false - запрос пришел от родительского класса
// Запрос от родительского класса нужен, например, для колонтитулов, потому
// что у них врапится текст не колонтитула, а документа.
CDocumentContent
.
prototype
.
CheckRange
=
function
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
PageNum_rel
,
Inner
,
bMathWrap
)
/**
* Inner = true - запрос пришел из содержимого,
* false - запрос пришел от родительского класса
* Запрос от родительского класса нужен, например, для колонтитулов, потому
* что у них врапится текст не колонтитула, а документа.
*/
CDocumentContent
.
prototype
.
CheckRange
=
function
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
CurPage
,
Inner
,
bMathWrap
)
{
if
(
this
.
LogicDocument
&&
typeof
(
editor
)
!==
"
undefined
"
&&
editor
.
isDocumentEditor
)
{
if
(
undefined
===
Inner
)
Inner
=
true
;
if
(
this
.
IsBlockLevelSdtContent
()
&&
true
===
Inner
)
return
this
.
Parent
.
CheckRange
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
CurPage
,
true
,
bMathWrap
);
if
(
this
.
LogicDocument
&&
editor
&&
editor
.
isDocumentEditor
)
{
var
oDocContent
=
this
;
if
(
this
.
Parent
&&
this
.
Parent
instanceof
CBlockLevelSdt
)
oDocContent
=
this
.
Parent
.
Parent
;
if
((
false
===
this
.
TurnOffInnerWrap
&&
true
===
Inner
)
||
(
false
===
Inner
))
return
this
.
LogicDocument
.
DrawingObjects
.
CheckRange
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
PageNum_rel
+
this
.
Get_StartPage_Absolute
(
),
[],
this
,
bMathWrap
);
return
this
.
LogicDocument
.
DrawingObjects
.
CheckRange
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
this
.
Get_AbsolutePage
(
CurPage
),
[],
this
,
bMathWrap
);
}
return
[];
...
...
@@ -584,7 +593,7 @@ CDocumentContent.prototype.Reset_RecalculateCache = function()
// Пересчитываем отдельную страницу DocumentContent
CDocumentContent
.
prototype
.
Recalculate_Page
=
function
(
PageIndex
,
bStart
)
{
if
(
0
===
PageIndex
&&
true
===
bStart
)
if
(
0
===
PageIndex
&&
true
===
bStart
&&
true
!==
this
.
IsBlockLevelSdtContent
()
)
{
this
.
RecalcInfo
.
FlowObject
=
null
;
this
.
RecalcInfo
.
FlowObjectPageBreakBefore
=
false
;
...
...
@@ -1061,6 +1070,9 @@ CDocumentContent.prototype.Recalculate_Page = function(PageIndex,
if
(
RecalcResult
&
recalcresult_CurPage
)
{
if
(
true
===
this
.
IsBlockLevelSdtContent
())
return
recalcresult2_CurPage
;
// Такое не должно приходить в автофигурах, только в таблицах основного документа. Проверка на это находится в параграфе.
if
(
RecalcResult
&
recalcresultflags_Footnotes
)
return
recalcresult2_CurPage
|
recalcresultflags_Column
|
recalcresultflags_Footnotes
;
...
...
@@ -1358,7 +1370,7 @@ CDocumentContent.prototype.Get_PageBounds = function(CurPage, Height, bForceChec
var
PageAbs
=
this
.
Get_AbsolutePage
(
CurPage
);
// В колонтитуле не учитывается.
if
(
true
!=
this
.
Is_HdrFtr
(
false
)
||
true
===
bForceCheckDrawings
)
if
(
(
true
!=
this
.
Is_HdrFtr
(
false
)
&&
true
!==
this
.
IsBlockLevelSdtContent
()
)
||
true
===
bForceCheckDrawings
)
{
// Учитываем все Drawing-объекты с обтеканием. Объекты без обтекания (над и под текстом) учитываем только в
// случае, когда начальная точка (левый верхний угол) попадает в this.Y + Height
...
...
@@ -8463,6 +8475,10 @@ CDocumentContent.prototype.PreDelete = function()
this
.
Content
[
nIndex
].
PreDelete
();
}
};
CDocumentContent
.
prototype
.
IsBlockLevelSdtContent
=
function
()
{
return
(
this
.
Parent
&&
this
.
Parent
instanceof
CBlockLevelSdt
);
};
function
CDocumentContentStartState
(
DocContent
)
{
...
...
word/Editor/DocumentContentBase.js
View file @
34881e03
...
...
@@ -702,3 +702,7 @@ CDocumentContentBase.prototype.private_Remove = function(Count, bOnlyText, bRemo
}
};
CDocumentContentBase
.
prototype
.
IsBlockLevelSdtContent
=
function
()
{
return
false
;
};
\ No newline at end of file
word/Editor/Paragraph/ParaDrawing.js
View file @
34881e03
...
...
@@ -1098,8 +1098,12 @@ ParaDrawing.prototype.Update_Position = function(Paragraph, ParaLayout, PageLimi
this
.
PositionV
.
Percent
=
this
.
PositionV_Old
.
Percent2
;
}
var
oDocumentContent
=
this
.
Parent
.
Parent
;
if
(
oDocumentContent
&&
oDocumentContent
.
IsBlockLevelSdtContent
())
oDocumentContent
=
oDocumentContent
.
Parent
.
Parent
;
this
.
Parent
=
Paragraph
;
this
.
DocumentContent
=
this
.
Parent
.
Par
ent
;
this
.
DocumentContent
=
oDocumentCont
ent
;
var
PageNum
=
ParaLayout
.
PageNum
;
var
OtherFlowObjects
=
editor
.
WordControl
.
m_oLogicDocument
.
DrawingObjects
.
getAllFloatObjectsOnPage
(
PageNum
,
this
.
Parent
.
Parent
);
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
34881e03
...
...
@@ -82,6 +82,8 @@ CBlockLevelSdt.prototype.Reset = function(X, Y, XLimit, YLimit, PageAbs, ColumnA
};
CBlockLevelSdt
.
prototype
.
Recalculate_Page
=
function
(
CurPage
)
{
this
.
Content
.
RecalcInfo
=
this
.
Parent
.
RecalcInfo
;
var
RecalcResult
=
this
.
Content
.
Recalculate_Page
(
CurPage
,
true
);
if
(
recalcresult2_End
===
RecalcResult
)
...
...
@@ -687,6 +689,18 @@ CBlockLevelSdt.prototype.CheckTableCoincidence = function(Table)
{
return
this
.
Parent
.
CheckTableCoincidence
(
Table
);
};
CBlockLevelSdt
.
prototype
.
CheckRange
=
function
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
CurPage
,
Inner
,
bMathWrap
)
{
if
(
true
===
Inner
)
{
var
PageRel
=
this
.
Get_AbsolutePage
(
CurPage
)
-
this
.
Get_AbsolutePage
(
0
)
+
this
.
Get_StartPage_Relative
();
return
this
.
Parent
.
CheckRange
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
PageRel
,
Inner
,
bMathWrap
);
}
else
{
return
this
.
Content
.
CheckRange
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
CurPage
,
Inner
,
bMathWrap
);
}
};
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
...
...
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