Skip to content
Permalink
Browse files

Accept newline terminated string as valid input to paste as temporary…

… scratch layer

Fixes #33617
  • Loading branch information
i-s-o authored and nyalldawson committed Jan 6, 2020
1 parent 64f2c42 commit 07d6a1ff481f255e4f9c6e770a90863a92087560
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/app/qgsclipboard.cpp
@@ -309,6 +309,16 @@ QgsFeatureList QgsClipboard::copyOf( const QgsFields &fields ) const
QString text = cb->text( QClipboard::Clipboard );
#endif

if ( text.endsWith( '\n' ) )
{
text.chop( 1 );
// In case Windows <EOL> marker (CRLF) makes it into the variable "text"
if ( text.endsWith( '\r' ) )
{
text.chop( 1 );
}
}

return stringToFeatureList( text, fields );
}

0 comments on commit 07d6a1f

Please sign in to comment.
You can’t perform that action at this time.