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
7aa2e268
Commit
7aa2e268
authored
Sep 27, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 35913
parent
b303baef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
58 deletions
+77
-58
cell/model/clipboard.js
cell/model/clipboard.js
+23
-7
common/wordcopypaste.js
common/wordcopypaste.js
+54
-51
No files found.
cell/model/clipboard.js
View file @
7aa2e268
...
...
@@ -2649,6 +2649,7 @@
pasteTextOnSheet
:
function
(
worksheet
,
text
)
{
var
t
=
this
;
if
(
!
text
||
(
text
&&
!
text
.
length
))
{
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
...
...
@@ -2670,15 +2671,30 @@
}
var
Count
=
text
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
newParagraph
=
new
Paragraph
(
isIntoShape
.
DrawingDocument
,
isIntoShape
);
var
selectedElements
=
new
CSelectedContent
();
var
insertText
=
""
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
_char
=
text
.
charAt
(
Index
);
if
(
"
"
==
_char
)
isIntoShape
.
AddToParagraph
(
new
ParaSpace
());
else
isIntoShape
.
AddToParagraph
(
new
ParaText
(
_char
));
var
_charCode
=
text
.
charCodeAt
(
Index
);
if
(
_charCode
===
0x0A
||
Index
===
Count
-
1
){
var
newParaRun
=
new
ParaRun
();
window
[
'
AscCommon
'
].
addTextIntoRun
(
newParaRun
,
insertText
);
newParagraph
.
Internal_Content_Add
(
newParagraph
.
Content
.
length
-
1
,
newParaRun
,
false
);
var
selectedElement
=
new
CSelectedElement
();
selectedElement
.
Element
=
newParagraph
;
selectedElements
.
Elements
.
push
(
selectedElement
);
insertText
=
""
;
newParagraph
=
new
Paragraph
(
isIntoShape
.
DrawingDocument
,
isIntoShape
);
}
else
{
insertText
+=
_char
;
}
}
t
.
_insertSelectedContentIntoShapeContent
(
worksheet
,
selectedElements
,
isIntoShape
);
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteButtonProps
=
{};
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
...
...
common/wordcopypaste.js
View file @
7aa2e268
...
...
@@ -2557,7 +2557,7 @@ PasteProcessor.prototype =
if
(
mathText
&&
mathText
.
str
)
{
var
newParaRun
=
new
ParaRun
();
this
.
_
addTextIntoRun
(
newParaRun
,
mathText
.
str
);
addTextIntoRun
(
newParaRun
,
mathText
.
str
);
res
=
newParaRun
;
}
...
...
@@ -2613,7 +2613,7 @@ PasteProcessor.prototype =
bIsAddTabBefore
=
true
;
}
t
.
_
addTextIntoRun
(
newParaRun
,
value
,
bIsAddTabBefore
,
true
);
addTextIntoRun
(
newParaRun
,
value
,
bIsAddTabBefore
,
true
);
newParagraph
.
Internal_Content_Add
(
newParagraph
.
Content
.
length
-
1
,
newParaRun
,
false
);
}
...
...
@@ -2649,7 +2649,7 @@ PasteProcessor.prototype =
var
numberingText
=
this
.
_getNumberingText
(
lvl
,
NumInfo
,
NumTextPr
,
lvl
);
var
newParaRun
=
new
ParaRun
();
this
.
_
addTextIntoRun
(
newParaRun
,
numberingText
,
false
,
true
,
true
);
addTextIntoRun
(
newParaRun
,
numberingText
,
false
,
true
,
true
);
paragraph
.
Internal_Content_Add
(
0
,
newParaRun
,
false
);
}
},
...
...
@@ -2825,53 +2825,6 @@ PasteProcessor.prototype =
return
Char
;
},
_addTextIntoRun
:
function
(
oCurRun
,
value
,
bIsAddTabBefore
,
dNotAddLastSpace
,
bIsAddTabAfter
)
{
var
diffContentIndex
=
0
;
if
(
bIsAddTabBefore
){
diffContentIndex
=
1
;
oCurRun
.
Add_ToContent
(
0
,
new
ParaTab
(),
false
);
}
for
(
var
k
=
0
,
length
=
value
.
length
;
k
<
length
;
k
++
)
{
var
nUnicode
=
null
;
var
nCharCode
=
value
.
charCodeAt
(
k
);
if
(
AscCommon
.
isLeadingSurrogateChar
(
nCharCode
))
{
if
(
k
+
1
<
length
)
{
k
++
;
var
nTrailingChar
=
value
.
charCodeAt
(
k
);
nUnicode
=
AscCommon
.
decodeSurrogateChar
(
nCharCode
,
nTrailingChar
);
}
}
else
nUnicode
=
nCharCode
;
var
bIsSpace
=
true
;
if
(
null
!=
nUnicode
)
{
var
Item
;
if
(
0x20
!==
nUnicode
&&
0xA0
!==
nUnicode
&&
0x2009
!==
nUnicode
)
{
Item
=
new
ParaText
();
Item
.
Set_CharCode
(
nUnicode
);
bIsSpace
=
false
;
}
else
if
(
0x2009
===
nUnicode
){
Item
=
new
ParaTab
();
}
else
Item
=
new
ParaSpace
();
//add text
if
(
!
(
dNotAddLastSpace
&&
k
===
value
.
length
-
1
&&
bIsSpace
)){
oCurRun
.
Add_ToContent
(
k
+
diffContentIndex
,
Item
,
false
);
}
}
}
if
(
bIsAddTabAfter
){
oCurRun
.
Add_ToContent
(
oCurRun
.
Content
.
length
,
new
ParaTab
(),
false
);
}
},
//***end special paste***
InsertInPlacePresentation
:
function
(
aNewContent
)
...
...
@@ -4429,7 +4382,7 @@ PasteProcessor.prototype =
var
_charCode
=
text
.
charCodeAt
(
Index
);
if
(
_charCode
===
0x0A
||
Index
===
Count
-
1
){
var
newParaRun
=
new
ParaRun
();
this
.
_
addTextIntoRun
(
newParaRun
,
insertText
);
addTextIntoRun
(
newParaRun
,
insertText
);
newParagraph
.
Internal_Content_Add
(
newParagraph
.
Content
.
length
-
1
,
newParaRun
,
false
);
this
.
aContent
.
push
(
newParagraph
);
...
...
@@ -8652,6 +8605,54 @@ function Check_LoadingDataBeforePrepaste(_api, _fonts, _images, _callback)
_api
.
pre_Paste
(
aPrepeareFonts
,
_images
,
_callback
);
}
function
addTextIntoRun
(
oCurRun
,
value
,
bIsAddTabBefore
,
dNotAddLastSpace
,
bIsAddTabAfter
)
{
var
diffContentIndex
=
0
;
if
(
bIsAddTabBefore
){
diffContentIndex
=
1
;
oCurRun
.
Add_ToContent
(
0
,
new
ParaTab
(),
false
);
}
for
(
var
k
=
0
,
length
=
value
.
length
;
k
<
length
;
k
++
)
{
var
nUnicode
=
null
;
var
nCharCode
=
value
.
charCodeAt
(
k
);
if
(
AscCommon
.
isLeadingSurrogateChar
(
nCharCode
))
{
if
(
k
+
1
<
length
)
{
k
++
;
var
nTrailingChar
=
value
.
charCodeAt
(
k
);
nUnicode
=
AscCommon
.
decodeSurrogateChar
(
nCharCode
,
nTrailingChar
);
}
}
else
nUnicode
=
nCharCode
;
var
bIsSpace
=
true
;
if
(
null
!=
nUnicode
)
{
var
Item
;
if
(
0x20
!==
nUnicode
&&
0xA0
!==
nUnicode
&&
0x2009
!==
nUnicode
)
{
Item
=
new
ParaText
();
Item
.
Set_CharCode
(
nUnicode
);
bIsSpace
=
false
;
}
else
if
(
0x2009
===
nUnicode
){
Item
=
new
ParaTab
();
}
else
Item
=
new
ParaSpace
();
//add text
if
(
!
(
dNotAddLastSpace
&&
k
===
value
.
length
-
1
&&
bIsSpace
)){
oCurRun
.
Add_ToContent
(
k
+
diffContentIndex
,
Item
,
false
);
}
}
}
if
(
bIsAddTabAfter
){
oCurRun
.
Add_ToContent
(
oCurRun
.
Content
.
length
,
new
ParaTab
(),
false
);
}
}
function
SpecialPasteShowOptions
()
{
this
.
options
=
[];
...
...
@@ -8680,6 +8681,8 @@ SpecialPasteShowOptions.prototype = {
window
[
"
AscCommon
"
].
sendImgUrls
=
sendImgUrls
;
window
[
"
AscCommon
"
].
PasteProcessor
=
PasteProcessor
;
window
[
"
AscCommon
"
].
addTextIntoRun
=
addTextIntoRun
;
window
[
"
AscCommon
"
].
PasteElementsId
=
PasteElementsId
;
window
[
"
Asc
"
][
"
SpecialPasteShowOptions
"
]
=
window
[
"
Asc
"
].
SpecialPasteShowOptions
=
SpecialPasteShowOptions
;
...
...
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