Opened 8 months ago

Closed 8 months ago

Last modified 7 months 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 8 months ago.
The file should display as two squares side by side
OGR-DXF-insert-ocs.diff (20.1 KB) - added by Alan Thomas 8 months ago.
Patch

Download all attachments as: .zip

Change History (6)

Changed 8 months ago by Alan Thomas

Attachment: insert-ocs-reduced.dxf added

The file should display as two squares side by side

Changed 8 months ago by Alan Thomas

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

Patch

comment:1 Changed 8 months ago by Even Rouault

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 Changed 8 months ago by Even Rouault

In 40353:

Fix compiler error and cppcheck warning (refs #7077)

comment:3 Changed 7 months ago by Alan Thomas

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

comment:4 Changed 7 months ago by Even Rouault

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.