~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Typeset/Bridge/bridge_document.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2008-04-06 15:11:41 UTC
  • mfrom: (1.1.7 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080406151141-w0sg20jnv86mlt6f
Tags: 1:1.0.6.14-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* 01_american.dpatch is updated
* Since thread support in guile-1.8 is now disabled, the segmentation faults
  should not arise anymore. More info at #439923. (Closes: #450499, #458685)
[kohda]
* This version fixed menu problem.  (Closes: #447083)
* Reverted orig.tar.gz to the upstream tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
void
70
70
bridge_document_rep::notify_assign (path p, tree u) {
71
71
  // cout << "Assign " << p << ", " << u << " in " << st << "\n";
72
 
  if (nil (p) && (!is_func (u, DOCUMENT)) && (!is_func (u, PARA)))
 
72
  if (is_nil (p) && (!is_func (u, DOCUMENT)) && (!is_func (u, PARA)))
73
73
    fatal_error ("Nil path", "bridge_document_rep::notify_assign");
74
 
  if (nil (p)) { st= u; initialize (); }
 
74
  if (is_nil (p)) { st= u; initialize (); }
75
75
  else {
76
 
    if (atom (p)) {
 
76
    if (is_atom (p)) {
77
77
      replace_bridge (brs[p->item], u, descend (ip, p->item));
78
78
      st= substitute (st, p->item, brs[p->item]->st);
79
79
    }
81
81
      brs[p->item]->notify_assign (p->next, u);
82
82
      st= substitute (st, p->item, brs[p->item]->st);
83
83
    }
84
 
    if (!nil (acc)) acc->notify_assign (p, u);
 
84
    if (!is_nil (acc)) acc->notify_assign (p, u);
85
85
  }
86
86
  status= CORRUPTED;
87
87
}
89
89
void
90
90
bridge_document_rep::notify_insert (path p, tree u) {
91
91
  // cout << "Insert " << p << ", " << u << " in " << st << "\n";
92
 
  if (nil (p)) fatal_error ("Nil path", "bridge_document_rep::notify_insert");
93
 
  if (atom (p)) {
 
92
  if (is_nil (p)) fatal_error ("Nil path", "bridge_document_rep::notify_insert");
 
93
  if (is_atom (p)) {
94
94
    int i, j, n= N(brs), pos= p->item, nr= N(u);
95
95
    array<bridge> brs2 (n+nr);
96
96
    for (i=0; i<pos; i++) brs2[i]= brs[i];
101
101
    }
102
102
    brs= brs2;
103
103
    st = (st (0, p->item) * u) * st (p->item, N(st));
104
 
    if (!nil (acc)) acc->notify_insert (p, u);
 
104
    if (!is_nil (acc)) acc->notify_insert (p, u);
105
105
    // initialize_acc ();
106
106
  }
107
107
  else {
108
108
    brs[p->item]->notify_insert (p->next, u);
109
109
    st= substitute (st, p->item, brs[p->item]->st);
110
 
    if (!nil (acc)) acc->notify_assign (p->item, st[p->item]);
 
110
    if (!is_nil (acc)) acc->notify_assign (p->item, st[p->item]);
111
111
  }
112
112
  status= CORRUPTED;
113
113
}
115
115
void
116
116
bridge_document_rep::notify_remove (path p, int nr) {
117
117
  // cout << "Remove " << p << ", " << nr << " in " << st << "\n";
118
 
  if (nil (p)) fatal_error ("Nil path", "bridge_document_rep::notify_remove");
119
 
  if (atom (p)) {
 
118
  if (is_nil (p)) fatal_error ("Nil path", "bridge_document_rep::notify_remove");
 
119
  if (is_atom (p)) {
120
120
    int i, n= N(brs), pos= p->item;
121
121
    array<bridge> brs2 (n-nr);
122
122
    for (i=0; i<pos ; i++) brs2[i]= brs[i];
135
135
    if (change_flag) // touch brs[pos..n] for correct ``changes handling''
136
136
      for (i=pos; i<n; i++)
137
137
        brs[i]->notify_change ();
138
 
    if (!nil (acc)) acc->notify_remove (p, nr);
 
138
    if (!is_nil (acc)) acc->notify_remove (p, nr);
139
139
    // initialize_acc ();
140
140
  }
141
141
  else {
142
142
    brs[p->item]->notify_remove (p->next, nr);
143
143
    st= substitute (st, p->item, brs[p->item]->st);
144
 
    if (!nil (acc)) acc->notify_assign (p->item, st[p->item]);
 
144
    if (!is_nil (acc)) acc->notify_assign (p->item, st[p->item]);
145
145
  }
146
146
  status= CORRUPTED;
147
147
}
154
154
    flag= brs[i]->notify_macro (tp, var, l, p, u) || flag;
155
155
  if (flag) {
156
156
    status= CORRUPTED;
157
 
    if (!nil (acc)) acc->notify_change ();
 
157
    if (!is_nil (acc)) acc->notify_change ();
158
158
  }
159
159
  return flag;
160
160
}
162
162
void
163
163
bridge_document_rep::notify_change () {
164
164
  status= CORRUPTED;
165
 
  if (!nil (acc)) acc->notify_change ();
 
165
  if (!is_nil (acc)) acc->notify_change ();
166
166
  if (N(brs)>0) brs[0]->notify_change ();
167
167
  if (N(brs)>1) brs[N(brs)-1]->notify_change ();
168
168
}
173
173
 
174
174
void
175
175
bridge_document_rep::my_exec_until (path p) {
176
 
  if (nil (acc)) {
 
176
  if (is_nil (acc)) {
177
177
    int i;
178
178
    for (i=0; i<p->item; i++)
179
179
      brs[i]->exec_until (path (right_index (brs[i]->st)), true);
184
184
 
185
185
bool
186
186
bridge_document_rep::my_typeset_will_be_complete () {
187
 
  if (nil (acc)) {
 
187
  if (is_nil (acc)) {
188
188
    int i, n= N(brs);
189
189
    for (i=0; i<n; i++)
190
190
      if (!brs[i]->my_typeset_will_be_complete ()) return false;
196
196
void
197
197
bridge_document_rep::my_typeset (int desired_status) {
198
198
  //cout << INDENT;
199
 
  if (nil (acc)) {
 
199
  if (is_nil (acc)) {
200
200
    int i, n= N(st);
201
201
    array<line_item> a= ttt->a;
202
202
    array<line_item> b= ttt->b;