Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-08 10:39:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-08 10:39:12 +0400
commit2dba2e72b76ba2933d6ca7d3e79ad669c430e3a5 (patch)
tree19e2d2af6a5923952d29151d5ae43a69b11508e4 /source/blender/editors/util/numinput.c
parent3fbd63c52e25344f115b5cd67a218436bc4007cf (diff)
Code Cleanup: de-duplicate text pasting which only used the first line
Diffstat (limited to 'source/blender/editors/util/numinput.c')
-rw-r--r--source/blender/editors/util/numinput.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 78499dac55b..2828973e91d 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -341,17 +341,13 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
case VKEY:
if (event->ctrl) {
/* extract the first line from the clipboard */
- char *pbuf = WM_clipboard_text_get(0);
+ int pbuf_len;
+ char *pbuf = WM_clipboard_text_get_firstline(false, &pbuf_len);
if (pbuf) {
bool success;
- /* Only copy string until first of this char. */
- char *cr = strchr(pbuf, '\r');
- char *cn = strchr(pbuf, '\n');
- if (cn && cn < cr) cr = cn;
- if (cr) *cr = '\0';
- success = editstr_insert_at_cursor(n, pbuf, strlen(pbuf));
+ success = editstr_insert_at_cursor(n, pbuf, pbuf_len);
MEM_freeN(pbuf);
if (!success) {