Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7077 closed enhancement (fixed)

DXF: Refactor out block insertion to its own function

Reported by: Alan Thomas Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: dxf
Cc:

Description

Currently the OGRDXFLayer::TranslateINSERT function is the only logic that inserts blocks. However, in the future we might want to insert blocks from other places in the code; for example, arrowheads are stored as blocks.

Some of the work I am currently doing on improving OGR's support for DXF DIMENSION and LEADER entities requires the block insertion code to be refactored out into its own function.

This patch also fixes a bug (test case supplied) where the insertion point of an INSERT entity is not transformed into the OCS, as required by the DXF specification.

Attachments (2)

insert-ocs-reduced.dxf (4.2 KB ) - added by Alan Thomas 7 years ago.
The file should display as two squares side by side
OGR-DXF-insert-ocs.diff (20.1 KB ) - added by Alan Thomas 7 years ago.
Patch

Download all attachments as: .zip

Change History (6)

by Alan Thomas, 7 years ago

Attachment: insert-ocs-reduced.dxf added

The file should display as two squares side by side

by Alan Thomas, 7 years ago

Attachment: OGR-DXF-insert-ocs.diff added

Patch

comment:1 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 40352:

DXF: refactor out block insertion to its own function, and transform insertion point of an INSERT entity into OCS (patch by atlight, fixes #7077)

comment:2 by Even Rouault, 7 years ago

In 40353:

Fix compiler error and cppcheck warning (refs #7077)

comment:3 by Alan Thomas, 7 years ago

Sorry about that, Even. MSVC doesn't complain about missing standard library headers, so it's very easy to miss it.

comment:4 by Even Rouault, 7 years ago

In 40357:

DXF: fix memory leak. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3580. Credit to OSS Fuzz (trunk only, refs #7077)

Note: See TracTickets for help on using tickets.