-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clipboard Cut&Paste fix when attached special field values. Fixes #16870 #5030
Clipboard Cut&Paste fix when attached special field values. Fixes #16870 #5030
Conversation
@nyalldawson @elpaso I did a backport of a2c1810 |
Thanks @luipir |
src/app/qgsclipboard.cpp
Outdated
if ( !geometry ) | ||
continue; | ||
|
||
QgsFeature feature; | ||
if ( !fields.isEmpty() ) | ||
feature.setFields( fields, true ); | ||
|
||
feature.setGeometry( geometry ); | ||
feature.setGeometry( *geometry ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this leaks the geometry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed... tanks to point out. I read the api too quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed with b73b25d
src/app/qgsclipboard.cpp
Outdated
if ( !geometry ) | ||
continue; | ||
|
||
QgsFeature feature; | ||
if ( !fields.isEmpty() ) | ||
feature.setFields( fields, true ); | ||
|
||
feature.setGeometry( geometry ); | ||
feature.setGeometry( *geometry ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed... tanks to point out. I read the api too quickly.
@m-kuhn travis fail on qgis3 but succes on qgis 2.x |
tnx |
Description
backport cherry-pick for a2c1810
resume:
In some cases when features are attached from clipboard as \t separated string, the import failed due the fact that the fromWkt geometry contructor is build on WKT * dumped fields. In some case when some dumped field has values inside parenthesis "(some value") the fromWkt parser return a ZM geometry.
This patch strips the leading field values leaving only WKT to the parser.
Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and containt sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit