Change Details
| eeshow/gfx/pdftoc.c |
| 248 | 248 | { |
| 249 | 249 | unsigned n = ctx->top + 1; |
| 250 | 250 | const struct object *obj = ctx->objs; |
| 251 | | const struct object *end = ctx->objs + ctx->top + 1; |
| 252 | 251 | const struct title *t; |
| 253 | 252 | unsigned outline, tail; |
| 253 | int i; |
| 254 | 254 | |
| 255 | 255 | /* Outline root */ |
| 256 | 256 | |
| ... | ... | |
| 267 | 267 | /* Outline items */ |
| 268 | 268 | |
| 269 | 269 | n++; |
| 270 | i = 0; |
| 270 | 271 | for (t = ctx->titles; t; t = t->next) { |
| 271 | | while (!obj->is_page) { |
| 272 | | assert(obj != end); |
| 273 | | obj++; |
| 272 | assert(i <= ctx->top); |
| 273 | while (!ctx->objs[i].is_page) { |
| 274 | i++; |
| 275 | assert(i <= ctx->top); |
| 274 | 276 | } |
| 275 | 277 | add_object(ctx, n, 0, ctx->pos + tail); |
| 276 | 278 | tail += fprintf(ctx->file, |
| ... | ... | |
| 285 | 287 | tail += fprintf(ctx->file, |
| 286 | 288 | " /Next %u 0 R\n", n + 1); |
| 287 | 289 | tail += fprintf(ctx->file, |
| 288 | | " /Dest [%u %u R /Fit]\n" |
| 290 | " /Dest [%d %u R /Fit]\n" |
| 289 | 291 | ">>\nendobj\n", |
| 290 | | (unsigned) (obj - ctx->objs), obj->gen); |
| 292 | i, ctx->objs[i].gen); |
| 291 | 293 | n++; |
| 292 | | obj++; |
| 294 | i++; |
| 293 | 295 | } |
| 294 | 296 | |
| 295 | 297 | /* xref table */ |
Download the corresponding diff file