@@ -7309,66 +7309,40 @@ dwg_set_dataflags (Dwg_Object *obj)
7309
7309
if (obj -> fixedtype == DWG_TYPE_TEXT )
7310
7310
{
7311
7311
Dwg_Entity_TEXT * _obj = obj -> tio .entity -> tio .TEXT ;
7312
- if (_obj -> elevation != 0.0 )
7313
- _obj -> dataflags |= 1 ;
7314
- if (_obj -> alignment_pt .x != _obj -> ins_pt .x
7315
- || _obj -> alignment_pt .y != _obj -> ins_pt .y )
7316
- _obj -> dataflags |= 2 ;
7317
- if (_obj -> oblique_angle != 0.0 )
7318
- _obj -> dataflags |= 4 ;
7319
- if (_obj -> rotation != 0.0 )
7320
- _obj -> dataflags |= 8 ;
7321
- if (_obj -> width_factor != 0.0 )
7322
- _obj -> dataflags |= 0x10 ;
7323
- if (_obj -> generation != 0 )
7324
- _obj -> dataflags |= 0x20 ;
7325
- if (_obj -> horiz_alignment != 0 )
7326
- _obj -> dataflags |= 0x40 ;
7327
- if (_obj -> vert_alignment != 0 )
7328
- _obj -> dataflags |= 0x80 ;
7312
+
7313
+ #define _SET_DATAFLAGS \
7314
+ _obj->dataflags = 0xff; \
7315
+ if (_obj->elevation != 0.0) \
7316
+ _obj->dataflags &= ~1; \
7317
+ if (_obj->alignment_pt.x != _obj->ins_pt.x \
7318
+ || _obj->alignment_pt.y != _obj->ins_pt.y) \
7319
+ _obj->dataflags &= ~2; \
7320
+ if (_obj->oblique_angle != 0.0) \
7321
+ _obj->dataflags &= ~4; \
7322
+ if (_obj->rotation != 0.0) \
7323
+ _obj->dataflags &= ~8; \
7324
+ if (_obj->width_factor != 1.0) \
7325
+ _obj->dataflags &= ~0x10; \
7326
+ if (_obj->generation != 0) \
7327
+ _obj->dataflags &= ~0x20; \
7328
+ if (_obj->horiz_alignment != 0) \
7329
+ _obj->dataflags &= ~0x40; \
7330
+ if (_obj->vert_alignment != 0) \
7331
+ _obj->dataflags &= ~0x80
7332
+
7333
+ _SET_DATAFLAGS ;
7329
7334
}
7330
7335
else if (obj -> fixedtype == DWG_TYPE_ATTRIB )
7331
7336
{
7332
7337
Dwg_Entity_ATTRIB * _obj = obj -> tio .entity -> tio .ATTRIB ;
7333
- if (_obj -> elevation != 0.0 )
7334
- _obj -> dataflags |= 1 ;
7335
- if (_obj -> alignment_pt .x != _obj -> ins_pt .x
7336
- || _obj -> alignment_pt .y != _obj -> ins_pt .y )
7337
- _obj -> dataflags |= 2 ;
7338
- if (_obj -> oblique_angle != 0.0 )
7339
- _obj -> dataflags |= 4 ;
7340
- if (_obj -> rotation != 0.0 )
7341
- _obj -> dataflags |= 8 ;
7342
- if (_obj -> width_factor != 0.0 )
7343
- _obj -> dataflags |= 0x10 ;
7344
- if (_obj -> generation != 0 )
7345
- _obj -> dataflags |= 0x20 ;
7346
- if (_obj -> horiz_alignment != 0 )
7347
- _obj -> dataflags |= 0x40 ;
7348
- if (_obj -> vert_alignment != 0 )
7349
- _obj -> dataflags |= 0x80 ;
7338
+ _SET_DATAFLAGS ;
7350
7339
}
7351
7340
else if (obj -> fixedtype == DWG_TYPE_ATTDEF )
7352
7341
{
7353
7342
Dwg_Entity_ATTDEF * _obj = obj -> tio .entity -> tio .ATTDEF ;
7354
- if (_obj -> elevation != 0.0 )
7355
- _obj -> dataflags |= 1 ;
7356
- if (_obj -> alignment_pt .x != _obj -> ins_pt .x
7357
- || _obj -> alignment_pt .y != _obj -> ins_pt .y )
7358
- _obj -> dataflags |= 2 ;
7359
- if (_obj -> oblique_angle != 0.0 )
7360
- _obj -> dataflags |= 4 ;
7361
- if (_obj -> rotation != 0.0 )
7362
- _obj -> dataflags |= 8 ;
7363
- if (_obj -> width_factor != 0.0 )
7364
- _obj -> dataflags |= 0x10 ;
7365
- if (_obj -> generation != 0 )
7366
- _obj -> dataflags |= 0x20 ;
7367
- if (_obj -> horiz_alignment != 0 )
7368
- _obj -> dataflags |= 0x40 ;
7369
- if (_obj -> vert_alignment != 0 )
7370
- _obj -> dataflags |= 0x80 ;
7343
+ _SET_DATAFLAGS ;
7371
7344
}
7345
+ #undef _SET_DATAFLAGS
7372
7346
}
7373
7347
7374
7348
#if 0
0 commit comments