listtable.cpp
1/*
2** A program to convert the XML rendered by KWord into LATEX.
3**
4** Copyright (C) 2000 Robert JACOLIN
5**
6** This library is free software; you can redistribute it and/or
7** modify it under the terms of the GNU Library General Public
8** License as published by the Free Software Foundation; either
9** version 2 of the License, or (at your option) any later version.
10**
11** This library is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14** Library General Public License for more details.
15**
16** To receive a copy of the GNU Library General Public License, write to the
17** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19**
20*/
21
22#include <kdebug.h> /* for kdDebug stream */
23#include "listtable.h"
24
25/*******************************************/
26/* Constructor */
27/*******************************************/
32
33/*******************************************/
34/* Destructor */
35/*******************************************/
36ListTable::~ListTable()
37{
38 /* Just call the parent destructor */
39}
40
41/*******************************************/
42/* IsNewTable */
43/*******************************************/
45{
46 Table *current = 0;
47
48 /* Parcourir les tables et tester chaque nom de table */
49 for(current = first(); current != 0; current = next())
50 {
51 if(current->getGrpMgr() == grpMgr)
52 return current;
53 }
54 return 0;
55}
56
57/*******************************************/
58/* add */
59/*******************************************/
61{
62 Table* newTable = 0;
63 /* If the GrpMng exist in one element
64 * update it
65 * else
66 * add
67 */
68 if((newTable = isNewTable(elt->getGrpMgr())) == 0)
69 {
70 kdDebug(30522) << "NEW TABLE !!" << endl;
71 newTable = new Table(elt->getGrpMgr());
72 newTable->append(elt);
73 append(newTable);
74 }
75 else
76 {
77 kdDebug(30522) << "UPDATE TABLE : " << elt->getGrpMgr() << endl;
78 newTable->append(elt);
79 }
80}
81
This class is a element.
ListTable()
Constructors.
Definition listtable.cpp:28
Table * isNewTable(TQString)
Accessors.
Definition listtable.cpp:44
void add(Element *)
Modifiers.
Definition listtable.cpp:60
This class hold a table.