From 2dba2e72b76ba2933d6ca7d3e79ad669c430e3a5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Jan 2014 17:39:12 +1100 Subject: Code Cleanup: de-duplicate text pasting which only used the first line --- source/blender/editors/util/numinput.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/util/numinput.c') 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) { -- cgit v1.2.3