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

« back to all changes in this revision

Viewing changes to src/Typeset/Table/table.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
* DESCRIPTION: Tables and cells of tables
5
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
6
6
*******************************************************************************
7
 
* This software falls under the GNU general public license and comes WITHOUT
8
 
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
 
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
 
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11
10
******************************************************************************/
12
11
 
13
12
#include "Table/table.hpp"
29
28
table_rep::~table_rep () {
30
29
  if (T != NULL) {
31
30
    int i;
32
 
    for (i=0; i<nr_rows; i++) delete[] T[i];
33
 
    delete[] T;
 
31
    for (i=0; i<nr_rows; i++) tm_delete_array (T[i]);
 
32
    tm_delete_array (T);
34
33
  }
35
 
  if (mw != NULL) delete[] mw;
36
 
  if (lw != NULL) delete[] lw;
37
 
  if (rw != NULL) delete[] rw;
 
34
  if (mw != NULL) tm_delete_array (mw);
 
35
  if (lw != NULL) tm_delete_array (lw);
 
36
  if (rw != NULL) tm_delete_array (rw);
38
37
}
39
38
 
40
39
void
88
87
  int i;
89
88
  nr_rows= N(t);
90
89
  nr_cols= 0;
91
 
  T= new cell*[nr_rows];
 
90
  T= tm_new_array<cell*> (nr_rows);
92
91
  STACK_NEW_ARRAY (subformat, tree, nr_rows);
93
92
  extract_format (fm, subformat, nr_rows);
94
93
  for (i=0; i<nr_rows; i++)
95
94
    typeset_row (i, subformat[i], t[i], descend (ip, i));
96
95
  STACK_DELETE_ARRAY (subformat);
97
 
  mw= new SI[nr_cols];
98
 
  lw= new SI[nr_cols];
99
 
  rw= new SI[nr_cols];
 
96
  mw= tm_new_array<SI> (nr_cols);
 
97
  lw= tm_new_array<SI> (nr_cols);
 
98
  rw= tm_new_array<SI> (nr_cols);
100
99
}
101
100
 
102
101
void
103
102
table_rep::typeset_row (int i, tree fm, tree t, path ip) {
104
103
  int j;
105
104
  nr_cols= N(t);
106
 
  T[i]= new cell[nr_cols];
 
105
  T[i]= tm_new_array<cell> (nr_cols);
107
106
  STACK_NEW_ARRAY (subformat, tree, nr_cols);
108
107
  extract_format (fm, subformat, nr_cols);
109
108
  for (j=0; j<nr_cols; j++) {
246
245
  int new_rows= nr_rows, new_cols= nr_cols;
247
246
  for (i=0; i<nr_rows; i++) new_rows += ex_i1[i] + ex_i2[i];
248
247
  for (j=0; j<nr_cols; j++) new_cols += ex_j1[j] + ex_j2[j];
249
 
  U= new cell*[new_rows];
 
248
  U= tm_new_array<cell*> (new_rows);
250
249
  for (i=0; i<new_rows; i++)
251
 
    U[i]= new cell[new_cols];
 
250
    U[i]= tm_new_array<cell> (new_cols);
252
251
 
253
252
  for (i=0; i<nr_rows; i++)
254
253
    for (j=0; j<nr_cols; j++) {
274
273
    }
275
274
 
276
275
  /*** replace old table by new one ***/
277
 
  for (i=0; i<nr_rows; i++) delete[] T[i];
278
 
  delete[] T;
 
276
  for (i=0; i<nr_rows; i++) tm_delete_array (T[i]);
 
277
  tm_delete_array (T);
279
278
  T      = U;
280
279
  nr_rows= new_rows;
281
280
  nr_cols= new_cols;
805
804
struct lazy_table {
806
805
  EXTEND_NULL(lazy,lazy_table);
807
806
  inline lazy_table (table T, path ip):
808
 
    rep (new lazy_table_rep (T, ip)) { rep->ref_count= 1; }
 
807
    rep (tm_new<lazy_table_rep> (T, ip)) { rep->ref_count= 1; }
809
808
};
810
809
EXTEND_NULL_CODE(lazy,lazy_table);
811
810