Skip to content

Commit

Permalink
Fix BLOCKSTRETCHACTION handles
Browse files Browse the repository at this point in the history
Fixes GH#1049
  • Loading branch information
michal-josef-spacek committed Nov 30, 2024
1 parent 777c79a commit f6db926
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
6 changes: 2 additions & 4 deletions doc/dynapi.texi
Original file line number Diff line number Diff line change
Expand Up @@ -13814,11 +13814,9 @@ BL, DXF 94
struct _dwg_object_BLOCKSTRETCHACTION*
@item hdl
H, DXF 331
@item shrt
@item bs74
BS, DXF 74
@item long1
BL, DXF 94
@item long2
@item bl94
BL, DXF 94

@end vtable
Expand Down
5 changes: 2 additions & 3 deletions include/dwg.h
Original file line number Diff line number Diff line change
Expand Up @@ -7800,9 +7800,8 @@ typedef struct _dwg_object_BLOCKSCALEACTION
typedef struct _dwg_BLOCKSTRETCHACTION_handles {
struct _dwg_object_BLOCKSTRETCHACTION *parent;
BITCODE_H hdl; // 331
BITCODE_BS shrt; // 74
BITCODE_BL long1; // 94
BITCODE_BL long2; // 94
BITCODE_BS bs74; // 74
BITCODE_BL bl94; // 94
} Dwg_BLOCKSTRETCHACTION_handles;

typedef struct _dwg_BLOCKSTRETCHACTION_codes {
Expand Down
9 changes: 2 additions & 7 deletions src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12425,13 +12425,8 @@ DWG_OBJECT (BLOCKSTRETCHACTION)
REPEAT (num_hdls, hdls, Dwg_BLOCKSTRETCHACTION_handles)
REPEAT_BLOCK
SUB_FIELD_HANDLE (hdls[rcount1], hdl, 0, 331);
SUB_FIELD_BS (hdls[rcount1], shrt, 74);
SUB_FIELD_BL (hdls[rcount1], long1, 94);
// See GRUE_LTM_1090+_from_cadforum.cz_2018
if (FIELD_VALUE (hdls[rcount1].long1) >= 128) {
DEBUG_HERE_OBJ
}
SUB_FIELD_BL (hdls[rcount1], long2, 94);
SUB_FIELD_BS (hdls[rcount1], bs74, 74);
SUB_FIELD_BL (hdls[rcount1], bl94, 94);
SET_PARENT_OBJ (hdls[rcount1]);
END_REPEAT_BLOCK
END_REPEAT (hdls)
Expand Down
6 changes: 2 additions & 4 deletions src/dynapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -11254,11 +11254,9 @@ static const Dwg_DYNAPI_field _dwg_BLOCKSTRETCHACTION_handles_fields[] = {
1,1,0, 0 },
{ "hdl", "H", sizeof (BITCODE_H), OFF (struct _dwg_BLOCKSTRETCHACTION_handles, hdl),
1,0,0, 331 },
{ "shrt", "BS", sizeof (BITCODE_BS), OFF (struct _dwg_BLOCKSTRETCHACTION_handles, shrt),
{ "bs74", "BS", sizeof (BITCODE_BS), OFF (struct _dwg_BLOCKSTRETCHACTION_handles, bs74),
0,0,0, 74 },
{ "long1", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_BLOCKSTRETCHACTION_handles, long1),
0,0,0, 94 },
{ "long2", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_BLOCKSTRETCHACTION_handles, long2),
{ "bl94", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_BLOCKSTRETCHACTION_handles, bl94),
0,0,0, 94 },
{NULL, NULL, 0, 0, 0,0,0, 0},
};
Expand Down
23 changes: 8 additions & 15 deletions src/in_dxf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7867,24 +7867,17 @@ add_AcDbBlockStretchAction (Dwg_Object *restrict obj, Bit_Chain *restrict dat)
dxf_free_pair (pair);

pair = dxf_read_pair (dat);
EXPECT_DXF (obj->name, o->hdls[i].shrt, 74);
o->hdls[i].shrt = pair->value.i;
LOG_TRACE ("%s.hdls[%d].shrt = %u [BS 74]\n", obj->name, i,
(unsigned)o->hdls[i].shrt);
EXPECT_DXF (obj->name, o->hdls[i].bs74, 74);
o->hdls[i].bs74 = pair->value.i;
LOG_TRACE ("%s.hdls[%d].bs74 = %u [BS 74]\n", obj->name, i,
(unsigned)o->hdls[i].bs74);
dxf_free_pair (pair);

pair = dxf_read_pair (dat);
EXPECT_DXF (obj->name, o->hdls[i].long1, 94);
o->hdls[i].long1 = pair->value.u;
LOG_TRACE ("%s.hdls[%d].long1 = %u [BL 94]\n", obj->name, i,
(unsigned)o->hdls[i].long1);
dxf_free_pair (pair);

pair = dxf_read_pair (dat);
EXPECT_DXF (obj->name, o->hdls[i].long2, 94);
o->hdls[i].long2 = pair->value.u;
LOG_TRACE ("%s.hdls[%d].long2 = %u [BL 94]\n", obj->name, i,
(unsigned)o->hdls[i].long2);
EXPECT_DXF (obj->name, o->hdls[i].bl94, 94);
o->hdls[i].bl94 = pair->value.u;
LOG_TRACE ("%s.hdls[%d].bl94 = %u [BL 94]\n", obj->name, i,
(unsigned)o->hdls[i].bl94);
dxf_free_pair (pair);
}
}
Expand Down

0 comments on commit f6db926

Please sign in to comment.