summaryrefslogtreecommitdiffstats
path: root/filters/kspread/latex/export/map.cpp
blob: 886f6c1154c0f1da4916ac715dbaf0a74d79e8cc (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
/*
** A program to convert the XML rendered by KWord into LATEX.
**
** Copyright (C) 2000, 2001, 2002 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 <stdlib.h>		/* for atoi function    */
#include <kdebug.h>		/* for kdDebug() stream */
#include "map.h"

/*******************************************/
/* Constructor                             */
/*******************************************/
Map::Map()
{
}

/*******************************************/
/* Destructor                              */
/*******************************************/
Map::~Map()
{
	kdDebug(30522) << "Destruction of a map." << endl;
}

/*******************************************/
/* Analyse                                 */
/*******************************************/
void Map::analyse(const TQDomNode balise)
{
	/* Analyse of the parameters */
	kdDebug(30522) << "ANALYSE A MAP" << endl;

	/* Analyse of the children markups */
	for(int index = 0; index < getNbChild(balise); index++)
	{
		// Only tables
		Table* table = new Table();
		table->analyse(getChild(balise, index));
		_tables.append(table);
	}
	kdDebug(30522) << "END OF MAP" << endl;
}

/*******************************************/
/* Generate                                */
/*******************************************/
/* Generate each text zone with the parag. */
/* markup.                                 */
/*******************************************/
void Map::generate(TQTextStream &out)
{
	Table *table = NULL;
	kdDebug(30522) << "  MAP GENERATION" << endl;
	TQPtrListIterator<Table> it(_tables);
	while ( (table = it.current()) != 0 )
	{
		++it;
		table->generate(out);
	}

	kdDebug(30522) << "MAP GENERATED" << endl;
}