kword13formatone.cpp
1#include <tqtextstream.h>
2
3#include "kword13utils.h"
4#include "kword13formatone.h"
5
6KWord13FormatOneData::KWord13FormatOneData( void )
7{
8}
9
10KWord13FormatOneData::~KWord13FormatOneData( void )
11{
12}
13
14void KWord13FormatOneData::xmldump( TQTextStream& iostream )
15{
16 iostream << " <formatone>" << "\">\n";
17
18 for ( TQMap<TQString,TQString>::ConstIterator it = m_properties.begin();
19 it != m_properties.end();
20 ++it)
21 {
22 iostream << " <param key=\"" << it.key() << "\" data=\"" << EscapeXmlDump( it.data() ) << "\"/>\n";
23 }
24
25 iostream << " </formatone>\n";
26}
27
28TQString KWord13FormatOneData::key( void ) const
29{
30 TQString strKey;
31
32 // At first, use the number of properties as it is an easy sorting value
33 strKey += TQString::number( m_properties.count(), 16 );
34 strKey += ':';
35
36 // use the worst key: the whole TQMap (### FIXME)
37 for ( TQMap<TQString,TQString>::const_iterator it = m_properties.constBegin() ;
38 it != m_properties.constEnd(); ++it )
39 {
40 strKey += it.key();
41 strKey += '=';
42 strKey += it.data();
43 strKey += ';';
44 }
45
46 return strKey;
47}
48
49TQString KWord13FormatOneData::getProperty( const TQString& name ) const
50{
51 TQMap<TQString,TQString>::ConstIterator it ( m_properties.find( name ) );
52 if ( it == m_properties.end() )
53 {
54 // Property does not exist
55 return TQString();
56 }
57 else
58 {
59 return it.data();
60 }
61}
62
63//
64//
65//
66
67KWord13FormatOne::KWord13FormatOne(void) : m_length(1)
68{
69 m_id = 1;
70}
71
72KWord13FormatOne::~KWord13FormatOne(void)
73{
74}
75
77{
78 return m_length;
79}
80
85
Contains the data of the <FORMAT id="1"> children also the grand-children of <STYLE> and <LAYOUT>
TQString key(void) const
Get a key representating the properties.
virtual int length(void)
Get length of format.
int m_length
Length of format.
KWord13FormatOneData m_formatOne
Data of children of <FORMAT id="1">
virtual KWord13FormatOneData * getFormatOneData(void)
Get a pointer to the data correponding to <FORMAT id="1">