summaryrefslogtreecommitdiffstats
path: root/filters/kword/latex/export/listtable.cc
blob: 55cbf23824d1acf85e1fef2cb1c646fff29fdf76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
** A program to convert the XML rendered by KWord into LATEX.
**
** Copyright (C) 2000 Robert JACOLIN
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Library General Public
** License as published by the Free Software Foundation; either
** version 2 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
** Library General Public License for more details.
**
** To receive a copy of the GNU Library General Public License, write to the
** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
**
*/

#include <kdebug.h>		/* for kdDebug stream */
#include "listtable.h"

/*******************************************/
/* Constructor                             */
/*******************************************/
ListTable::ListTable()
{

}

/*******************************************/
/* Destructor                              */
/*******************************************/
ListTable::~ListTable()
{
	/* Just call the parent destructor */
}

/*******************************************/
/* IsNewTable                              */
/*******************************************/
Table* ListTable::isNewTable(TQString grpMgr)
{
	Table *current = 0;

	/* Parcourir les tables et tester chaque nom de table */
	for(current = first(); current != 0; current = next())
	{
		if(current->getGrpMgr() == grpMgr)
			return current;
	}
	return 0;
}

/*******************************************/
/* add                                     */
/*******************************************/
void ListTable::add(Element* elt)
{
	Table* newTable = 0;
	/* If the GrpMng exist in one element 
	 * update it
	 * else
	 * add
	 */
	if((newTable = isNewTable(elt->getGrpMgr())) == 0)
	{
		kdDebug(30522) << "NEW TABLE !!" << endl;
		newTable = new Table(elt->getGrpMgr());
		newTable->append(elt);
		append(newTable);
	}
	else
	{
		kdDebug(30522) << "UPDATE TABLE : " << elt->getGrpMgr() << endl;
		newTable->append(elt);
	}
}