filters

kword13formatone.cpp

00001 #include <qtextstream.h>
00002 
00003 #include "kword13utils.h"
00004 #include "kword13formatone.h"
00005 
00006 KWord13FormatOneData::KWord13FormatOneData( void )
00007 {
00008 }
00009 
00010 KWord13FormatOneData::~KWord13FormatOneData( void )
00011 {
00012 }
00013 
00014 void KWord13FormatOneData::xmldump( QTextStream& iostream )
00015 {
00016     iostream << "     <formatone>"  << "\">\n";
00017     
00018     for ( QMap<QString,QString>::ConstIterator it = m_properties.begin();
00019         it != m_properties.end();
00020         ++it)
00021     {
00022         iostream << "       <param key=\"" << it.key() << "\" data=\"" << EscapeXmlDump( it.data() ) << "\"/>\n";
00023     }
00024     
00025     iostream << "    </formatone>\n";
00026 }
00027 
00028 QString KWord13FormatOneData::key( void ) const
00029 {
00030     QString strKey;
00031     
00032     // At first, use the number of properties as it is an easy sorting value
00033     strKey += QString::number( m_properties.count(), 16 );
00034     strKey += ':';
00035   
00036     // use the worst key: the whole QMap (### FIXME)
00037     for ( QMap<QString,QString>::const_iterator it = m_properties.constBegin() ;
00038         it != m_properties.constEnd(); ++it )
00039     {
00040         strKey += it.key();
00041         strKey += '=';
00042         strKey += it.data();
00043         strKey += ';';
00044     }
00045       
00046     return strKey;
00047 }
00048 
00049 QString KWord13FormatOneData::getProperty( const QString& name ) const
00050 {
00051     QMap<QString,QString>::ConstIterator it ( m_properties.find( name ) );
00052     if ( it == m_properties.end() )
00053     {
00054         // Property does not exist
00055         return QString::null;
00056     }
00057     else
00058     {
00059         return it.data();
00060     }
00061 }
00062 
00063 //
00064 //
00065 //
00066 
00067 KWord13FormatOne::KWord13FormatOne(void) : m_length(1)
00068 {
00069     m_id = 1;
00070 }
00071 
00072 KWord13FormatOne::~KWord13FormatOne(void)
00073 {
00074 }
00075 
00076 int KWord13FormatOne::length(void)
00077 {
00078     return m_length;
00079 }
00080 
00081 KWord13FormatOneData* KWord13FormatOne::getFormatOneData(void)
00082 {
00083     return &m_formatOne;
00084 }
00085 
KDE Home | KDE Accessibility Home | Description of Access Keys