| line |
true |
false |
branch |
|
18
|
10 |
0 |
if (!doc || !name) return NULL; |
|
|
0 |
10 |
if (!doc || !name) return NULL; |
|
21
|
7 |
3 |
if (doc->ocg_count >= doc->ocg_cap) { |
|
22
|
0 |
7 |
size_t new_cap = doc->ocg_cap == 0 ? 4 : doc->ocg_cap * 2; |
|
24
|
0 |
7 |
if (!new_arr) return NULL; |
|
30
|
0 |
10 |
if (!ocg) return NULL; |
|
45
|
0 |
0 |
return doc ? doc->ocg_count : 0; |
|
49
|
0 |
0 |
if (!doc || idx >= doc->ocg_count) return NULL; |
|
|
0 |
0 |
if (!doc || idx >= doc->ocg_count) return NULL; |
|
56
|
0 |
0 |
if (!doc || !name) return NULL; |
|
|
0 |
0 |
if (!doc || !name) return NULL; |
|
57
|
0 |
0 |
for (i = 0; i < doc->ocg_count; i++) { |
|
59
|
0 |
0 |
if (strcmp(ocg->name, name) == 0) return ocg; |
|
81
|
10 |
0 |
if (!ocg || !doc) return 0; |
|
|
0 |
10 |
if (!ocg || !doc) return 0; |
|
82
|
0 |
10 |
if (ocg->obj_num) return ocg->obj_num; /* already written */ |
|
87
|
0 |
10 |
if (dict.kind != PDFMAKE_DICT) return 0; |
|
98
|
0 |
10 |
ocg->intent == PDFMAKE_OCG_INTENT_DESIGN ? "Design" : "View")); |
|
101
|
10 |
0 |
if (ocg->has_print_state || ocg->has_view_state || ocg->has_export_state) { |
|
|
10 |
0 |
if (ocg->has_print_state || ocg->has_view_state || ocg->has_export_state) { |
|
|
0 |
10 |
if (ocg->has_print_state || ocg->has_view_state || ocg->has_export_state) { |
|
105
|
0 |
0 |
if (ocg->has_print_state) { |
|
109
|
0 |
0 |
pdfmake_name_cstr(arena, ocg->print_state == PDFMAKE_OCG_ON ? "ON" : "OFF")); |
|
114
|
0 |
0 |
if (ocg->has_view_state) { |
|
118
|
0 |
0 |
pdfmake_name_cstr(arena, ocg->view_state == PDFMAKE_OCG_ON ? "ON" : "OFF")); |
|
123
|
0 |
0 |
if (ocg->has_export_state) { |
|
127
|
0 |
0 |
pdfmake_name_cstr(arena, ocg->export_state == PDFMAKE_OCG_ON ? "ON" : "OFF")); |
|
153
|
5 |
0 |
if (!doc || doc->ocg_count == 0) return PDFMAKE_OK; |
|
|
0 |
5 |
if (!doc || doc->ocg_count == 0) return PDFMAKE_OK; |
|
158
|
8 |
5 |
for (i = 0; i < doc->ocg_count; i++) { |
|
160
|
0 |
8 |
if (!ocg->obj_num) { |
|
161
|
0 |
0 |
if (pdfmake_ocg_write(ocg, doc) == 0) |
|
168
|
8 |
5 |
for (i = 0; i < doc->ocg_count; i++) { |
|
185
|
8 |
5 |
for (i = 0; i < doc->ocg_count; i++) { |
|
187
|
3 |
5 |
if (!ocg->visible) { |
|
192
|
3 |
2 |
if (has_off) { |
|
199
|
8 |
5 |
for (i = 0; i < doc->ocg_count; i++) { |
|
215
|
5 |
0 |
if (!catalog || catalog->kind != PDFMAKE_DICT) return PDFMAKE_EINVAL; |
|
|
0 |
5 |
if (!catalog || catalog->kind != PDFMAKE_DICT) return PDFMAKE_EINVAL; |
|
227
|
10 |
0 |
if (!page || !name || ocg_obj_num == 0) return -1; |
|
|
10 |
0 |
if (!page || !name || ocg_obj_num == 0) return -1; |
|
|
0 |
10 |
if (!page || !name || ocg_obj_num == 0) return -1; |
|
228
|
0 |
10 |
if (page->prop_count >= PDFMAKE_MAX_PAGE_PROPERTIES) return -1; |
|
241
|
7 |
0 |
if (!c || !res_name) return PDFMAKE_EINVAL; |
|
|
0 |
7 |
if (!c || !res_name) return PDFMAKE_EINVAL; |
|
246
|
0 |
7 |
if (!c) return PDFMAKE_EINVAL; |