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
a688ab64
Commit
a688ab64
authored
Apr 26, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed several problems with working with content control track.
parent
3fdb8aa7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
5 deletions
+56
-5
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+2
-4
word/Editor/Document.js
word/Editor/Document.js
+49
-0
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+4
-0
word/Editor/Table/TableCell.js
word/Editor/Table/TableCell.js
+1
-1
No files found.
word/Drawing/DrawingDocument.js
View file @
a688ab64
...
@@ -6246,6 +6246,7 @@ function CDrawingDocument()
...
@@ -6246,6 +6246,7 @@ function CDrawingDocument()
var
_old
=
this
.
ContentControlObjectState
;
var
_old
=
this
.
ContentControlObjectState
;
if
(
pos
.
X
>
_x
&&
pos
.
X
<
_r
&&
pos
.
Y
>
_y
&&
pos
.
Y
<
_b
)
if
(
pos
.
X
>
_x
&&
pos
.
X
<
_r
&&
pos
.
Y
>
_y
&&
pos
.
Y
<
_b
)
{
{
oWordControl
.
m_oLogicDocument
.
SelectContentControl
(
this
.
ContentControlObject
.
id
);
this
.
ContentControlObjectState
=
1
;
this
.
ContentControlObjectState
=
1
;
this
.
InlineTextTrackEnabled
=
true
;
this
.
InlineTextTrackEnabled
=
true
;
...
@@ -6459,16 +6460,13 @@ function CDrawingDocument()
...
@@ -6459,16 +6460,13 @@ function CDrawingDocument()
if
(
this
.
InlineTextTrack
)
// значит был MouseMove
if
(
this
.
InlineTextTrack
)
// значит был MouseMove
{
{
this
.
InlineTextTrack
=
oWordControl
.
m_oLogicDocument
.
Get_NearestPos
(
pos
.
Page
,
pos
.
X
,
pos
.
Y
);
this
.
InlineTextTrack
=
oWordControl
.
m_oLogicDocument
.
Get_NearestPos
(
pos
.
Page
,
pos
.
X
,
pos
.
Y
);
// TODO:
this
.
m_oWordControl
.
m_oLogicDocument
.
OnContentControlTrackEnd
(
this
.
ContentControlObject
.
id
,
this
.
InlineTextTrack
,
AscCommon
.
global_keyboardEvent
.
CtrlKey
);
//this.m_oWordControl.m_oLogicDocument.On_ContentControlTrackEnd(this.ContentControlObject.id, this.InlineTextTrack, AscCommon.global_keyboardEvent.CtrlKey);
this
.
InlineTextTrackEnabled
=
false
;
this
.
InlineTextTrackEnabled
=
false
;
this
.
InlineTextTrack
=
null
;
this
.
InlineTextTrack
=
null
;
this
.
InlineTextTrackPage
=
-
1
;
this
.
InlineTextTrackPage
=
-
1
;
}
}
else
else
{
{
// TODO: Select?
this
.
InlineTextTrackEnabled
=
false
;
this
.
InlineTextTrackEnabled
=
false
;
}
}
}
}
...
...
word/Editor/Document.js
View file @
a688ab64
...
@@ -15145,6 +15145,9 @@ CDocument.prototype.MoveToFillingForm = function(bNext)
...
@@ -15145,6 +15145,9 @@ CDocument.prototype.MoveToFillingForm = function(bNext)
};
};
CDocument
.
prototype
.
DrawContentControls
=
function
(
PageAbs
,
MouseX
,
MouseY
,
MousePage
)
CDocument
.
prototype
.
DrawContentControls
=
function
(
PageAbs
,
MouseX
,
MouseY
,
MousePage
)
{
{
if
(
null
!==
this
.
FullRecalc
.
Id
&&
(
this
.
FullRecalc
.
PageIndex
<
PageAbs
||
this
.
FullRecalc
.
PageIndex
<
MousePage
))
return
false
;
var
oBlockLevelSdt
=
this
.
Controller
.
IsInBlockLevelSdt
();
var
oBlockLevelSdt
=
this
.
Controller
.
IsInBlockLevelSdt
();
if
(
null
!==
oBlockLevelSdt
)
if
(
null
!==
oBlockLevelSdt
)
{
{
...
@@ -15155,6 +15158,52 @@ CDocument.prototype.DrawContentControls = function(PageAbs, MouseX, MouseY, Mous
...
@@ -15155,6 +15158,52 @@ CDocument.prototype.DrawContentControls = function(PageAbs, MouseX, MouseY, Mous
this
.
Controller
.
DrawContentControlsHover
(
MouseX
,
MouseY
,
MousePage
);
this
.
Controller
.
DrawContentControlsHover
(
MouseX
,
MouseY
,
MousePage
);
}
}
};
};
CDocument
.
prototype
.
SelectContentControl
=
function
(
Id
)
{
var
oBlockLevelSdt
=
this
.
TableId
.
Get_ById
(
Id
);
if
(
oBlockLevelSdt
)
{
this
.
RemoveSelection
();
oBlockLevelSdt
.
SelectAll
(
1
);
oBlockLevelSdt
.
Set_CurrentElement
(
false
,
0
,
oBlockLevelSdt
.
Content
);
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateSelectionState
();
}
};
CDocument
.
prototype
.
OnContentControlTrackEnd
=
function
(
Id
,
NearestPos
,
isCopy
)
{
if
(
true
===
this
.
Comments
.
Is_Use
())
{
this
.
Select_Comment
(
null
,
false
);
editor
.
sync_HideComment
();
}
var
oParagraph
=
NearestPos
.
Paragraph
;
// Сначала нам надо проверить попадаем ли мы обратно в выделенный текст, если да, тогда ничего не делаем,
// а если нет, тогда удаляем выделенный текст и вставляем его в заданное место.
if
(
true
===
this
.
CheckPosInSelection
(
0
,
0
,
0
,
NearestPos
))
{
this
.
RemoveSelection
();
// Нам надо снять селект и поставить курсор в то место, где была ближайшая позиция
oParagraph
.
Cursor_MoveToNearPos
(
NearestPos
);
oParagraph
.
Document_SetThisElementCurrent
(
false
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateRulersState
();
}
else
{
console
.
log
(
"
нормально
"
);
}
};
function
CDocumentSelectionState
()
function
CDocumentSelectionState
()
{
{
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
a688ab64
...
@@ -113,14 +113,18 @@ CBlockLevelSdt.prototype.Reset_RecalculateCache = function()
...
@@ -113,14 +113,18 @@ CBlockLevelSdt.prototype.Reset_RecalculateCache = function()
CBlockLevelSdt
.
prototype
.
Write_ToBinary2
=
function
(
Writer
)
CBlockLevelSdt
.
prototype
.
Write_ToBinary2
=
function
(
Writer
)
{
{
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_BlockLevelSdt
);
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_BlockLevelSdt
);
// String : Id
// String : Content id
// String : Content id
Writer
.
WriteString2
(
this
.
GetId
());
Writer
.
WriteString2
(
this
.
Content
.
GetId
());
Writer
.
WriteString2
(
this
.
Content
.
GetId
());
};
};
CBlockLevelSdt
.
prototype
.
Read_FromBinary2
=
function
(
Reader
)
CBlockLevelSdt
.
prototype
.
Read_FromBinary2
=
function
(
Reader
)
{
{
this
.
LogicDocument
=
editor
.
WordControl
.
m_oLogicDocument
;
this
.
LogicDocument
=
editor
.
WordControl
.
m_oLogicDocument
;
// String : Id
// String : Content id
// String : Content id
this
.
Id
=
Reader
.
GetString2
();
this
.
Content
=
this
.
LogicDocument
.
Get_TableId
().
Get_ById
(
Reader
.
GetString2
());
this
.
Content
=
this
.
LogicDocument
.
Get_TableId
().
Get_ById
(
Reader
.
GetString2
());
};
};
CBlockLevelSdt
.
prototype
.
Draw
=
function
(
CurPage
,
oGraphics
)
CBlockLevelSdt
.
prototype
.
Draw
=
function
(
CurPage
,
oGraphics
)
...
...
word/Editor/Table/TableCell.js
View file @
a688ab64
...
@@ -1792,7 +1792,7 @@ CTableCell.prototype =
...
@@ -1792,7 +1792,7 @@ CTableCell.prototype =
{
{
}
}
};
};
CTableCell
.
private_TransformXY
=
function
(
X
,
Y
)
CTableCell
.
pr
ototype
.
pr
ivate_TransformXY
=
function
(
X
,
Y
)
{
{
// TODO: Везде, где идет такой код заменить на данную функцию
// TODO: Везде, где идет такой код заменить на данную функцию
...
...
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