Skip to content
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

OgrFileImport: Improve DXF import of text objects #2135

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dl3sdo
Copy link
Member

@dl3sdo dl3sdo commented Feb 5, 2023

Text object properties like the text itsef, alignment and rotation were previously imported by putting them into a string and transporting the string via the description property of the related text symbol. Besides being an awkward design the approach suffers from multiple deficiencies: the auxiliary string was not removed from the description field, the rotation angle was rounded (e.g., -17.2 became 20) and the way of constructing and parsing the string was unnecessary complex.

This commit uses a static QVariantHash object to transport the object properties. As only a single object is imported at a time it's not required to pass a reference to this QVariantHash object to the functions that return the related symbol and retrieve the object properties.

Text object properties like the text itsef, alignment and rotation were
previously imported by putting them into a string and transporting the
string via the description property of the related text symbol.
Besides being an awkward design the approach suffers from multiple
deficiencies: the auxiliary string was not removed from the description
field, the rotation angle was rounded (e.g., -17.2 became 20) and the
way of constructing and parsing the string was unnecessary complex.

This commit uses a static QVariantHash object to transport the object
properties. As only a single object is imported at a time it's not
required to pass a reference to this QVariantHash object to the
functions that return the related symbol and retrieve the object
properties.
@dl3sdo dl3sdo marked this pull request as draft March 18, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant