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
7 years ago
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()
...
@@ -307,19 +307,28 @@ CDocumentContent.prototype.Get_EmptyHeight = function()
else
else
return
0
;
return
0
;
};
};
// Inner = true - запрос пришел из содержимого,
/**
// false - запрос пришел от родительского класса
* Inner = true - запрос пришел из содержимого,
// Запрос от родительского класса нужен, например, для колонтитулов, потому
* false - запрос пришел от родительского класса
// что у них врапится текст не колонтитула, а документа.
* Запрос от родительского класса нужен, например, для колонтитулов, потому
CDocumentContent
.
prototype
.
CheckRange
=
function
(
X0
,
Y0
,
X1
,
Y1
,
_Y0
,
_Y1
,
X_lf
,
X_rf
,
PageNum_rel
,
Inner
,
bMathWrap
)
* что у них врапится текст не колонтитула, а документа.
*/
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
)
if
(
undefined
===
Inner
)
Inner
=
true
;
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
))
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
[];
return
[];
...
@@ -584,7 +593,7 @@ CDocumentContent.prototype.Reset_RecalculateCache = function()
...
@@ -584,7 +593,7 @@ CDocumentContent.prototype.Reset_RecalculateCache = function()
// Пересчитываем отдельную страницу DocumentContent
// Пересчитываем отдельную страницу DocumentContent
CDocumentContent
.
prototype
.
Recalculate_Page
=
function
(
PageIndex
,
bStart
)
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
.
FlowObject
=
null
;
this
.
RecalcInfo
.
FlowObjectPageBreakBefore
=
false
;
this
.
RecalcInfo
.
FlowObjectPageBreakBefore
=
false
;
...
@@ -1061,6 +1070,9 @@ CDocumentContent.prototype.Recalculate_Page = function(PageIndex,
...
@@ -1061,6 +1070,9 @@ CDocumentContent.prototype.Recalculate_Page = function(PageIndex,
if
(
RecalcResult
&
recalcresult_CurPage
)
if
(
RecalcResult
&
recalcresult_CurPage
)
{
{
if
(
true
===
this
.
IsBlockLevelSdtContent
())
return
recalcresult2_CurPage
;
// Такое не должно приходить в автофигурах, только в таблицах основного документа. Проверка на это находится в параграфе.
// Такое не должно приходить в автофигурах, только в таблицах основного документа. Проверка на это находится в параграфе.
if
(
RecalcResult
&
recalcresultflags_Footnotes
)
if
(
RecalcResult
&
recalcresultflags_Footnotes
)
return
recalcresult2_CurPage
|
recalcresultflags_Column
|
recalcresultflags_Footnotes
;
return
recalcresult2_CurPage
|
recalcresultflags_Column
|
recalcresultflags_Footnotes
;
...
@@ -1358,7 +1370,7 @@ CDocumentContent.prototype.Get_PageBounds = function(CurPage, Height, bForceChec
...
@@ -1358,7 +1370,7 @@ CDocumentContent.prototype.Get_PageBounds = function(CurPage, Height, bForceChec
var
PageAbs
=
this
.
Get_AbsolutePage
(
CurPage
);
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-объекты с обтеканием. Объекты без обтекания (над и под текстом) учитываем только в
// Учитываем все Drawing-объекты с обтеканием. Объекты без обтекания (над и под текстом) учитываем только в
// случае, когда начальная точка (левый верхний угол) попадает в this.Y + Height
// случае, когда начальная точка (левый верхний угол) попадает в this.Y + Height
...
@@ -8463,6 +8475,10 @@ CDocumentContent.prototype.PreDelete = function()
...
@@ -8463,6 +8475,10 @@ CDocumentContent.prototype.PreDelete = function()
this
.
Content
[
nIndex
].
PreDelete
();
this
.
Content
[
nIndex
].
PreDelete
();
}
}
};
};
CDocumentContent
.
prototype
.
IsBlockLevelSdtContent
=
function
()
{
return
(
this
.
Parent
&&
this
.
Parent
instanceof
CBlockLevelSdt
);
};
function
CDocumentContentStartState
(
DocContent
)
function
CDocumentContentStartState
(
DocContent
)
{
{
...
...
This diff is collapsed.
Click to expand it.
word/Editor/DocumentContentBase.js
View file @
34881e03
...
@@ -702,3 +702,7 @@ CDocumentContentBase.prototype.private_Remove = function(Count, bOnlyText, bRemo
...
@@ -702,3 +702,7 @@ CDocumentContentBase.prototype.private_Remove = function(Count, bOnlyText, bRemo
}
}
};
};
CDocumentContentBase
.
prototype
.
IsBlockLevelSdtContent
=
function
()
{
return
false
;
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
word/Editor/Paragraph/ParaDrawing.js
View file @
34881e03
...
@@ -1098,8 +1098,12 @@ ParaDrawing.prototype.Update_Position = function(Paragraph, ParaLayout, PageLimi
...
@@ -1098,8 +1098,12 @@ ParaDrawing.prototype.Update_Position = function(Paragraph, ParaLayout, PageLimi
this
.
PositionV
.
Percent
=
this
.
PositionV_Old
.
Percent2
;
this
.
PositionV
.
Percent
=
this
.
PositionV_Old
.
Percent2
;
}
}
var
oDocumentContent
=
this
.
Parent
.
Parent
;
if
(
oDocumentContent
&&
oDocumentContent
.
IsBlockLevelSdtContent
())
oDocumentContent
=
oDocumentContent
.
Parent
.
Parent
;
this
.
Parent
=
Paragraph
;
this
.
Parent
=
Paragraph
;
this
.
DocumentContent
=
this
.
Parent
.
Par
ent
;
this
.
DocumentContent
=
oDocumentCont
ent
;
var
PageNum
=
ParaLayout
.
PageNum
;
var
PageNum
=
ParaLayout
.
PageNum
;
var
OtherFlowObjects
=
editor
.
WordControl
.
m_oLogicDocument
.
DrawingObjects
.
getAllFloatObjectsOnPage
(
PageNum
,
this
.
Parent
.
Parent
);
var
OtherFlowObjects
=
editor
.
WordControl
.
m_oLogicDocument
.
DrawingObjects
.
getAllFloatObjectsOnPage
(
PageNum
,
this
.
Parent
.
Parent
);
...
...
This diff is collapsed.
Click to expand it.
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
34881e03
...
@@ -82,6 +82,8 @@ CBlockLevelSdt.prototype.Reset = function(X, Y, XLimit, YLimit, PageAbs, ColumnA
...
@@ -82,6 +82,8 @@ CBlockLevelSdt.prototype.Reset = function(X, Y, XLimit, YLimit, PageAbs, ColumnA
};
};
CBlockLevelSdt
.
prototype
.
Recalculate_Page
=
function
(
CurPage
)
CBlockLevelSdt
.
prototype
.
Recalculate_Page
=
function
(
CurPage
)
{
{
this
.
Content
.
RecalcInfo
=
this
.
Parent
.
RecalcInfo
;
var
RecalcResult
=
this
.
Content
.
Recalculate_Page
(
CurPage
,
true
);
var
RecalcResult
=
this
.
Content
.
Recalculate_Page
(
CurPage
,
true
);
if
(
recalcresult2_End
===
RecalcResult
)
if
(
recalcresult2_End
===
RecalcResult
)
...
@@ -687,6 +689,18 @@ CBlockLevelSdt.prototype.CheckTableCoincidence = function(Table)
...
@@ -687,6 +689,18 @@ CBlockLevelSdt.prototype.CheckTableCoincidence = function(Table)
{
{
return
this
.
Parent
.
CheckTableCoincidence
(
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--------------------------------------------------------
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
...
...
This diff is collapsed.
Click to expand it.
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