filters
KWEFStructures.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <kdebug.h>
00030
00031 #include "KWEFStructures.h"
00032
00033
00034 TableCell::~TableCell ( void )
00035 {
00036 #if 0
00037 if ( paraList) delete paraList;
00038 #endif
00039 }
00040
00041 void Table::addCell ( int c, int r, int _cols, int _rows, QValueList<ParaData> &p, FrameData &frameData )
00042 {
00043 if ( c + _cols > cols )
00044 {
00045 cols = c + _cols;
00046 }
00047
00048 cellList << TableCell ( c, r, _cols, _rows, new QValueList<ParaData> (p), frameData );
00049 }
00050
00051 bool TabulatorData::operator == (const TabulatorData& other) const
00052 {
00053 return ((m_type==other.m_type)
00054 && (m_ptpos==other.m_ptpos)
00055 && (m_filling==other.m_filling)
00056 && (m_width==other.m_width));
00057 }
00058
00059 void VariableData::setLink(const QString& linkName, const QString& hrefName)
00060 {
00061 propertyMap["link:linkName"]=linkName;
00062 propertyMap["link:hrefName"]=hrefName;
00063 }
00064
00065 QString VariableData::getLinkName(void) const
00066 {
00067 return propertyMap["link:linkName"];
00068 }
00069
00070 QString VariableData::getHrefName(void) const
00071 {
00072 return propertyMap["link:hrefName"];
00073 }
00074
00075 void VariableData::setPgNum(const QString& subtype, const QString& value)
00076 {
00077 propertyMap["pgnum:subtype"]=subtype;
00078 propertyMap["pgnum:value"]=value;
00079 }
00080
00081 bool VariableData::isPageNumber(void) const
00082 {
00083 const int num=propertyMap["pgnum:subtype"].toInt();
00084 return (num==0);
00085 }
00086
00087 bool VariableData::isPageCount(void) const
00088 {
00089 const int num=propertyMap["pgnum:subtype"].toInt();
00090 return (num==1);
00091 }
00092
00093 void VariableData::setField(const QString& name, const QString& value)
00094 {
00095 propertyMap["field:name"]=name;
00096 propertyMap["field:value"]=value;
00097 }
00098
00099 QString VariableData::getFieldName(void) const
00100 {
00101 return propertyMap["field:name"];
00102 }
00103
00104 QString VariableData::getFieldValue(void) const
00105 {
00106 return propertyMap["field:value"];
00107 }
00108
00109 void VariableData::setFootnote( const QString& notetype, const QString& automatic,const QString& value, QValueList<ParaData>* para)
00110 {
00111 propertyMap["footnote:value"] = value;
00112 propertyMap["footnote:auto"] = automatic;
00113 propertyMap["footnote:notetype"] = notetype;
00114 footnotePara = para;
00115 }
00116
00117 bool VariableData::getFootnoteAuto(void) const
00118 {
00119 return propertyMap["footnote:auto"]=="auto";
00120 }
00121
00122 QString VariableData::getFootnoteValue(void) const
00123 {
00124 return propertyMap["footnote:value"];
00125 }
00126
00127 bool VariableData::getFootnoteType( void ) const
00128 {
00129 return propertyMap["footnote:notetype"] == "footnote";
00130 }
00131
00132 QValueList<ParaData>* VariableData::getFootnotePara(void) const
00133 {
00134 return footnotePara;
00135 }
00136
00137 void VariableData::setGenericData( const QString& key, const QString& data )
00138 {
00139 propertyMap[ key ] = data ;
00140 }
00141
00142 QString VariableData::getGenericData( const QString& key ) const
00143 {
00144 return propertyMap[ key ];
00145 }
00146
00147 Bookmark::Bookmark()
00148 : m_startparag(-1), m_endparag(-1), m_cursorIndexStart(-1), m_cursorIndexEnd(-1)
00149 {
00150 }
00151
00152 void CreateMissingFormatData (QString ¶Text, ValueListFormatData ¶FormatDataList)
00153 {
00154 ValueListFormatData::Iterator paraFormatDataIt;
00155 int lastPos=0;
00156
00157 for (paraFormatDataIt = paraFormatDataList.begin ();
00158 paraFormatDataIt != paraFormatDataList.end ();
00159 paraFormatDataIt++)
00160 {
00161 if ( (*paraFormatDataIt).pos > lastPos )
00162 {
00163 #if 0
00164 kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos
00165 << ", pos = " << (*paraFormatDataIt).pos
00166 << ", len = " << (*paraFormatDataIt).len << " (bad)" << endl;
00167 #endif
00168
00169
00170 paraFormatDataList.insert ( paraFormatDataIt,
00171 FormatData ( lastPos, (*paraFormatDataIt).pos - lastPos, true ) );
00172 }
00173 #if 0
00174 else
00175 {
00176 kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos
00177 << ", pos = " << (*paraFormatDataIt).pos
00178 << ", len = " << (*paraFormatDataIt).len << " (ok)" << endl;
00179 }
00180 #endif
00181
00182
00183
00184
00185
00186 lastPos = (*paraFormatDataIt).pos + (*paraFormatDataIt).len;
00187
00188 }
00189
00190
00191 if ( (int) paraText.length () > lastPos )
00192 {
00193 #if 0
00194 kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos
00195 << ", total len = " << paraText.length () << " (bad)" << endl;
00196 #endif
00197
00198 paraFormatDataList.append (
00199 FormatData ( lastPos, paraText.length () - lastPos, true ) );
00200 }
00201 #if 0
00202 else
00203 {
00204 kdDebug (30508) << "CreateMissingFormatData: lastPos = " << lastPos
00205 << ", total len = " << paraText.length () << " (ok)" << endl;
00206 }
00207 #endif
00208 }
|