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
9779307c
Commit
9779307c
authored
Nov 22, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't insert text in formulas
parent
5cf688d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
cell/model/clipboard.js
cell/model/clipboard.js
+36
-2
slide/Editor/Format/Presentation.js
slide/Editor/Format/Presentation.js
+32
-0
No files found.
cell/model/clipboard.js
View file @
9779307c
...
...
@@ -1136,10 +1136,44 @@
if
(
null
!=
paragraph
&&
type_Paragraph
==
paragraph
.
GetType
()
&&
selectedContent
.
Elements
&&
selectedContent
.
Elements
.
length
)
{
var
NearPos
=
{
Paragraph
:
paragraph
,
ContentPos
:
paragraph
.
Get_ParaContentPos
(
false
,
false
)};
paragraph
.
Check_NearestPos
(
NearPos
);
NearPos
=
{
Paragraph
:
paragraph
,
ContentPos
:
paragraph
.
Get_ParaContentPos
(
false
,
false
)
};
paragraph
.
Check_NearestPos
(
NearPos
);
var
ParaNearPos
=
NearPos
.
Paragraph
.
Get_ParaNearestPos
(
NearPos
);
if
(
null
===
ParaNearPos
||
ParaNearPos
.
Classes
.
length
<
2
)
return
;
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
if
(
para_Math_Run
===
LastClass
.
Type
)
{
// Проверяем, что вставляемый контент тоже формула
var
Element
=
selectedContent
.
Elements
[
0
].
Element
;
if
(
1
!==
selectedContent
.
Elements
.
length
||
type_Paragraph
!==
Element
.
Get_Type
()
||
null
===
LastClass
.
Parent
)
return
;
var
Math
=
null
;
var
Count
=
Element
.
Content
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
Item
=
Element
.
Content
[
Index
];
if
(
para_Math
===
Item
.
Type
&&
null
===
Math
)
Math
=
Element
.
Content
[
Index
];
else
if
(
true
!==
Item
.
Is_Empty
({
SkipEnd
:
true
}))
return
;
}
}
else
if
(
para_Run
!==
LastClass
.
Type
)
return
;
if
(
null
===
paragraph
.
Parent
||
undefined
===
paragraph
.
Parent
)
return
;
paragraph
.
Check_NearestPos
(
NearPos
);
target_doc_content
.
Insert_Content
(
selectedContent
,
NearPos
);
worksheet
.
objectRender
.
controller
.
cursorMoveRight
(
false
,
false
)
worksheet
.
objectRender
.
controller
.
cursorMoveRight
(
false
,
false
)
;
var
oTargetTextObject
=
AscFormat
.
getTargetTextObject
(
worksheet
.
objectRender
.
controller
);
oTargetTextObject
&&
oTargetTextObject
.
checkExtentsByDocContent
&&
oTargetTextObject
.
checkExtentsByDocContent
();
...
...
slide/Editor/Format/Presentation.js
View file @
9779307c
...
...
@@ -4050,6 +4050,38 @@ CPresentation.prototype =
{
NearPos
=
{
Paragraph
:
paragraph
,
ContentPos
:
paragraph
.
Get_ParaContentPos
(
false
,
false
)
};
paragraph
.
Check_NearestPos
(
NearPos
);
var
ParaNearPos
=
NearPos
.
Paragraph
.
Get_ParaNearestPos
(
NearPos
);
if
(
null
===
ParaNearPos
||
ParaNearPos
.
Classes
.
length
<
2
)
return
;
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
if
(
para_Math_Run
===
LastClass
.
Type
)
{
// Проверяем, что вставляемый контент тоже формула
var
Element
=
Content
.
DocContent
.
Elements
[
0
].
Element
;
if
(
1
!==
Content
.
DocContent
.
Elements
.
length
||
type_Paragraph
!==
Element
.
Get_Type
()
||
null
===
LastClass
.
Parent
)
return
;
var
Math
=
null
;
var
Count
=
Element
.
Content
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
Item
=
Element
.
Content
[
Index
];
if
(
para_Math
===
Item
.
Type
&&
null
===
Math
)
Math
=
Element
.
Content
[
Index
];
else
if
(
true
!==
Item
.
Is_Empty
({
SkipEnd
:
true
}))
return
;
}
}
else
if
(
para_Run
!==
LastClass
.
Type
)
return
;
if
(
null
===
paragraph
.
Parent
||
undefined
===
paragraph
.
Parent
)
return
;
target_doc_content
.
Insert_Content
(
Content
.
DocContent
,
NearPos
);
}
var
oTargetTextObject
=
AscFormat
.
getTargetTextObject
(
this
.
Slides
[
this
.
CurPage
].
graphicObjects
);
...
...
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