Skip to content

Commit

Permalink
Accept newline terminated string as valid input to paste as temporary…
Browse files Browse the repository at this point in the history
… scratch layer

Fixes #33617
  • Loading branch information
i-s-o authored and nirvn committed Jan 10, 2020
1 parent a816bb8 commit 662ede5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsclipboard.cpp
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 662ede5

Please sign in to comment.