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
f2b176e7
Commit
f2b176e7
authored
Jun 29, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
paste text on sheet(cell)
parent
d69afa12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
cell/model/clipboard.js
cell/model/clipboard.js
+53
-2
No files found.
cell/model/clipboard.js
View file @
f2b176e7
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
}
}
else
else
{
{
t
.
pasteProcessor
.
editorPasteExec
(
ws
,
data1
,
true
);
t
.
pasteProcessor
.
pasteTextOnSheet
(
ws
,
data1
);
}
}
break
;
break
;
...
@@ -1038,7 +1038,7 @@
...
@@ -1038,7 +1038,7 @@
},
true
);
},
true
);
},
},
editorPasteExec
:
function
(
worksheet
,
node
,
isText
,
onlyFromLocalStorage
)
editorPasteExec
:
function
(
worksheet
,
node
,
isText
,
onlyFromLocalStorage
)
{
{
if
(
node
==
undefined
)
if
(
node
==
undefined
)
return
;
return
;
...
@@ -1726,6 +1726,57 @@
...
@@ -1726,6 +1726,57 @@
style
=
'
style = "text-decoration:
'
+
underline
+
"
;
"
+
"
font-style:
"
+
italic
+
"
;
"
+
"
font-weight:
"
+
bold
+
"
;
"
+
'
"
'
;
style
=
'
style = "text-decoration:
'
+
underline
+
"
;
"
+
"
font-style:
"
+
italic
+
"
;
"
+
"
font-weight:
"
+
bold
+
"
;
"
+
'
"
'
;
$
(
oldElem
).
replaceWith
(
"
<span
"
+
style
+
"
>
"
+
value
+
"
</span>
"
);
$
(
oldElem
).
replaceWith
(
"
<span
"
+
style
+
"
>
"
+
value
+
"
</span>
"
);
};
};
},
pasteTextOnSheet
:
function
(
worksheet
,
text
)
{
//TODO сделать вставку текста всегда через эту функцию
this
.
activeRange
=
worksheet
.
activeRange
.
clone
(
true
);
//если находимся внутри шейпа
var
isIntoShape
=
worksheet
.
objectRender
.
controller
.
getTargetDocContent
();
if
(
isIntoShape
)
{
var
callback
=
function
(
isSuccess
)
{
if
(
isSuccess
===
false
)
{
return
false
;
}
var
Count
=
text
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
_char
=
text
.
charAt
(
Index
);
if
(
"
"
==
_char
)
isIntoShape
.
Paragraph_Add
(
new
ParaSpace
());
else
isIntoShape
.
Paragraph_Add
(
new
ParaText
(
_char
));
}
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
return
;
}
var
aResult
=
[];
aResult
[
this
.
activeRange
.
r1
]
=
[];
var
oNewItem
=
[];
oNewItem
[
0
]
=
this
.
_getDefaultCell
(
worksheet
);
aResult
[
this
.
activeRange
.
r1
][
this
.
activeRange
.
c1
]
=
oNewItem
;
oNewItem
[
0
][
0
].
text
=
text
;
aResult
.
fontsNew
=
[];
aResult
.
rowSpanSpCount
=
0
;
aResult
.
cellCount
=
1
;
aResult
.
_images
=
undefined
;
aResult
.
_aPastedImages
=
undefined
;
if
(
aResult
&&
!
(
aResult
.
onlyImages
&&
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
))
{
worksheet
.
setSelectionInfo
(
'
paste
'
,
aResult
,
this
);
}
}
}
};
};
...
...
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