diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-08 10:39:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-08 10:39:12 +0400 |
commit | 2dba2e72b76ba2933d6ca7d3e79ad669c430e3a5 (patch) | |
tree | 19e2d2af6a5923952d29151d5ae43a69b11508e4 /source/blender/editors/util | |
parent | 3fbd63c52e25344f115b5cd67a218436bc4007cf (diff) |
Code Cleanup: de-duplicate text pasting which only used the first line
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/numinput.c | 10 |
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) { |