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
3e7c331f
Commit
3e7c331f
authored
Apr 26, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drawing a frame around CBlockLevelSdt.
parent
f6ef2884
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
109 additions
and
8 deletions
+109
-8
word/Editor/Document.js
word/Editor/Document.js
+27
-0
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+12
-0
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+4
-0
word/Editor/DocumentControllerBase.js
word/Editor/DocumentControllerBase.js
+5
-0
word/Editor/DrawingsController.js
word/Editor/DrawingsController.js
+7
-0
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+7
-0
word/Editor/HeaderFooterController.js
word/Editor/HeaderFooterController.js
+7
-0
word/Editor/LogicDocumentController.js
word/Editor/LogicDocumentController.js
+4
-0
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+4
-0
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+25
-8
word/Editor/Table.js
word/Editor/Table.js
+7
-0
No files found.
word/Editor/Document.js
View file @
3e7c331f
...
...
@@ -15011,6 +15011,18 @@ CDocument.prototype.controller_GetCurrentSectionPr = function()
var
nContentPos
=
this
.
CurPos
.
ContentPos
;
return
this
.
SectionsInfo
.
Get_SectPr
(
nContentPos
).
SectPr
;
};
CDocument
.
prototype
.
controller_IsInBlockLevelSdt
=
function
()
{
if
(
false
===
this
.
Selection
.
Use
||
this
.
Selection
.
StartPos
===
this
.
Selection
.
EndPos
)
{
if
(
true
===
this
.
Selection
.
Use
)
return
this
.
Content
[
this
.
Selection
.
StartPos
].
IsInBlockLevelSdt
(
null
);
else
return
this
.
Content
[
this
.
CurPos
.
ContentPos
].
IsInBlockLevelSdt
(
null
);
}
return
null
;
};
//----------------------------------------------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -15124,6 +15136,21 @@ CDocument.prototype.MoveToFillingForm = function(bNext)
this
.
Document_UpdateSelectionState
();
}
};
CDocument
.
prototype
.
DrawContentControls
=
function
(
PageAbs
,
MouseX
,
MouseY
,
MousePage
)
{
var
oBlockLevelSdt
=
this
.
Controller
.
IsInBlockLevelSdt
();
if
(
null
!==
oBlockLevelSdt
)
{
oBlockLevelSdt
.
DrawContentControls
(
PageAbs
);
}
else
if
(
PageAbs
===
MousePage
)
{
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
MouseX
,
MouseY
,
MousePage
);
var
Item
=
this
.
Content
[
ContentPos
];
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
MouseX
,
MouseY
,
MousePage
);
//Item.DrawContentControls(MouseX, MouseY, MousePage);
}
};
function
CDocumentSelectionState
()
{
...
...
word/Editor/DocumentContent.js
View file @
3e7c331f
...
...
@@ -8479,6 +8479,18 @@ CDocumentContent.prototype.IsBlockLevelSdtContent = function()
{
return
(
this
.
Parent
&&
this
.
Parent
instanceof
CBlockLevelSdt
);
};
CDocumentContent
.
prototype
.
IsInBlockLevelSdt
=
function
(
oBlockLevelSdt
)
{
if
(
false
===
this
.
Selection
.
Use
||
this
.
Selection
.
StartPos
===
this
.
Selection
.
EndPos
)
{
if
(
true
===
this
.
Selection
.
Use
)
return
this
.
Content
[
this
.
Selection
.
StartPos
].
IsInBlockLevelSdt
(
oBlockLevelSdt
);
else
return
this
.
Content
[
this
.
CurPos
.
ContentPos
].
IsInBlockLevelSdt
(
oBlockLevelSdt
);
}
return
oBlockLevelSdt
;
};
function
CDocumentContentStartState
(
DocContent
)
{
...
...
word/Editor/DocumentContentElementBase.js
View file @
3e7c331f
...
...
@@ -571,6 +571,10 @@ CDocumentContentElementBase.prototype.GetSelectionAnchorPos = function()
{
return
null
;
};
CDocumentContentElementBase
.
prototype
.
IsInBlockLevelSdt
=
function
(
oBlockLevelSdt
)
{
return
this
.
Content
.
IsInBlockLevelSdt
(
this
);
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/DocumentControllerBase.js
View file @
3e7c331f
...
...
@@ -732,3 +732,8 @@ CDocumentControllerBase.prototype.GetCurrentSectionPr = function(){return null;}
* Отличие от RemoveSelection в том, что сбрасываем селект с текста, но не сбрасываем с автофигур
*/
CDocumentControllerBase
.
prototype
.
RemoveTextSelection
=
function
(){};
/**
* Если выделение или курсор находятся в контейнере - получаем его.
* @returns {CBlockLevelSdt?}
*/
CDocumentControllerBase
.
prototype
.
IsInBlockLevelSdt
=
function
(){
return
null
;};
word/Editor/DrawingsController.js
View file @
3e7c331f
...
...
@@ -517,4 +517,11 @@ CDrawingsController.prototype.RemoveTextSelection = function()
{
this
.
DrawingObjects
.
removeTextSelection
();
};
CDrawingsController
.
prototype
.
IsInBlockLevelSdt
=
function
()
{
var
oTargetTextObject
=
AscFormat
.
getTargetTextObject
(
this
.
DrawingObjects
);
if
(
oTargetTextObject
)
return
oTargetTextObject
.
IsInBlockLevelSdt
(
null
);
return
null
;
};
word/Editor/Footnotes.js
View file @
3e7c331f
...
...
@@ -3218,6 +3218,13 @@ CFootnotesController.prototype.ResetRecalculateCache = function()
this
.
Footnote
[
Id
].
Reset_RecalculateCache
();
}
};
CFootnotesController
.
prototype
.
IsInBlockLevelSdt
=
function
()
{
if
(
true
!==
this
.
Selection
.
Use
||
0
===
this
.
Selection
.
Direction
)
return
this
.
CurFootnote
.
IsInBlockLevelSdt
(
null
);
return
null
;
};
function
CFootEndnotePageColumn
()
...
...
word/Editor/HeaderFooterController.js
View file @
3e7c331f
...
...
@@ -481,4 +481,11 @@ CHdrFtrController.prototype.RemoveTextSelection = function()
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
if
(
null
!=
CurHdrFtr
)
return
CurHdrFtr
.
Content
.
RemoveTextSelection
();
};
CHdrFtrController
.
prototype
.
IsInBlockLevelSdt
=
function
()
{
if
(
this
.
HdrFtr
.
CurHdrFtr
)
return
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
IsInBlockLevelSdt
(
null
);
return
null
;
};
\ No newline at end of file
word/Editor/LogicDocumentController.js
View file @
3e7c331f
...
...
@@ -377,4 +377,8 @@ CLogicDocumentController.prototype.GetCurrentSectionPr = function()
CLogicDocumentController
.
prototype
.
RemoveTextSelection
=
function
()
{
return
this
.
RemoveSelection
();
};
CLogicDocumentController
.
prototype
.
IsInBlockLevelSdt
=
function
()
{
return
this
.
LogicDocument
.
controller_IsInBlockLevelSdt
();
};
\ No newline at end of file
word/Editor/Paragraph.js
View file @
3e7c331f
...
...
@@ -12094,6 +12094,10 @@ Paragraph.prototype.GetCurrentParagraph = function()
{
return
this
;
};
Paragraph
.
prototype
.
IsInBlockLevelSdt
=
function
(
oBlockLevelSdt
)
{
return
oBlockLevelSdt
;
};
var
pararecalc_0_All
=
0
;
var
pararecalc_0_None
=
1
;
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
3e7c331f
...
...
@@ -126,14 +126,6 @@ CBlockLevelSdt.prototype.Read_FromBinary2 = function(Reader)
CBlockLevelSdt
.
prototype
.
Draw
=
function
(
CurPage
,
oGraphics
)
{
this
.
Content
.
Draw
(
CurPage
,
oGraphics
);
var
oPageBounds
=
this
.
GetPageBounds
(
CurPage
);
oGraphics
.
p_color
(
0
,
0
,
255
,
255
);
oGraphics
.
drawVerLine
(
0
,
oPageBounds
.
Left
,
oPageBounds
.
Top
,
oPageBounds
.
Bottom
,
0
);
oGraphics
.
drawVerLine
(
0
,
oPageBounds
.
Right
,
oPageBounds
.
Top
,
oPageBounds
.
Bottom
,
0
);
oGraphics
.
drawHorLine
(
0
,
oPageBounds
.
Top
,
oPageBounds
.
Left
,
oPageBounds
.
Right
,
0
);
oGraphics
.
drawHorLine
(
0
,
oPageBounds
.
Bottom
,
oPageBounds
.
Left
,
oPageBounds
.
Right
,
0
);
};
CBlockLevelSdt
.
prototype
.
Get_CurrentPage_Absolute
=
function
()
{
...
...
@@ -571,6 +563,31 @@ CBlockLevelSdt.prototype.GetSelectionAnchorPos = function()
{
return
this
.
Content
.
GetSelectionAnchorPos
();
};
CBlockLevelSdt
.
prototype
.
IsInBlockLevelSdt
=
function
(
oBlockLevelSdt
)
{
return
this
.
Content
.
IsInBlockLevelSdt
(
this
);
};
CBlockLevelSdt
.
prototype
.
DrawContentControls
=
function
(
PageAbs
)
{
var
oDrawingDocument
=
this
.
LogicDocument
.
Get_DrawingDocument
();
var
arrRects
=
[];
for
(
var
nCurPage
=
0
,
nPagesCount
=
this
.
GetPagesCount
();
nCurPage
<
nPagesCount
;
++
nCurPage
)
{
var
nCurPageAbs
=
this
.
Get_AbsolutePage
(
nCurPage
);
if
(
nCurPageAbs
===
PageAbs
)
{
var
oBounds
=
this
.
GetPageBounds
(
nCurPage
);
arrRects
.
push
({
X
:
oBounds
.
Left
,
Y
:
oBounds
.
Top
,
R
:
oBounds
.
Right
,
B
:
oBounds
.
Bottom
});
}
else
if
(
nCurPageAbs
>
PageAbs
)
{
break
;
}
}
oDrawingDocument
.
DrawContentControl
(
this
.
GetId
(),
c_oContentControlTrack
.
In
,
PageAbs
,
arrRects
);
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt
.
prototype
.
Is_HdrFtr
=
function
(
bReturnHdrFtr
)
{
...
...
word/Editor/Table.js
View file @
3e7c331f
...
...
@@ -11999,6 +11999,13 @@ CTable.prototype.GetTableProps = function()
{
return
this
.
Get_Props
();
};
CTable
.
prototype
.
IsInBlockLevelSdt
=
function
(
oBlockLevelSdt
)
{
if
(
true
!==
this
.
Selection
.
Use
||
table_Selection_Text
===
this
.
Selection
.
Type
)
return
this
.
CurCell
.
Content
.
IsInBlockLevelSdt
(
oBlockLevelSdt
);
return
oBlockLevelSdt
;
};
//----------------------------------------------------------------------------------------------------------------------
// Класс CTableLook
//----------------------------------------------------------------------------------------------------------------------
...
...
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