~ubuntu-branches/ubuntu/raring/luatex/raring

« back to all changes in this revision

Viewing changes to source/texk/web2c/luatexdir/pdf/pdfoutline.w

  • Committer: Package Import Robot
  • Author(s): Norbert Preining
  • Date: 2011-05-20 09:40:39 UTC
  • mfrom: (0.8.1) (1.8.1) (19.2.3 oneiric)
  • Revision ID: package-import@ubuntu.com-20110520094039-7sezr4kqonjqxqz6
Tags: 0.70.1-1
* new upstream release (probably) matching TeX Live 2011
* deactivate fix-luatex-build-with-old-libpng patch, included upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "ptexlib.h"
22
22
 
23
23
static const char _svn_version[] =
24
 
    "$Id: pdfoutline.w 3571 2010-04-02 13:50:45Z taco $"
25
 
    "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.60.2/source/texk/web2c/luatexdir/pdf/pdfoutline.w $";
 
24
    "$Id: pdfoutline.w 3891 2010-09-14 23:02:24Z hhenkel $"
 
25
    "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.70.1/source/texk/web2c/luatexdir/pdf/pdfoutline.w $";
26
26
 
27
27
@ Data structure of outlines; it's not able to write out outline entries
28
28
before all outline entries are defined, so memory allocated for outline
64
64
    if (obj_outline_first(pdf, p) != 0) {
65
65
        l = obj_outline_first(pdf, p);
66
66
        do {
67
 
            incr(k);
 
67
            k++;
68
68
            c = open_subentries(pdf, l);
69
69
            if (obj_outline_count(pdf, l) > 0)
70
70
                k = k + c;
89
89
{
90
90
    int k = 1;
91
91
    while (obj_outline_prev(pdf, p) != 0) {
92
 
        incr(k);
 
92
        k++;
93
93
        p = obj_outline_prev(pdf, p);
94
94
    }
95
95
    return k;
99
99
void scan_pdfoutline(PDF pdf)
100
100
{
101
101
    halfword p, q, r;
102
 
    int i, j, k;
 
102
    int i, j, k, l;
103
103
    if (scan_keyword("attr")) {
104
104
        scan_pdf_ext_toks();
105
105
        r = def_ref;
115
115
    }
116
116
    scan_pdf_ext_toks();
117
117
    q = def_ref;
118
 
    pdf_new_obj(pdf, obj_type_others, 0, 1);
119
 
    j = pdf->obj_ptr;
 
118
    j = pdf_new_obj(pdf, obj_type_others, 0, 1);
120
119
    write_action(pdf, p);
121
120
    pdf_end_obj(pdf);
122
121
    delete_action_ref(p);
123
 
    pdf_create_obj(pdf, obj_type_outline, 0);
124
 
    k = pdf->obj_ptr;
 
122
    k = pdf_create_obj(pdf, obj_type_outline, 0);
125
123
    set_obj_outline_ptr(pdf, k, pdf_get_mem(pdf, pdfmem_outline_size));
126
124
    set_obj_outline_action_objnum(pdf, k, j);
127
125
    set_obj_outline_count(pdf, k, i);
128
 
    pdf_new_obj(pdf, obj_type_others, 0, 1);
 
126
    l = pdf_new_obj(pdf, obj_type_others, 0, 1);
129
127
    {
130
128
        char *s = tokenlist_to_cstring(q, true, NULL);
131
129
        pdf_print_str_ln(pdf, s);
133
131
    }
134
132
    delete_token_ref(q);
135
133
    pdf_end_obj(pdf);
136
 
    set_obj_outline_title(pdf, k, pdf->obj_ptr);
 
134
    set_obj_outline_title(pdf, k, l);
137
135
    set_obj_outline_prev(pdf, k, 0);
138
136
    set_obj_outline_next(pdf, k, 0);
139
137
    set_obj_outline_first(pdf, k, 0);
182
180
    int k, l, a;
183
181
    int outlines;
184
182
    if (pdf->first_outline != 0) {
185
 
        pdf_new_dict(pdf, obj_type_others, 0, 1);
186
 
        outlines = pdf->obj_ptr;
 
183
        outlines = pdf_new_dict(pdf, obj_type_others, 0, 1);
187
184
        l = pdf->first_outline;
188
185
        k = 0;
189
186
        do {
190
 
            incr(k);
 
187
            k++;
191
188
            a = open_subentries(pdf, l);
192
189
            if (obj_outline_count(pdf, l) > 0)
193
190
                k = k + a;