1 #define DWG_TYPE DWG_TYPE_CELLSTYLEMAP
2 #include "common.c"
3
4 void
5 api_process (dwg_object *obj)
6 {
7 int error, isnew;
8 BITCODE_BL i, j, num_cells;
9 Dwg_TABLESTYLE_CellStyle *cells;
10
11 Dwg_Version_Type dwg_version = obj->parent->header.version;
12 dwg_obj_cellstylemap *_obj = dwg_object_to_CELLSTYLEMAP (obj);
13
14 CHK_ENTITY_TYPE (_obj, CELLSTYLEMAP, num_cells, BL);
15 if (!dwg_dynapi_entity_value (_obj, "CELLSTYLEMAP", "cells", &cells, NULL))
16 fail ("CELLSTYLEMAP.cells");
17 else
18 for (i = 0; i < num_cells; i++)
19 {
20 CHK_SUBCLASS_TYPE (cells[i], TABLESTYLE_CellStyle, id, BL);
21 CHK_SUBCLASS_TYPE (cells[i], TABLESTYLE_CellStyle, type, BL);
22 CHK_SUBCLASS_MAX (cells[i], TABLESTYLE_CellStyle, type, BL, 2);
23 CHK_SUBCLASS_UTF8TEXT (cells[i], TABLESTYLE_CellStyle, name);
24 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, type, BL);
25 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, data_flags, BS);
26 if (!cells[i].cellstyle.data_flags)
27 continue;
28 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle,
29 property_override_flags, BLx);
30 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, merge_flags, BLx);
31 CHK_SUBCLASS_CMC (cells[i].cellstyle, CellStyle, bg_color);
32 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, content_layout, BL);
33 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
34 property_override_flags, BLx);
35 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
36 property_override_flags, BLx);
37 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
38 property_flags, BLx);
39 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
40 value_data_type, BL);
41 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
42 value_unit_type, BL);
43 CHK_SUBCLASS_UTF8TEXT (cells[i].cellstyle.content_format,
44 ContentFormat, value_format_string);
45 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
46 rotation, BD);
47 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
48 block_scale, BD);
49 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
50 cell_alignment, BLx);
51 CHK_SUBCLASS_CMC (cells[i].cellstyle.content_format, ContentFormat,
52 content_color);
53 CHK_SUBCLASS_H (cells[i].cellstyle.content_format, ContentFormat,
54 text_style);
55 CHK_SUBCLASS_TYPE (cells[i].cellstyle.content_format, ContentFormat,
56 text_height, BD);
57 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle,
58 margin_override_flags, BS);
59 if (cells[i].cellstyle.margin_override_flags)
60 {
61 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, vert_margin, BD);
62 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, horiz_margin,
63 BD);
64 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, bottom_margin,
65 BD);
66 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, right_margin,
67 BD);
68 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle,
69 margin_horiz_spacing, BD);
70 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle,
71 margin_vert_spacing, BD);
72 }
73 CHK_SUBCLASS_TYPE (cells[i].cellstyle, CellStyle, num_borders, BL);
74 for (j = 0; j < cells[i].cellstyle.num_borders; j++)
75 {
76 CHK_SUBCLASS_TYPE (cells[i].cellstyle.borders[j], GridFormat,
77 index_mask, BL);
78 if (!cells[i].cellstyle.borders[j].index_mask)
79 continue;
80 CHK_SUBCLASS_TYPE (cells[i].cellstyle.borders[j], GridFormat,
81 border_overrides, BL);
82 CHK_SUBCLASS_TYPE (cells[i].cellstyle.borders[j], GridFormat,
83 border_type, BL);
84 CHK_SUBCLASS_CMC (cells[i].cellstyle.borders[j], GridFormat,
85 color);
86 CHK_SUBCLASS_TYPE (cells[i].cellstyle.borders[j], GridFormat,
87 linewt, BLd);
88 CHK_SUBCLASS_H (cells[i].cellstyle.borders[j], GridFormat, ltype);
89 CHK_SUBCLASS_TYPE (cells[i].cellstyle.borders[j], GridFormat,
90 visible, B);
91 CHK_SUBCLASS_TYPE (cells[i].cellstyle.borders[j], GridFormat,
92 double_line_spacing, BD);
93 }
94 }
95 }