diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /filters/kword | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filters/kword')
309 files changed, 6897 insertions, 6856 deletions
diff --git a/filters/kword/abiword/ImportField.cc b/filters/kword/abiword/ImportField.cc index bfcc5a8c..dfba826d 100644 --- a/filters/kword/abiword/ImportField.cc +++ b/filters/kword/abiword/ImportField.cc @@ -17,27 +17,27 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> #include <klocale.h> #include "ImportField.h" -QString getFootnoteFramesetName(const QString& id) +TQString getFootnoteFramesetName(const TQString& id) { - return i18n("Frameset name","Footnote %1").arg(id); + return i18n("Frameset name","Footnote %1").tqarg(id); } -static void InsertTimeVariable(QDomDocument& mainDocument, - QDomElement& variableElement, QString strKey) +static void InsertTimeVariable(TQDomDocument& mainDocument, + TQDomElement& variableElement, TQString strKey) { - QDomElement typeElement=mainDocument.createElement("TYPE"); + TQDomElement typeElement=mainDocument.createElement("TYPE"); typeElement.setAttribute("key",strKey); typeElement.setAttribute("type",2); // Time typeElement.setAttribute("text","-"); // Dummy, we let KWord do the work! variableElement.appendChild(typeElement); //Append to <VARIABLE> - QDomElement timeElement=mainDocument.createElement("TIME"); + TQDomElement timeElement=mainDocument.createElement("TIME"); // We cannot calculate the time, so default to midnight timeElement.setAttribute("hour",0); timeElement.setAttribute("minute",0); @@ -46,15 +46,15 @@ static void InsertTimeVariable(QDomDocument& mainDocument, variableElement.appendChild(timeElement); //Append to <VARIABLE> } -static void InsertDateVariable(QDomDocument& mainDocument, - QDomElement& variableElement, QString strKey) +static void InsertDateVariable(TQDomDocument& mainDocument, + TQDomElement& variableElement, TQString strKey) { - QDomElement typeElement=mainDocument.createElement("TYPE"); + TQDomElement typeElement=mainDocument.createElement("TYPE"); typeElement.setAttribute("key",strKey); typeElement.setAttribute("type",0); // date typeElement.setAttribute("text","-"); // Just a dummy, KWord will do the work variableElement.appendChild(typeElement); //Append to <VARIABLE> - QDomElement dateElement=mainDocument.createElement("DATE"); + TQDomElement dateElement=mainDocument.createElement("DATE"); // As we have no idea about the current date, use the *nix epoch 1970-01-01 dateElement.setAttribute("year",1970); dateElement.setAttribute("month",1); @@ -63,8 +63,8 @@ static void InsertDateVariable(QDomDocument& mainDocument, variableElement.appendChild(dateElement); //Append to <VARIABLE> } -static bool ProcessTimeField(QDomDocument& mainDocument, - QDomElement& variableElement, QString strType) +static bool ProcessTimeField(TQDomDocument& mainDocument, + TQDomElement& variableElement, TQString strType) // strType: AbiWord's type { if (strType=="time") @@ -89,8 +89,8 @@ static bool ProcessTimeField(QDomDocument& mainDocument, return true; } -static bool ProcessDateField(QDomDocument& mainDocument, - QDomElement& variableElement, QString strType) +static bool ProcessDateField(TQDomDocument& mainDocument, + TQDomElement& variableElement, TQString strType) // strType: AbiWord's type // Help for the % formats: // man date @@ -137,8 +137,8 @@ static bool ProcessDateField(QDomDocument& mainDocument, return true; } -bool ProcessField(QDomDocument& mainDocument, - QDomElement& variableElement, QString strType, const QXmlAttributes& attributes) +bool ProcessField(TQDomDocument& mainDocument, + TQDomElement& variableElement, TQString strType, const TQXmlAttributes& attributes) { // In AbiWord: // field names are in the file: src/text/fmt/xp/fp_Fields.h @@ -155,12 +155,12 @@ bool ProcessField(QDomDocument& mainDocument, } else if ((strType=="page_number")||(strType=="page_count")) { - QDomElement typeElement=mainDocument.createElement("TYPE"); + TQDomElement typeElement=mainDocument.createElement("TYPE"); typeElement.setAttribute("key","NUMBER"); typeElement.setAttribute("type",4); // page number/count typeElement.setAttribute("text",1); // We cannot count the pages, so give a default value variableElement.appendChild(typeElement); //Append to <VARIABLE> - QDomElement pgnumElement=mainDocument.createElement("PGNUM"); + TQDomElement pgnumElement=mainDocument.createElement("PGNUM"); pgnumElement.setAttribute("subtype",(strType=="page_count")?1:0); pgnumElement.setAttribute("value",1); variableElement.appendChild(pgnumElement); //Append to <VARIABLE> @@ -168,12 +168,12 @@ bool ProcessField(QDomDocument& mainDocument, } else if (strType=="file_name") { - QDomElement typeElement=mainDocument.createElement("TYPE"); + TQDomElement typeElement=mainDocument.createElement("TYPE"); typeElement.setAttribute("key","STRING"); typeElement.setAttribute("type",8); typeElement.setAttribute("text","?"); // TODO: do we need this information right now? variableElement.appendChild(typeElement); //Append to <VARIABLE> - QDomElement fieldElement=mainDocument.createElement("FIELD"); + TQDomElement fieldElement=mainDocument.createElement("FIELD"); fieldElement.setAttribute("subtype",0); fieldElement.setAttribute("value","?"); // Should be the same as the text attribute variableElement.appendChild(fieldElement); //Append to <VARIABLE> @@ -181,15 +181,15 @@ bool ProcessField(QDomDocument& mainDocument, } else if (strType=="endnote_ref") { - QDomElement typeElement=mainDocument.createElement("TYPE"); + TQDomElement typeElement=mainDocument.createElement("TYPE"); typeElement.setAttribute("key","STRING"); typeElement.setAttribute("type",11); typeElement.setAttribute("text","?"); // ### TODO: do we need this information right now? variableElement.appendChild(typeElement); //Append to <VARIABLE> - QDomElement element=mainDocument.createElement("FOOTNOTE"); + TQDomElement element=mainDocument.createElement("FOOTNOTE"); element.setAttribute("numberingtype","auto"); // ### TODO: support other types element.setAttribute("notetype","footnote"); - QString reference(attributes.value("endnote-id").stripWhiteSpace()); + TQString reference(attributes.value("endnote-id").stripWhiteSpace()); element.setAttribute("frameset", getFootnoteFramesetName(reference)); // ### TODO: better name element.setAttribute("value","?"); // Should be the same as the text attribute variableElement.appendChild(element); //Append to <VARIABLE> diff --git a/filters/kword/abiword/ImportField.h b/filters/kword/abiword/ImportField.h index e357754d..2e660d41 100644 --- a/filters/kword/abiword/ImportField.h +++ b/filters/kword/abiword/ImportField.h @@ -20,11 +20,11 @@ #ifndef IMPORTFIELD_H #define IMPORTFIELD_H -#include <qxml.h> +#include <tqxml.h> -QString getFootnoteFramesetName(const QString& id); -bool ProcessField(QDomDocument& mainDocument, - QDomElement& variableElement, QString strType, const QXmlAttributes& attributes); +TQString getFootnoteFramesetName(const TQString& id); +bool ProcessField(TQDomDocument& mainDocument, + TQDomElement& variableElement, TQString strType, const TQXmlAttributes& attributes); #endif /* IMPORTFIELD_H */ diff --git a/filters/kword/abiword/ImportFormatting.cc b/filters/kword/abiword/ImportFormatting.cc index 950d41cc..14a059eb 100644 --- a/filters/kword/abiword/ImportFormatting.cc +++ b/filters/kword/abiword/ImportFormatting.cc @@ -32,14 +32,14 @@ StackItem::~StackItem() { } -void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, - const QXmlAttributes& attributes, AbiPropsMap& abiPropsMap, +void PopulateProperties(StackItem* stackItem, const TQString& strStyleProps, + const TQXmlAttributes& attributes, AbiPropsMap& abiPropsMap, const bool allowInit) // TODO: find a better name for this function { if (allowInit) { - // Initialize the QStrings with the previous values of the properties + // Initialize the TQStrings with the previous values of the properties // TODO: any others needed? if (stackItem->italic) { @@ -71,11 +71,11 @@ void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, stackItem->italic=(abiPropsMap["font-style"].getValue()=="italic"); stackItem->bold=(abiPropsMap["font-weight"].getValue()=="bold"); - QString strDecoration=abiPropsMap["text-decoration"].getValue(); + TQString strDecoration=abiPropsMap["text-decoration"].getValue(); stackItem->underline=(strDecoration=="underline"); stackItem->strikeout=(strDecoration=="line-through"); - QString strTextPosition=abiPropsMap["text-position"].getValue(); + TQString strTextPosition=abiPropsMap["text-position"].getValue(); if (strTextPosition=="subscript") { stackItem->textPosition=1; @@ -90,14 +90,14 @@ void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, stackItem->textPosition=0; } - QString strColour=abiPropsMap["color"].getValue(); + TQString strColour=abiPropsMap["color"].getValue(); if (!strColour.isEmpty()) { // The colour information is *not* lead by a hash (#) stackItem->fgColor.setNamedColor("#"+strColour); } - QString strBackgroundTextColor=abiPropsMap["bgcolor"].getValue(); + TQString strBackgroundTextColor=abiPropsMap["bgcolor"].getValue(); if (strBackgroundTextColor=="transparent") { // KWord has no idea what transparency is, so we use white @@ -109,7 +109,7 @@ void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, stackItem->bgColor.setNamedColor("#"+strBackgroundTextColor); } - QString strFontSize=abiPropsMap["font-size"].getValue(); + TQString strFontSize=abiPropsMap["font-size"].getValue(); if (!strFontSize.isEmpty()) { const int size=int(ValueWithLengthUnit(strFontSize)); @@ -119,7 +119,7 @@ void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, } } - QString strFontFamily=abiPropsMap["font-family"].getValue(); + TQString strFontFamily=abiPropsMap["font-family"].getValue(); if (!strFontFamily.isEmpty() && (strFontFamily!="(null)")) { // TODO: transform the font-family in a font that we have on the system on which KWord runs. @@ -127,9 +127,9 @@ void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, } } -void AddFormat(QDomElement& formatElementOut, StackItem* stackItem, QDomDocument& mainDocument) +void AddFormat(TQDomElement& formatElementOut, StackItem* stackItem, TQDomDocument& mainDocument) { - QDomElement element; + TQDomElement element; if (!stackItem->fontName.isEmpty()) { element=mainDocument.createElement("FONT"); @@ -186,17 +186,17 @@ void AddFormat(QDomElement& formatElementOut, StackItem* stackItem, QDomDocument } } -void AddLayout(const QString& strStyleName, QDomElement& layoutElement, - StackItem* stackItem, QDomDocument& mainDocument, +void AddLayout(const TQString& strStyleName, TQDomElement& tqlayoutElement, + StackItem* stackItem, TQDomDocument& mainDocument, const AbiPropsMap& abiPropsMap, const int level, const bool isStyle) { - QDomElement element; + TQDomElement element; element=mainDocument.createElement("NAME"); element.setAttribute("value",strStyleName); - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); - QString strFollowing=abiPropsMap["followedby"].getValue(); - QDomElement followingElement=mainDocument.createElement("FOLLOWING"); + TQString strFollowing=abiPropsMap["followedby"].getValue(); + TQDomElement followingElement=mainDocument.createElement("FOLLOWING"); followingElement.setAttribute("name",strFollowing); if ((strFollowing.isEmpty()) || (strFollowing=="Current Settings")) // "Current Settings" is only a pseudo-style! @@ -206,18 +206,18 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, { // We are a style, so we need a default followingElement.setAttribute("name","Normal"); - layoutElement.appendChild(followingElement); + tqlayoutElement.appendChild(followingElement); } - // Else: we are a layout, so we leave the work to KWord (from the style) + // Else: we are a tqlayout, so we leave the work to KWord (from the style) } else { // Following style is defined // TODO: we should be sure that this style is defined! - layoutElement.appendChild(followingElement); + tqlayoutElement.appendChild(followingElement); } - QString strFlow=abiPropsMap["text-align"].getValue(); + TQString strFlow=abiPropsMap["text-align"].getValue(); element=mainDocument.createElement("FLOW"); if ((strFlow=="left") || (strFlow=="center") || (strFlow=="right") || (strFlow=="justify")) { @@ -227,12 +227,12 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, { element.setAttribute("align","left"); } - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); int kwordDepth; int kwordNumberingType; int kwordType; - QString kwordRightText; + TQString kwordRightText; // level is 1 based like AbiWord, any value lower than 1 means no level! if ((level<=0) || (level>=15)) { @@ -258,11 +258,11 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, element.setAttribute("bullet",64); element.setAttribute("bulletfont","Symbol"); element.setAttribute("customdef",""); - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); - QString strLeftMargin=abiPropsMap["margin-left"].getValue(); - QString strRightMargin=abiPropsMap["margin-right"].getValue(); - QString strTextIndent=abiPropsMap["text-indent"].getValue(); + TQString strLeftMargin=abiPropsMap["margin-left"].getValue(); + TQString strRightMargin=abiPropsMap["margin-right"].getValue(); + TQString strTextIndent=abiPropsMap["text-indent"].getValue(); if ( !strLeftMargin.isEmpty() || !strRightMargin.isEmpty() @@ -275,11 +275,11 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, element.setAttribute("right",ValueWithLengthUnit(strRightMargin)); if (!strTextIndent.isEmpty()) element.setAttribute("first",ValueWithLengthUnit(strTextIndent)); - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); } - QString strTopMargin=abiPropsMap["margin-top"].getValue(); - QString strBottomMargin=abiPropsMap["margin-bottom"].getValue(); + TQString strTopMargin=abiPropsMap["margin-top"].getValue(); + TQString strBottomMargin=abiPropsMap["margin-bottom"].getValue(); if (!strTopMargin.isEmpty() || !strBottomMargin.isEmpty() ) { element=mainDocument.createElement("OFFSETS"); @@ -290,10 +290,10 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, element.setAttribute("after",margin_bottom); if (!strTopMargin.isEmpty()) element.setAttribute("before",margin_top); - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); } - QString strLineHeight=abiPropsMap["line-height"].getValue(); + TQString strLineHeight=abiPropsMap["line-height"].getValue(); if(!strLineHeight.isEmpty()) { element=mainDocument.createElement("LINESPACING"); @@ -351,18 +351,18 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, element.setAttribute( "spacingvalue", lineHeight ); } } - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); } - QString strTab=abiPropsMap["tabstops"].getValue(); + TQString strTab=abiPropsMap["tabstops"].getValue(); if(!strTab.isEmpty()) { - QStringList listTab=QStringList::split(",",strTab); - for ( QStringList::Iterator it = listTab.begin(); it != listTab.end(); ++it ) + TQStringList listTab=TQStringList::split(",",strTab); + for ( TQStringList::Iterator it = listTab.begin(); it != listTab.end(); ++it ) { - QStringList tab=QStringList::split("/",*it); - const QChar tabType=tab[1].at(0); - const QChar tabFilling=tab[1].at(1); // Might be empty in old AbiWord files + TQStringList tab=TQStringList::split("/",*it); + const TQChar tabType=tab[1].at(0); + const TQChar tabFilling=tab[1].at(1); // Might be empty in old AbiWord files int type; if (tabType=='L') // left type=0; @@ -376,7 +376,7 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, type=0; else { - kdWarning(30506)<<"Unknown tabulator type: " << QString(tabType) << endl; + kdWarning(30506)<<"Unknown tabulator type: " << TQString(tabType) << endl; type=0; } int filling; @@ -397,23 +397,23 @@ void AddLayout(const QString& strStyleName, QDomElement& layoutElement, element.setAttribute("type",type); element.setAttribute("filling",filling); element.setAttribute("width",width); - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); } } - QDomElement formatElementOut=mainDocument.createElement("FORMAT"); - layoutElement.appendChild(formatElementOut); + TQDomElement formatElementOut=mainDocument.createElement("FORMAT"); + tqlayoutElement.appendChild(formatElementOut); AddFormat(formatElementOut, stackItem, mainDocument); } -void AddStyle(QDomElement& styleElement, const QString& strStyleName, - const StyleData& styleData, QDomDocument& mainDocument) +void AddStyle(TQDomElement& styleElement, const TQString& strStyleName, + const StyleData& styleData, TQDomDocument& mainDocument) { // NOTE; styleElement is <STYLE> (singular), not <STYLES> (plural) StackItem stackItem; - QXmlAttributes attributes; // This is just a dummy for reusing already existing functions (TODO) + TQXmlAttributes attributes; // This is just a dummy for reusing already existing functions (TODO) AbiPropsMap abiPropsMap; PopulateProperties(&stackItem, styleData.m_props, attributes, abiPropsMap, false); diff --git a/filters/kword/abiword/ImportFormatting.h b/filters/kword/abiword/ImportFormatting.h index e7f9e000..31b26b3f 100644 --- a/filters/kword/abiword/ImportFormatting.h +++ b/filters/kword/abiword/ImportFormatting.h @@ -20,11 +20,11 @@ #ifndef _IMPORT_FORMATTING_H #define _IMPORT_FORMATTING_H -#include <qptrstack.h> -#include <qstring.h> -#include <qcolor.h> -#include <qxml.h> -#include <qdom.h> +#include <tqptrstack.h> +#include <tqstring.h> +#include <tqcolor.h> +#include <tqxml.h> +#include <tqdom.h> #include "ImportHelpers.h" @@ -74,28 +74,28 @@ public: StackItem(); ~StackItem(); public: - QString itemName; ///< Name of the tag (only for error purposes) + TQString itemName; ///< Name of the tag (only for error purposes) StackItemElementType elementType; - QDomElement m_frameset; ///< current \<FRAMESET\> - QDomElement stackElementParagraph; ///< \<PARAGRAPH\> - QDomElement stackElementText; ///< \<TEXT\> - QDomElement stackElementFormatsPlural; ///< \<FORMATS\> - QString fontName; ///< font name but for \<d\>: name + TQDomElement m_frameset; ///< current \<FRAMESET\> + TQDomElement stackElementParagraph; ///< \<PARAGRAPH\> + TQDomElement stackElementText; ///< \<TEXT\> + TQDomElement stackElementFormatsPlural; ///< \<FORMATS\> + TQString fontName; ///< font name but for \<d\>: name int fontSize; int pos; ///< Position bool italic; bool bold; ///< bold but for \<d\>: is base64 coded? bool underline; bool strikeout; - QColor fgColor; - QColor bgColor; + TQColor fgColor; + TQColor bgColor; int textPosition; ///< Normal (0), subscript(1), superscript (2) - QString strTemp1; /**< for \<d\>: mime type + TQString strTemp1; /**< for \<d\>: mime type * for \<a\>: link reference * for \<m\>: key * for \<table\>: KWord's table name */ - QString strTemp2; /**< for \<d\>: collecting the data + TQString strTemp2; /**< for \<d\>: collecting the data * for \<a\>: link name * for \<iw\>: collecting the data (i.e. word to ignore) * for \<m\>: value of the meta data @@ -103,12 +103,12 @@ public: */ /** * for tables (\<table\>, \<cell\>): defines the widths of the columns. - * Be careful: we are using the shallow copy mechanism of Qt. Use QMemArray::detach when needed to avoid modifying the parents + * Be careful: we are using the shallow copy mechanism of TQt. Use TQMemArray::detach when needed to avoid modifying the tqparents */ - QMemArray<double> m_doubleArray; + TQMemArray<double> m_doubleArray; }; -class StackItemStack : public QPtrStack<StackItem> +class StackItemStack : public TQPtrStack<StackItem> { public: StackItemStack(void) { } @@ -117,16 +117,16 @@ public: class StyleData; -void PopulateProperties(StackItem* stackItem, const QString& strStyleProps, - const QXmlAttributes& attributes, AbiPropsMap& abiPropsMap, +void PopulateProperties(StackItem* stackItem, const TQString& strStyleProps, + const TQXmlAttributes& attributes, AbiPropsMap& abiPropsMap, const bool allowInit); -void AddFormat(QDomElement& formatElementOut, StackItem* stackItem, - QDomDocument& mainDocument); -void AddLayout(const QString& strStyleName, QDomElement& layoutElement, - StackItem* stackItem, QDomDocument& mainDocument, +void AddFormat(TQDomElement& formatElementOut, StackItem* stackItem, + TQDomDocument& mainDocument); +void AddLayout(const TQString& strStyleName, TQDomElement& tqlayoutElement, + StackItem* stackItem, TQDomDocument& mainDocument, const AbiPropsMap& abiPropsMap, const int level, const bool isStyle); -void AddStyle(QDomElement& styleElement, const QString& strStyleName, - const StyleData& styleData, QDomDocument& mainDocument); +void AddStyle(TQDomElement& styleElement, const TQString& strStyleName, + const StyleData& styleData, TQDomDocument& mainDocument); #endif // _IMPORT_FORMATTING_H diff --git a/filters/kword/abiword/ImportHelpers.cc b/filters/kword/abiword/ImportHelpers.cc index 19b4bac4..d37b078c 100644 --- a/filters/kword/abiword/ImportHelpers.cc +++ b/filters/kword/abiword/ImportHelpers.cc @@ -17,37 +17,37 @@ * Boston, MA 02110-1301, USA. */ -#include <qstringlist.h> -#include <qregexp.h> +#include <tqstringlist.h> +#include <tqregexp.h> #include <kdebug.h> #include "ImportHelpers.h" -bool AbiPropsMap::setProperty(const QString& newName, const QString& newValue) +bool AbiPropsMap::setProperty(const TQString& newName, const TQString& newValue) { - replace(newName,AbiProps(newValue)); + tqreplace(newName,AbiProps(newValue)); return true; } // Treat the "props" attribute of AbiWord's tags and split it in separates names and values -void AbiPropsMap::splitAndAddAbiProps(const QString& strProps) +void AbiPropsMap::splitAndAddAbiProps(const TQString& strProps) { if (strProps.isEmpty()) return; // Split the properties (we do not want empty ones) - QStringList list=QStringList::split(';',strProps,false); - QString name,value; + TQStringList list=TQStringList::split(';',strProps,false); + TQString name,value; - QStringList::ConstIterator it; - QStringList::ConstIterator end(list.end()); + TQStringList::ConstIterator it; + TQStringList::ConstIterator end(list.end()); for (it=list.begin();it!=end;++it) { - const int result=(*it).find(':'); + const int result=(*it).tqfind(':'); if (result==-1) { name=(*it); - value=QString::null; + value=TQString(); kdWarning(30506) << "Property without value: " << name << endl; } else @@ -61,14 +61,14 @@ void AbiPropsMap::splitAndAddAbiProps(const QString& strProps) } } -double ValueWithLengthUnit( const QString& _str, bool* atleast ) +double ValueWithLengthUnit( const TQString& _str, bool* atleast ) { if ( atleast ) *atleast = false; double result; // We search an unit (defined by a sequence of lower case characters), with possibly a + sign after it - QRegExp unitExp("([a-z]+)\\s*(\\+?)"); + TQRegExp unitExp("([a-z]+)\\s*(\\+?)"); const int pos=unitExp.search(_str); if (pos==-1) { @@ -80,7 +80,7 @@ double ValueWithLengthUnit( const QString& _str, bool* atleast ) else { const double rawValue=_str.left(pos).toDouble(); - const QString strUnit ( unitExp.cap(1) ); + const TQString strUnit ( unitExp.cap(1) ); if (strUnit=="cm") result=CentimetresToPoints(rawValue); else if (strUnit=="in") diff --git a/filters/kword/abiword/ImportHelpers.h b/filters/kword/abiword/ImportHelpers.h index bc72c4ab..04419b90 100644 --- a/filters/kword/abiword/ImportHelpers.h +++ b/filters/kword/abiword/ImportHelpers.h @@ -20,37 +20,37 @@ #ifndef _IMPORT_HELPERS_H #define _IMPORT_HELPERS_H -#include <qstring.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqmap.h> /** * \file ImportHelpers.h * Helpers for the AbiWord import filter * * Rough rule for including code in this file: - * use nothing of QT except QMap, QValueList and QString + * use nothing of QT except TQMap, TQValueList and TQString */ class AbiProps { public: AbiProps() {}; - AbiProps(QString newValue) : m_value(newValue) {}; + AbiProps(TQString newValue) : m_value(newValue) {}; virtual ~AbiProps() {}; public: - inline QString getValue(void) const { return m_value; } + inline TQString getValue(void) const { return m_value; } private: - QString m_value; + TQString m_value; }; -class AbiPropsMap : public QMap<QString,AbiProps> +class AbiPropsMap : public TQMap<TQString,AbiProps> { public: AbiPropsMap() {}; virtual ~AbiPropsMap() {}; public: - bool setProperty(const QString& newName, const QString& newValue); - void splitAndAddAbiProps(const QString& strProps); + bool setProperty(const TQString& newName, const TQString& newValue); + void splitAndAddAbiProps(const TQString& strProps); }; inline double CentimetresToPoints(const double d) @@ -80,6 +80,6 @@ inline double PicaToPoints(const double d) * @param atleast was there a + character after the unit to denote an "at-least" property * @return the value as double (in points) */ -double ValueWithLengthUnit( const QString& _str, bool* atleast = NULL ); +double ValueWithLengthUnit( const TQString& _str, bool* atleast = NULL ); #endif // _IMPORT_HELPERS_H diff --git a/filters/kword/abiword/ImportStyle.cc b/filters/kword/abiword/ImportStyle.cc index e5d371de..62d951e5 100644 --- a/filters/kword/abiword/ImportStyle.cc +++ b/filters/kword/abiword/ImportStyle.cc @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qfontinfo.h> +#include <tqfontinfo.h> #include <kglobalsettings.h> #include <kdebug.h> @@ -34,11 +34,11 @@ StyleDataMap::StyleDataMap(void) { } -QString StyleDataMap::getDefaultStyle(void) +TQString StyleDataMap::getDefaultStyle(void) { - // We use QFontInfo, as it return real values - QFontInfo fontInfo(KoGlobal::defaultFont()); - QString strReturn; + // We use TQFontInfo, as it return real values + TQFontInfo fontInfo(KoGlobal::defaultFont()); + TQString strReturn; strReturn += "font-family:"; strReturn += fontInfo.family(); // TODO: should be "Times New Roman" @@ -48,8 +48,8 @@ QString StyleDataMap::getDefaultStyle(void) return strReturn; } -void StyleDataMap::defineNewStyleFromOld(const QString& strName, const QString& strOld, - const int level, const QString& strProps) +void StyleDataMap::defineNewStyleFromOld(const TQString& strName, const TQString& strOld, + const int level, const TQString& strProps) { if (strOld.isEmpty()) { @@ -57,26 +57,26 @@ void StyleDataMap::defineNewStyleFromOld(const QString& strName, const QString& return; } - StyleDataMap::Iterator it=find(strOld); + StyleDataMap::Iterator it=tqfind(strOld); if (it==end()) { defineNewStyle(strName,level,strProps); } else { - QString strAllProps=it.data().m_props; + TQString strAllProps=it.data().m_props; strAllProps+=strProps; defineNewStyle(strName,level,strAllProps); } } -void StyleDataMap::defineNewStyle(const QString& strName, const int level, - const QString& strProps) +void StyleDataMap::defineNewStyle(const TQString& strName, const int level, + const TQString& strProps) { // Despite its name, this method can be called multiple times // We must take care that KWord just gets it only one time. - StyleDataMap::Iterator it=find(strName); + StyleDataMap::Iterator it=tqfind(strName); if (it==end()) { // The style does not exist yet, so we must define it. @@ -92,10 +92,10 @@ void StyleDataMap::defineNewStyle(const QString& strName, const int level, } } -StyleDataMap::Iterator StyleDataMap::useOrCreateStyle(const QString& strName) +StyleDataMap::Iterator StyleDataMap::useOrCreateStyle(const TQString& strName) { // We are using a style but we are not sure if it is defined - StyleDataMap::Iterator it=find(strName); + StyleDataMap::Iterator it=tqfind(strName); if (it==end()) { // The style is not yet defined! @@ -111,17 +111,17 @@ void StyleDataMap::defineDefaultStyles(void) { // Add a few of AbiWord predefined style sheets // AbiWord file: src/text/ptbl/xp/pt_PT_Styles.cpp - defineNewStyle("Normal",-1,QString::null); + defineNewStyle("Normal",-1,TQString()); // TODO: font should be "Arial" // TODO: "keep with next" - QString strHeading("font-weight: bold; margin-top: 22pt; margin-bottom: 3pt; "); + TQString strHeading("font-weight: bold; margin-top: 22pt; margin-bottom: 3pt; "); defineNewStyle("Heading 1",1,strHeading+"font-size: 17pt"); defineNewStyle("Heading 2",2,strHeading+"font-size: 14pt"); defineNewStyle("Heading 3",3,strHeading+"font-size: 12pt"); defineNewStyle("Block Text",-1,"margin-left: 1in; margin-right: 1in; margin-bottom: 6pt"); - QFontInfo fixedInfo(KGlobalSettings::fixedFont()); - QString strPlainText=QString("font-family: %1") - .arg(fixedInfo.family()); // TODO: should be "Courier New" + TQFontInfo fixedInfo(KGlobalSettings::fixedFont()); + TQString strPlainText=TQString("font-family: %1") + .tqarg(fixedInfo.family()); // TODO: should be "Courier New" kdDebug(30506) << "Plain Text: " << strPlainText << endl; defineNewStyle("Plain Text",-1,strPlainText); // TODO: all list and numbered types diff --git a/filters/kword/abiword/ImportStyle.h b/filters/kword/abiword/ImportStyle.h index b812640a..dfa91028 100644 --- a/filters/kword/abiword/ImportStyle.h +++ b/filters/kword/abiword/ImportStyle.h @@ -20,9 +20,9 @@ #ifndef _IMPORT_STYLE_H #define _IMPORT_STYLE_H -#include <qvaluelist.h> -#include <qstring.h> -#include <qmap.h> +#include <tqvaluelist.h> +#include <tqstring.h> +#include <tqmap.h> class StyleData { @@ -30,21 +30,21 @@ public: StyleData(void); public: int m_level; // Depth of heading (as defined by AbiWord!) - QString m_props; // properties + TQString m_props; // properties }; -class StyleDataMap : public QMap<QString,StyleData> +class StyleDataMap : public TQMap<TQString,StyleData> { public: StyleDataMap(void); public: - void defineNewStyle(const QString& strName, const int level, const QString& strProps); - void defineNewStyleFromOld(const QString& strName, const QString& strOld, - const int level, const QString& strProps); - StyleDataMap::Iterator useOrCreateStyle(const QString& strName); + void defineNewStyle(const TQString& strName, const int level, const TQString& strProps); + void defineNewStyleFromOld(const TQString& strName, const TQString& strOld, + const int level, const TQString& strProps); + StyleDataMap::Iterator useOrCreateStyle(const TQString& strName); void defineDefaultStyles(void); private: - QString getDefaultStyle(void); + TQString getDefaultStyle(void); }; #endif // _IMPORT_STYLE_H diff --git a/filters/kword/abiword/abiwordexport.cc b/filters/kword/abiword/abiwordexport.cc index 31733bd6..281f5d7e 100644 --- a/filters/kword/abiword/abiwordexport.cc +++ b/filters/kword/abiword/abiwordexport.cc @@ -30,10 +30,10 @@ License version 2. */ -#include <qmap.h> -#include <qiodevice.h> -#include <qtextstream.h> -#include <qdom.h> +#include <tqmap.h> +#include <tqiodevice.h> +#include <tqtextstream.h> +#include <tqdom.h> #include <kdebug.h> #include <kmdcodec.h> @@ -67,7 +67,7 @@ protected: K_EXPORT_COMPONENT_FACTORY( libabiwordexport, ABIWORDExportFactory() ) -class StyleMap : public QMap<QString,LayoutData> +class StyleMap : public TQMap<TQString,LayoutData> { public: StyleMap(void) {} @@ -80,11 +80,11 @@ public: AbiWordWorker(void); virtual ~AbiWordWorker(void) { delete m_streamOut; delete m_ioDevice; } public: - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); // Close file in normal conditions virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); virtual bool doOpenTextFrameSet(void); // AbiWord's <section> virtual bool doCloseTextFrameSet(void); // AbiWord's </section> @@ -95,39 +95,39 @@ public: virtual bool doCloseHead(void); // Write <papersize> virtual bool doOpenStyles(void); // AbiWord's <styles> virtual bool doCloseStyles(void); // AbiWord's </styles> - virtual bool doFullDefineStyle(LayoutData& layout); // AbiWord's <s></s> + virtual bool doFullDefineStyle(LayoutData& tqlayout); // AbiWord's <s></s> virtual bool doOpenSpellCheckIgnoreList (void); // AbiWord's <ignorewords> virtual bool doCloseSpellCheckIgnoreList (void); // AbiWord's </ignorewords> - virtual bool doFullSpellCheckIgnoreWord (const QString& ignoreword); // AbiWord's <iw> + virtual bool doFullSpellCheckIgnoreWord (const TQString& ignoreword); // AbiWord's <iw> virtual bool doFullDocumentInfo(const KWEFDocumentInfo& docInfo); // AbiWord's <metadata> private: - void processParagraphData (const QString& paraText, + void processParagraphData (const TQString& paraText, const TextFormatting& formatLayout, const ValueListFormatData& paraFormatDataList); - void processNormalText ( const QString& paraText, + void processNormalText ( const TQString& paraText, const TextFormatting& formatLayout, const FormatData& formatData); - void processVariable ( const QString& paraText, + void processVariable ( const TQString& paraText, const TextFormatting& formatLayout, const FormatData& formatData); - void processAnchor ( const QString& paraText, + void processAnchor ( const TQString& paraText, const TextFormatting& formatLayout, const FormatData& formatData); - QString textFormatToAbiProps(const TextFormatting& formatOrigin, + TQString textFormatToAbiProps(const TextFormatting& formatOrigin, const TextFormatting& formatData, const bool force) const; - QString layoutToCss(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force) const; - QString escapeAbiWordText(const QString& strText) const; + TQString tqlayoutToCss(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force) const; + TQString escapeAbiWordText(const TQString& strText) const; bool makeTable(const FrameAnchor& anchor); bool makePicture(const FrameAnchor& anchor); void writeAbiProps(const TextFormatting& formatLayout, const TextFormatting& format); - void writePictureData(const QString& koStoreName, const QString& keyName); - QString transformToTextDate(const QDateTime& dt); + void writePictureData(const TQString& koStoreName, const TQString& keyName); + TQString transformToTextDate(const TQDateTime& dt); private: - QIODevice* m_ioDevice; - QTextStream* m_streamOut; - QString m_pagesize; // Buffer for the <pagesize> tag - QMap<QString,KoPictureKey> m_mapPictureData; + TQIODevice* m_ioDevice; + TQTextStream* m_streamOut; + TQString m_pagesize; // Buffer for the <pagesize> tag + TQMap<TQString,KoPictureKey> m_mapPictureData; StyleMap m_styleMap; double m_paperBorderTop,m_paperBorderLeft,m_paperBorderBottom,m_paperBorderRight; bool m_inIgnoreWords; // true if <ignorewords> has been written @@ -140,26 +140,26 @@ AbiWordWorker::AbiWordWorker(void) : m_ioDevice(NULL), m_streamOut(NULL), { } -QString AbiWordWorker::escapeAbiWordText(const QString& strText) const +TQString AbiWordWorker::escapeAbiWordText(const TQString& strText) const { // Escape quotes (needed in attributes) // Escape apostrophs (allowed by XML) return KWEFUtil::EscapeSgmlText(NULL,strText,true,true); } -bool AbiWordWorker::doOpenFile(const QString& filenameOut, const QString& ) +bool AbiWordWorker::doOpenFile(const TQString& filenameOut, const TQString& ) { kdDebug(30506) << "Opening file: " << filenameOut << " (in AbiWordWorker::doOpenFile)" << endl; //Find the last extension - QString strExt; - const int result=filenameOut.findRev('.'); + TQString strExt; + const int result=filenameOut.tqfindRev('.'); if (result>=0) { strExt=filenameOut.mid(result); } - QString strMimeType; // Mime type of the compressor + TQString strMimeType; // Mime type of the compressor if ((strExt==".gz")||(strExt==".GZ") //in case of .abw.gz (logical extension) ||(strExt==".zabw")||(strExt==".ZABW")) //in case of .zabw (extension used prioritary with AbiWord) @@ -195,10 +195,10 @@ bool AbiWordWorker::doOpenFile(const QString& filenameOut, const QString& ) return false; } - m_streamOut=new QTextStream(m_ioDevice); + m_streamOut=new TQTextStream(m_ioDevice); // We only export in UTF-8 (are there AbiWord ports that cannot read UTF-8? Be careful SVG uses UTF-8 too!) - m_streamOut->setEncoding( QTextStream::UnicodeUTF8 ); + m_streamOut->setEncoding( TQTextStream::UnicodeUTF8 ); return true; } @@ -246,14 +246,14 @@ bool AbiWordWorker::doOpenDocument(void) return true; } -void AbiWordWorker::writePictureData(const QString& koStoreName, const QString& keyName) +void AbiWordWorker::writePictureData(const TQString& koStoreName, const TQString& keyName) { kdDebug(30506) << "AbiWordWorker::writeImageData" << endl; - QByteArray image; + TQByteArray image; - QString strExtension(koStoreName.lower()); - const int result=koStoreName.findRev("."); + TQString strExtension(koStoreName.lower()); + const int result=koStoreName.tqfindRev("."); if (result>=0) { strExtension=koStoreName.mid(result+1); @@ -278,9 +278,9 @@ void AbiWordWorker::writePictureData(const QString& koStoreName, const QString& << " base64=\"yes\"" << " mime=\"image/png\">\n"; - QCString base64=KCodecs::base64Encode(image,true); + TQCString base64=KCodecs::base64Encode(image,true); - *m_streamOut << base64 << "\n"; // QCString is taken as Latin1 by QTextStream + *m_streamOut << base64 << "\n"; // TQCString is taken as Latin1 by TQTextStream *m_streamOut << "</d>\n"; } @@ -299,8 +299,8 @@ bool AbiWordWorker::doCloseDocument(void) { *m_streamOut << "<data>\n"; - QMap<QString,KoPictureKey>::ConstIterator it; - QMap<QString,KoPictureKey>::ConstIterator end(m_mapPictureData.end()); + TQMap<TQString,KoPictureKey>::ConstIterator it; + TQMap<TQString,KoPictureKey>::ConstIterator end(m_mapPictureData.end()); // all images first for (it=m_mapPictureData.begin(); it!=end; ++it) { @@ -352,14 +352,14 @@ bool AbiWordWorker::doCloseStyles(void) return true; } -QString AbiWordWorker::textFormatToAbiProps(const TextFormatting& formatOrigin, +TQString AbiWordWorker::textFormatToAbiProps(const TextFormatting& formatOrigin, const TextFormatting& formatData, const bool force) const { // TODO: rename variable formatData - QString strElement; // TODO: rename this variable + TQString strElement; // TODO: rename this variable // Font name - QString fontName = formatData.fontName; + TQString fontName = formatData.fontName; if ( !fontName.isEmpty() && (force || (formatOrigin.fontName!=formatData.fontName))) { @@ -404,7 +404,7 @@ QString AbiWordWorker::textFormatToAbiProps(const TextFormatting& formatOrigin, { // We use absolute font sizes. strElement+="font-size: "; - strElement+=QString::number(size,10); + strElement+=TQString::number(size,10); strElement+="pt; "; } } @@ -419,16 +419,16 @@ QString AbiWordWorker::textFormatToAbiProps(const TextFormatting& formatOrigin, // No leading # (unlike CSS2) // We must have two hex digits for each colour channel! const int red=formatData.fgColor.red(); - strElement += QString::number((red&0xf0)>>4,16); - strElement += QString::number(red&0x0f,16); + strElement += TQString::number((red&0xf0)>>4,16); + strElement += TQString::number(red&0x0f,16); const int green=formatData.fgColor.green(); - strElement += QString::number((green&0xf0)>>4,16); - strElement += QString::number(green&0x0f,16); + strElement += TQString::number((green&0xf0)>>4,16); + strElement += TQString::number(green&0x0f,16); const int blue=formatData.fgColor.blue(); - strElement += QString::number((blue&0xf0)>>4,16); - strElement += QString::number(blue&0x0f,16); + strElement += TQString::number((blue&0xf0)>>4,16); + strElement += TQString::number(blue&0x0f,16); strElement+="; "; } @@ -444,16 +444,16 @@ QString AbiWordWorker::textFormatToAbiProps(const TextFormatting& formatOrigin, // No leading # (unlike CSS2) // We must have two hex digits for each colour channel! const int red=formatData.bgColor.red(); - strElement += QString::number((red&0xf0)>>4,16); - strElement += QString::number(red&0x0f,16); + strElement += TQString::number((red&0xf0)>>4,16); + strElement += TQString::number(red&0x0f,16); const int green=formatData.bgColor.green(); - strElement += QString::number((green&0xf0)>>4,16); - strElement += QString::number(green&0x0f,16); + strElement += TQString::number((green&0xf0)>>4,16); + strElement += TQString::number(green&0x0f,16); const int blue=formatData.bgColor.blue(); - strElement += QString::number((blue&0xf0)>>4,16); - strElement += QString::number(blue&0x0f,16); + strElement += TQString::number((blue&0xf0)>>4,16); + strElement += TQString::number(blue&0x0f,16); strElement+="; "; } @@ -488,7 +488,7 @@ bool AbiWordWorker::makeTable(const FrameAnchor& anchor) *m_streamOut << "<table>\n"; #endif - QValueList<TableCell>::ConstIterator itCell; + TQValueList<TableCell>::ConstIterator itCell; for (itCell=anchor.table.cellList.begin(); itCell!=anchor.table.cellList.end(); itCell++) { @@ -540,10 +540,10 @@ bool AbiWordWorker::makePicture(const FrameAnchor& anchor) void AbiWordWorker::writeAbiProps (const TextFormatting& formatLayout, const TextFormatting& format) { - QString abiprops=textFormatToAbiProps(formatLayout,format,false); + TQString abiprops=textFormatToAbiProps(formatLayout,format,false); // Erase the last semi-comma (as in CSS2, semi-commas only separate instructions and do not terminate them) - const int result=abiprops.findRev(";"); + const int result=abiprops.tqfindRev(";"); if (result>=0) { @@ -557,18 +557,18 @@ void AbiWordWorker::writeAbiProps (const TextFormatting& formatLayout, const Tex } } -void AbiWordWorker::processNormalText ( const QString ¶Text, +void AbiWordWorker::processNormalText ( const TQString ¶Text, const TextFormatting& formatLayout, const FormatData& formatData) { // Retrieve text and escape it - QString partialText=escapeAbiWordText(paraText.mid(formatData.pos,formatData.len)); + TQString partialText=escapeAbiWordText(paraText.mid(formatData.pos,formatData.len)); // Replace line feeds by line breaks int pos; - while ((pos=partialText.find(QChar(10)))>-1) + while ((pos=partialText.tqfind(TQChar(10)))>-1) { - partialText.replace(pos,1,"<br/>"); + partialText.tqreplace(pos,1,"<br/>"); } if (formatData.text.missing) @@ -584,7 +584,7 @@ void AbiWordWorker::processNormalText ( const QString ¶Text, } } -void AbiWordWorker::processVariable ( const QString&, +void AbiWordWorker::processVariable ( const TQString&, const TextFormatting& formatLayout, const FormatData& formatData) { @@ -605,7 +605,7 @@ void AbiWordWorker::processVariable ( const QString&, else if (4==formatData.variable.m_type) { // As AbiWord's field is inflexible, we cannot make the time custom - QString strFieldType; + TQString strFieldType; if (formatData.variable.isPageNumber()) { strFieldType="page_number"; @@ -641,15 +641,15 @@ void AbiWordWorker::processVariable ( const QString&, else if (11==(*paraFormatDataIt).variable.m_type) { // Footnote - QString value = (*paraFormatDataIt).variable.getFootnoteValue(); + TQString value = (*paraFormatDataIt).variable.getFootnoteValue(); bool automatic = (*paraFormatDataIt).variable.getFootnoteAuto(); - QValueList<ParaData> *paraList = (*paraFormatDataIt).variable.getFootnotePara(); + TQValueList<ParaData> *paraList = (*paraFormatDataIt).variable.getFootnotePara(); if( paraList ) { - QString fstr; - QValueList<ParaData>::ConstIterator it; + TQString fstr; + TQValueList<ParaData>::ConstIterator it; for (it=paraList->begin();it!=paraList->end();it++) - fstr += ProcessParagraphData( (*it).text, (*it).layout,(*it).formattingList); + fstr += ProcessParagraphData( (*it).text, (*it).tqlayout,(*it).formattingList); str += "{\\super "; str += automatic ? "\\chftn " : value; str += "{\\footnote "; @@ -669,7 +669,7 @@ void AbiWordWorker::processVariable ( const QString&, } } -void AbiWordWorker::processAnchor ( const QString&, +void AbiWordWorker::processAnchor ( const TQString&, const TextFormatting& /*formatLayout*/, //TODO const FormatData& formatData) { @@ -690,7 +690,7 @@ void AbiWordWorker::processAnchor ( const QString&, } } -void AbiWordWorker::processParagraphData ( const QString ¶Text, +void AbiWordWorker::processParagraphData ( const TQString ¶Text, const TextFormatting& formatLayout, const ValueListFormatData ¶FormatDataList) { @@ -718,51 +718,51 @@ void AbiWordWorker::processParagraphData ( const QString ¶Text, } } -QString AbiWordWorker::layoutToCss(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force) const +TQString AbiWordWorker::tqlayoutToCss(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force) const { - QString props; + TQString props; - if (force || (layoutOrigin.alignment!=layout.alignment)) + if (force || (tqlayoutOrigin.tqalignment!=tqlayout.tqalignment)) { - // Check if the current alignment is a valid one for AbiWord. - if ((layout.alignment == "left") || (layout.alignment == "right") - || (layout.alignment == "center") || (layout.alignment == "justify")) + // Check if the current tqalignment is a valid one for AbiWord. + if ((tqlayout.tqalignment == "left") || (tqlayout.tqalignment == "right") + || (tqlayout.tqalignment == "center") || (tqlayout.tqalignment == "justify")) { props += "text-align:"; - props += layout.alignment; + props += tqlayout.tqalignment; props += "; "; } - else if (layout.alignment == "auto") + else if (tqlayout.tqalignment == "auto") { - // We assume a left alignment as AbiWord is not really bi-di (and this filter even less.) + // We assume a left tqalignment as AbiWord is not really bi-di (and this filter even less.) props += "text-align:left; "; } else { - kdWarning(30506) << "Unknown alignment: " << layout.alignment << endl; + kdWarning(30506) << "Unknown tqalignment: " << tqlayout.tqalignment << endl; } } // TODO/FIXME: what if all tabulators must be erased? #if 0 // DEPRECATED! - if (!layout.tabulator.isEmpty() - && (force || (layoutOrigin.tabulator!=layout.tabulator))) + if (!tqlayout.tabulator.isEmpty() + && (force || (tqlayoutOrigin.tabulator!=tqlayout.tabulator))) { props += "tabstops:"; - props += layout.tabulator; + props += tqlayout.tabulator; props += "; "; } #endif - if (!layout.tabulatorList.isEmpty() - && (force || (layoutOrigin.tabulatorList!=layout.tabulatorList) )) + if (!tqlayout.tabulatorList.isEmpty() + && (force || (tqlayoutOrigin.tabulatorList!=tqlayout.tabulatorList) )) { props += "tabstops:"; bool first=true; TabulatorList::ConstIterator it; - TabulatorList::ConstIterator end(layout.tabulatorList.end()); - for (it=layout.tabulatorList.begin();it!=end;++it) + TabulatorList::ConstIterator end(tqlayout.tabulatorList.end()); + for (it=tqlayout.tabulatorList.begin();it!=end;++it) { if (first) { @@ -772,7 +772,7 @@ QString AbiWordWorker::layoutToCss(const LayoutData& layoutOrigin, { props += ","; } - props += QString::number((*it).m_ptpos); + props += TQString::number((*it).m_ptpos); props += "pt"; switch ((*it).m_type) @@ -789,48 +789,48 @@ QString AbiWordWorker::layoutToCss(const LayoutData& layoutOrigin, props += "; "; } - if ((layout.indentLeft>=0.0) - && (force || (layoutOrigin.indentLeft!=layout.indentLeft))) + if ((tqlayout.indentLeft>=0.0) + && (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft))) { - props += QString("margin-left:%1pt; ").arg(layout.indentLeft); + props += TQString("margin-left:%1pt; ").tqarg(tqlayout.indentLeft); } - if ((layout.indentRight>=0.0) - && (force || (layoutOrigin.indentRight!=layout.indentRight))) + if ((tqlayout.indentRight>=0.0) + && (force || (tqlayoutOrigin.indentRight!=tqlayout.indentRight))) { - props += QString("margin-right:%1pt; ").arg(layout.indentRight); + props += TQString("margin-right:%1pt; ").tqarg(tqlayout.indentRight); } - if (force || (layoutOrigin.indentLeft!=layout.indentLeft)) + if (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft)) { props += "text-indent: "; - props += QString::number(layout.indentFirst); + props += TQString::number(tqlayout.indentFirst); props += "pt; "; } - if ((layout.marginBottom>=0.0) - && ( force || ( layoutOrigin.marginBottom != layout.marginBottom ) ) ) + if ((tqlayout.marginBottom>=0.0) + && ( force || ( tqlayoutOrigin.marginBottom != tqlayout.marginBottom ) ) ) { - props += QString("margin-bottom:%1pt; ").arg(layout.marginBottom); + props += TQString("margin-bottom:%1pt; ").tqarg(tqlayout.marginBottom); } - if ((layout.marginTop>=0.0) - && ( force || ( layoutOrigin.marginTop != layout.marginTop ) ) ) + if ((tqlayout.marginTop>=0.0) + && ( force || ( tqlayoutOrigin.marginTop != tqlayout.marginTop ) ) ) { - props += QString("margin-top:%1pt; ").arg(layout.marginTop); + props += TQString("margin-top:%1pt; ").tqarg(tqlayout.marginTop); } if (force - || ( layoutOrigin.lineSpacingType != layout.lineSpacingType ) - || ( layoutOrigin.lineSpacing != layout.lineSpacing ) ) + || ( tqlayoutOrigin.lineSpacingType != tqlayout.lineSpacingType ) + || ( tqlayoutOrigin.lineSpacing != tqlayout.lineSpacing ) ) { - switch ( layout.lineSpacingType ) + switch ( tqlayout.lineSpacingType ) { case LayoutData::LS_CUSTOM: { // We have a custom line spacing (in points). However AbiWord cannot do it, so transform in "at-least" props += "line-height=:"; - props += QString::number( layout.lineSpacing ); // ### TODO: rounding? + props += TQString::number( tqlayout.lineSpacing ); // ### TODO: rounding? props += "pt+; "; break; } @@ -852,7 +852,7 @@ QString AbiWordWorker::layoutToCss(const LayoutData& layoutOrigin, case LayoutData::LS_MULTIPLE: { props += "line-height:"; - props += QString::number( layout.lineSpacing ); // ### TODO: rounding? + props += TQString::number( tqlayout.lineSpacing ); // ### TODO: rounding? props += "; "; break; } @@ -860,7 +860,7 @@ QString AbiWordWorker::layoutToCss(const LayoutData& layoutOrigin, { // We have a fixed line height (in points) props += "line-height:"; - props += QString::number( layout.lineSpacing ); // ### TODO: rounding? + props += TQString::number( tqlayout.lineSpacing ); // ### TODO: rounding? props += "pt; "; break; } @@ -868,32 +868,32 @@ QString AbiWordWorker::layoutToCss(const LayoutData& layoutOrigin, { // We have an "at-least" line height (in points) props += "line-height=:"; - props += QString::number( layout.lineSpacing ); // ### TODO: rounding? + props += TQString::number( tqlayout.lineSpacing ); // ### TODO: rounding? props += "pt+; "; // The + makes the difference break; } default: { - kdWarning(30506) << "Unsupported lineSpacingType: " << layout.lineSpacingType << " (Ignoring!)" << endl; + kdWarning(30506) << "Unsupported lineSpacingType: " << tqlayout.lineSpacingType << " (Ignoring!)" << endl; break; } } } // Add all AbiWord properties collected in the <FORMAT> element - props += textFormatToAbiProps(layoutOrigin.formatData.text,layout.formatData.text,force); + props += textFormatToAbiProps(tqlayoutOrigin.formatData.text,tqlayout.formatData.text,force); return props; } -bool AbiWordWorker::doFullParagraph(const QString& paraText, const LayoutData& layout, +bool AbiWordWorker::doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { - QString style=layout.styleName; + TQString style=tqlayout.styleName; const LayoutData& styleLayout=m_styleMap[style]; - QString props=layoutToCss(styleLayout,layout,false); + TQString props=tqlayoutToCss(styleLayout,tqlayout,false); *m_streamOut << "<p"; if (!style.isEmpty()) @@ -904,7 +904,7 @@ bool AbiWordWorker::doFullParagraph(const QString& paraText, const LayoutData& l { // Find the last semi-comma // Note: as in CSS2, semi-commas only separates instructions (like in PASCAL) and do not terminate them (like in C) - const int result=props.findRev(";"); + const int result=props.tqfindRev(";"); if (result>=0) { // Remove the last semi-comma and the space thereafter @@ -916,16 +916,16 @@ bool AbiWordWorker::doFullParagraph(const QString& paraText, const LayoutData& l *m_streamOut << ">"; //Warning: No trailing white space or else it's in the text!!! // Before processing the text, test if we have a page break - if (layout.pageBreakBefore) + if (tqlayout.pageBreakBefore) { // We have a page break before the paragraph *m_streamOut << "<pbr/>"; } - processParagraphData(paraText, layout.formatData.text, paraFormatDataList); + processParagraphData(paraText, tqlayout.formatData.text, paraFormatDataList); // Before closing the paragraph, test if we have a page break - if (layout.pageBreakAfter) + if (tqlayout.pageBreakAfter) { // We have a page break after the paragraph *m_streamOut << "<pbr/>"; @@ -935,28 +935,28 @@ bool AbiWordWorker::doFullParagraph(const QString& paraText, const LayoutData& l return true; } -bool AbiWordWorker::doFullDefineStyle(LayoutData& layout) +bool AbiWordWorker::doFullDefineStyle(LayoutData& tqlayout) { //Register style in the style map - m_styleMap[layout.styleName]=layout; + m_styleMap[tqlayout.styleName]=tqlayout; *m_streamOut << "<s"; // TODO: cook the style name to the standard style names in AbiWord - *m_streamOut << " name=\"" << EscapeXmlText(layout.styleName,true,true) << "\""; - *m_streamOut << " followedby=\"" << EscapeXmlText(layout.styleFollowing,true,true) << "\""; + *m_streamOut << " name=\"" << EscapeXmlText(tqlayout.styleName,true,true) << "\""; + *m_streamOut << " followedby=\"" << EscapeXmlText(tqlayout.styleFollowing,true,true) << "\""; - if ( (layout.counter.numbering == CounterData::NUM_CHAPTER) - && (layout.counter.depth<10) ) + if ( (tqlayout.counter.numbering == CounterData::NUM_CHAPTER) + && (tqlayout.counter.depth<10) ) { *m_streamOut << " level=\""; - *m_streamOut << QString::number(layout.counter.depth+1,10); + *m_streamOut << TQString::number(tqlayout.counter.depth+1,10); *m_streamOut << "\""; } - QString abiprops=layoutToCss(layout,layout,true); + TQString abiprops=tqlayoutToCss(tqlayout,tqlayout,true); - const int result=abiprops.findRev(";"); + const int result=abiprops.tqfindRev(";"); if (result>=0) { // Remove the last semi-comma and the space thereafter @@ -973,7 +973,7 @@ bool AbiWordWorker::doFullDefineStyle(LayoutData& layout) bool AbiWordWorker::doFullPaperFormat(const int format, const double width, const double height, const int orientation) { - QString outputText = "<pagesize "; + TQString outputText = "<pagesize "; switch (format) { @@ -997,11 +997,11 @@ bool AbiWordWorker::doFullPaperFormat(const int format, case PG_US_LETTER: // US Letter case PG_US_LEGAL: // US Legal { - QString pagetype=KoPageFormat::formatString(KoFormat(format)); + TQString pagetype=KoPageFormat::formatString(KoFormat(format)); outputText+="pagetype=\""; outputText+=pagetype; - QString strWidth, strHeight, strUnits; + TQString strWidth, strHeight, strUnits; KWEFUtil::GetNativePaperFormat(format, strWidth, strHeight, strUnits); outputText+="\" width=\""; outputText+=strWidth; @@ -1041,7 +1041,7 @@ bool AbiWordWorker::doFullPaperFormat(const int format, } else { // We prefer to use inches, as to limit rounding errors (page size is in points!) - outputText += QString("pagetype=\"Custom\" width=\"%1\" height=\"%2\" units=\"inch\" ").arg(width/72.0).arg(height/72.0); + outputText += TQString("pagetype=\"Custom\" width=\"%1\" height=\"%2\" units=\"inch\" ").tqarg(width/72.0).tqarg(height/72.0); } break; } @@ -1098,7 +1098,7 @@ bool AbiWordWorker::doCloseSpellCheckIgnoreList (void) return true; } -bool AbiWordWorker::doFullSpellCheckIgnoreWord (const QString& ignoreword) +bool AbiWordWorker::doFullSpellCheckIgnoreWord (const TQString& ignoreword) { kdDebug(30506) << "AbiWordWorker::doFullSpellCheckIgnoreWord: " << ignoreword << endl; if (!m_inIgnoreWords) @@ -1110,14 +1110,14 @@ bool AbiWordWorker::doFullSpellCheckIgnoreWord (const QString& ignoreword) return true; } -// Similar to QDateTime::toString, but guaranteed *not* to be translated -QString AbiWordWorker::transformToTextDate(const QDateTime& dt) +// Similar to TQDateTime::toString, but guaranteed *not* to be translated +TQString AbiWordWorker::transformToTextDate(const TQDateTime& dt) { if (dt.isValid()) { - QString result; + TQString result; - const QDate date(dt.date()); + const TQDate date(dt.date()); const char* dayName[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; const int dow = date.dayOfWeek() - 1; @@ -1135,32 +1135,32 @@ QString AbiWordWorker::transformToTextDate(const QDateTime& dt) result += monthName[month]; result += ' '; - QString temp; + TQString temp; temp = "00"; - temp += QString::number(date.day(), 10); + temp += TQString::number(date.day(), 10); result += temp.right(2); result += ' '; - const QTime time(dt.time()); + const TQTime time(dt.time()); temp = "00"; - temp += QString::number(time.hour(), 10); + temp += TQString::number(time.hour(), 10); result += temp.right(2); result += ':'; temp = "00"; - temp += QString::number(time.minute(), 10); + temp += TQString::number(time.minute(), 10); result += temp.right(2); result += ':'; temp = "00"; - temp += QString::number(time.second(), 10); + temp += TQString::number(time.second(), 10); result += temp.right(2); result += ' '; temp = "0000"; - temp += QString::number(date.year(), 10); + temp += TQString::number(date.year(), 10); result += temp.right(4); return result; @@ -1201,14 +1201,14 @@ bool AbiWordWorker::doFullDocumentInfo(const KWEFDocumentInfo& docInfo) // Say who we are (with the CVS revision number) in case we have a bug in our filter output! *m_streamOut << "<m key=\"abiword.generator\">KWord Export Filter"; - QString strVersion("$Revision: 508787 $"); + TQString strVersion("$Revision: 508787 $"); // Remove the dollar signs // (We don't want that the version number changes if the AbiWord file is itself put in a CVS storage.) *m_streamOut << strVersion.mid(10).remove('$'); *m_streamOut << "</m>\n"; - QDateTime now (QDateTime::currentDateTime(Qt::UTC)); // current time in UTC + TQDateTime now (TQDateTime::tqcurrentDateTime(Qt::UTC)); // current time in UTC *m_streamOut << "<m key=\"abiword.date_last_changed\">" << escapeAbiWordText(transformToTextDate(now)) << "</m>\n"; @@ -1221,11 +1221,11 @@ bool AbiWordWorker::doFullDocumentInfo(const KWEFDocumentInfo& docInfo) // ========================================================================================== -ABIWORDExport::ABIWORDExport(KoFilter */*parent*/, const char */*name*/, const QStringList &) : +ABIWORDExport::ABIWORDExport(KoFilter */*tqparent*/, const char */*name*/, const TQStringList &) : KoFilter() { } -KoFilter::ConversionStatus ABIWORDExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus ABIWORDExport::convert( const TQCString& from, const TQCString& to ) { if ( to != "application/x-abiword" || from != "application/x-kword" ) { @@ -1252,7 +1252,7 @@ KoFilter::ConversionStatus ABIWORDExport::convert( const QCString& from, const Q return KoFilter::StupidError; } - KoFilter::ConversionStatus result=leader->convert(m_chain,from,to); + KoFilter::ConversiontqStatus result=leader->convert(m_chain,from,to); delete leader; delete worker; diff --git a/filters/kword/abiword/abiwordexport.h b/filters/kword/abiword/abiwordexport.h index a373f5e4..85203f8b 100644 --- a/filters/kword/abiword/abiwordexport.h +++ b/filters/kword/abiword/abiwordexport.h @@ -32,8 +32,8 @@ #ifndef ABIWORDEXPORT_H #define ABIWORDEXPORT_H -#include <qstring.h> -#include <qcstring.h> +#include <tqstring.h> +#include <tqcstring.h> #include <KoFilter.h> @@ -41,11 +41,12 @@ class ABIWORDExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - ABIWORDExport(KoFilter *parent, const char *name, const QStringList &); + ABIWORDExport(KoFilter *tqparent, const char *name, const TQStringList &); virtual ~ABIWORDExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // ABIWORDEXPORT_H diff --git a/filters/kword/abiword/abiwordimport.cc b/filters/kword/abiword/abiwordimport.cc index b872e875..9533d5df 100644 --- a/filters/kword/abiword/abiwordimport.cc +++ b/filters/kword/abiword/abiwordimport.cc @@ -23,12 +23,12 @@ #include <unistd.h> #endif -#include <qmap.h> -#include <qbuffer.h> -#include <qpicture.h> -#include <qxml.h> -#include <qdom.h> -#include <qdatetime.h> +#include <tqmap.h> +#include <tqbuffer.h> +#include <tqpicture.h> +#include <tqxml.h> +#include <tqdom.h> +#include <tqdatetime.h> #include <kdebug.h> #include <kmdcodec.h> @@ -67,12 +67,12 @@ K_EXPORT_COMPONENT_FACTORY( libabiwordimport, ABIWORDImportFactory() ) // enum StackItemElementType is now in the file ImportFormatting.h -class StructureParser : public QXmlDefaultHandler +class StructureParser : public TQXmlDefaultHandler { public: StructureParser(KoFilterChain* chain) : m_chain(chain), m_pictureNumber(0), m_pictureFrameNumber(0), m_tableGroupNumber(0), - m_timepoint(QDateTime::currentDateTime(Qt::UTC)), m_fatalerror(false) + m_timepoint(TQDateTime::tqcurrentDateTime(Qt::UTC)), m_fatalerror(false) { createDocument(); structureStack.setAutoDelete(true); @@ -89,15 +89,15 @@ public: public: virtual bool startDocument(void); virtual bool endDocument(void); - virtual bool startElement( const QString&, const QString&, const QString& name, const QXmlAttributes& attributes); - virtual bool endElement( const QString&, const QString& , const QString& qName); - virtual bool characters ( const QString & ch ); - virtual bool warning(const QXmlParseException& exception); - virtual bool error(const QXmlParseException& exception); - virtual bool fatalError(const QXmlParseException& exception); + virtual bool startElement( const TQString&, const TQString&, const TQString& name, const TQXmlAttributes& attributes); + virtual bool endElement( const TQString&, const TQString& , const TQString& qName); + virtual bool characters ( const TQString & ch ); + virtual bool warning(const TQXmlParseException& exception); + virtual bool error(const TQXmlParseException& exception); + virtual bool fatalError(const TQXmlParseException& exception); public: - inline QDomDocument getDocInfo(void) const { return m_info; } - inline QDomDocument getDocument(void) const { return mainDocument; } + inline TQDomDocument getDocInfo(void) const { return m_info; } + inline TQDomDocument getDocument(void) const { return mainDocument; } inline bool wasFatalError(void) const { return m_fatalerror; } protected: bool clearStackUntilParagraph(StackItemStack& auxilaryStack); @@ -105,45 +105,45 @@ protected: private: // The methods that would need too much parameters are private instead of being static outside the class bool StartElementC(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes); + const TQXmlAttributes& attributes); bool StartElementA(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes); + const TQXmlAttributes& attributes); bool StartElementImage(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes); + const TQXmlAttributes& attributes); bool EndElementD (StackItem* stackItem); bool EndElementM (StackItem* stackItem); bool StartElementSection(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes); + const TQXmlAttributes& attributes); bool StartElementFoot(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes); - bool StartElementTable(StackItem* stackItem, StackItem* stackCurrent, const QXmlAttributes& attributes); - bool StartElementCell(StackItem* stackItem, StackItem* stackCurrent,const QXmlAttributes& attributes); + const TQXmlAttributes& attributes); + bool StartElementTable(StackItem* stackItem, StackItem* stackCurrent, const TQXmlAttributes& attributes); + bool StartElementCell(StackItem* stackItem, StackItem* stackCurrent,const TQXmlAttributes& attributes); private: void createDocument(void); void createDocInfo(void); - QString indent; //DEBUG + TQString indent; //DEBUG StackItemStack structureStack; - QDomDocument mainDocument; - QDomDocument m_info; - QDomElement framesetsPluralElement; // <FRAMESETS> - QDomElement mainFramesetElement; // The main <FRAMESET> where the body text will be under. - QDomElement m_picturesElement; // <PICTURES> - QDomElement m_paperElement; // <PAPER> - QDomElement m_paperBordersElement; // <PAPERBORDER> - QDomElement m_ignoreWordsElement; // <SPELLCHECKIGNORELIST> + TQDomDocument mainDocument; + TQDomDocument m_info; + TQDomElement framesetsPluralElement; // <FRAMESETS> + TQDomElement mainFramesetElement; // The main <FRAMESET> where the body text will be under. + TQDomElement m_picturesElement; // <PICTURES> + TQDomElement m_paperElement; // <PAPER> + TQDomElement m_paperBordersElement; // <PAPERBORDER> + TQDomElement m_ignoreWordsElement; // <SPELLCHECKIGNORELIST> StyleDataMap styleDataMap; KoFilterChain* m_chain; uint m_pictureNumber; // unique: increment *before* use uint m_pictureFrameNumber; // unique: increment *before* use uint m_tableGroupNumber; // unique: increment *before* use - QMap<QString,QString> m_metadataMap; // Map for <m> elements - QDateTime m_timepoint; // Date/time (for pictures) + TQMap<TQString,TQString> m_metadataMap; // Map for <m> elements + TQDateTime m_timepoint; // Date/time (for pictures) bool m_fatalerror; // Did a XML parsing fatal error happened? }; // Element <c> -bool StructureParser::StartElementC(StackItem* stackItem, StackItem* stackCurrent, const QXmlAttributes& attributes) +bool StructureParser::StartElementC(StackItem* stackItem, StackItem* stackCurrent, const TQXmlAttributes& attributes) { // <c> elements can be nested in <p> elements, in <a> elements or in other <c> elements // AbiWord does not nest <c> elements in other <c> elements, but explicitly allows external programs to do it! @@ -153,11 +153,11 @@ bool StructureParser::StartElementC(StackItem* stackItem, StackItem* stackCurren { // Contents can have styles, however KWord cannot have character style. // Therefore we use the style if it exist, but we do not create it if not. - QString strStyleProps; - QString strStyleName=attributes.value("style").stripWhiteSpace(); + TQString strStyleProps; + TQString strStyleName=attributes.value("style").stripWhiteSpace(); if (!strStyleName.isEmpty()) { - StyleDataMap::Iterator it=styleDataMap.find(strStyleName); + StyleDataMap::Iterator it=styleDataMap.tqfind(strStyleName); if (it!=styleDataMap.end()) { strStyleProps=it.data().m_props; @@ -187,15 +187,15 @@ bool StructureParser::StartElementC(StackItem* stackItem, StackItem* stackCurren return true; } -bool charactersElementC (StackItem* stackItem, QDomDocument& mainDocument, const QString & ch) +bool charactersElementC (StackItem* stackItem, TQDomDocument& mainDocument, const TQString & ch) { if (stackItem->elementType==ElementTypeContent) { // Normal <c> - QDomElement elementText=stackItem->stackElementText; - QDomElement elementFormatsPlural=stackItem->stackElementFormatsPlural; + TQDomElement elementText=stackItem->stackElementText; + TQDomElement elementFormatsPlural=stackItem->stackElementFormatsPlural; elementText.appendChild(mainDocument.createTextNode(ch)); - QDomElement formatElementOut=mainDocument.createElement("FORMAT"); + TQDomElement formatElementOut=mainDocument.createElement("FORMAT"); formatElementOut.setAttribute("id",1); // Normal text! formatElementOut.setAttribute("pos",stackItem->pos); // Start position formatElementOut.setAttribute("len",ch.length()); // Start position @@ -223,11 +223,11 @@ bool EndElementC (StackItem* stackItem, StackItem* stackCurrent) if (stackItem->elementType==ElementTypeContent) { stackItem->stackElementText.normalize(); - stackCurrent->pos=stackItem->pos; //Propagate the position back to the parent element + stackCurrent->pos=stackItem->pos; //Propagate the position back to the tqparent element } else if (stackItem->elementType==ElementTypeAnchorContent) { - stackCurrent->strTemp2+=stackItem->strTemp2; //Propagate the link name back to the parent element + stackCurrent->strTemp2+=stackItem->strTemp2; //Propagate the link name back to the tqparent element } else { @@ -238,14 +238,14 @@ bool EndElementC (StackItem* stackItem, StackItem* stackCurrent) } // Element <a> -bool StructureParser::StartElementA(StackItem* stackItem, StackItem* stackCurrent, const QXmlAttributes& attributes) +bool StructureParser::StartElementA(StackItem* stackItem, StackItem* stackCurrent, const TQXmlAttributes& attributes) { // <a> elements can be nested in <p> elements if (stackCurrent->elementType==ElementTypeParagraph) { //AbiPropsMap abiPropsMap; - //PopulateProperties(stackItem,QString::null,attributes,abiPropsMap,true); + //PopulateProperties(stackItem,TQString(),attributes,abiPropsMap,true); stackItem->elementType=ElementTypeAnchor; stackItem->stackElementParagraph=stackCurrent->stackElementParagraph; // <PARAGRAPH> @@ -253,7 +253,7 @@ bool StructureParser::StartElementA(StackItem* stackItem, StackItem* stackCurren stackItem->stackElementFormatsPlural=stackCurrent->stackElementFormatsPlural; // <FORMATS> stackItem->pos=stackCurrent->pos; //Propagate the position stackItem->strTemp1=attributes.value("xlink:href").stripWhiteSpace(); // link reference - stackItem->strTemp2=QString::null; // link name + stackItem->strTemp2=TQString(); // link name // We must be careful: AbiWord permits anchors to bookmarks. // However, KWord does not know what a bookmark is. @@ -274,14 +274,14 @@ bool StructureParser::StartElementA(StackItem* stackItem, StackItem* stackCurren return true; } -static bool charactersElementA (StackItem* stackItem, const QString & ch) +static bool charactersElementA (StackItem* stackItem, const TQString & ch) { // Add characters to the link name stackItem->strTemp2+=ch; return true; } -static bool EndElementA (StackItem* stackItem, StackItem* stackCurrent, QDomDocument& mainDocument) +static bool EndElementA (StackItem* stackItem, StackItem* stackCurrent, TQDomDocument& mainDocument) { if (!stackItem->elementType==ElementTypeAnchor) { @@ -289,31 +289,31 @@ static bool EndElementA (StackItem* stackItem, StackItem* stackCurrent, QDomDocu return false; } - QDomElement elementText=stackItem->stackElementText; + TQDomElement elementText=stackItem->stackElementText; elementText.appendChild(mainDocument.createTextNode("#")); - QDomElement formatElement=mainDocument.createElement("FORMAT"); + TQDomElement formatElement=mainDocument.createElement("FORMAT"); formatElement.setAttribute("id",4); // Variable formatElement.setAttribute("pos",stackItem->pos); // Start position formatElement.setAttribute("len",1); // Start position - QDomElement variableElement=mainDocument.createElement("VARIABLE"); + TQDomElement variableElement=mainDocument.createElement("VARIABLE"); formatElement.appendChild(variableElement); - QDomElement typeElement=mainDocument.createElement("TYPE"); + TQDomElement typeElement=mainDocument.createElement("TYPE"); typeElement.setAttribute("key","STRING"); typeElement.setAttribute("type",9); // link typeElement.setAttribute("text",stackItem->strTemp2); variableElement.appendChild(typeElement); //Append to <VARIABLE> - QDomElement linkElement=mainDocument.createElement("LINK"); + TQDomElement linkElement=mainDocument.createElement("LINK"); linkElement.setAttribute("hrefName",stackItem->strTemp1); linkElement.setAttribute("linkName",stackItem->strTemp2); variableElement.appendChild(linkElement); //Append to <VARIABLE> // Now work on stackCurrent stackCurrent->stackElementFormatsPlural.appendChild(formatElement); - stackCurrent->pos++; //Propagate the position back to the parent element + stackCurrent->pos++; //Propagate the position back to the tqparent element return true; } @@ -321,18 +321,18 @@ static bool EndElementA (StackItem* stackItem, StackItem* stackCurrent, QDomDocu // Element <p> bool StartElementP(StackItem* stackItem, StackItem* stackCurrent, - QDomDocument& mainDocument, - StyleDataMap& styleDataMap, const QXmlAttributes& attributes) + TQDomDocument& mainDocument, + StyleDataMap& styleDataMap, const TQXmlAttributes& attributes) { // We must prepare the style - QString strStyle=attributes.value("style"); + TQString strStyle=attributes.value("style"); if (strStyle.isEmpty()) { strStyle="Normal"; } StyleDataMap::ConstIterator it=styleDataMap.useOrCreateStyle(strStyle); - QString strLevel=attributes.value("level"); + TQString strLevel=attributes.value("level"); int level; if (strLevel.isEmpty()) { @@ -345,13 +345,13 @@ bool StartElementP(StackItem* stackItem, StackItem* stackCurrent, level=strStyle.toInt(); } - QDomElement elementText=stackCurrent->stackElementText; - QDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); + TQDomElement elementText=stackCurrent->stackElementText; + TQDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); stackCurrent->m_frameset.appendChild(paragraphElementOut); - QDomElement textElementOut=mainDocument.createElement("TEXT"); + TQDomElement textElementOut=mainDocument.createElement("TEXT"); paragraphElementOut.appendChild(textElementOut); - QDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); + TQDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); paragraphElementOut.appendChild(formatsPluralElementOut); AbiPropsMap abiPropsMap; @@ -363,18 +363,18 @@ bool StartElementP(StackItem* stackItem, StackItem* stackCurrent, stackItem->stackElementFormatsPlural=formatsPluralElementOut; // <FORMATS> stackItem->pos=0; // No text characters yet - // Now we populate the layout - QDomElement layoutElement=mainDocument.createElement("LAYOUT"); - paragraphElementOut.appendChild(layoutElement); + // Now we populate the tqlayout + TQDomElement tqlayoutElement=mainDocument.createElement("LAYOUT"); + paragraphElementOut.appendChild(tqlayoutElement); - AddLayout(strStyle,layoutElement, stackItem, mainDocument, abiPropsMap, level, false); + AddLayout(strStyle,tqlayoutElement, stackItem, mainDocument, abiPropsMap, level, false); return true; } -bool charactersElementP (StackItem* stackItem, QDomDocument& mainDocument, const QString & ch) +bool charactersElementP (StackItem* stackItem, TQDomDocument& mainDocument, const TQString & ch) { - QDomElement elementText=stackItem->stackElementText; + TQDomElement elementText=stackItem->stackElementText; elementText.appendChild(mainDocument.createTextNode(ch)); @@ -395,28 +395,28 @@ bool EndElementP (StackItem* stackItem) } static bool StartElementField(StackItem* stackItem, StackItem* stackCurrent, - QDomDocument& mainDocument, const QXmlAttributes& attributes) + TQDomDocument& mainDocument, const TQXmlAttributes& attributes) { // <field> element elements can be nested in <p> if (stackCurrent->elementType==ElementTypeParagraph) { - QString strType=attributes.value("type").stripWhiteSpace(); + TQString strType=attributes.value("type").stripWhiteSpace(); kdDebug(30506)<<"<field> type:"<<strType<<endl; AbiPropsMap abiPropsMap; - PopulateProperties(stackItem,QString::null,attributes,abiPropsMap,true); + PopulateProperties(stackItem,TQString(),attributes,abiPropsMap,true); stackItem->elementType=ElementTypeEmpty; // We create a format element - QDomElement variableElement=mainDocument.createElement("VARIABLE"); + TQDomElement variableElement=mainDocument.createElement("VARIABLE"); if (!ProcessField(mainDocument, variableElement, strType, attributes)) { // The field type was not recognised, // therefore write the field type in red as normal text kdWarning(30506) << "Unknown <field> type: " << strType << endl; - QDomElement formatElement=mainDocument.createElement("FORMAT"); + TQDomElement formatElement=mainDocument.createElement("FORMAT"); formatElement.setAttribute("id",1); // Variable formatElement.setAttribute("pos",stackItem->pos); // Start position formatElement.setAttribute("len",strType.length()); @@ -435,7 +435,7 @@ static bool StartElementField(StackItem* stackItem, StackItem* stackCurrent, } // We create a format element - QDomElement formatElement=mainDocument.createElement("FORMAT"); + TQDomElement formatElement=mainDocument.createElement("FORMAT"); formatElement.setAttribute("id",4); // Variable formatElement.setAttribute("pos",stackItem->pos); // Start position formatElement.setAttribute("len",1); @@ -462,13 +462,13 @@ static bool StartElementField(StackItem* stackItem, StackItem* stackCurrent, // <s> (style) static bool StartElementS(StackItem* stackItem, StackItem* /*stackCurrent*/, - const QXmlAttributes& attributes, StyleDataMap& styleDataMap) + const TQXmlAttributes& attributes, StyleDataMap& styleDataMap) { // We do not assume when we are called. // We also do not care if a style is defined multiple times. stackItem->elementType=ElementTypeEmpty; - QString strStyleName=attributes.value("name").stripWhiteSpace(); + TQString strStyleName=attributes.value("name").stripWhiteSpace(); if (strStyleName.isEmpty()) { @@ -476,13 +476,13 @@ static bool StartElementS(StackItem* stackItem, StackItem* /*stackCurrent*/, } else { - QString strLevel=attributes.value("level"); + TQString strLevel=attributes.value("level"); int level; if (strLevel.isEmpty()) level=-1; //TODO/FIXME: might be wrong if the style is based on another else level=strLevel.toInt(); - QString strBasedOn=attributes.value("basedon").simplifyWhiteSpace(); + TQString strBasedOn=attributes.value("basedon").simplifyWhiteSpace(); styleDataMap.defineNewStyleFromOld(strStyleName,strBasedOn,level,attributes.value("props")); kdDebug(30506) << " Style name: " << strStyleName << endl << " Based on: " << strBasedOn << endl @@ -495,7 +495,7 @@ static bool StartElementS(StackItem* stackItem, StackItem* /*stackCurrent*/, // <image> bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes) + const TQXmlAttributes& attributes) { // <image> elements can be nested in <p> or <c> elements if ((stackCurrent->elementType!=ElementTypeParagraph) && (stackCurrent->elementType!=ElementTypeContent)) @@ -506,7 +506,7 @@ bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCu } stackItem->elementType=ElementTypeEmpty; - QString strDataId=attributes.value("dataid").stripWhiteSpace(); + TQString strDataId=attributes.value("dataid").stripWhiteSpace(); AbiPropsMap abiPropsMap; abiPropsMap.splitAndAddAbiProps(attributes.value("props")); @@ -527,18 +527,18 @@ bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCu kdDebug(30506) << "Image: " << strDataId << endl; } - QString strPictureFrameName(i18n("Frameset name","Picture %1").arg(++m_pictureFrameNumber)); + TQString strPictureFrameName(i18n("Frameset name","Picture %1").tqarg(++m_pictureFrameNumber)); // Create the frame set of the image - QDomElement framesetElement=mainDocument.createElement("FRAMESET"); + TQDomElement framesetElement=mainDocument.createElement("FRAMESET"); framesetElement.setAttribute("frameType",2); framesetElement.setAttribute("frameInfo",0); framesetElement.setAttribute("visible",1); framesetElement.setAttribute("name",strPictureFrameName); framesetsPluralElement.appendChild(framesetElement); - QDomElement frameElementOut=mainDocument.createElement("FRAME"); + TQDomElement frameElementOut=mainDocument.createElement("FRAME"); frameElementOut.setAttribute("left",0); frameElementOut.setAttribute("top",0); frameElementOut.setAttribute("bottom",height); @@ -547,12 +547,12 @@ bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCu // TODO: a few attributes are missing framesetElement.appendChild(frameElementOut); - QDomElement element=mainDocument.createElement("PICTURE"); + TQDomElement element=mainDocument.createElement("PICTURE"); element.setAttribute("keepAspectRatio","true"); framesetElement.setAttribute("frameType",2); // Picture framesetElement.appendChild(element); - QDomElement key=mainDocument.createElement("KEY"); + TQDomElement key=mainDocument.createElement("KEY"); key.setAttribute("filename",strDataId); key.setAttribute("year",m_timepoint.date().year()); key.setAttribute("month",m_timepoint.date().month()); @@ -564,11 +564,11 @@ bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCu element.appendChild(key); // Now use the image's frame set - QDomElement elementText=stackItem->stackElementText; - QDomElement elementFormatsPlural=stackItem->stackElementFormatsPlural; + TQDomElement elementText=stackItem->stackElementText; + TQDomElement elementFormatsPlural=stackItem->stackElementFormatsPlural; elementText.appendChild(mainDocument.createTextNode("#")); - QDomElement formatElementOut=mainDocument.createElement("FORMAT"); + TQDomElement formatElementOut=mainDocument.createElement("FORMAT"); formatElementOut.setAttribute("id",6); // Normal text! formatElementOut.setAttribute("pos",stackItem->pos); // Start position formatElementOut.setAttribute("len",1); // Start position @@ -577,7 +577,7 @@ bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCu // WARNING: we must change the position in stackCurrent! stackCurrent->pos++; // Adapt new starting position - QDomElement anchor=mainDocument.createElement("ANCHOR"); + TQDomElement anchor=mainDocument.createElement("ANCHOR"); // No name attribute! anchor.setAttribute("type","frameset"); anchor.setAttribute("instance",strPictureFrameName); @@ -588,17 +588,17 @@ bool StructureParser::StartElementImage(StackItem* stackItem, StackItem* stackCu // <d> static bool StartElementD(StackItem* stackItem, StackItem* /*stackCurrent*/, - const QXmlAttributes& attributes) + const TQXmlAttributes& attributes) { // We do not assume when we are called or if we are or not a child of <data> // However, we assume that we are after all <image> elements stackItem->elementType=ElementTypeRealData; - QString strName=attributes.value("name").stripWhiteSpace(); + TQString strName=attributes.value("name").stripWhiteSpace(); kdDebug(30506) << "Data: " << strName << endl; - QString strBase64=attributes.value("base64").stripWhiteSpace(); - QString strMime=attributes.value("mime").stripWhiteSpace(); + TQString strBase64=attributes.value("base64").stripWhiteSpace(); + TQString strMime=attributes.value("mime").stripWhiteSpace(); if (strName.isEmpty()) { @@ -617,12 +617,12 @@ static bool StartElementD(StackItem* stackItem, StackItem* /*stackCurrent*/, stackItem->fontName=strName; // Store the data name as font name. stackItem->bold=(strBase64=="yes"); // Store base64-coded as bold stackItem->strTemp1=strMime; // Mime type - stackItem->strTemp2=QString::null; // Image data + stackItem->strTemp2=TQString(); // Image data return true; } -static bool CharactersElementD (StackItem* stackItem, QDomDocument& /*mainDocument*/, const QString & ch) +static bool CharactersElementD (StackItem* stackItem, TQDomDocument& /*mainDocument*/, const TQString & ch) { // As we have no guarantee to have the whole stream in one call, we must store the data. stackItem->strTemp2+=ch; @@ -644,7 +644,7 @@ bool StructureParser::EndElementD (StackItem* stackItem) bool isSvg=false; // SVG ? - QString extension; + TQString extension; // stackItem->strTemp1 contains the mime type if (stackItem->strTemp1=="image/png") @@ -667,13 +667,13 @@ bool StructureParser::EndElementD (StackItem* stackItem) return true; } - QString strStoreName; + TQString strStoreName; strStoreName="pictures/picture"; - strStoreName+=QString::number(++m_pictureNumber); + strStoreName+=TQString::number(++m_pictureNumber); strStoreName+=extension; - QString strDataId=stackItem->fontName; // AbiWord's data id - QDomElement key=mainDocument.createElement("KEY"); + TQString strDataId=stackItem->fontName; // AbiWord's data id + TQDomElement key=mainDocument.createElement("KEY"); key.setAttribute("filename",strDataId); key.setAttribute("year",m_timepoint.date().year()); key.setAttribute("month",m_timepoint.date().month()); @@ -696,9 +696,9 @@ bool StructureParser::EndElementD (StackItem* stackItem) { kdDebug(30506) << "Decode and write base64 stream: " << stackItem->fontName << endl; // We need to decode the base64 stream - // However KCodecs has no QString to QByteArray decoder! - QByteArray base64Stream=stackItem->strTemp2.utf8(); // Use utf8 to avoid corruption of data - QByteArray binaryStream; + // However KCodecs has no TQString to TQByteArray decoder! + TQByteArray base64Stream=stackItem->strTemp2.utf8(); // Use utf8 to avoid corruption of data + TQByteArray binaryStream; KCodecs::base64Decode(base64Stream, binaryStream); out->writeBlock(binaryStream, binaryStream.count()); } @@ -707,7 +707,7 @@ bool StructureParser::EndElementD (StackItem* stackItem) // Unknown text format! kdDebug(30506) << "Write character stream: " << stackItem->fontName << endl; // We strip the white space in front to avoid white space before a XML declaration - QCString strOut=stackItem->strTemp2.stripWhiteSpace().utf8(); + TQCString strOut=stackItem->strTemp2.stripWhiteSpace().utf8(); out->writeBlock(strOut,strOut.length()); } @@ -716,12 +716,12 @@ bool StructureParser::EndElementD (StackItem* stackItem) // <m> static bool StartElementM(StackItem* stackItem, StackItem* /*stackCurrent*/, - const QXmlAttributes& attributes) + const TQXmlAttributes& attributes) { // We do not assume when we are called or if we are or not a child of <metadata> stackItem->elementType=ElementTypeRealMetaData; - QString strKey=attributes.value("key").stripWhiteSpace(); + TQString strKey=attributes.value("key").stripWhiteSpace(); kdDebug(30506) << "Metadata key: " << strKey << endl; if (strKey.isEmpty()) @@ -732,12 +732,12 @@ static bool StartElementM(StackItem* stackItem, StackItem* /*stackCurrent*/, } stackItem->strTemp1=strKey; // Key - stackItem->strTemp2=QString::null; // Meta data + stackItem->strTemp2=TQString(); // Meta data return true; } -static bool CharactersElementM (StackItem* stackItem, const QString & ch) +static bool CharactersElementM (StackItem* stackItem, const TQString & ch) { // As we have no guarantee to have the whole data in one call, we must store the data. stackItem->strTemp2+=ch; @@ -767,7 +767,7 @@ bool StructureParser::EndElementM (StackItem* stackItem) // <br> (forced line break) static bool StartElementBR(StackItem* stackItem, StackItem* stackCurrent, - QDomDocument& mainDocument) + TQDomDocument& mainDocument) { // <br> elements are mostly in <c> but can also be in <p> if ((stackCurrent->elementType==ElementTypeParagraph) @@ -780,15 +780,15 @@ static bool StartElementBR(StackItem* stackItem, StackItem* stackCurrent, if (stackCurrent->elementType==ElementTypeContent) { // Child <c>, so we have to add formating of <c> - QDomElement formatElement=mainDocument.createElement("FORMAT"); + TQDomElement formatElement=mainDocument.createElement("FORMAT"); formatElement.setAttribute("id",1); // Normal text! formatElement.setAttribute("pos",stackCurrent->pos); // Start position formatElement.setAttribute("len",1); - AddFormat(formatElement, stackCurrent, mainDocument); // Add the format of the parent <c> + AddFormat(formatElement, stackCurrent, mainDocument); // Add the format of the tqparent <c> stackCurrent->stackElementFormatsPlural.appendChild(formatElement); //Append to <FORMATS> } - stackCurrent->stackElementText.appendChild(mainDocument.createTextNode(QChar(10))); // Add a LINE FEED + stackCurrent->stackElementText.appendChild(mainDocument.createTextNode(TQChar(10))); // Add a LINE FEED stackCurrent->pos++; // Adjust position } @@ -804,31 +804,31 @@ static bool StartElementBR(StackItem* stackItem, StackItem* stackCurrent, // <cbr> (forced column break, not supported) // <pbr> (forced page break) static bool StartElementPBR(StackItem* /*stackItem*/, StackItem* stackCurrent, - QDomDocument& mainDocument) + TQDomDocument& mainDocument) { // We are sure to be the child of a <p> element // The following code is similar to the one in StartElementP // We use mainFramesetElement here not to be dependant that <section> has happened before - QDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); + TQDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); stackCurrent->m_frameset.appendChild(paragraphElementOut); - QDomElement textElementOut=mainDocument.createElement("TEXT"); + TQDomElement textElementOut=mainDocument.createElement("TEXT"); paragraphElementOut.appendChild(textElementOut); - QDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); + TQDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); paragraphElementOut.appendChild(formatsPluralElementOut); - // We must now copy/clone the layout of elementText. + // We must now copy/clone the tqlayout of elementText. - QDomNodeList nodeList=stackCurrent->stackElementParagraph.elementsByTagName("LAYOUT"); + TQDomNodeList nodeList=stackCurrent->stackElementParagraph.elementsByTagName("LAYOUT"); if (!nodeList.count()) { - kdError(30506) << "Unable to find <LAYOUT> element! Aborting! (in StartElementPBR)" <<endl; + kdError(30506) << "Unable to tqfind <LAYOUT> element! Aborting! (in StartElementPBR)" <<endl; return false; } // Now clone it - QDomNode newNode=nodeList.item(0).cloneNode(true); // We make a deep cloning of the first element/node + TQDomNode newNode=nodeList.item(0).cloneNode(true); // We make a deep cloning of the first element/node if (newNode.isNull()) { kdError(30506) << "Unable to clone <LAYOUT> element! Aborting! (in StartElementPBR)" <<endl; @@ -837,7 +837,7 @@ static bool StartElementPBR(StackItem* /*stackItem*/, StackItem* stackCurrent, paragraphElementOut.appendChild(newNode); // We need a page break! - QDomElement oldLayoutElement=nodeList.item(0).toElement(); + TQDomElement oldLayoutElement=nodeList.item(0).toElement(); if (oldLayoutElement.isNull()) { kdError(30506) << "Cannot find old <LAYOUT> element! Aborting! (in StartElementPBR)" <<endl; @@ -845,7 +845,7 @@ static bool StartElementPBR(StackItem* /*stackItem*/, StackItem* stackCurrent, } // We have now to add a element <PAGEBREAKING> // TODO/FIXME: what if there is already one? - QDomElement pagebreakingElement=mainDocument.createElement("PAGEBREAKING"); + TQDomElement pagebreakingElement=mainDocument.createElement("PAGEBREAKING"); pagebreakingElement.setAttribute("linesTogether","false"); pagebreakingElement.setAttribute("hardFrameBreak","false"); pagebreakingElement.setAttribute("hardFrameBreakAfter","true"); @@ -864,7 +864,7 @@ static bool StartElementPBR(StackItem* /*stackItem*/, StackItem* stackCurrent, } // <pagesize> -static bool StartElementPageSize(QDomElement& paperElement, const QXmlAttributes& attributes) +static bool StartElementPageSize(TQDomElement& paperElement, const TQXmlAttributes& attributes) { if (attributes.value("page-scale").toDouble()!=1.0) { @@ -872,7 +872,7 @@ static bool StartElementPageSize(QDomElement& paperElement, const QXmlAttributes } int kwordOrientation; - QString strOrientation=attributes.value("orientation").stripWhiteSpace(); + TQString strOrientation=attributes.value("orientation").stripWhiteSpace(); if (strOrientation=="portrait") { @@ -891,7 +891,7 @@ static bool StartElementPageSize(QDomElement& paperElement, const QXmlAttributes double kwordHeight; double kwordWidth; - QString strPageType=attributes.value("pagetype").stripWhiteSpace(); + TQString strPageType=attributes.value("pagetype").stripWhiteSpace(); // Do we know the page size or do we need to measure? // For page formats that KWord knows, use our own values in case the values in the file would be wrong. @@ -905,7 +905,7 @@ static bool StartElementPageSize(QDomElement& paperElement, const QXmlAttributes double height = attributes.value("height").toDouble(); double width = attributes.value("width" ).toDouble(); - QString strUnits = attributes.value("units").stripWhiteSpace(); + TQString strUnits = attributes.value("units").stripWhiteSpace(); kdDebug(30506) << "Explicit page size: " << height << " " << strUnits << " x " << width << " " << strUnits @@ -1006,7 +1006,7 @@ bool StructureParser::complexForcedPageBreak(StackItem* stackItem) // <section> bool StructureParser::StartElementSection(StackItem* stackItem, StackItem* /*stackCurrent*/, - const QXmlAttributes& attributes) + const TQXmlAttributes& attributes) { //TODO: non main text sections (e.g. footers) stackItem->elementType=ElementTypeSection; @@ -1021,7 +1021,7 @@ bool StructureParser::StartElementSection(StackItem* stackItem, StackItem* /*sta // TODO; (as KWord does not allow different page sizes/margins for the same document) if (true && (!m_paperBordersElement.isNull())) { - QString str; + TQString str; str=abiPropsMap["page-margin-top"].getValue(); if (!str.isEmpty()) { @@ -1049,14 +1049,14 @@ bool StructureParser::StartElementSection(StackItem* stackItem, StackItem* /*sta // <iw> static bool EndElementIW(StackItem* stackItem, StackItem* /*stackCurrent*/, - QDomDocument& mainDocument, QDomElement& m_ignoreWordsElement) + TQDomDocument& mainDocument, TQDomElement& m_ignoreWordsElement) { if (!stackItem->elementType==ElementTypeIgnoreWord) { kdError(30506) << "Wrong element type!! Aborting! (in endElementIW)" << endl; return false; } - QDomElement wordElement=mainDocument.createElement("SPELLCHECKIGNOREWORD"); + TQDomElement wordElement=mainDocument.createElement("SPELLCHECKIGNOREWORD"); wordElement.setAttribute("word",stackItem->strTemp2.stripWhiteSpace()); m_ignoreWordsElement.appendChild(wordElement); return true; @@ -1064,12 +1064,12 @@ static bool EndElementIW(StackItem* stackItem, StackItem* /*stackCurrent*/, // <foot> bool StructureParser::StartElementFoot(StackItem* stackItem, StackItem* /*stackCurrent*/, - const QXmlAttributes& /*attributes*/) + const TQXmlAttributes& /*attributes*/) { #if 0 stackItem->elementType=ElementTypeFoot; - const QString id(attributes.value("endnote-id").stripWhiteSpace()); + const TQString id(attributes.value("endnote-id").stripWhiteSpace()); kdDebug(30506) << "Foot note id: " << id << endl; if (id.isEmpty()) @@ -1080,14 +1080,14 @@ bool StructureParser::StartElementFoot(StackItem* stackItem, StackItem* /*stackC } // We need to create a frameset for the foot note. - QDomElement framesetElement(mainDocument.createElement("FRAMESET")); + TQDomElement framesetElement(mainDocument.createElement("FRAMESET")); framesetElement.setAttribute("frameType",1); framesetElement.setAttribute("frameInfo",7); framesetElement.setAttribute("visible",1); framesetElement.setAttribute("name",getFootnoteFramesetName(id)); framesetsPluralElement.appendChild(framesetElement); - QDomElement frameElementOut(mainDocument.createElement("FRAME")); + TQDomElement frameElementOut(mainDocument.createElement("FRAME")); //frameElementOut.setAttribute("left",28); //frameElementOut.setAttribute("top",42); //frameElementOut.setAttribute("bottom",566); @@ -1105,19 +1105,19 @@ bool StructureParser::StartElementFoot(StackItem* stackItem, StackItem* /*stackC // Element <table> bool StructureParser::StartElementTable(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes) + const TQXmlAttributes& attributes) { #if 1 // In KWord, inline tables are inside a paragraph. // In AbiWord, tables are outside any paragraph. - QStringList widthList; + TQStringList widthList; widthList.split('/', attributes.value("table-column-props"), false); const uint columns = widthList.size(); - stackItem->m_doubleArray.detach(); // Be sure not to modify parents + stackItem->m_doubleArray.detach(); // Be sure not to modify tqparents stackItem->m_doubleArray.resize(columns+1); // All left positions but the last right one stackItem->m_doubleArray[0] = 0.0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; uint i; for ( i=0, it=widthList.begin(); i<columns; ++i, ++it ) { @@ -1127,26 +1127,26 @@ bool StructureParser::StartElementTable(StackItem* stackItem, StackItem* stackCu // ### TODO: in case of automatic column widths, we have not any width given by AbiWord const uint tableNumber(++m_tableGroupNumber); - const QString tableName(i18n("Table %1").arg(tableNumber)); + const TQString tableName(i18n("Table %1").tqarg(tableNumber)); - QDomElement elementText=stackCurrent->stackElementText; - QDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); + TQDomElement elementText=stackCurrent->stackElementText; + TQDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); stackCurrent->m_frameset.appendChild(paragraphElementOut); - QDomElement textElementOut(mainDocument.createElement("TEXT")); + TQDomElement textElementOut(mainDocument.createElement("TEXT")); textElementOut.appendChild(mainDocument.createTextNode("#")); paragraphElementOut.appendChild(textElementOut); - QDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); + TQDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); paragraphElementOut.appendChild(formatsPluralElementOut); - QDomElement elementFormat(mainDocument.createElement("FORMAT")); + TQDomElement elementFormat(mainDocument.createElement("FORMAT")); elementFormat.setAttribute("id",6); elementFormat.setAttribute("pos",0); elementFormat.setAttribute("len",1); formatsPluralElementOut.appendChild(elementFormat); - QDomElement elementAnchor(mainDocument.createElement("ANCHOR")); + TQDomElement elementAnchor(mainDocument.createElement("ANCHOR")); elementAnchor.setAttribute("type","frameset"); elementAnchor.setAttribute("instance",tableName); elementFormat.appendChild(elementAnchor); @@ -1156,16 +1156,16 @@ bool StructureParser::StartElementTable(StackItem* stackItem, StackItem* stackCu stackItem->stackElementText=textElementOut; // <TEXT> stackItem->stackElementFormatsPlural=formatsPluralElementOut; // <FORMATS> stackItem->strTemp1=tableName; - stackItem->strTemp2=QString::number(tableNumber); // needed as I18N does not allow adding phrases + stackItem->strTemp2=TQString::number(tableNumber); // needed as I18N does not allow adding phrases stackItem->pos=1; // Just # - // Now we populate the layout - QDomElement layoutElement=mainDocument.createElement("LAYOUT"); - paragraphElementOut.appendChild(layoutElement); + // Now we populate the tqlayout + TQDomElement tqlayoutElement=mainDocument.createElement("LAYOUT"); + paragraphElementOut.appendChild(tqlayoutElement); AbiPropsMap abiPropsMap; styleDataMap.useOrCreateStyle("Normal"); // We might have to create the "Normal" style. - AddLayout("Normal", layoutElement, stackItem, mainDocument, abiPropsMap, 0, false); + AddLayout("Normal", tqlayoutElement, stackItem, mainDocument, abiPropsMap, 0, false); #else stackItem->elementType=ElementTypeIgnore; #endif @@ -1174,7 +1174,7 @@ bool StructureParser::StartElementTable(StackItem* stackItem, StackItem* stackCu // <cell> bool StructureParser::StartElementCell(StackItem* stackItem, StackItem* stackCurrent, - const QXmlAttributes& attributes) + const TQXmlAttributes& attributes) { #if 1 if (stackCurrent->elementType!=ElementTypeTable) @@ -1185,7 +1185,7 @@ bool StructureParser::StartElementCell(StackItem* stackItem, StackItem* stackCur stackItem->elementType=ElementTypeCell; - const QString tableName(stackCurrent->strTemp1); + const TQString tableName(stackCurrent->strTemp1); kdDebug(30506) << "Table name: " << tableName << endl; if (tableName.isEmpty()) @@ -1204,17 +1204,17 @@ bool StructureParser::StartElementCell(StackItem* stackItem, StackItem* stackCur if ( col >= stackItem->m_doubleArray.size() ) { // We do not know the right position of this column, so improvise. (### TODO) - // We play on the fact that QByteArray uses shallow copies by default. + // We play on the fact that TQByteArray uses shallow copies by default. // (We do want that the change is known at <table> level) - stackItem->m_doubleArray.resize( stackItem->m_doubleArray.size() + 1, QGArray::SpeedOptim ); + stackItem->m_doubleArray.resize( stackItem->m_doubleArray.size() + 1, TQGArray::SpeedOptim ); stackItem->m_doubleArray[col+1] = stackItem->m_doubleArray[col] + 72; // Try 1 inch } - const QString frameName(i18n("Frameset name","Table %3, row %1, column %2") - .arg(row).arg(col).arg(stackCurrent->strTemp2)); // As the stack could be wrong, be careful and use the string as last! + const TQString frameName(i18n("Frameset name","Table %3, row %1, column %2") + .tqarg(row).tqarg(col).tqarg(stackCurrent->strTemp2)); // As the stack could be wrong, be careful and use the string as last! // We need to create a frameset for the cell - QDomElement framesetElement(mainDocument.createElement("FRAMESET")); + TQDomElement framesetElement(mainDocument.createElement("FRAMESET")); framesetElement.setAttribute("frameType",1); framesetElement.setAttribute("frameInfo",0); framesetElement.setAttribute("visible",1); @@ -1226,7 +1226,7 @@ bool StructureParser::StartElementCell(StackItem* stackItem, StackItem* stackCur framesetElement.setAttribute("grpMgr",tableName); framesetsPluralElement.appendChild(framesetElement); - QDomElement frameElementOut(mainDocument.createElement("FRAME")); + TQDomElement frameElementOut(mainDocument.createElement("FRAME")); frameElementOut.setAttribute( "left", stackItem->m_doubleArray[col] ); frameElementOut.setAttribute( "right", stackItem->m_doubleArray[col+1] ); frameElementOut.setAttribute("top",0); @@ -1237,7 +1237,7 @@ bool StructureParser::StartElementCell(StackItem* stackItem, StackItem* stackCur framesetElement.appendChild(frameElementOut); stackItem->m_frameset=framesetElement; - QDomElement nullDummy; + TQDomElement nullDummy; stackItem->stackElementParagraph=nullDummy; // <PARAGRAPH> stackItem->stackElementText=nullDummy; // <TEXT> stackItem->stackElementFormatsPlural=nullDummy; // <FORMATS> @@ -1250,7 +1250,7 @@ bool StructureParser::StartElementCell(StackItem* stackItem, StackItem* stackCur // Parser for SAX2 -bool StructureParser :: startElement( const QString&, const QString&, const QString& name, const QXmlAttributes& attributes) +bool StructureParser :: startElement( const TQString&, const TQString&, const TQString& name, const TQXmlAttributes& attributes) { //Warning: be careful that some element names can be lower case or upper case (not very XML) kdDebug(30506) << indent << " <" << name << ">" << endl; //DEBUG @@ -1403,7 +1403,7 @@ bool StructureParser :: startElement( const QString&, const QString&, const QStr return success; } -bool StructureParser :: endElement( const QString&, const QString& , const QString& name) +bool StructureParser :: endElement( const TQString&, const TQString& , const TQString& name) { indent.remove( 0, 1 ); // DEBUG kdDebug(30506) << indent << " </" << name << ">" << endl; @@ -1464,7 +1464,7 @@ bool StructureParser :: endElement( const QString&, const QString& , const QStri return success; } -bool StructureParser :: characters ( const QString & ch ) +bool StructureParser :: characters ( const TQString & ch ) { // DEBUG start if (ch=="\n") @@ -1536,15 +1536,15 @@ bool StructureParser :: characters ( const QString & ch ) bool StructureParser::startDocument(void) { - indent = QString::null; //DEBUG + indent = TQString(); //DEBUG styleDataMap.defineDefaultStyles(); return true; } void StructureParser::createDocInfo(void) { - QDomImplementation implementation; - QDomDocument doc(implementation.createDocumentType("document-info", + TQDomImplementation implementation; + TQDomDocument doc(implementation.createDocumentType("document-info", "-//KDE//DTD document-info 1.2//EN", "http://www.koffice.org/DTD/document-info-1.2.dtd")); m_info=doc; @@ -1553,33 +1553,33 @@ void StructureParser::createDocInfo(void) mainDocument.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"")); - QDomElement elementDoc(mainDocument.createElement("document-info")); + TQDomElement elementDoc(mainDocument.createElement("document-info")); elementDoc.setAttribute("xmlns","http://www.koffice.org/DTD/document-info"); m_info.appendChild(elementDoc); - QDomElement about(mainDocument.createElement("about")); + TQDomElement about(mainDocument.createElement("about")); elementDoc.appendChild(about); - QDomElement abstract(mainDocument.createElement("abstract")); + TQDomElement abstract(mainDocument.createElement("abstract")); about.appendChild(abstract); abstract.appendChild(mainDocument.createTextNode(m_metadataMap["dc.description"])); - QDomElement title(mainDocument.createElement("title")); + TQDomElement title(mainDocument.createElement("title")); about.appendChild(title); title.appendChild(mainDocument.createTextNode(m_metadataMap["dc.title"])); - QDomElement keyword(mainDocument.createElement("keyword")); + TQDomElement keyword(mainDocument.createElement("keyword")); about.appendChild(keyword); keyword.appendChild(mainDocument.createTextNode(m_metadataMap["abiword.keywords"])); - QDomElement subject(mainDocument.createElement("subject")); + TQDomElement subject(mainDocument.createElement("subject")); about.appendChild(subject); subject.appendChild(mainDocument.createTextNode(m_metadataMap["dc.subject"])); } bool StructureParser::endDocument(void) { - QDomElement stylesPluralElement=mainDocument.createElement("STYLES"); + TQDomElement stylesPluralElement=mainDocument.createElement("STYLES"); // insert before <PICTURES>, as <PICTURES> must remain last. mainDocument.documentElement().insertBefore(stylesPluralElement,m_picturesElement); @@ -1587,11 +1587,11 @@ bool StructureParser::endDocument(void) StyleDataMap::ConstIterator it; // At first, we put the Normal style - it=styleDataMap.find("Normal"); + it=styleDataMap.tqfind("Normal"); if (it!=styleDataMap.end()) { kdDebug(30506) << "\"" << it.key() << "\" => " << it.data().m_props << endl; - QDomElement styleElement=mainDocument.createElement("STYLE"); + TQDomElement styleElement=mainDocument.createElement("STYLE"); stylesPluralElement.appendChild(styleElement); AddStyle(styleElement, it.key(),it.data(),mainDocument); } @@ -1605,7 +1605,7 @@ bool StructureParser::endDocument(void) kdDebug(30506) << "\"" << it.key() << "\" => " << it.data().m_props << endl; - QDomElement styleElement=mainDocument.createElement("STYLE"); + TQDomElement styleElement=mainDocument.createElement("STYLE"); stylesPluralElement.appendChild(styleElement); AddStyle(styleElement, it.key(),it.data(),mainDocument); @@ -1617,14 +1617,14 @@ bool StructureParser::endDocument(void) return true; } -bool StructureParser::warning(const QXmlParseException& exception) +bool StructureParser::warning(const TQXmlParseException& exception) { kdWarning(30506) << "XML parsing warning: line " << exception.lineNumber() << " col " << exception.columnNumber() << " message: " << exception.message() << endl; return true; } -bool StructureParser::error(const QXmlParseException& exception) +bool StructureParser::error(const TQXmlParseException& exception) { // A XML error is recoverable, so it is only a KDE warning kdWarning(30506) << "XML parsing error: line " << exception.lineNumber() @@ -1632,22 +1632,22 @@ bool StructureParser::error(const QXmlParseException& exception) return true; } -bool StructureParser::fatalError (const QXmlParseException& exception) +bool StructureParser::fatalError (const TQXmlParseException& exception) { kdError(30506) << "XML parsing fatal error: line " << exception.lineNumber() << " col " << exception.columnNumber() << " message: " << exception.message() << endl; m_fatalerror=true; KMessageBox::error(NULL, i18n("An error has occurred while parsing the AbiWord file.\nAt line: %1, column %2\nError message: %3") - .arg(exception.lineNumber()).arg(exception.columnNumber()) - .arg( i18n( "QXml", exception.message().utf8() ) ), + .tqarg(exception.lineNumber()).tqarg(exception.columnNumber()) + .tqarg( i18n( "TQXml", exception.message().utf8() ) ), i18n("AbiWord Import Filter"),0); return false; // Stop parsing now, we do not need further errors. } void StructureParser :: createDocument(void) { - QDomImplementation implementation; - QDomDocument doc(implementation.createDocumentType("DOC", + TQDomImplementation implementation; + TQDomDocument doc(implementation.createDocumentType("DOC", "-//KDE//DTD kword 1.2//EN", "http://www.koffice.org/DTD/kword-1.2.dtd")); mainDocument=doc; @@ -1656,7 +1656,7 @@ void StructureParser :: createDocument(void) mainDocument.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"")); - QDomElement elementDoc; + TQDomElement elementDoc; elementDoc=mainDocument.createElement("DOC"); elementDoc.setAttribute("xmlns","http://www.koffice.org/DTD/kword"); elementDoc.setAttribute("editor","AbiWord Import Filter"); @@ -1664,7 +1664,7 @@ void StructureParser :: createDocument(void) elementDoc.setAttribute( "syntaxVersion", 3 ); mainDocument.appendChild(elementDoc); - QDomElement element; + TQDomElement element; element=mainDocument.createElement("ATTRIBUTES"); element.setAttribute("processing",0); element.setAttribute("standardpage",1); @@ -1707,7 +1707,7 @@ void StructureParser :: createDocument(void) mainFramesetElement.setAttribute("name",i18n("Frameset name","Main Text Frameset")); framesetsPluralElement.appendChild(mainFramesetElement); - QDomElement frameElementOut=mainDocument.createElement("FRAME"); + TQDomElement frameElementOut=mainDocument.createElement("FRAME"); frameElementOut.setAttribute("left",28); frameElementOut.setAttribute("top",42); frameElementOut.setAttribute("bottom",566); @@ -1753,11 +1753,11 @@ bool StructureParser::clearStackUntilParagraph(StackItemStack& auxilaryStack) } } -ABIWORDImport::ABIWORDImport(KoFilter */*parent*/, const char */*name*/, const QStringList &) : +ABIWORDImport::ABIWORDImport(KoFilter */*tqparent*/, const char */*name*/, const TQStringList &) : KoFilter() { } -KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus ABIWORDImport::convert( const TQCString& from, const TQCString& to ) { if ((to != "application/x-kword") || (from != "application/x-abiword")) return KoFilter::NotImplemented; @@ -1766,15 +1766,15 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q StructureParser handler(m_chain); - //We arbitrarily decide that Qt can handle the encoding in which the file was written!! - QXmlSimpleReader reader; + //We arbitrarily decide that TQt can handle the encoding in which the file was written!! + TQXmlSimpleReader reader; reader.setContentHandler( &handler ); reader.setErrorHandler( &handler ); //Find the last extension - QString strExt; - QString fileIn = m_chain->inputFile(); - const int result=fileIn.findRev('.'); + TQString strExt; + TQString fileIn = m_chain->inputFile(); + const int result=fileIn.tqfindRev('.'); if (result>=0) { strExt=fileIn.mid(result); @@ -1782,7 +1782,7 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q kdDebug(30506) << "File extension: -" << strExt << "-" << endl; - QString strMime; // Mime type of the compressor (default: unknown) + TQString strMime; // Mime type of the compressor (default: unknown) if ((strExt==".gz")||(strExt==".GZ") //in case of .abw.gz (logical extension) ||(strExt==".zabw")||(strExt==".ZABW")) //in case of .zabw (extension used prioritary with AbiWord) @@ -1799,7 +1799,7 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q kdDebug(30506) << "Compression: bzip2" << endl; } - QIODevice* in = KFilterDev::deviceForFile(fileIn,strMime); + TQIODevice* in = KFilterDev::deviceForFile(fileIn,strMime); if ( !in ) { @@ -1814,7 +1814,7 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q return KoFilter::FileNotFound; } - QXmlInputSource source(in); // Read the file + TQXmlInputSource source(in); // Read the file in->close(); @@ -1825,14 +1825,14 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q if (!handler.wasFatalError()) { // As the parsing was stopped for something else than a fatal error, we have not yet get an error message. (Can it really happen?) - KMessageBox::error(NULL, i18n("An error occurred during the load of the AbiWord file: %1").arg(from), + KMessageBox::error(NULL, i18n("An error occurred during the load of the AbiWord file: %1").tqarg(from.data()), i18n("AbiWord Import Filter"),0); } return KoFilter::ParsingError; } delete in; - QCString strOut; + TQCString strOut; KoStoreDevice* out; kdDebug(30506) << "Creating documentinfo.xml" << endl; @@ -1846,7 +1846,7 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q //Write the document information! strOut=handler.getDocInfo().toCString(); // UTF-8 - // WARNING: we cannot use KoStore::write(const QByteArray&) because it writes an extra NULL character at the end. + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it writes an extra NULL character at the end. out->writeBlock(strOut,strOut.length()); kdDebug(30506) << "Creating maindoc.xml" << endl; @@ -1860,7 +1860,7 @@ KoFilter::ConversionStatus ABIWORDImport::convert( const QCString& from, const Q //Write the document! strOut=handler.getDocument().toCString(); // UTF-8 - // WARNING: we cannot use KoStore::write(const QByteArray&) because it writes an extra NULL character at the end. + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it writes an extra NULL character at the end. out->writeBlock(strOut,strOut.length()); #if 0 diff --git a/filters/kword/abiword/abiwordimport.h b/filters/kword/abiword/abiwordimport.h index 3ead0283..c48ac362 100644 --- a/filters/kword/abiword/abiwordimport.h +++ b/filters/kword/abiword/abiwordimport.h @@ -33,9 +33,9 @@ #ifndef ABIWORDIMPORT_H #define ABIWORDIMPORT_H -#include <qstring.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -43,12 +43,13 @@ class ABIWORDImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - ABIWORDImport(KoFilter *parent, const char *name, const QStringList &); + ABIWORDImport(KoFilter *tqparent, const char *name, const TQStringList &); ABIWORDImport(); virtual ~ABIWORDImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // ABIWORDIMPORT_H diff --git a/filters/kword/amipro/FileFormat.txt b/filters/kword/amipro/FileFormat.txt index 15f20037..f795b56c 100644 --- a/filters/kword/amipro/FileFormat.txt +++ b/filters/kword/amipro/FileFormat.txt @@ -43,9 +43,9 @@ Note: Word underline is just like underline, except that spaces between words are not underlined. Paragraph align is also encoded using tag, here it the list: - <+@> left alignment - <+A> right alignment - <+B> center alignment + <+@> left tqalignment + <+A> right tqalignment + <+B> center tqalignment <+C> justified Linespacing is encoded using tag: @@ -81,7 +81,7 @@ example below: 0 font color (see below) 16385 formatting flag (see below) [algn] - 4 alignment flag (see below) + 4 tqalignment flag (see below) 1 216 indent, 216/20 = 10.8 pt 144 first line indent, 144/20 = 7.2 pt @@ -185,7 +185,7 @@ Normally this appears in beginning of paragraph. 5 Page Layout ------------- -Page layout is defined in section [lay]. Here is the format, +Page tqlayout is defined in section [lay]. Here is the format, along with an example: [lay] diff --git a/filters/kword/amipro/amiproexport.cc b/filters/kword/amipro/amiproexport.cc index fcf93914..dd4550b8 100644 --- a/filters/kword/amipro/amiproexport.cc +++ b/filters/kword/amipro/amiproexport.cc @@ -23,10 +23,10 @@ #include <unistd.h> #endif -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -46,20 +46,20 @@ class AmiProWorker : public KWEFBaseWorker public: AmiProWorker(void) { } virtual ~AmiProWorker(void) { } - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); private: - QString filename; - QString result; + TQString filename; + TQString result; bool m_bold, m_italic, m_underline, m_underlineDouble; bool m_strike, m_subscript, m_superscript; }; -bool AmiProWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool AmiProWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { filename = filenameOut; @@ -68,11 +68,11 @@ bool AmiProWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) bool AmiProWorker::doCloseFile(void) { - QFile out( filename ); + TQFile out( filename ); if( !out.open( IO_WriteOnly ) ) return FALSE; - QTextStream stream; - stream.setDevice( &out ); + TQTextStream stream; + stream.setDevice( TQT_TQIODEVICE(&out) ); stream << result; return TRUE; } @@ -92,7 +92,7 @@ bool AmiProWorker::doOpenDocument(void) 1, 2160, 1, 2880, 1, 3600, 1, 4320, 1, 5040, 1, 5760, 1, 6480, 1, 7200, 1, 7920, 1, 8640 }; for( uint i=0; i<sizeof(magic)/sizeof(magic[0]); i++ ) - result += "\t\t" + QString::number(magic[i]) + "\n"; + result += "\t\t" + TQString::number(magic[i]) + "\n"; result += "[elay]\n"; result += "[edoc]\n"; @@ -109,14 +109,14 @@ bool AmiProWorker::doCloseDocument(void) return TRUE; } -static QString AmiProEscape( const QString& text ) +static TQString AmiProEscape( const TQString& text ) { - QString result; + TQString result; for( unsigned i=0; i<text.length(); i++ ) { - QChar ch = text[i]; - switch( ch.unicode() ) + TQChar ch = text[i]; + switch( ch.tqunicode() ) { case '<': result += "<<"; break; case '>': result += "<;>"; break; @@ -130,11 +130,11 @@ static QString AmiProEscape( const QString& text ) return result; } -bool AmiProWorker::doFullParagraph(const QString& paraText, - const LayoutData& /*layout*/, const ValueListFormatData& paraFormatDataList) +bool AmiProWorker::doFullParagraph(const TQString& paraText, + const LayoutData& /*tqlayout*/, const ValueListFormatData& paraFormatDataList) { - QString amiproText = ""; - QString text = paraText; + TQString amiproText = ""; + TQString text = paraText; ValueListFormatData::ConstIterator it; for( it = paraFormatDataList.begin(); it!=paraFormatDataList.end(); ++it ) @@ -144,7 +144,7 @@ bool AmiProWorker::doFullParagraph(const QString& paraText, // only if the format is for text (id==1) if( formatData.id == 1 ) { - QString partialText; + TQString partialText; partialText = text.mid( formatData.pos, formatData.len ); partialText = AmiProEscape( partialText ); @@ -175,14 +175,14 @@ bool AmiProWorker::doFullParagraph(const QString& paraText, return TRUE; } -AmiProExport::AmiProExport( KoFilter *, const char *, const QStringList& ): +AmiProExport::AmiProExport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } -KoFilter::ConversionStatus -AmiProExport::convert( const QCString& from, - const QCString& to ) +KoFilter::ConversiontqStatus +AmiProExport::convert( const TQCString& from, + const TQCString& to ) { // check for proper conversion if( to!= "application/x-amipro" || from != "application/x-kword" ) @@ -191,7 +191,7 @@ AmiProExport::convert( const QCString& from, AmiProWorker* worker = new AmiProWorker(); KWEFKWordLeader* leader = new KWEFKWordLeader( worker ); - KoFilter::ConversionStatus result; + KoFilter::ConversiontqStatus result; result = leader->convert( m_chain, from, to ); delete worker; diff --git a/filters/kword/amipro/amiproexport.h b/filters/kword/amipro/amiproexport.h index 12461309..d4a0603e 100644 --- a/filters/kword/amipro/amiproexport.h +++ b/filters/kword/amipro/amiproexport.h @@ -26,15 +26,16 @@ class AmiProExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - AmiProExport(KoFilter *parent, const char *name, const QStringList&); + AmiProExport(KoFilter *tqparent, const char *name, const TQStringList&); AmiProExport(); virtual ~AmiProExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __AMIPROEXPORT_H diff --git a/filters/kword/amipro/amiproimport.cc b/filters/kword/amipro/amiproimport.cc index f2fcb72c..7f37746c 100644 --- a/filters/kword/amipro/amiproimport.cc +++ b/filters/kword/amipro/amiproimport.cc @@ -23,10 +23,10 @@ #include <unistd.h> #endif -#include <qregexp.h> -#include <qfileinfo.h> -#include <qvaluelist.h> -#include <qfont.h> +#include <tqregexp.h> +#include <tqfileinfo.h> +#include <tqvaluelist.h> +#include <tqfont.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -39,7 +39,7 @@ typedef KGenericFactory<AmiProImport, KoFilter> AmiProImportFactory; K_EXPORT_COMPONENT_FACTORY( libamiproimport, AmiProImportFactory( "kofficefilters" ) ) -AmiProImport::AmiProImport( KoFilter *, const char *, const QStringList& ): +AmiProImport::AmiProImport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } @@ -48,49 +48,49 @@ class AmiProConverter: public AmiProListener { public: AmiProConverter(); - QString root, documentInfo; + TQString root, documentInfo; virtual bool doOpenDocument(); virtual bool doCloseDocument(); virtual bool doDefineStyle( const AmiProStyle& style ); - virtual bool doParagraph( const QString& text, AmiProFormatList formatList, + virtual bool doParagraph( const TQString& text, AmiProFormatList formatList, AmiProLayout& l ); private: AmiProStyleList styleList; }; // helper function to escape string for XML-ness -static QString XMLEscape( const QString& str ) +static TQString XMLEscape( const TQString& str ) { - QString result; + TQString result; for( unsigned i=0; i<str.length(); i++ ) if( str[i] == '&' ) result += "&"; else if( str[i] == '<' ) result += "<"; else if( str[i] == '>' ) result += ">"; else if( str[i] == '"' ) result += """; - else if( str[i] == QChar(39) ) result += "'"; + else if( str[i] == TQChar(39) ) result += "'"; else result += str[i]; return result; } // helper function to convert AmiPro format to KWord's FORMAT -static QString AmiProFormatAsXML( AmiProFormat format ) +static TQString AmiProFormatAsXML( AmiProFormat format ) { - QString result; + TQString result; - QString fontname = format.fontFamily; + TQString fontname = format.fontFamily; if( fontname.isEmpty() ) fontname = KoGlobal::defaultFont().family(); - QString fontsize = QString::number( format.fontSize ); - QString boldness = format.bold ? "75" : "50"; - QString italic = format.italic ? "1" : "0"; - QString strikeout = format.strikethrough ? "1" : "0"; - QString vertalign = format.superscript ? "2" : format.subscript ? "1" : "0"; - QString underline = format.double_underline ? "double" : + TQString fontsize = TQString::number( format.fontSize ); + TQString boldness = format.bold ? "75" : "50"; + TQString italic = format.italic ? "1" : "0"; + TQString strikeout = format.strikethrough ? "1" : "0"; + TQString vertalign = format.superscript ? "2" : format.subscript ? "1" : "0"; + TQString underline = format.double_underline ? "double" : format.underline|format.word_underline ? "1" : "0"; - result = "<FORMAT id=\"1\" pos=\"" + QString::number(format.pos) + - "\" len=\"" + QString::number(format.len) + "\">\n"; + result = "<FORMAT id=\"1\" pos=\"" + TQString::number(format.pos) + + "\" len=\"" + TQString::number(format.len) + "\">\n"; result.append( " <FONT name=\"" + fontname + "\" />\n" ); result.append( " <SIZE value=\"" + fontsize + "\" />\n" ); result.append( " <WEIGHT value=\"" + boldness + "\" />\n" ); @@ -104,9 +104,9 @@ static QString AmiProFormatAsXML( AmiProFormat format ) } // helper function to convert AmiPro list of formats to KWord FORMATS -static QString AmiProFormatListAsXML( AmiProFormatList& formatList ) +static TQString AmiProFormatListAsXML( AmiProFormatList& formatList ) { - QString result; + TQString result; AmiProFormatList::iterator it; for( it=formatList.begin(); it!=formatList.end(); ++it ) @@ -124,43 +124,43 @@ static QString AmiProFormatListAsXML( AmiProFormatList& formatList ) return result; } -// helper function to convert AmiPro paragraph layout to KWord's LAYOUT -static QString AmiProLayoutAsXML( const AmiProLayout& layout ) +// helper function to convert AmiPro paragraph tqlayout to KWord's LAYOUT +static TQString AmiProLayoutAsXML( const AmiProLayout& tqlayout ) { - QString result; + TQString result; - QString referredStyle = layout.name; + TQString referredStyle = tqlayout.name; if( referredStyle.isEmpty() ) referredStyle = "Standard"; - QString fontname = layout.fontFamily; + TQString fontname = tqlayout.fontFamily; if( fontname.isEmpty() ) fontname = KoGlobal::defaultFont().family(); - QString fontsize = QString::number( layout.fontSize ); - QString fontcolor = "red=\"" + QString::number( layout.fontColor.red() ) + - "\" green=\"" + QString::number( layout.fontColor.green() ) + - "\" blue=\"" + QString::number( layout.fontColor.blue() ) + "\""; - QString boldness = layout.bold ? "75" : "50"; - QString italic = layout.italic ? "1" : "0"; - QString strikeout = layout.strikethrough ? "1" : "0"; - QString vertalign = layout.superscript ? "2" : layout.subscript ? "1" : "0"; - QString underline = layout.double_underline ? "double" : - layout.underline|layout.word_underline ? "1" : "0"; - - QString align; - align = layout.align==Qt::AlignLeft ? "left" : - layout.align==Qt::AlignRight ? "right" : - layout.align==Qt::AlignCenter ? "center" : - layout.align==Qt::AlignJustify ? "justify" : + TQString fontsize = TQString::number( tqlayout.fontSize ); + TQString fontcolor = "red=\"" + TQString::number( tqlayout.fontColor.red() ) + + "\" green=\"" + TQString::number( tqlayout.fontColor.green() ) + + "\" blue=\"" + TQString::number( tqlayout.fontColor.blue() ) + "\""; + TQString boldness = tqlayout.bold ? "75" : "50"; + TQString italic = tqlayout.italic ? "1" : "0"; + TQString strikeout = tqlayout.strikethrough ? "1" : "0"; + TQString vertalign = tqlayout.superscript ? "2" : tqlayout.subscript ? "1" : "0"; + TQString underline = tqlayout.double_underline ? "double" : + tqlayout.underline|tqlayout.word_underline ? "1" : "0"; + + TQString align; + align = tqlayout.align==TQt::AlignLeft ? "left" : + tqlayout.align==TQt::AlignRight ? "right" : + tqlayout.align==TQt::AlignCenter ? "center" : + tqlayout.align==TQt::AlignJustify ? "justify" : "left"; - QString offsets; - offsets = "before=\"" + QString::number(layout.spaceBefore) + - "\" after=\"" + QString::number(layout.spaceAfter) + "\""; + TQString offsets; + offsets = "before=\"" + TQString::number(tqlayout.spaceBefore) + + "\" after=\"" + TQString::number(tqlayout.spaceAfter) + "\""; - QString linespacing; - linespacing = layout.linespace==AmiPro::LS_Single ? QString::fromLatin1( "0" ) : - layout.linespace==AmiPro::LS_OneAndHalf ? QString::fromLatin1( "oneandhalf" ) : - layout.linespace==AmiPro::LS_Double ? QString::fromLatin1( "double" ) : - QString::number( layout.linespace ); + TQString linespacing; + linespacing = tqlayout.linespace==AmiPro::LS_Single ? TQString::tqfromLatin1( "0" ) : + tqlayout.linespace==AmiPro::LS_OneAndHalf ? TQString::tqfromLatin1( "oneandhalf" ) : + tqlayout.linespace==AmiPro::LS_Double ? TQString::tqfromLatin1( "double" ) : + TQString::number( tqlayout.linespace ); result.append( "<LAYOUT>\n" ); result.append( " <NAME value=\"" + XMLEscape( referredStyle ) + "\" />\n" ); @@ -191,36 +191,36 @@ static QString AmiProLayoutAsXML( const AmiProLayout& layout ) } // helper function to convert AmiPro style to KWord STYLE -static QString AmiProStyleAsXML( const AmiProStyle& style ) +static TQString AmiProStyleAsXML( const AmiProStyle& style ) { - QString result; + TQString result; - QString fontname = style.fontFamily; + TQString fontname = style.fontFamily; if( fontname.isEmpty() ) fontname = KoGlobal::defaultFont().family(); - QString fontsize = QString::number( style.fontSize ); - QString boldness = style.bold ? "75" : "50"; - QString italic = style.italic ? "1" : "0"; - QString strikeout = style.strikethrough ? "1" : "0"; - QString vertalign = style.superscript ? "2" : style.subscript ? "1" : "0"; - QString underline = style.double_underline ? "double" : + TQString fontsize = TQString::number( style.fontSize ); + TQString boldness = style.bold ? "75" : "50"; + TQString italic = style.italic ? "1" : "0"; + TQString strikeout = style.strikethrough ? "1" : "0"; + TQString vertalign = style.superscript ? "2" : style.subscript ? "1" : "0"; + TQString underline = style.double_underline ? "double" : style.underline|style.word_underline ? "1" : "0"; - QString align; - align = style.align==Qt::AlignLeft ? "left" : - style.align==Qt::AlignRight ? "right" : - style.align==Qt::AlignCenter ? "center" : - style.align==Qt::AlignJustify ? "justify" : + TQString align; + align = style.align==TQt::AlignLeft ? "left" : + style.align==TQt::AlignRight ? "right" : + style.align==TQt::AlignCenter ? "center" : + style.align==TQt::AlignJustify ? "justify" : "left"; - QString linespacing; - linespacing = style.linespace==AmiPro::LS_Single ? QString::fromLatin1( "0" ) : - style.linespace==AmiPro::LS_OneAndHalf ? QString::fromLatin1( "oneandhalf" ) : - style.linespace==AmiPro::LS_Double ? QString::fromLatin1( "double" ) : - QString::number( style.linespace ); + TQString linespacing; + linespacing = style.linespace==AmiPro::LS_Single ? TQString::tqfromLatin1( "0" ) : + style.linespace==AmiPro::LS_OneAndHalf ? TQString::tqfromLatin1( "oneandhalf" ) : + style.linespace==AmiPro::LS_Double ? TQString::tqfromLatin1( "double" ) : + TQString::number( style.linespace ); - QString offsets; - offsets = "before=\"" + QString::number(style.spaceBefore) + - "\" after=\"" + QString::number(style.spaceAfter) + "\""; + TQString offsets; + offsets = "before=\"" + TQString::number(style.spaceBefore) + + "\" after=\"" + TQString::number(style.spaceAfter) + "\""; result.append( "<STYLE>\n" ); result.append( " <NAME value=\"" + XMLEscape( style.name ) + "\" />\n" ); @@ -247,9 +247,9 @@ static QString AmiProStyleAsXML( const AmiProStyle& style ) } // helper function to convert AmiPro styles to KWord STYLES -static QString AmiProStyleListAsXML( AmiProStyleList& styleList ) +static TQString AmiProStyleListAsXML( AmiProStyleList& styleList ) { - QString result; + TQString result; AmiProStyleList::iterator it; for( it=styleList.begin(); it!=styleList.end(); ++it ) @@ -274,7 +274,7 @@ AmiProConverter::AmiProConverter() bool AmiProConverter::doOpenDocument() { - QString prolog = "<!DOCTYPE DOC>\n"; + TQString prolog = "<!DOCTYPE DOC>\n"; prolog.append( "<DOC mime=\"application/x-kword\" syntaxVersion=\"2\" editor=\"KWord\">\n"); prolog.append( "<PAPER width=\"595\" height=\"841\" format=\"1\" fType=\"0\" orientation=\"0\" hType=\"0\" columns=\"1\">\n" ); @@ -291,7 +291,7 @@ bool AmiProConverter::doOpenDocument() bool AmiProConverter::doCloseDocument() { - QString epilog = "</FRAMESET>\n"; + TQString epilog = "</FRAMESET>\n"; epilog.append( "</FRAMESETS>\n" ); epilog.append( AmiProStyleListAsXML( styleList ) ); epilog.append( "</DOC>\n" ); @@ -307,19 +307,19 @@ bool AmiProConverter::doDefineStyle( const AmiProStyle& style ) return true; } -bool AmiProConverter::doParagraph( const QString& text, AmiProFormatList formatList, - AmiProLayout& layout ) +bool AmiProConverter::doParagraph( const TQString& text, AmiProFormatList formatList, + AmiProLayout& tqlayout ) { root.append( "<PARAGRAPH>\n" ); root.append( "<TEXT>" + XMLEscape( text ) + "</TEXT>\n" ); root.append( AmiProFormatListAsXML( formatList ) ); - root.append( AmiProLayoutAsXML( layout ) ); + root.append( AmiProLayoutAsXML( tqlayout ) ); root.append( "</PARAGRAPH>\n" ); return true; } -KoFilter::ConversionStatus AmiProImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus AmiProImport::convert( const TQCString& from, const TQCString& to ) { // check for proper conversion if( to!= "application/x-kword" || from != "application/x-amipro" ) @@ -335,8 +335,8 @@ KoFilter::ConversionStatus AmiProImport::convert( const QCString& from, const QC if( converter->root.isEmpty() ) return KoFilter::StupidError; - QString root = converter->root; - QString documentInfo = converter->documentInfo; + TQString root = converter->root; + TQString documentInfo = converter->documentInfo; delete converter; delete parser; @@ -347,7 +347,7 @@ KoFilter::ConversionStatus AmiProImport::convert( const QCString& from, const QC // store output document if( out ) { - QCString cstring = root.utf8(); + TQCString cstring = root.utf8(); cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); out->writeBlock( (const char*) cstring, cstring.length() ); } @@ -356,7 +356,7 @@ KoFilter::ConversionStatus AmiProImport::convert( const QCString& from, const QC out = m_chain->storageFile( "documentinfo.xml", KoStore::Write ); if ( out ) { - QCString cstring = documentInfo.utf8(); + TQCString cstring = documentInfo.utf8(); cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); out->writeBlock( (const char*) cstring, cstring.length() ); diff --git a/filters/kword/amipro/amiproimport.h b/filters/kword/amipro/amiproimport.h index d1b6cb7e..8d22270f 100644 --- a/filters/kword/amipro/amiproimport.h +++ b/filters/kword/amipro/amiproimport.h @@ -20,7 +20,7 @@ #ifndef __AMIPROIMPORT_H #define __AMIPROIMPORT_H -#include <qstring.h> +#include <tqstring.h> #include <KoFilter.h> #include <KoStore.h> @@ -28,15 +28,16 @@ class AmiProImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - AmiProImport(KoFilter *parent, const char *name, const QStringList&); + AmiProImport(KoFilter *tqparent, const char *name, const TQStringList&); AmiProImport(); virtual ~AmiProImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __AMIPROIMPORT_H diff --git a/filters/kword/amipro/amiproparser.cpp b/filters/kword/amipro/amiproparser.cpp index 12311417..fdae97e6 100644 --- a/filters/kword/amipro/amiproparser.cpp +++ b/filters/kword/amipro/amiproparser.cpp @@ -19,23 +19,23 @@ #include "amiproparser.h" -#include <qfile.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtextstream.h> const float AmiPro::LS_Single = -1; const float AmiPro::LS_OneAndHalf = -1.5; const float AmiPro::LS_Double = -2; // helper function to "unescape" AmiPro string -static QString AmiProUnescape( const QString& str ) +static TQString AmiProUnescape( const TQString& str ) { - QString result; + TQString result; for( unsigned i=0; i< str.length(); i++ ) { - QChar c = str[i]; + TQChar c = str[i]; result.append( c ); // check for "@@", decoded as '@' @@ -83,7 +83,7 @@ static QString AmiProUnescape( const QString& str ) else { result.truncate( result.length() - 1 ); // remove the '<' - result.append( QChar(str[i+2].unicode() + 0x40 ) ); + result.append( TQChar(str[i+2].tqunicode() + 0x40 ) ); i += 3; } } @@ -92,7 +92,7 @@ static QString AmiProUnescape( const QString& str ) if( str[i+1] == '\\' ) { result.truncate( result.length() - 1 ); // remove the '<' - result.append( QChar(str[i+2].unicode() | 0x80 ) ); + result.append( TQChar(str[i+2].tqunicode() | 0x80 ) ); i += 3; } @@ -124,17 +124,17 @@ void AmiProParser::setListener( AmiProListener *listener ) m_listener = listener; } -bool AmiProParser::process( const QString& filename ) +bool AmiProParser::process( const TQString& filename ) { - QString line; + TQString line; // open input file - QFile in( filename ); + TQFile in( filename ); if( !in.open( IO_ReadOnly)) return setResult( FileError ); - QTextStream stream; - stream.setDevice( &in ); + TQTextStream stream; + stream.setDevice( TQT_TQIODEVICE(&in) ); // the first should be "[ver]" line = stream.readLine(); @@ -155,7 +155,7 @@ bool AmiProParser::process( const QString& filename ) m_formatList.clear(); m_styleList.clear(); m_currentSection = ""; - QStringList lines; + TQStringList lines; // parse line-by-line for( ;; ) @@ -164,7 +164,7 @@ bool AmiProParser::process( const QString& filename ) line = stream.readLine(); if( line.isNull() ) break; - QString old_section = m_currentSection; + TQString old_section = m_currentSection; bool enter_new_section = false; // new main section ? @@ -244,19 +244,19 @@ bool AmiProParser::processCloseDocument() return true; } -bool AmiProParser::parseParagraph( const QStringList& lines ) +bool AmiProParser::parseParagraph( const TQStringList& lines ) { m_text = ""; m_formatList.clear(); m_layout = AmiProLayout(); // join the lines, up until first char in a line is '>' - QString partext = ""; + TQString partext = ""; for( unsigned i=0; i<lines.count(); i++ ) if( lines[i][0] == '>' ) break; else partext.append( lines[i] + "\n" ); - QChar ch = partext[partext.length()-1]; + TQChar ch = partext[partext.length()-1]; while( ( ch == '\n' ) || ( ch == '\r' ) ) { partext.remove( partext.length()-1, 1 ); @@ -264,19 +264,19 @@ bool AmiProParser::parseParagraph( const QStringList& lines ) } // "unescape", process special chars and such - QString text = AmiProUnescape( partext ); + TQString text = AmiProUnescape( partext ); // apply default style first m_layout.applyStyle( findStyle( "Body Text" ) ); for( unsigned i=0; i<text.length(); i++ ) { - QChar ch = text[i]; + TQChar ch = text[i]; // handle a tag if( ch == '<' ) { - QString tag = ""; + TQString tag = ""; for( i++; (i < text.length()) && (text[i] != '>'); i++) tag.append( text[i] ); handleTag( tag ); @@ -287,7 +287,7 @@ bool AmiProParser::parseParagraph( const QStringList& lines ) // handle style change if( ch == '@' ) { - QString styleName; + TQString styleName; for( i++; (i < partext.length()) && (partext[i] != '@'); i++) styleName += partext[i]; m_layout.name = styleName; @@ -322,7 +322,7 @@ bool AmiProParser::parseParagraph( const QStringList& lines ) return true; } -bool AmiProParser::parseStyle( const QStringList& lines ) +bool AmiProParser::parseStyle( const TQStringList& lines ) { AmiProStyle style; @@ -344,13 +344,13 @@ bool AmiProParser::parseStyle( const QStringList& lines ) style.word_underline = flag & 8; style.double_underline = flag & 64; - // alignment + // tqalignment if( lines[7].stripWhiteSpace() != "[algn]" ) return true; unsigned align_flag = lines[8].stripWhiteSpace().toUInt(); - if( align_flag & 1 ) style.align = Qt::AlignLeft; - if( align_flag & 2 ) style.align = Qt::AlignRight; - if( align_flag & 4 ) style.align = Qt::AlignCenter; - if( align_flag & 8 ) style.align = Qt::AlignJustify; + if( align_flag & 1 ) style.align = TQt::AlignLeft; + if( align_flag & 2 ) style.align = TQt::AlignRight; + if( align_flag & 4 ) style.align = TQt::AlignCenter; + if( align_flag & 8 ) style.align = TQt::AlignJustify; // linespace if( lines[13].stripWhiteSpace() != "[spc]" ) return true; @@ -373,7 +373,7 @@ bool AmiProParser::parseStyle( const QStringList& lines ) return true; } -AmiProStyle AmiProParser::findStyle( const QString& name ) +AmiProStyle AmiProParser::findStyle( const TQString& name ) { AmiProStyleList::iterator it; for( it=m_styleList.begin(); it!=m_styleList.end(); ++it ) @@ -385,7 +385,7 @@ AmiProStyle AmiProParser::findStyle( const QString& name ) return AmiProStyle(); } -bool AmiProParser::handleTag( const QString& tag ) +bool AmiProParser::handleTag( const TQString& tag ) { // > (actually encoded as <;>) if( tag == ";" ) @@ -525,19 +525,19 @@ bool AmiProParser::handleTag( const QString& tag ) // paragraph left-align if( tag == "+@" ) - m_layout.align = Qt::AlignLeft; + m_layout.align = TQt::AlignLeft; // paragraph right-align if( tag == "+A" ) - m_layout.align = Qt::AlignRight; + m_layout.align = TQt::AlignRight; // paragraph center if( tag == "+B" ) - m_layout.align = Qt::AlignCenter; + m_layout.align = TQt::AlignCenter; // paragraph justify if( tag == "+C" ) - m_layout.align = Qt::AlignJustify; + m_layout.align = TQt::AlignJustify; // linespace if( tag.left( 3 ) == ":S+" ) @@ -551,12 +551,12 @@ bool AmiProParser::handleTag( const QString& tag ) // font if( tag.left( 2 ) == ":f" ) { - QString fontdesc = tag.right( tag.length()-2 ); - QStringList desc = QStringList::split( ",", fontdesc ); + TQString fontdesc = tag.right( tag.length()-2 ); + TQStringList desc = TQStringList::split( ",", fontdesc ); if( desc.count() > 0 ) m_currentFormat.fontSize = desc[0].toFloat() / 20.0; if( desc.count() > 1 ) { - QString fontFamily = desc[1]; + TQString fontFamily = desc[1]; if( fontFamily[0].isDigit() ) fontFamily.remove( 0, 1 ); m_currentFormat.fontFamily = fontFamily; } @@ -582,7 +582,7 @@ AmiProFormat::AmiProFormat() subscript = superscript = strikethrough = FALSE; fontFamily = ""; fontSize = 12; - fontColor = Qt::black; + fontColor = TQt::black; } void AmiProFormat::assign( const AmiProFormat& f ) @@ -628,17 +628,17 @@ void AmiProFormat::applyStyle( const AmiProStyle& style ) strikethrough = style.strikethrough; } -// paragraph layout +// paragraph tqlayout AmiProLayout::AmiProLayout() { name = ""; fontFamily = ""; fontSize = 12; - fontColor = Qt::black; + fontColor = TQt::black; bold = italic = underline = word_underline = double_underline = subscript = superscript = strikethrough = FALSE; - align = Qt::AlignLeft; + align = TQt::AlignLeft; linespace = AmiPro::LS_Single; spaceBefore = spaceAfter = 0; } @@ -699,7 +699,7 @@ AmiProStyle::AmiProStyle() name = "Unnamed"; fontFamily = ""; fontSize = 12; - fontColor = Qt::black; + fontColor = TQt::black; bold = italic = underline = word_underline = double_underline = subscript = superscript = strikethrough = FALSE; @@ -756,5 +756,5 @@ AmiProListener::~AmiProListener() DO_TRUE_DEFINITION(doOpenDocument()) DO_TRUE_DEFINITION(doCloseDocument()) DO_TRUE_DEFINITION(doDefineStyle(const AmiProStyle& style)) -DO_TRUE_DEFINITION(doParagraph(const QString& text, AmiProFormatList formatList, +DO_TRUE_DEFINITION(doParagraph(const TQString& text, AmiProFormatList formatList, AmiProLayout& )) diff --git a/filters/kword/amipro/amiproparser.h b/filters/kword/amipro/amiproparser.h index 0f2015bf..40a8f82b 100644 --- a/filters/kword/amipro/amiproparser.h +++ b/filters/kword/amipro/amiproparser.h @@ -20,10 +20,10 @@ #ifndef __AMIPROPARSER_H #define __AMIPROPARSER_H -class QString; -class QStringList; -#include <qvaluelist.h> -#include <qcolor.h> +class TQString; +class TQStringList; +#include <tqvaluelist.h> +#include <tqcolor.h> class AmiPro { @@ -40,9 +40,9 @@ class AmiProFormat bool bold, italic, underline; bool word_underline, double_underline; bool subscript, superscript, strikethrough; - QString fontFamily; + TQString fontFamily; float fontSize; - QColor fontColor; + TQColor fontColor; enum { Left, Right, Center, Justified } align; AmiProFormat(); AmiProFormat( const AmiProFormat& ); @@ -51,20 +51,20 @@ class AmiProFormat void applyStyle( const AmiProStyle& ); }; -typedef QValueList<AmiProFormat> AmiProFormatList; +typedef TQValueList<AmiProFormat> AmiProFormatList; class AmiProLayout { public: - QString name; - QString fontFamily; + TQString name; + TQString fontFamily; float fontSize; - QColor fontColor; + TQColor fontColor; bool bold, italic, underline; bool word_underline, double_underline; bool subscript, superscript, strikethrough; - Qt::AlignmentFlags align; + TQt::AlignmentFlags align; float linespace; float spaceBefore, spaceAfter; AmiProLayout(); @@ -77,14 +77,14 @@ class AmiProLayout class AmiProStyle { public: - QString name; - QString fontFamily; + TQString name; + TQString fontFamily; float fontSize; - QColor fontColor; + TQColor fontColor; bool bold, italic, underline; bool word_underline, double_underline; bool subscript, superscript, strikethrough; - Qt::AlignmentFlags align; + TQt::AlignmentFlags align; float linespace; float spaceBefore, spaceAfter; AmiProStyle(); @@ -93,7 +93,7 @@ class AmiProStyle void assign( const AmiProStyle& ); }; -typedef QValueList<AmiProStyle> AmiProStyleList; +typedef TQValueList<AmiProStyle> AmiProStyleList; class AmiProListener { @@ -103,8 +103,8 @@ class AmiProListener virtual bool doOpenDocument(); virtual bool doCloseDocument(); virtual bool doDefineStyle( const AmiProStyle& style ); - virtual bool doParagraph( const QString& text, AmiProFormatList formatList, - AmiProLayout& layout ); + virtual bool doParagraph( const TQString& text, AmiProFormatList formatList, + AmiProLayout& tqlayout ); }; class AmiProParser @@ -116,7 +116,7 @@ class AmiProParser enum { OK, UnknownError, FileError, InvalidFormat } Error; - bool process( const QString& filename ); + bool process( const TQString& filename ); int result(){ return m_result; } void setListener( AmiProListener * ); @@ -124,7 +124,7 @@ class AmiProParser private: int m_result; - QString m_text; + TQString m_text; AmiProFormat m_currentFormat; AmiProFormatList m_formatList; AmiProLayout m_layout; @@ -133,18 +133,18 @@ class AmiProParser AmiProListener *m_listener; - QString m_currentSection; + TQString m_currentSection; bool setResult( int ); - bool parseParagraph( const QStringList& lines ); - bool parseStyle( const QStringList& line ); - AmiProStyle findStyle( const QString& name ); + bool parseParagraph( const TQStringList& lines ); + bool parseStyle( const TQStringList& line ); + AmiProStyle findStyle( const TQString& name ); - bool handleTag( const QString& tag ); + bool handleTag( const TQString& tag ); bool processOpenDocument(); bool processCloseDocument(); - bool processParagraph( const QString& text, AmiProFormatList formatList, - AmiProLayout& layout ); + bool processParagraph( const TQString& text, AmiProFormatList formatList, + AmiProLayout& tqlayout ); }; diff --git a/filters/kword/applixword/applixwordimport.cc b/filters/kword/applixword/applixwordimport.cc index d172af50..17af6d88 100644 --- a/filters/kword/applixword/applixwordimport.cc +++ b/filters/kword/applixword/applixwordimport.cc @@ -23,8 +23,8 @@ #include <unistd.h> #endif -#include <qmessagebox.h> -#include <qptrlist.h> +#include <tqmessagebox.h> +#include <tqptrlist.h> #include <applixwordimport.h> #include <applixwordimport.moc> #include <kdebug.h> @@ -43,7 +43,7 @@ K_EXPORT_COMPONENT_FACTORY( libapplixwordimport, APPLIXWORDImportFactory( "koffi * * * * ******************************************************************************/ -APPLIXWORDImport::APPLIXWORDImport (KoFilter *, const char *, const QStringList& ) : +APPLIXWORDImport::APPLIXWORDImport (KoFilter *, const char *, const TQStringList& ) : KoFilter() { } @@ -56,10 +56,10 @@ APPLIXWORDImport::APPLIXWORDImport (KoFilter *, const char *, const QStringList& * * * * ******************************************************************************/ -QString -APPLIXWORDImport::nextLine (QTextStream & stream) +TQString +APPLIXWORDImport::nextLine (TQTextStream & stream) { - QString s; + TQString s; // Read one Line s = stream.readLine(); @@ -85,13 +85,13 @@ APPLIXWORDImport::nextLine (QTextStream & stream) * * * * ******************************************************************************/ -KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus APPLIXWORDImport::convert( const TQCString& from, const TQCString& to ) { if (to!="application/x-kword" || from!="application/x-applixword") return KoFilter::NotImplemented; - QFile in(m_chain->inputFile()); + TQFile in(m_chain->inputFile()); if (!in.open (IO_ReadOnly)) { kdError(30517) << "Unable to open input file!" << endl; @@ -100,7 +100,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons } - QString str; + TQString str; str += "<?xml version=\"1.0\"?>\n"; str += "<DOC author=\"Reginald Stadlbauer and Torben Weis\" email=\"reggie@kde.org and weis@kde.org\" editor=\"KWord\" mime=\"application/x-kword\">\n"; @@ -113,7 +113,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons str += " <FRAME left=\"28\" top=\"42\" right=\"566\" bottom=\"798\" runaround=\"1\" runaGapPT=\"2\" runaGapMM=\"1\" runaGapINCH=\"0.0393701\" lWidth=\"1\" lRed=\"255\" lGreen=\"255\" lBlue=\"255\" lStyle=\"0\" rWidth=\"1\" rRed=\"255\" rGreen=\"255\" rBlue=\"255\" rStyle=\"0\" tWidth=\"1\" tRed=\"255\" tGreen=\"255\" tBlue=\"255\" tStyle=\"0\" bWidth=\"1\" bRed=\"255\" bGreen=\"255\" bBlue=\"255\" bStyle=\"0\" bkRed=\"255\" bkGreen=\"255\" bkBlue=\"255\" bleftpt=\"0\" bleftmm=\"0\" bleftinch=\"0\" brightpt=\"0\" brightmm=\"0\" brightinch=\"0\" btoppt=\"0\" btopmm=\"0\" btopinch=\"0\" bbottompt=\"0\" bbottommm=\"0\" bbottominch=\"0\"/>\n"; - QTextStream stream (&in); + TQTextStream stream (&in); m_stepsize = in.size()/50; m_instep = 0; @@ -122,9 +122,9 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons int rueck; int pos, ok; char stylename[100]; - QString mystr, textstr; - QPtrList<t_mycolor> mcol; - QStringList mcoltxt; + TQString mystr, textstr; + TQPtrList<t_mycolor> mcol; + TQStringList mcoltxt; /************************************************************************** * Read header * @@ -145,7 +145,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons { printf ("Start styles\n"); t_mycolor *col = new t_mycolor; // delete is in place - QString coltxt ; + TQString coltxt ; int zaehler = 0; // Note: "zaehler" means "counter" in English do { @@ -160,7 +160,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons if (mystr.startsWith ("<color ")) { mystr.remove (0, 8); - pos = mystr.find ("\""); + pos = mystr.tqfind ("\""); coltxt = mystr.left (pos); mystr.remove (0,pos+1); rueck = sscanf ((const char *) mystr.latin1() , @@ -239,7 +239,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons **********************************************************************/ else if (mystr.startsWith ("<T ")) { - QString colname; + TQString colname; // Remove starting tab info mystr.remove (0, 4); @@ -252,13 +252,13 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons int y=0; do { - pos = mystr.find ("\"", y); + pos = mystr.tqfind ("\"", y); kdDebug(30517)<<"POS:"<<pos<<" length:"<< mystr.length()<<" y:"<<y <<endl; kdDebug(30517)<<"< "<<mystr<<" >\n"; if( (pos-1 > -1) && (mystr[pos-1] == '\\')) { - kdDebug(30517)<<" No string end - but Gänsefüsschen\n"; + kdDebug(30517)<<" No string end - but G�nsef�sschen\n"; y=pos+1; } else @@ -275,13 +275,13 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons kdDebug(30517) <<"Text:<" <<textstr <<" > "<< pos<<" Rest:<"<< mystr<<"> \n"; // split format - QStringList typeList; - typeList = QStringList::split (' ', mystr); + TQStringList typeList; + typeList = TQStringList::split (' ', mystr); int fontsize=12, bold=0, italic=0, underline=0, colpos=-1; - QString fontname; + TQString fontname; int nn=0; - for (QStringList::Iterator it = typeList.begin(); it != typeList.end(); ++it ) + for (TQStringList::Iterator it = typeList.begin(); it != typeList.end(); ++it ) { kdDebug(30517) <<" No: "<< nn<< " > "<< (*it)<< "< = \n"; @@ -334,7 +334,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons (*it).remove (0, 7); (*it).remove ((*it).length()-1, 1); colname = *it; - colpos = mcoltxt.findIndex (colname); + colpos = mcoltxt.tqfindIndex (colname); kdDebug(30517) <<" Color: "<< colname<<" "<< colpos <<" \n"; } else @@ -371,7 +371,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons if (fontsize != 1) { str += " <SIZE value=\""; - str += QString::number (fontsize); + str += TQString::number (fontsize); str += "\" />\n"; } @@ -396,11 +396,11 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons mc = mcol.at(colpos); str += " <COLOR red=\""; - str += QString::number (mc->r); + str += TQString::number (mc->r); str += "\" green=\""; - str += QString::number (mc->g); + str += TQString::number (mc->g); str += "\" blue=\""; - str += QString::number (mc->b); + str += TQString::number (mc->b); str += "\" />\n"; delete mc; } @@ -427,7 +427,7 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons return KoFilter::StorageCreationError; } - QCString cstring = str.utf8 (); + TQCString cstring = str.utf8 (); out->writeBlock ((const char*) cstring, cstring.length()); @@ -439,174 +439,174 @@ KoFilter::ConversionStatus APPLIXWORDImport::convert( const QCString& from, cons /****************************************************************************** * function: specCharfind * ******************************************************************************/ -QChar -APPLIXWORDImport::specCharfind (QChar a, QChar b) +TQChar +APPLIXWORDImport::specCharfind (TQChar a, TQChar b) { - QChar chr; + TQChar chr; - if ( (a == 'n') && (b == 'p') ) chr = 'ß'; + if ( (a == 'n') && (b == 'p') ) chr = '�'; - else if ( (a == 'n') && (b == 'c') ) chr = 'Ò'; - else if ( (a == 'p') && (b == 'c') ) chr = 'ò'; + else if ( (a == 'n') && (b == 'c') ) chr = '�'; + else if ( (a == 'p') && (b == 'c') ) chr = '�'; - else if ( (a == 'n') && (b == 'd') ) chr = 'Ó'; - else if ( (a == 'p') && (b == 'd') ) chr = 'ó'; + else if ( (a == 'n') && (b == 'd') ) chr = '�'; + else if ( (a == 'p') && (b == 'd') ) chr = '�'; - else if ( (a == 'n') && (b == 'e') ) chr = 'Ô'; - else if ( (a == 'p') && (b == 'e') ) chr = 'ô'; + else if ( (a == 'n') && (b == 'e') ) chr = '�'; + else if ( (a == 'p') && (b == 'e') ) chr = '�'; - else if ( (a == 'n') && (b == 'f') ) chr = 'Õ'; - else if ( (a == 'p') && (b == 'f') ) chr = 'õ'; + else if ( (a == 'n') && (b == 'f') ) chr = '�'; + else if ( (a == 'p') && (b == 'f') ) chr = '�'; - else if ( (a == 'p') && (b == 'g') ) chr = 'ö'; - else if ( (a == 'n') && (b == 'g') ) chr = 'Ö'; + else if ( (a == 'p') && (b == 'g') ) chr = '�'; + else if ( (a == 'n') && (b == 'g') ) chr = '�'; - else if ( (a == 'n') && (b == 'j') ) chr = 'Ù'; - else if ( (a == 'p') && (b == 'j') ) chr = 'ù'; + else if ( (a == 'n') && (b == 'j') ) chr = '�'; + else if ( (a == 'p') && (b == 'j') ) chr = '�'; - else if ( (a == 'n') && (b == 'k') ) chr = 'Ú'; - else if ( (a == 'p') && (b == 'k') ) chr = 'ú'; + else if ( (a == 'n') && (b == 'k') ) chr = '�'; + else if ( (a == 'p') && (b == 'k') ) chr = '�'; - else if ( (a == 'n') && (b == 'l') ) chr = 'Û'; - else if ( (a == 'p') && (b == 'l') ) chr = 'û'; + else if ( (a == 'n') && (b == 'l') ) chr = '�'; + else if ( (a == 'p') && (b == 'l') ) chr = '�'; - else if ( (a == 'p') && (b == 'm') ) chr = 'ü'; - else if ( (a == 'n') && (b == 'm') ) chr = 'Ü'; + else if ( (a == 'p') && (b == 'm') ) chr = '�'; + else if ( (a == 'n') && (b == 'm') ) chr = '�'; - else if ( (a == 'm') && (b == 'a') ) chr = 'À'; - else if ( (a == 'o') && (b == 'a') ) chr = 'à'; + else if ( (a == 'm') && (b == 'a') ) chr = '�'; + else if ( (a == 'o') && (b == 'a') ) chr = '�'; - else if ( (a == 'm') && (b == 'b') ) chr = 'Á'; - else if ( (a == 'o') && (b == 'b') ) chr = 'á'; + else if ( (a == 'm') && (b == 'b') ) chr = '�'; + else if ( (a == 'o') && (b == 'b') ) chr = '�'; - else if ( (a == 'm') && (b == 'c') ) chr = 'Â'; - else if ( (a == 'o') && (b == 'c') ) chr = 'â'; + else if ( (a == 'm') && (b == 'c') ) chr = '�'; + else if ( (a == 'o') && (b == 'c') ) chr = '�'; - else if ( (a == 'm') && (b == 'd') ) chr = 'Ã'; - else if ( (a == 'o') && (b == 'd') ) chr = 'ã'; + else if ( (a == 'm') && (b == 'd') ) chr = '�'; + else if ( (a == 'o') && (b == 'd') ) chr = '�'; - else if ( (a == 'm') && (b == 'e') ) chr = 'Ä'; - else if ( (a == 'o') && (b == 'e') ) chr = 'ä'; + else if ( (a == 'm') && (b == 'e') ) chr = '�'; + else if ( (a == 'o') && (b == 'e') ) chr = '�'; - else if ( (a == 'm') && (b == 'f') ) chr = 'Å'; - else if ( (a == 'o') && (b == 'f') ) chr = 'å'; + else if ( (a == 'm') && (b == 'f') ) chr = '�'; + else if ( (a == 'o') && (b == 'f') ) chr = '�'; - else if ( (a == 'm') && (b == 'g') ) chr = 'Æ'; - else if ( (a == 'o') && (b == 'g') ) chr = 'æ'; + else if ( (a == 'm') && (b == 'g') ) chr = '�'; + else if ( (a == 'o') && (b == 'g') ) chr = '�'; - else if ( (a == 'm') && (b == 'i') ) chr = 'È'; - else if ( (a == 'o') && (b == 'i') ) chr = 'è'; + else if ( (a == 'm') && (b == 'i') ) chr = '�'; + else if ( (a == 'o') && (b == 'i') ) chr = '�'; - else if ( (a == 'm') && (b == 'j') ) chr = 'É'; - else if ( (a == 'o') && (b == 'j') ) chr = 'é'; + else if ( (a == 'm') && (b == 'j') ) chr = '�'; + else if ( (a == 'o') && (b == 'j') ) chr = '�'; - else if ( (a == 'm') && (b == 'k') ) chr = 'Ê'; - else if ( (a == 'o') && (b == 'k') ) chr = 'ê'; + else if ( (a == 'm') && (b == 'k') ) chr = '�'; + else if ( (a == 'o') && (b == 'k') ) chr = '�'; - else if ( (a == 'm') && (b == 'l') ) chr = 'Ë'; - else if ( (a == 'o') && (b == 'l') ) chr = 'ë'; + else if ( (a == 'm') && (b == 'l') ) chr = '�'; + else if ( (a == 'o') && (b == 'l') ) chr = '�'; - else if ( (a == 'm') && (b == 'm') ) chr = 'Ì'; - else if ( (a == 'o') && (b == 'm') ) chr = 'ì'; + else if ( (a == 'm') && (b == 'm') ) chr = '�'; + else if ( (a == 'o') && (b == 'm') ) chr = '�'; - else if ( (a == 'm') && (b == 'n') ) chr = 'Í'; - else if ( (a == 'o') && (b == 'n') ) chr = 'í'; + else if ( (a == 'm') && (b == 'n') ) chr = '�'; + else if ( (a == 'o') && (b == 'n') ) chr = '�'; - else if ( (a == 'm') && (b == 'o') ) chr = 'Î'; - else if ( (a == 'o') && (b == 'o') ) chr = 'î'; + else if ( (a == 'm') && (b == 'o') ) chr = '�'; + else if ( (a == 'o') && (b == 'o') ) chr = '�'; - else if ( (a == 'm') && (b == 'p') ) chr = 'Ï'; - else if ( (a == 'o') && (b == 'p') ) chr = 'ï'; + else if ( (a == 'm') && (b == 'p') ) chr = '�'; + else if ( (a == 'o') && (b == 'p') ) chr = '�'; - else if ( (a == 'n') && (b == 'b') ) chr = 'Ñ'; - else if ( (a == 'p') && (b == 'b') ) chr = 'ñ'; + else if ( (a == 'n') && (b == 'b') ) chr = '�'; + else if ( (a == 'p') && (b == 'b') ) chr = '�'; - else if ( (a == 'k') && (b == 'c') ) chr = '¢'; - else if ( (a == 'k') && (b == 'j') ) chr = '©'; - else if ( (a == 'l') && (b == 'f') ) chr = 'µ'; - else if ( (a == 'n') && (b == 'i') ) chr = 'Ø'; - else if ( (a == 'p') && (b == 'i') ) chr = 'ø'; + else if ( (a == 'k') && (b == 'c') ) chr = '�'; + else if ( (a == 'k') && (b == 'j') ) chr = '�'; + else if ( (a == 'l') && (b == 'f') ) chr = '�'; + else if ( (a == 'n') && (b == 'i') ) chr = '�'; + else if ( (a == 'p') && (b == 'i') ) chr = '�'; - else if ( (a == 'l') && (b == 'j') ) chr = '¹'; - else if ( (a == 'l') && (b == 'c') ) chr = '²'; - else if ( (a == 'l') && (b == 'd') ) chr = '³'; + else if ( (a == 'l') && (b == 'j') ) chr = '�'; + else if ( (a == 'l') && (b == 'c') ) chr = '�'; + else if ( (a == 'l') && (b == 'd') ) chr = '�'; - else if ( (a == 'l') && (b == 'm') ) chr = '¼'; - else if ( (a == 'l') && (b == 'n') ) chr = '½'; - else if ( (a == 'l') && (b == 'o') ) chr = '¾'; + else if ( (a == 'l') && (b == 'm') ) chr = '�'; + else if ( (a == 'l') && (b == 'n') ) chr = '�'; + else if ( (a == 'l') && (b == 'o') ) chr = '�'; - else if ( (a == 'l') && (b == 'a') ) chr = '°'; + else if ( (a == 'l') && (b == 'a') ) chr = '�'; - else if ( (a == 'k') && (b == 'o') ) chr = '®'; - else if ( (a == 'k') && (b == 'h') ) chr = '§'; - else if ( (a == 'k') && (b == 'd') ) chr = '£'; + else if ( (a == 'k') && (b == 'o') ) chr = '�'; + else if ( (a == 'k') && (b == 'h') ) chr = '�'; + else if ( (a == 'k') && (b == 'd') ) chr = '�'; - else if ( (a == 'p') && (b == 'a') ) chr = 'ð'; - else if ( (a == 'n') && (b == 'a') ) chr = 'Ð'; + else if ( (a == 'p') && (b == 'a') ) chr = '�'; + else if ( (a == 'n') && (b == 'a') ) chr = '�'; - else if ( (a == 'l') && (b == 'l') ) chr = '»'; - else if ( (a == 'k') && (b == 'l') ) chr = '«'; + else if ( (a == 'l') && (b == 'l') ) chr = '�'; + else if ( (a == 'k') && (b == 'l') ) chr = '�'; - else if ( (a == 'l') && (b == 'k') ) chr = 'º'; + else if ( (a == 'l') && (b == 'k') ) chr = '�'; - else if ( (a == 'l') && (b == 'h') ) chr = '·'; + else if ( (a == 'l') && (b == 'h') ) chr = '�'; - else if ( (a == 'k') && (b == 'b') ) chr = '¡'; + else if ( (a == 'k') && (b == 'b') ) chr = '�'; - else if ( (a == 'k') && (b == 'e') ) chr = '¤'; + else if ( (a == 'k') && (b == 'e') ) chr = '�'; - else if ( (a == 'l') && (b == 'b') ) chr = '±'; + else if ( (a == 'l') && (b == 'b') ) chr = '�'; - else if ( (a == 'l') && (b == 'p') ) chr = '¿'; + else if ( (a == 'l') && (b == 'p') ) chr = '�'; - else if ( (a == 'k') && (b == 'f') ) chr = '¥'; + else if ( (a == 'k') && (b == 'f') ) chr = '�'; - else if ( (a == 'p') && (b == 'o') ) chr = 'þ'; - else if ( (a == 'n') && (b == 'o') ) chr = 'Þ'; + else if ( (a == 'p') && (b == 'o') ) chr = '�'; + else if ( (a == 'n') && (b == 'o') ) chr = '�'; - else if ( (a == 'n') && (b == 'n') ) chr = 'Ý'; - else if ( (a == 'p') && (b == 'n') ) chr = 'ý'; - else if ( (a == 'p') && (b == 'p') ) chr = 'ÿ'; + else if ( (a == 'n') && (b == 'n') ) chr = '�'; + else if ( (a == 'p') && (b == 'n') ) chr = '�'; + else if ( (a == 'p') && (b == 'p') ) chr = '�'; - else if ( (a == 'k') && (b == 'k') ) chr = 'ª'; + else if ( (a == 'k') && (b == 'k') ) chr = '�'; - else if ( (a == 'k') && (b == 'm') ) chr = '¬'; - else if ( (a == 'p') && (b == 'h') ) chr = '÷'; + else if ( (a == 'k') && (b == 'm') ) chr = '�'; + else if ( (a == 'p') && (b == 'h') ) chr = '�'; else if ( (a == 'k') && (b == 'g') ) chr = '|'; else if ( (a == 'l') && (b == 'e') ) chr = '\''; - else if ( (a == 'k') && (b == 'i') ) chr = '¨'; + else if ( (a == 'k') && (b == 'i') ) chr = '�'; - else if ( (a == 'k') && (b == 'n') ) chr = ''; + else if ( (a == 'k') && (b == 'n') ) chr = '�'; - else if ( (a == 'k') && (b == 'p') ) chr = '¯'; + else if ( (a == 'k') && (b == 'p') ) chr = '�'; - else if ( (a == 'l') && (b == 'g') ) chr = '¶'; + else if ( (a == 'l') && (b == 'g') ) chr = '�'; - else if ( (a == 'l') && (b == 'i') ) chr = '¸'; + else if ( (a == 'l') && (b == 'i') ) chr = '�'; - else if ( (a == 'm') && (b == 'h') ) chr = 'Ç'; - else if ( (a == 'o') && (b == 'h') ) chr = 'ç'; + else if ( (a == 'm') && (b == 'h') ) chr = '�'; + else if ( (a == 'o') && (b == 'h') ) chr = '�'; - else if ( (a == 'n') && (b == 'h') ) chr = '×'; + else if ( (a == 'n') && (b == 'h') ) chr = '�'; - else if ( (a == 'k') && (b == 'a') ) chr = ' '; + else if ( (a == 'k') && (b == 'a') ) chr = '�'; else if ( (a == 'a') && (b == 'j') ) chr = '!'; @@ -625,10 +625,10 @@ APPLIXWORDImport::specCharfind (QChar a, QChar b) * * * * ******************************************************************************/ -QString -APPLIXWORDImport::readTagLine (QTextStream &stream, QFile &in) +TQString +APPLIXWORDImport::readTagLine (TQTextStream &stream, TQFile &in) { - QString mystrn, mystr; + TQString mystrn, mystr; int ok, pos; // Read one line @@ -686,14 +686,14 @@ APPLIXWORDImport::readTagLine (QTextStream &stream, QFile &in) * * ******************************************************************************/ void -APPLIXWORDImport::replaceSpecial (QString &textstr) +APPLIXWORDImport::replaceSpecial (TQString &textstr) { int ok, pos; // 1. Replace Part for this characters: <, >, & - textstr.replace ('&', "&"); - textstr.replace ('<', "<"); - textstr.replace ('>', ">"); + textstr.tqreplace ('&', "&"); + textstr.tqreplace ('<', "<"); + textstr.tqreplace ('>', ">"); // 2. Replace part for this characters: applixwear qoutes @@ -702,12 +702,12 @@ APPLIXWORDImport::replaceSpecial (QString &textstr) do { // Searching for an quote - pos = textstr.find ('\"', pos); + pos = textstr.tqfind ('\"', pos); // Is it an textqoute ? if ((pos > -1) && (textstr[pos-1] == '\\')) { - textstr.replace (pos-1, 2,"\""); + textstr.tqreplace (pos-1, 2,"\""); } else { @@ -720,14 +720,14 @@ APPLIXWORDImport::replaceSpecial (QString &textstr) // 3. Replace part for Applix Characters int foundSpecialCharakter; - QChar newchar; + TQChar newchar; do { // initialize foundSpecialCharakter = false; - pos = textstr.find ("^"); + pos = textstr.tqfind ("^"); // is there a special character ? if (pos > -1 ) @@ -739,7 +739,7 @@ APPLIXWORDImport::replaceSpecial (QString &textstr) newchar = specCharfind (textstr[pos+1], textstr[pos+2]); // replace the character - textstr.replace (pos, 3, newchar); + textstr.tqreplace (pos, 3, newchar); } } while (foundSpecialCharakter == true); @@ -756,9 +756,9 @@ APPLIXWORDImport::replaceSpecial (QString &textstr) * * ******************************************************************************/ int -APPLIXWORDImport::readHeader (QTextStream &stream, QFile &in) +APPLIXWORDImport::readHeader (TQTextStream &stream, TQFile &in) { - QString mystr; + TQString mystr; int rueck; int vers[3] = { 0, 0, 0 }; @@ -777,13 +777,13 @@ APPLIXWORDImport::readHeader (QTextStream &stream, QFile &in) printf ("Header not correkt - May be it is not an applixword file\n"); printf ("Headerline: <%s>\n", (const char *) mystr.latin1()); - QMessageBox::critical (0L, "Applixword header problem", - QString ("The Applixword header is not correct. " + TQMessageBox::critical (0L, "Applixword header problem", + TQString ("The Applixword header is not correct. " "May be it is not an applixword file! <BR>" - "This is the header line I did read:<BR><B>%1</B>").arg(mystr.latin1()), + "This is the header line I did read:<BR><B>%1</B>").tqarg(mystr.latin1()), "Okay"); - // i18n( "What is the separator used in this file ? First line is \n%1" ).arg(firstLine), + // i18n( "What is the separator used in this file ? First line is \n%1" ).tqarg(firstLine), return false; } else return true; diff --git a/filters/kword/applixword/applixwordimport.h b/filters/kword/applixword/applixwordimport.h index 50532fa5..f82066ec 100644 --- a/filters/kword/applixword/applixwordimport.h +++ b/filters/kword/applixword/applixwordimport.h @@ -20,11 +20,11 @@ #ifndef APPLIXWORDIMPORT_H #define APPLIXWORDIMPORT_H -#include <qstring.h> -#include <qstringlist.h> -#include <qfile.h> -#include <qobject.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqfile.h> +#include <tqobject.h> +#include <tqtextstream.h> #include <KoFilter.h> #include <KoStore.h> @@ -44,19 +44,20 @@ typedef struct class APPLIXWORDImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - APPLIXWORDImport(KoFilter *parent, const char *name, const QStringList&); + APPLIXWORDImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~APPLIXWORDImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); protected: - QChar specCharfind (QChar , QChar ); - QString readTagLine (QTextStream &, QFile &); - void replaceSpecial (QString &); - QString nextLine (QTextStream &); - int readHeader (QTextStream &stream, QFile &); + TQChar specCharfind (TQChar , TQChar ); + TQString readTagLine (TQTextStream &, TQFile &); + void replaceSpecial (TQString &); + TQString nextLine (TQTextStream &); + int readHeader (TQTextStream &stream, TQFile &); private: int m_stepsize; diff --git a/filters/kword/ascii/ExportDialog.cc b/filters/kword/ascii/ExportDialog.cc index 8e758282..1d408b18 100644 --- a/filters/kword/ascii/ExportDialog.cc +++ b/filters/kword/ascii/ExportDialog.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qtextcodec.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> +#include <tqtextcodec.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> #include <kdebug.h> #include <klocale.h> @@ -33,22 +33,22 @@ #include <ExportDialogUI.h> #include <ExportDialog.h> -AsciiExportDialog :: AsciiExportDialog(QWidget* parent) - : KDialogBase(parent, 0, true, i18n("KWord's Plain Text Export Filter"), Ok|Cancel, No, true), +AsciiExportDialog :: AsciiExportDialog(TQWidget* tqparent) + : KDialogBase(tqparent, 0, true, i18n("KWord's Plain Text Export Filter"), Ok|Cancel, No, true), m_dialog(new ExportDialogUI(this)) { kapp->restoreOverrideCursor(); - QStringList encodings; - encodings << i18n( "Descriptive encoding name", "Recommended ( %1 )" ).arg( "UTF-8" ); - encodings << i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( QTextCodec::codecForLocale()->name() ); + TQStringList encodings; + encodings << i18n( "Descriptive encoding name", "Recommended ( %1 )" ).tqarg( "UTF-8" ); + encodings << i18n( "Descriptive encoding name", "Locale ( %1 )" ).tqarg( TQTextCodec::codecForLocale()->name() ); encodings += KGlobal::charsets()->descriptiveEncodingNames(); // Add a few non-standard encodings, which might be useful for text files - const QString description(i18n("Descriptive encoding name","Other ( %1 )")); - encodings << description.arg("Apple Roman"); // Apple - encodings << description.arg("IBM 850") << description.arg("IBM 866"); // MS DOS - encodings << description.arg("CP 1258"); // Windows + const TQString description(i18n("Descriptive encoding name","Other ( %1 )")); + encodings << description.tqarg("Apple Roman"); // Apple + encodings << description.tqarg("IBM 850") << description.tqarg("IBM 866"); // MS DOS + encodings << description.tqarg("CP 1258"); // Windows m_dialog->comboBoxEncoding->insertStringList(encodings); @@ -58,18 +58,18 @@ AsciiExportDialog :: AsciiExportDialog(QWidget* parent) AsciiExportDialog :: ~AsciiExportDialog(void) { - kapp->setOverrideCursor(Qt::waitCursor); + kapp->setOverrideCursor(TQt::waitCursor); } -QTextCodec* AsciiExportDialog::getCodec(void) const +TQTextCodec* AsciiExportDialog::getCodec(void) const { - const QString strCodec( KGlobal::charsets()->encodingForName( m_dialog->comboBoxEncoding->currentText() ) ); + const TQString strCodec( KGlobal::charsets()->encodingForName( m_dialog->comboBoxEncoding->currentText() ) ); kdDebug(30502) << "Encoding: " << strCodec << endl; bool ok = false; - QTextCodec* codec = QTextCodec::codecForName( strCodec.utf8() ); + TQTextCodec* codec = TQTextCodec::codecForName( strCodec.utf8() ); - // If QTextCodec has not found a valid encoding, so try with KCharsets. + // If TQTextCodec has not found a valid encoding, so try with KCharsets. if ( codec ) { ok = true; @@ -84,17 +84,17 @@ QTextCodec* AsciiExportDialog::getCodec(void) const { // Default: UTF-8 kdWarning(30502) << "Cannot find encoding:" << strCodec << endl; - // ### TODO: what parent to use? - KMessageBox::error( 0, i18n("Cannot find encoding: %1").arg( strCodec ) ); + // ### TODO: what tqparent to use? + KMessageBox::error( 0, i18n("Cannot find encoding: %1").tqarg( strCodec ) ); return 0; } return codec; } -QString AsciiExportDialog::getEndOfLine(void) const +TQString AsciiExportDialog::getEndOfLine(void) const { - QString strReturn; + TQString strReturn; if (m_dialog->radioEndOfLineLF==m_dialog->buttonGroupEndOfLine->selected()) strReturn="\n"; else if (m_dialog->radioEndOfLineCRLF==m_dialog->buttonGroupEndOfLine->selected()) diff --git a/filters/kword/ascii/ExportDialog.h b/filters/kword/ascii/ExportDialog.h index 6405cb88..2d75df8e 100644 --- a/filters/kword/ascii/ExportDialog.h +++ b/filters/kword/ascii/ExportDialog.h @@ -21,7 +21,7 @@ #ifndef EXPORT_DIALOG_H #define EXPORT_DIALOG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> @@ -30,12 +30,13 @@ class ExportDialogUI; class AsciiExportDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - AsciiExportDialog(QWidget* parent=NULL); + AsciiExportDialog(TQWidget* tqparent=NULL); ~AsciiExportDialog(void); - QString getEndOfLine(void) const; - QTextCodec* getCodec(void) const; + TQString getEndOfLine(void) const; + TQTextCodec* getCodec(void) const; private: ExportDialogUI* m_dialog; }; diff --git a/filters/kword/ascii/ExportDialogUI.ui b/filters/kword/ascii/ExportDialogUI.ui index 3e3a45f4..2cef87d5 100644 --- a/filters/kword/ascii/ExportDialogUI.ui +++ b/filters/kword/ascii/ExportDialogUI.ui @@ -2,7 +2,7 @@ <class>ExportDialogUI</class> <comment>Export dialog for KWord's plain text export filter</comment> <author>Nicolas GOUTTE <goutte@kde.org></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ExportDialogUI</cstring> </property> @@ -27,15 +27,15 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -67,7 +67,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>106</width> <height>20</height> @@ -76,7 +76,7 @@ </spacer> </hbox> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroupEndOfLine</cstring> </property> @@ -93,7 +93,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioEndOfLineLF</cstring> </property> @@ -104,7 +104,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioEndOfLineCRLF</cstring> </property> @@ -115,7 +115,7 @@ <bool>false</bool> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioEndOfLineCR</cstring> </property> @@ -138,7 +138,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -152,7 +152,7 @@ <tabstop>radioEndOfLineCRLF</tabstop> <tabstop>radioEndOfLineCR</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>klineedit.h</includehint> diff --git a/filters/kword/ascii/ImportDialog.cc b/filters/kword/ascii/ImportDialog.cc index ae20409a..4bcccc58 100644 --- a/filters/kword/ascii/ImportDialog.cc +++ b/filters/kword/ascii/ImportDialog.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qtextcodec.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> +#include <tqtextcodec.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> #include <klocale.h> #include <kcharsets.h> @@ -33,22 +33,22 @@ #include <ImportDialogUI.h> #include <ImportDialog.h> -AsciiImportDialog :: AsciiImportDialog(QWidget* parent) - : KDialogBase(parent, 0, true, i18n("KWord's Plain Text Import Filter"), Ok|Cancel, No, true), +AsciiImportDialog :: AsciiImportDialog(TQWidget* tqparent) + : KDialogBase(tqparent, 0, true, i18n("KWord's Plain Text Import Filter"), Ok|Cancel, No, true), m_dialog(new ImportDialogUI(this)) { kapp->restoreOverrideCursor(); - QStringList encodings; - encodings << i18n( "Descriptive encoding name", "Recommended ( %1 )" ).arg( "UTF-8" ); - encodings << i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( QTextCodec::codecForLocale()->name() ); + TQStringList encodings; + encodings << i18n( "Descriptive encoding name", "Recommended ( %1 )" ).tqarg( "UTF-8" ); + encodings << i18n( "Descriptive encoding name", "Locale ( %1 )" ).tqarg( TQTextCodec::codecForLocale()->name() ); encodings += KGlobal::charsets()->descriptiveEncodingNames(); // Add a few non-standard encodings, which might be useful for text files - const QString description(i18n("Descriptive encoding name","Other ( %1 )")); - encodings << description.arg("Apple Roman"); // Apple - encodings << description.arg("IBM 850") << description.arg("IBM 866"); // MS DOS - encodings << description.arg("CP 1258"); // Windows + const TQString description(i18n("Descriptive encoding name","Other ( %1 )")); + encodings << description.tqarg("Apple Roman"); // Apple + encodings << description.tqarg("IBM 850") << description.tqarg("IBM 866"); // MS DOS + encodings << description.tqarg("CP 1258"); // Windows m_dialog->comboBoxEncoding->insertStringList(encodings); @@ -57,18 +57,18 @@ AsciiImportDialog :: AsciiImportDialog(QWidget* parent) AsciiImportDialog :: ~AsciiImportDialog(void) { - kapp->setOverrideCursor(Qt::waitCursor); + kapp->setOverrideCursor(TQt::waitCursor); } -QTextCodec* AsciiImportDialog::getCodec(void) const +TQTextCodec* AsciiImportDialog::getCodec(void) const { - const QString strCodec( KGlobal::charsets()->encodingForName( m_dialog->comboBoxEncoding->currentText() ) ); + const TQString strCodec( KGlobal::charsets()->encodingForName( m_dialog->comboBoxEncoding->currentText() ) ); kdDebug(30502) << "Encoding: " << strCodec << endl; bool ok = false; - QTextCodec* codec = QTextCodec::codecForName( strCodec.utf8() ); + TQTextCodec* codec = TQTextCodec::codecForName( strCodec.utf8() ); - // If QTextCodec has not found a valid encoding, so try with KCharsets. + // If TQTextCodec has not found a valid encoding, so try with KCharsets. if ( codec ) { ok = true; @@ -83,8 +83,8 @@ QTextCodec* AsciiImportDialog::getCodec(void) const { // Default: UTF-8 kdWarning(30502) << "Cannot find encoding:" << strCodec << endl; - // ### TODO: what parent to use? - KMessageBox::error( 0, i18n("Cannot find encoding: %1").arg( strCodec ) ); + // ### TODO: what tqparent to use? + KMessageBox::error( 0, i18n("Cannot find encoding: %1").tqarg( strCodec ) ); return 0; } diff --git a/filters/kword/ascii/ImportDialog.h b/filters/kword/ascii/ImportDialog.h index 22bbaa57..929aa8fc 100644 --- a/filters/kword/ascii/ImportDialog.h +++ b/filters/kword/ascii/ImportDialog.h @@ -21,7 +21,7 @@ #ifndef _IMPORT_DIALOG_H #define _IMPORT_DIALOG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> @@ -30,10 +30,11 @@ class ImportDialogUI; class AsciiImportDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - AsciiImportDialog(QWidget* parent=NULL); + AsciiImportDialog(TQWidget* tqparent=NULL); ~AsciiImportDialog(void); - QTextCodec* getCodec(void) const; + TQTextCodec* getCodec(void) const; int getParagraphStrategy(void) const; private: ImportDialogUI* m_dialog; diff --git a/filters/kword/ascii/ImportDialogUI.ui b/filters/kword/ascii/ImportDialogUI.ui index cbfe1cd4..a67a43c2 100644 --- a/filters/kword/ascii/ImportDialogUI.ui +++ b/filters/kword/ascii/ImportDialogUI.ui @@ -2,7 +2,7 @@ <class>ImportDialogUI</class> <comment>Import dialog for KWord's plain text import filter</comment> <author>Nicolas GOUTTE <goutte@kde.org></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ImportDialogUI</cstring> </property> @@ -27,15 +27,15 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -67,7 +67,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>106</width> <height>20</height> @@ -76,7 +76,7 @@ </spacer> </hbox> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroupParagraph</cstring> </property> @@ -93,7 +93,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioParagraphAsIs</cstring> </property> @@ -104,7 +104,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioParagraphSentence</cstring> </property> @@ -112,7 +112,7 @@ <string>&Sentence: If the end of line is the end of a sentence</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioParagraphOldWay</cstring> </property> @@ -132,7 +132,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -141,7 +141,7 @@ </spacer> </vbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>klineedit.h</includehint> diff --git a/filters/kword/ascii/asciiexport.cc b/filters/kword/ascii/asciiexport.cc index 09b22dec..04b7f451 100644 --- a/filters/kword/ascii/asciiexport.cc +++ b/filters/kword/ascii/asciiexport.cc @@ -24,12 +24,12 @@ #include <limits.h> -#include <qcstring.h> -#include <qfile.h> -#include <qiodevice.h> -#include <qstring.h> -#include <qtextcodec.h> -#include <qtextstream.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqiodevice.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqtextstream.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -77,38 +77,38 @@ public: } public: - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); // Close file in normal conditions virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraphList(const QValueList<ParaData>& paraList); + virtual bool doFullParagraphList(const TQValueList<ParaData>& paraList); virtual bool doFullParagraph(const ParaData& para); - virtual bool doFullParagraph(const QString& paraText, - const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, + const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); public: - QString getEndOfLine(void) const { return m_eol; } - void setEndOfLine(const QString& str) { m_eol = str; } + TQString getEndOfLine(void) const { return m_eol; } + void setEndOfLine(const TQString& str) { m_eol = str; } - QTextCodec* getCodec(void) const { return m_codec; } - void setCodec(QTextCodec* codec) { m_codec = codec; } + TQTextCodec* getCodec(void) const { return m_codec; } + void setCodec(TQTextCodec* codec) { m_codec = codec; } private: virtual bool ProcessTable(const Table& table); - virtual bool ProcessParagraphData (const QString& paraText, + virtual bool ProcessParagraphData (const TQString& paraText, const ValueListFormatData& paraFormatDataList); private: - QIODevice* m_ioDevice; - QTextStream* m_streamOut; + TQIODevice* m_ioDevice; + TQTextStream* m_streamOut; - QTextCodec* m_codec; // QTextCodec in which the file will be written - QString m_eol; // End of line character(s) - QStringList m_automaticNotes; // Automatic foot-/endnotes - QString m_manualNotes; // Manual foot-/endnotes + TQTextCodec* m_codec; // TQTextCodec in which the file will be written + TQString m_eol; // End of line character(s) + TQStringList m_automaticNotes; // Automatic foot-/endnotes + TQString m_manualNotes; // Manual foot-/endnotes #if 0 CounterData::Style m_typeList; // What is the style of the current list (undefined, if we are not in a list) @@ -118,9 +118,9 @@ private: #endif }; -bool ASCIIWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool ASCIIWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { - m_ioDevice = new QFile(filenameOut); + m_ioDevice = TQT_TQIODEVICE(new TQFile(filenameOut)); if (!m_ioDevice) { @@ -134,7 +134,7 @@ bool ASCIIWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) return false; } - m_streamOut = new QTextStream(m_ioDevice); + m_streamOut = new TQTextStream(m_ioDevice); if (!m_streamOut) { kdError(30502) << "Could not create output stream! Aborting!" << endl; @@ -146,7 +146,7 @@ bool ASCIIWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) if (!getCodec()) { - kdError(30502) << "Could not create QTextCodec! Aborting" << endl; + kdError(30502) << "Could not create TQTextCodec! Aborting" << endl; return false; } @@ -177,7 +177,7 @@ bool ASCIIWorker::doCloseDocument(void) { *m_streamOut << m_eol; int noteNumber = 1; - for (QStringList::Iterator it = m_automaticNotes.begin(); it != m_automaticNotes.end(); ++it) + for (TQStringList::Iterator it = m_automaticNotes.begin(); it != m_automaticNotes.end(); ++it) { *m_streamOut << "[" << noteNumber << "] " << *it; noteNumber++; @@ -190,9 +190,9 @@ bool ASCIIWorker::doCloseDocument(void) return true; } -bool ASCIIWorker::doFullParagraphList(const QValueList<ParaData>& paraList) +bool ASCIIWorker::doFullParagraphList(const TQValueList<ParaData>& paraList) { - for (QValueList<ParaData>::ConstIterator it = paraList.begin(); + for (TQValueList<ParaData>::ConstIterator it = paraList.begin(); it != paraList.end(); it++) { @@ -204,10 +204,10 @@ bool ASCIIWorker::doFullParagraphList(const QValueList<ParaData>& paraList) bool ASCIIWorker::doFullParagraph(const ParaData& para) { - return doFullParagraph(para.text, para.layout, para.formattingList); + return doFullParagraph(para.text, para.tqlayout, para.formattingList); } -bool ASCIIWorker::doFullParagraph(const QString& paraText, const LayoutData& layout, +bool ASCIIWorker::doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { kdDebug(30502) << "Entering ASCIIWorker::doFullParagraph" << endl; @@ -216,15 +216,15 @@ bool ASCIIWorker::doFullParagraph(const QString& paraText, const LayoutData& lay // As KWord has only one depth of lists, we can process lists very simply. // -- // Not anymore - Clarence - if ( layout.counter.numbering == CounterData::NUM_LIST ) + if ( tqlayout.counter.numbering == CounterData::NUM_LIST ) { // Are we still in a list of the right type? - if (!m_inList || (layout.counter.style!=m_typeList)) + if (!m_inList || (tqlayout.counter.style!=m_typeList)) { // We are not yet part of a list m_inList=true; m_counterList=1; // Start numbering - m_typeList=layout.counter.style; + m_typeList=tqlayout.counter.style; } switch (m_typeList) @@ -265,24 +265,24 @@ bool ASCIIWorker::doFullParagraph(const QString& paraText, const LayoutData& lay case CounterData::STYLE_CUSTOM: { m_orderedList=true; - *m_streamOut << QString::number(m_counterList,10); + *m_streamOut << TQString::number(m_counterList,10); break; } case CounterData::STYLE_ALPHAB_L: { m_orderedList=true; - QString strTemp; + TQString strTemp; for (int i=m_counterList;i>0;i/=26) - strTemp=QChar(0x40+i%26)+strTemp; // Lower alpha + strTemp=TQChar(0x40+i%26)+strTemp; // Lower alpha *m_streamOut << strTemp; break; } case CounterData::STYLE_ALPHAB_U: { m_orderedList=true; - QString strTemp; + TQString strTemp; for (int i=m_counterList;i>0;i/=26) - strTemp=QChar(0x40+i%26)+strTemp; // Lower alpha + strTemp=TQChar(0x40+i%26)+strTemp; // Lower alpha *m_streamOut << strTemp; break; } @@ -290,14 +290,14 @@ bool ASCIIWorker::doFullParagraph(const QString& paraText, const LayoutData& lay { // For now, we do not support lower-case Roman numbering (TODO) m_orderedList=true; - *m_streamOut << QString::number(m_counterList,10); + *m_streamOut << TQString::number(m_counterList,10); break; } case CounterData::STYLE_ROM_NUM_U: { // For now, we do not support upper-case Roman numbering (TODO) m_orderedList=true; - *m_streamOut << QString::number(m_counterList,10); + *m_streamOut << TQString::number(m_counterList,10); break; } } @@ -307,26 +307,26 @@ bool ASCIIWorker::doFullParagraph(const QString& paraText, const LayoutData& lay else { m_inList=false; // Close an eventual list - if ( layout.counter.numbering == CounterData::NUM_CHAPTER ) + if ( tqlayout.counter.numbering == CounterData::NUM_CHAPTER ) { - if (!layout.counter.depth) + if (!tqlayout.counter.depth) { // HEAD 1 *m_streamOut << "###################################" << m_eol; *m_streamOut << "# "; ProcessParagraphData ( paraText, paraFormatDataList); *m_streamOut << "###################################" << m_eol; } - else if (layout.counter.depth==1) + else if (tqlayout.counter.depth==1) { // HEAD 2 *m_streamOut << "#### "; ProcessParagraphData ( paraText, paraFormatDataList); } - else if (layout.counter.depth==2) + else if (tqlayout.counter.depth==2) { // HEAD 3 *m_streamOut << "## "; ProcessParagraphData ( paraText, paraFormatDataList); } - else if (layout.counter.depth==3) + else if (tqlayout.counter.depth==3) { // HEAD 4 *m_streamOut << "# "; ProcessParagraphData ( paraText, paraFormatDataList); @@ -342,8 +342,8 @@ bool ASCIIWorker::doFullParagraph(const QString& paraText, const LayoutData& lay } } #else - if (!layout.counter.text.isEmpty()) - *m_streamOut << layout.counter.text << " "; + if (!tqlayout.counter.text.isEmpty()) + *m_streamOut << tqlayout.counter.text << " "; if (!ProcessParagraphData(paraText, paraFormatDataList)) return false; #endif @@ -357,8 +357,8 @@ bool ASCIIWorker::ProcessTable(const Table& table) { kdDebug(30502) << "processTable CALLED!" << endl; - // just dump the table out (no layout for now) - for (QValueList<TableCell>::ConstIterator it = table.cellList.begin(); + // just dump the table out (no tqlayout for now) + for (TQValueList<TableCell>::ConstIterator it = table.cellList.begin(); it != table.cellList.end(); it++) { @@ -371,7 +371,7 @@ bool ASCIIWorker::ProcessTable(const Table& table) // ProcessParagraphData () mangles the pure text through the // formatting information stored in the FormatData list and prints it // out to the export file. -bool ASCIIWorker::ProcessParagraphData(const QString& paraText, +bool ASCIIWorker::ProcessParagraphData(const TQString& paraText, const ValueListFormatData& paraFormatDataList) { bool lastSegmentWasText = true; @@ -390,8 +390,8 @@ bool ASCIIWorker::ProcessParagraphData(const QString& paraText, { case 1: // Normal text { - QString strText(paraText.mid((*paraFormatDataIt).pos,(*paraFormatDataIt).len)); - strText = strText.replace(QChar(10), m_eol, true); + TQString strText(paraText.mid((*paraFormatDataIt).pos,(*paraFormatDataIt).len)); + strText = strText.tqreplace(TQChar(10), m_eol, true); *m_streamOut << strText; break; } @@ -400,16 +400,16 @@ bool ASCIIWorker::ProcessParagraphData(const QString& paraText, if (11==(*paraFormatDataIt).variable.m_type) { // Footnote - QString value = (*paraFormatDataIt).variable.getFootnoteValue(); + TQString value = (*paraFormatDataIt).variable.getFootnoteValue(); bool automatic = (*paraFormatDataIt).variable.getFootnoteAuto(); - QValueList<ParaData> *paraList = (*paraFormatDataIt).variable.getFootnotePara(); + TQValueList<ParaData> *paraList = (*paraFormatDataIt).variable.getFootnotePara(); if (paraList) { - QString notestr; - QValueList<ParaData>::ConstIterator it; - QValueList<ParaData>::ConstIterator end(paraList->end()); + TQString notestr; + TQValueList<ParaData>::ConstIterator it; + TQValueList<ParaData>::ConstIterator end(paraList->end()); for (it=paraList->begin();it!=end;++it) - notestr += (*it).text.stripWhiteSpace().replace(QChar(10), m_eol, true) + m_eol; + notestr += (*it).text.stripWhiteSpace().tqreplace(TQChar(10), m_eol, true) + m_eol; *m_streamOut << "["; if (automatic) { @@ -469,12 +469,12 @@ bool ASCIIWorker::ProcessParagraphData(const QString& paraText, } -ASCIIExport::ASCIIExport(KoFilter*, const char*, const QStringList&) +ASCIIExport::ASCIIExport(KoFilter*, const char*, const TQStringList&) : KoFilter() { } -KoFilter::ConversionStatus ASCIIExport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus ASCIIExport::convert(const TQCString& from, const TQCString& to) { if (to != "text/plain" || from != "application/x-kword") { @@ -504,11 +504,11 @@ KoFilter::ConversionStatus ASCIIExport::convert(const QCString& from, const QCSt delete dialog; return KoFilter::StupidError; } - QTextCodec* codec; + TQTextCodec* codec; if (dialog) codec = dialog->getCodec(); else - codec = QTextCodec::codecForName("UTF-8"); + codec = TQTextCodec::codecForName("UTF-8"); if ( !codec ) { @@ -534,7 +534,7 @@ KoFilter::ConversionStatus ASCIIExport::convert(const QCString& from, const QCSt return KoFilter::StupidError; } - KoFilter::ConversionStatus result = leader->convert(m_chain,from,to); + KoFilter::ConversiontqStatus result = leader->convert(m_chain,from,to); delete leader; delete worker; diff --git a/filters/kword/ascii/asciiexport.h b/filters/kword/ascii/asciiexport.h index 7259c1d8..88db0c8f 100644 --- a/filters/kword/ascii/asciiexport.h +++ b/filters/kword/ascii/asciiexport.h @@ -25,12 +25,13 @@ class ASCIIExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - ASCIIExport(KoFilter* parent, const char* name, const QStringList&); + ASCIIExport(KoFilter* tqparent, const char* name, const TQStringList&); virtual ~ASCIIExport() {} - virtual KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + virtual KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); }; #endif // ASCIIEXPORT_H diff --git a/filters/kword/ascii/asciiimport.cc b/filters/kword/ascii/asciiimport.cc index 561daf1e..ceb93582 100644 --- a/filters/kword/ascii/asciiimport.cc +++ b/filters/kword/ascii/asciiimport.cc @@ -25,14 +25,14 @@ #include <unistd.h> #endif -#include <qobject.h> -#include <qstring.h> -// #include <qregexp.h> // Currently not needed (due to disabled code) -#include <qtextcodec.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qdom.h> -#include <qfontinfo.h> +#include <tqobject.h> +#include <tqstring.h> +// #include <tqregexp.h> // Currently not needed (due to disabled code) +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqdom.h> +#include <tqfontinfo.h> #include <kdebug.h> #include <kglobal.h> @@ -62,11 +62,11 @@ protected: K_EXPORT_COMPONENT_FACTORY( libasciiimport, ASCIIImportFactory() ) -ASCIIImport::ASCIIImport(KoFilter *, const char *, const QStringList &) : +ASCIIImport::ASCIIImport(KoFilter *, const char *, const TQStringList &) : KoFilter() { } -void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainFramesetElement) +void ASCIIImport::prepareDocument(TQDomDocument& mainDocument, TQDomElement& mainFramesetElement) { // TODO: other paper formats KoFormat paperFormat=PG_DIN_A4; // ISO A4 @@ -76,7 +76,7 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF mainDocument.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"")); - QDomElement elementDoc; + TQDomElement elementDoc; elementDoc=mainDocument.createElement("DOC"); elementDoc.setAttribute("editor","KWord's Plain Text Import Filter"); elementDoc.setAttribute("mime","application/x-kword"); @@ -84,7 +84,7 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF elementDoc.setAttribute("syntaxVersion",2); mainDocument.appendChild(elementDoc); - QDomElement element; + TQDomElement element; element=mainDocument.createElement("ATTRIBUTES"); element.setAttribute("processing",0); element.setAttribute("standardpage",1); @@ -93,7 +93,7 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF //element.setAttribute("unit","mm"); // use KWord default instead elementDoc.appendChild(element); - QDomElement elementPaper=mainDocument.createElement("PAPER"); + TQDomElement elementPaper=mainDocument.createElement("PAPER"); elementPaper.setAttribute("format",paperFormat); elementPaper.setAttribute("width" ,KoPageFormat::width (paperFormat,paperOrientation) * 72.0 / 25.4); elementPaper.setAttribute("height",KoPageFormat::height(paperFormat,paperOrientation) * 72.0 / 25.4); @@ -114,7 +114,7 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF element.setAttribute("bottom",42); elementPaper.appendChild(element); - QDomElement framesetsPluralElementOut=mainDocument.createElement("FRAMESETS"); + TQDomElement framesetsPluralElementOut=mainDocument.createElement("FRAMESETS"); mainDocument.documentElement().appendChild(framesetsPluralElementOut); mainFramesetElement=mainDocument.createElement("FRAMESET"); @@ -125,7 +125,7 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF // TODO: "name" attribute (needs I18N) framesetsPluralElementOut.appendChild(mainFramesetElement); - QDomElement frameElementOut=mainDocument.createElement("FRAME"); + TQDomElement frameElementOut=mainDocument.createElement("FRAME"); frameElementOut.setAttribute("left",28); frameElementOut.setAttribute("top",42); frameElementOut.setAttribute("bottom",566); @@ -133,10 +133,10 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF frameElementOut.setAttribute("runaround",1); mainFramesetElement.appendChild(frameElementOut); - QDomElement elementStylesPlural=mainDocument.createElement("STYLES"); + TQDomElement elementStylesPlural=mainDocument.createElement("STYLES"); elementDoc.appendChild(elementStylesPlural); - QDomElement elementStyleStandard=mainDocument.createElement("STYLE"); + TQDomElement elementStyleStandard=mainDocument.createElement("STYLE"); elementStylesPlural.appendChild(elementStyleStandard); element=mainDocument.createElement("NAME"); @@ -147,11 +147,11 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF element.setAttribute("name","Standard"); elementStyleStandard.appendChild(element); - QDomElement elementFormat=mainDocument.createElement("FORMAT"); + TQDomElement elementFormat=mainDocument.createElement("FORMAT"); elementStyleStandard.appendChild(elementFormat); - // Use QFontInfo, as it does not give back -1 as point size. - QFontInfo defaultFontInfo(KoGlobal::defaultFont()); + // Use TQFontInfo, as it does not give back -1 as point size. + TQFontInfo defaultFontInfo(KoGlobal::defaultFont()); element=mainDocument.createElement("FONT"); element.setAttribute("name",defaultFontInfo.family()); @@ -195,7 +195,7 @@ void ASCIIImport::prepareDocument(QDomDocument& mainDocument, QDomElement& mainF } -KoFilter::ConversionStatus ASCIIImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus ASCIIImport::convert( const TQCString& from, const TQCString& to ) { if (to!="application/x-kword" || from!="text/plain") return KoFilter::NotImplemented; @@ -216,7 +216,7 @@ KoFilter::ConversionStatus ASCIIImport::convert( const QCString& from, const QCS } } - QTextCodec* codec; + TQTextCodec* codec; int paragraphStrategy; if (dialog) { @@ -226,29 +226,29 @@ KoFilter::ConversionStatus ASCIIImport::convert( const QCString& from, const QCS } else { - codec = QTextCodec::codecForName("UTF-8"); + codec = TQTextCodec::codecForName("UTF-8"); paragraphStrategy=0; } - QFile in(m_chain->inputFile()); + TQFile in(m_chain->inputFile()); if(!in.open(IO_ReadOnly)) { kdError(30502) << "Unable to open input file!" << endl; in.close(); return KoFilter::FileNotFound; } - QString tbl; // string for table XML + TQString tbl; // string for table XML - QDomDocument mainDocument; - QDomElement mainFramesetElement; + TQDomDocument mainDocument; + TQDomElement mainFramesetElement; prepareDocument(mainDocument,mainFramesetElement); - QTextStream stream(&in); + TQTextStream stream(&in); if (!codec) { - kdError(30502) << "Could not create QTextCodec! Aborting" << endl; + kdError(30502) << "Could not create TQTextCodec! Aborting" << endl; in.close(); return KoFilter::StupidError; } @@ -275,24 +275,24 @@ KoFilter::ConversionStatus ASCIIImport::convert( const QCString& from, const QCS in.close(); return KoFilter::StorageCreationError; } - QCString cstr=mainDocument.toCString(); - // WARNING: we cannot use KoStore::write(const QByteArray&) because it gives an extra NULL character at the end. + TQCString cstr=mainDocument.toCString(); + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it gives an extra NULL character at the end. out->writeBlock(cstr,cstr.length()); in.close(); return KoFilter::OK; } -void ASCIIImport::oldWayConvert(QTextStream& stream, QDomDocument& mainDocument, - QDomElement& mainFramesetElement) +void ASCIIImport::oldWayConvert(TQTextStream& stream, TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement) { kdDebug(30502) << "Entering: ASCIIImport::oldWayConvert" << endl; - QStringList paragraph; // lines of the paragraph + TQStringList paragraph; // lines of the paragraph int linecount = 0; // line counter used to position tables //int table_no = 0; // used for table identifiers int numLines; // Number of lines of the paragraph bool lastCharWasCr=false; // Was the previous character a Carriage Return? - QString strLine; + TQString strLine; while(!stream.atEnd()) { paragraph.clear(); @@ -300,19 +300,19 @@ void ASCIIImport::oldWayConvert(QTextStream& stream, QDomDocument& mainDocument, for(int line_no = numLines = 0; line_no < MAXLINES; line_no++, numLines++) { // We need to read a line - // NOTE: we cannot use QStreamText::readLine, + // NOTE: we cannot use TQStreamText::readLine, // as it does not know anything about Carriage Returns strLine=readLine(stream,lastCharWasCr); if (strLine.isEmpty()) { - paragraph.append(QString::null); + paragraph.append(TQString()); break; } const int length = strLine.length(); - if (strLine.at(length-1) == '-') + if (strLine.tqat(length-1) == '-') // replace the hard hyphen - at line end by a soft hyphen - strLine.at(length-1)=QChar(173); + strLine.tqat(length-1)=TQChar(173); else strLine += ' '; // add space to end of line @@ -350,13 +350,13 @@ void ASCIIImport::oldWayConvert(QTextStream& stream, QDomDocument& mainDocument, #endif } -void ASCIIImport::asIsConvert(QTextStream& stream, QDomDocument& mainDocument, - QDomElement& mainFramesetElement) +void ASCIIImport::asIsConvert(TQTextStream& stream, TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement) // Paragraph strategy: one line, one paragraph { kdDebug(30502) << "Entering: ASCIIImport::asIsConvert" << endl; bool lastCharWasCr=false; // Was the previous character a Carriage Return? - QString strLine; + TQString strLine; while(!stream.atEnd()) { // Read one line and consider it being a paragraph @@ -366,27 +366,27 @@ void ASCIIImport::asIsConvert(QTextStream& stream, QDomDocument& mainDocument, } } -void ASCIIImport::sentenceConvert(QTextStream& stream, QDomDocument& mainDocument, - QDomElement& mainFramesetElement) +void ASCIIImport::sentenceConvert(TQTextStream& stream, TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement) // Strategy: // - end a paragraph when a line ends with a point or similar punctuation. -// - search the punctuation at the end of the line, even if the sentence is quoted or in parentheses. +// - search the punctuation at the end of the line, even if the sentence is quoted or in tqparentheses. // - an empty line also ends the paragraph // TODO/FIXME: we have a little problem with empty lines. Perhaps we should not allow empty paragraphs! { kdDebug(30502) << "Entering: ASCIIImport::sentenceConvert" << endl; - QStringList paragraph; // lines of the paragraph + TQStringList paragraph; // lines of the paragraph bool lastCharWasCr=false; // Was the previous character a Carriage Return? - QString strLine; - QString stoppingPunctuation(".!?"); - QString skippingQuotes("\"')"); + TQString strLine; + TQString stoppingPunctuation(".!?"); + TQString skippingQuotes("\"')"); while (!stream.atEnd()) { paragraph.clear(); for(;;) { // We need to read a line - // NOTE: we cannot use QStreamText::readLine, + // NOTE: we cannot use TQStreamText::readLine, // as it does not know anything about Carriage Returns strLine=readLine(stream,lastCharWasCr); if (strLine.isEmpty()) @@ -397,14 +397,14 @@ void ASCIIImport::sentenceConvert(QTextStream& stream, QDomDocument& mainDocumen paragraph.append(strLine); uint lastPos=strLine.length()-1; - QChar lastChar; + TQChar lastChar; // Skip a maximum of 10 quotes (or similar) at the end of the line for (int i=0;i<10;i++) { lastChar=strLine[lastPos]; if (lastChar.isNull()) break; - else if (skippingQuotes.find(lastChar)==-1) + else if (skippingQuotes.tqfind(lastChar)==-1) break; else lastPos--; @@ -413,7 +413,7 @@ void ASCIIImport::sentenceConvert(QTextStream& stream, QDomDocument& mainDocumen lastChar=strLine[lastPos]; if (lastChar.isNull()) continue; - else if (stoppingPunctuation.find(lastChar)!=-1) + else if (stoppingPunctuation.tqfind(lastChar)!=-1) break; } #if 1 @@ -426,13 +426,13 @@ void ASCIIImport::sentenceConvert(QTextStream& stream, QDomDocument& mainDocumen } // while(!eof) } -void ASCIIImport::processParagraph(QDomDocument& mainDocument, - QDomElement& mainFramesetElement, const QStringList& paragraph) +void ASCIIImport::processParagraph(TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement, const TQStringList& paragraph) { // Paragraph with no tables or lists - QString text; - QStringList::ConstIterator it=paragraph.begin(); // Current line (at start, the first one) - QStringList::ConstIterator previousLine=it; // The previous one (at start, also the first one) + TQString text; + TQStringList::ConstIterator it=paragraph.begin(); // Current line (at start, the first one) + TQStringList::ConstIterator previousLine=it; // The previous one (at start, also the first one) int firstindent=Indent(*it); // We work with one line in advance (therefore the two it++) @@ -450,7 +450,7 @@ void ASCIIImport::processParagraph(QDomDocument& mainDocument, "Standard", text.simplifyWhiteSpace(), firstindent, secondindent); firstindent = Indent(*it); - text = QString::null; // reinitialize paragraph text + text = TQString(); // reinitialize paragraph text } } previousLine=it; @@ -461,32 +461,32 @@ void ASCIIImport::processParagraph(QDomDocument& mainDocument, "Standard", text.simplifyWhiteSpace(), firstindent, secondindent); } -void ASCIIImport::writeOutParagraph(QDomDocument& mainDocument, - QDomElement& mainFramesetElement, const QString& name, - const QString& text, const int firstindent, const int secondindent) +void ASCIIImport::writeOutParagraph(TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement, const TQString& name, + const TQString& text, const int firstindent, const int secondindent) { - QDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); + TQDomElement paragraphElementOut=mainDocument.createElement("PARAGRAPH"); mainFramesetElement.appendChild(paragraphElementOut); - QDomElement textElement=mainDocument.createElement("TEXT"); + TQDomElement textElement=mainDocument.createElement("TEXT"); paragraphElementOut.appendChild(textElement); - //QDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); + //TQDomElement formatsPluralElementOut=mainDocument.createElement("FORMATS"); //paragraphElementOut.appendChild(formatsPluralElementOut); - QDomElement layoutElement=mainDocument.createElement("LAYOUT"); - paragraphElementOut.appendChild(layoutElement); + TQDomElement tqlayoutElement=mainDocument.createElement("LAYOUT"); + paragraphElementOut.appendChild(tqlayoutElement); - QDomElement element; + TQDomElement element; element=mainDocument.createElement("NAME"); element.setAttribute("value",name); - layoutElement.appendChild(element); + tqlayoutElement.appendChild(element); double size; element=mainDocument.createElement("INDENTS"); size = firstindent-secondindent; size *= ptsperchar; // convert indent spaces to points - element.setAttribute("first",QString::number(size)); + element.setAttribute("first",TQString::number(size)); size = secondindent; size *= ptsperchar; // convert indent spaces to points - element.setAttribute("left",QString::number(size)); + element.setAttribute("left",TQString::number(size)); element.setAttribute("right",0); textElement.appendChild(mainDocument.createTextNode(text)); @@ -518,18 +518,18 @@ void ASCIIImport::writeOutParagraph(QDomDocument& mainDocument, /* The Indent method determines the equivalent number of spaces at the beginning of a line */ -int ASCIIImport::Indent(const QString& line) const +int ASCIIImport::Indent(const TQString& line) const { - QChar c; // for reading string a character at a time + TQChar c; // for reading string a character at a time int count=0; // amount of white space at the begining of the line for( uint i = 0; i < line.length(); i++ ) { c = line.at(i); - if( c == QChar(' ')) + if( c == TQChar(' ')) count++; - else if( c == QChar('\t')) + else if( c == TQChar('\t')) count += spacespertab; else break; @@ -547,52 +547,52 @@ int ASCIIImport::Indent(const QString& line) const int row - row number int col - column number Position *pos - pointer to the table position - QString str - the output string. + TQString str - the output string. Returns - void */ #if 0 void ASCIIImport::WriteOutTableCell( int table_no, int row, - int col, Position *pos, QString &str) + int col, Position *pos, TQString &str) { str += "<FRAMESET frameType=\"1\" frameInfo=\"0\" grpMgr=\"grpmgr_"; - QString buf = QString::number(table_no); // convert int to string + TQString buf = TQString::number(table_no); // convert int to string str += buf; str += "\" row=\""; - buf = QString::number(row); // convert row to string + buf = TQString::number(row); // convert row to string str += buf; str += "\" col=\""; - buf = QString::number(col); // convert col to string + buf = TQString::number(col); // convert col to string str += buf; str += "\" rows=\"1\" cols=\"1\" removable=\"0\" visible=\"1\" name=\"Cell "; - buf = QString::number(row); // convert row to string + buf = TQString::number(row); // convert row to string str += buf; str += ","; - buf = QString::number(col); // convert col to string + buf = TQString::number(col); // convert col to string str += buf; str += "\">\n"; str += "<FRAME left=\""; - buf = QString::number(pos->left); // convert left coordinate to string + buf = TQString::number(pos->left); // convert left coordinate to string str += buf; str += "\" top=\""; - buf = QString::number(pos->top); // convert top coordinate to string + buf = TQString::number(pos->top); // convert top coordinate to string str += buf; str += "\" right=\""; - buf = QString::number(pos->right); // convert right coordinate to string + buf = TQString::number(pos->right); // convert right coordinate to string str += buf; str += "\" bottom=\""; - buf = QString::number(pos->bottom); // convert bottom coordinate to string + buf = TQString::number(pos->bottom); // convert bottom coordinate to string str += buf; str += "\" runaround=\"0\" autoCreateNewFrame=\"0\" newFrameBehavior=\"1\" />\n"; @@ -604,8 +604,8 @@ int ASCIIImport::Indent(const QString& line) const -bool ASCIIImport::Table( QString *Line, int *linecount, int no_lines, - int table_no, QString &tbl, QString &str ) +bool ASCIIImport::Table( TQString *Line, int *linecount, int no_lines, + int table_no, TQString &tbl, TQString &str ) { return false; // this method is disabled @@ -615,22 +615,22 @@ bool ASCIIImport::Table( QString *Line, int *linecount, int no_lines, check for embedded bullet or dash lists which is a seperate method. Arguments - QString *Line - pointer to the array of text lines in the paragraph. + TQString *Line - pointer to the array of text lines in the paragraph. int *linecount - pointer to the line counter used to position tables int no_lines - the number of lines in the paragraph int *table_no - pointer to the table number counter - QString str - the output string + TQString str - the output string Returns - enum value indicating wheterer a table was processed. */ enum LiType{paragraph, table} linetype[MAXLINES]; struct Tabs tabs[MAXLINES]; // array of structures for tables struct Position pos; // struct to pass cell position int width[MAXCOLUMNS]; // array of column widths - QString *currentline; // pointer to the current line - QString *beginline; // pointer to the beginning line - QString text; // text buffer - QString text1; // another text buffer - QString No_indents; // Line with leading white space removed + TQString *currentline; // pointer to the current line + TQString *beginline; // pointer to the beginning line + TQString text; // text buffer + TQString text1; // another text buffer + TQString No_indents; // Line with leading white space removed int index, index1, index2, index3; // used to define column positions in a line int no_cols; // column counter @@ -639,7 +639,7 @@ bool ASCIIImport::Table( QString *Line, int *linecount, int no_lines, int i; // counter int j; // counter int k; // counter - QString *firstline; + TQString *firstline; firstline = Line; int begin = 0; // beginning line number int tabcount = 0; // counts tab characters @@ -655,16 +655,16 @@ bool ASCIIImport::Table( QString *Line, int *linecount, int no_lines, { // save and remove tabs at beginning of the line text = *Line; // copy - Line->remove(QRegExp("^[\\ \t]*")); + Line->remove(TQRegExp("^[\\ \t]*")); } // find column positions and record text fields - while((index2 = Line->find( QRegExp("\t"),index)) > index + while((index2 = Line->tqfind( TQRegExp("\t"),index)) > index || (index3 = MultSpaces( *Line, index)) > index ) { index1 = kMax(index2, index3); if( index2 > index3) - index1 = Line->find( QRegExp("[^\t]"), index1); + index1 = Line->tqfind( TQRegExp("[^\t]"), index1); tabcount++; tabs[i].field[no_cols] = Line->mid(index, (index1 - index -1)); tabs[i].width[no_cols] = index1 - index + spacespertab - 1; @@ -733,7 +733,7 @@ bool ASCIIImport::Table( QString *Line, int *linecount, int no_lines, beginline++; // increment pointer } // process the white space to eliminate unwanted spaces - QString text1 = text.simplifyWhiteSpace(); + TQString text1 = text.simplifyWhiteSpace(); WriteOutParagraph( "Standard", "", text1 , firstindent, secondindent, str); *linecount += (i - begin); @@ -786,11 +786,11 @@ bool ASCIIImport::Table( QString *Line, int *linecount, int no_lines, #endif // the following method finds the location of multiple spaces in a string -int ASCIIImport::MultSpaces(const QString& text, const int index) const +int ASCIIImport::MultSpaces(const TQString& text, const int index) const { - QChar c; - QChar lastchar = 'c'; // previous character - initialize non blank + TQChar c; + TQChar lastchar = 'c'; // previous character - initialize non blank bool found = false; // kdDebug(30502) << "length = " << text.length() << endl; for (uint i = index; i < text.length(); i++) @@ -807,25 +807,25 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const } // MultSpaces #if 0 - bool ASCIIImport::ListItem( QString *Line, int no_lines, - QString &str ) + bool ASCIIImport::ListItem( TQString *Line, int no_lines, + TQString &str ) { /* This method examines a paragraph for embedded lists. If none are found, it returns. If lists are found then it writes out the paragraph including the lists. Arguments - QString *Line - pointer to the array of text lines in the paragraph. + TQString *Line - pointer to the array of text lines in the paragraph. int *linecount - pointer to the line counter used to position tables int no_lines - the number of lines in the paragraph - QString &str - the output string + TQString &str - the output string Returns - bool value indicating whether a list item was processed. */ - QString *currentline; // pointer to the current line + TQString *currentline; // pointer to the current line enum Listtype{none, bullet, dash} listtype[MAXLINES]; - QString type; // type of list - bullet or dash - QString *firstline; + TQString type; // type of list - bullet or dash + TQString *firstline; int i; // counter int firstindent; int secondindent; @@ -839,13 +839,13 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const listtype[i] = none; // initialize // check for a bullet list item - if( IsListItem( *Line, QChar('*'))) + if( IsListItem( *Line, TQChar('*'))) { listtype[i] = bullet; listcount++; } // check for a dash list item - if( IsListItem( *Line, QChar('-'))) + if( IsListItem( *Line, TQChar('-'))) { listtype[i] = dash; listcount++; @@ -858,7 +858,7 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const // check for at least one list if( listcount == 0) return false; - QString text = ""; // initialize a null string for paragraph text + TQString text = ""; // initialize a null string for paragraph text Line = firstline; // reset the line pointer for( i = 0; i < no_lines; i++) @@ -872,13 +872,13 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const { type = "6"; // delete * at beginning of line - text.remove( QRegExp("^[ \t]*\\* ") ); + text.remove( TQRegExp("^[ \t]*\\* ") ); } else if( listtype[begin] == dash) // write out a dash list { type = "7"; // delete - at beginning of line - text.remove( QRegExp("^[ \t]*\\- ") ); + text.remove( TQRegExp("^[ \t]*\\- ") ); } else if( listtype[begin] == none) // write out a paragraph type = ""; @@ -894,7 +894,7 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const else secondindent = 0; // process the white space to eliminate unwanted spaces - QString text1 = text.simplifyWhiteSpace(); + TQString text1 = text.simplifyWhiteSpace(); WriteOutParagraph( "Standard", type, text1 , firstindent, secondindent, str); begin = i; @@ -916,13 +916,13 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const { type = "6"; // delete * at beginning of line - text.replace( QRegExp("^[ \t]*\\* "), ""); + text.tqreplace( TQRegExp("^[ \t]*\\* "), ""); } else if( listtype[begin] == dash) // write out a dash list { type = "7"; // delete - at beginning of line - text.replace( QRegExp("^[ \t]*\\- "), ""); + text.tqreplace( TQRegExp("^[ \t]*\\- "), ""); } else if( listtype[begin] == none) // write out a paragraph type = ""; @@ -938,7 +938,7 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const else secondindent = 0; // process the white space to eliminate unwanted spaces - QString text1 = text.simplifyWhiteSpace(); + TQString text1 = text.simplifyWhiteSpace(); WriteOutParagraph( "Standard", type, text1 , firstindent, secondindent, str); @@ -951,21 +951,21 @@ int ASCIIImport::MultSpaces(const QString& text, const int index) const the text appears to be a list item (bullet or dash). Arguments - QString FirstLine the first line of text in a paragraph - QChar mark the mark - or * that indicates a list item + TQString FirstLine the first line of text in a paragraph + TQChar mark the mark - or * that indicates a list item Return true if the line appears as a list item, false if not. */ -bool ASCIIImport::IsListItem( QString FirstLine, QChar mark ) +bool ASCIIImport::IsListItem( TQString FirstLine, TQChar mark ) { int i; // counter - QChar c; // to stream into one character at a time + TQChar c; // to stream into one character at a time - int k = FirstLine.find(mark); + int k = FirstLine.tqfind(mark); if( k < 0) return false; // list item mark not on line @@ -981,21 +981,21 @@ bool ASCIIImport::IsListItem( QString FirstLine, QChar mark ) } // IsListItem -bool ASCIIImport::IsWhiteSpace(const QChar& c) const +bool ASCIIImport::IsWhiteSpace(const TQChar& c) const { - if ( c == QChar(' ') || c == QChar('\t') ) + if ( c == TQChar(' ') || c == TQChar('\t') ) return true; else return false; } // IsWhiteSpace -QString ASCIIImport::readLine(QTextStream& textstream, bool& lastCharWasCr) +TQString ASCIIImport::readLine(TQTextStream& textstream, bool& lastCharWasCr) { // We need to read a line, character by character - // NOTE: we cannot use QStreamText::readLine, + // NOTE: we cannot use TQStreamText::readLine, // as it does not know anything about Carriage Returns - QString strLine; - QChar ch; + TQString strLine; + TQChar ch; while (!textstream.atEnd()) { textstream >> ch; // Read one character diff --git a/filters/kword/ascii/asciiimport.h b/filters/kword/ascii/asciiimport.h index c8746eed..6d315879 100644 --- a/filters/kword/ascii/asciiimport.h +++ b/filters/kword/ascii/asciiimport.h @@ -24,10 +24,10 @@ #include <KoFilter.h> -class QString; -class QTextStream; -class QDomDocument; -class QDomElement; +class TQString; +class TQTextStream; +class TQDomDocument; +class TQDomElement; #define MAXLINES 1000 #define MAXCOLUMNS 15 @@ -43,7 +43,7 @@ class QDomElement; { int columns; int indent; - QString field[MAXCOLUMNS]; + TQString field[MAXCOLUMNS]; int width[MAXCOLUMNS]; }; @@ -58,45 +58,46 @@ class QDomElement; class ASCIIImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - ASCIIImport(KoFilter *parent, const char *name, const QStringList &); + ASCIIImport(KoFilter *tqparent, const char *name, const TQStringList &); ASCIIImport(); virtual ~ASCIIImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: // not yet changed #if 0 void WriteOutTableCell( int table_no, int row, int col, Position *pos, - QString &str); + TQString &str); - bool Table( QString *Line, int *linecount, int no_lines, - int table_no, QString &tbl, QString &str ); + bool Table( TQString *Line, int *linecount, int no_lines, + int table_no, TQString &tbl, TQString &str ); - bool ListItem( QString *Line, int no_lines, - QString &str ); + bool ListItem( TQString *Line, int no_lines, + TQString &str ); #endif - bool IsListItem( QString FirstLine, QChar mark ); + bool IsListItem( TQString FirstLine, TQChar mark ); private: - void prepareDocument(QDomDocument& mainDocument, QDomElement& mainFramesetElement); - void processParagraph(QDomDocument& mainDocument, - QDomElement& mainFramesetElement, const QStringList& paragraph); - void writeOutParagraph(QDomDocument& mainDocument, - QDomElement& mainFramesetElement, const QString& name, - const QString& text, const int firstindent, const int secondindent); - int Indent(const QString& line) const; - int MultSpaces(const QString& text, const int index) const; - bool IsWhiteSpace(const QChar& c) const; - QString readLine(QTextStream& textstream, bool& lastCharWasCr); + void prepareDocument(TQDomDocument& mainDocument, TQDomElement& mainFramesetElement); + void processParagraph(TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement, const TQStringList& paragraph); + void writeOutParagraph(TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement, const TQString& name, + const TQString& text, const int firstindent, const int secondindent); + int Indent(const TQString& line) const; + int MultSpaces(const TQString& text, const int index) const; + bool IsWhiteSpace(const TQChar& c) const; + TQString readLine(TQTextStream& textstream, bool& lastCharWasCr); private: // converting functions - void oldWayConvert(QTextStream& stream, QDomDocument& mainDocument, - QDomElement& mainFramesetElement); - void asIsConvert(QTextStream& stream, QDomDocument& mainDocument, - QDomElement& mainFramesetElement); - void sentenceConvert(QTextStream& stream, QDomDocument& mainDocument, - QDomElement& mainFramesetElement); + void oldWayConvert(TQTextStream& stream, TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement); + void asIsConvert(TQTextStream& stream, TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement); + void sentenceConvert(TQTextStream& stream, TQDomDocument& mainDocument, + TQDomElement& mainFramesetElement); }; #endif // ASCIIIMPORT_H diff --git a/filters/kword/ascii/status.html b/filters/kword/ascii/status.html index 6b53717d..e8af7c5d 100644 --- a/filters/kword/ascii/status.html +++ b/filters/kword/ascii/status.html @@ -98,7 +98,7 @@ (Recommended strategy)<br> <b>Sentence:</b><br> - a paragraph ends when a line ends with a point or similar punctuation.<br> - - the punctuation is searched at the end of the line, even if the sentence is quoted or in parentheses.<br> + - the punctuation is searched at the end of the line, even if the sentence is quoted or in tqparentheses.<br> - an empty line also ends the paragraph.<br> <b>Old Way: (similar to KOffice 1.1.x)</b><br> - a paragraph ends at an empty line.<br> diff --git a/filters/kword/docbook/docbookexport.cc b/filters/kword/docbook/docbookexport.cc index 617c2d13..db9c754a 100644 --- a/filters/kword/docbook/docbookexport.cc +++ b/filters/kword/docbook/docbookexport.cc @@ -26,8 +26,8 @@ #include <docbookexport.moc> #include <kdebug.h> #include <kgenericfactory.h> -#include <qdir.h> -#include <qdom.h> +#include <tqdir.h> +#include <tqdom.h> #include <KoFilterChain.h> #include <KWEFStructures.h> @@ -41,7 +41,7 @@ K_EXPORT_COMPONENT_FACTORY( libdocbookexport, DocBookExportFactory( "kofficefilt DocBookExport::DocBookExport ( KoFilter *, const char *, - const QStringList & ) : KoFilter () + const TQStringList & ) : KoFilter () { } @@ -71,7 +71,7 @@ class DocBookWorker : public KWEFBaseWorker bool doOpenDocument ( void ); bool doCloseDocument ( void ); - bool doOpenFile ( const QString &, const QString & ); + bool doOpenFile ( const TQString &, const TQString & ); bool doCloseFile ( void ); bool doOpenBody ( void ); @@ -79,7 +79,7 @@ class DocBookWorker : public KWEFBaseWorker bool doFullDocumentInfo ( const KWEFDocumentInfo & ); - bool doFullDocument ( const QValueList<ParaData> ¶List ); + bool doFullDocument ( const TQValueList<ParaData> ¶List ); private: void ProcessPictureData ( const Picture &picture ); @@ -87,7 +87,7 @@ class DocBookWorker : public KWEFBaseWorker void ProcessTableData ( const Table &table ); void ProcessParagraphData ( const ParaData ¶, - QString tag ); + TQString tag ); void CloseItemizedList ( void ); void CloseEnumeratedList ( void ); @@ -101,10 +101,10 @@ class DocBookWorker : public KWEFBaseWorker void OpenArticleUnlessHead1 ( void ); - QString outputText; + TQString outputText; DocData docData; - QFile *fileOut; - QString exportFileName; + TQFile *fileOut; + TQString exportFileName; }; @@ -114,13 +114,13 @@ class DocBookWorker : public KWEFBaseWorker void DocBookWorker::ProcessPictureData ( const Picture &picture ) { - QByteArray byteArray; + TQByteArray byteArray; if ( loadSubFile ( picture.koStoreName,byteArray ) ) { - QFileInfo fileInfo (exportFileName); - QDir dir ( fileInfo.dirPath () ); - QString subDirName = fileInfo.fileName () + ".d"; + TQFileInfo fileInfo (exportFileName); + TQDir dir ( fileInfo.dirPath () ); + TQString subDirName = fileInfo.fileName () + ".d"; if ( !dir.exists (subDirName) ) { @@ -134,15 +134,15 @@ void DocBookWorker::ProcessPictureData ( const Picture &picture ) dir.mkdir ("pictures"); } - QString pictureFileName = dir.filePath (picture.koStoreName); + TQString pictureFileName = dir.filePath (picture.koStoreName); - QFile pictureFile (pictureFileName); + TQFile pictureFile (pictureFileName); if ( pictureFile.open (IO_WriteOnly) ) { pictureFile.writeBlock ( byteArray, byteArray.size () ); - QString pictureText; + TQString pictureText; #if TABLES_WITH_TITLES pictureText += "<FIGURE>\n"; @@ -191,7 +191,7 @@ void DocBookWorker::ProcessTableData ( const Table &table ) kdError (30507) << "DEBUG: ProcessTableData ()" << endl; #endif - QString tableText; + TQString tableText; #if TABLES_WITH_TITLES tableText += "<TABLE>\n"; @@ -205,12 +205,12 @@ void DocBookWorker::ProcessTableData ( const Table &table ) tableText += "<INFORMALTABLE>\n"; #endif - tableText += " <TGROUP COLS=\"" + QString::number (table.cols) + "\">\n"; + tableText += " <TGROUP COLS=\"" + TQString::number (table.cols) + "\">\n"; tableText += " <TBODY>\n"; int currentRow = -1; - QValueList<TableCell>::ConstIterator cellIt; + TQValueList<TableCell>::ConstIterator cellIt; for ( cellIt = table.cellList.begin (); cellIt != table.cellList.end (); @@ -228,7 +228,7 @@ void DocBookWorker::ProcessTableData ( const Table &table ) tableText += " <ROW>\n"; } - QString tmpBuf; + TQString tmpBuf; tmpBuf = outputText; outputText = ""; @@ -266,10 +266,10 @@ void DocBookWorker::ProcessTableData ( const Table &table ) // out to the export file. void DocBookWorker::ProcessParagraphData ( const ParaData ¶, - QString tag ) + TQString tag ) { #if !INSERT_TABLE_IN_PARA - QValueList<AnchoredInsert> tmpAnchoredInsertList; + TQValueList<AnchoredInsert> tmpAnchoredInsertList; #endif outputText += "<" + tag + ">"; @@ -296,12 +296,12 @@ void DocBookWorker::ProcessParagraphData ( const ParaData ¶, fixedFont = true; } - if ( (*formattingIt).text.italic && !para.layout.formatData.text.italic ) + if ( (*formattingIt).text.italic && !para.tqlayout.formatData.text.italic ) { outputText += "<EMPHASIS>"; } - if ( (*formattingIt).text.weight > para.layout.formatData.text.weight ) + if ( (*formattingIt).text.weight > para.tqlayout.formatData.text.weight ) { outputText += "<EMPHASIS ROLE=bold>"; } @@ -318,12 +318,12 @@ void DocBookWorker::ProcessParagraphData ( const ParaData ¶, outputText += "</LITERAL>"; } - if ( (*formattingIt).text.weight > para.layout.formatData.text.weight ) + if ( (*formattingIt).text.weight > para.tqlayout.formatData.text.weight ) { outputText += "</EMPHASIS>"; } - if ( (*formattingIt).text.italic && !para.layout.formatData.text.italic ) + if ( (*formattingIt).text.italic && !para.tqlayout.formatData.text.italic ) { outputText += "</EMPHASIS>"; } @@ -391,7 +391,7 @@ void DocBookWorker::ProcessParagraphData ( const ParaData ¶, outputText += "</" + tag + ">\n"; #if !INSERT_TABLE_IN_PARA - QValueList<AnchoredInsert>::Iterator anchoredInsert; + TQValueList<AnchoredInsert>::Iterator anchoredInsert; for ( anchoredInsert = tmpAnchoredInsertList.begin (); anchoredInsert != tmpAnchoredInsertList.end (); @@ -506,20 +506,20 @@ void DocBookWorker::OpenArticleUnlessHead1 ( void ) } -bool DocBookWorker::doFullDocument ( const QValueList<ParaData> ¶List ) +bool DocBookWorker::doFullDocument ( const TQValueList<ParaData> ¶List ) { #if 0 kdError (30507) << "doFullDocument () - Begin" << endl; #endif - QValueList<ParaData>::ConstIterator paraIt; - QValueList<ParaData>::ConstIterator end(paraList.end ()); + TQValueList<ParaData>::ConstIterator paraIt; + TQValueList<ParaData>::ConstIterator end(paraList.end ()); for ( paraIt = paraList.begin (); paraIt != end ; ++paraIt ) { - switch ( (*paraIt).layout.counter.numbering ) + switch ( (*paraIt).tqlayout.counter.numbering ) { case CounterData::NUM_LIST: - switch ( (*paraIt).layout.counter.style ) + switch ( (*paraIt).tqlayout.counter.style ) { case CounterData::STYLE_CUSTOMBULLET: case CounterData::STYLE_CIRCLEBULLET: @@ -581,7 +581,7 @@ bool DocBookWorker::doFullDocument ( const QValueList<ParaData> ¶List ) break; default: - kdError (30507) << "Unknown counter style " << (*paraIt).layout.counter.style << "!" << endl; + kdError (30507) << "Unknown counter style " << (*paraIt).tqlayout.counter.style << "!" << endl; CloseLists (); OpenArticleUnlessHead1 (); ProcessParagraphData (*paraIt, "PARA" ); @@ -590,7 +590,7 @@ bool DocBookWorker::doFullDocument ( const QValueList<ParaData> ¶List ) break; case CounterData::NUM_CHAPTER: - switch ( (*paraIt).layout.counter.depth ) + switch ( (*paraIt).tqlayout.counter.depth ) { case 0: CloseHead1AndArticle (); @@ -629,7 +629,7 @@ bool DocBookWorker::doFullDocument ( const QValueList<ParaData> ¶List ) break; default: - kdError (30507) << "Unexpected chapter depth " << (*paraIt).layout.counter.depth << "!" << endl; + kdError (30507) << "Unexpected chapter depth " << (*paraIt).tqlayout.counter.depth << "!" << endl; CloseLists (); OpenArticleUnlessHead1 (); ProcessParagraphData (*paraIt, "PARA" ); @@ -691,9 +691,9 @@ bool DocBookWorker::doCloseDocument ( void ) } -bool DocBookWorker::doOpenFile ( const QString &filenameOut, const QString & /*to*/ ) +bool DocBookWorker::doOpenFile ( const TQString &filenameOut, const TQString & /*to*/ ) { - fileOut = new QFile(filenameOut); + fileOut = new TQFile(filenameOut); if ( !fileOut ) { @@ -722,9 +722,9 @@ bool DocBookWorker::doCloseFile ( void ) { if ( !fileOut ) return true; - // As a QChar can be transformed into many bytes, - // we need to use QCString::length instead of QString::length - QCString cstr = outputText.local8Bit (); + // As a TQChar can be transformed into many bytes, + // we need to use TQCString::length instead of TQString::length + TQCString cstr = outputText.local8Bit (); fileOut->writeBlock ( cstr, cstr.length () ); fileOut->close (); @@ -740,9 +740,9 @@ bool DocBookWorker::doCloseFile ( void ) // the current tag level. It is used by ProcessDocumentIntoTag () to // assemble the diverse levels of information of the BOOKINFO tag. -static void ProcessInfoData ( const QString &tagName, - const QString & tagText, - QString &outputText) +static void ProcessInfoData ( const TQString &tagName, + const TQString & tagText, + TQString &outputText) { if ( tagText.length () ) { @@ -753,11 +753,11 @@ static void ProcessInfoData ( const QString &tagName, bool DocBookWorker::doFullDocumentInfo ( const KWEFDocumentInfo &docInfo ) { - QString bookInfoText; - QString abstractText; - QString authorText; - QString affiliationText; - QString addressText; + TQString bookInfoText; + TQString abstractText; + TQString authorText; + TQString affiliationText; + TQString addressText; ProcessInfoData ( "TITLE", docInfo.title, bookInfoText ); ProcessInfoData ( "PARA", docInfo.abstract, abstractText ); @@ -782,7 +782,7 @@ bool DocBookWorker::doFullDocumentInfo ( const KWEFDocumentInfo &docInfo ) } -KoFilter::ConversionStatus DocBookExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus DocBookExport::convert( const TQCString& from, const TQCString& to ) { #if 0 kdError (30507) << "to = " << to << ", from = " << from << endl; diff --git a/filters/kword/docbook/docbookexport.h b/filters/kword/docbook/docbookexport.h index f6cf0494..9a1611c8 100644 --- a/filters/kword/docbook/docbookexport.h +++ b/filters/kword/docbook/docbookexport.h @@ -20,10 +20,10 @@ #ifndef DOCBOOKEXPORT_H #define DOCBOOKEXPORT_H -#include <qstring.h> -#include <qcstring.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -32,11 +32,12 @@ class DocBookExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - DocBookExport (KoFilter *parent, const char *name, const QStringList & ); + DocBookExport (KoFilter *tqparent, const char *name, const TQStringList & ); virtual ~DocBookExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // DOCBOOKEXPORT_H diff --git a/filters/kword/hancomword/hancomwordimport.cpp b/filters/kword/hancomword/hancomwordimport.cpp index 0e72355b..41244247 100644 --- a/filters/kword/hancomword/hancomwordimport.cpp +++ b/filters/kword/hancomword/hancomwordimport.cpp @@ -26,12 +26,12 @@ #include <hancomwordimport.h> #include <hancomwordimport.moc> -#include <qbuffer.h> -#include <qcstring.h> -#include <qfile.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qtextstream.h> +#include <tqbuffer.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqtextstream.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -50,17 +50,17 @@ K_EXPORT_COMPONENT_FACTORY( libhancomwordimport, HancomWordImportFactory( "koffi class HancomWordImport::Private { public: - QString inputFile; - QString outputFile; + TQString inputFile; + TQString outputFile; - QStringList paragraphs; + TQStringList paragraphs; - QByteArray createStyles(); - QByteArray createContent(); - QByteArray createManifest(); + TQByteArray createStyles(); + TQByteArray createContent(); + TQByteArray createManifest(); }; -HancomWordImport::HancomWordImport ( QObject*, const char*, const QStringList& ) +HancomWordImport::HancomWordImport ( TQObject*, const char*, const TQStringList& ) : KoFilter() { d = new Private; @@ -82,7 +82,7 @@ static inline unsigned long readU16( const void* p ) } -KoFilter::ConversionStatus HancomWordImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus HancomWordImport::convert( const TQCString& from, const TQCString& to ) { if ( from != "application/x-hancomword" ) return KoFilter::NotImplemented; @@ -107,18 +107,18 @@ KoFilter::ConversionStatus HancomWordImport::convert( const QCString& from, cons } int len = stream->size() / 2; - QString plaindoc; + TQString plaindoc; plaindoc.reserve( len ); unsigned char* buf = new unsigned char [stream->size()]; stream->read( buf, stream->size()); for(int i = 0; i < len; i++ ) - plaindoc.append( QChar((int)readU16(buf + i*2) ) ); + plaindoc.append( TQChar((int)readU16(buf + i*2) ) ); delete[] buf; delete stream; // split into paragraphs - d->paragraphs = QStringList::split( "\n", plaindoc, true ); + d->paragraphs = TQStringList::split( "\n", plaindoc, true ); // create output store KoStore* storeout; @@ -158,21 +158,21 @@ KoFilter::ConversionStatus HancomWordImport::convert( const QCString& from, cons storeout->close(); // we are done! - d->inputFile = QString::null; - d->outputFile = QString::null; + d->inputFile = TQString(); + d->outputFile = TQString(); delete storeout; return KoFilter::OK; } -QByteArray HancomWordImport::Private::createContent() +TQByteArray HancomWordImport::Private::createContent() { KoXmlWriter* contentWriter; - QByteArray contentData; - QBuffer contentBuffer( contentData ); + TQByteArray contentData; + TQBuffer contentBuffer( contentData ); contentBuffer.open( IO_WriteOnly ); - contentWriter = new KoXmlWriter( &contentBuffer ); + contentWriter = new KoXmlWriter( TQT_TQIODEVICE(&contentBuffer) ); contentWriter->startDocument( "office:document-content" ); contentWriter->startElement( "office:document-content" ); @@ -199,8 +199,8 @@ QByteArray HancomWordImport::Private::createContent() for( uint i = 0; i < paragraphs.count(); i++ ) { - QString text = paragraphs[i]; - text.replace( '\r', ' ' ); + TQString text = paragraphs[i]; + text.tqreplace( '\r', ' ' ); contentWriter->startElement( "text:p" ); contentWriter->addTextNode( text ); contentWriter->endElement(); // text:p @@ -217,14 +217,14 @@ QByteArray HancomWordImport::Private::createContent() return contentData; } -QByteArray HancomWordImport::Private::createStyles() +TQByteArray HancomWordImport::Private::createStyles() { KoXmlWriter* stylesWriter; - QByteArray stylesData; - QBuffer stylesBuffer( stylesData ); + TQByteArray stylesData; + TQBuffer stylesBuffer( stylesData ); stylesBuffer.open( IO_WriteOnly ); - stylesWriter = new KoXmlWriter( &stylesBuffer ); + stylesWriter = new KoXmlWriter( TQT_TQIODEVICE(&stylesBuffer) ); stylesWriter->startDocument( "office:document-styles" ); stylesWriter->startElement( "office:document-styles" ); @@ -273,14 +273,14 @@ QByteArray HancomWordImport::Private::createStyles() return stylesData; } -QByteArray HancomWordImport::Private::createManifest() +TQByteArray HancomWordImport::Private::createManifest() { KoXmlWriter* manifestWriter; - QByteArray manifestData; - QBuffer manifestBuffer( manifestData ); + TQByteArray manifestData; + TQBuffer manifestBuffer( manifestData ); manifestBuffer.open( IO_WriteOnly ); - manifestWriter = new KoXmlWriter( &manifestBuffer ); + manifestWriter = new KoXmlWriter( TQT_TQIODEVICE(&manifestBuffer) ); manifestWriter->startDocument( "manifest:manifest" ); manifestWriter->startElement( "manifest:manifest" ); diff --git a/filters/kword/hancomword/hancomwordimport.h b/filters/kword/hancomword/hancomwordimport.h index 7f3fc7cf..7cacd668 100644 --- a/filters/kword/hancomword/hancomwordimport.h +++ b/filters/kword/hancomword/hancomwordimport.h @@ -23,18 +23,19 @@ #include <KoFilter.h> #include <KoStore.h> -#include <qcstring.h> +#include <tqcstring.h> class HancomWordImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - HancomWordImport ( QObject *parent, const char* name, const QStringList& ); + HancomWordImport ( TQObject *tqparent, const char* name, const TQStringList& ); virtual ~HancomWordImport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: class Private; diff --git a/filters/kword/hancomword/pole.cpp b/filters/kword/hancomword/pole.cpp index cb3771f5..dfcb31f5 100644 --- a/filters/kword/hancomword/pole.cpp +++ b/filters/kword/hancomword/pole.cpp @@ -96,7 +96,7 @@ class DirEntry { public: bool valid; // false if invalid (should be skipped) - std::string name; // the name, not in unicode anymore + std::string name; // the name, not in tqunicode anymore bool dir; // true if directory unsigned long size; // size (not valid if directory) unsigned long start; // starting block @@ -115,9 +115,9 @@ class DirTree DirEntry* entry( unsigned index ); DirEntry* entry( const std::string& name, bool create=false ); int indexOf( DirEntry* e ); - int parent( unsigned index ); + int tqparent( unsigned index ); std::string fullName( unsigned index ); - std::vector<unsigned> children( unsigned index ); + std::vector<unsigned> tqchildren( unsigned index ); void load( unsigned char* buffer, unsigned len ); void save( unsigned char* buffer ); unsigned size(); @@ -505,13 +505,13 @@ int DirTree::indexOf( DirEntry* e ) return -1; } -int DirTree::parent( unsigned index ) +int DirTree::tqparent( unsigned index ) { - // brute-force, basically we iterate for each entries, find its children - // and check if one of the children is 'index' + // brute-force, basically we iterate for each entries, find its tqchildren + // and check if one of the tqchildren is 'index' for( unsigned j=0; j<entryCount(); j++ ) { - std::vector<unsigned> chi = children( j ); + std::vector<unsigned> chi = tqchildren( j ); for( unsigned i=0; i<chi.size();i++ ) if( chi[i] == index ) return j; @@ -527,7 +527,7 @@ std::string DirTree::fullName( unsigned index ) std::string result = entry( index )->name; result.insert( 0, "/" ); - int p = parent( index ); + int p = tqparent( index ); DirEntry * _entry = 0; while( p > 0 ) { @@ -575,8 +575,8 @@ DirEntry* DirTree::entry( const std::string& name, bool create ) for( it = names.begin(); it != names.end(); ++it ) { - // find among the children of index - std::vector<unsigned> chi = children( index ); + // find among the tqchildren of index + std::vector<unsigned> chi = tqchildren( index ); unsigned child = 0; for( unsigned i = 0; i < chi.size(); i++ ) { @@ -591,11 +591,11 @@ DirEntry* DirTree::entry( const std::string& name, bool create ) if( child > 0 ) index = child; else { - // not found among children + // not found among tqchildren if( !create ) return (DirEntry*)0; // create a new entry - unsigned parent = index; + unsigned tqparent = index; entries.push_back( DirEntry() ); index = entryCount()-1; DirEntry* e = entry( index ); @@ -606,8 +606,8 @@ DirEntry* DirTree::entry( const std::string& name, bool create ) e->start = 0; e->child = End; e->prev = End; - e->next = entry(parent)->child; - entry(parent)->child = index; + e->next = entry(tqparent)->child; + entry(tqparent)->child = index; } } @@ -648,7 +648,7 @@ void dirtree_find_siblings( DirTree* dirtree, std::vector<unsigned>& result, } } -std::vector<unsigned> DirTree::children( unsigned index ) +std::vector<unsigned> DirTree::tqchildren( unsigned index ) { std::vector<unsigned> result; @@ -1102,7 +1102,7 @@ StreamIO::StreamIO( StorageIO* s, DirEntry* e) updateCache(); } -// FIXME tell parent we're gone +// FIXME tell tqparent we're gone StreamIO::~StreamIO() { delete[] cache_data; @@ -1248,10 +1248,10 @@ std::list<std::string> Storage::entries( const std::string& path ) DirEntry* e = dt->entry( path, false ); if( e && e->dir ) { - unsigned parent = dt->indexOf( e ); - std::vector<unsigned> children = dt->children( parent ); - for( unsigned i = 0; i < children.size(); i++ ) - result.push_back( dt->entry( children[i] )->name ); + unsigned tqparent = dt->indexOf( e ); + std::vector<unsigned> tqchildren = dt->tqchildren( tqparent ); + for( unsigned i = 0; i < tqchildren.size(); i++ ) + result.push_back( dt->entry( tqchildren[i] )->name ); } return result; @@ -1270,7 +1270,7 @@ Stream::Stream( Storage* storage, const std::string& name ) io = storage->io->streamIO( name ); } -// FIXME tell parent we're gone +// FIXME tell tqparent we're gone Stream::~Stream() { delete io; diff --git a/filters/kword/html/export/ExportBasic.cc b/filters/kword/html/export/ExportBasic.cc index 35d1e399..13864d7a 100644 --- a/filters/kword/html/export/ExportBasic.cc +++ b/filters/kword/html/export/ExportBasic.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextcodec.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqfile.h> #include <klocale.h> #include <kdebug.h> @@ -30,17 +30,17 @@ #include "ExportFilter.h" #include "ExportBasic.h" -HtmlBasicWorker::HtmlBasicWorker( const QString &cssURL ) +HtmlBasicWorker::HtmlBasicWorker( const TQString &cssURL ) { m_cssURL = cssURL; } -QString HtmlBasicWorker::textFormatToCss(const TextFormatting& formatData) const +TQString HtmlBasicWorker::textFormatToCss(const TextFormatting& formatData) const {// PROVISORY - QString strElement; + TQString strElement; // Font name - QString fontName = formatData.fontName; + TQString fontName = formatData.fontName; if ( !fontName.isEmpty() ) { strElement+="font-family: "; @@ -53,7 +53,7 @@ QString HtmlBasicWorker::textFormatToCss(const TextFormatting& formatData) const { // We use absolute font sizes. strElement+="font-size: "; - strElement+=QString::number(size,10); + strElement+=TQString::number(size,10); strElement+="pt; "; } @@ -67,9 +67,9 @@ QString HtmlBasicWorker::textFormatToCss(const TextFormatting& formatData) const return strElement; } -QString HtmlBasicWorker::getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered) +TQString HtmlBasicWorker::getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered) { - QString strResult; + TQString strResult; switch (typeList) { case CounterData::STYLE_CUSTOMBULLET: // We cannot keep the custom type/style @@ -165,7 +165,7 @@ void HtmlBasicWorker::openFormatData(const FormatData& formatOrigin, const FormatData& format, const bool force,const bool allowBold) { bool useCSS = !m_cssURL.isEmpty(); - QString attr; + TQString attr; if( !useCSS && ( force || formatOrigin.text.fontName != format.text.fontName ) && !format.text.fontName.isEmpty() ) { @@ -183,7 +183,7 @@ void HtmlBasicWorker::openFormatData(const FormatData& formatOrigin, if (size<1) size=1; if (size>7) size=7; attr += " size=\""; // in XML numbers must be quoted! - attr += QString::number(size,10); + attr += TQString::number(size,10); attr += "\""; } @@ -307,38 +307,38 @@ void HtmlBasicWorker::closeFormatData(const FormatData& formatOrigin, } -void HtmlBasicWorker::openParagraph(const QString& strTag, - const LayoutData& layout, QChar::Direction direction) +void HtmlBasicWorker::openParagraph(const TQString& strTag, + const LayoutData& tqlayout, TQChar::Direction direction) { *m_streamOut << '<' << strTag; - if ( (layout.alignment=="left") || (layout.alignment== "right") - || (layout.alignment=="center") || (layout.alignment=="justify")) + if ( (tqlayout.tqalignment=="left") || (tqlayout.tqalignment== "right") + || (tqlayout.tqalignment=="center") || (tqlayout.tqalignment=="justify")) { - *m_streamOut << " align=\"" << layout.alignment << "\""; - if ( (direction == QChar::DirRLE) || (direction == QChar::DirRLO) ) + *m_streamOut << " align=\"" << tqlayout.tqalignment << "\""; + if ( (direction == TQChar::DirRLE) || (direction == TQChar::DirRLO) ) *m_streamOut << " dir=\"rtl\""; } - else if ( layout.alignment=="auto") + else if ( tqlayout.tqalignment=="auto") { // Do nothing, the user-agent should be more intelligent than us. } else { - kdWarning(30503) << "Unknown alignment: " << layout.alignment << endl; + kdWarning(30503) << "Unknown tqalignment: " << tqlayout.tqalignment << endl; } *m_streamOut << ">"; // Allow bold only if tag is not a heading! - openFormatData(layout.formatData,layout.formatData,true,(strTag[0]!='h')); + openFormatData(tqlayout.formatData,tqlayout.formatData,true,(strTag[0]!='h')); } -void HtmlBasicWorker::closeParagraph(const QString& strTag, - const LayoutData& layout) +void HtmlBasicWorker::closeParagraph(const TQString& strTag, + const LayoutData& tqlayout) { // Allow bold only if tag is not a heading! - closeFormatData(layout.formatData,layout.formatData,true,(strTag[0]!='h')); + closeFormatData(tqlayout.formatData,tqlayout.formatData,true,(strTag[0]!='h')); *m_streamOut << "</" << strTag << ">\n"; } @@ -360,7 +360,7 @@ bool HtmlBasicWorker::doOpenBody(void) return true; } -QString HtmlBasicWorker::customCSSURL(void) const +TQString HtmlBasicWorker::customCSSURL(void) const { return m_cssURL; } diff --git a/filters/kword/html/export/ExportBasic.h b/filters/kword/html/export/ExportBasic.h index fd573f82..a6de0082 100644 --- a/filters/kword/html/export/ExportBasic.h +++ b/filters/kword/html/export/ExportBasic.h @@ -27,29 +27,29 @@ class HtmlBasicWorker : public HtmlWorker { public: - HtmlBasicWorker( const QString &cssURL = QString::null ); + HtmlBasicWorker( const TQString &cssURL = TQString() ); virtual ~HtmlBasicWorker(void) { } public: protected: - virtual QString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered); - virtual void openParagraph(const QString& strTag, - const LayoutData& layout,QChar::Direction direction=QChar::DirL); - virtual void closeParagraph(const QString& strTag, - const LayoutData& layout); + virtual TQString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered); + virtual void openParagraph(const TQString& strTag, + const LayoutData& tqlayout,TQChar::Direction direction=TQChar::DirL); + virtual void closeParagraph(const TQString& strTag, + const LayoutData& tqlayout); virtual void openSpan(const FormatData& formatOrigin, const FormatData& format); virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format); virtual bool doOpenBody(void); ///< HTML's \<body\> virtual void writeDocType(void); - virtual QString customCSSURL(void) const; + virtual TQString customCSSURL(void) const; private: void openFormatData(const FormatData& formatOrigin, const FormatData& format, const bool force, const bool allowBold); void closeFormatData(const FormatData& formatOrigin, const FormatData& format, const bool force, const bool allowBold); - QString textFormatToCss(const TextFormatting& formatData) const; + TQString textFormatToCss(const TextFormatting& formatData) const; private: - QString m_cssURL; + TQString m_cssURL; }; #endif /* EXPORTBASIC_H */ diff --git a/filters/kword/html/export/ExportCss.cc b/filters/kword/html/export/ExportCss.cc index 0278510d..51c4da91 100644 --- a/filters/kword/html/export/ExportCss.cc +++ b/filters/kword/html/export/ExportCss.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextcodec.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqfile.h> #include <klocale.h> #include <kdebug.h> @@ -31,18 +31,18 @@ #include "ExportFilter.h" #include "ExportCss.h" -QString HtmlCssWorker::escapeCssIdentifier(const QString& strText) const +TQString HtmlCssWorker::escapeCssIdentifier(const TQString& strText) const { // Reference: section 4.1.3 of the CSS2 recommendation // However most HTML user agents support this section only in a restrictive way, so we cannot use any CSS escape // NOTE: we do not guarantee anymore that the style name is unique! (### FIXME) - QString strReturn; + TQString strReturn; // Taken in the restrictive way, an identifier can only start with a letter. - const QChar qch0(strText[0]); - if ((qch0<'a' || qch0>'z') && (qch0<'A' || qch0>'Z')) + const TQChar qch0(strText[0]); + if (((int)qch0<'a' || (int)qch0>'z') && ((int)qch0<'A' || (int)qch0>'Z')) { // Not a letter, so we have to add a prefix strReturn+="kWoRd_"; // The curious spelling is for allowing a HTML import to identfy it and to remove it. @@ -51,8 +51,8 @@ QString HtmlCssWorker::escapeCssIdentifier(const QString& strText) const for (uint i=0; i<strText.length(); i++) { - const QChar qch(strText.at(i)); - const ushort ch=qch.unicode(); + const TQChar qch(strText.at(i)); + const ushort ch=qch.tqunicode(); if (((ch>='a') && (ch<='z')) || ((ch>='A') && (ch<='Z')) @@ -79,29 +79,29 @@ QString HtmlCssWorker::escapeCssIdentifier(const QString& strText) const // but a CSS escape would break some HTML user agents (e.g. Mozilla 1.4) // So we have to do our own incompatible cooking. :-( strReturn+="--"; // start our private escape - strReturn+=QString::number(ch,16); + strReturn+=TQString::number(ch,16); strReturn+="--"; // end our private escape } } return strReturn; } -QString HtmlCssWorker::textFormatToCss(const TextFormatting& formatOrigin, +TQString HtmlCssWorker::textFormatToCss(const TextFormatting& formatOrigin, const TextFormatting& formatData, const bool force) const { // TODO: as this method comes from the AbiWord filter, // TODO: verify that it is working for HTML // TODO: rename variable formatData - QString strElement; // TODO: rename this variable + TQString strElement; // TODO: rename this variable // Font name - QString fontName = formatData.fontName; + TQString fontName = formatData.fontName; if (!fontName.isEmpty() && (force || (formatOrigin.fontName!=formatData.fontName))) { strElement+="font-family: "; - if (fontName.find(' ')==-1) + if (fontName.tqfind(' ')==-1) strElement+=escapeHtmlText(fontName); else { // If the font name contains a space, it should be quoted. @@ -149,7 +149,7 @@ QString HtmlCssWorker::textFormatToCss(const TextFormatting& formatOrigin, { // We use absolute font sizes. strElement+="font-size: "; - strElement+=QString::number(size,10); + strElement+=TQString::number(size,10); strElement+="pt; "; } } @@ -231,9 +231,9 @@ QString HtmlCssWorker::textFormatToCss(const TextFormatting& formatOrigin, return strElement; } -QString HtmlCssWorker::getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered) +TQString HtmlCssWorker::getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered) { - QString strResult; + TQString strResult; switch (typeList) { case CounterData::STYLE_CUSTOMBULLET: // We cannot keep the custom type/style @@ -308,69 +308,69 @@ QString HtmlCssWorker::getStartOfListOpeningTag(const CounterData::Style typeLis return strResult; } -QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force) const +TQString HtmlCssWorker::tqlayoutToCss(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force) const { - QString strLayout; + TQString strLayout; - if (force || (layoutOrigin.alignment!=layout.alignment)) + if (force || (tqlayoutOrigin.tqalignment!=tqlayout.tqalignment)) { - if ( (layout.alignment=="left") || (layout.alignment== "right") - || (layout.alignment=="center") || (layout.alignment=="justify")) + if ( (tqlayout.tqalignment=="left") || (tqlayout.tqalignment== "right") + || (tqlayout.tqalignment=="center") || (tqlayout.tqalignment=="justify")) { - strLayout += QString("text-align:%1; ").arg(layout.alignment); + strLayout += TQString("text-align:%1; ").tqarg(tqlayout.tqalignment); } - else if ( layout.alignment=="auto") + else if ( tqlayout.tqalignment=="auto") { // Do nothing, the user-agent should be more intelligent than us. } else { - kdWarning(30503) << "Unknown alignment: " << layout.alignment << endl; + kdWarning(30503) << "Unknown tqalignment: " << tqlayout.tqalignment << endl; } } - if ((layout.indentLeft>=0.0) - && (force || (layoutOrigin.indentLeft!=layout.indentLeft))) + if ((tqlayout.indentLeft>=0.0) + && (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft))) { - strLayout += QString("margin-left:%1pt; ").arg(layout.indentLeft); + strLayout += TQString("margin-left:%1pt; ").tqarg(tqlayout.indentLeft); } - if ((layout.indentRight>=0.0) - && (force || (layoutOrigin.indentRight!=layout.indentRight))) + if ((tqlayout.indentRight>=0.0) + && (force || (tqlayoutOrigin.indentRight!=tqlayout.indentRight))) { - strLayout += QString("margin-right:%1pt; ").arg(layout.indentRight); + strLayout += TQString("margin-right:%1pt; ").tqarg(tqlayout.indentRight); } - if (force || (layoutOrigin.indentLeft!=layout.indentLeft)) + if (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft)) { - strLayout += QString("text-indent:%1pt; ").arg(layout.indentFirst); + strLayout += TQString("text-indent:%1pt; ").tqarg(tqlayout.indentFirst); } - if ((layout.marginBottom>=0.0) - && ( force || ( layoutOrigin.marginBottom != layout.marginBottom ) ) ) + if ((tqlayout.marginBottom>=0.0) + && ( force || ( tqlayoutOrigin.marginBottom != tqlayout.marginBottom ) ) ) { - strLayout += QString("margin-bottom:%1pt; ").arg(layout.marginBottom); + strLayout += TQString("margin-bottom:%1pt; ").tqarg(tqlayout.marginBottom); } - if ((layout.marginTop>=0.0) - && ( force || ( layoutOrigin.marginTop != layout.marginTop ) ) ) + if ((tqlayout.marginTop>=0.0) + && ( force || ( tqlayoutOrigin.marginTop != tqlayout.marginTop ) ) ) { - strLayout += QString("margin-top:%1pt; ").arg(layout.marginTop); + strLayout += TQString("margin-top:%1pt; ").tqarg(tqlayout.marginTop); } if (force - || ( layoutOrigin.lineSpacingType != layout.lineSpacingType ) - || ( layoutOrigin.lineSpacing != layout.lineSpacing ) ) + || ( tqlayoutOrigin.lineSpacingType != tqlayout.lineSpacingType ) + || ( tqlayoutOrigin.lineSpacing != tqlayout.lineSpacing ) ) { - switch ( layout.lineSpacingType ) + switch ( tqlayout.lineSpacingType ) { case LayoutData::LS_CUSTOM: { // ### TODO: CSS 2 does not known "at-least". #if 0 // We have a custom line spacing (in points) - const QString height ( QString::number(layout.lineSpacing) ); // ### TODO: rounding? + const TQString height ( TQString::number(tqlayout.lineSpacing) ); // ### TODO: rounding? strLayout += "style:line-spacing:"; strLayout += height; strLayout += "pt; "; @@ -394,7 +394,7 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, } case LayoutData::LS_MULTIPLE: { - const QString mult ( QString::number( qRound( layout.lineSpacing * 100 ) ) ); + const TQString mult ( TQString::number( tqRound( tqlayout.lineSpacing * 100 ) ) ); strLayout += "line-height:"; strLayout += mult; strLayout += "%; "; @@ -403,7 +403,7 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, case LayoutData::LS_FIXED: { // We have a fixed line height (in points) - const QString height ( QString::number(layout.lineSpacing) ); // ### TODO: rounding? + const TQString height ( TQString::number(tqlayout.lineSpacing) ); // ### TODO: rounding? strLayout += "line-height:"; strLayout += height; strLayout += "pt; "; @@ -414,7 +414,7 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, // ### TODO: CSS 2 does not known "at-least". // ### TODO: however draft CCS3 (module 'line') has 'line-stacking-strategy' to tweak this behaviour // We have a at-least line height (in points) - const QString height ( QString::number(layout.lineSpacing) ); // ### TODO: rounding? + const TQString height ( TQString::number(tqlayout.lineSpacing) ); // ### TODO: rounding? strLayout += "line-height:"; strLayout += height; strLayout += "pt; "; @@ -422,7 +422,7 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, } default: { - kdWarning(30503) << "Unsupported lineSpacingType: " << layout.lineSpacingType << " (Ignoring!)" << endl; + kdWarning(30503) << "Unsupported lineSpacingType: " << tqlayout.lineSpacingType << " (Ignoring!)" << endl; break; } } @@ -430,12 +430,12 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, // TODO: Konqueror/KHTML does not support "text-shadow" if (!force - && ( layoutOrigin.shadowDirection == layout.shadowDirection ) - && ( layoutOrigin.shadowDistance == layout.shadowDistance ) ) + && ( tqlayoutOrigin.shadowDirection == tqlayout.shadowDirection ) + && ( tqlayoutOrigin.shadowDistance == tqlayout.shadowDistance ) ) { // Do nothing! } - else if ((!layout.shadowDirection) || (!layout.shadowDistance)) + else if ((!tqlayout.shadowDirection) || (!tqlayout.shadowDistance)) { strLayout += "text-shadow:"; strLayout+="none; "; @@ -443,8 +443,8 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, else { double xDistance,yDistance; - const double distance=layout.shadowDistance; - switch (layout.shadowDirection) + const double distance=tqlayout.shadowDistance; + switch (tqlayout.shadowDirection) { case 1: // SD_LEFT_UP { @@ -509,8 +509,8 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, else { strLayout += "text-shadow:"; - strLayout+=QString("%1 %2pt %3pt; ").arg(layout.shadowColor.name()) - .arg(xDistance,0,'f',0).arg(yDistance,0,'f',0); + strLayout+=TQString("%1 %2pt %3pt; ").tqarg(tqlayout.shadowColor.name()) + .tqarg(xDistance,0,'f',0).tqarg(yDistance,0,'f',0); // We do not want any scientific notation or any decimal } } @@ -518,61 +518,61 @@ QString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin, // TODO: borders // This must remain last, as the last property does not have a semi-colon - strLayout+=textFormatToCss(layoutOrigin.formatData.text, - layout.formatData.text,force); + strLayout+=textFormatToCss(tqlayoutOrigin.formatData.text, + tqlayout.formatData.text,force); return strLayout; } -void HtmlCssWorker::openParagraph(const QString& strTag, - const LayoutData& layout, QChar::Direction direction) +void HtmlCssWorker::openParagraph(const TQString& strTag, + const LayoutData& tqlayout, TQChar::Direction direction) { - const LayoutData& styleLayout=m_styleMap[layout.styleName]; + const LayoutData& styleLayout=m_styleMap[tqlayout.styleName]; *m_streamOut << '<' << strTag; // Opening elements - *m_streamOut << " class=\"" << escapeCssIdentifier(layout.styleName); + *m_streamOut << " class=\"" << escapeCssIdentifier(tqlayout.styleName); *m_streamOut << "\""; - QString strStyle=layoutToCss(styleLayout,layout,false); + TQString strStyle=tqlayoutToCss(styleLayout,tqlayout,false); if (!strStyle.isEmpty()) { *m_streamOut << " style=\"" << strStyle; - if (direction == QChar::DirRLE) { - *m_streamOut << "direction: rtl; unicode-bidi: embed; "; - } else if (direction == QChar::DirRLO) { - *m_streamOut << "direction: rtl; unicode-bidi: override; "; + if (direction == TQChar::DirRLE) { + *m_streamOut << "direction: rtl; tqunicode-bidi: embed; "; + } else if (direction == TQChar::DirRLO) { + *m_streamOut << "direction: rtl; tqunicode-bidi: override; "; } *m_streamOut<< "\""; } *m_streamOut << ">"; - if ( 1==layout.formatData.text.verticalAlignment ) + if ( 1==tqlayout.formatData.text.verticalAlignment ) { *m_streamOut << "<sub>"; //Subscript } - else if ( 2==layout.formatData.text.verticalAlignment ) + else if ( 2==tqlayout.formatData.text.verticalAlignment ) { *m_streamOut << "<sup>"; //Superscript } - if ( layout.alignment == "center" ) *m_streamOut << "<center>"; + if ( tqlayout.tqalignment == "center" ) *m_streamOut << "<center>"; } -void HtmlCssWorker::closeParagraph(const QString& strTag, - const LayoutData& layout) +void HtmlCssWorker::closeParagraph(const TQString& strTag, + const LayoutData& tqlayout) { - if ( 2==layout.formatData.text.verticalAlignment ) + if ( 2==tqlayout.formatData.text.verticalAlignment ) { *m_streamOut << "</sup>"; //Superscript } - else if ( 1==layout.formatData.text.verticalAlignment ) + else if ( 1==tqlayout.formatData.text.verticalAlignment ) { *m_streamOut << "</sub>"; //Subscript } - if ( layout.alignment == "center" ) *m_streamOut << "</center>"; + if ( tqlayout.tqalignment == "center" ) *m_streamOut << "</center>"; *m_streamOut << "</" << strTag << ">\n"; } @@ -609,20 +609,20 @@ void HtmlCssWorker::closeSpan(const FormatData& formatOrigin, const FormatData& bool HtmlCssWorker::doFullPaperFormat(const int format, const double width, const double height, const int orientation) { - QString strWidth, strHeight, strUnits; + TQString strWidth, strHeight, strUnits; KWEFUtil::GetNativePaperFormat(format, strWidth, strHeight, strUnits); if ((strWidth.isEmpty())||(strHeight.isEmpty())||(strUnits.isEmpty())) { // page format is unknown, so we need the size information strUnits="pt"; - strWidth=QString::number(width); - strHeight=QString::number(height); + strWidth=TQString::number(width); + strHeight=TQString::number(height); } if (orientation==1) { // Landscape, so we must swap the sizes - QString strTemp(strWidth); + TQString strTemp(strWidth); strWidth=strHeight; strHeight=strTemp; } @@ -641,16 +641,16 @@ bool HtmlCssWorker::doFullPaperBorders (const double top, const double left, const double bottom, const double right) { m_strPaperBorders=" margin-top: "; - m_strPaperBorders+=QString::number(top); + m_strPaperBorders+=TQString::number(top); m_strPaperBorders+="pt;\n"; m_strPaperBorders+=" margin-left: "; - m_strPaperBorders+=QString::number(left); + m_strPaperBorders+=TQString::number(left); m_strPaperBorders+="pt;\n"; m_strPaperBorders+=" margin-bottom: "; - m_strPaperBorders+=QString::number(bottom); + m_strPaperBorders+=TQString::number(bottom); m_strPaperBorders+="pt;\n"; m_strPaperBorders+=" margin-right: "; - m_strPaperBorders+=QString::number(right); + m_strPaperBorders+=TQString::number(right); m_strPaperBorders+="pt;\n"; return true; @@ -667,7 +667,7 @@ bool HtmlCssWorker::doOpenStyles(void) } // Say who we are (with the CVS revision number) - const QString strVersion("$Revision: 483471 $"); + const TQString strVersion("$Revision: 483471 $"); // Eliminate the dollar signs // (We don't want that the version number changes if the HTML file is itself put in a CVS storage.) *m_streamOut << "/* KWORD_CSS_EXPORT =" @@ -680,16 +680,16 @@ bool HtmlCssWorker::doOpenStyles(void) return true; } -bool HtmlCssWorker::doFullDefineStyle(LayoutData& layout) +bool HtmlCssWorker::doFullDefineStyle(LayoutData& tqlayout) { //Register style in the style map - m_styleMap[layout.styleName]=layout; + m_styleMap[tqlayout.styleName]=tqlayout; // We do not limit (anymore) any style to <h1> ... <h6>, because - // the style could be forced on <p> by the layout. + // the style could be forced on <p> by the tqlayout. - *m_streamOut << "." << escapeCssIdentifier(layout.styleName); - *m_streamOut << "\n{\n " << layoutToCss(layout,layout,true) << "\n}\n"; + *m_streamOut << "." << escapeCssIdentifier(tqlayout.styleName); + *m_streamOut << "\n{\n " << tqlayoutToCss(tqlayout,tqlayout,true) << "\n}\n"; return true; } diff --git a/filters/kword/html/export/ExportCss.h b/filters/kword/html/export/ExportCss.h index 82121128..acbf20cc 100644 --- a/filters/kword/html/export/ExportCss.h +++ b/filters/kword/html/export/ExportCss.h @@ -21,12 +21,12 @@ #ifndef EXPORTCSS_H #define EXPORTCSS_H -#include <qmap.h> +#include <tqmap.h> #include <KWEFBaseWorker.h> #include "ExportFilter.h" -class StyleMap : public QMap<QString,LayoutData> +class StyleMap : public TQMap<TQString,LayoutData> { public: StyleMap(void) {} @@ -41,27 +41,27 @@ public: public: virtual bool doOpenStyles(void); ///< HTML's \<style\> virtual bool doCloseStyles(void); ///< HTML's \</style\> - virtual bool doFullDefineStyle(LayoutData& layout); + virtual bool doFullDefineStyle(LayoutData& tqlayout); virtual bool doFullPaperFormat(const int format, const double width, const double height, const int orientation); virtual bool doFullPaperBorders (const double top, const double left, const double bottom, const double right); ///< Like KWord's \<PAPERBORDERS\> protected: - virtual QString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered); - virtual void openParagraph(const QString& strTag, const LayoutData& layout, - QChar::Direction direction=QChar::DirL); - virtual void closeParagraph(const QString& strTag, const LayoutData& layout); + virtual TQString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered); + virtual void openParagraph(const TQString& strTag, const LayoutData& tqlayout, + TQChar::Direction direction=TQChar::DirL); + virtual void closeParagraph(const TQString& strTag, const LayoutData& tqlayout); virtual void openSpan(const FormatData& formatOrigin, const FormatData& format); virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format); private: - QString layoutToCss(const LayoutData& layoutOrigin,const LayoutData& layout, + TQString tqlayoutToCss(const LayoutData& tqlayoutOrigin,const LayoutData& tqlayout, const bool force) const; - QString escapeCssIdentifier(const QString& strText) const; - QString textFormatToCss(const TextFormatting& formatOrigin, + TQString escapeCssIdentifier(const TQString& strText) const; + TQString textFormatToCss(const TextFormatting& formatOrigin, const TextFormatting& formatData, const bool force) const; private: - QString m_strPageSize; - QString m_strPaperBorders; + TQString m_strPageSize; + TQString m_strPaperBorders; StyleMap m_styleMap; }; diff --git a/filters/kword/html/export/ExportDialog.cc b/filters/kword/html/export/ExportDialog.cc index 81e126ae..3f1d0b3e 100644 --- a/filters/kword/html/export/ExportDialog.cc +++ b/filters/kword/html/export/ExportDialog.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <klocale.h> #include <kcharsets.h> @@ -27,44 +27,44 @@ #include <kapplication.h> #include <kcombobox.h> #include <kmessagebox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> -#include <qcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> +#include <tqcheckbox.h> #include <kurlrequester.h> #include <ExportDialogUI.h> #include <ExportDialog.h> -HtmlExportDialog :: HtmlExportDialog(QWidget* parent) - : KDialogBase(parent, 0, true, i18n("KWord's HTML Export Filter"), Ok|Cancel, No, true), +HtmlExportDialog :: HtmlExportDialog(TQWidget* tqparent) + : KDialogBase(tqparent, 0, true, i18n("KWord's HTML Export Filter"), Ok|Cancel, No, true), m_dialog(new ExportDialogUI(this)) { kapp->restoreOverrideCursor(); - QStringList encodingList; + TQStringList encodingList; - encodingList += i18n( "Descriptive encoding name", "Recommended ( %1 )" ).arg( "UTF-8" ); - encodingList += i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( QTextCodec::codecForLocale()->name() ); + encodingList += i18n( "Descriptive encoding name", "Recommended ( %1 )" ).tqarg( "UTF-8" ); + encodingList += i18n( "Descriptive encoding name", "Locale ( %1 )" ).tqarg( TQTextCodec::codecForLocale()->name() ); encodingList += KGlobal::charsets()->descriptiveEncodingNames(); m_dialog->comboBoxEncoding->insertStringList( encodingList ); m_dialog->KURL_ExternalCSS->setMode( KFile::ExistingOnly ); - connect(m_dialog->radioModeEnhanced, SIGNAL( toggled( bool ) ), - SLOT( setCSSEnabled( bool ) ) ); - connect(m_dialog->checkExternalCSS, SIGNAL( toggled( bool ) ), - m_dialog->KURL_ExternalCSS, SLOT( setEnabled( bool ) ) ); + connect(m_dialog->radioModeEnhanced, TQT_SIGNAL( toggled( bool ) ), + TQT_SLOT( setCSSEnabled( bool ) ) ); + connect(m_dialog->checkExternalCSS, TQT_SIGNAL( toggled( bool ) ), + m_dialog->KURL_ExternalCSS, TQT_SLOT( setEnabled( bool ) ) ); setMainWidget(m_dialog); } HtmlExportDialog :: ~HtmlExportDialog(void) { - kapp->setOverrideCursor(Qt::waitCursor); + kapp->setOverrideCursor(TQt::waitCursor); } void HtmlExportDialog::setCSSEnabled( bool b ) @@ -82,15 +82,15 @@ bool HtmlExportDialog::isXHtml(void) const return true; } -QTextCodec* HtmlExportDialog::getCodec(void) const +TQTextCodec* HtmlExportDialog::getCodec(void) const { - const QString strCodec( KGlobal::charsets()->encodingForName( m_dialog->comboBoxEncoding->currentText() ) ); + const TQString strCodec( KGlobal::charsets()->encodingForName( m_dialog->comboBoxEncoding->currentText() ) ); kdDebug(30503) << "Encoding: " << strCodec << endl; bool ok = false; - QTextCodec* codec = QTextCodec::codecForName( strCodec.utf8() ); + TQTextCodec* codec = TQTextCodec::codecForName( strCodec.utf8() ); - // If QTextCodec has not found a valid encoding, so try with KCharsets. + // If TQTextCodec has not found a valid encoding, so try with KCharsets. if ( codec ) { ok = true; @@ -105,8 +105,8 @@ QTextCodec* HtmlExportDialog::getCodec(void) const { // Default: UTF-8 kdWarning(30503) << "Cannot find encoding:" << strCodec << endl; - // ### TODO: what parent to use? - KMessageBox::error( 0, i18n("Cannot find encoding: %1").arg( strCodec ) ); + // ### TODO: what tqparent to use? + KMessageBox::error( 0, i18n("Cannot find encoding: %1").tqarg( strCodec ) ); return 0; } @@ -137,7 +137,7 @@ HtmlExportDialog::Mode HtmlExportDialog::getMode(void) const return DefaultCSS;//Our default } -QString HtmlExportDialog::cssURL(void) const +TQString HtmlExportDialog::cssURL(void) const { return m_dialog->KURL_ExternalCSS->url(); } diff --git a/filters/kword/html/export/ExportDialog.h b/filters/kword/html/export/ExportDialog.h index 2a85c1c2..978f6e6b 100644 --- a/filters/kword/html/export/ExportDialog.h +++ b/filters/kword/html/export/ExportDialog.h @@ -21,7 +21,7 @@ #ifndef EXPORT_DIALOG_H #define EXPORT_DIALOG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> class ExportDialogUI; @@ -29,6 +29,7 @@ class ExportDialogUI; class HtmlExportDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: enum Mode { @@ -38,12 +39,12 @@ public: CustomCSS }; - HtmlExportDialog(QWidget* parent=NULL); + HtmlExportDialog(TQWidget* tqparent=NULL); ~HtmlExportDialog(void); bool isXHtml(void) const; - QTextCodec* getCodec(void) const; + TQTextCodec* getCodec(void) const; Mode getMode(void) const; - QString cssURL(void) const; + TQString cssURL(void) const; protected slots: void setCSSEnabled( bool ); diff --git a/filters/kword/html/export/ExportDialogUI.ui b/filters/kword/html/export/ExportDialogUI.ui index 090024f9..474d2912 100644 --- a/filters/kword/html/export/ExportDialogUI.ui +++ b/filters/kword/html/export/ExportDialogUI.ui @@ -2,7 +2,7 @@ <class>ExportDialogUI</class> <comment>Export dialog for KWord's HTML export filter</comment> <author>Nicolas GOUTTE <goutte@kde.org></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ExportDialogUI</cstring> </property> @@ -27,15 +27,15 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -67,7 +67,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>106</width> <height>20</height> @@ -76,7 +76,7 @@ </spacer> </hbox> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroup1</cstring> </property> @@ -93,7 +93,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioDocType1</cstring> </property> @@ -110,7 +110,7 @@ <string>HTML 4.01 (For older HTML user agents) </string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioDocType2</cstring> </property> @@ -126,7 +126,7 @@ </widget> </vbox> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroupMode</cstring> </property> @@ -143,7 +143,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioModeLight</cstring> </property> @@ -160,7 +160,7 @@ <string>Convert mainly the document structure (Recommended for exporting to browsers with limited capabilities)</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioModeBasic</cstring> </property> @@ -180,7 +180,7 @@ <string>Convert most of the document (Recommended for re-importing in KWord or for exporting to older browsers)</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>radioModeEnhanced</cstring> </property> @@ -194,9 +194,9 @@ <string>Convert as much as possible of the KWord document (Recommended for exporting to other modern word processors or to modern browsers)</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <hbox> <property name="name"> @@ -212,22 +212,22 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>checkExternalCSS</cstring> </property> @@ -262,7 +262,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>90</height> @@ -279,7 +279,7 @@ <tabstop>radioModeLight</tabstop> <tabstop>radioModeEnhanced</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>klineedit.h</includehint> diff --git a/filters/kword/html/export/ExportDocStruct.cc b/filters/kword/html/export/ExportDocStruct.cc index 5f0fc53c..545d3e31 100644 --- a/filters/kword/html/export/ExportDocStruct.cc +++ b/filters/kword/html/export/ExportDocStruct.cc @@ -18,9 +18,9 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextcodec.h> -#include <qfile.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqfile.h> #include <klocale.h> #include <kdebug.h> @@ -30,9 +30,9 @@ #include "ExportFilter.h" #include "ExportDocStruct.h" -QString HtmlDocStructWorker::getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered) +TQString HtmlDocStructWorker::getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered) { - QString strResult; + TQString strResult; switch (typeList) { case CounterData::STYLE_CUSTOMBULLET: @@ -66,7 +66,7 @@ void HtmlDocStructWorker::openFormatData(const FormatData& formatOrigin, { // TODO/FIXME: find another way to find fixed fonts // TODO/FIXME: (leaves out "Typewriter", "Monospace", "Mono") - if (format.text.fontName.contains("ourier")) + if (format.text.fontName.tqcontains("ourier")) { *m_streamOut << "<tt>"; // teletype } @@ -133,23 +133,23 @@ void HtmlDocStructWorker::closeFormatData(const FormatData& formatOrigin, } } - if (format.text.fontName.contains("ourier")) // Courier? + if (format.text.fontName.tqcontains("ourier")) // Courier? { *m_streamOut << "</tt>"; // teletype } } -void HtmlDocStructWorker::openParagraph(const QString& strTag, - const LayoutData& layout,QChar::Direction /*direction*/) +void HtmlDocStructWorker::openParagraph(const TQString& strTag, + const LayoutData& tqlayout,TQChar::Direction /*direction*/) { *m_streamOut << '<' << strTag << ">"; - openFormatData(layout.formatData,layout.formatData,true,(strTag[0]!='h')); + openFormatData(tqlayout.formatData,tqlayout.formatData,true,(strTag[0]!='h')); } -void HtmlDocStructWorker::closeParagraph(const QString& strTag, - const LayoutData& layout) +void HtmlDocStructWorker::closeParagraph(const TQString& strTag, + const LayoutData& tqlayout) { - closeFormatData(layout.formatData,layout.formatData,true,(strTag[0]!='h')); + closeFormatData(tqlayout.formatData,tqlayout.formatData,true,(strTag[0]!='h')); *m_streamOut << "</" << strTag << ">\n"; } diff --git a/filters/kword/html/export/ExportDocStruct.h b/filters/kword/html/export/ExportDocStruct.h index 507afd08..43b1e76a 100644 --- a/filters/kword/html/export/ExportDocStruct.h +++ b/filters/kword/html/export/ExportDocStruct.h @@ -31,11 +31,11 @@ public: virtual ~HtmlDocStructWorker(void) { } public: protected: - virtual QString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered); - virtual void openParagraph(const QString& strTag, - const LayoutData& layout,QChar::Direction direction=QChar::DirL); - virtual void closeParagraph(const QString& strTag, - const LayoutData& layout); + virtual TQString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered); + virtual void openParagraph(const TQString& strTag, + const LayoutData& tqlayout,TQChar::Direction direction=TQChar::DirL); + virtual void closeParagraph(const TQString& strTag, + const LayoutData& tqlayout); virtual void openSpan(const FormatData& formatOrigin, const FormatData& format); virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format); private: diff --git a/filters/kword/html/export/ExportFilter.cc b/filters/kword/html/export/ExportFilter.cc index 87bd811f..225a51ea 100644 --- a/filters/kword/html/export/ExportFilter.cc +++ b/filters/kword/html/export/ExportFilter.cc @@ -18,12 +18,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qpicture.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqpicture.h> #include <klocale.h> #include <kdebug.h> @@ -33,7 +33,7 @@ #include "ExportFilter.h" -QString HtmlWorker::escapeHtmlText(const QString& strText) const +TQString HtmlWorker::escapeHtmlText(const TQString& strText) const { // Escape quotes (needed in attributes) // Do not escape apostrophs (only allowed in XHTML!) @@ -45,7 +45,7 @@ bool HtmlWorker::makeTable(const FrameAnchor& anchor) *m_streamOut << "<table>\n"; *m_streamOut << "<tbody>\n"; - QValueList<TableCell>::ConstIterator itCell; + TQValueList<TableCell>::ConstIterator itCell; int rowCurrent=0; *m_streamOut << "<tr>\n"; @@ -82,11 +82,11 @@ bool HtmlWorker::makeTable(const FrameAnchor& anchor) return true; } -QString HtmlWorker::getAdditionalFileName(const QString& additionalName) +TQString HtmlWorker::getAdditionalFileName(const TQString& additionalName) { kdDebug(30503) << "HtmlWorker::getAdditionalFileName " << additionalName << endl; - QDir dir(m_strFileDir); + TQDir dir(m_strFileDir); kdDebug(30503) << "Base directory: " << m_strFileDir << endl; if (!dir.exists(m_strSubDirectoryName)) @@ -96,9 +96,9 @@ QString HtmlWorker::getAdditionalFileName(const QString& additionalName) dir.mkdir(m_strSubDirectoryName); } - QString strFileName(m_strSubDirectoryName); + TQString strFileName(m_strSubDirectoryName); strFileName+="/"; - const int result=additionalName.findRev("/"); + const int result=additionalName.tqfindRev("/"); if (result>=0) { strFileName+=additionalName.mid(result+1); @@ -110,7 +110,7 @@ QString HtmlWorker::getAdditionalFileName(const QString& additionalName) // Now, we have to create a backup file. - QString strBackupName(strFileName); + TQString strBackupName(strFileName); strBackupName+="~"; kdDebug(30503) << "Remove backup file: " << strBackupName << endl; // We need to remove the backup file, as not all filesystems or ports can do it themselves on a rename. @@ -123,13 +123,13 @@ QString HtmlWorker::getAdditionalFileName(const QString& additionalName) bool HtmlWorker::makeImage(const FrameAnchor& anchor) { - const QString strImageName(getAdditionalFileName(anchor.picture.koStoreName)); + const TQString strImageName(getAdditionalFileName(anchor.picture.koStoreName)); - QString strImagePath(m_strFileDir); + TQString strImagePath(m_strFileDir); strImagePath+='/'; strImagePath+=strImageName; - QByteArray image; + TQByteArray image; kdDebug(30503) << "Image " << anchor.picture.koStoreName << " will be written in " << strImageName << endl; @@ -140,8 +140,8 @@ bool HtmlWorker::makeImage(const FrameAnchor& anchor) const double height = anchor.frame.bottom - anchor.frame.top; const double width = anchor.frame.right - anchor.frame.left; - const int pos = anchor.picture.koStoreName.findRev( '.' ); - QString extension; + const int pos = anchor.picture.koStoreName.tqfindRev( '.' ); + TQString extension; if ( pos > -1 ) extension = anchor.picture.koStoreName.mid( pos+1 ).lower(); @@ -166,16 +166,16 @@ bool HtmlWorker::makeImage(const FrameAnchor& anchor) else if ( extension == "qpic" ) { - QPicture picture; + TQPicture picture; - QIODevice* io=getSubFileDevice(anchor.picture.koStoreName); + TQIODevice* io=getSubFileDevice(anchor.picture.koStoreName); if (!io) { // NO message error, as there must be already one return false; } - // TODO: if we have alreasy SVG, do *not* go through QPicture! + // TODO: if we have alreasy SVG, do *not* go through TQPicture! if (picture.load(io)) { @@ -215,7 +215,7 @@ bool HtmlWorker::makeImage(const FrameAnchor& anchor) // Do we still need to write the original picture? if ( writePicture ) { - QFile file(strImagePath); + TQFile file(strImagePath); if ( !file.open (IO_WriteOnly) ) { @@ -235,17 +235,17 @@ bool HtmlWorker::makeImage(const FrameAnchor& anchor) return true; } -void HtmlWorker::formatTextParagraph(const QString& strText, +void HtmlWorker::formatTextParagraph(const TQString& strText, const FormatData& formatOrigin, const FormatData& format) { - QString strEscaped(escapeHtmlText(strText)); + TQString strEscaped(escapeHtmlText(strText)); // Replace line feeds by line breaks int pos; - QString strBr(isXML()?QString("<br />"):QString("<br>")); - while ((pos=strEscaped.find(QChar(10)))>-1) + TQString strBr(isXML()?TQString("<br />"):TQString("<br>")); + while ((pos=strEscaped.tqfind(TQChar(10)))>-1) { - strEscaped.replace(pos,1,strBr); + strEscaped.tqreplace(pos,1,strBr); } if (!format.text.missing) @@ -274,14 +274,14 @@ void HtmlWorker::formatTextParagraph(const QString& strText, } } -void HtmlWorker::ProcessParagraphData (const QString& strTag, const QString ¶Text, - const LayoutData& layout, const ValueListFormatData ¶FormatDataList) +void HtmlWorker::ProcessParagraphData (const TQString& strTag, const TQString ¶Text, + const LayoutData& tqlayout, const ValueListFormatData ¶FormatDataList) { if (paraText.isEmpty() && paraFormatDataList.first().id != 6) { - openParagraph(strTag,layout); + openParagraph(strTag,tqlayout); *m_streamOut << " " ; // A paragraph can never be empty in HTML - closeParagraph(strTag,layout); + closeParagraph(strTag,tqlayout); } else { @@ -289,7 +289,7 @@ void HtmlWorker::ProcessParagraphData (const QString& strTag, const QString &par ValueListFormatData::ConstIterator paraFormatDataIt; - QString partialText; + TQString partialText; for ( paraFormatDataIt = paraFormatDataList.begin (); paraFormatDataIt != paraFormatDataList.end (); @@ -302,17 +302,17 @@ void HtmlWorker::ProcessParagraphData (const QString& strTag, const QString &par // For normal text, we need an opened paragraph if (paragraphNotOpened) { - openParagraph(strTag,layout,partialText.ref(0).direction()); + openParagraph(strTag,tqlayout,partialText.ref(0).direction()); paragraphNotOpened=false; } - formatTextParagraph(partialText,layout.formatData,*paraFormatDataIt); + formatTextParagraph(partialText,tqlayout.formatData,*paraFormatDataIt); } else if (4==(*paraFormatDataIt).id) { // For variables, we need an opened paragraph if (paragraphNotOpened) { - openParagraph(strTag,layout); + openParagraph(strTag,tqlayout); paragraphNotOpened=false; } if (9==(*paraFormatDataIt).variable.m_type) @@ -341,7 +341,7 @@ void HtmlWorker::ProcessParagraphData (const QString& strTag, const QString &par if (!paragraphNotOpened) { // The paragraph was opened, so close it. - closeParagraph(strTag,layout); + closeParagraph(strTag,tqlayout); } makeTable((*paraFormatDataIt).frameAnchor); // The paragraph will need to be opened again @@ -355,7 +355,7 @@ void HtmlWorker::ProcessParagraphData (const QString& strTag, const QString &par // <img> and <object> need to be in a paragraph if (paragraphNotOpened) { - openParagraph( strTag, layout,partialText.ref(0). direction() ); + openParagraph( strTag, tqlayout,partialText.ref(0). direction() ); paragraphNotOpened=false; } makeImage((*paraFormatDataIt).frameAnchor); @@ -370,36 +370,36 @@ void HtmlWorker::ProcessParagraphData (const QString& strTag, const QString &par if (!paragraphNotOpened) { // The paragraph was opened, so close it. - closeParagraph(strTag,layout); + closeParagraph(strTag,tqlayout); } } } -bool HtmlWorker::doFullParagraph(const QString& paraText, - const LayoutData& layout, const ValueListFormatData& paraFormatDataList) +bool HtmlWorker::doFullParagraph(const TQString& paraText, + const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { kdDebug(30503) << "Entering HtmlWorker::doFullParagraph" << endl << paraText << endl; - QString strParaText=paraText; - QString strTag; // Tag that will be written. + TQString strParaText=paraText; + TQString strTag; // Tag that will be written. - if ( layout.counter.numbering == CounterData::NUM_LIST ) + if ( tqlayout.counter.numbering == CounterData::NUM_LIST ) { - const uint layoutDepth=layout.counter.depth+1; // Word's depth starts at 0! + const uint tqlayoutDepth=tqlayout.counter.depth+1; // Word's depth starts at 0! const uint listDepth=m_listStack.size(); // We are in a list, but has it the right depth? - if (layoutDepth>listDepth) + if (tqlayoutDepth>listDepth) { ListInfo newList; - newList.m_typeList=layout.counter.style; - for (uint i=listDepth; i<layoutDepth; i++) + newList.m_typeList=tqlayout.counter.style; + for (uint i=listDepth; i<tqlayoutDepth; i++) { - *m_streamOut << getStartOfListOpeningTag(layout.counter.style,newList.m_orderedList); + *m_streamOut << getStartOfListOpeningTag(tqlayout.counter.style,newList.m_orderedList); m_listStack.push(newList); } } - else if (layoutDepth<listDepth) + else if (tqlayoutDepth<listDepth) { - for (uint i=listDepth; i>layoutDepth; i--) + for (uint i=listDepth; i>tqlayoutDepth; i--) { ListInfo oldList=m_listStack.pop(); if (oldList.m_orderedList) @@ -414,7 +414,7 @@ bool HtmlWorker::doFullParagraph(const QString& paraText, } // We have a list but does it have the right type? - if ( layout.counter.style!=m_listStack.top().m_typeList) + if ( tqlayout.counter.style!=m_listStack.top().m_typeList) { // No, then close the previous list ListInfo oldList=m_listStack.pop(); @@ -427,8 +427,8 @@ bool HtmlWorker::doFullParagraph(const QString& paraText, *m_streamOut << "</ul>\n"; } ListInfo newList; - *m_streamOut << getStartOfListOpeningTag(layout.counter.style,newList.m_orderedList); - newList.m_typeList=layout.counter.style; + *m_streamOut << getStartOfListOpeningTag(tqlayout.counter.style,newList.m_orderedList); + newList.m_typeList=tqlayout.counter.style; m_listStack.push(newList); } @@ -453,10 +453,10 @@ bool HtmlWorker::doFullParagraph(const QString& paraText, } } } - if ( (layout.counter.numbering == CounterData::NUM_CHAPTER) - && (layout.counter.depth<6) ) + if ( (tqlayout.counter.numbering == CounterData::NUM_CHAPTER) + && (tqlayout.counter.depth<6) ) { - strTag=QString("h%1").arg(layout.counter.depth + 1); // H1 ... H6 + strTag=TQString("h%1").tqarg(tqlayout.counter.depth + 1); // H1 ... H6 } else { @@ -464,15 +464,15 @@ bool HtmlWorker::doFullParagraph(const QString& paraText, } } - ProcessParagraphData(strTag, strParaText, layout, paraFormatDataList); + ProcessParagraphData(strTag, strParaText, tqlayout, paraFormatDataList); kdDebug(30503) << "Quiting HtmlWorker::doFullParagraph" << endl; return true; } -bool HtmlWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool HtmlWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { - m_ioDevice=new QFile(filenameOut); + m_ioDevice=TQT_TQIODEVICE(new TQFile(filenameOut)); if (!m_ioDevice) { @@ -486,11 +486,11 @@ bool HtmlWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) return false; } - m_streamOut=new QTextStream(m_ioDevice); + m_streamOut=new TQTextStream(m_ioDevice); if (!getCodec()) { - kdError(30503) << "Could not create QTextCodec! Aborting" << endl; + kdError(30503) << "Could not create TQTextCodec! Aborting" << endl; return false; } @@ -499,7 +499,7 @@ bool HtmlWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) m_streamOut->setCodec( getCodec() ); m_fileName=filenameOut; - QFileInfo base(m_fileName); + TQFileInfo base(m_fileName); m_strFileDir=base.dirPath(); m_strTitle=base.fileName(); m_strSubDirectoryName=base.fileName(); @@ -565,7 +565,7 @@ bool HtmlWorker::doCloseDocument(void) bool HtmlWorker::doFullDocumentInfo(const KWEFDocumentInfo& docInfo) { - QString strText=docInfo.title; + TQString strText=docInfo.title; if (!strText.isEmpty()) { m_strTitle=strText; // Set title only if it is not empty! @@ -584,7 +584,7 @@ bool HtmlWorker::doOpenHead(void) *m_streamOut << (isXML()?" /":"") << ">\n" ; // Say who we are (with the CVS revision number) in case we have a bug in our filter output! - QString strVersion("$Revision: 466447 $"); + TQString strVersion("$Revision: 466447 $"); // Eliminate the dollar signs // (We don't want that the version number changes if the HTML file is itself put in a CVS storage.) *m_streamOut << "<meta name=\"Generator\" content=\"KWord HTML Export Filter Version" diff --git a/filters/kword/html/export/ExportFilter.h b/filters/kword/html/export/ExportFilter.h index b1a939d0..f8446c1b 100644 --- a/filters/kword/html/export/ExportFilter.h +++ b/filters/kword/html/export/ExportFilter.h @@ -21,7 +21,7 @@ #ifndef EXPORTFILTERFULLPOWER_H #define EXPORTFILTERFULLPOWER_H -#include <qvaluestack.h> +#include <tqvaluestack.h> #include <KWEFBaseWorker.h> @@ -38,11 +38,11 @@ public: HtmlWorker(void) : m_ioDevice(NULL), m_streamOut(NULL) { } virtual ~HtmlWorker(void) { delete m_streamOut; delete m_ioDevice; } public: - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); // Close file in normal conditions virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); virtual bool doFullDocumentInfo(const KWEFDocumentInfo& docInfo); virtual bool doOpenTextFrameSet(void); @@ -52,27 +52,27 @@ public: virtual bool doOpenBody(void); ///< HTML's \<body\> virtual bool doCloseBody(void); ///< HTML's \</body\> protected: - virtual QString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered)=0; + virtual TQString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered)=0; /** - * \note QChar::Direction is needed because the text flow can only + * \note TQChar::Direction is needed because the text flow can only * be detected from the actual string data */ - virtual void openParagraph(const QString& strTag, - const LayoutData& layout, QChar::Direction direction=QChar::DirL)=0; - virtual void closeParagraph(const QString& strTag, - const LayoutData& layout)=0; + virtual void openParagraph(const TQString& strTag, + const LayoutData& tqlayout, TQChar::Direction direction=TQChar::DirL)=0; + virtual void closeParagraph(const TQString& strTag, + const LayoutData& tqlayout)=0; virtual void openSpan(const FormatData& formatOrigin, const FormatData& format)=0; virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format)=0; virtual void writeDocType(void); - virtual QString customCSSURL(void) const { return QString::null; } + virtual TQString customCSSURL(void) const { return TQString(); } public: inline bool isXML (void) const { return m_xml; } inline void setXML (const bool flag ) { m_xml=flag; } - inline QTextCodec* getCodec(void) const { return m_codec; } - inline void setCodec(QTextCodec* codec) { m_codec=codec; } + inline TQTextCodec* getCodec(void) const { return m_codec; } + inline void setCodec(TQTextCodec* codec) { m_codec=codec; } protected: - QString escapeHtmlText(const QString& strText) const; + TQString escapeHtmlText(const TQString& strText) const; /** * \brief Get file name for an additional file * @@ -81,23 +81,23 @@ protected: * \param additionalName is the wanted name * \return the path where the file has to be written */ - QString getAdditionalFileName(const QString& additionalName); + TQString getAdditionalFileName(const TQString& additionalName); private: - void ProcessParagraphData ( const QString& strTag, const QString ¶Text, - const LayoutData& layout, const ValueListFormatData ¶FormatDataList); - void formatTextParagraph(const QString& strText, + void ProcessParagraphData ( const TQString& strTag, const TQString ¶Text, + const LayoutData& tqlayout, const ValueListFormatData ¶FormatDataList); + void formatTextParagraph(const TQString& strText, const FormatData& formatOrigin, const FormatData& format); bool makeTable(const FrameAnchor& anchor); bool makeImage(const FrameAnchor& anchor); protected: - QIODevice* m_ioDevice; - QTextStream* m_streamOut; - QTextCodec* m_codec; ///< QTextCodec in which the file will be written - QString m_strTitle; - QString m_fileName; ///< Name of the output file - QString m_strFileDir; ///< Directory of the output file - QString m_strSubDirectoryName; ///< Name of the sub directory for the additional files - QValueStack<ListInfo> m_listStack; ///< Stack for list information + TQIODevice* m_ioDevice; + TQTextStream* m_streamOut; + TQTextCodec* m_codec; ///< TQTextCodec in which the file will be written + TQString m_strTitle; + TQString m_fileName; ///< Name of the output file + TQString m_strFileDir; ///< Directory of the output file + TQString m_strSubDirectoryName; ///< Name of the sub directory for the additional files + TQValueStack<ListInfo> m_listStack; ///< Stack for list information bool m_xml; }; diff --git a/filters/kword/html/export/htmlexport.cc b/filters/kword/html/export/htmlexport.cc index 3bc660c7..f8af8e3e 100644 --- a/filters/kword/html/export/htmlexport.cc +++ b/filters/kword/html/export/htmlexport.cc @@ -31,7 +31,7 @@ License version 2. */ -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -57,11 +57,11 @@ K_EXPORT_COMPONENT_FACTORY( libhtmlexport, HTMLExportFactory( "kofficefilters" ) // HTMLExport // -HTMLExport::HTMLExport(KoFilter *, const char *, const QStringList &) : +HTMLExport::HTMLExport(KoFilter *, const char *, const TQStringList &) : KoFilter() { } -KoFilter::ConversionStatus HTMLExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus HTMLExport::convert( const TQCString& from, const TQCString& to ) { if ((from != "application/x-kword") || (to != "text/html")) { @@ -78,7 +78,7 @@ KoFilter::ConversionStatus HTMLExport::convert( const QCString& from, const QCSt { worker=new HtmlCssWorker(); worker->setXML(true); - worker->setCodec(QTextCodec::codecForName("UTF-8")); + worker->setCodec(TQTextCodec::codecForName("UTF-8")); } else { @@ -118,7 +118,7 @@ KoFilter::ConversionStatus HTMLExport::convert( const QCString& from, const QCSt delete worker; return KoFilter::StupidError; } - KoFilter::ConversionStatus result=leader->convert(m_chain,from,to); + KoFilter::ConversiontqStatus result=leader->convert(m_chain,from,to); delete leader; delete worker; diff --git a/filters/kword/html/export/htmlexport.h b/filters/kword/html/export/htmlexport.h index cbaefb58..c4e73292 100644 --- a/filters/kword/html/export/htmlexport.h +++ b/filters/kword/html/export/htmlexport.h @@ -21,10 +21,10 @@ #ifndef HTMLEXPORT_H #define HTMLEXPORT_H -#include <qstring.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -33,12 +33,13 @@ class HTMLExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - HTMLExport(KoFilter *parent, const char *name, const QStringList &); + HTMLExport(KoFilter *tqparent, const char *name, const TQStringList &); virtual ~HTMLExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // HTMLEXPORT_H diff --git a/filters/kword/html/import/htmlimport.cpp b/filters/kword/html/import/htmlimport.cpp index afd8430c..2c403b2f 100644 --- a/filters/kword/html/import/htmlimport.cpp +++ b/filters/kword/html/import/htmlimport.cpp @@ -34,12 +34,12 @@ typedef KGenericFactory<HTMLImport, KoFilter> HTMLImportFactory; K_EXPORT_COMPONENT_FACTORY( libhtmlimport, HTMLImportFactory( "kofficefilters" ) ) -HTMLImport::HTMLImport(KoFilter *, const char*, const QStringList &) : +HTMLImport::HTMLImport(KoFilter *, const char*, const TQStringList &) : KoFilter() { // 123 } -KoFilter::ConversionStatus HTMLImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus HTMLImport::convert( const TQCString& from, const TQCString& to ) { if(to!="application/x-kword" || from!="text/html") return KoFilter::NotImplemented; diff --git a/filters/kword/html/import/htmlimport.h b/filters/kword/html/import/htmlimport.h index a1ef5302..b383665b 100644 --- a/filters/kword/html/import/htmlimport.h +++ b/filters/kword/html/import/htmlimport.h @@ -20,9 +20,9 @@ #ifndef HTMLIMPORT_H #define HTMLIMPORT_H -#include <qstring.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -31,12 +31,13 @@ class HTMLImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - HTMLImport(KoFilter *parent, const char *name, const QStringList &); + HTMLImport(KoFilter *tqparent, const char *name, const TQStringList &); virtual ~HTMLImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // HTMLIMPORT_H diff --git a/filters/kword/html/import/khtmlreader.cpp b/filters/kword/html/import/khtmlreader.cpp index a3d22356..1df58edf 100644 --- a/filters/kword/html/import/khtmlreader.cpp +++ b/filters/kword/html/import/khtmlreader.cpp @@ -23,14 +23,14 @@ #include <dom/dom_text.h> #include <dom/dom2_views.h> #include <dom/dom_doc.h> -#include <qcolor.h> +#include <tqcolor.h> #include <dom/dom_element.h> #include <dom/html_table.h> #include <khtmlview.h> -#include <qwidget.h> +#include <tqwidget.h> #include <kapplication.h> #include <dom/html_misc.h> -#include <qregexp.h> +#include <tqregexp.h> KHTMLReader::KHTMLReader(KWDWriter *w) { @@ -40,14 +40,14 @@ KHTMLReader::KHTMLReader(KWDWriter *w) } // if a troll ever sees this, he can't kill me anyway. (and he should kill dfaure first) -void qt_enter_modal( QWidget *widget ); -void qt_leave_modal( QWidget *widget ); +void qt_enter_modal( TQWidget *widget ); +void qt_leave_modal( TQWidget *widget ); bool KHTMLReader::filter(KURL url) { kdDebug(30503) << "KHTMLReader::filter" << endl; - QObject::connect(_html,SIGNAL(completed()),this,SLOT(completed())); + TQObject::connect(_html,TQT_SIGNAL(completed()),this,TQT_SLOT(completed())); _state.clear(); _list_depth=0; @@ -65,9 +65,9 @@ bool KHTMLReader::filter(KURL url) } //FIXME use synchronous IO instead of this hack if possible. - QWidget dummy(0,0,WType_Dialog | WShowModal); + TQWidget dummy(0,0,WType_Dialog | WShowModal); qt_enter_modal(&dummy); - qApp->enter_loop(); + tqApp->enter_loop(); qt_leave_modal(&dummy); return _it_worked; } @@ -80,7 +80,7 @@ HTMLReader_state *KHTMLReader::state() s->frameset=_writer->mainFrameset(); s->paragraph = _writer->addParagraph(s->frameset); s->format=_writer->currentFormat(s->paragraph,true); - s->layout=_writer->currentLayout(s->paragraph); + s->tqlayout=_writer->currentLayout(s->paragraph); s->in_pre_mode = false; _state.push(s); } @@ -93,7 +93,7 @@ HTMLReader_state *KHTMLReader::pushNewState() s->frameset=state()->frameset; s->paragraph=state()->paragraph; s->format=state()->format; - s->layout=state()->layout; + s->tqlayout=state()->tqlayout; s->in_pre_mode=state()->in_pre_mode; _writer->cleanUpParagraph(s->paragraph); _state.push(s); @@ -118,9 +118,9 @@ void KHTMLReader::popState() if (s->frameset == state()->frameset) { state()->paragraph=s->paragraph; - if ((state()->layout != s->layout)) + if ((state()->tqlayout != s->tqlayout)) { - if (_writer->getText(state()->paragraph).length()!=0) startNewLayout(false,state()->layout); + if (_writer->getText(state()->paragraph).length()!=0) startNewLayout(false,state()->tqlayout); } state()->format=_writer->startFormat(state()->paragraph, state()->format); } @@ -129,21 +129,21 @@ void KHTMLReader::popState() void KHTMLReader::startNewLayout(bool startNewFormat) { - QDomElement layout; - startNewLayout(startNewFormat,layout); + TQDomElement tqlayout; + startNewLayout(startNewFormat,tqlayout); } -void KHTMLReader::startNewLayout(bool startNewFormat, QDomElement layout) +void KHTMLReader::startNewLayout(bool startNewFormat, TQDomElement tqlayout) { kdDebug() << "entering startNewLayout" << endl; startNewParagraph(startNewFormat,true); - state()->layout=_writer->setLayout(state()->paragraph,layout); + state()->tqlayout=_writer->setLayout(state()->paragraph,tqlayout); } void KHTMLReader::completed() { kdDebug(30503) << "KHTMLReader::completed" << endl; - qApp->exit_loop(); + tqApp->exit_loop(); DOM::Document doc=_html->document(); // FIXME parse <HEAD> too DOM::NodeList list=doc.getElementsByTagName("body"); DOM::Node docbody=list.item(0); @@ -178,12 +178,12 @@ void KHTMLReader::parseNode(DOM::Node node) if (!t.isNull()) { _writer->addText(state()->paragraph,t.data().string(),1,state()->in_pre_mode); - return; // no children anymore... + return; // no tqchildren anymore... } // is this really needed ? it can't do harm anyway. state()->format=_writer->currentFormat(state()->paragraph,true); - state()->layout=_writer->currentLayout(state()->paragraph); + state()->tqlayout=_writer->currentLayout(state()->paragraph); pushNewState(); DOM::Element e=node; @@ -227,16 +227,16 @@ void KHTMLReader::parse_head(DOM::Element e) } \ } -// the state->layout=_writer->setLayout is meant to tell popState something changed in the layout, and a new -// layout should probably be started after closing. +// the state->tqlayout=_writer->setLayout is meant to tell popState something changed in the tqlayout, and a new +// tqlayout should probably be started after closing. #define _PL(x,a,b,c) { \ if (e.tagName().lower() == #x) \ { \ - state()->layout=_writer->setLayout(state()->paragraph,state()->layout);\ + state()->tqlayout=_writer->setLayout(state()->paragraph,state()->tqlayout);\ if (!(_writer->getText(state()->paragraph).isEmpty())) \ startNewParagraph(false,false); \ - _writer->layoutAttribute(state()->paragraph, #a,#b,#c); \ + _writer->tqlayoutAttribute(state()->paragraph, #a,#b,#c); \ return true; \ } \ } @@ -283,20 +283,20 @@ bool KHTMLReader::parseTag(DOM::Element e) return true; } -void KHTMLReader::startNewParagraph(bool startnewformat, bool startnewlayout) +void KHTMLReader::startNewParagraph(bool startnewformat, bool startnewtqlayout) { kdDebug() << "Entering startNewParagraph" << endl; - QDomElement qf=state()->format; - QDomElement ql=state()->layout; + TQDomElement qf=state()->format; + TQDomElement ql=state()->tqlayout; _writer->cleanUpParagraph(state()->paragraph); - if ((startnewlayout==true) || ql.isNull()) + if ((startnewtqlayout==true) || ql.isNull()) {state()->paragraph=_writer->addParagraph(state()->frameset);} else {state()->paragraph= - _writer->addParagraph(state()->frameset,state()->layout);} + _writer->addParagraph(state()->frameset,state()->tqlayout);} @@ -314,14 +314,14 @@ void KHTMLReader::startNewParagraph(bool startnewformat, bool startnewlayout) we don't want to start a new item, but we want to retain the list state. we do this by incrementing the 'environment depth' and changing the numbering type to 'no numbering' **/ - QString ct=_writer->getLayoutAttribute(state()->paragraph,"COUNTER","type"); + TQString ct=_writer->getLayoutAttribute(state()->paragraph,"COUNTER","type"); if ((!ct.isNull()) && (ct != "0")) { - _writer->layoutAttribute(state()->paragraph,"COUNTER","type","0"); - _writer->layoutAttribute(state()->paragraph,"COUNTER","numberingtype","0"); - _writer->layoutAttribute(state()->paragraph,"COUNTER","righttext",""); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","type","0"); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","numberingtype","0"); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","righttext",""); int currdepth=(_writer->getLayoutAttribute(state()->paragraph,"COUNTER","depth")).toInt(); - _writer->layoutAttribute(state()->paragraph,"COUNTER","depth",QString("%1").arg(currdepth+1)); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","depth",TQString("%1").tqarg(currdepth+1)); } } @@ -343,32 +343,32 @@ bool KHTMLReader::parse_CommonAttributes(DOM::Element e) { kdDebug(30503) << "entering KHTMLReader::parse_CommonAttributes" << endl; kdDebug(30503) << "tagName is " << e.tagName().string() << endl; - QString s=e.getAttribute("align").string(); + TQString s=e.getAttribute("align").string(); if (!s.isEmpty()) { _writer->formatAttribute(state()->paragraph,"FLOW","align",s); } - QRegExp rx( "h[0-9]+" ); + TQRegExp rx( "h[0-9]+" ); if ( 0 == rx.search( e.getAttribute("class").string() ) ) // example: <p class="h1" style="text-align:left; "> { kdDebug(30503) << "laying out with " << e.getAttribute("class").string() << endl; - _writer->layoutAttribute(state()->paragraph,"NAME","value",e.getAttribute("class").string()); + _writer->tqlayoutAttribute(state()->paragraph,"NAME","value",e.getAttribute("class").string()); } if ( e.getAttribute("class").string()=="Standard" ) { kdDebug(30503) << "laying out with " << e.getAttribute("class").string() << endl; - _writer->layoutAttribute(state()->paragraph,"NAME","value",e.getAttribute("class").string()); + _writer->tqlayoutAttribute(state()->paragraph,"NAME","value",e.getAttribute("class").string()); } kdDebug(30503) << "leaving parse_CommonAttributes" << endl; return true; } bool KHTMLReader::parse_a(DOM::Element e) { - QString url = e.getAttribute("href").string(); + TQString url = e.getAttribute("href").string(); if (!url.isEmpty()) { - QString linkName; + TQString linkName; DOM::Text t = e.firstChild(); if (t.isNull()) { /* Link without text -> just drop it*/ @@ -403,13 +403,13 @@ bool KHTMLReader::parse_hr(DOM::Element /*e*/) bool KHTMLReader::parse_br(DOM::Element /*e*/) { - startNewParagraph(false,false); //keep the current format and layout + startNewParagraph(false,false); //keep the current format and tqlayout return false; // a BR tag has no childs. } -static const QColor parsecolor(const QString& colorstring) +static const TQColor parsecolor(const TQString& colorstring) { - QColor color; + TQColor color; if (colorstring[0]=='#') { color.setRgb( @@ -420,7 +420,7 @@ static const QColor parsecolor(const QString& colorstring) } else { - QString colorlower=colorstring.lower(); + TQString colorlower=colorstring.lower(); // Grays if (colorlower=="black") color.setRgb(0,0,0); @@ -486,18 +486,18 @@ void KHTMLReader::parseStyle(DOM::Element e) } // process e.g. <style="color: #ffffff"> - if ( s1.getPropertyValue("color").string() != QString() ) + if ( s1.getPropertyValue("color").string() != TQString() ) { - QColor c=parsecolor(s1.getPropertyValue("color").string()); - _writer->formatAttribute(state()->paragraph,"COLOR","red",QString::number(c.red())); - _writer->formatAttribute(state()->paragraph,"COLOR","green",QString::number(c.green())); - _writer->formatAttribute(state()->paragraph,"COLOR","blue",QString::number(c.blue())); + TQColor c=parsecolor(s1.getPropertyValue("color").string()); + _writer->formatAttribute(state()->paragraph,"COLOR","red",TQString::number(c.red())); + _writer->formatAttribute(state()->paragraph,"COLOR","green",TQString::number(c.green())); + _writer->formatAttribute(state()->paragraph,"COLOR","blue",TQString::number(c.blue())); } // done // process e.g. <style="font-size: 42"> - if ( s1.getPropertyValue("font-size").string() != QString() ) + if ( s1.getPropertyValue("font-size").string() != TQString() ) { - QString size=s1.getPropertyValue("font-size").string(); + TQString size=s1.getPropertyValue("font-size").string(); if (size.endsWith("pt")) { size=size.left(size.length()-2); @@ -506,10 +506,10 @@ void KHTMLReader::parseStyle(DOM::Element e) } // done // process e.g. <style="text-align: center">this is in the center</style> - if ( s1.getPropertyValue("text-align").string() != QString() && s1.getPropertyValue("text-align").string() != QString("left") ) + if ( s1.getPropertyValue("text-align").string() != TQString() && s1.getPropertyValue("text-align").string() != TQString("left") ) { - state()->layout=_writer->setLayout(state()->paragraph,state()->layout); - _writer->layoutAttribute(state()->paragraph, "FLOW","align",s1.getPropertyValue("text-align").string()); + state()->tqlayout=_writer->setLayout(state()->paragraph,state()->tqlayout); + _writer->tqlayoutAttribute(state()->paragraph, "FLOW","align",s1.getPropertyValue("text-align").string()); } // done @@ -520,11 +520,11 @@ void KHTMLReader::parseStyle(DOM::Element e) // debugging code. kdDebug(30503) << "e.style()" << endl; for (unsigned int i=0;i<s1.length();i++) { - kdDebug(30503) << QString("%1: %2").arg(s1.item(i).string()).arg(s1.getPropertyValue(s1.item(i)).string()) << endl; + kdDebug(30503) << TQString("%1: %2").tqarg(s1.item(i).string()).tqarg(s1.getPropertyValue(s1.item(i)).string()) << endl; } kdDebug(30503) << "override style" << endl; for (unsigned int i=0;i<s2.length();i++) { - kdDebug(30503) << QString("%1: %2").arg(s2.item(i).string()).arg(s2.getPropertyValue(s2.item(i)).string()) << endl; + kdDebug(30503) << TQString("%1: %2").tqarg(s2.item(i).string()).tqarg(s2.getPropertyValue(s2.item(i)).string()) << endl; } */ } @@ -554,7 +554,7 @@ bool KHTMLReader::parse_table(DOM::Element e) int nrow=0; int ncol=0; bool has_borders=false; - QColor bgcolor=parsecolor("#FFFFFF"); + TQColor bgcolor=parsecolor("#FFFFFF"); if (!table_body.getAttribute("bgcolor").string().isEmpty()) bgcolor=parsecolor(table_body.getAttribute("bgcolor").string()); @@ -566,21 +566,21 @@ bool KHTMLReader::parse_table(DOM::Element e) for (DOM::Node rowsnode=table_body.firstChild();!rowsnode.isNull();rowsnode=rowsnode.nextSibling()) { DOM::Element rows = rowsnode; if (!rows.isNull() && rows.tagName().string().lower() == "tr") { - QColor obgcolor=bgcolor; + TQColor obgcolor=bgcolor; if (!rows.getAttribute("bgcolor").string().isEmpty()) bgcolor=parsecolor(rows.getAttribute("bgcolor").string()); ncol=0; for (DOM::Node colsnode=rows.firstChild();!colsnode.isNull();colsnode=colsnode.nextSibling()) { DOM::Element cols = colsnode; - const QString nodename = cols.isNull() ? QString::null : cols.nodeName().string().lower(); + const TQString nodename = cols.isNull() ? TQString() : cols.nodeName().string().lower(); if (nodename == "td" || nodename == "th") { - QColor bbgcolor=bgcolor; + TQColor bbgcolor=bgcolor; if (!cols.getAttribute("bgcolor").string().isEmpty()) bgcolor=parsecolor(cols.getAttribute("bgcolor").string()); pushNewState(); - QRect colrect=cols.getRect(); + TQRect colrect=cols.getRect(); state()->frameset=_writer->createTableCell(tableno,nrow,ncol,1,colrect); state()->frameset.firstChild().toElement().setAttribute("bkRed",bgcolor.red()); state()->frameset.firstChild().toElement().setAttribute("bkGreen",bgcolor.green()); @@ -614,7 +614,7 @@ bool KHTMLReader::parse_table(DOM::Element e) bool KHTMLReader::parse_img(DOM::Element /*e*/) { - //QRect e=e.getRect(); + //TQRect e=e.getRect(); return true; } @@ -628,19 +628,19 @@ bool KHTMLReader::parse_pre(DOM::Element e) _writer->addText(state()->paragraph,htmlelement.innerHTML().string(),1); startNewParagraph(); //popState(); - return false; // children are already handled. + return false; // tqchildren are already handled. #else pushNewState(); state()->in_pre_mode=true; - QString face=e.getAttribute("face").string(); - _writer->formatAttribute(state()->paragraph,"FONT","name",QString("Courier")); + TQString face=e.getAttribute("face").string(); + _writer->formatAttribute(state()->paragraph,"FONT","name",TQString("Courier")); for (DOM::Node q=e.firstChild(); !q.isNull(); q=q.nextSibling()) { parseNode(q); // parse everything... } popState(); _writer->formatAttribute(state()->paragraph,"FONT","name",face); - return false; // children are already handled. + return false; // tqchildren are already handled. #endif } @@ -653,11 +653,11 @@ bool KHTMLReader::parse_font(DOM::Element e) { kdDebug(30503) << "Entering parse_font" << endl; // fixme don't hardcode 12 font size ... - QString face=e.getAttribute("face").string(); - QColor color=parsecolor("#000000"); + TQString face=e.getAttribute("face").string(); + TQColor color=parsecolor("#000000"); if (!e.getAttribute("color").string().isEmpty()) color=parsecolor(e.getAttribute("color").string()); - QString size=e.getAttribute("size").string(); + TQString size=e.getAttribute("size").string(); int isize=-1; if (size.startsWith("+")) isize=12+size.right(size.length()-1).toInt(); @@ -668,11 +668,11 @@ bool KHTMLReader::parse_font(DOM::Element e) _writer->formatAttribute(state()->paragraph,"FONT","name",face); if ((isize>=0) && (isize != 12)) - _writer->formatAttribute(state()->paragraph,"SIZE","value",QString("%1").arg(isize)); + _writer->formatAttribute(state()->paragraph,"SIZE","value",TQString("%1").tqarg(isize)); - _writer->formatAttribute(state()->paragraph,"COLOR","red",QString("%1").arg(color.red())); - _writer->formatAttribute(state()->paragraph,"COLOR","green",QString("%1").arg(color.green())); - _writer->formatAttribute(state()->paragraph,"COLOR","blue",QString("%1").arg(color.blue())); + _writer->formatAttribute(state()->paragraph,"COLOR","red",TQString("%1").tqarg(color.red())); + _writer->formatAttribute(state()->paragraph,"COLOR","green",TQString("%1").tqarg(color.green())); + _writer->formatAttribute(state()->paragraph,"COLOR","blue",TQString("%1").tqarg(color.blue())); return true; } @@ -684,7 +684,7 @@ bool KHTMLReader::parse_ul(DOM::Element e) _list_depth++; if (e.firstChild().nodeName().string().lower() == "#text") // e.g. <ul>this is indented<li>first listitem</li></ul> { - _writer->layoutAttribute(state()->paragraph,"COUNTER","depth",QString("%1").arg(_list_depth-1)); // indent + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","depth",TQString("%1").tqarg(_list_depth-1)); // indent startNewLayout(); } for (DOM::Node items=e.firstChild();!items.isNull();items=items.nextSibling()) @@ -692,21 +692,21 @@ bool KHTMLReader::parse_ul(DOM::Element e) if (items.nodeName().string().lower() == "li") { if (!(_writer->getText(state()->paragraph).isEmpty())) startNewLayout(); - _writer->layoutAttribute(state()->paragraph,"COUNTER","numberingtype","1"); - _writer->layoutAttribute(state()->paragraph,"COUNTER","righttext","."); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","numberingtype","1"); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","righttext","."); if (e.tagName().string().lower() == "ol") { - _writer->layoutAttribute(state()->paragraph,"COUNTER","type","1"); - _writer->layoutAttribute(state()->paragraph,"COUNTER","numberingtype","1"); - _writer->layoutAttribute(state()->paragraph,"COUNTER","righttext","."); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","type","1"); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","numberingtype","1"); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","righttext","."); } else { - _writer->layoutAttribute(state()->paragraph,"COUNTER","type","10"); - _writer->layoutAttribute(state()->paragraph,"COUNTER","numberingtype",""); - _writer->layoutAttribute(state()->paragraph,"COUNTER","righttext",""); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","type","10"); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","numberingtype",""); + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","righttext",""); } - _writer->layoutAttribute(state()->paragraph,"COUNTER","depth",QString("%1").arg(_list_depth-1)); // indent + _writer->tqlayoutAttribute(state()->paragraph,"COUNTER","depth",TQString("%1").tqarg(_list_depth-1)); // indent } parseNode(items); } diff --git a/filters/kword/html/import/khtmlreader.h b/filters/kword/html/import/khtmlreader.h index c5b4c6b6..9987a589 100644 --- a/filters/kword/html/import/khtmlreader.h +++ b/filters/kword/html/import/khtmlreader.h @@ -20,11 +20,11 @@ #define KHTMLREADER_H #include <khtml_part.h> // fixme speedup compile time by moving these into the cpp file. -#include <qdom.h> -#include <qptrstack.h> +#include <tqdom.h> +#include <tqptrstack.h> #include <kwdwriter.h> -//#include <qstack.h> +//#include <tqstack.h> /** *@author Frank Dekervel @@ -36,16 +36,17 @@ namespace DOM { } struct HTMLReader_state { - QDomElement format; - QDomElement frameset; - QDomElement paragraph; - QDomElement layout; + TQDomElement format; + TQDomElement frameset; + TQDomElement paragraph; + TQDomElement tqlayout; bool in_pre_mode; // keep formatting as is. }; -class KHTMLReader: public QObject { +class KHTMLReader: public TQObject { Q_OBJECT + TQ_OBJECT public: KHTMLReader(KWDWriter *writer); @@ -66,18 +67,18 @@ private: void popState(); - /* void stateSetFormat(QDomElement f); - void stateSetFrameset(QDomElement f); - void stateSetLayout(QDomElement l); - void stateSetParagraph(QDomElement p);*/ + /* void stateSetFormat(TQDomElement f); + void stateSetFrameset(TQDomElement f); + void stateSetLayout(TQDomElement l); + void stateSetParagraph(TQDomElement p);*/ - QPtrStack<HTMLReader_state> _state; + TQPtrStack<HTMLReader_state> _state; KHTMLPart *_html; KWDWriter *_writer; void startNewLayout(bool startNewFormat=false); - void startNewLayout(bool startNewFormat, QDomElement layout); - void startNewParagraph(bool startnewformat=true, bool startnewlayout=true); + void startNewLayout(bool startNewFormat, TQDomElement tqlayout); + void startNewParagraph(bool startnewformat=true, bool startnewtqlayout=true); bool _it_worked; // ----------------------------------------------------- int _list_depth; diff --git a/filters/kword/html/import/kwdwriter.cpp b/filters/kword/html/import/kwdwriter.cpp index 3a7e0aea..d2e4c450 100644 --- a/filters/kword/html/import/kwdwriter.cpp +++ b/filters/kword/html/import/kwdwriter.cpp @@ -18,32 +18,32 @@ #include "kwdwriter.h" #include <stdlib.h> -#include "qrect.h" +#include "tqrect.h" #include <KoTextZoomHandler.h> -#include <qpaintdevice.h> +#include <tqpaintdevice.h> KWDWriter::KWDWriter(KoStore *store){ _zoomhandler = new KoTextZoomHandler(); _store=store; - _doc= new QDomDocument("DOC"); - _docinfo = new QDomDocument("document-info"); + _doc= new TQDomDocument("DOC"); + _docinfo = new TQDomDocument("document-info"); _doc->appendChild( _doc->createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) ); _docinfo->appendChild( _docinfo->createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement infodoc = _docinfo->createElement( "document-info" ); + TQDomElement infodoc = _docinfo->createElement( "document-info" ); _docinfoMain=infodoc; _docinfo->appendChild(infodoc); tableNo=1; insidetable = false; - QDomElement kwdoc = _doc->createElement( "DOC" ); + TQDomElement kwdoc = _doc->createElement( "DOC" ); kwdoc.setAttribute( "editor", "HTML Import Filter" ); kwdoc.setAttribute( "mime", "application/x-kword" ); _doc->appendChild( kwdoc ); - QDomElement paper = _doc->createElement( "PAPER" ); + TQDomElement paper = _doc->createElement( "PAPER" ); kwdoc.appendChild( paper ); paper.setAttribute( "format", 1 ); paper.setAttribute( "width", 595 ); @@ -54,14 +54,14 @@ KWDWriter::KWDWriter(KoStore *store){ paper.setAttribute( "hType", 0 ); paper.setAttribute( "fType", 0 ); - QDomElement borders = _doc->createElement( "PAPERBORDERS" ); + TQDomElement borders = _doc->createElement( "PAPERBORDERS" ); paper.appendChild( borders ); borders.setAttribute( "left", 20 ); borders.setAttribute( "top", 10 ); borders.setAttribute( "right", 10 ); borders.setAttribute( "bottom", 10 ); - QDomElement docattrs = _doc->createElement( "ATTRIBUTES" ); + TQDomElement docattrs = _doc->createElement( "ATTRIBUTES" ); kwdoc.appendChild( docattrs ); docattrs.setAttribute( "processing", 0 ); docattrs.setAttribute( "standardpage", 1 ); @@ -69,19 +69,19 @@ KWDWriter::KWDWriter(KoStore *store){ docattrs.setAttribute( "hasFooter", 0 ); //docattrs.setAttribute( "unit", "mm" ); // use KWord default instead - QDomElement framesets = _doc->createElement("FRAMESETS"); + TQDomElement framesets = _doc->createElement("FRAMESETS"); kwdoc.appendChild(framesets); - QDomElement rootframeset = addFrameSet(framesets); + TQDomElement rootframeset = addFrameSet(framesets); _mainFrameset=rootframeset; - QDomElement mainframe= addFrame(rootframeset,QRect(28,28,539,757)); + TQDomElement mainframe= addFrame(rootframeset,TQRect(28,28,539,757)); - QDomElement styles=_doc->createElement("STYLES"); + TQDomElement styles=_doc->createElement("STYLES"); kwdoc.appendChild(styles); - QDomElement standard=_doc->createElement("STYLE"); + TQDomElement standard=_doc->createElement("STYLE"); styles.appendChild(standard); - QDomElement tmp; + TQDomElement tmp; tmp=_doc->createElement("NAME"); tmp.setAttribute("value","Standard"); standard.appendChild(tmp); @@ -89,7 +89,7 @@ KWDWriter::KWDWriter(KoStore *store){ tmp=_doc->createElement("FOLLOWING"); tmp.setAttribute("name","Standard"); standard.appendChild(tmp); - QDomElement fmt; + TQDomElement fmt; fmt=_doc->createElement("FORMAT"); fmt.setAttribute("id","1"); @@ -134,15 +134,15 @@ int KWDWriter::createTable() { return tableNo++; } -void KWDWriter::createDocInfo(QString author, QString title) { - QDomElement authorTag=_docinfo->createElement("author"); - QDomElement aboutTag=_docinfo->createElement("about"); - QDomElement fullNameTag=_docinfo->createElement("full-name"); - QDomText titleText=_docinfo->createTextNode(title); - QDomText authorText=_docinfo->createTextNode(author); +void KWDWriter::createDocInfo(TQString author, TQString title) { + TQDomElement authorTag=_docinfo->createElement("author"); + TQDomElement aboutTag=_docinfo->createElement("about"); + TQDomElement fullNameTag=_docinfo->createElement("full-name"); + TQDomText titleText=_docinfo->createTextNode(title); + TQDomText authorText=_docinfo->createTextNode(author); fullNameTag.appendChild(authorText); authorTag.appendChild(fullNameTag); - QDomElement titleTag=_docinfo->createElement("title"); + TQDomElement titleTag=_docinfo->createElement("title"); titleTag.appendChild(titleText); aboutTag.appendChild(titleTag); _docinfoMain.appendChild(authorTag); @@ -150,7 +150,7 @@ void KWDWriter::createDocInfo(QString author, QString title) { } -void KWDWriter::createInline(QDomElement paragraph, QDomElement toInline) { +void KWDWriter::createInline(TQDomElement paragraph, TQDomElement toInline) { if (toInline.tagName() == "FRAMESET") { formatAttribute(paragraph,"ANCHOR","type","frameset"); // fixme: support other kinds of inlines. @@ -162,20 +162,20 @@ void KWDWriter::createInline(QDomElement paragraph, QDomElement toInline) { } -QDomElement KWDWriter::currentLayout(QDomElement paragraph) { +TQDomElement KWDWriter::currentLayout(TQDomElement paragraph) { return paragraph.elementsByTagName("LAYOUT").item(0).toElement(); } -QDomElement KWDWriter::createTableCell(int tableno, int nrow, - int ncol, int colspan, QRect rect) { - QDomElement parent=docroot().elementsByTagName("FRAMESETS").item(0).toElement(); +TQDomElement KWDWriter::createTableCell(int tableno, int nrow, + int ncol, int colspan, TQRect rect) { + TQDomElement tqparent=docroot().elementsByTagName("FRAMESETS").item(0).toElement(); - QDomElement fs=addFrameSet(parent,1,0, - QString("Table %1 - %2,%3").arg(tableno).arg(nrow).arg(ncol), + TQDomElement fs=addFrameSet(tqparent,1,0, + TQString("Table %1 - %2,%3").tqarg(tableno).tqarg(nrow).tqarg(ncol), 1); - fs.setAttribute("grpMgr",QString("Table %1").arg(tableno)); + fs.setAttribute("grpMgr",TQString("Table %1").tqarg(tableno)); fs.setAttribute("row",nrow); fs.setAttribute("col",ncol); fs.setAttribute("cols",colspan); // FIXME do colspan in finishTable @@ -185,16 +185,16 @@ QDomElement KWDWriter::createTableCell(int tableno, int nrow, return fs; } -QDomElement KWDWriter::fetchTableCell(int tableno, int rowno, int colno) { - QDomNodeList e=docroot().elementsByTagName("FRAMESET"); +TQDomElement KWDWriter::fetchTableCell(int tableno, int rowno, int colno) { + TQDomNodeList e=docroot().elementsByTagName("FRAMESET"); for (unsigned int i=0;i<e.count();i++) { - QDomElement k=e.item(i).toElement(); - if (k.attribute("grpMgr") == QString("Table %1").arg(tableno)) - if (k.attribute("row") == QString("%1").arg(rowno)) - if (k.attribute("col") == QString("%1").arg(colno)) + TQDomElement k=e.item(i).toElement(); + if (k.attribute("grpMgr") == TQString("Table %1").tqarg(tableno)) + if (k.attribute("row") == TQString("%1").tqarg(rowno)) + if (k.attribute("col") == TQString("%1").tqarg(colno)) return k; } - QDomElement dummy; + TQDomElement dummy; return dummy; } @@ -202,15 +202,15 @@ QDomElement KWDWriter::fetchTableCell(int tableno, int rowno, int colno) { #define MIN(x,y) ((x < y) ? x : y) void KWDWriter::finishTable(int tableno) { - finishTable(tableno,QRect(-1,-1,-1,-1)); + finishTable(tableno,TQRect(-1,-1,-1,-1)); } -void KWDWriter::createHR(QDomElement paragraph, int width) { - layoutAttribute(paragraph,"BOTTOMBORDER","width",QString("%1").arg(width)); +void KWDWriter::createHR(TQDomElement paragraph, int width) { + tqlayoutAttribute(paragraph,"BOTTOMBORDER","width",TQString("%1").tqarg(width)); } -void KWDWriter::finishTable(int tableno,QRect rect) { +void KWDWriter::finishTable(int tableno,TQRect rect) { int ncols=0; int nrows=0; insidetable = false; @@ -220,14 +220,14 @@ void KWDWriter::finishTable(int tableno,QRect rect) { int w=rect.width(); int h=rect.height(); - QDomNodeList nl=docroot().elementsByTagName("FRAMESET"); + TQDomNodeList nl=docroot().elementsByTagName("FRAMESET"); //FIXME calculate nrows and stuff. //and add empty cells for missing ones. // first, see how big the table is (cols & rows) for (unsigned i=0;i<nl.count();i++) { - QDomElement k=nl.item(i).toElement(); - if (k.attribute("grpMgr") == QString("Table %1").arg(tableno)) { + TQDomElement k=nl.item(i).toElement(); + if (k.attribute("grpMgr") == TQString("Table %1").tqarg(tableno)) { ncols=MAX(ncols,k.attribute("col").toInt()+1); nrows=MAX(nrows,k.attribute("row").toInt()+1); } @@ -248,23 +248,23 @@ void KWDWriter::finishTable(int tableno,QRect rect) { while (currow < nrows) { curcol=0; while (curcol < ncols) { - QDomElement e=fetchTableCell(tableno,currow,curcol); + TQDomElement e=fetchTableCell(tableno,currow,curcol); if (e.isNull()) { // a missing cell ! - kdDebug(30503) << QString("creating %1 %2").arg(currow).arg(curcol).latin1() << endl; + kdDebug(30503) << TQString("creating %1 %2").tqarg(currow).tqarg(curcol).latin1() << endl; createTableCell(tableno,currow,curcol,1, - QRect(x+step_x*curcol,y+step_y*currow,step_x,step_y) + TQRect(x+step_x*curcol,y+step_y*currow,step_x,step_y) ); // fixme: what to do if we don't have to resize ? } // resize this one FIXME optimize this routine if (must_resize == true) { - QDomElement ee=e.firstChild().toElement(); // the frame in the frameset + TQDomElement ee=e.firstChild().toElement(); // the frame in the frameset int cs=e.attribute("cols").toInt(); int rs=e.attribute("rows").toInt(); kdDebug(30503) << "resizing" << endl; - addRect(ee,QRect(x+step_x*curcol,0,step_x*cs,step_y*rs)); + addRect(ee,TQRect(x+step_x*curcol,0,step_x*cs,step_y*rs)); } if (curcol==0) currow_inc=e.attribute("rows").toInt(); curcol +=e.attribute("cols").toInt(); @@ -278,11 +278,11 @@ void KWDWriter::finishTable(int tableno,QRect rect) { } -QDomElement KWDWriter::addFrameSet(QDomElement parent, int frametype, - int frameinfo, QString name, int visible) { +TQDomElement KWDWriter::addFrameSet(TQDomElement tqparent, int frametype, + int frameinfo, TQString name, int visible) { - QDomElement frameset=_doc->createElement("FRAMESET"); - parent.appendChild(frameset); + TQDomElement frameset=_doc->createElement("FRAMESET"); + tqparent.appendChild(frameset); frameset.setAttribute("frameType",frametype); frameset.setAttribute("frameInfo",frameinfo); @@ -295,17 +295,17 @@ QDomElement KWDWriter::addFrameSet(QDomElement parent, int frametype, return frameset; } -QDomElement KWDWriter::addParagraph(QDomElement parent) { - QDomElement k; - return addParagraph(parent,k); +TQDomElement KWDWriter::addParagraph(TQDomElement tqparent) { + TQDomElement k; + return addParagraph(tqparent,k); } -void KWDWriter::appendKWordVariable(QDomDocument& doc, QDomElement& format, - const QString& text, const QString& key, int type, QDomElement& child) { +void KWDWriter::appendKWordVariable(TQDomDocument& doc, TQDomElement& format, + const TQString& text, const TQString& key, int type, TQDomElement& child) { - QDomElement variableElement ( doc.createElement("VARIABLE") ); + TQDomElement variableElement ( doc.createElement("VARIABLE") ); - QDomElement typeElement ( doc.createElement("TYPE") ); + TQDomElement typeElement ( doc.createElement("TYPE") ); typeElement.setAttribute("key",key); typeElement.setAttribute("type",type); typeElement.setAttribute("text",text); @@ -316,11 +316,11 @@ void KWDWriter::appendKWordVariable(QDomDocument& doc, QDomElement& format, format.appendChild(variableElement); } -QDomElement KWDWriter::createLink(QDomElement paragraph, QString linkName, QString hrefName) { - QDomElement linkElement = _doc->createElement("LINK"); +TQDomElement KWDWriter::createLink(TQDomElement paragraph, TQString linkName, TQString hrefName) { + TQDomElement linkElement = _doc->createElement("LINK"); linkElement.setAttribute( "linkName", linkName ); linkElement.setAttribute( "hrefName", hrefName ); - QDomElement format = currentFormat(paragraph,true); + TQDomElement format = currentFormat(paragraph,true); format.setAttribute("id", 4); // change Variable appendKWordVariable(*_doc, format, linkName, "STRING", 9, linkElement); @@ -328,23 +328,23 @@ QDomElement KWDWriter::createLink(QDomElement paragraph, QString linkName, QStri } -QDomElement KWDWriter::setLayout(QDomElement paragraph, QDomElement layout) { - QDomElement theLayout; - if (layout.isNull()) +TQDomElement KWDWriter::setLayout(TQDomElement paragraph, TQDomElement tqlayout) { + TQDomElement theLayout; + if (tqlayout.isNull()) theLayout=_doc->createElement("LAYOUT"); else - theLayout=layout.cloneNode().toElement(); - QDomElement oldLayout=currentLayout(paragraph); + theLayout=tqlayout.cloneNode().toElement(); + TQDomElement oldLayout=currentLayout(paragraph); paragraph.removeChild(oldLayout); paragraph.appendChild(theLayout); return theLayout; } -QRect getRect(QDomElement frameset) { +TQRect getRect(TQDomElement frameset) { // returns the rect of the first frame. - QDomElement frame=frameset.elementsByTagName("FRAME").item(0).toElement(); - return QRect(frame.attribute("left").toInt(), + TQDomElement frame=frameset.elementsByTagName("FRAME").item(0).toElement(); + return TQRect(frame.attribute("left").toInt(), frame.attribute("top").toInt(), frame.attribute("right").toInt()-frame.attribute("left").toInt(), frame.attribute("bottom").toInt()-frame.attribute("top").toInt() @@ -353,39 +353,39 @@ QRect getRect(QDomElement frameset) { } -QDomElement KWDWriter::addParagraph(QDomElement parent, QDomElement layoutToClone) { +TQDomElement KWDWriter::addParagraph(TQDomElement tqparent, TQDomElement tqlayoutToClone) { - QDomElement paragraph=_doc->createElement("PARAGRAPH"); - QDomElement formats=_doc->createElement("FORMATS"); - QDomElement layout; - if (layoutToClone.isNull()) { - layout=_doc->createElement("LAYOUT"); + TQDomElement paragraph=_doc->createElement("PARAGRAPH"); + TQDomElement formats=_doc->createElement("FORMATS"); + TQDomElement tqlayout; + if (tqlayoutToClone.isNull()) { + tqlayout=_doc->createElement("LAYOUT"); } else { - layout=layoutToClone.cloneNode().toElement(); + tqlayout=tqlayoutToClone.cloneNode().toElement(); } - QDomElement text=_doc->createElement("TEXT"); - QDomText t=_doc->createTextNode(QString("")); + TQDomElement text=_doc->createElement("TEXT"); + TQDomText t=_doc->createTextNode(TQString("")); text.appendChild(t); paragraph.appendChild(formats); paragraph.appendChild(text); - parent.appendChild(paragraph); - paragraph.appendChild(layout); - layoutAttribute(paragraph,"NAME","value","Standard"); + tqparent.appendChild(paragraph); + paragraph.appendChild(tqlayout); + tqlayoutAttribute(paragraph,"NAME","value","Standard"); return paragraph; } -QDomElement KWDWriter::formatAttribute(QDomElement paragraph, QString name, QString attrName, QString attr) { +TQDomElement KWDWriter::formatAttribute(TQDomElement paragraph, TQString name, TQString attrName, TQString attr) { kdDebug() << "Entering KWDWriter::formatAttribute" << endl; - QDomElement lastformat=currentFormat(paragraph,true); - QDomNodeList qdnl= lastformat.elementsByTagName(name); + TQDomElement lastformat=currentFormat(paragraph,true); + TQDomNodeList qdnl= lastformat.elementsByTagName(name); if (qdnl.length()) { - QDomElement el; + TQDomElement el; el=qdnl.item(0).toElement(); el.setAttribute(attrName,attr); return el; } else { - QDomElement al=_doc->createElement(name); + TQDomElement al=_doc->createElement(name); lastformat.appendChild(al); al.setAttribute(attrName,attr); return al; @@ -393,43 +393,43 @@ QDomElement KWDWriter::formatAttribute(QDomElement paragraph, QString name, QStr } -QString KWDWriter::getLayoutAttribute(QDomElement paragraph, QString name, QString attrName) { - QDomElement currentLayout=paragraph.elementsByTagName("LAYOUT").item(0).toElement(); - QDomNodeList qdnl= currentLayout.elementsByTagName(name); +TQString KWDWriter::getLayoutAttribute(TQDomElement paragraph, TQString name, TQString attrName) { + TQDomElement currentLayout=paragraph.elementsByTagName("LAYOUT").item(0).toElement(); + TQDomNodeList qdnl= currentLayout.elementsByTagName(name); if (qdnl.length()) { - QDomElement el=qdnl.item(0).toElement(); + TQDomElement el=qdnl.item(0).toElement(); return el.attribute(attrName); } - return QString::null; + return TQString(); } -QDomElement KWDWriter::layoutAttribute(QDomElement paragraph, QString name, QString attrName, QString attr) +TQDomElement KWDWriter::tqlayoutAttribute(TQDomElement paragraph, TQString name, TQString attrName, TQString attr) { - kdDebug() << "Entering KWDWriter::layoutAttribute name=" << name << " attrName=" << attrName << " attr=" << attr << endl; - QDomElement currentLayout=paragraph.elementsByTagName("LAYOUT").item(0).toElement(); - QDomNodeList qdnl= currentLayout.elementsByTagName(name); + kdDebug() << "Entering KWDWriter::tqlayoutAttribute name=" << name << " attrName=" << attrName << " attr=" << attr << endl; + TQDomElement currentLayout=paragraph.elementsByTagName("LAYOUT").item(0).toElement(); + TQDomNodeList qdnl= currentLayout.elementsByTagName(name); if (qdnl.length()) { - QDomElement el; + TQDomElement el; el=qdnl.item(0).toElement(); el.setAttribute(attrName,attr); return el; } else { - QDomElement al=_doc->createElement(name); + TQDomElement al=_doc->createElement(name); currentLayout.appendChild(al); al.setAttribute(attrName,attr); return al; } } -void KWDWriter::addText(QDomElement paragraph, QString text, int format_id, bool keep_formatting) { - QDomNode temp=paragraph.elementsByTagName("TEXT").item(0).firstChild(); - QDomText currentText=temp.toText(); +void KWDWriter::addText(TQDomElement paragraph, TQString text, int format_id, bool keep_formatting) { + TQDomNode temp=paragraph.elementsByTagName("TEXT").item(0).firstChild(); + TQDomText currentText=temp.toText(); if (temp.isNull()) { kdDebug(30503) << "no text" << endl; return; } - QString oldtext=currentText.data(); + TQString oldtext=currentText.data(); int oldLength=oldtext.length(); if (keep_formatting) { @@ -445,7 +445,7 @@ void KWDWriter::addText(QDomElement paragraph, QString text, int format_id, bool ++oldLength; // add new trailing space char text=text.simplifyWhiteSpace(); // drop all unprintable chars } - QString newtext; + TQString newtext; if (keep_formatting) newtext=oldtext + text; else @@ -457,38 +457,38 @@ void KWDWriter::addText(QDomElement paragraph, QString text, int format_id, bool } currentText.setData(newtext); int newLength=text.length(); - QDomElement lastformat=currentFormat(paragraph,true); + TQDomElement lastformat=currentFormat(paragraph,true); if (lastformat.attribute("id").isEmpty()) // keep old id value, e.g. for LINK URL lastformat.setAttribute("id",format_id); - lastformat.setAttribute("pos",QString("%1").arg(oldLength)); - lastformat.setAttribute("len",QString("%1").arg(newLength)); + lastformat.setAttribute("pos",TQString("%1").tqarg(oldLength)); + lastformat.setAttribute("len",TQString("%1").tqarg(newLength)); } -QString KWDWriter::getText(QDomElement paragraph) { - QDomNode temp=paragraph.elementsByTagName("TEXT").item(0).firstChild(); - QDomText currentText=temp.toText(); +TQString KWDWriter::getText(TQDomElement paragraph) { + TQDomNode temp=paragraph.elementsByTagName("TEXT").item(0).firstChild(); + TQDomText currentText=temp.toText(); if (temp.isNull()) { kdWarning(30503) << "no text" << endl; } return currentText.data(); } -QDomElement KWDWriter::startFormat(QDomElement paragraph) { +TQDomElement KWDWriter::startFormat(TQDomElement paragraph) { if (paragraph.isNull()) { kdWarning(30503) << "startFormat on empty paragraph" << endl; } - QDomElement format=_doc->createElement("FORMAT"); + TQDomElement format=_doc->createElement("FORMAT"); paragraph.elementsByTagName("FORMATS").item(0).appendChild(format); return format; } -QDomElement KWDWriter::startFormat(QDomElement paragraph, QDomElement formatToClone) { - QDomElement format=formatToClone.cloneNode().toElement(); +TQDomElement KWDWriter::startFormat(TQDomElement paragraph, TQDomElement formatToClone) { + TQDomElement format=formatToClone.cloneNode().toElement(); if (format.isNull()) { kdWarning(30503) << "startFormat: null format cloned" << endl; } if (paragraph.isNull()) { kdWarning(30503) << "startFormat on empty paragraph" << endl; } format.removeAttribute("len"); format.removeAttribute("pos"); format.removeAttribute("id"); - for (QDomElement a=format.firstChild().toElement();!a.isNull();a=a.nextSibling().toElement()) { + for (TQDomElement a=format.firstChild().toElement();!a.isNull();a=a.nextSibling().toElement()) { if (a.tagName() == "ANCHOR") { format.removeChild(a); } @@ -497,9 +497,9 @@ QDomElement KWDWriter::startFormat(QDomElement paragraph, QDomElement formatToCl return format; } -QDomElement KWDWriter::currentFormat(QDomElement paragraph, bool start_new_one) { +TQDomElement KWDWriter::currentFormat(TQDomElement paragraph, bool start_new_one) { - QDomElement e=paragraph.elementsByTagName("FORMATS").item(0).lastChild().toElement(); + TQDomElement e=paragraph.elementsByTagName("FORMATS").item(0).lastChild().toElement(); if (e.isNull()) { // no current format, start a new one if (start_new_one) return startFormat(paragraph); @@ -513,11 +513,11 @@ QDomElement KWDWriter::currentFormat(QDomElement paragraph, bool start_new_one) } -void KWDWriter::cleanUpParagraph(QDomElement paragraph) { - QDomElement e=paragraph.elementsByTagName("FORMATS").item(0).toElement(); +void KWDWriter::cleanUpParagraph(TQDomElement paragraph) { + TQDomElement e=paragraph.elementsByTagName("FORMATS").item(0).toElement(); if (e.isNull()) { kdWarning(30503) << "cleanup : no valid paragraph" << endl; return; } - for (QDomElement k=e.firstChild().toElement();!k.isNull();k=k.nextSibling().toElement()) { - if (k.attribute("len",QString::null).isNull()) { + for (TQDomElement k=e.firstChild().toElement();!k.isNull();k=k.nextSibling().toElement()) { + if (k.attribute("len",TQString()).isNull()) { e.removeChild(k); cleanUpParagraph(paragraph); return; @@ -526,10 +526,10 @@ void KWDWriter::cleanUpParagraph(QDomElement paragraph) { } -QDomElement KWDWriter::addFrame(QDomElement frameset, QRect rect, int runaround, int copy, +TQDomElement KWDWriter::addFrame(TQDomElement frameset, TQRect rect, int runaround, int copy, int newFrameBehaviour, int runaroundGap ) { - QDomElement frame = _doc->createElement("FRAME"); + TQDomElement frame = _doc->createElement("FRAME"); frameset.appendChild(frame); frame.setAttribute("runaround",runaround); frame.setAttribute("copy",copy); @@ -539,12 +539,12 @@ QDomElement KWDWriter::addFrame(QDomElement frameset, QRect rect, int runaround, return frame; } -QDomElement KWDWriter::docroot() { +TQDomElement KWDWriter::docroot() { return _doc->elementsByTagName("DOC").item(0).toElement(); } bool KWDWriter::writeDoc() { - QCString str=_doc->toCString(); + TQCString str=_doc->toCString(); kdWarning(30503) << str << endl; if (!_store->open("root")) { @@ -566,12 +566,12 @@ bool KWDWriter::writeDoc() { } -QDomElement KWDWriter::mainFrameset() { +TQDomElement KWDWriter::mainFrameset() { return _mainFrameset; } -void KWDWriter::addRect(QDomElement e,QRect rect) { +void KWDWriter::addRect(TQDomElement e,TQRect rect) { e.setAttribute("top",_zoomhandler->pixelYToPt( rect.top())); e.setAttribute("left",_zoomhandler->pixelXToPt(rect.left())); e.setAttribute("bottom",_zoomhandler->pixelYToPt(rect.bottom())); diff --git a/filters/kword/html/import/kwdwriter.h b/filters/kword/html/import/kwdwriter.h index 5b800c7a..2fc888c4 100644 --- a/filters/kword/html/import/kwdwriter.h +++ b/filters/kword/html/import/kwdwriter.h @@ -20,9 +20,9 @@ #define KWDWRITER_H -#include <qrect.h> +#include <tqrect.h> #include <KoStore.h> -#include <qdom.h> +#include <tqdom.h> /** *@author Frank Dekervel @@ -44,10 +44,10 @@ public: /** - * adds a frameset to parent FIXME + * adds a frameset to tqparent FIXME **/ - QDomElement addFrameSet(QDomElement parent, int frametype=1, - int frameinfo=0, QString name=QString::null, + TQDomElement addFrameSet(TQDomElement tqparent, int frametype=1, + int frameinfo=0, TQString name=TQString(), int visible=1); /** @@ -65,15 +65,15 @@ public: /** * creates a table cell **/ - QDomElement createTableCell(int tableno, int nrow, - int ncol, int colspan, QRect rect); + TQDomElement createTableCell(int tableno, int nrow, + int ncol, int colspan, TQRect rect); /** * fetches the cell of a table **/ - QDomElement fetchTableCell(int tableno, int rowno, int colno); + TQDomElement fetchTableCell(int tableno, int rowno, int colno); /** @@ -81,7 +81,7 @@ public: * if the arguments x,y,w,h are given, each cell is resized to have a 'right' * table. otherwise, the cell sizes are not touched. **/ - void finishTable(int tableno, QRect rect); + void finishTable(int tableno, TQRect rect); void finishTable(int tableno); /** @@ -89,23 +89,23 @@ public: * @param paragraph: the paragraph the anchor should be placed in * @param toInLline: the element that should be inlined **/ - void createInline(QDomElement paragraph, QDomElement toInline); + void createInline(TQDomElement paragraph, TQDomElement toInline); /** - * create a horizontal ruler layout + * create a horizontal ruler tqlayout **/ - void createHR(QDomElement paragraph, int width=1); + void createHR(TQDomElement paragraph, int width=1); /** * **/ - QDomElement currentLayout(QDomElement paragraph); + TQDomElement currentLayout(TQDomElement paragraph); /** * adds a frame to frameset FIXME **/ - QDomElement addFrame(QDomElement frameset, QRect rect, int runaround=0, int copy=0, + TQDomElement addFrame(TQDomElement frameset, TQRect rect, int runaround=0, int copy=0, //int top=42, int left=28, int bottom=799, int right=567, int newFrameBehaviour=0, int runaroundGap=2 ); @@ -114,104 +114,104 @@ public: /** * adds a paragraph **/ - QDomElement addParagraph(QDomElement parent); - QDomElement addParagraph(QDomElement parent, QDomElement layout); + TQDomElement addParagraph(TQDomElement tqparent); + TQDomElement addParagraph(TQDomElement tqparent, TQDomElement tqlayout); /** * adds/changes an attribute to/of the current format **/ - QDomElement formatAttribute(QDomElement paragraph, QString name, QString attrName, QString attr); + TQDomElement formatAttribute(TQDomElement paragraph, TQString name, TQString attrName, TQString attr); /** - * get a layout attribute + * get a tqlayout attribute **/ - QString getLayoutAttribute(QDomElement paragraph, QString name, QString attrName); + TQString getLayoutAttribute(TQDomElement paragraph, TQString name, TQString attrName); /** - * adds/changes an attribute to/of the current layout + * adds/changes an attribute to/of the current tqlayout **/ - QDomElement layoutAttribute(QDomElement paragraph, QString name, QString attrName, QString attr); + TQDomElement tqlayoutAttribute(TQDomElement paragraph, TQString name, TQString attrName, TQString attr); /** * creates a new format in the current paragraph. do this before adding text * FIXME: you can only do addText once per format **/ - QDomElement startFormat(QDomElement paragraph); - QDomElement startFormat(QDomElement paragraph, QDomElement formatToClone); + TQDomElement startFormat(TQDomElement paragraph); + TQDomElement startFormat(TQDomElement paragraph, TQDomElement formatToClone); /** * cleans up the current paragraph (throw away unused formats) * FIXME: find a better solution **/ - void cleanUpParagraph(QDomElement paragraph); + void cleanUpParagraph(TQDomElement paragraph); /** * adds some text to the current format in this paragraph **/ - void addText(QDomElement paragraph, QString text, int format_id, bool keep_formatting=false); + void addText(TQDomElement paragraph, TQString text, int format_id, bool keep_formatting=false); /** * returns the current format * if start_new_one is true, a new format will be started if needed **/ - QDomElement currentFormat(QDomElement paragraph, bool start_new_one=false); + TQDomElement currentFormat(TQDomElement paragraph, bool start_new_one=false); /** * create a Link (URL) **/ - QDomElement createLink(QDomElement paragraph, QString linkName, QString hrefName); + TQDomElement createLink(TQDomElement paragraph, TQString linkName, TQString hrefName); /** - * copy the given layout, and set it as layout of the given paragraph + * copy the given tqlayout, and set it as tqlayout of the given paragraph **/ - QDomElement setLayout(QDomElement paragraph, QDomElement layout); + TQDomElement setLayout(TQDomElement paragraph, TQDomElement tqlayout); /** * returns the text of this paragraph. **/ - QString getText(QDomElement paragraph); + TQString getText(TQDomElement paragraph); /** * returns the rectangle of the first frame of this frameset **/ - QRect getRect(QDomElement frameset); + TQRect getRect(TQDomElement frameset); /** * returns the 'main' frameset of this document. **/ - QDomElement mainFrameset(); + TQDomElement mainFrameset(); /** * mark document as being written by author, and having title title **/ - void createDocInfo(QString author, QString title); + void createDocInfo(TQString author, TQString title); /** * returns the document root **/ - QDomElement docroot(); + TQDomElement docroot(); /** * creates a KWord Variable (Link, ...) **/ - void appendKWordVariable(QDomDocument& doc, QDomElement& format, - const QString& text, const QString& key, int type, QDomElement& child); + void appendKWordVariable(TQDomDocument& doc, TQDomElement& format, + const TQString& text, const TQString& key, int type, TQDomElement& child); private: /** * creates a rectangle **/ - void addRect(QDomElement e, QRect rect); + void addRect(TQDomElement e, TQRect rect); protected: KoStore *_store; - QDomElement _mainFrameset; - QDomDocument *_doc; - QDomDocument *_docinfo; - QDomElement _docinfoMain; + TQDomElement _mainFrameset; + TQDomDocument *_doc; + TQDomDocument *_docinfo; + TQDomElement _docinfoMain; KoTextZoomHandler *_zoomhandler; int tableNo; bool insidetable; diff --git a/filters/kword/kword1.3/import/kword13document.cpp b/filters/kword/kword1.3/import/kword13document.cpp index 697bb366..fcf8e60c 100644 --- a/filters/kword/kword1.3/import/kword13document.cpp +++ b/filters/kword/kword1.3/import/kword13document.cpp @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qiodevice.h> +#include <tqiodevice.h> #include <kdebug.h> #include <ktempfile.h> @@ -44,15 +44,15 @@ KWord13Document::~KWord13Document( void ) delete m_previewFile; } -void KWord13Document::xmldump( QIODevice* io ) +void KWord13Document::xmldump( TQIODevice* io ) { - QTextStream iostream( io ); - iostream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream iostream( io ); + iostream.setEncoding( TQTextStream::UnicodeUTF8 ); iostream << "<?xml encoding='UTF-8'?>\n"; iostream << "<kworddocument>\n"; - for ( QMap<QString,QString>::ConstIterator it = m_documentProperties.begin(); + for ( TQMap<TQString,TQString>::ConstIterator it = m_documentProperties.begin(); it != m_documentProperties.end(); ++it) { @@ -60,7 +60,7 @@ void KWord13Document::xmldump( QIODevice* io ) } iostream << " <documentinfo>\n"; - for ( QMap<QString,QString>::ConstIterator it11 = m_documentInfo.begin(); + for ( TQMap<TQString,TQString>::ConstIterator it11 = m_documentInfo.begin(); it11 != m_documentInfo.end(); ++it11) { @@ -124,7 +124,7 @@ void KWord13Document::xmldump( QIODevice* io ) iostream << " <styles>\n"; - for ( QValueList<KWord13Layout>::Iterator it2 = m_styles.begin(); + for ( TQValueList<KWord13Layout>::Iterator it2 = m_styles.begin(); it2 != m_styles.end(); ++it2) { @@ -135,7 +135,7 @@ void KWord13Document::xmldump( QIODevice* io ) iostream << " <pictures>\n"; - for ( QDictIterator<KWord13Picture> it3( m_pictureDict ) ; it3.current(); ++it3 ) + for ( TQDictIterator<KWord13Picture> it3( m_pictureDict ) ; it3.current(); ++it3 ) { iostream << " <key>" << it3.currentKey() << "</key>" << endl; } @@ -145,13 +145,13 @@ void KWord13Document::xmldump( QIODevice* io ) iostream << "</kworddocument>\n"; } -QString KWord13Document::getDocumentInfo( const QString& name ) const +TQString KWord13Document::getDocumentInfo( const TQString& name ) const { - QMap<QString,QString>::ConstIterator it ( m_documentInfo.find( name ) ); + TQMap<TQString,TQString>::ConstIterator it ( m_documentInfo.tqfind( name ) ); if ( it == m_documentInfo.end() ) { // Property does not exist - return QString::null; + return TQString(); } else { @@ -159,9 +159,9 @@ QString KWord13Document::getDocumentInfo( const QString& name ) const } } -QString KWord13Document::getProperty( const QString& name, const QString& oldName ) const +TQString KWord13Document::getProperty( const TQString& name, const TQString& oldName ) const { - const QString result ( getPropertyInternal( name ) ); + const TQString result ( getPropertyInternal( name ) ); if ( result.isEmpty() && !oldName.isEmpty() ) { @@ -174,13 +174,13 @@ QString KWord13Document::getProperty( const QString& name, const QString& oldNam } } -QString KWord13Document::getPropertyInternal( const QString& name ) const +TQString KWord13Document::getPropertyInternal( const TQString& name ) const { - QMap<QString,QString>::ConstIterator it ( m_documentProperties.find( name ) ); + TQMap<TQString,TQString>::ConstIterator it ( m_documentProperties.tqfind( name ) ); if ( it == m_documentProperties.end() ) { // Property does not exist - return QString::null; + return TQString(); } else { @@ -188,11 +188,11 @@ QString KWord13Document::getPropertyInternal( const QString& name ) const } } -QDateTime KWord13Document::lastPrintingDate( void ) const +TQDateTime KWord13Document::lastPrintingDate( void ) const { - const QString strDate( getPropertyInternal( "VARIABLESETTINGS:lastPrintingDate" ) ); + const TQString strDate( getPropertyInternal( "VARIABLESETTINGS:lastPrintingDate" ) ); - QDateTime dt; + TQDateTime dt; if ( strDate.isEmpty() ) { @@ -201,16 +201,16 @@ QDateTime KWord13Document::lastPrintingDate( void ) const } else { - dt = QDateTime::fromString( strDate, Qt::ISODate ); + dt = TQDateTime::fromString( strDate, Qt::ISODate ); } return dt; } -QDateTime KWord13Document::creationDate( void ) const +TQDateTime KWord13Document::creationDate( void ) const { - const QString strDate( getPropertyInternal( "VARIABLESETTINGS:creationDate" ) ); + const TQString strDate( getPropertyInternal( "VARIABLESETTINGS:creationDate" ) ); - QDateTime dt; + TQDateTime dt; if ( strDate.isEmpty() ) { @@ -219,9 +219,9 @@ QDateTime KWord13Document::creationDate( void ) const const int month = getPropertyInternal( "VARIABLESETTINGS:createFileMonth" ).toInt(); const int day = getPropertyInternal( "VARIABLESETTINGS:createFileDay" ).toInt(); - if ( QDate::isValid( year, month, day) ) + if ( TQDate::isValid( year, month, day) ) { - dt.setDate( QDate ( year, month, day) ); + dt.setDate( TQDate ( year, month, day) ); } else { @@ -230,16 +230,16 @@ QDateTime KWord13Document::creationDate( void ) const } else { - dt = QDateTime::fromString( strDate, Qt::ISODate ); + dt = TQDateTime::fromString( strDate, Qt::ISODate ); } return dt; } -QDateTime KWord13Document::modificationDate( void ) const +TQDateTime KWord13Document::modificationDate( void ) const { - const QString strDate( getPropertyInternal( "VARIABLESETTINGS:modificationDate" ) ); + const TQString strDate( getPropertyInternal( "VARIABLESETTINGS:modificationDate" ) ); - QDateTime dt; + TQDateTime dt; if ( strDate.isEmpty() ) { @@ -247,9 +247,9 @@ QDateTime KWord13Document::modificationDate( void ) const const int year = getPropertyInternal( "VARIABLESETTINGS:modifyFileYear" ).toInt(); const int month = getPropertyInternal( "VARIABLESETTINGS:modifyFileMonth" ).toInt(); const int day = getPropertyInternal( "VARIABLESETTINGS:modifyFileDay" ).toInt(); - if ( QDate::isValid( year, month, day) ) + if ( TQDate::isValid( year, month, day) ) { - dt.setDate( QDate ( year, month, day) ); + dt.setDate( TQDate ( year, month, day) ); } else { @@ -258,7 +258,7 @@ QDateTime KWord13Document::modificationDate( void ) const } else { - dt = QDateTime::fromString( strDate, Qt::ISODate ); + dt = TQDateTime::fromString( strDate, Qt::ISODate ); } return dt; } diff --git a/filters/kword/kword1.3/import/kword13document.h b/filters/kword/kword1.3/import/kword13document.h index dad59be9..79d4d971 100644 --- a/filters/kword/kword1.3/import/kword13document.h +++ b/filters/kword/kword1.3/import/kword13document.h @@ -21,16 +21,16 @@ #ifndef KWORD_1_3_DOCUMENT_H #define KWORD_1_3_DOCUMENT_H -class QIODevice; +class TQIODevice; class KTempFile; class KWord13Picture; -#include <qstring.h> -#include <qmap.h> -#include <qptrlist.h> -#include <qdatetime.h> -#include <qdict.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqdatetime.h> +#include <tqdict.h> +#include <tqstringlist.h> #include "kword13frameset.h" @@ -41,40 +41,40 @@ public: ~KWord13Document( void ); public: - void xmldump( QIODevice* io ); + void xmldump( TQIODevice* io ); /// Get the "last printed" date/time - QDateTime lastPrintingDate( void ) const; + TQDateTime lastPrintingDate( void ) const; /// Get the "creation" date/time - QDateTime creationDate( void ) const; + TQDateTime creationDate( void ) const; /// Get the "modification" date/time - QDateTime modificationDate( void ) const; + TQDateTime modificationDate( void ) const; /** * Get a document info * \param name name of the document info */ - QString getDocumentInfo( const QString& name ) const; + TQString getDocumentInfo( const TQString& name ) const; /** * Get a document property * \param name name of the property * \param oldName alternative name of the property (in old KWord syntax) */ - QString getProperty( const QString& name, const QString& oldName = QString::null ) const; + TQString getProperty( const TQString& name, const TQString& oldName = TQString() ) const; protected: /// Get a document property \internal - QString getPropertyInternal( const QString& name ) const; + TQString getPropertyInternal( const TQString& name ) const; public: - QMap<QString, QString> m_documentProperties; - QMap<QString, QString> m_documentInfo; ///< From documentinfo.xml - QValueList<KWord13Layout> m_styles; - QPtrList<KWordTextFrameset> m_normalTextFramesetList; ///< List of \<FRAMESET\> having normal text - QPtrList<KWordTextFrameset> m_tableFramesetList; ///< List of \<FRAMESET\> being part of tables - QPtrList<KWordTextFrameset> m_headerFooterFramesetList; ///< List of \<FRAMESET\> having footer/header - QPtrList<KWordTextFrameset> m_footEndNoteFramesetList; ///< List of \<FRAMESET\> having footnotes or endnotes - QPtrList<KWord13PictureFrameset> m_pictureFramesetList; ///< List of \<FRAMESET\> having pictures - QPtrList<KWord13Frameset> m_otherFramesetList; ///< List of \<FRAMESET\> of other types - QDict<KWord13Picture> m_pictureDict; ///< "Dictionnary" of all pictures' data + TQMap<TQString, TQString> m_documentProperties; + TQMap<TQString, TQString> m_documentInfo; ///< From documentinfo.xml + TQValueList<KWord13Layout> m_styles; + TQPtrList<KWordTextFrameset> m_normalTextFramesetList; ///< List of \<FRAMESET\> having normal text + TQPtrList<KWordTextFrameset> m_tableFramesetList; ///< List of \<FRAMESET\> being part of tables + TQPtrList<KWordTextFrameset> m_headerFooterFramesetList; ///< List of \<FRAMESET\> having footer/header + TQPtrList<KWordTextFrameset> m_footEndNoteFramesetList; ///< List of \<FRAMESET\> having footnotes or endnotes + TQPtrList<KWord13PictureFrameset> m_pictureFramesetList; ///< List of \<FRAMESET\> having pictures + TQPtrList<KWord13Frameset> m_otherFramesetList; ///< List of \<FRAMESET\> of other types + TQDict<KWord13Picture> m_pictureDict; ///< "Dictionnary" of all pictures' data KTempFile* m_previewFile; - QStringList m_anchoredFramesetNames; ///< List of framesets that are anchored + TQStringList m_anchoredFramesetNames; ///< List of framesets that are anchored }; #endif // KWORD_1_3_DOCUMENT_H diff --git a/filters/kword/kword1.3/import/kword13formatone.cpp b/filters/kword/kword1.3/import/kword13formatone.cpp index 00a7d173..5f4dca5f 100644 --- a/filters/kword/kword1.3/import/kword13formatone.cpp +++ b/filters/kword/kword1.3/import/kword13formatone.cpp @@ -1,4 +1,4 @@ -#include <qtextstream.h> +#include <tqtextstream.h> #include "kword13utils.h" #include "kword13formatone.h" @@ -11,11 +11,11 @@ KWord13FormatOneData::~KWord13FormatOneData( void ) { } -void KWord13FormatOneData::xmldump( QTextStream& iostream ) +void KWord13FormatOneData::xmldump( TQTextStream& iostream ) { iostream << " <formatone>" << "\">\n"; - for ( QMap<QString,QString>::ConstIterator it = m_properties.begin(); + for ( TQMap<TQString,TQString>::ConstIterator it = m_properties.begin(); it != m_properties.end(); ++it) { @@ -25,16 +25,16 @@ void KWord13FormatOneData::xmldump( QTextStream& iostream ) iostream << " </formatone>\n"; } -QString KWord13FormatOneData::key( void ) const +TQString KWord13FormatOneData::key( void ) const { - QString strKey; + TQString strKey; // At first, use the number of properties as it is an easy sorting value - strKey += QString::number( m_properties.count(), 16 ); + strKey += TQString::number( m_properties.count(), 16 ); strKey += ':'; - // use the worst key: the whole QMap (### FIXME) - for ( QMap<QString,QString>::const_iterator it = m_properties.constBegin() ; + // use the worst key: the whole TQMap (### FIXME) + for ( TQMap<TQString,TQString>::const_iterator it = m_properties.constBegin() ; it != m_properties.constEnd(); ++it ) { strKey += it.key(); @@ -46,13 +46,13 @@ QString KWord13FormatOneData::key( void ) const return strKey; } -QString KWord13FormatOneData::getProperty( const QString& name ) const +TQString KWord13FormatOneData::getProperty( const TQString& name ) const { - QMap<QString,QString>::ConstIterator it ( m_properties.find( name ) ); + TQMap<TQString,TQString>::ConstIterator it ( m_properties.tqfind( name ) ); if ( it == m_properties.end() ) { // Property does not exist - return QString::null; + return TQString(); } else { diff --git a/filters/kword/kword1.3/import/kword13formatone.h b/filters/kword/kword1.3/import/kword13formatone.h index 9f2e16d1..e4cc7f38 100644 --- a/filters/kword/kword1.3/import/kword13formatone.h +++ b/filters/kword/kword1.3/import/kword13formatone.h @@ -21,16 +21,16 @@ #ifndef KWORD_1_3_FORMAT_ONE #define KWORD_1_3_FORMAT_ONE -class QTextStream; +class TQTextStream; -#include <qstring.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqmap.h> #include "kword13format.h" /** - * Contains the data of the \<FORMAT id="1"\> children - * also the grand-children of \<STYLE\> and \<LAYOUT\> + * Contains the data of the \<FORMAT id="1"\> tqchildren + * also the grand-tqchildren of \<STYLE\> and \<LAYOUT\> */ class KWord13FormatOneData { @@ -39,21 +39,21 @@ public: ~KWord13FormatOneData( void ); public: - void xmldump( QTextStream& iostream ); + void xmldump( TQTextStream& iostream ); /** * @brief Get a key representating the properties * * This key helps to categorize the automatic styles */ - QString key( void ) const; + TQString key( void ) const; - QString getProperty( const QString& name ) const; + TQString getProperty( const TQString& name ) const; public: - QMap<QString,QString> m_properties; + TQMap<TQString,TQString> m_properties; public: // OASIS-specific - QString m_autoStyleName; ///< Name of the OASIS automatic style + TQString m_autoStyleName; ///< Name of the OASIS automatic style }; /** @@ -75,7 +75,7 @@ public: virtual KWord13FormatOneData* getFormatOneData(void); public: int m_length; ///< Length of format - KWord13FormatOneData m_formatOne; ///< Data of children of \<FORMAT id="1"\> + KWord13FormatOneData m_formatOne; ///< Data of tqchildren of \<FORMAT id="1"\> }; #endif // KWORD_1_3_FORMAT_ONE diff --git a/filters/kword/kword1.3/import/kword13formatother.cpp b/filters/kword/kword1.3/import/kword13formatother.cpp index 2ed48f6f..f1ee8cf0 100644 --- a/filters/kword/kword1.3/import/kword13formatother.cpp +++ b/filters/kword/kword1.3/import/kword13formatother.cpp @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> +#include <tqstring.h> #include "kword13formatother.h" diff --git a/filters/kword/kword1.3/import/kword13formatother.h b/filters/kword/kword1.3/import/kword13formatother.h index 66eb1356..01181363 100644 --- a/filters/kword/kword1.3/import/kword13formatother.h +++ b/filters/kword/kword1.3/import/kword13formatother.h @@ -34,7 +34,7 @@ public: KWord13FormatFour(void); virtual ~KWord13FormatFour(void); public: - QString m_text; ///< replacement text + TQString m_text; ///< replacement text }; /** @@ -48,7 +48,7 @@ public: KWord13FormatSix(void); virtual ~KWord13FormatSix(void); public: - QString m_anchorName; ///< name of anchor + TQString m_anchorName; ///< name of anchor }; diff --git a/filters/kword/kword1.3/import/kword13frameset.cpp b/filters/kword/kword1.3/import/kword13frameset.cpp index 783546d4..6ab0f99c 100644 --- a/filters/kword/kword1.3/import/kword13frameset.cpp +++ b/filters/kword/kword1.3/import/kword13frameset.cpp @@ -24,7 +24,7 @@ #include "kword13frameset.h" -KWord13Frameset::KWord13Frameset( int frameType, int frameInfo, const QString& name ) +KWord13Frameset::KWord13Frameset( int frameType, int frameInfo, const TQString& name ) : m_numFrames(0), m_frameType( frameType ), m_frameInfo( frameInfo ), m_name( name ) { } @@ -39,13 +39,13 @@ bool KWord13Frameset::addParagraph(const KWord13Paragraph&) return false; } -bool KWord13Frameset::setKey(const QString&) +bool KWord13Frameset::setKey(const TQString&) { kdWarning(30520) << "Cannot set a key! Not a picture frameset!" << endl; return false; } -void KWord13Frameset::xmldump( QTextStream& iostream ) +void KWord13Frameset::xmldump( TQTextStream& iostream ) { iostream << " <frameset variant=\"None\" type=\"" << m_frameType << "\" info=\"" << m_frameInfo @@ -53,7 +53,7 @@ void KWord13Frameset::xmldump( QTextStream& iostream ) } -KWordTextFrameset::KWordTextFrameset( int frameType, int frameInfo, const QString& name ) +KWordTextFrameset::KWordTextFrameset( int frameType, int frameInfo, const TQString& name ) : KWord13Frameset( frameType, frameInfo, name ) { } @@ -68,7 +68,7 @@ bool KWordTextFrameset::addParagraph(const KWord13Paragraph& para) return true; } -void KWordTextFrameset::xmldump( QTextStream& iostream ) +void KWordTextFrameset::xmldump( TQTextStream& iostream ) { iostream << " <frameset variant=\"Text\" type=\"" << m_frameType << "\" info=\"" << m_frameInfo @@ -77,7 +77,7 @@ void KWordTextFrameset::xmldump( QTextStream& iostream ) iostream << " </frameset>\n"; } -KWord13PictureFrameset::KWord13PictureFrameset( int frameType, int frameInfo, const QString& name ) +KWord13PictureFrameset::KWord13PictureFrameset( int frameType, int frameInfo, const TQString& name ) : KWord13Frameset( frameType, frameInfo, name ) { } @@ -86,13 +86,13 @@ KWord13PictureFrameset::~KWord13PictureFrameset( void ) { } -bool KWord13PictureFrameset::setKey(const QString& key) +bool KWord13PictureFrameset::setKey(const TQString& key) { m_pictureKey = key; return true; } -void KWord13PictureFrameset::xmldump( QTextStream& iostream ) +void KWord13PictureFrameset::xmldump( TQTextStream& iostream ) { iostream << " <frameset variant=\"Picture\" type=\"" << m_frameType << "\" info=\"" << m_frameInfo diff --git a/filters/kword/kword1.3/import/kword13frameset.h b/filters/kword/kword1.3/import/kword13frameset.h index 94b6acd9..e5ea5e26 100644 --- a/filters/kword/kword1.3/import/kword13frameset.h +++ b/filters/kword/kword1.3/import/kword13frameset.h @@ -21,40 +21,40 @@ #ifndef _FILTER_KWORD_1_3__KWORDFRAMESET_H #define _FILTER_KWORD_1_3__KWORDFRAMESET_H -class QString; -class QTextStream; +class TQString; +class TQTextStream; -#include <qstring.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqmap.h> #include "kword13paragraph.h" class KWord13Frameset { public: - KWord13Frameset( int frameType, int frameInfo, const QString& name ); + KWord13Frameset( int frameType, int frameInfo, const TQString& name ); virtual ~KWord13Frameset( void ); public: virtual bool addParagraph(const KWord13Paragraph& para); - virtual bool setKey( const QString& key ); - virtual void xmldump( QTextStream& iostream ); + virtual bool setKey( const TQString& key ); + virtual void xmldump( TQTextStream& iostream ); public: int m_numFrames; ///< Number of frames - QMap<QString,QString> m_frameData; ///< Data of frames (### TODO: do better!) + TQMap<TQString,TQString> m_frameData; ///< Data of frames (### TODO: do better!) protected: int m_frameType; int m_frameInfo; - QString m_name; ///< Name of frameset + TQString m_name; ///< Name of frameset }; class KWordTextFrameset : public KWord13Frameset { public: - KWordTextFrameset( int frameType, int frameInfo, const QString& name ); + KWordTextFrameset( int frameType, int frameInfo, const TQString& name ); virtual ~KWordTextFrameset( void ); public: virtual bool addParagraph(const KWord13Paragraph& para); - virtual void xmldump( QTextStream& iostream ); + virtual void xmldump( TQTextStream& iostream ); public: KWord13ParagraphGroup m_paragraphGroup; }; @@ -62,13 +62,13 @@ public: class KWord13PictureFrameset : public KWord13Frameset { public: - KWord13PictureFrameset( int frameType, int frameInfo, const QString& name ); + KWord13PictureFrameset( int frameType, int frameInfo, const TQString& name ); virtual ~KWord13PictureFrameset( void ); public: - virtual bool setKey( const QString& key ); - virtual void xmldump( QTextStream& iostream ); + virtual bool setKey( const TQString& key ); + virtual void xmldump( TQTextStream& iostream ); public: - QString m_pictureKey; + TQString m_pictureKey; }; #endif // _FILTER_KWORD_1_3__KWORDFRAMESET_H diff --git a/filters/kword/kword1.3/import/kword13import.cpp b/filters/kword/kword1.3/import/kword13import.cpp index a27a39c3..58349af8 100644 --- a/filters/kword/kword1.3/import/kword13import.cpp +++ b/filters/kword/kword1.3/import/kword13import.cpp @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qxml.h> -#include <qdom.h> +#include <tqxml.h> +#include <tqdom.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -38,17 +38,17 @@ typedef KGenericFactory<KWord13Import, KoFilter> KWord13ImportFactory; K_EXPORT_COMPONENT_FACTORY( libkwordkword1dot3import, KWord13ImportFactory( "kofficefilters" ) ) -KWord13Import::KWord13Import(KoFilter */*parent*/, const char */*name*/, const QStringList &) +KWord13Import::KWord13Import(KoFilter */*tqparent*/, const char */*name*/, const TQStringList &) : KoFilter() { } -bool KWord13Import::parseInfo( QIODevice* io, KWord13Document& kwordDocument ) +bool KWord13Import::parseInfo( TQIODevice* io, KWord13Document& kwordDocument ) { kdDebug(30520) << "Starting KWord13Import::parseInfo" << endl; - QDomDocument doc; - // Error variables for QDomDocument::setContent - QString errorMsg; + TQDomDocument doc; + // Error variables for TQDomDocument::setContent + TQString errorMsg; int errorLine, errorColumn; if ( ! doc.setContent( io, &errorMsg, &errorLine, &errorColumn ) ) { @@ -58,21 +58,21 @@ bool KWord13Import::parseInfo( QIODevice* io, KWord13Document& kwordDocument ) // ### TODO: user message return false; } - QDomElement docElement( doc.documentElement() ); - // In documentinfo.xml, the text data is in the grand-children of the document element - for ( QDomNode node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) + TQDomElement docElement( doc.documentElement() ); + // In documentinfo.xml, the text data is in the grand-tqchildren of the document element + for ( TQDomNode node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { kdDebug(30520) << "Child " << node.nodeName() << endl; if ( !node.isElement() ) continue; // Comment, PI... - const QString nodeName( node.nodeName() ); - for ( QDomNode node2 = node.firstChild(); !node2.isNull(); node2 = node2.nextSibling() ) + const TQString nodeName( node.nodeName() ); + for ( TQDomNode node2 = node.firstChild(); !node2.isNull(); node2 = node2.nextSibling() ) { kdDebug(30520) << "Grand-child " << node2.nodeName() << endl; if ( !node2.isElement() ) continue; - const QString nodeName2 ( nodeName + ':' + node2.nodeName() ); - QDomElement element( node2.toElement() ); + const TQString nodeName2 ( nodeName + ':' + node2.nodeName() ); + TQDomElement element( node2.toElement() ); kwordDocument.m_documentInfo[ nodeName2 ] = element.text(); } } @@ -80,15 +80,15 @@ bool KWord13Import::parseInfo( QIODevice* io, KWord13Document& kwordDocument ) return true; } -bool KWord13Import::parseRoot( QIODevice* io, KWord13Document& kwordDocument ) +bool KWord13Import::parseRoot( TQIODevice* io, KWord13Document& kwordDocument ) { KWord13Parser handler( &kwordDocument ); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler( &handler ); reader.setErrorHandler( &handler ); - QXmlInputSource source( io ); // Read the file + TQXmlInputSource source( io ); // Read the file if (!reader.parse( source )) { @@ -104,7 +104,7 @@ bool KWord13Import::postParse( KoStore* store, KWord13Document& doc ) return post.postParse( store, doc ); } -KoFilter::ConversionStatus KWord13Import::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus KWord13Import::convert( const TQCString& from, const TQCString& to ) { if ( to != "application/vnd.oasis.opendocument.text" || from != "application/x-kword" ) @@ -117,7 +117,7 @@ KoFilter::ConversionStatus KWord13Import::convert( const QCString& from, const Q KWord13Document kwordDocument; - const QString fileName( m_chain->inputFile() ); + const TQString fileName( m_chain->inputFile() ); if ( fileName.isEmpty() ) { kdError(30520) << "No input file name!" << endl; @@ -166,17 +166,17 @@ KoFilter::ConversionStatus KWord13Import::convert( const QCString& from, const Q kdDebug(30520) << "Preview found!" << endl; KoStoreDevice ioPreview( store ); ioPreview.open( IO_ReadOnly ); - const QByteArray image ( ioPreview.readAll() ); + const TQByteArray image ( ioPreview.readAll() ); if ( image.isNull() ) { kdWarning(30520) << "Loading of preview failed! Ignoring!" << endl; } else { - kwordDocument.m_previewFile = new KTempFile( QString::null, ".png" ); + kwordDocument.m_previewFile = new KTempFile( TQString(), ".png" ); // ### TODO check KTempFile kwordDocument.m_previewFile->setAutoDelete( true ); - QFile file( kwordDocument.m_previewFile->name() ); + TQFile file( kwordDocument.m_previewFile->name() ); // ### TODO: check if file is correctly written file.open( IO_WriteOnly ); file.writeBlock( image ); @@ -197,9 +197,9 @@ KoFilter::ConversionStatus KWord13Import::convert( const QCString& from, const Q delete store; store = 0; - QFile file( fileName ); + TQFile file( fileName ); file.open( IO_ReadOnly ); - if ( ! parseRoot( &file, kwordDocument ) ) + if ( ! parseRoot( TQT_TQIODEVICE(&file), kwordDocument ) ) { kdError(30520) << "Could not process document! Aborting!" << endl; file.close(); @@ -230,7 +230,7 @@ KoFilter::ConversionStatus KWord13Import::convert( const QCString& from, const Q return KoFilter::StupidError; } - const QString filenameOut ( m_chain->outputFile() ); + const TQString filenameOut ( m_chain->outputFile() ); if ( filenameOut.isEmpty() ) { diff --git a/filters/kword/kword1.3/import/kword13import.h b/filters/kword/kword1.3/import/kword13import.h index bf58a7d7..d5bebeb3 100644 --- a/filters/kword/kword1.3/import/kword13import.h +++ b/filters/kword/kword1.3/import/kword13import.h @@ -21,27 +21,28 @@ #ifndef KWORD_1_3_IMPORT_H #define KWORD_1_3_IMPORT_H -#include <qstring.h> -#include <qcstring.h> +#include <tqstring.h> +#include <tqcstring.h> #include <KoFilter.h> -class QIODevice; +class TQIODevice; class KoStore; class KWord13Document; class KWord13Import : public KoFilter { Q_OBJECT + TQ_OBJECT public: - KWord13Import(KoFilter *parent, const char *name, const QStringList &); + KWord13Import(KoFilter *tqparent, const char *name, const TQStringList &); virtual ~KWord13Import() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); protected: - bool parseInfo( QIODevice* io, KWord13Document& kwordDocument ); - bool parseRoot( QIODevice* io, KWord13Document& kwordDocument ); + bool parseInfo( TQIODevice* io, KWord13Document& kwordDocument ); + bool parseRoot( TQIODevice* io, KWord13Document& kwordDocument ); bool postParse( KoStore* store, KWord13Document& doc ); }; #endif // KWORD_1_3_IMPORT_H diff --git a/filters/kword/kword1.3/import/kword13layout.cpp b/filters/kword/kword1.3/import/kword13layout.cpp index b6344f9c..4ec4c59d 100644 --- a/filters/kword/kword1.3/import/kword13layout.cpp +++ b/filters/kword/kword1.3/import/kword13layout.cpp @@ -1,4 +1,4 @@ -#include <qtextstream.h> +#include <tqtextstream.h> #include "kword13utils.h" #include "kword13layout.h" @@ -11,12 +11,12 @@ KWord13Layout::~KWord13Layout( void ) { } -void KWord13Layout::xmldump( QTextStream& iostream ) +void KWord13Layout::xmldump( TQTextStream& iostream ) { - iostream << " <layout name=\"" << EscapeXmlDump( m_name ) - << "\" outline=\"" << ( m_outline ? QString("true") : QString("false") ) << "\">\n"; + iostream << " <tqlayout name=\"" << EscapeXmlDump( m_name ) + << "\" outline=\"" << ( m_outline ? TQString("true") : TQString("false") ) << "\">\n"; - for ( QMap<QString,QString>::ConstIterator it = m_layoutProperties.begin(); + for ( TQMap<TQString,TQString>::ConstIterator it = m_layoutProperties.begin(); it != m_layoutProperties.end(); ++it) { @@ -25,18 +25,18 @@ void KWord13Layout::xmldump( QTextStream& iostream ) m_format.xmldump( iostream ); - iostream << " </layout>\n"; + iostream << " </tqlayout>\n"; } -QString KWord13Layout::key( void ) const +TQString KWord13Layout::key( void ) const { - QString strKey; + TQString strKey; strKey += m_name; strKey += '@'; // Use the number of properties as it is an easy sorting value - strKey += QString::number( m_layoutProperties.count(), 16 ); + strKey += TQString::number( m_layoutProperties.count(), 16 ); strKey += ':'; if ( m_outline ) @@ -44,8 +44,8 @@ QString KWord13Layout::key( void ) const else strKey += "O0,"; - // use the worst key: the whole QMap (### FIXME) - for ( QMap<QString,QString>::const_iterator it = m_layoutProperties.constBegin() ; + // use the worst key: the whole TQMap (### FIXME) + for ( TQMap<TQString,TQString>::const_iterator it = m_layoutProperties.constBegin() ; it != m_layoutProperties.constEnd(); ++it ) { strKey += it.key(); @@ -61,13 +61,13 @@ QString KWord13Layout::key( void ) const return strKey; } -QString KWord13Layout::getProperty( const QString& name ) const +TQString KWord13Layout::getProperty( const TQString& name ) const { - QMap<QString,QString>::ConstIterator it ( m_layoutProperties.find( name ) ); + TQMap<TQString,TQString>::ConstIterator it ( m_layoutProperties.tqfind( name ) ); if ( it == m_layoutProperties.end() ) { // Property does not exist - return QString::null; + return TQString(); } else { diff --git a/filters/kword/kword1.3/import/kword13layout.h b/filters/kword/kword1.3/import/kword13layout.h index ee8a2010..2ca1a8b1 100644 --- a/filters/kword/kword1.3/import/kword13layout.h +++ b/filters/kword/kword1.3/import/kword13layout.h @@ -2,10 +2,10 @@ #ifndef _KWORD13LAYOUT #define _KWORD13LAYOUT -class QTextStream; +class TQTextStream; -#include <qstring.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqmap.h> #include "kword13formatone.h" @@ -19,25 +19,25 @@ public: ~KWord13Layout( void ); public: - void xmldump( QTextStream& iostream ); + void xmldump( TQTextStream& iostream ); /** * @brief Get a key representating the properties * * This key helps to categorize the automatic styles */ - QString key( void ) const; + TQString key( void ) const; - QString getProperty( const QString& name ) const; + TQString getProperty( const TQString& name ) const; public: KWord13FormatOneData m_format; ///< Character format properties - QMap<QString,QString> m_layoutProperties; + TQMap<TQString,TQString> m_layoutProperties; bool m_outline; - QString m_name; ///< Name of the style (either the used one or the one currently being defined) + TQString m_name; ///< Name of the style (either the used one or the one currently being defined) public: // OASIS-specific - QString m_autoStyleName; ///< Name of the OASIS automatic style + TQString m_autoStyleName; ///< Name of the OASIS automatic style }; #endif // _KWORD13LAYOUT diff --git a/filters/kword/kword1.3/import/kword13oasisgenerator.cpp b/filters/kword/kword1.3/import/kword13oasisgenerator.cpp index 58ef032e..00b899f9 100644 --- a/filters/kword/kword1.3/import/kword13oasisgenerator.cpp +++ b/filters/kword/kword1.3/import/kword13oasisgenerator.cpp @@ -17,12 +17,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qdict.h> -#include <qfile.h> -#include <qbuffer.h> -#include <qcolor.h> -#include <qimage.h> +#include <tqstring.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqbuffer.h> +#include <tqcolor.h> +#include <tqimage.h> #include <kdebug.h> #include <ktempfile.h> @@ -57,7 +57,7 @@ void KWord13OasisGenerator::prepareTextFrameset( KWordTextFrameset* frameset ) return; } - for ( QValueList<KWord13Paragraph>::Iterator it = frameset->m_paragraphGroup.begin(); + for ( TQValueList<KWord13Paragraph>::Iterator it = frameset->m_paragraphGroup.begin(); it != frameset->m_paragraphGroup.end(); ++it) { declareLayout( (*it).m_layout ); @@ -105,9 +105,9 @@ void KWord13OasisGenerator::preparePageLayout( void ) if ( ok && columns > 1 ) { // ### TODO: test - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - KoXmlWriter element ( &buffer ); + KoXmlWriter element ( TQT_TQIODEVICE(&buffer) ); element.startElement("style:columns"); element.addAttribute( "fo:column-count", columns ); element.addAttributePt( "fo:column-gap", positiveNumberOrNull( m_kwordDocument->getProperty( "PAPER:columnspacing", "PAPER:ptColumnspc" ) ) ); @@ -123,10 +123,10 @@ void KWord13OasisGenerator::preparePageLayout( void ) element.endElement(); buffer.close(); - const QString strElement( QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ) ); + const TQString strElement( TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ) ); style.addChildElement( "style:columns", strElement ); } - const QString automaticPageStyle ( m_oasisGenStyles.lookup( style, "pm" ) ); + const TQString automaticPageStyle ( m_oasisGenStyles.lookup( style, "pm" ) ); kdDebug(30520) << "Automatic page style: " << automaticPageStyle << endl; } @@ -143,7 +143,7 @@ bool KWord13OasisGenerator::prepare( KWord13Document& kwordDocument ) preparePageLayout(); // Declare styles - for ( QValueList<KWord13Layout>::Iterator it = m_kwordDocument->m_styles.begin(); + for ( TQValueList<KWord13Layout>::Iterator it = m_kwordDocument->m_styles.begin(); it != m_kwordDocument->m_styles.end(); ++it) { declareStyle( *it ); @@ -157,7 +157,7 @@ bool KWord13OasisGenerator::prepare( KWord13Document& kwordDocument ) return true; } -double KWord13OasisGenerator::numberOrNull( const QString& str ) const +double KWord13OasisGenerator::numberOrNull( const TQString& str ) const { bool ok = false; const double d = str.toDouble( &ok ); @@ -167,7 +167,7 @@ double KWord13OasisGenerator::numberOrNull( const QString& str ) const return 0.0; } -double KWord13OasisGenerator::positiveNumberOrNull( const QString& str ) const +double KWord13OasisGenerator::positiveNumberOrNull( const TQString& str ) const { bool ok = false; const double d = str.toDouble( &ok ); @@ -178,11 +178,11 @@ double KWord13OasisGenerator::positiveNumberOrNull( const QString& str ) const } // Inspired by KoParagStyle::saveStyle -void KWord13OasisGenerator::declareLayout( KWord13Layout& layout ) +void KWord13OasisGenerator::declareLayout( KWord13Layout& tqlayout ) { - KoGenStyle gs( KoGenStyle::STYLE_AUTO, "paragraph", layout.m_name ); + KoGenStyle gs( KoGenStyle::STYLE_AUTO, "paragraph", tqlayout.m_name ); - // ### TODO: any display name? gs.addAttribute( "style:display-name", layout.m_name ); + // ### TODO: any display name? gs.addAttribute( "style:display-name", tqlayout.m_name ); #if 0 // TODO: check that this is correct if ( m_paragLayout.counter && m_paragLayout.counter->depth() ) { @@ -192,21 +192,21 @@ void KWord13OasisGenerator::declareLayout( KWord13Layout& layout ) gs.addAttribute( "style:default-level", (int)m_paragLayout.counter->depth() + 1 ); } #endif - fillGenStyleWithLayout( layout, gs, false ); - fillGenStyleWithFormatOne( layout.m_format , gs, false ); + fillGenStyleWithLayout( tqlayout, gs, false ); + fillGenStyleWithFormatOne( tqlayout.m_format , gs, false ); - layout.m_autoStyleName = m_oasisGenStyles.lookup( gs, "P", true ); + tqlayout.m_autoStyleName = m_oasisGenStyles.lookup( gs, "P", true ); - kdDebug(30520) << "Layout: Parent " << layout.m_name << " => " << layout.m_autoStyleName << endl; + kdDebug(30520) << "Layout: Parent " << tqlayout.m_name << " => " << tqlayout.m_autoStyleName << endl; } // Inspired by KoParagStyle::saveStyle -void KWord13OasisGenerator::declareStyle( KWord13Layout& layout ) +void KWord13OasisGenerator::declareStyle( KWord13Layout& tqlayout ) { - KoGenStyle gs( KoGenStyle::STYLE_USER, "paragraph", QString::null ); + KoGenStyle gs( KoGenStyle::STYLE_USER, "paragraph", TQString() ); - gs.addAttribute( "style:display-name", layout.m_name ); + gs.addAttribute( "style:display-name", tqlayout.m_name ); #if 0 // TODO: check that this is correct if ( m_paragLayout.counter && m_paragLayout.counter->depth() ) { @@ -216,23 +216,23 @@ void KWord13OasisGenerator::declareStyle( KWord13Layout& layout ) gs.addAttribute( "style:default-level", (int)m_paragLayout.counter->depth() + 1 ); } #endif - fillGenStyleWithLayout( layout, gs, true ); - fillGenStyleWithFormatOne( layout.m_format , gs, true ); + fillGenStyleWithLayout( tqlayout, gs, true ); + fillGenStyleWithFormatOne( tqlayout.m_format , gs, true ); - layout.m_autoStyleName = m_oasisGenStyles.lookup( gs, layout.m_name, false ); + tqlayout.m_autoStyleName = m_oasisGenStyles.lookup( gs, tqlayout.m_name, false ); - kdDebug(30520) << "Style: " << layout.m_name << " => " << layout.m_autoStyleName << endl; + kdDebug(30520) << "Style: " << tqlayout.m_name << " => " << tqlayout.m_autoStyleName << endl; } // Inspired from KoTextFormat::save but we have not the same data to start with. void KWord13OasisGenerator::fillGenStyleWithFormatOne( const KWord13FormatOneData& one, KoGenStyle& gs, const bool style ) const { - QString str; // helper string + TQString str; // helper string KoGenStyle::PropertyType tt = KoGenStyle::TextType; bool redok = false, greenok = false, blueok = false, ok = false; - const QColor color( + const TQColor color( one.getProperty( "COLOR:red" ).toInt( &redok ), one.getProperty( "COLOR:green" ).toInt( &greenok ), one.getProperty( "COLOR:blue" ).toInt( &blueok ) ); @@ -273,7 +273,7 @@ void KWord13OasisGenerator::fillGenStyleWithFormatOne( const KWord13FormatOneDat } else { - gs.addProperty( "fo:font-weight", QString::number( weight * 10 ), tt ); + gs.addProperty( "fo:font-weight", TQString::number( weight * 10 ), tt ); } } else if ( style ) @@ -298,7 +298,7 @@ void KWord13OasisGenerator::fillGenStyleWithFormatOne( const KWord13FormatOneDat gs.addProperty( "style:text-underline-mode", d->m_bWordByWord ? "skip-white-space" : "continuous", tt ); gs.addProperty( "style:text-underline-type", m_underlineType == U_NONE ? "none" : m_underlineType == U_DOUBLE ? "double" : "single", tt ); - QString styleline; + TQString styleline; if ( m_underlineType == U_WAVE ) styleline = "wave"; else @@ -314,14 +314,14 @@ void KWord13OasisGenerator::fillGenStyleWithFormatOne( const KWord13FormatOneDat gs.addProperty( "style:text-line-through-style", styleline, tt ); //gs.addProperty( "style:text-line-through-color", ...) TODO in kotext - QString textPos; + TQString textPos; if ( d->m_offsetFromBaseLine != 0 ) - textPos = QString::number( 100 * d->m_offsetFromBaseLine / fn.pointSizeFloat() ) + '%'; + textPos = TQString::number( 100 * d->m_offsetFromBaseLine / fn.pointSizeFloat() ) + '%'; else if ( va == AlignSuperScript ) textPos = "super"; else if ( va == AlignSubScript ) textPos = "sub"; else textPos = "0%"; textPos += ' '; - textPos += QString::number( d->m_relativeTextSize * 100 ); + textPos += TQString::number( d->m_relativeTextSize * 100 ); textPos += '%'; gs.addProperty( "style:text-position", textPos, tt ); @@ -332,7 +332,7 @@ void KWord13OasisGenerator::fillGenStyleWithFormatOne( const KWord13FormatOneDat else if ( m_attributeFont == ATT_LOWER ) gs.addProperty( "fo:text-transform", "lowercase", tt ); - gs.addProperty( "fo:language", m_language == "en_US" ? QString("en") : m_language, tt ); + gs.addProperty( "fo:language", m_language == "en_US" ? TQString("en") : m_language, tt ); gs.addProperty( "fo:background-color", m_textBackColor.isValid() ? m_textBackColor.name() : "transparent", tt ); gs.addProperty( "fo:text-shadow", shadowAsCss(), tt ); @@ -341,13 +341,13 @@ void KWord13OasisGenerator::fillGenStyleWithFormatOne( const KWord13FormatOneDat } // Inspired from KoParagLayout::saveOasis but we have not the same data to start with. -void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, KoGenStyle& gs, const bool style ) const +void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& tqlayout, KoGenStyle& gs, const bool style ) const { // ### TODO syntaxVersion < 3 - QString str; // Help string to store each KWord 1.3 layout property + TQString str; // Help string to store each KWord 1.3 tqlayout property - str = layout.getProperty( "FLOW:align" ); + str = tqlayout.getProperty( "FLOW:align" ); if ( str.isEmpty() && ! style) { // Nothing to do! @@ -361,7 +361,7 @@ void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, gs.addProperty( "fo:text-align", "start" ); // i.e. direction-dependent } - str = layout.getProperty( "FLOW:dir" ); + str = tqlayout.getProperty( "FLOW:dir" ); if ( str == "R" ) // ### TODO: check the right value { gs.addProperty( "style:writing-mode", "rl-tb" ); // right-to-left, top-to-bottom @@ -372,11 +372,11 @@ void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, } // ### TODO: do not define if it does not exist and ! style - gs.addPropertyPt( "fo:margin-left", numberOrNull( layout.getProperty( "INDENTS:left" ) ) ); - gs.addPropertyPt( "fo:margin-right", numberOrNull( layout.getProperty( "INDENTS:right" ) ) ); - gs.addPropertyPt( "fo:text-indent", numberOrNull( layout.getProperty( "INDENTS:first" ) ) ); - gs.addPropertyPt( "fo:margin-top", numberOrNull( layout.getProperty( "OFFSETS:before" ) ) ); - gs.addPropertyPt( "fo:margin-bottom", numberOrNull( layout.getProperty( "OFFSETS:after" ) ) ); + gs.addPropertyPt( "fo:margin-left", numberOrNull( tqlayout.getProperty( "INDENTS:left" ) ) ); + gs.addPropertyPt( "fo:margin-right", numberOrNull( tqlayout.getProperty( "INDENTS:right" ) ) ); + gs.addPropertyPt( "fo:text-indent", numberOrNull( tqlayout.getProperty( "INDENTS:first" ) ) ); + gs.addPropertyPt( "fo:margin-top", numberOrNull( tqlayout.getProperty( "OFFSETS:before" ) ) ); + gs.addPropertyPt( "fo:margin-bottom", numberOrNull( tqlayout.getProperty( "OFFSETS:after" ) ) ); #if 0 switch ( lineSpacingType ) { @@ -390,7 +390,7 @@ void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, gs.addProperty( "fo:line-height", "200%" ); break; case KoParagLayout::LS_MULTIPLE: - gs.addProperty( "fo:line-height", QString::number( lineSpacing * 100.0 ) + '%' ); + gs.addProperty( "fo:line-height", TQString::number( lineSpacing * 100.0 ) + '%' ); break; case KoParagLayout::LS_FIXED: gs.addPropertyPt( "fo:line-height", lineSpacing ); @@ -405,7 +405,7 @@ void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, #endif #if 0 - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); KoXmlWriter tabsWriter( &buffer, 4 ); // indent==4: root,autostyle,style,parag-props tabsWriter.startElement( "style:tab-stops" ); @@ -425,9 +425,9 @@ void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, case T_RIGHT: tabsWriter.addAttribute( "style:type", "right" ); break; - case T_DEC_PNT: // "alignment on decimal point" + case T_DEC_PNT: // "tqalignment on decimal point" tabsWriter.addAttribute( "style:type", "char" ); - tabsWriter.addAttribute( "style:char", QString( (*it).alignChar ) ); + tabsWriter.addAttribute( "style:char", TQString( (*it).alignChar ) ); break; case T_INVALID: // keep compiler happy, this can't happen break; @@ -474,7 +474,7 @@ void KWord13OasisGenerator::fillGenStyleWithLayout( const KWord13Layout& layout, } tabsWriter.endElement(); buffer.close(); - QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); gs.addChildElement( "style:tab-stops", elementContents ); #endif @@ -516,14 +516,14 @@ void KWord13OasisGenerator::generateTextFrameset( KoXmlWriter& writer, KWordText return; } - for ( QValueList<KWord13Paragraph>::Iterator it = frameset->m_paragraphGroup.begin(); + for ( TQValueList<KWord13Paragraph>::Iterator it = frameset->m_paragraphGroup.begin(); it != frameset->m_paragraphGroup.end(); ++it) { // Write rawly the paragrapgh (see KoTextParag::saveOasis) writer.startElement( "text:p", false ); // No indent inside! writer.addAttribute( "text:style-name", (*it).m_layout.m_autoStyleName ); #if 1 - const QString paragraphText( (*it).text() ); + const TQString paragraphText( (*it).text() ); int currentPos = 0; // Current position where the next character has to be written for ( KWord13Format* format = (*it).m_formats.first(); format; format = (*it).m_formats.next() ) @@ -553,7 +553,7 @@ void KWord13OasisGenerator::generateTextFrameset( KoXmlWriter& writer, KWordText else if ( format->m_id == 4 ) { // Variable // ### TEMPORARY - const QString text ( ( (KWord13FormatFour*) format ) -> m_text ); + const TQString text ( ( (KWord13FormatFour*) format ) -> m_text ); if ( text.isEmpty() ) writer.addTextNode( "#" ); // Placeholder else @@ -567,7 +567,7 @@ void KWord13OasisGenerator::generateTextFrameset( KoXmlWriter& writer, KWordText currentPos += length; } // We might have still something to write out - const QString tailText( paragraphText.mid( currentPos ) ); + const TQString tailText( paragraphText.mid( currentPos ) ); if ( ! tailText.isEmpty() ) writer.addTextSpan( tailText ); #else @@ -593,8 +593,8 @@ void KWord13OasisGenerator::writeStylesXml( void ) KoXmlWriter *stylesWriter = KoDocument::createOasisXmlWriter( &io, "office:document-styles" ); stylesWriter->startElement( "office:styles" ); - QValueList<KoGenStyles::NamedStyle> styles = m_oasisGenStyles.styles( KoGenStyle::STYLE_USER ); - QValueList<KoGenStyles::NamedStyle>::const_iterator it = styles.begin(); + TQValueList<KoGenStyles::NamedStyle> styles = m_oasisGenStyles.styles( KoGenStyle::STYLE_USER ); + TQValueList<KoGenStyles::NamedStyle>::const_iterator it = styles.begin(); for ( ; it != styles.end() ; ++it ) { (*it).style->writeStyle( stylesWriter, m_oasisGenStyles, "style:style", (*it).name, "style:paragraph-properties" ); } @@ -609,12 +609,12 @@ void KWord13OasisGenerator::writeStylesXml( void ) } #endif - QString pageLayoutName; + TQString pageLayoutName; styles = m_oasisGenStyles.styles( KoGenStyle::STYLE_PAGELAYOUT ); Q_ASSERT( styles.count() == 1 ); it = styles.begin(); for ( ; it != styles.end() ; ++it ) { - (*it).style->writeStyle( stylesWriter, m_oasisGenStyles, "style:page-layout", (*it).name, "style:page-layout-properties", false /*don't close*/ ); + (*it).style->writeStyle( stylesWriter, m_oasisGenStyles, "style:page-tqlayout", (*it).name, "style:page-tqlayout-properties", false /*don't close*/ ); //if ( m_pageLayout.columns > 1 ) TODO add columns element. This is a bit of a hack, // which only works as long as we have only one page master stylesWriter->endElement(); @@ -629,7 +629,7 @@ void KWord13OasisGenerator::writeStylesXml( void ) stylesWriter->startElement( "office:master-styles" ); stylesWriter->startElement( "style:master-page" ); stylesWriter->addAttribute( "style:name", "Standard" ); - stylesWriter->addAttribute( "style:page-layout-name", pageLayoutName ); + stylesWriter->addAttribute( "style:page-tqlayout-name", pageLayoutName ); stylesWriter->endElement(); stylesWriter->endElement(); // office:master-styles @@ -664,8 +664,8 @@ void KWord13OasisGenerator::writeContentXml(void) // Automatic styles writer->startElement( "office:automatic-styles" ); - QValueList<KoGenStyles::NamedStyle> styles = m_oasisGenStyles.styles( KoGenStyle::STYLE_AUTO ); - QValueList<KoGenStyles::NamedStyle>::const_iterator it; + TQValueList<KoGenStyles::NamedStyle> styles = m_oasisGenStyles.styles( KoGenStyle::STYLE_AUTO ); + TQValueList<KoGenStyles::NamedStyle>::const_iterator it; for ( it = styles.begin(); it != styles.end() ; ++it ) { (*it).style->writeStyle( writer, m_oasisGenStyles, "style:style", (*it).name, "style:paragraph-properties" ); } @@ -718,15 +718,15 @@ void KWord13OasisGenerator::writeMetaXml(void) // Tell who we are in case that we have a bug in our filter output! // According to OASIS spec section 3.1.1, it has to follow section 14.43 of RFC 2616 writer->startElement( "meta:generator" ); - QString strVersion; + TQString strVersion; strVersion += "KWord-OneDotThree-Import-Filter/"; - strVersion += QString( "$Revision: 515673 $" ).mid( 10 ).remove( '$' ).stripWhiteSpace(); + strVersion += TQString( "$Revision: 515673 $" ).mid( 10 ).remove( '$' ).stripWhiteSpace(); strVersion += " KOffice/"; strVersion += KOFFICE_VERSION_STRING; writer->addTextSpan( strVersion ); writer->endElement(); - QString str; // Helper string + TQString str; // Helper string str = m_kwordDocument->getDocumentInfo( "about:title" ); if ( !str.isEmpty() ) @@ -754,7 +754,7 @@ void KWord13OasisGenerator::writeMetaXml(void) // ### TODO: what about the other document info of KWord 1.3? - QDateTime dt; + TQDateTime dt; dt = m_kwordDocument->creationDate(); if ( dt.isValid() ) @@ -794,7 +794,7 @@ void KWord13OasisGenerator::writeMetaXml(void) #if 1 zipWriteData( "0" ); // ### TODO #else - zipWriteData( QString::number ( m_pictureNumber ) ); + zipWriteData( TQString::number ( m_pictureNumber ) ); #endif zipWriteData( "\"" ); @@ -802,7 +802,7 @@ void KWord13OasisGenerator::writeMetaXml(void) #if 1 zipWriteData( "0" ); // ### TODO #else - zipWriteData( QString::number ( m_tableNumber ) ); + zipWriteData( TQString::number ( m_tableNumber ) ); #endif zipWriteData( "\"" ); #endif @@ -831,7 +831,7 @@ void KWord13OasisGenerator::writePreviewFile(void) } // Load image - QImage image( m_kwordDocument->m_previewFile->name() ); + TQImage image( m_kwordDocument->m_previewFile->name() ); if ( image.isNull() ) { kdWarning(30520) << "Could not re-read preview from temp file!" << endl; @@ -839,7 +839,7 @@ void KWord13OasisGenerator::writePreviewFile(void) } // We have a 256x256x8 preview and we need a 128x128x32 preview with alpha channel - QImage preview( image.convertDepth( 32, Qt::ColorOnly ).smoothScale( 128, 128 ) ); + TQImage preview( image.convertDepth( 32, Qt::ColorOnly ).smoothScale( 128, 128 ) ); if ( preview.isNull() ) { kdWarning(30520) << "Could not create preview!" << endl; @@ -867,23 +867,23 @@ void KWord13OasisGenerator::writePictures( void ) return; } - for ( QDictIterator<KWord13Picture> it( m_kwordDocument->m_pictureDict ) ; it.current(); ++it ) + for ( TQDictIterator<KWord13Picture> it( m_kwordDocument->m_pictureDict ) ; it.current(); ++it ) { if ( !it.current()->m_valid || !it.current()->m_tempFile ) { kdDebug(30520) << "No data for picture: " << it.currentKey() << endl; continue; } - const QString fileName( it.current()->m_tempFile->name() ); - const QString oasisName( it.current()->getOasisPictureName() ); + const TQString fileName( it.current()->m_tempFile->name() ); + const TQString oasisName( it.current()->getOasisPictureName() ); kdDebug(30520) << "Copying... " << it.currentKey() << endl << " => " << oasisName << endl; - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { kdWarning(30520) << "Cannot open: " << fileName << endl; continue; } - QByteArray array( file.readAll() ); + TQByteArray array( file.readAll() ); if ( array.isNull() ) { kdWarning(30520) << "Null picture for " << fileName << endl; @@ -898,7 +898,7 @@ void KWord13OasisGenerator::writePictures( void ) if ( m_manifestWriter ) { - const QString mimeType ( KMimeType::findByContent( array, 0 )->name() ); + const TQString mimeType ( KMimeType::findByContent( array, 0 )->name() ); if ( mimeType == "application/octet-stream" ) { kdWarning(30520) << "Generic mime type for " << it.currentKey() << endl; @@ -911,7 +911,7 @@ void KWord13OasisGenerator::writePictures( void ) } -bool KWord13OasisGenerator::generate ( const QString& fileName, KWord13Document& kwordDocument ) +bool KWord13OasisGenerator::generate ( const TQString& fileName, KWord13Document& kwordDocument ) { if ( m_kwordDocument && ( (void*) m_kwordDocument ) != ( (void*) &kwordDocument ) ) { @@ -929,10 +929,10 @@ bool KWord13OasisGenerator::generate ( const QString& fileName, KWord13Document& m_store->disallowNameExpansion(); // Prepare manifest file - in memory (inspired by KoDocument::saveNativeFormat) - QByteArray manifestData; - QBuffer manifestBuffer( manifestData ); + TQByteArray manifestData; + TQBuffer manifestBuffer( manifestData ); manifestBuffer.open( IO_WriteOnly ); - m_manifestWriter = new KoXmlWriter( &manifestBuffer ); + m_manifestWriter = new KoXmlWriter( TQT_TQIODEVICE(&manifestBuffer) ); m_manifestWriter->startDocument( "manifest:manifest" ); m_manifestWriter->startElement( "manifest:manifest" ); m_manifestWriter->addAttribute( "xmlns:manifest", "urn:oasis:names:tc:openoffice:xmlns:manifest:1.0" ); diff --git a/filters/kword/kword1.3/import/kword13oasisgenerator.h b/filters/kword/kword1.3/import/kword13oasisgenerator.h index 3c9ae245..39bc232a 100644 --- a/filters/kword/kword1.3/import/kword13oasisgenerator.h +++ b/filters/kword/kword1.3/import/kword13oasisgenerator.h @@ -22,8 +22,8 @@ #define STRICT_OOWRITER_VERSION_1 -class QString; -class QTextStream; +class TQString; +class TQTextStream; class KZip; class KoStore; class KoGenStyle; @@ -39,7 +39,7 @@ public: ~KWord13OasisGenerator( void ); bool prepare( KWord13Document& kwordDocument ); - bool generate( const QString& fileName, KWord13Document& kwordDocument ); + bool generate( const TQString& fileName, KWord13Document& kwordDocument ); protected: // Generating phase /// @param main Is it the main frameset? void generateTextFrameset( KoXmlWriter& writer, KWordTextFrameset* frameset, bool main ); @@ -49,21 +49,21 @@ protected: // Generating phase void writePreviewFile(void); void writePictures( void ); protected: // Preparing phase - /// Preparing page layout + /// Preparing page tqlayout void preparePageLayout( void ); void prepareTextFrameset( KWordTextFrameset* frameset ); /// Also sets the name of the automatical style - void declareLayout( KWord13Layout& layout ); + void declareLayout( KWord13Layout& tqlayout ); /// Also sets the name of the automatical style - void declareStyle( KWord13Layout& layout ); - double numberOrNull( const QString& str ) const; - double positiveNumberOrNull( const QString& str ) const; + void declareStyle( KWord13Layout& tqlayout ); + double numberOrNull( const TQString& str ) const; + double positiveNumberOrNull( const TQString& str ) const; void fillGenStyleWithFormatOne( const KWord13FormatOneData& one, KoGenStyle& gs, const bool style ) const; - void fillGenStyleWithLayout( const KWord13Layout& layout, KoGenStyle& gs, const bool style ) const; + void fillGenStyleWithLayout( const KWord13Layout& tqlayout, KoGenStyle& gs, const bool style ) const; protected: KWord13Document* m_kwordDocument; KoStore* m_store; - QString m_contentAutomaticStyles; ///< Automatic styles for content.xml (in OO format) + TQString m_contentAutomaticStyles; ///< Automatic styles for content.xml (in OO format) KoGenStyles m_oasisGenStyles; ///< OASIS styles KoXmlWriter* m_manifestWriter; ///< Manifest file writer }; diff --git a/filters/kword/kword1.3/import/kword13paragraph.cpp b/filters/kword/kword1.3/import/kword13paragraph.cpp index d22372b3..f26bee46 100644 --- a/filters/kword/kword1.3/import/kword13paragraph.cpp +++ b/filters/kword/kword1.3/import/kword13paragraph.cpp @@ -10,7 +10,7 @@ KWord13Paragraph::~KWord13Paragraph( void ) { } -void KWord13Paragraph::xmldump( QTextStream& iostream ) +void KWord13Paragraph::xmldump( TQTextStream& iostream ) { iostream << " <paragraph>\n"; iostream << " <text>" << m_text << "</text>\n"; @@ -18,27 +18,27 @@ void KWord13Paragraph::xmldump( QTextStream& iostream ) iostream << " </paragraph>\n"; } -void KWord13Paragraph::setText( const QString& str) +void KWord13Paragraph::setText( const TQString& str) { m_text = str; } -void KWord13Paragraph::appendText( const QString& str) +void KWord13Paragraph::appendText( const TQString& str) { m_text += str; } -QString KWord13Paragraph::text( void ) const +TQString KWord13Paragraph::text( void ) const { return m_text; } -void KWord13ParagraphGroup::xmldump( QTextStream& iostream ) +void KWord13ParagraphGroup::xmldump( TQTextStream& iostream ) { iostream << " <paragraphgroup>\n"; - for( QValueList <KWord13Paragraph>::Iterator it = begin(); + for( TQValueList <KWord13Paragraph>::Iterator it = begin(); it != end(); ++it ) { (*it).xmldump( iostream ); diff --git a/filters/kword/kword1.3/import/kword13paragraph.h b/filters/kword/kword1.3/import/kword13paragraph.h index 269e4821..0855aaec 100644 --- a/filters/kword/kword1.3/import/kword13paragraph.h +++ b/filters/kword/kword1.3/import/kword13paragraph.h @@ -2,9 +2,9 @@ #ifndef _FILTER_KWORD_1_3__KWORDPARAGRAPH_H #define _FILTER_KWORD_1_3__KWORDPARAGRAPH_H -#include <qstring.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> #include "kword13layout.h" @@ -19,27 +19,27 @@ public: KWord13Paragraph( void ); ~KWord13Paragraph( void ); public: - void xmldump( QTextStream& iostream ); - void setText( const QString& str); - void appendText( const QString& str); - QString text( void ) const; + void xmldump( TQTextStream& iostream ); + void setText( const TQString& str); + void appendText( const TQString& str); + TQString text( void ) const; public: /// \<LAYOUT\> KWord13Layout m_layout; /// \<FORMATS\> - QPtrList<KWord13Format> m_formats; + TQPtrList<KWord13Format> m_formats; private: - QString m_text; ///< Text + TQString m_text; ///< Text }; /** * Group of paragraphs * (Mostly all paragraphs of a text frameset) */ -class KWord13ParagraphGroup : public QValueList <KWord13Paragraph> +class KWord13ParagraphGroup : public TQValueList <KWord13Paragraph> { public: - void xmldump( QTextStream& iostream ); + void xmldump( TQTextStream& iostream ); }; #endif // _FILTER_KWORD_1_3__KWORDPARAGRAPH_H diff --git a/filters/kword/kword1.3/import/kword13parser.cpp b/filters/kword/kword1.3/import/kword13parser.cpp index 61dd9d00..c6dce3d5 100644 --- a/filters/kword/kword1.3/import/kword13parser.cpp +++ b/filters/kword/kword1.3/import/kword13parser.cpp @@ -53,7 +53,7 @@ KWord13Parser::~KWord13Parser( void ) delete m_currentFormat; } -bool KWord13Parser::startElementFormatOneProperty( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem) +bool KWord13Parser::startElementFormatOneProperty( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem) { // ### TODO: check status if ( stackItem->elementType == KWord13TypeLayoutFormatOne ) @@ -65,7 +65,7 @@ bool KWord13Parser::startElementFormatOneProperty( const QString& name, const QX } for (int i = 0; i < attributes.count(); ++i ) { - QString attrName ( name ); + TQString attrName ( name ); attrName += ':'; attrName += attributes.qName( i ); m_currentLayout->m_format.m_properties[ attrName ] = attributes.value( i ); @@ -91,7 +91,7 @@ bool KWord13Parser::startElementFormatOneProperty( const QString& name, const QX for (int i = 0; i < attributes.count(); ++i ) { - QString attrName ( name ); + TQString attrName ( name ); attrName += ':'; attrName += attributes.qName( i ); data->m_properties[ attrName ] = attributes.value( i ); @@ -106,12 +106,12 @@ bool KWord13Parser::startElementFormatOneProperty( const QString& name, const QX } else { - kdError(30520) << "Wrong parents for FORMAT property: " << name << endl; + kdError(30520) << "Wrong tqparents for FORMAT property: " << name << endl; return false; } } -bool KWord13Parser::startElementLayoutProperty( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem) +bool KWord13Parser::startElementLayoutProperty( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem) { // ### TODO: check status if ( stackItem->elementType == KWord13TypeIgnore ) @@ -122,7 +122,7 @@ bool KWord13Parser::startElementLayoutProperty( const QString& name, const QXmlA { for (int i = 0; i < attributes.count(); ++i ) { - QString attrName ( name ); + TQString attrName ( name ); attrName += ':'; attrName += attributes.qName( i ); m_currentLayout->m_layoutProperties[ attrName ] = attributes.value( i ); @@ -133,12 +133,12 @@ bool KWord13Parser::startElementLayoutProperty( const QString& name, const QXmlA } else { - kdError(30520) << "No current layout for storing property: " << name << endl; + kdError(30520) << "No current tqlayout for storing property: " << name << endl; return false; } } -bool KWord13Parser::startElementName( const QString&, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementName( const TQString&, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { if ( stackItem->elementType != KWord13TypeLayout ) { @@ -156,9 +156,9 @@ bool KWord13Parser::startElementName( const QString&, const QXmlAttributes& attr return true; } -bool KWord13Parser::startElementFormat( const QString&, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementFormat( const TQString&, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { - // ### TODO: check parent? + // ### TODO: check tqparent? if ( stackItem->elementType == KWord13TypeIgnore ) { return true; @@ -166,7 +166,7 @@ bool KWord13Parser::startElementFormat( const QString&, const QXmlAttributes& at else if ( stackItem->elementType == KWord13TypeLayout ) { stackItem->elementType = KWord13TypeLayoutFormatOne; - return true; // Everything is done directly on the layout + return true; // Everything is done directly on the tqlayout } else if ( stackItem->elementType != KWord13TypeFormatsPlural ) { @@ -228,9 +228,9 @@ bool KWord13Parser::startElementFormat( const QString&, const QXmlAttributes& at return true; } -bool KWord13Parser::startElementLayout( const QString&, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementLayout( const TQString&, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { - // ### TODO: check parent? + // ### TODO: check tqparent? if ( stackItem->elementType == KWord13TypeIgnore ) { return true; @@ -247,7 +247,7 @@ bool KWord13Parser::startElementLayout( const QString&, const QXmlAttributes& at if ( m_currentLayout ) { // Delete an eventually already existing paragraph (should not happen) - kdWarning(30520) << "Current layout already defined!" << endl; + kdWarning(30520) << "Current tqlayout already defined!" << endl; delete m_currentLayout; } @@ -257,7 +257,7 @@ bool KWord13Parser::startElementLayout( const QString&, const QXmlAttributes& at return true; } -bool KWord13Parser::startElementParagraph( const QString&, const QXmlAttributes&, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementParagraph( const TQString&, const TQXmlAttributes&, KWord13StackItem *stackItem ) { if ( stackItem->elementType == KWord13TypeUnknownFrameset ) { @@ -279,7 +279,7 @@ bool KWord13Parser::startElementParagraph( const QString&, const QXmlAttributes& return true; } -bool KWord13Parser::startElementFrame( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementFrame( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { if ( stackItem->elementType == KWord13TypeFrameset || stackItem->elementType == KWord13TypePictureFrameset ) { @@ -289,9 +289,9 @@ bool KWord13Parser::startElementFrame( const QString& name, const QXmlAttributes const int num = ++stackItem->m_currentFrameset->m_numFrames; for (int i = 0; i < attributes.count(); ++i ) { - QString attrName ( name ); + TQString attrName ( name ); attrName += ':'; - attrName += QString::number( num ); + attrName += TQString::number( num ); attrName += ':'; attrName += attributes.qName( i ); stackItem->m_currentFrameset->m_frameData[ attrName ] = attributes.value( i ); @@ -313,10 +313,10 @@ bool KWord13Parser::startElementFrame( const QString& name, const QXmlAttributes return true; } -bool KWord13Parser::startElementFrameset( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementFrameset( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { - const QString frameTypeStr( attributes.value( "frameType" ) ); - const QString frameInfoStr( attributes.value( "frameInfo" ) ); + const TQString frameTypeStr( attributes.value( "frameType" ) ); + const TQString frameInfoStr( attributes.value( "frameInfo" ) ); if ( frameTypeStr.isEmpty() || frameInfoStr.isEmpty() ) { @@ -390,7 +390,7 @@ bool KWord13Parser::startElementFrameset( const QString& name, const QXmlAttribu } -bool KWord13Parser::startElementDocumentAttributes( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem, +bool KWord13Parser::startElementDocumentAttributes( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem, const KWord13StackItemType& allowedParentType, const KWord13StackItemType& newType ) { if ( parserStack.current()->elementType == allowedParentType ) @@ -398,7 +398,7 @@ bool KWord13Parser::startElementDocumentAttributes( const QString& name, const Q stackItem->elementType = newType; for (int i = 0; i < attributes.count(); ++i ) { - QString attrName ( name ); + TQString attrName ( name ); attrName += ':'; attrName += attributes.qName( i ); m_kwordDocument->m_documentProperties[ attrName ] = attributes.value( i ); @@ -408,14 +408,14 @@ bool KWord13Parser::startElementDocumentAttributes( const QString& name, const Q } else { - kdError(30520) << "Wrong parent!" << endl; + kdError(30520) << "Wrong tqparent!" << endl; return false; } } -bool KWord13Parser::startElementKey( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementKey( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { - const QString key( calculatePictureKey( attributes.value( "filename" ), + const TQString key( calculatePictureKey( attributes.value( "filename" ), attributes.value( "year" ), attributes.value( "month" ), attributes.value( "day" ), attributes.value( "hour" ), attributes.value( "minute" ), attributes.value( "second" ), attributes.value( "msec" ) ) ); @@ -450,11 +450,11 @@ bool KWord13Parser::startElementKey( const QString& name, const QXmlAttributes& return true; } -bool KWord13Parser::startElementAnchor( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ) +bool KWord13Parser::startElementAnchor( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ) { if ( stackItem->elementType == KWord13TypeAnchor ) { - const QString anchorType ( attributes.value( "type" ) ); + const TQString anchorType ( attributes.value( "type" ) ); if ( anchorType == "grpMgr" ) kdWarning(30520) << "Anchor of type grpMgr! Not tested!" << endl; // ### TODO else if ( anchorType != "frameset" ) @@ -462,7 +462,7 @@ bool KWord13Parser::startElementAnchor( const QString& name, const QXmlAttribute kdError(30520) << "Unsupported anchor type: " << anchorType << endl; return false; } - const QString frameset ( attributes.value( "instance" ) ); + const TQString frameset ( attributes.value( "instance" ) ); if ( frameset.isEmpty() ) { kdError(30520) << "Anchor to an empty frameset name! Aborting!" << endl; @@ -474,7 +474,7 @@ bool KWord13Parser::startElementAnchor( const QString& name, const QXmlAttribute six->m_anchorName = frameset; } // add frameset name to the list of anchored framesets - if ( m_kwordDocument->m_anchoredFramesetNames.find( frameset ) == m_kwordDocument->m_anchoredFramesetNames.end() ) + if ( m_kwordDocument->m_anchoredFramesetNames.tqfind( frameset ) == m_kwordDocument->m_anchoredFramesetNames.end() ) { m_kwordDocument->m_anchoredFramesetNames.append( frameset ); } @@ -488,7 +488,7 @@ bool KWord13Parser::startElementAnchor( const QString& name, const QXmlAttribute } -bool KWord13Parser::startElement( const QString&, const QString&, const QString& name, const QXmlAttributes& attributes ) +bool KWord13Parser::startElement( const TQString&, const TQString&, const TQString& name, const TQXmlAttributes& attributes ) { kdDebug(30520) << indent << "<" << name << ">" << endl; // DEBUG indent += "*"; //DEBUG @@ -532,7 +532,7 @@ bool KWord13Parser::startElement( const QString&, const QString&, const QString& if ( stackItem->elementType == KWord13TypeParagraph && m_currentParagraph ) { stackItem->elementType = KWord13TypeText; - m_currentParagraph->setText( QString::null ); + m_currentParagraph->setText( TQString() ); } else { @@ -625,13 +625,13 @@ bool KWord13Parser::startElement( const QString&, const QString&, const QString& } else if ( name == "FRAMESTYLE" ) { - // ### TODO, but some of the <STYLE> children are also children of <FRAMESTYLE>, so we have to set it to "ignore" + // ### TODO, but some of the <STYLE> tqchildren are also tqchildren of <FRAMESTYLE>, so we have to set it to "ignore" stackItem->elementType = KWord13TypeIgnore; success = true; } else if ( name == "PICTURES" || name == "PIXMAPS" || name == "CLIPARTS" ) { - // We just need a separate "type" for the <KEY> children + // We just need a separate "type" for the <KEY> tqchildren stackItem->elementType = KWord13TypePicturesPlural; success = true; } @@ -653,7 +653,7 @@ bool KWord13Parser::startElement( const QString&, const QString&, const QString& return success; } -bool KWord13Parser :: endElement( const QString&, const QString& , const QString& name) +bool KWord13Parser :: endElement( const TQString&, const TQString& , const TQString& name) { indent.remove( 0, 1 ); // DEBUG //kdDebug(30520) << indent << "</" << name << ">" << endl; // DEBUG @@ -756,7 +756,7 @@ bool KWord13Parser :: endElement( const QString&, const QString& , const QString return success; } -bool KWord13Parser :: characters ( const QString & ch ) +bool KWord13Parser :: characters ( const TQString & ch ) { #if 0 // DEBUG start @@ -795,14 +795,14 @@ bool KWord13Parser :: characters ( const QString & ch ) const uint length = ch.length(); for ( uint i = 0; i < length; ++i ) { - const ushort uni = ch.at(i).unicode(); + const ushort uni = ch.tqat(i).tqunicode(); if ( uni >= 32 ) continue; // Normal character else if ( uni == 9 || uni == 10 || uni == 13) continue; // Tabulator, Line Feed, Carriage Return else if ( uni == 1 ) { - // Old KWord documents have a QChar(1) as anchor character + // Old KWord documents have a TQChar(1) as anchor character // So replace it with the anchor character of recent KWord versions ch[i]='#'; } @@ -840,14 +840,14 @@ bool KWord13Parser :: characters ( const QString & ch ) return success; } -bool KWord13Parser::warning(const QXmlParseException& exception) +bool KWord13Parser::warning(const TQXmlParseException& exception) { kdWarning(30520) << "XML parsing warning: line " << exception.lineNumber() << " col " << exception.columnNumber() << " message: " << exception.message() << endl; return true; } -bool KWord13Parser::error(const QXmlParseException& exception) +bool KWord13Parser::error(const TQXmlParseException& exception) { // A XML error is recoverable, so it is only a KDE warning kdWarning(30520) << "XML parsing error: line " << exception.lineNumber() @@ -855,7 +855,7 @@ bool KWord13Parser::error(const QXmlParseException& exception) return true; } -bool KWord13Parser::fatalError (const QXmlParseException& exception) +bool KWord13Parser::fatalError (const TQXmlParseException& exception) { kdError(30520) << "XML parsing fatal error: line " << exception.lineNumber() << " col " << exception.columnNumber() << " message: " << exception.message() << endl; @@ -863,10 +863,10 @@ bool KWord13Parser::fatalError (const QXmlParseException& exception) return false; // Stop parsing now, we do not need further errors. } -QString KWord13Parser::calculatePictureKey( const QString& filename, - const QString& year, const QString& month, const QString& day, - const QString& hour, const QString& minute, const QString& second, - const QString& microsecond ) const +TQString KWord13Parser::calculatePictureKey( const TQString& filename, + const TQString& year, const TQString& month, const TQString& day, + const TQString& hour, const TQString& minute, const TQString& second, + const TQString& microsecond ) const { bool ok; bool globalOk = true; @@ -902,27 +902,27 @@ QString KWord13Parser::calculatePictureKey( const QString& filename, if ( globalOk ) { // No error until then, so check if the date/time is valid at all - globalOk = globalOk && QDate::isValid( iYear, iMonth, iDay ); - globalOk = globalOk && QTime::isValid( iHour, iMinute, iSecond, iMicrosecond ); + globalOk = globalOk && TQDate::isValid( iYear, iMonth, iDay ); + globalOk = globalOk && TQTime::isValid( iHour, iMinute, iSecond, iMicrosecond ); } - QDateTime dt; + TQDateTime dt; if ( globalOk ) { // The date/time seems correct - dt = QDateTime( QDate( iYear, iMonth, iDay ), QTime( iHour, iMinute, iSecond, iMicrosecond ) ); + dt = TQDateTime( TQDate( iYear, iMonth, iDay ), TQTime( iHour, iMinute, iSecond, iMicrosecond ) ); } else { // *NIX epoch (We do not really care if it is UTC or local time) - dt = QDateTime( QDate( 1970, 1, 1 ), QTime( 0, 0, 0, 0 ) ); + dt = TQDateTime( TQDate( 1970, 1, 1 ), TQTime( 0, 0, 0, 0 ) ); } // We put the date/time first, as if the date is useful, it will have faster a difference than a path // where the common pth might be very long. // Output the date/time as compact as possible - QString result ( dt.toString( "yyyyMMddhhmmsszzz" ) ); + TQString result ( dt.toString( "yyyyMMddhhmmsszzz" ) ); result += '@'; // A separator result += filename; return result; diff --git a/filters/kword/kword1.3/import/kword13parser.h b/filters/kword/kword1.3/import/kword13parser.h index 87f3ccad..7dc81d42 100644 --- a/filters/kword/kword1.3/import/kword13parser.h +++ b/filters/kword/kword1.3/import/kword13parser.h @@ -21,8 +21,8 @@ #ifndef KWORD_1_3_PARSER_H #define KWORD_1_3_PARSER_H -#include <qxml.h> -#include <qptrstack.h> +#include <tqxml.h> +#include <tqptrstack.h> class KWord13Paragraph; class KWord13Document; @@ -64,72 +64,72 @@ public: KWord13StackItem(); ~KWord13StackItem(); public: - QString itemName; ///< Name of the tag (only for error purposes) + TQString itemName; ///< Name of the tag (only for error purposes) KWord13StackItemType elementType; KWord13Frameset* m_currentFrameset; }; -class KWord13StackItemStack : public QPtrStack<KWord13StackItem> +class KWord13StackItemStack : public TQPtrStack<KWord13StackItem> { public: KWord13StackItemStack(void) { } ~KWord13StackItemStack(void) { } }; -class KWord13Parser : public QXmlDefaultHandler +class KWord13Parser : public TQXmlDefaultHandler { public: KWord13Parser( KWord13Document* kwordDocument ); virtual ~KWord13Parser( void ); -protected: //QXml +protected: //TQXml /// Process opening tag - virtual bool startElement( const QString&, const QString&, const QString& name, const QXmlAttributes& attributes); + virtual bool startElement( const TQString&, const TQString&, const TQString& name, const TQXmlAttributes& attributes); /// Process closing tag - virtual bool endElement( const QString&, const QString& , const QString& qName); + virtual bool endElement( const TQString&, const TQString& , const TQString& qName); /// Process element's characters (between opening and closing tags) - virtual bool characters ( const QString & ch ); - virtual bool warning(const QXmlParseException& exception); - virtual bool error(const QXmlParseException& exception); - virtual bool fatalError(const QXmlParseException& exception); + virtual bool characters ( const TQString & ch ); + virtual bool warning(const TQXmlParseException& exception); + virtual bool error(const TQXmlParseException& exception); + virtual bool fatalError(const TQXmlParseException& exception); protected: - /// Process children of \<FORMAT id="1"\> - bool startElementFormatOneProperty( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem); - /// Process children of \<LAYOUT\> (with exceptions) - bool startElementLayoutProperty( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem); + /// Process tqchildren of \<FORMAT id="1"\> + bool startElementFormatOneProperty( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem); + /// Process tqchildren of \<LAYOUT\> (with exceptions) + bool startElementLayoutProperty( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem); /// Process \<NAME\> - bool startElementName( const QString&, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); + bool startElementName( const TQString&, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); /// Process \<FORMAT\> - bool startElementFormat( const QString&, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); + bool startElementFormat( const TQString&, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); /// Process \<LAYOUT\> and \<STYLE\> - bool startElementLayout( const QString&, const QXmlAttributes&, KWord13StackItem *stackItem ); + bool startElementLayout( const TQString&, const TQXmlAttributes&, KWord13StackItem *stackItem ); /// Process \<PARAGRAPH\> - bool startElementParagraph( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); + bool startElementParagraph( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); /// Process \<FRAME\> - bool startElementFrame( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); + bool startElementFrame( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); /// Process \<FRAMESET\> - bool startElementFrameset( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); - /// Process opening tag of some elements that are children of \<DOC\> and which only define document properties - bool startElementDocumentAttributes( const QString& name, const QXmlAttributes& attributes, + bool startElementFrameset( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); + /// Process opening tag of some elements that are tqchildren of \<DOC\> and which only define document properties + bool startElementDocumentAttributes( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem, const KWord13StackItemType& allowedParentType, const KWord13StackItemType& newType ); /// Process \<KEY\> - bool startElementKey( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); + bool startElementKey( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); /// Process \<ANCHOR\> - bool startElementAnchor( const QString& name, const QXmlAttributes& attributes, KWord13StackItem *stackItem ); + bool startElementAnchor( const TQString& name, const TQXmlAttributes& attributes, KWord13StackItem *stackItem ); /** * Get a picture key out of the individual \<KEY\> attributes * * \note The generated key is different that one of the class KoPictureKey */ - QString calculatePictureKey( const QString& filename, - const QString& year, const QString& month, const QString& day, - const QString& hour, const QString& minute, const QString& second, - const QString& microsecond ) const; + TQString calculatePictureKey( const TQString& filename, + const TQString& year, const TQString& month, const TQString& day, + const TQString& hour, const TQString& minute, const TQString& second, + const TQString& microsecond ) const; protected: - QString indent; //DEBUG + TQString indent; //DEBUG KWord13StackItemStack parserStack; KWord13Document* m_kwordDocument; KWord13Paragraph* m_currentParagraph; ///< Current paragraph - KWord13Layout* m_currentLayout; ///< Current layout (or style) + KWord13Layout* m_currentLayout; ///< Current tqlayout (or style) KWord13Format* m_currentFormat; ///< Current format }; diff --git a/filters/kword/kword1.3/import/kword13picture.cpp b/filters/kword/kword1.3/import/kword13picture.cpp index 6067d8b5..13437d6c 100644 --- a/filters/kword/kword1.3/import/kword13picture.cpp +++ b/filters/kword/kword1.3/import/kword13picture.cpp @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qfile.h> +#include <tqfile.h> #include <kdebug.h> #include <ktempfile.h> @@ -42,7 +42,7 @@ bool KWord13Picture::loadPicture( KoStore* store ) { kdDebug(30520) << "Loading picture: " << m_storeName << endl; - m_tempFile = new KTempFile( QString::null, ".bin" ); + m_tempFile = new KTempFile( TQString(), ".bin" ); m_tempFile->setAutoDelete( true ); if ( ! store->extractFile( m_storeName, m_tempFile->name() ) ) @@ -59,26 +59,26 @@ bool KWord13Picture::loadPicture( KoStore* store ) return m_valid; } -QString KWord13Picture::getOasisPictureName( void ) const +TQString KWord13Picture::getOasisPictureName( void ) const { if ( ! m_valid || ! m_tempFile ) - return QString::null; + return TQString(); // We need a 32 digit hex value of the picture number // Please note: it is an exact 32 digit value, truncated if the value is more than 512 bits wide. :-) - QString number; + TQString number; number.fill('0',32); // ### TODO: have a real counter instead of using the pointers - number += QString::number( (long long)( (void*) m_tempFile ) , 16 ); // in hex + number += TQString::number( (long long)( (void*) m_tempFile ) , 16 ); // in hex - QString strExtension( m_storeName.lower() ); - const int result = m_storeName.findRev( '.' ); + TQString strExtension( m_storeName.lower() ); + const int result = m_storeName.tqfindRev( '.' ); if ( result >= 0 ) { strExtension = m_storeName.mid( result ); } - QString ooName( "Pictures/" ); + TQString ooName( "Pictures/" ); ooName += number.right( 32 ); ooName += strExtension; diff --git a/filters/kword/kword1.3/import/kword13picture.h b/filters/kword/kword1.3/import/kword13picture.h index b8a18a0c..e6a1951f 100644 --- a/filters/kword/kword1.3/import/kword13picture.h +++ b/filters/kword/kword1.3/import/kword13picture.h @@ -24,7 +24,7 @@ class KTempFile; class KoStore; -#include <qstring.h> +#include <tqstring.h> class KWord13Picture { @@ -33,9 +33,9 @@ public: ~KWord13Picture( void ); public: bool loadPicture( KoStore* store ); - QString getOasisPictureName( void ) const; + TQString getOasisPictureName( void ) const; public: - QString m_storeName; ///< Name of the file in store + TQString m_storeName; ///< Name of the file in store KTempFile* m_tempFile; ///< Temporary file bool m_valid; ///< Is the picture valid? }; diff --git a/filters/kword/kword1.3/import/kword13postparsing.cpp b/filters/kword/kword1.3/import/kword13postparsing.cpp index a3dcd162..ff48b794 100644 --- a/filters/kword/kword1.3/import/kword13postparsing.cpp +++ b/filters/kword/kword1.3/import/kword13postparsing.cpp @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qdict.h> +#include <tqstring.h> +#include <tqdict.h> #include <kdebug.h> @@ -42,7 +42,7 @@ bool KWord13PostParsing::postParsePictures( KoStore* store ) if ( ! m_kwordDocument ) return false; - for ( QDictIterator<KWord13Picture> it( m_kwordDocument->m_pictureDict ) ; it.current(); ++it ) + for ( TQDictIterator<KWord13Picture> it( m_kwordDocument->m_pictureDict ) ; it.current(); ++it ) { kdDebug(30520) << "Loading... " << it.currentKey() << endl; if ( ! it.current()->loadPicture( store ) ) diff --git a/filters/kword/kword1.3/import/kword13utils.cpp b/filters/kword/kword1.3/import/kword13utils.cpp index 0ac9272e..d870f484 100644 --- a/filters/kword/kword1.3/import/kword13utils.cpp +++ b/filters/kword/kword1.3/import/kword13utils.cpp @@ -1,14 +1,14 @@ #include "kword13utils.h" -QString EscapeXmlDump( const QString& strIn ) +TQString EscapeXmlDump( const TQString& strIn ) { - QString strReturn; - QChar ch; + TQString strReturn; + TQChar ch; for (uint i=0; i<strIn.length(); i++) { ch=strIn[i]; - switch (ch.unicode()) + switch (ch.tqunicode()) { case 38: // & { diff --git a/filters/kword/kword1.3/import/kword13utils.h b/filters/kword/kword1.3/import/kword13utils.h index 41365c6d..ef9eb94e 100644 --- a/filters/kword/kword1.3/import/kword13utils.h +++ b/filters/kword/kword1.3/import/kword13utils.h @@ -1,4 +1,4 @@ -#include <qstring.h> +#include <tqstring.h> -QString EscapeXmlDump( const QString& strIn ); +TQString EscapeXmlDump( const TQString& strIn ); diff --git a/filters/kword/latex/export/anchor.cc b/filters/kword/latex/export/anchor.cc index a66c8cd0..99915384 100644 --- a/filters/kword/latex/export/anchor.cc +++ b/filters/kword/latex/export/anchor.cc @@ -35,7 +35,7 @@ Anchor::~Anchor() kdDebug(30522) << "Destruction of an anchor." << endl; } -void Anchor::analyse(const QDomNode balise) +void Anchor::analyse(const TQDomNode balise) { /* MARKUPS FORMAT id="1" pos="0" len="17">...</FORMAT> */ Format::analyse(balise); @@ -51,7 +51,7 @@ void Anchor::analyse(const QDomNode balise) kdDebug(30522) << "END OF AN ANCHOR" << endl; } -void Anchor::generate(QTextStream &out) +void Anchor::generate(TQTextStream &out) { Element *elt = 0; diff --git a/filters/kword/latex/export/anchor.h b/filters/kword/latex/export/anchor.h index 9adc4641..4e666669 100644 --- a/filters/kword/latex/export/anchor.h +++ b/filters/kword/latex/export/anchor.h @@ -25,7 +25,7 @@ #ifndef __KWORD_LATEX_ANCHOR_H__ #define __KWORD_LATEX_ANCHOR_H__ -#include <qstring.h> +#include <tqstring.h> #include "format.h" /***********************************************************************/ @@ -38,8 +38,8 @@ */ class Anchor: public Format { - QString _type; - QString _instance; + TQString _type; + TQString _instance; public: @@ -50,7 +50,7 @@ class Anchor: public Format /** * Creates a new instances of Anchor. * - * @param para the parent class. + * @param para the tqparent class. */ Anchor(Para* para = 0); //Anchor(TextZone); @@ -65,22 +65,22 @@ class Anchor: public Format /** * Accessors */ - QString getType () const { return _type; } - QString getInstance() const { return _instance; } + TQString getType () const { return _type; } + TQString getInstance() const { return _instance; } /** * Modifiers */ - void setType (QString type) { _type = type; } - void setInstance(QString inst) { _instance = inst; } + void setType (TQString type) { _type = type; } + void setInstance(TQString inst) { _instance = inst; } /** * Helpfull functions */ - void analyse (const QDomNode); + void analyse (const TQDomNode); - void generate(QTextStream&); + void generate(TQTextStream&); //private: }; diff --git a/filters/kword/latex/export/border.h b/filters/kword/latex/export/border.h index 7f966819..b63065ca 100644 --- a/filters/kword/latex/export/border.h +++ b/filters/kword/latex/export/border.h @@ -178,7 +178,7 @@ class Border /** * Write a border frame */ - void generate(QTextStream&); + void generate(TQTextStream&); private: }; diff --git a/filters/kword/latex/export/config.cc b/filters/kword/latex/export/config.cc index a79296ca..8460aae4 100644 --- a/filters/kword/latex/export/config.cc +++ b/filters/kword/latex/export/config.cc @@ -76,7 +76,7 @@ void Config::desindent() } } -void Config::writeIndent(QTextStream& out) +void Config::writeIndent(TQTextStream& out) { for(int index = 0; index < _tabulation; index++) { diff --git a/filters/kword/latex/export/config.h b/filters/kword/latex/export/config.h index 56580bda..7a81b168 100644 --- a/filters/kword/latex/export/config.h +++ b/filters/kword/latex/export/config.h @@ -22,8 +22,8 @@ #ifndef __LATEX_CONFIG_H__ #define __LATEX_CONFIG_H__ -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqtextstream.h> +#include <tqstringlist.h> /***********************************************************************/ /* Class: Config */ @@ -39,20 +39,20 @@ class Config /* Document tab */ bool _useLatexStyle; bool _isEmbeded; - QString _class; - QString _quality; + TQString _class; + TQString _quality; unsigned int _defaultFontSize; /* Pictures tab */ bool _convertPictures; - QString _picturesDir; + TQString _picturesDir; /* Language tab */ //bool _useUnicode; //bool _useLatin1; - QString _encoding; - QStringList _languagesList; - QString _defaultLanguage; + TQString _encoding; + TQStringList _languagesList; + TQString _defaultLanguage; int _tabSize; /* Size of the para indentation. */ int _tabulation; /* Total size of the indentation. */ @@ -77,18 +77,18 @@ class Config */ bool isKwordStyleUsed() const { return (_useLatexStyle == false); } bool isEmbeded() const { return _isEmbeded; } - QString getClass() const { return _class; } - QString getQuality() const { return _quality; } + TQString getClass() const { return _class; } + TQString getQuality() const { return _quality; } unsigned int getDefaultFontSize() const { return _defaultFontSize; } bool convertPictures() const { return _convertPictures; } - QString getPicturesDir() const { return _picturesDir; } + TQString getPicturesDir() const { return _picturesDir; } - bool mustUseUnicode() const { return (_encoding == "unicode"); } - bool mustUseLatin1() const { return (_encoding != "unicode"); } - QString getEncoding() const { return _encoding; } - QStringList getLanguagesList() const { return _languagesList; } - QString getDefaultLanguage() const { return _defaultLanguage; } + bool mustUseUnicode() const { return (_encoding == "tqunicode"); } + bool mustUseLatin1() const { return (_encoding != "tqunicode"); } + TQString getEncoding() const { return _encoding; } + TQStringList getLanguagesList() const { return _languagesList; } + TQString getDefaultLanguage() const { return _defaultLanguage; } int getTabSize() const { return _tabSize; } int getIndentation() const { return _tabulation; } @@ -110,16 +110,16 @@ class Config void setEmbeded(bool emb) { _isEmbeded = emb; } /** The class can be article, book, letter, report or slides. It's the type of the * latex document. */ - void setClass(const QString &lclass) { _class = lclass; } - void setQuality(const QString &quality) { _quality = quality; } + void setClass(const TQString &lclass) { _class = lclass; } + void setQuality(const TQString &quality) { _quality = quality; } void setDefaultFontSize(int size) { _defaultFontSize = size; } void convertPictures(bool state) { _convertPictures = state; } - void setPicturesDir(const QString &dir) { _picturesDir = dir; } + void setPicturesDir(const TQString &dir) { _picturesDir = dir; } - void setEncoding(const QString &enc) { _encoding = enc; } - void addLanguage(const QString &l) { _languagesList.append(l); } - void setDefaultLanguage(const QString &l) { _defaultLanguage = l; } + void setEncoding(const TQString &enc) { _encoding = enc; } + void addLanguage(const TQString &l) { _languagesList.append(l); } + void setDefaultLanguage(const TQString &l) { _defaultLanguage = l; } void setIndentation(int indent) { _tabulation = indent; } @@ -127,7 +127,7 @@ class Config void indent(); void desindent(); - void writeIndent(QTextStream& out); + void writeIndent(TQTextStream& out); protected: /** diff --git a/filters/kword/latex/export/document.cc b/filters/kword/latex/export/document.cc index 5d2e1c91..410e7b7f 100644 --- a/filters/kword/latex/export/document.cc +++ b/filters/kword/latex/export/document.cc @@ -25,7 +25,7 @@ #include <ktempfile.h> #include <KoStore.h> -#include <qdir.h> +#include <tqdir.h> #include "fileheader.h" #include "document.h" @@ -51,9 +51,9 @@ Document::~Document() /*******************************************/ /* Analyse */ /*******************************************/ -void Document::analyse(const QDomNode balise) +void Document::analyse(const TQDomNode balise) { - //QDomNode balise = getChild(balise_initial, "FRAMESET"); + //TQDomNode balise = getChild(balise_initial, "FRAMESET"); kdDebug(30522) << getChildName(balise, 0) << endl; for(int index= 0; index < getNbChild(balise); index++) { @@ -82,7 +82,7 @@ void Document::analyse(const QDomNode balise) //elt->analyse(getChild(balise, index)); break; case ST_FORMULA: - /* Just save the frameset in a QString input + /* Just save the frameset in a TQString input * call the formula latex export filter * save in output * generate : write the output @@ -159,9 +159,9 @@ void Document::analyse(const QDomNode balise) /*******************************************/ /* AnalysePixmaps */ /*******************************************/ -void Document::analysePixmaps(const QDomNode balise) +void Document::analysePixmaps(const TQDomNode balise) { - //QDomNode balise = getChild(balise_initial, "FRAMESET"); + //TQDomNode balise = getChild(balise_initial, "FRAMESET"); for(int index= 0; index < getNbChild(balise); index++) { Key *key = 0; @@ -176,7 +176,7 @@ void Document::analysePixmaps(const QDomNode balise) /*******************************************/ /* getTypeFrameset */ /*******************************************/ -SType Document::getTypeFrameset(const QDomNode balise) +SType Document::getTypeFrameset(const TQDomNode balise) { SType type = ST_NONE; type = (SType) getAttr(balise, "frameType").toInt(); @@ -186,7 +186,7 @@ SType Document::getTypeFrameset(const QDomNode balise) /*******************************************/ /* Generate */ /*******************************************/ -void Document::generate(QTextStream &out, bool hasPreambule) +void Document::generate(TQTextStream &out, bool hasPreambule) { kdDebug(30522) << "DOC. GENERATION." << endl; @@ -202,7 +202,7 @@ void Document::generate(QTextStream &out, bool hasPreambule) out << "\\begin{document}" << endl; Config::instance()->indent(); } - QString dir = ""; + TQString dir = ""; if( !Config::instance()->getPicturesDir().isEmpty() && Config::instance()->getPicturesDir() != NULL && FileHeader::instance()->hasGraphics()) @@ -228,7 +228,7 @@ void Document::generate(QTextStream &out, bool hasPreambule) /*******************************************/ /* GeneratePreambule */ /*******************************************/ -void Document::generatePreambule(QTextStream &out) +void Document::generatePreambule(TQTextStream &out) { Element* header; Element* footer; @@ -270,7 +270,7 @@ void Document::generatePreambule(QTextStream &out) /*******************************************/ /* GenerateTypeHeader */ /*******************************************/ -void Document::generateTypeHeader(QTextStream &out, Element *header) +void Document::generateTypeHeader(TQTextStream &out, Element *header) { kdDebug(30522) << "generate header" << endl; if((FileHeader::instance()->getHeadType() == FileHeader::TH_ALL || @@ -316,7 +316,7 @@ void Document::generateTypeHeader(QTextStream &out, Element *header) /*******************************************/ /* GenerateTypeFooter */ /*******************************************/ -void Document::generateTypeFooter(QTextStream &out, Element *footer) +void Document::generateTypeFooter(TQTextStream &out, Element *footer) { if(FileHeader::instance()->getFootType() == FileHeader::TH_ALL && footer->getInfo() == SI_EVEN) @@ -356,7 +356,7 @@ void Document::generateTypeFooter(QTextStream &out, Element *footer) } } -Element* Document::searchAnchor(QString anchor) +Element* Document::searchAnchor(TQString anchor) { Element *elt = _tables.first(); while(elt != 0) @@ -386,7 +386,7 @@ Element* Document::searchAnchor(QString anchor) } -Element* Document::searchFootnote(QString footnote) +Element* Document::searchFootnote(TQString footnote) { Element* elt = _footnotes.first(); while(elt != 0) @@ -399,7 +399,7 @@ Element* Document::searchFootnote(QString footnote) } -Key* Document::searchKey(QString keyName) +Key* Document::searchKey(TQString keyName) { Key* key = _keys.first(); while(key != 0) @@ -413,27 +413,27 @@ Key* Document::searchKey(QString keyName) } -QString Document::extractData(QString key) +TQString Document::extractData(TQString key) { - QString data = searchKey(key)->getName(); + TQString data = searchKey(key)->getName(); kdDebug(30522) << "Opening " << data << endl; if(!getStorage()->isOpen()) { if(!getStorage()->open(data)) { kdError(30522) << "Unable to open " << data << endl; - return QString(""); + return TQString(""); } } /* Temp file with the default name in the default temp dir */ KTempFile temp; //temp.setAutoDelete(true); - QFile* tempFile = temp.file(); + TQFile* tempFile = temp.file(); - const Q_LONG buflen = 4096; + const TQ_LONG buflen = 4096; char buffer[ buflen ]; - Q_LONG readBytes = getStorage()->read( buffer, buflen ); + TQ_LONG readBytes = getStorage()->read( buffer, buflen ); while ( readBytes > 0 ) { @@ -444,7 +444,7 @@ QString Document::extractData(QString key) if(!getStorage()->close()) { kdError(30522) << "Unable to close " << data << endl; - return QString(""); + return TQString(""); } kdDebug(30522) << "temp filename : " << temp.name() << endl; return temp.name(); diff --git a/filters/kword/latex/export/document.h b/filters/kword/latex/export/document.h index afa7fb4c..b2844127 100644 --- a/filters/kword/latex/export/document.h +++ b/filters/kword/latex/export/document.h @@ -22,8 +22,8 @@ #ifndef __KWORD_LATEX_DOCUMENT_H__ #define __KWORD_LATEX_DOCUMENT_H__ -#include <qptrlist.h> -#include <qtextstream.h> +#include <tqptrlist.h> +#include <tqtextstream.h> #include "listtable.h" /* list of tables (another kind of list of elements). */ #include "key.h" @@ -43,16 +43,16 @@ class Document: public XmlParser enum EGenerate { E_LATEX, E_KWORD, E_CONFIG }; private: - QPtrList<Element> _headers; - QPtrList<Element> _footers; - QPtrList<Element> _footnotes; - QPtrList<Element> _formulas; - QPtrList<Element> _corps; - QPtrList<Element> _pixmaps; - QPtrList<Key> _keys; + TQPtrList<Element> _headers; + TQPtrList<Element> _footers; + TQPtrList<Element> _footnotes; + TQPtrList<Element> _formulas; + TQPtrList<Element> _corps; + TQPtrList<Element> _pixmaps; + TQPtrList<Key> _keys; ListTable _tables; - //QPtrList<Element> _parts; + //TQPtrList<Element> _parts; EGenerate _generation; public: @@ -77,37 +77,37 @@ class Document: public XmlParser /** * @return the next frame type (header, footer, body, footnote). */ - SType getTypeFrameset(const QDomNode); + SType getTypeFrameset(const TQDomNode); //FileHeader* getFileHeader() const { return _fileHeader; } //void setFileHeader(FileHeader *h) { _fileHeader = h; } - void analyse(const QDomNode); - void analysePixmaps(const QDomNode); + void analyse(const TQDomNode); + void analysePixmaps(const TQDomNode); - void generate(QTextStream&, bool); - Element* searchAnchor(QString); - Element* searchFootnote(QString); - Key* searchKey(QString keyName); + void generate(TQTextStream&, bool); + Element* searchAnchor(TQString); + Element* searchFootnote(TQString); + Key* searchKey(TQString keyName); /** Save the file in a temp file. */ - QString extractData(QString key); + TQString extractData(TQString key); /** Build a DOM tree (e.g. a KOffice part) */ - //QDomNode extractKoData(QString key); - //Pixmap* searchPixmap(QString); + //TQDomNode extractKoData(TQString key); + //Pixmap* searchPixmap(TQString); private: /** * Generate the second part of the preambule */ - void generatePreambule(QTextStream&); + void generatePreambule(TQTextStream&); /** * Generate the header */ - void generateTypeHeader(QTextStream&, Element*); + void generateTypeHeader(TQTextStream&, Element*); /** * Generate the footer */ - void generateTypeFooter(QTextStream&, Element*); + void generateTypeFooter(TQTextStream&, Element*); }; #endif /* __KWORD_LATEX_DOCUMENT_H__ */ diff --git a/filters/kword/latex/export/element.cc b/filters/kword/latex/export/element.cc index 7525d929..99229324 100644 --- a/filters/kword/latex/export/element.cc +++ b/filters/kword/latex/export/element.cc @@ -52,7 +52,7 @@ Element::~Element() /*******************************************/ /* Analyse */ /*******************************************/ -void Element::analyse(const QDomNode balise_initiale) +void Element::analyse(const TQDomNode balise_initiale) { /* ANALYSE A FRAMESET MARKUP */ @@ -64,7 +64,7 @@ void Element::analyse(const QDomNode balise_initiale) /*******************************************/ /* AnalyseParam */ /*******************************************/ -void Element::analyseParam(const QDomNode balise) +void Element::analyseParam(const TQDomNode balise) { /* <FRAMESET frameType="1" frameInfo="0" removable="0" * visible="1" name="Supercadre 1"> diff --git a/filters/kword/latex/export/element.h b/filters/kword/latex/export/element.h index 2abe77cf..9374620d 100644 --- a/filters/kword/latex/export/element.h +++ b/filters/kword/latex/export/element.h @@ -23,7 +23,7 @@ #ifndef __KWORD_ELEMENT_H__ #define __KWORD_ELEMENT_H__ -#include <qtextstream.h> +#include <tqtextstream.h> #include "xmlparser.h" #include "border.h" @@ -100,10 +100,10 @@ class Element: public XmlParser, public Border SType _type; SSect _section; SInfo _hinfo; - QString _name; + TQString _name; bool _removable; bool _visible; - QString _grpMgr; + TQString _grpMgr; int _row, _col, _rows, @@ -134,10 +134,10 @@ class Element: public XmlParser, public Border SSect getSection () const { return _section; } SType getType () const { return _type; } SInfo getInfo () const { return _hinfo; } - QString getName () const { return _name; } + TQString getName () const { return _name; } bool isVisible () const { return _visible; } bool isRemovable() const { return _removable; } - QString getGrpMgr () const { return _grpMgr; } + TQString getGrpMgr () const { return _grpMgr; } int getRow () const { return _row; } int getCol () const { return _col; } int getRows () const { return _rows; } @@ -151,7 +151,7 @@ class Element: public XmlParser, public Border void setSection (SSect s) { _section = s; } void setVisible (bool v) { _visible = v; } void setRemovable(bool r) { _removable = r; } - void setGrpMgr (QString g) { _grpMgr = g; } + void setGrpMgr (TQString g) { _grpMgr = g; } void setRow (int r) { _row = r; } void setCol (int c) { _col = c; } void setRows (int r) { _rows = r; } @@ -165,11 +165,11 @@ class Element: public XmlParser, public Border * Get informations about frameset markupt only from a * markup tree. */ - virtual void analyse(const QDomNode); - virtual void generate(QTextStream&) = 0; + virtual void analyse(const TQDomNode); + virtual void generate(TQTextStream&) = 0; private: - void analyseParam(const QDomNode); + void analyseParam(const TQDomNode); }; #endif /* __KWORD_ELEMENT_H__ */ diff --git a/filters/kword/latex/export/fileheader.cc b/filters/kword/latex/export/fileheader.cc index de3d2ae7..96b4be4e 100644 --- a/filters/kword/latex/export/fileheader.cc +++ b/filters/kword/latex/export/fileheader.cc @@ -55,7 +55,7 @@ FileHeader::~FileHeader() /*******************************************/ /* AnalysePaperParam */ /*******************************************/ -void FileHeader::analysePaperParam(const QDomNode balise) +void FileHeader::analysePaperParam(const TQDomNode balise) { setFormat(getAttr(balise, "format").toInt()); _width = getAttr(balise, "width").toInt(); @@ -73,13 +73,13 @@ void FileHeader::analysePaperParam(const QDomNode balise) /*******************************************/ /* AnalysePaper */ /*******************************************/ -void FileHeader::analysePaper(const QDomNode balise) +void FileHeader::analysePaper(const TQDomNode balise) { analysePaperParam(balise); //setTokenCurrent(balise_initiale->pContent); - // Analyse children markups --> PAPERBORDERS - QDomNode fils = getChild(balise, "PAPERSBORDERS"); + // Analyse tqchildren markups --> PAPERBORDERS + TQDomNode fils = getChild(balise, "PAPERSBORDERS"); _leftBorder = getAttr(fils, "left").toInt(); _rightBorder = getAttr(fils, "right").toInt(); _bottomBorder = getAttr(fils, "bottom").toInt(); @@ -89,7 +89,7 @@ void FileHeader::analysePaper(const QDomNode balise) /*******************************************/ /* AnalyseAttributs */ /*******************************************/ -void FileHeader::analyseAttributs(const QDomNode balise) +void FileHeader::analyseAttributs(const TQDomNode balise) { setProcessing(getAttr(balise, "processing").toInt()); setStandardPge(getAttr(balise, "standardpage").toInt()); @@ -102,7 +102,7 @@ void FileHeader::analyseAttributs(const QDomNode balise) /*******************************************/ /* Generate */ /*******************************************/ -void FileHeader::generate(QTextStream &out) +void FileHeader::generate(TQTextStream &out) { kdDebug(30522) << "GENERATION OF THE FILE HEADER" << endl; if(Config::instance()->mustUseLatin1()) @@ -119,9 +119,9 @@ void FileHeader::generate(QTextStream &out) /*******************************************/ /* GeneratePaper */ /*******************************************/ -void FileHeader::generatePaper(QTextStream &out) +void FileHeader::generatePaper(TQTextStream &out) { - QString unit; + TQString unit; out << "% Format of paper" << endl; kdDebug(30522) << "Generate custom size paper" << endl; @@ -140,7 +140,7 @@ void FileHeader::generatePaper(QTextStream &out) /*******************************************/ /* GenerateLatinPreambule */ /*******************************************/ -void FileHeader::generateLatinPreambule(QTextStream &out) +void FileHeader::generateLatinPreambule(TQTextStream &out) { out << "%% Generated by KWord. Don't modify this file but the file *.kwd." << endl; out << "%% Send an email to rjacolin@ifrance.com for bugs, wishes, .... Thank you." << endl; @@ -209,7 +209,7 @@ void FileHeader::generateLatinPreambule(QTextStream &out) /*******************************************/ /* GenerateUnicodePreambule */ /*******************************************/ -void FileHeader::generateUnicodePreambule(QTextStream &out) +void FileHeader::generateUnicodePreambule(TQTextStream &out) { out << "%% Generated by KWord. Don't modify this file but the file *.kwd." << endl; out << "%% Send an email to rjacolin@ifrance.com for bugs, wishes, .... Thank you." << endl; @@ -281,13 +281,13 @@ void FileHeader::generateUnicodePreambule(QTextStream &out) /*******************************************/ /* GeneratePackage */ /*******************************************/ -void FileHeader::generatePackage(QTextStream &out) +void FileHeader::generatePackage(TQTextStream &out) { out << "% Package(s) to include" << endl; if(Config::instance()->mustUseUnicode()) out << "\\usepackage{omega}" << endl; if(getFormat() == TF_A4) - out << "\\usepackage[a4paper]{geometry}" << endl; + out << "\\usepackage[a4paper]{tqgeometry}" << endl; if(hasFooter() || hasHeader()) out << "\\usepackage{fancyhdr}" << endl; if(hasColor()) @@ -303,7 +303,7 @@ void FileHeader::generatePackage(QTextStream &out) out << "\\usepackage{array}" << endl; out << "\\usepackage{multirow}" << endl; } - QStringList langs = Config::instance()->getLanguagesList(); + TQStringList langs = Config::instance()->getLanguagesList(); if(langs.count() > 0) { out << "\\usepackage[" << langs.join( ", " ) << "]{babel}" << endl; diff --git a/filters/kword/latex/export/fileheader.h b/filters/kword/latex/export/fileheader.h index d11b0a0f..d837c828 100644 --- a/filters/kword/latex/export/fileheader.h +++ b/filters/kword/latex/export/fileheader.h @@ -22,7 +22,7 @@ #ifndef __KWORD_FILEHEADER_H__ #define __KWORD_FILEHEADER_H__ -#include <qtextstream.h> +#include <tqtextstream.h> #include "xmlparser.h" @@ -134,10 +134,10 @@ class FileHeader: public XmlParser void useGraphics () { _hasGraphics = true; } void useTable () { _hasTable = true; } - void analysePaper (const QDomNode); - void analyseAttributs (const QDomNode); + void analysePaper (const TQDomNode); + void analyseAttributs (const TQDomNode); - void generate (QTextStream &); + void generate (TQTextStream &); protected: /** @@ -149,12 +149,12 @@ class FileHeader: public XmlParser private: - void analysePaperParam(const QDomNode); + void analysePaperParam(const TQDomNode); - void generatePaper (QTextStream&); - void generateLatinPreambule(QTextStream&); - void generateUnicodePreambule(QTextStream&); - void generatePackage (QTextStream&); + void generatePaper (TQTextStream&); + void generateLatinPreambule(TQTextStream&); + void generateUnicodePreambule(TQTextStream&); + void generatePackage (TQTextStream&); }; diff --git a/filters/kword/latex/export/footnote.cc b/filters/kword/latex/export/footnote.cc index 85f83658..fbfba354 100644 --- a/filters/kword/latex/export/footnote.cc +++ b/filters/kword/latex/export/footnote.cc @@ -35,28 +35,28 @@ Footnote::~Footnote() } /* Modifiers */ -void Footnote::setSpace (QString new_space) +void Footnote::setSpace (TQString new_space) { _space = new_space; } -void Footnote::setBefore(QString new_before) +void Footnote::setBefore(TQString new_before) { _before = new_before; } -void Footnote::setAfter(QString new_after) +void Footnote::setAfter(TQString new_after) { _after = new_after; } -void Footnote::setRef(QString new_ref) +void Footnote::setRef(TQString new_ref) { _ref = new_ref; } -void Footnote::analyse(const QDomNode balise) +void Footnote::analyse(const TQDomNode balise) { /* MARKUPS FORMAT id="1" pos="0" len="17">...</FORMAT> */ @@ -95,9 +95,9 @@ void Footnote::analyse(const QDomNode balise) kdDebug(30522) << "END OF FOOTNOTE" << endl; } -void Footnote::analyseInternal(const QDomNode balise) +void Footnote::analyseInternal(const TQDomNode balise) { - QDomNode fils; + TQDomNode fils; /* MARKUPS <INTERNAL> <PART from="1" to="-1" space="-"/> */ /* Children Markups Analyse */ @@ -115,27 +115,27 @@ void Footnote::analyseInternal(const QDomNode balise) } } -void Footnote::analyseRange(const QDomNode balise) +void Footnote::analyseRange(const TQDomNode balise) { kdDebug(30522) << "PARAM" << endl; setStart(getAttr(balise, "START").toInt()); setEnd(getAttr(balise, "END").toInt()); } -void Footnote::analyseText(const QDomNode balise) +void Footnote::analyseText(const TQDomNode balise) { kdDebug(30522) << "PARAM" << endl; setBefore(getAttr(balise, "BEFORE")); setAfter(getAttr(balise, "AFTER")); } -void Footnote::analyseDescript(const QDomNode balise) +void Footnote::analyseDescript(const TQDomNode balise) { kdDebug(30522) << "PARAM" << endl; setRef(getAttr(balise, "REF")); } -void Footnote::generate(QTextStream &out) +void Footnote::generate(TQTextStream &out) { Element *footnote = 0; diff --git a/filters/kword/latex/export/footnote.h b/filters/kword/latex/export/footnote.h index 6ed72b91..468de523 100644 --- a/filters/kword/latex/export/footnote.h +++ b/filters/kword/latex/export/footnote.h @@ -25,7 +25,7 @@ #ifndef __KWORD_LATEX_FOOTNOTE_H__ #define __KWORD_LATEX_FOOTNOTE_H__ -#include <qstring.h> +#include <tqstring.h> #include "format.h" /***********************************************************************/ @@ -40,8 +40,8 @@ class Footnote: public Format { int _from, _to; int _start, _end; - QString _before, _after, _space; // TODO: Change in QChar - QString _ref; + TQString _before, _after, _space; // TODO: Change in TQChar + TQString _ref; public: /** @@ -49,7 +49,7 @@ class Footnote: public Format * * Creates a new instances of Footnote. * - * @param Para is the parent class + * @param Para is the tqparent class */ Footnote(Para* para = 0); //Footnote(TextZone); @@ -70,23 +70,23 @@ class Footnote: public Format */ void setFrom (int f) { _from = f; } void setTo (int t) { _to = t; } - void setSpace (QString); + void setSpace (TQString); void setStart (int s) { _start = s; } void setEnd (int e) { _end = e; } - void setBefore(QString); - void setAfter (QString); - void setRef (QString); + void setBefore(TQString); + void setAfter (TQString); + void setRef (TQString); /** * Helpfull functions */ - void analyse (const QDomNode); - void analyseInternal(const QDomNode); - void analyseRange(const QDomNode); - void analyseText(const QDomNode); - void analyseDescript(const QDomNode); + void analyse (const TQDomNode); + void analyseInternal(const TQDomNode); + void analyseRange(const TQDomNode); + void analyseText(const TQDomNode); + void analyseDescript(const TQDomNode); - void generate(QTextStream&); + void generate(TQTextStream&); //private: }; diff --git a/filters/kword/latex/export/format.cc b/filters/kword/latex/export/format.cc index 262dd6f0..d2e7d4a2 100644 --- a/filters/kword/latex/export/format.cc +++ b/filters/kword/latex/export/format.cc @@ -27,7 +27,7 @@ #include "format.h" /* Get the set of info. about a text format */ -void Format::analyse(const QDomNode balise) +void Format::analyse(const TQDomNode balise) { /* <FORMAT id="1" pos="0" len="17"> */ setId(getAttr(balise, "id").toInt()); @@ -35,6 +35,6 @@ void Format::analyse(const QDomNode balise) setLength(getAttr(balise, "len").toInt()); } -/*void Format::generate(QTextStream&, int) +/*void Format::generate(TQTextStream&, int) { }*/ diff --git a/filters/kword/latex/export/format.h b/filters/kword/latex/export/format.h index eb70e787..c7551767 100644 --- a/filters/kword/latex/export/format.h +++ b/filters/kword/latex/export/format.h @@ -23,9 +23,9 @@ #ifndef __KWORD_FORMAT_H__ #define __KWORD_FORMAT_H__ -#include <qtextstream.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqtextstream.h> +#include <tqstring.h> +#include <tqcolor.h> #include "xmlparser.h" enum _EFormat @@ -68,7 +68,7 @@ class Format: public XmlParser * * Creates a new instance of Format. * - * @param Para the parent class of the format. + * @param Para the tqparent class of the format. */ Format(Para *para= 0): _id((EFormat) 0), _para(para) {} @@ -104,10 +104,10 @@ class Format: public XmlParser /** * Get informations from a markup tree (only param of a format). */ - virtual void analyse(const QDomNode); + virtual void analyse(const TQDomNode); - virtual void generate(QTextStream&) = 0; - //virtual void generate(QTextStream&, int = 0); + virtual void generate(TQTextStream&) = 0; + //virtual void generate(TQTextStream&, int = 0); }; diff --git a/filters/kword/latex/export/formula.cc b/filters/kword/latex/export/formula.cc index 31621acc..f461a6f0 100644 --- a/filters/kword/latex/export/formula.cc +++ b/filters/kword/latex/export/formula.cc @@ -21,8 +21,8 @@ #include <stdlib.h> /* for atoi function */ #include <kdebug.h> /* for kdDebug() stream */ -#include <qptrstack.h> /* for getFormula() */ -#include <qdom.h> +#include <tqptrstack.h> /* for getFormula() */ +#include <tqdom.h> #include "formula.h" #include <kapplication.h> @@ -48,7 +48,7 @@ Formula::Formula() /*******************************************/ /* analyse */ /*******************************************/ -void Formula::analyse(const QDomNode balise) +void Formula::analyse(const TQDomNode balise) { /* MARKUP TYPE : FRAMESET INFO = TEXTE, ENTETE CONNUE */ @@ -80,12 +80,12 @@ void Formula::analyse(const QDomNode balise) /*******************************************/ /* Get back the xml markup tree. */ /*******************************************/ -void Formula::getFormula(QDomNode p, int indent) +void Formula::getFormula(TQDomNode p, int indent) { switch( p.nodeType() ) { - case QDomNode::TextNode: - _formula = _formula + QString(p.toText().data()) + " "; + case TQDomNode::TextNode: + _formula = _formula + TQString(p.toText().data()) + " "; break; /* case TT_Space: _formula = _formula + p->zText; @@ -95,9 +95,9 @@ void Formula::getFormula(QDomNode p, int indent) _formula = _formula + "\n"; //printf("%*s\n", indent, ""); break;*/ - case QDomNode::ElementNode: + case TQDomNode::ElementNode: _formula = _formula + "<" + p.nodeName(); - QDomNamedNodeMap attr = p.attributes(); + TQDomNamedNodeMap attr = p.attributes(); for(unsigned int index = 0; index < attr.length(); index++) { // The attributes _formula = _formula + " " + attr.item(index).nodeName(); @@ -108,7 +108,7 @@ void Formula::getFormula(QDomNode p, int indent) else { _formula = _formula + ">\n"; - QDomNodeList child = p.childNodes(); + TQDomNodeList child = p.childNodes(); for(unsigned int index = 0; index < child.length(); index++) { getFormula(child.item(index), indent + 3); // The child elements @@ -116,18 +116,18 @@ void Formula::getFormula(QDomNode p, int indent) _formula = _formula + "</" + p.nodeName() + ">\n"; } break; - /*case QDomNode::AttributeNode: - case QDomNode::CDATASectionNode: - case QDomNode::EntityReferenceNode: - case QDomNode::EntityNode: - case QDomNode::ProcessingInstructionNode: - case QDomNode::CommentNode: - case QDomNode::DocumentNode: - case QDomNode::DocumentTypeNode: - case QDomNode::DocumentFragmentNode: - case QDomNode::NotationNode: - case QDomNode::BaseNode: - case QDomNode::CharacterDataNode: + /*case TQDomNode::AttributeNode: + case TQDomNode::CDATASectionNode: + case TQDomNode::EntityReferenceNode: + case TQDomNode::EntityNode: + case TQDomNode::ProcessingInstructionNode: + case TQDomNode::CommentNode: + case TQDomNode::DocumentNode: + case TQDomNode::DocumentTypeNode: + case TQDomNode::DocumentFragmentNode: + case TQDomNode::NotationNode: + case TQDomNode::BaseNode: + case TQDomNode::CharacterDataNode: break;*/ //default: //kdError(30522) << "Can't happen" << endl; @@ -139,7 +139,7 @@ void Formula::getFormula(QDomNode p, int indent) /*******************************************/ /* analyseParamFrame */ /*******************************************/ -void Formula::analyseParamFrame(const QDomNode balise) +void Formula::analyseParamFrame(const TQDomNode balise) { /*<FRAME left="28" top="42" right="566" bottom="798" runaround="1" />*/ @@ -157,10 +157,10 @@ void Formula::analyseParamFrame(const QDomNode balise) /*******************************************/ /* generate */ /*******************************************/ -void Formula::generate(QTextStream &out) +void Formula::generate(TQTextStream &out) { kdDebug(30522) << "FORMULA GENERATION" << endl; - QDomDocument doc; + TQDomDocument doc; doc.setContent(_formula); // a new KFormula::Document for every formula is not the best idea. diff --git a/filters/kword/latex/export/formula.h b/filters/kword/latex/export/formula.h index bc6dcfed..03ba4bd6 100644 --- a/filters/kword/latex/export/formula.h +++ b/filters/kword/latex/export/formula.h @@ -24,8 +24,8 @@ #define __KWORD_LATEXFORMULA__ #include "element.h" -#include <qstring.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqtextstream.h> /***********************************************************************/ /* Class: Formula */ @@ -49,7 +49,7 @@ class Formula: public Element TSide _sheetSide; /* CHILDREN MARKUPS */ - QString _formula; + TQString _formula; public: /** @@ -78,7 +78,7 @@ class Formula: public Element TNFrame getNewFrame () const { return _newFrameBehaviour; } TSide getSheetSide () const { return _sheetSide; } - void getFormula(QDomNode, int); + void getFormula(TQDomNode, int); /** * Modifiers @@ -95,17 +95,17 @@ class Formula: public Element /** * Get informations from a markup tree and put the formula - * in a QString. + * in a TQString. */ - void analyse(const QDomNode); + void analyse(const TQDomNode); /** * Write the formula in a file. */ - void generate(QTextStream&); + void generate(TQTextStream&); private: - void analyseParamFrame(const QDomNode); + void analyseParamFrame(const TQDomNode); }; #endif /* __KWORD_LATEXFORMULA_H__ */ diff --git a/filters/kword/latex/export/key.cc b/filters/kword/latex/export/key.cc index 33da485d..dccf89c6 100644 --- a/filters/kword/latex/export/key.cc +++ b/filters/kword/latex/export/key.cc @@ -42,7 +42,7 @@ Key::~Key() /*******************************************/ /* Analyse */ /*******************************************/ -void Key::analyse(const QDomNode balise) +void Key::analyse(const TQDomNode balise) { /* MARKUP TYPE : PARAGRAPH */ @@ -66,7 +66,7 @@ void Key::analyse(const QDomNode balise) /* Generate each text zone with the parag. */ /* markup. */ /*******************************************/ -void Key::generate(QTextStream &out) +void Key::generate(TQTextStream &out) { kdDebug(30522) << " GENERATION KEY" << endl; diff --git a/filters/kword/latex/export/key.h b/filters/kword/latex/export/key.h index 6f3b1ccf..7d873466 100644 --- a/filters/kword/latex/export/key.h +++ b/filters/kword/latex/export/key.h @@ -22,7 +22,7 @@ #ifndef __KWORD_LATEX_EXPORT_KEY_H__ #define __KWORD_LATEX_EXPORT_KEY_H__ -#include <qstring.h> +#include <tqstring.h> #include "xmlparser.h" @@ -41,8 +41,8 @@ class Key: public XmlParser enum eKeyType { PIXMAP, PICTURE }; private: /* MARKUP DATA */ - QString _filename; - QString _name; + TQString _filename; + TQString _name; int _hour; int _minute; int _second; @@ -77,8 +77,8 @@ class Key: public XmlParser /** * @return the paragraph's name. */ - QString getName() const { return _name; } - QString getFilename() const { return _filename; } + TQString getName() const { return _name; } + TQString getFilename() const { return _filename; } int getHour() const { return _hour; } int getMSec() const { return _msec; } int getDay() const { return _day; } @@ -91,8 +91,8 @@ class Key: public XmlParser /** * Modifiers */ - void setName(QString name) { _name = name; } - void setFilename(QString filename) { _filename = filename; } + void setName(TQString name) { _name = name; } + void setFilename(TQString filename) { _filename = filename; } void setHour(int hour) { _hour = hour; } void setMSec(int msec) { _msec = msec; } void setDay(int day) { _day = day; } @@ -108,12 +108,12 @@ class Key: public XmlParser /** * Get informations from a markup tree. */ - void analyse (const QDomNode); + void analyse (const TQDomNode); /** * Write the paragraph in a file. */ - void generate (QTextStream&); + void generate (TQTextStream&); private: diff --git a/filters/kword/latex/export/kwordlatexexportdia.cc b/filters/kword/latex/export/kwordlatexexportdia.cc index beafbe10..b5904248 100644 --- a/filters/kword/latex/export/kwordlatexexportdia.cc +++ b/filters/kword/latex/export/kwordlatexexportdia.cc @@ -20,11 +20,11 @@ #include <kwordlatexexportdia.h> -#include <qdir.h> -#include <qcombobox.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qcheckbox.h> +#include <tqdir.h> +#include <tqcombobox.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> #include <kapplication.h> #include <kglobal.h> @@ -50,15 +50,15 @@ #endif*/ /* - * Constructs a KWordLatexExportDia which is a child of 'parent', with the + * Constructs a KWordLatexExportDia which is a child of 'tqparent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -KWordLatexExportDia::KWordLatexExportDia(KoStore* in, QWidget* parent, +KWordLatexExportDia::KWordLatexExportDia(KoStore* in, TQWidget* tqparent, const char* name_, bool modal, WFlags fl ) - : LatexExportDia( parent, name_, modal, fl ),_in( in ) + : LatexExportDia( tqparent, name_, modal, fl ),_in( in ) { int i = 0; @@ -68,10 +68,10 @@ KWordLatexExportDia::KWordLatexExportDia(KoStore* in, QWidget* parent, /* Recent files */ _config = new KConfig("kwordlatexexportdialog"); _config->setGroup( "KWord latex export filter" ); - QString value; + TQString value; while(i < 10) { - /*value = _config->readPathEntry( QString("Recent%1").arg(i) ); + /*value = _config->readPathEntry( TQString("Recent%1").tqarg(i) ); kdDebug(30522) << "recent : " << value << endl; if(!value.isEmpty()) { @@ -101,7 +101,7 @@ KWordLatexExportDia::KWordLatexExportDia(KoStore* in, QWidget* parent, classComboBox->insertItem("report"); classComboBox->insertItem("slides"); - encodingComboBox->insertItem("unicode"); + encodingComboBox->insertItem("tqunicode"); encodingComboBox->insertItem("ansinew"); encodingComboBox->insertItem("applemac"); encodingComboBox->insertItem("ascii"); @@ -169,7 +169,7 @@ KWordLatexExportDia::~KWordLatexExportDia() void KWordLatexExportDia::reject() { kdDebug(30522) << "Export cancelled" << endl; - QDialog::reject(); + TQDialog::reject(); } /** @@ -231,7 +231,7 @@ void KWordLatexExportDia::accept() void KWordLatexExportDia::addLanguage() { kdDebug(30522) << "add a new language supported" << languagesList->currentText() << endl; - QString text = languagesList->currentText(); + TQString text = languagesList->currentText(); languagesList->removeItem(languagesList->currentItem()); langUsedList->insertItem(text); } @@ -239,7 +239,7 @@ void KWordLatexExportDia::addLanguage() void KWordLatexExportDia::removeLanguage() { kdDebug(30522) << "remove the language" << langUsedList->currentText() << endl; - QString text = langUsedList->currentText(); + TQString text = langUsedList->currentText(); langUsedList->removeItem(langUsedList->currentItem()); languagesList->insertItem(text); } diff --git a/filters/kword/latex/export/kwordlatexexportdia.h b/filters/kword/latex/export/kwordlatexexportdia.h index 9cc90287..8aca29ed 100644 --- a/filters/kword/latex/export/kwordlatexexportdia.h +++ b/filters/kword/latex/export/kwordlatexexportdia.h @@ -21,7 +21,7 @@ #define __KWORDLATEXEXPORTDIA_H__ #include <latexexportdia.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <kurl.h> class KoStore; @@ -31,19 +31,20 @@ class LatexExportIface; class KWordLatexExportDia : public LatexExportDia { Q_OBJECT + TQ_OBJECT private: - QString _fileOut; + TQString _fileOut; KoStore* _in; KConfig* _config; LatexExportIface* _iface; public: - KWordLatexExportDia( KoStore*, QWidget* parent = 0, + KWordLatexExportDia( KoStore*, TQWidget* tqparent = 0, const char* name = 0, bool modal = true, WFlags fl = 0 ); virtual ~KWordLatexExportDia(); - void setOutputFile(QString file) { _fileOut = file; } + void setOutputFile(TQString file) { _fileOut = file; } public slots: virtual void reject(); diff --git a/filters/kword/latex/export/latexexport.cc b/filters/kword/latex/export/latexexport.cc index de4cf72a..f521ec9d 100644 --- a/filters/kword/latex/export/latexexport.cc +++ b/filters/kword/latex/export/latexexport.cc @@ -25,20 +25,20 @@ #include <kgenericfactory.h> #include <kglobal.h> #include <klocale.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include "kwordlatexexportdia.h" typedef KGenericFactory<LATEXExport, KoFilter> LATEXExportFactory; K_EXPORT_COMPONENT_FACTORY( libkwordlatexexport, LATEXExportFactory( "kofficefilters" ) ) -LATEXExport::LATEXExport(KoFilter *, const char *, const QStringList&) : +LATEXExport::LATEXExport(KoFilter *, const char *, const TQStringList&) : KoFilter() { } -KoFilter::ConversionStatus LATEXExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus LATEXExport::convert( const TQCString& from, const TQCString& to ) { - QString config; + TQString config; if(to != "text/x-tex" || from != "application/x-kword") return KoFilter::NotImplemented; diff --git a/filters/kword/latex/export/latexexport.h b/filters/kword/latex/export/latexexport.h index 3b743000..5812d316 100644 --- a/filters/kword/latex/export/latexexport.h +++ b/filters/kword/latex/export/latexexport.h @@ -20,10 +20,10 @@ #ifndef __LATEXEXPORT_H__ #define __LATEXEXPORT_H__ -#include <qstring.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -32,12 +32,13 @@ class LATEXExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - LATEXExport(KoFilter *parent, const char *name, const QStringList&); + LATEXExport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~LATEXExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif /* __LATEXExport_H__ */ diff --git a/filters/kword/latex/export/latexexportIface.cc b/filters/kword/latex/export/latexexportIface.cc index 102845b1..a50d7c61 100644 --- a/filters/kword/latex/export/latexexportIface.cc +++ b/filters/kword/latex/export/latexexportIface.cc @@ -22,7 +22,7 @@ #include "kwordlatexexportdia.h" /* - * Constructs a KWordLatexExportDia which is a child of 'parent', with the + * Constructs a KWordLatexExportDia which is a child of 'tqparent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to diff --git a/filters/kword/latex/export/latexexportdia.ui b/filters/kword/latex/export/latexexportdia.ui index 3e62df55..677329da 100644 --- a/filters/kword/latex/export/latexexportdia.ui +++ b/filters/kword/latex/export/latexexportdia.ui @@ -2,7 +2,7 @@ <class>LatexExportDia</class> <comment>This dialog box is used for all latex filter in koffice.</comment> <author>Robert Jacolin <rjacolin@ifrance.com></author> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>LatexExportDia</cstring> </property> @@ -30,14 +30,14 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QTabWidget" row="0" column="1"> + <widget class="TQTabWidget" row="0" column="1"> <property name="name"> <cstring>_tab</cstring> </property> <property name="enabled"> <bool>true</bool> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>Widget2</cstring> </property> @@ -66,7 +66,7 @@ <number>1000</number> </property> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>styleGroup</cstring> </property> @@ -81,7 +81,7 @@ <property name="title"> <string>Document Style</string> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>kwordStyleButton</cstring> </property> @@ -100,7 +100,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>latexStyleButton</cstring> </property> @@ -117,7 +117,7 @@ </property> </widget> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>typeGroup</cstring> </property> @@ -132,7 +132,7 @@ <property name="title"> <string>Document Type</string> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>fullDocButton</cstring> </property> @@ -157,7 +157,7 @@ <string>The document will be generated as a full latex document since all the include will be generated before the \begin[document} and \end{document} commands.</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>embededButton</cstring> </property> @@ -180,7 +180,7 @@ </property> </widget> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>TextLabel1_2</cstring> </property> @@ -196,7 +196,7 @@ <string>Document class:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>TextLabel2</cstring> </property> @@ -212,7 +212,7 @@ <string>Quality:</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>defaultFontSizeTextZone</cstring> </property> @@ -228,7 +228,7 @@ <string>Default font size:</string> </property> </widget> - <widget class="QComboBox"> + <widget class="TQComboBox"> <property name="name"> <cstring>classComboBox</cstring> </property> @@ -265,7 +265,7 @@ </property> </widget> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>Widget3</cstring> </property> @@ -288,7 +288,7 @@ <string>This directory will contains the eps pictures of your document.</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>pictureCheckBox</cstring> </property> @@ -307,7 +307,7 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>TextLabel1</cstring> </property> @@ -324,14 +324,14 @@ </property> </widget> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Language</string> </attribute> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>ButtonGroup3</cstring> </property> @@ -360,7 +360,7 @@ </property> </widget> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>GroupBox4</cstring> </property> @@ -378,7 +378,7 @@ <property name="title"> <string>Language</string> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>rmLanguageBtn</cstring> </property> @@ -394,7 +394,7 @@ <string>Remove</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>addLanguageBtn</cstring> </property> @@ -438,14 +438,14 @@ </widget> </widget> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Contents</string> </attribute> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>exportAuthor</cstring> </property> @@ -467,7 +467,7 @@ <bool>false</bool> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>tableContents</cstring> </property> @@ -486,7 +486,7 @@ <string>Add a table of content</string> </property> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>note</cstring> </property> @@ -504,7 +504,7 @@ <property name="title"> <string>Notes</string> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>RadioButton7</cstring> </property> @@ -520,7 +520,7 @@ <string>Don't export</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>RadioButton6</cstring> </property> @@ -536,7 +536,7 @@ <string>Export notes in comments</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>RadioButton5</cstring> </property> @@ -555,7 +555,7 @@ </widget> </widget> </widget> - <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQLayoutWidget" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>Layout1</cstring> </property> @@ -569,7 +569,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonHelp</cstring> </property> @@ -593,14 +593,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>0</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonOk</cstring> </property> @@ -614,7 +614,7 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonCancel</cstring> </property> @@ -655,11 +655,11 @@ <slot>removeLanguage()</slot> </connection> </connections> -<slots> +<Q_SLOTS> <slot>addLanguage()</slot> <slot>removeLanguage()</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint> diff --git a/filters/kword/latex/export/layout.cc b/filters/kword/latex/export/layout.cc index 0701a3a0..2615b852 100644 --- a/filters/kword/latex/export/layout.cc +++ b/filters/kword/latex/export/layout.cc @@ -24,10 +24,10 @@ #include <kdebug.h> /* for kdDebug() stream */ #include "fileheader.h" /* for _header use */ -#include "layout.h" +#include "tqlayout.h" /* Static Datas */ -QString Layout::_last_name; +TQString Layout::_last_name; EType Layout::_last_counter; /*******************************************/ @@ -51,14 +51,14 @@ Layout::Layout() /*******************************************/ /* analyseLAyout */ /*******************************************/ -void Layout::analyseLayout(const QDomNode balise) +void Layout::analyseLayout(const TQDomNode balise) { /* Markup type : FORMAT id="1" pos="0" len="17">...</FORMAT> */ /* No parameters for this markup */ kdDebug(30522) << "ANALYSE OF THE BEGINING OF A LAYOUT" << endl; - /* Analyse children markups */ + /* Analyse tqchildren markups */ for(int index= 0; index < getNbChild(balise); index++) { if(getChildName(balise, index).compare("NAME")== 0) @@ -95,7 +95,7 @@ void Layout::analyseLayout(const QDomNode balise) kdDebug(30522) << "END OF THE BEGINING OF A LAYOUT" << endl; } -void Layout::analyseName(const QDomNode balise) +void Layout::analyseName(const TQDomNode balise) { /* <NAME value="times"> */ kdDebug(30522) << "PARAM" << endl; @@ -107,7 +107,7 @@ void Layout::analyseName(const QDomNode balise) /*******************************************/ /* Get info about folowing. Ununsefull. */ /*******************************************/ -void Layout::analyseFollowing(const QDomNode balise) +void Layout::analyseFollowing(const TQDomNode balise) { /* <FOLLOWING name="times"> */ kdDebug(30522) << "PARAM" << endl; @@ -119,7 +119,7 @@ void Layout::analyseFollowing(const QDomNode balise) /*******************************************/ /* Get informations about environment. */ /*******************************************/ -void Layout::analyseEnv(const QDomNode balise) +void Layout::analyseEnv(const TQDomNode balise) { /* <FLOW align="0"> */ // ERROR: Enter first in flow ???? @@ -134,7 +134,7 @@ void Layout::analyseEnv(const QDomNode balise) setEnv(ENV_CENTER); } -void Layout::analyseBreakLine(const QDomNode balise) +void Layout::analyseBreakLine(const TQDomNode balise) { /* <NAME hardFrameBreakAfter="true"> */ kdDebug(30522) << "PARAM" << endl; @@ -153,7 +153,7 @@ void Layout::analyseBreakLine(const QDomNode balise) /* If I use a counter, I must include a tex*/ /* package. */ /*******************************************/ -void Layout::analyseCounter(const QDomNode balise) +void Layout::analyseCounter(const TQDomNode balise) { /* <COUNTER type="1"> */ kdDebug(30522) << "PARAM" << endl; diff --git a/filters/kword/latex/export/layout.h b/filters/kword/latex/export/layout.h index 9db1fe61..298b08ff 100644 --- a/filters/kword/latex/export/layout.h +++ b/filters/kword/latex/export/layout.h @@ -23,8 +23,8 @@ #ifndef __KWORD_LAYOUT_H__ #define __KWORD_LAYOUT_H__ -#include <qtextstream.h> -#include <qstring.h> +#include <tqtextstream.h> +#include <tqstring.h> #include <kdebug.h> #include "textformat.h" @@ -65,15 +65,15 @@ typedef enum _EEnv EEnv; */ class Layout: public TextFormat { - QString _name; - QString _following; + TQString _name; + TQString _following; EType _counterType; int _counterDepth; int _counterBullet; int _counterStart; int _numberingType; EEnv _env; - static QString _last_name; + static TQString _last_name; static EType _last_counter; bool _useHardBreakAfter; bool _useHardBreak; @@ -93,7 +93,7 @@ class Layout: public TextFormat * Nothing to do. */ virtual ~Layout() { - kdDebug(30522) << "Destruction of a layout." << endl; + kdDebug(30522) << "Destruction of a tqlayout." << endl; } /** @@ -104,7 +104,7 @@ class Layout: public TextFormat bool isEnum () const { return (_counterType != TL_NONE); } bool isLastSame () const { return (_name == _last_name); } bool isNextSame () const { return (_following == _name); } - QString getLastName () const { return _last_name; } + TQString getLastName () const { return _last_name; } EType getLastCounter () const { return _last_counter; } EType getCounterType () const { return _counterType; } int getCounterDepth () const { return _counterDepth; } @@ -119,10 +119,10 @@ class Layout: public TextFormat /** * Modifiers */ - void setName (QString name) { _name = name; } + void setName (TQString name) { _name = name; } void setLastName () { _last_name = _name; } void setLastCounter () { _last_counter= _counterType; } - void setFollowing (QString name) { _following = name; } + void setFollowing (TQString name) { _following = name; } void setCounterType (int ct) { _counterType = (EType) ct; } void setCounterDepth (int cd) { _counterDepth = cd; } void setCounterBullet(int cb) { _counterBullet = cb; } @@ -137,14 +137,14 @@ class Layout: public TextFormat * Helpfull functions */ - void analyseLayout (const QDomNode); + void analyseLayout (const TQDomNode); private: - void analyseCounter (const QDomNode); - void analyseFollowing(const QDomNode); - void analyseName (const QDomNode); - void analyseEnv (const QDomNode); - void analyseBreakLine(const QDomNode); + void analyseCounter (const TQDomNode); + void analyseFollowing(const TQDomNode); + void analyseName (const TQDomNode); + void analyseEnv (const TQDomNode); + void analyseBreakLine(const TQDomNode); }; #endif /* __KWORD_LAYOUT_H__ */ diff --git a/filters/kword/latex/export/listeformat.h b/filters/kword/latex/export/listeformat.h index 5107d4cd..29dec6bc 100644 --- a/filters/kword/latex/export/listeformat.h +++ b/filters/kword/latex/export/listeformat.h @@ -96,7 +96,7 @@ class FormatElt class ListeFormat { - //QString _texte; + //TQString _texte; private: FormatElt* _first; diff --git a/filters/kword/latex/export/listtable.cc b/filters/kword/latex/export/listtable.cc index df49385d..e5d29725 100644 --- a/filters/kword/latex/export/listtable.cc +++ b/filters/kword/latex/export/listtable.cc @@ -35,13 +35,13 @@ ListTable::ListTable() /*******************************************/ ListTable::~ListTable() { - /* Just call the parent destructor */ + /* Just call the tqparent destructor */ } /*******************************************/ /* IsNewTable */ /*******************************************/ -Table* ListTable::isNewTable(QString grpMgr) +Table* ListTable::isNewTable(TQString grpMgr) { Table *current = 0; diff --git a/filters/kword/latex/export/listtable.h b/filters/kword/latex/export/listtable.h index 7a307fe8..01009f7d 100644 --- a/filters/kword/latex/export/listtable.h +++ b/filters/kword/latex/export/listtable.h @@ -25,10 +25,10 @@ #include "table.h" /** - * This class hold a list of tables. It just a wrapper for \verbatim QPtrList<Table> \endverbatim + * This class hold a list of tables. It just a wrapper for \verbatim TQPtrList<Table> \endverbatim * to add a frame in a table if the table exists else to create a new table. */ -class ListTable: public QPtrList<Table> +class ListTable: public TQPtrList<Table> { public: /** @@ -47,7 +47,7 @@ class ListTable: public QPtrList<Table> * Accessors */ - Table* isNewTable(QString); + Table* isNewTable(TQString); /** * Modifiers diff --git a/filters/kword/latex/export/para.cc b/filters/kword/latex/export/para.cc index 4fe645f9..6003a075 100644 --- a/filters/kword/latex/export/para.cc +++ b/filters/kword/latex/export/para.cc @@ -23,7 +23,7 @@ #include <kdebug.h> /* for kdDebug() stream */ #include "para.h" #include "textFrame.h" /* father class. */ -#include "format.h" /* children classes. */ +#include "format.h" /* tqchildren classes. */ //#include "picturezone.h" #include "fileheader.h" #include "textzone.h" @@ -32,7 +32,7 @@ #include "anchor.h" /* static data */ -QPtrStack<EType> Para::_historicList; +TQPtrStack<EType> Para::_historicList; int Para::_tabulation = 0; /*******************************************/ @@ -77,7 +77,7 @@ SSect Para::getFrameType() const /* To know if the zone is a textzone, a */ /* footnote, a picture, a variable. */ /*******************************************/ -EFormat Para::getTypeFormat(const QDomNode balise) const +EFormat Para::getTypeFormat(const TQDomNode balise) const { //<FORMAT id="1" ...> @@ -126,13 +126,13 @@ int Para::getNbCharPara() const /*******************************************/ /* Analyse */ /*******************************************/ -void Para::analyse(const QDomNode balise) +void Para::analyse(const TQDomNode balise) { /* MARKUP TYPE : PARAGRAPH */ kdDebug(30522) << "**** PARAGRAPH ****" << endl; - /* Analyse of the children markups */ + /* Analyse of the tqchildren markups */ for(int index = 0; index < getNbChild(balise); index++) { if(getChildName(balise, index).compare("TEXT")== 0) @@ -174,11 +174,11 @@ void Para::analyse(const QDomNode balise) /* If a footnote have a name : it's a */ /* footnote/endnote. */ /*******************************************/ -void Para::analyseName(const QDomNode balise) +void Para::analyseName(const TQDomNode balise) { /* <NAME name="Footnote/Endnote_1"> */ - _name = new QString(getAttr(balise, "NAME")); + _name = new TQString(getAttr(balise, "NAME")); } /*******************************************/ @@ -187,7 +187,7 @@ void Para::analyseName(const QDomNode balise) /* Type of the parag. : if info is 1, it's */ /* a footnote/endnote (so it have a name). */ /*******************************************/ -void Para::analyseInfo(const QDomNode balise) +void Para::analyseInfo(const TQDomNode balise) { /* <INFO info="1"> */ @@ -200,7 +200,7 @@ void Para::analyseInfo(const QDomNode balise) /* There is a new page before this */ /* paragraph. */ /*******************************************/ -/*void Para::analyseBrk(const QDomNode balise) +/*void Para::analyseBrk(const TQDomNode balise) { //<NAME name="Footnote/Endnote_1"> @@ -210,12 +210,12 @@ void Para::analyseInfo(const QDomNode balise) /*******************************************/ /* AnalyseLayoutPara */ /*******************************************/ -/* Analyse the layout of a para. */ +/* Analyse the tqlayout of a para. */ /* For each format, keep the type (picture,*/ /* text, variable, footnote) and put the */ /* zone in a list. */ /*******************************************/ -void Para::analyseLayoutPara(const QDomNode balise) +void Para::analyseLayoutPara(const TQDomNode balise) { Format* zone = 0; @@ -233,7 +233,7 @@ void Para::analyseLayoutPara(const QDomNode balise) ((TextZone*) zone)->setLength(_currentPos - _text.length()); ((TextZone*) zone)->analyse(); if(_lines == 0) - _lines = new QPtrList<Format>; + _lines = new TQPtrList<Format>; /* add the text */ _lines->append(zone); _currentPos = _currentPos + ((TextZone*) zone)->getLength(); @@ -252,7 +252,7 @@ void Para::analyseLayoutPara(const QDomNode balise) /* keep the type (picture, text, variable,*/ /* footnote) and put the zone in a list. */ /*******************************************/ -void Para::analyseFormats(const QDomNode balise) +void Para::analyseFormats(const TQDomNode balise) { for(int index= 0; index < getNbChild(balise, "FORMAT"); index++) { @@ -273,7 +273,7 @@ void Para::analyseFormats(const QDomNode balise) /* keep the type (picture, text, variable,*/ /* footnote) and put the zone in a list. */ /*******************************************/ -void Para::analyseFormat(const QDomNode balise) +void Para::analyseFormat(const TQDomNode balise) { Format *zone = 0; Format *zoneFirst = 0; @@ -291,7 +291,7 @@ void Para::analyseFormat(const QDomNode balise) if(zone->getPos() != _currentPos) { if(_lines == 0) - _lines = new QPtrList<Format>; + _lines = new TQPtrList<Format>; /* Create first a default format */ zoneFirst = new TextZone(_text, this); zoneFirst->setPos(_currentPos); @@ -327,7 +327,7 @@ void Para::analyseFormat(const QDomNode balise) if(zone->getPos() != _currentPos) { if(_lines == 0) - _lines = new QPtrList<Format>; + _lines = new TQPtrList<Format>; /* Create first a default format */ zoneFirst = new TextZone(_text, this); zoneFirst->setPos(_currentPos); @@ -342,7 +342,7 @@ void Para::analyseFormat(const QDomNode balise) if(zone != 0) { if(_lines == 0) - _lines = new QPtrList<Format>; + _lines = new TQPtrList<Format>; /* add the text */ _lines->append(zone); @@ -356,7 +356,7 @@ void Para::analyseFormat(const QDomNode balise) /* Generate each text zone with the parag. */ /* markup. */ /*******************************************/ -void Para::generate(QTextStream &out) +void Para::generate(TQTextStream &out) { kdDebug(30522) << " GENERATION PARA" << endl; @@ -406,7 +406,7 @@ void Para::generate(QTextStream &out) /*******************************************/ /* Generate the begining paragraph markup. */ /*******************************************/ -void Para::generateDebut(QTextStream &out) +void Para::generateDebut(TQTextStream &out) { /* Be careful we are in a table ! * You can't use directly environment, ... @@ -444,7 +444,7 @@ void Para::generateDebut(QTextStream &out) Config::instance()->writeIndent(out); } -void Para::generateBeginEnv(QTextStream &out) +void Para::generateBeginEnv(TQTextStream &out) { kdDebug(30522) << "Begin new Env : " << getEnv() << endl; @@ -473,7 +473,7 @@ void Para::generateBeginEnv(QTextStream &out) /* Generate the markup to begin a list and */ /* push the type in the historic stack. */ /*******************************************/ -void Para::openList(QTextStream &out) +void Para::openList(TQTextStream &out) { EType *type_temp = 0; @@ -530,7 +530,7 @@ void Para::openList(QTextStream &out) /*******************************************/ /* Generate the closing paragraph markup. */ /*******************************************/ -void Para::generateFin(QTextStream &out) +void Para::generateFin(TQTextStream &out) { /* Close a title of chapter */ if(isChapter()) @@ -542,7 +542,7 @@ void Para::generateFin(QTextStream &out) /*******************************************/ /* Generate the closing environment markup.*/ /*******************************************/ -void Para::generateEndEnv(QTextStream &out) +void Para::generateEndEnv(TQTextStream &out) { kdDebug(30522) << "end of an environment : " << getEnv() << endl; @@ -581,7 +581,7 @@ void Para::generateEndEnv(QTextStream &out) /* list type (letter, custom, ...) and */ /* remove the last list saved. */ /*******************************************/ -void Para::closeList(QTextStream &out, Para* next) +void Para::closeList(TQTextStream &out, Para* next) { closeList(getCounterType(), out); @@ -608,7 +608,7 @@ void Para::closeList(QTextStream &out, Para* next) /* list type (letter, custom, ...) and */ /* remove the last list saved. */ /*******************************************/ -void Para::closeList(EType type, QTextStream &out) +void Para::closeList(EType type, TQTextStream &out) { //out << endl; kdDebug(30522) << " type list to close : " << type << endl; @@ -654,7 +654,7 @@ void Para::closeList(EType type, QTextStream &out) /*******************************************/ /* GenerateTitle */ /*******************************************/ -void Para::generateTitle(QTextStream &out) +void Para::generateTitle(TQTextStream &out) { switch(getCounterDepth()) { diff --git a/filters/kword/latex/export/para.h b/filters/kword/latex/export/para.h index c5f40520..75c41b3a 100644 --- a/filters/kword/latex/export/para.h +++ b/filters/kword/latex/export/para.h @@ -22,11 +22,11 @@ #ifndef __KWORD_PARA_H__ #define __KWORD_PARA_H__ -#include <qstring.h> -#include <qptrstack.h> /* historic list */ -#include <qptrlist.h> /* for list of format */ +#include <tqstring.h> +#include <tqptrstack.h> /* historic list */ +#include <tqptrlist.h> /* for list of format */ -/*#include "listeformat.h"*/ /* children class contents the zone (italic, footnote, +/*#include "listeformat.h"*/ /* tqchildren class contents the zone (italic, footnote, variable. */ #include "layout.h" /* set of informations about the paragraph style. */ #include "element.h" /* to use the father class. */ @@ -58,18 +58,18 @@ class TextFrame; class Para: public Layout { /* MARKUP DATA */ - QString _text; - QString* _name; + TQString _text; + TQString* _name; EP_INFO _info; //EP_HARDBRK _hardbrk; - QPtrList<Format>* _lines; + TQPtrList<Format>* _lines; /* TO MANAGE THE LIST */ /* USEFULL DATA */ TextFrame* _element; /* Father frame */ unsigned int _currentPos; /* Begining of the text to use the good format */ - static QPtrStack<EType> _historicList; /* opened lists but not closed */ + static TQPtrStack<EType> _historicList; /* opened lists but not closed */ int _nbLines; /* Nb of lines in a cell (table) */ static int _tabulation; /* Size of the para tabulation (for lists). */ @@ -107,7 +107,7 @@ class Para: public Layout /** * @return the paragraph's name. */ - QString* getName () const { return _name; } + TQString* getName () const { return _name; } /** * @return the paragraph's type (contents or footnote). */ @@ -123,7 +123,7 @@ class Para: public Layout /** * @return the next format type (picture, text, variable, footnote). */ - EFormat getTypeFormat(const QDomNode) const; + EFormat getTypeFormat(const TQDomNode) const; /** * @return count the number of characters in the paragraph. */ @@ -143,57 +143,57 @@ class Para: public Layout /** * Get informations from a markup tree. */ - void analyse (const QDomNode); + void analyse (const TQDomNode); /** * Write the paragraph in a file. */ - void generate (QTextStream&); + void generate (TQTextStream&); /** * If the paragraph has a different environment, change it */ - void generateBeginEnv(QTextStream&); + void generateBeginEnv(TQTextStream&); /** * If the next paragraph has a different environment, close it */ - void generateEndEnv(QTextStream&); + void generateEndEnv(TQTextStream&); /** * If the paragraph is a title, generate the command. */ - void generateTitle (QTextStream&); + void generateTitle (TQTextStream&); /** * Write the markup to begin a list */ - void openList (QTextStream&); + void openList (TQTextStream&); /** * Write the markup to close a list */ - void closeList (QTextStream&, Para*); + void closeList (TQTextStream&, Para*); private: - void analyseParam (const QDomNode); - void analyseName (const QDomNode); - void analyseInfo (const QDomNode); - //void analyseBrk (const QDomNode); - void analyseLayoutPara(const QDomNode); - void analyseFormat (const QDomNode); - void analyseFormats (const QDomNode); + void analyseParam (const TQDomNode); + void analyseName (const TQDomNode); + void analyseInfo (const TQDomNode); + //void analyseBrk (const TQDomNode); + void analyseLayoutPara(const TQDomNode); + void analyseFormat (const TQDomNode); + void analyseFormats (const TQDomNode); /** * Write the paragraph style, format. */ - void generateDebut (QTextStream&); - void generateFin (QTextStream&); + void generateDebut (TQTextStream&); + void generateFin (TQTextStream&); /** * Write the markup to close a list */ - void closeList (EType, QTextStream&); + void closeList (EType, TQTextStream&); }; diff --git a/filters/kword/latex/export/pixmapFrame.cc b/filters/kword/latex/export/pixmapFrame.cc index 7a34a77c..bbd0430b 100644 --- a/filters/kword/latex/export/pixmapFrame.cc +++ b/filters/kword/latex/export/pixmapFrame.cc @@ -19,7 +19,7 @@ ** */ -#include <qdir.h> +#include <tqdir.h> #include <kdebug.h> /* for kdDebug() stream */ #include <config.h> /* Needed to convert picture in eps file. Use ImageMagick. */ @@ -48,7 +48,7 @@ PixmapFrame::~PixmapFrame() { kdDebug(30522) << "Destruction of a pixmap" << endl; } -void PixmapFrame::setKeepAspectRatio(const QString ratio) +void PixmapFrame::setKeepAspectRatio(const TQString ratio) { if(ratio == "true") _keepAspectRatio = true; @@ -62,7 +62,7 @@ void PixmapFrame::setKeepAspectRatio(const QString ratio) /* Get informations about a pixmap stored */ /* in the tared file. */ /*******************************************/ -void PixmapFrame::analyse(const QDomNode balise) +void PixmapFrame::analyse(const TQDomNode balise) { /* MARKUP TYPE : FRAMESET INFO = TEXTE, ENTETE CONNUE */ @@ -93,16 +93,16 @@ void PixmapFrame::analyse(const QDomNode balise) /* Get informations about a pixmap stored */ /* in the tared file. */ /*******************************************/ -void PixmapFrame::getPixmap(const QDomNode balise_initiale) +void PixmapFrame::getPixmap(const TQDomNode balise_initiale) { kdDebug(30522) << "PIXMAP" << endl; setKeepAspectRatio(getAttr(balise_initiale, "keepAspectRatio")); - QDomNode balise = getChild(balise_initiale, "KEY"); + TQDomNode balise = getChild(balise_initiale, "KEY"); setKey(getAttr(balise, "filename")); FileHeader::instance()->useGraphics(); - QString file = getKey(); + TQString file = getKey(); /* Remove the extension */ - int posExt = file.findRev('.'); + int posExt = file.tqfindRev('.'); file.truncate(posExt); /* Remove the path */ file = file.section('/', -1); @@ -114,7 +114,7 @@ void PixmapFrame::getPixmap(const QDomNode balise_initiale) /*******************************************/ /* analyseParamFrame */ /*******************************************/ -void PixmapFrame::analyseParamFrame(const QDomNode balise) +void PixmapFrame::analyseParamFrame(const TQDomNode balise) { /*<FRAME left="28" top="42" right="566" bottom="798" runaround="1" />*/ @@ -150,7 +150,7 @@ void PixmapFrame::convert() GetExceptionInfo(&exception); image_info = CloneImageInfo((ImageInfo *) NULL); // 8 characters are deleted when readign the file picture name - QString filename = "file:///" + getRoot()->extractData(getKey()); + TQString filename = "file:///" + getRoot()->extractData(getKey()); strncpy(image_info->filename, filename.latin1(), filename.length()); image = ReadImage(image_info, &exception); if (image == (Image *) NULL) @@ -161,12 +161,12 @@ void PixmapFrame::convert() Write the image as EPS and destroy it. Copy image file in the same directory than the tex file. */ - QString dir = ""; + TQString dir = ""; if( Config::instance()->getPicturesDir().isEmpty() || Config::instance()->getPicturesDir() == NULL) { dir = getFilename(); - dir.truncate(getFilename().findRev('/')); + dir.truncate(getFilename().tqfindRev('/')); } else dir = Config::instance()->getPicturesDir(); @@ -188,7 +188,7 @@ void PixmapFrame::convert() /*******************************************/ /* Generate the text formated (if needed). */ /*******************************************/ -void PixmapFrame::generate(QTextStream &out) +void PixmapFrame::generate(TQTextStream &out) { if(Config::instance()->convertPictures()) convert(); diff --git a/filters/kword/latex/export/pixmapFrame.h b/filters/kword/latex/export/pixmapFrame.h index 9095138e..01e5c642 100644 --- a/filters/kword/latex/export/pixmapFrame.h +++ b/filters/kword/latex/export/pixmapFrame.h @@ -51,12 +51,12 @@ class PixmapFrame : public Element bool _keepAspectRatio; /* TEXT MARKUP */ - QString _key; - QString _filenamePS; + TQString _key; + TQString _filenamePS; public: PixmapFrame(); - PixmapFrame(QString, QString); + PixmapFrame(TQString, TQString); virtual ~PixmapFrame(); /** @@ -68,9 +68,9 @@ class PixmapFrame : public Element TNFrame getNewFrame () const { return _newFrameBehaviour; } TSide getSheetSide () const { return _sheetSide; } - void getPixmap(QDomNode); - QString getKey () const { return _key; } - QString getFilenamePS() const { return _filenamePS; } + void getPixmap(TQDomNode); + TQString getKey () const { return _key; } + TQString getFilenamePS() const { return _filenamePS; } /** * Modifiers @@ -80,23 +80,23 @@ class PixmapFrame : public Element void setAutoCreate(const int a) { _autoCreate = (TCreate) a; } void setNewFrame (const int n) { _newFrameBehaviour = (TNFrame) n; } void setSheetSide (const int s) { _sheetSide = (TSide) s; } - void setKeepAspectRatio(const QString); + void setKeepAspectRatio(const TQString); - void setKey (QString k) { _key = k; } - void setFilenamePS (QString f) { _filenamePS = f; } + void setKey (TQString k) { _key = k; } + void setFilenamePS (TQString f) { _filenamePS = f; } /** * Helpfull functions */ - void analyse(const QDomNode); + void analyse(const TQDomNode); void convert(); - void generate(QTextStream&); - /*void generate_format_begin(QTextStream &); - void generate_format_end(QTextStream &);*/ + void generate(TQTextStream&); + /*void generate_format_begin(TQTextStream &); + void generate_format_end(TQTextStream &);*/ private: - void analyseParamFrame(const QDomNode); + void analyseParamFrame(const TQDomNode); }; #endif /* __KWORD_LATEX_EXPORT_PIXMAPFRAME_H__ */ diff --git a/filters/kword/latex/export/table.cc b/filters/kword/latex/export/table.cc index 7d6567fa..90fdc378 100644 --- a/filters/kword/latex/export/table.cc +++ b/filters/kword/latex/export/table.cc @@ -20,7 +20,7 @@ */ #include <kdebug.h> /* for kdDebug stream */ -#include <qbitarray.h> +#include <tqbitarray.h> #include "listtable.h" #include "textFrame.h" @@ -33,7 +33,7 @@ Table::Table() setMaxRow(0); } -Table::Table(QString grpMgr) +Table::Table(TQString grpMgr) { setGrpMgr(grpMgr); setMaxCol(0); @@ -113,13 +113,13 @@ void Table::append(Element* elt) if(elt->getCol() > getMaxCol()) setMaxCol(elt->getCol()); - QPtrList<Element>::append(elt); + TQPtrList<Element>::append(elt); } /*******************************************/ /* generate */ /*******************************************/ -void Table::generate(QTextStream& out) +void Table::generate(TQTextStream& out) { Element* elt = 0; kdDebug(30522) << "GENERATION OF A TABLE " << count() << endl; @@ -166,10 +166,10 @@ void Table::generate(QTextStream& out) /*******************************************/ /* generateTopLineBorder */ /*******************************************/ -void Table::generateTopLineBorder(QTextStream& out, int row) +void Table::generateTopLineBorder(TQTextStream& out, int row) { Element* elt = 0; - QBitArray border(getMaxCol()); + TQBitArray border(getMaxCol()); bool fullLine = true; for(int index = 0; index <= getMaxCol(); index++) @@ -220,10 +220,10 @@ void Table::generateTopLineBorder(QTextStream& out, int row) /*******************************************/ /* generateBottomLineBorder */ /*******************************************/ -void Table::generateBottomLineBorder(QTextStream& out, int row) +void Table::generateBottomLineBorder(TQTextStream& out, int row) { Element* elt = 0; - QBitArray border(getMaxCol()); + TQBitArray border(getMaxCol()); bool fullLine = true; for(int index = 0; index <= getMaxCol(); index++) @@ -273,7 +273,7 @@ void Table::generateBottomLineBorder(QTextStream& out, int row) /*******************************************/ /* generateCell */ /*******************************************/ -void Table::generateCell(QTextStream& out, int row, int col) +void Table::generateCell(TQTextStream& out, int row, int col) { Element* elt = 0; @@ -291,7 +291,7 @@ void Table::generateCell(QTextStream& out, int row, int col) /*******************************************/ /* generateTableHeader */ /*******************************************/ -void Table::generateTableHeader(QTextStream& out) +void Table::generateTableHeader(TQTextStream& out) { Element* elt = 0; bool fullRightBorder = true; diff --git a/filters/kword/latex/export/table.h b/filters/kword/latex/export/table.h index 5ad1ba4e..a0a9ff32 100644 --- a/filters/kword/latex/export/table.h +++ b/filters/kword/latex/export/table.h @@ -23,8 +23,8 @@ #ifndef __KWORD_TABLE_H__ #define __KWORD_TABLE_H__ -#include <qstring.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqptrlist.h> #include "element.h" /* Child class */ #include "layout.h" /* Cell flow */ @@ -37,11 +37,11 @@ * frame, ...). It use a special latex package. * The color table of the tables is not yet supported. */ -class Table: public QPtrList<Element>, public Element +class Table: public TQPtrList<Element>, public Element { /* MARKUP DATA */ - //QString _name; - //QString _grpMgr; + //TQString _name; + //TQString _grpMgr; /* USEFULL DATA */ int _maxRow, _maxCol; /* Size of the table (nb of cell) */ @@ -61,7 +61,7 @@ class Table: public QPtrList<Element>, public Element * * @param grpMng The group manager. */ - Table(QString grpMng); + Table(TQString grpMng); /* * Destructor @@ -75,8 +75,8 @@ class Table: public QPtrList<Element>, public Element * Accessors */ - //QString getName () const { return _name; } - //QString getGrpMgr() const { return _grpMgr; } + //TQString getName () const { return _name; } + //TQString getGrpMgr() const { return _grpMgr; } int getMaxRow() const { return _maxRow; } int getMaxCol() const { return _maxCol; } @@ -94,13 +94,13 @@ class Table: public QPtrList<Element>, public Element */ Element* searchCell(int, int); void append (Element*); - void generate (QTextStream&); + void generate (TQTextStream&); private: - void generateCell(QTextStream&, int, int); - void generateTableHeader(QTextStream&); - void generateTopLineBorder(QTextStream&, int); - void generateBottomLineBorder(QTextStream&, int); + void generateCell(TQTextStream&, int, int); + void generateTableHeader(TQTextStream&); + void generateTopLineBorder(TQTextStream&, int); + void generateBottomLineBorder(TQTextStream&, int); }; #endif /* __KWORD_TABLE_H__ */ diff --git a/filters/kword/latex/export/texlauncher.cc b/filters/kword/latex/export/texlauncher.cc index e55b16d7..b67a7385 100644 --- a/filters/kword/latex/export/texlauncher.cc +++ b/filters/kword/latex/export/texlauncher.cc @@ -6,7 +6,7 @@ #include <klocale.h> #include <KoFilter.h> #include <KoStore.h> -#include<qtextstream.h> +#include<tqtextstream.h> int main(int argc, char* argv[]) @@ -14,8 +14,8 @@ int main(int argc, char* argv[]) kdDebug(30522) << argv[1] << endl; kdDebug(30522) << argv[2] << endl; - QString fileIn = argv[1]; - QString fileOut = argv[2]; + TQString fileIn = argv[1]; + TQString fileOut = argv[2]; kdDebug(30522) << "TEXGRAPH FILTER --> BEGIN" << endl; Xml2LatexParser parser(fileIn, fileOut); diff --git a/filters/kword/latex/export/textFrame.cc b/filters/kword/latex/export/textFrame.cc index 9d6599ba..cdcbba6a 100644 --- a/filters/kword/latex/export/textFrame.cc +++ b/filters/kword/latex/export/textFrame.cc @@ -45,11 +45,11 @@ TextFrame::TextFrame() /*******************************************/ /* searchFootnote */ /*******************************************/ -/*Para* TextFrame::searchFootnote(const QString name) +/*Para* TextFrame::searchFootnote(const TQString name) { for(Para* current = _footnotes.first(); current!= 0; current = _footnotes.next()) { - QString* string = current->getName(); + TQString* string = current->getName(); kdDebug(30522) << *string << endl; if(*string == name) return current; @@ -61,7 +61,7 @@ TextFrame::TextFrame() /*******************************************/ /* analyse */ /*******************************************/ -void TextFrame::analyse(const QDomNode balise) +void TextFrame::analyse(const TQDomNode balise) { /* MARKUP TYPE : FRAMESET INFO = TEXTE, ENTETE CONNUE */ @@ -103,7 +103,7 @@ void TextFrame::analyse(const QDomNode balise) /*******************************************/ /* analyseParamFrame */ /*******************************************/ -void TextFrame::analyseParamFrame(const QDomNode balise) +void TextFrame::analyseParamFrame(const TQDomNode balise) { /*<FRAME left="28" top="42" right="566" bottom="798" runaround="1" />*/ setLeft(getAttr(balise, "left").toDouble()); @@ -169,7 +169,7 @@ void TextFrame::analyseParamFrame(const QDomNode balise) /*******************************************/ /* generate */ /*******************************************/ -void TextFrame::generate(QTextStream &out) +void TextFrame::generate(TQTextStream &out) { Para * lastPara = 0; @@ -217,7 +217,7 @@ void TextFrame::generate(QTextStream &out) lastPara->closeList(out, currentPara); _lastTypeEnum = TL_NONE; } - /* layout management (left, center, justify, right) */ + /* tqlayout management (left, center, justify, right) */ if((!lastPara->isChapter() && _lastEnv != getNextEnv(_parags, _parags.at()) && lastPara->notEmpty()) || _lastEnv != getNextEnv(_parags, _parags.at())) @@ -238,7 +238,7 @@ void TextFrame::generate(QTextStream &out) } } -EEnv TextFrame::getNextEnv(QPtrList<Para> liste, const int pos) +EEnv TextFrame::getNextEnv(TQPtrList<Para> liste, const int pos) { if ( pos < 0 ) return ENV_NONE; diff --git a/filters/kword/latex/export/textFrame.h b/filters/kword/latex/export/textFrame.h index b43650c0..da51b7f2 100644 --- a/filters/kword/latex/export/textFrame.h +++ b/filters/kword/latex/export/textFrame.h @@ -23,7 +23,7 @@ #ifndef __KWORD_LATEX_FRAMETEXT_H__ #define __KWORD_LATEX_FRAMETEXT_H__ -#include <qptrlist.h> +#include <tqptrlist.h> #include "element.h" //#include "border.h" #include "para.h" @@ -50,8 +50,8 @@ class TextFrame: public Element TSide _sheetSide; /* CHILD MARKUP */ - QPtrList<Para> _parags; - //QPtrList<Para> _footnotes; + TQPtrList<Para> _parags; + //TQPtrList<Para> _footnotes; /* USEFULL DATA */ EEnv _lastEnv; @@ -92,7 +92,7 @@ class TextFrame: public Element TNFrame getNewFrame () const { return _newFrameBehaviour; } TSide getSheetSide () const { return _sheetSide; } Para* getFirstPara () const { return _parags.getFirst(); } - EEnv getNextEnv (QPtrList<Para>, const int); + EEnv getNextEnv (TQPtrList<Para>, const int); bool isBeginEnum (Para*, Para*); bool isCloseEnum (Para*, Para*); @@ -110,24 +110,24 @@ class TextFrame: public Element void setNewFrame (const int n) { _newFrameBehaviour = (TNFrame) n; } void setSheetSide (const int s) { _sheetSide = (TSide) s; } - //Para* searchFootnote(const QString); + //Para* searchFootnote(const TQString); /** * Get informations from a markup tree. */ - void analyse(const QDomNode); + void analyse(const TQDomNode); /** * Write the text in a file. */ - void generate(QTextStream&); + void generate(TQTextStream&); private: /** * Get informations from a markup tree (only parameters * in a frame. */ - void analyseParamFrame(const QDomNode); + void analyseParamFrame(const TQDomNode); }; diff --git a/filters/kword/latex/export/textformat.cc b/filters/kword/latex/export/textformat.cc index 74ec905e..02576354 100644 --- a/filters/kword/latex/export/textformat.cc +++ b/filters/kword/latex/export/textformat.cc @@ -86,7 +86,7 @@ int TextFormat::getBkColorRed () const void TextFormat::setColor (const int r, const int g, const int b) { if(_textcolor == 0) - _textcolor = new QColor(r, g, b); + _textcolor = new TQColor(r, g, b); else _textcolor->setRgb(r, g, b); } @@ -97,7 +97,7 @@ void TextFormat::setColor (const int r, const int g, const int b) void TextFormat::setBkColor (const int r, const int g, const int b) { if(_backcolor == 0) - _backcolor = new QColor(r, g, b); + _backcolor = new TQColor(r, g, b); else _backcolor->setRgb(r, g, b); } @@ -107,7 +107,7 @@ void TextFormat::setBkColor (const int r, const int g, const int b) /*******************************************/ /* Get the set of info. about a text format*/ /*******************************************/ -void TextFormat::analyseFormat(const QDomNode balise) +void TextFormat::analyseFormat(const TQDomNode balise) { /* MARKUPS FORMAT id="1" pos="0" len="17">...</FORMAT> */ @@ -138,7 +138,7 @@ void TextFormat::analyseFormat(const QDomNode balise) kdDebug(30522) << "END OF A FORMAT" << endl; } -void TextFormat::analyseBackgroundColor(const QDomNode balise) +void TextFormat::analyseBackgroundColor(const TQDomNode balise) { /* <TEXTBACKGROUNDCOLOR red="0" green="0" blue="0"/> */ int red = 0, @@ -163,7 +163,7 @@ void TextFormat::analyseBackgroundColor(const QDomNode balise) /*******************************************/ /* Get the zone where the format is applied*/ /*******************************************/ -void TextFormat::analyseParam(const QDomNode balise) +void TextFormat::analyseParam(const TQDomNode balise) { /* <FORMAT id="1" pos="0" len="17"> */ @@ -178,7 +178,7 @@ void TextFormat::analyseParam(const QDomNode balise) /*******************************************/ /* Get the text font! */ /*******************************************/ -void TextFormat::analyseFont(const QDomNode balise) +void TextFormat::analyseFont(const TQDomNode balise) { /* <FONT name="times"> */ setPolice(getAttr(balise, "name")); @@ -189,7 +189,7 @@ void TextFormat::analyseFont(const QDomNode balise) /*******************************************/ /* Verify if it's a italic text. */ /*******************************************/ -void TextFormat::analyseItalic(const QDomNode balise) +void TextFormat::analyseItalic(const TQDomNode balise) { /* <ITALIC value="1"> */ setItalic(getAttr(balise, "value").toInt()); @@ -200,7 +200,7 @@ void TextFormat::analyseItalic(const QDomNode balise) /*******************************************/ /* Verify if it's a underlined text. */ /*******************************************/ -void TextFormat::analyseUnderlined(const QDomNode balise) +void TextFormat::analyseUnderlined(const TQDomNode balise) { /* <UNDERLINE value="1"> */ @@ -215,7 +215,7 @@ void TextFormat::analyseUnderlined(const QDomNode balise) /*******************************************/ /* Verify if it's a strikeout text. */ /*******************************************/ -void TextFormat::analyseStrikeout(const QDomNode balise) +void TextFormat::analyseStrikeout(const TQDomNode balise) { /* <STRIKEOUT value="1" /> */ setStrikeout(getAttr(balise, "value").toInt()); @@ -229,7 +229,7 @@ void TextFormat::analyseStrikeout(const QDomNode balise) /*******************************************/ /* Get the text weigth. */ /*******************************************/ -void TextFormat::analyseWeight(const QDomNode balise) +void TextFormat::analyseWeight(const TQDomNode balise) { /* <WEIGHT value="75" /> */ setWeight(getAttr(balise, "value").toInt()); @@ -241,7 +241,7 @@ void TextFormat::analyseWeight(const QDomNode balise) /*******************************************/ /* Get the text align. */ /*******************************************/ -void TextFormat::analyseAlign(const QDomNode balise) +void TextFormat::analyseAlign(const TQDomNode balise) { /* <VERTALIGN value="0"> */ @@ -253,7 +253,7 @@ void TextFormat::analyseAlign(const QDomNode balise) /*******************************************/ /* Get the text color. */ /*******************************************/ -void TextFormat::analyseColor(const QDomNode balise) +void TextFormat::analyseColor(const TQDomNode balise) { /* <COLOR red="0" green="0" blue="0"/> */ int red = 0, @@ -278,7 +278,7 @@ void TextFormat::analyseColor(const QDomNode balise) /*******************************************/ /* Get the text size. */ /*******************************************/ -void TextFormat::analyseSize(const QDomNode balise) +void TextFormat::analyseSize(const TQDomNode balise) { /* <SIZE value="11"> */ setSize(getAttr(balise, "value").toInt()); diff --git a/filters/kword/latex/export/textformat.h b/filters/kword/latex/export/textformat.h index defc5925..e982fc08 100644 --- a/filters/kword/latex/export/textformat.h +++ b/filters/kword/latex/export/textformat.h @@ -23,8 +23,8 @@ #ifndef __KWORD_TEXTFORMAT_H__ #define __KWORD_TEXTFORMAT_H__ -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> #include "format.h" enum _EAlign @@ -68,15 +68,15 @@ typedef enum _ETypeLinespacing ETypeLinespacing; */ class TextFormat: public Format { - QString _police; + TQString _police; unsigned int _size; /* Size of the police */ unsigned int _weight; /* bold */ bool _italic; ETypeUnderline _underline; bool _strikeout; EAlign _vertalign; - QColor* _textcolor; - QColor* _backcolor; + TQColor* _textcolor; + TQColor* _backcolor; ETypeLinespacing _linespacingType; int _spacingValue; @@ -130,7 +130,7 @@ class TextFormat: public Format void setWeight (const unsigned int w) { _weight = w; } void setItalic (bool i) { _italic = i; } void setUnderlined (ETypeUnderline u) { _underline = u; } - void setUnderlined (QString u) + void setUnderlined (TQString u) { if(u == "double") _underline = UNDERLINE_DOUBLE; @@ -142,23 +142,23 @@ class TextFormat: public Format _underline = UNDERLINE_NONE; } void setStrikeout (bool s) { _strikeout = s; } - void setPolice (QString p) { _police = p; } + void setPolice (TQString p) { _police = p; } void setAlign (const int a) { _vertalign = (EAlign) a; } void setColor (const int, const int, const int); void setBkColor (const int, const int, const int); /* ==== Helpfull functions ==== */ - void analyseFormat (const QDomNode); - void analyseParam (const QDomNode); - void analyseFont (const QDomNode); - void analyseItalic (const QDomNode); - void analyseUnderlined(const QDomNode); - void analyseStrikeout (const QDomNode); - void analyseWeight (const QDomNode); - void analyseAlign (const QDomNode); - void analyseColor (const QDomNode); - void analyseSize (const QDomNode); - void analyseBackgroundColor(const QDomNode); + void analyseFormat (const TQDomNode); + void analyseParam (const TQDomNode); + void analyseFont (const TQDomNode); + void analyseItalic (const TQDomNode); + void analyseUnderlined(const TQDomNode); + void analyseStrikeout (const TQDomNode); + void analyseWeight (const TQDomNode); + void analyseAlign (const TQDomNode); + void analyseColor (const TQDomNode); + void analyseSize (const TQDomNode); + void analyseBackgroundColor(const TQDomNode); }; #endif /* __KWORD_TEXTFORMAT_H__ */ diff --git a/filters/kword/latex/export/textzone.cc b/filters/kword/latex/export/textzone.cc index 5495de5d..476babb3 100644 --- a/filters/kword/latex/export/textzone.cc +++ b/filters/kword/latex/export/textzone.cc @@ -1,4 +1,4 @@ -/* MEMO: to see the unicode table +/* MEMO: to see the tqunicode table * xset +fp /usr/X11R6/lib/X11/fonts/ucs/ * xfd -fn '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1' */ @@ -24,7 +24,7 @@ */ #include <kdebug.h> /* for kdDebug() stream */ -#include <qregexp.h> /* for QRegExp() --> escapeLatin1 */ +#include <tqregexp.h> /* for TQRegExp() --> escapeLatin1 */ #include "textzone.h" #include "para.h" @@ -50,7 +50,7 @@ TextZone::TextZone(Para *para) /*******************************************/ /* TextZone */ /*******************************************/ -TextZone::TextZone(QString texte, Para *para): _texte(texte) +TextZone::TextZone(TQString texte, Para *para): _texte(texte) { setPara(para); if(para != NULL) @@ -85,10 +85,10 @@ bool TextZone::useFormat() const /*******************************************/ /* escapeLatin1 */ /*******************************************/ -/* Convert special caracters (unicode) in */ +/* Convert special caracters (tqunicode) in */ /* latex usable caracters. */ /*******************************************/ -QString TextZone::escapeLatin1(QString text) +TQString TextZone::escapeLatin1(TQString text) { static const char *escapes[64] = { @@ -113,8 +113,8 @@ QString TextZone::escapeLatin1(QString text) "\\\"{u}", "\\'{y}", "\\th{}", "\\\"{y}" }; - QString escapedText; - int unicode; /* the character to be escaped */ + TQString escapedText; + int tqunicode; /* the character to be escaped */ escapedText = text; /* copy input text */ @@ -185,8 +185,8 @@ QString TextZone::escapeLatin1(QString text) for(int index = 0; index < 64; index++) { - unicode = CSTART + index; - convert(escapedText, unicode, escapes[index]); + tqunicode = CSTART + index; + convert(escapedText, tqunicode, escapes[index]); } convert(escapedText, 0X2020, "\\textdied{}"); /* textcomp */ @@ -259,17 +259,17 @@ QString TextZone::escapeLatin1(QString text) /* Convert all the instance of one */ /* character in latex usable caracter. */ /*******************************************/ -void TextZone::convert(QString& text, int unicode, const char* escape) +void TextZone::convert(TQString& text, int tqunicode, const char* escape) { - QString expression; - QString value; + TQString expression; + TQString value; - expression = QString("\\x") + value.setNum(unicode, 16); + expression = TQString("\\x") + value.setNum(tqunicode, 16); - if( !QString(escape).isEmpty() ) + if( !TQString(escape).isEmpty() ) { /*1. translate special characters with a space after. */ - text = text.replace( QRegExp( expression), QString(escape)); + text = text.tqreplace( TQRegExp( expression), TQString(escape)); } } @@ -279,7 +279,7 @@ void TextZone::convert(QString& text, int unicode, const char* escape) /* Analyse a text format, get the text used*/ /* by this format. */ /*******************************************/ -void TextZone::analyse(const QDomNode balise) +void TextZone::analyse(const TQDomNode balise) { kdDebug(30522) << "FORMAT" << endl; /* Get header information (size, position) @@ -319,7 +319,7 @@ void TextZone::analyse() /*******************************************/ /* Generate the text formated (if needed). */ /*******************************************/ -void TextZone::generate(QTextStream &out) +void TextZone::generate(TQTextStream &out) { if(useFormat()) @@ -343,11 +343,11 @@ void TextZone::generate(QTextStream &out) /* Trunc the text in about 80 caracters of */ /* width except if there are not spaces. */ /*******************************************/ -void TextZone::display(QString texte, QTextStream& out) +void TextZone::display(TQString texte, TQTextStream& out) { - QString line; + TQString line; int index = 0, end = 0; - end = texte.find(' ', 60, false); + end = texte.tqfind(' ', 60, false); if(end != -1) line = texte.mid(index, end - index); else @@ -361,7 +361,7 @@ void TextZone::display(QString texte, QTextStream& out) out << line << endl; Config::instance()->writeIndent(out); index = end; - end = texte.find(' ', index + 60, false); + end = texte.tqfind(' ', index + 60, false); line = texte.mid(index, end - index); } kdDebug(30522) << line << endl; @@ -378,7 +378,7 @@ void TextZone::display(QString texte, QTextStream& out) /*******************************************/ /* Write the begining format markup. */ /*******************************************/ -void TextZone::generate_format_begin(QTextStream & out) +void TextZone::generate_format_begin(TQTextStream & out) { kdDebug(30522) << "GENERATE FORMAT BEGIN" << endl; @@ -451,7 +451,7 @@ void TextZone::generate_format_begin(QTextStream & out) /*******************************************/ /* Write the format end markup. */ /*******************************************/ -void TextZone::generate_format_end(QTextStream & out) +void TextZone::generate_format_end(TQTextStream & out) { kdDebug(30522) << "GENERATE FORMAT END" << endl; @@ -485,9 +485,9 @@ void TextZone::generate_format_end(QTextStream & out) out << "}"; } -QString convertSpecialChar(int c) +TQString convertSpecialChar(int c) { - QString output; + TQString output; switch(c) { diff --git a/filters/kword/latex/export/textzone.h b/filters/kword/latex/export/textzone.h index 21548c1d..a9f5ff07 100644 --- a/filters/kword/latex/export/textzone.h +++ b/filters/kword/latex/export/textzone.h @@ -26,8 +26,8 @@ #ifndef __KWORD_LATEX_TEXTZONE_H__ #define __KWORD_LATEX_TEXTZONE_H__ -#include <qtextstream.h> -#include <qstring.h> +#include <tqtextstream.h> +#include <tqstring.h> #include "textformat.h" /***********************************************************************/ @@ -40,7 +40,7 @@ class TextZone: public TextFormat { /* TEXT MARKUP */ - QString _texte; + TQString _texte; public: /* === Constructors ==== */ @@ -48,7 +48,7 @@ class TextZone: public TextFormat /** * Creates a new instance of TextZone. * - * @param para which is the parent class. + * @param para which is the tqparent class. */ TextZone(Para *para = 0); /** @@ -56,9 +56,9 @@ class TextZone: public TextFormat * Creates a new instance of TextZOne. * * @param text the text in this zone. - * @param para which is the parent class. + * @param para which is the tqparent class. */ - TextZone(QString text, Para *para = 0); + TextZone(TQString text, Para *para = 0); /* * Destructor @@ -72,37 +72,37 @@ class TextZone: public TextFormat * */ bool useFormat() const; - QString getTexte() const { return _texte; } + TQString getTexte() const { return _texte; } /* ==== Setters ==== */ - void setTexte(QString texte) { _texte = texte; } + void setTexte(TQString texte) { _texte = texte; } /* ==== Helpfull functions ==== */ /** - * convert a unicode text in latin1 enconding ala latex. + * convert a tqunicode text in latin1 enconding ala latex. */ - QString escapeLatin1(QString); + TQString escapeLatin1(TQString); - void analyse(const QDomNode); + void analyse(const TQDomNode); void analyse(); - virtual void generate(QTextStream&); + virtual void generate(TQTextStream&); - void generate_format_begin(QTextStream &); - void generate_format_end(QTextStream &); + void generate_format_begin(TQTextStream &); + void generate_format_end(TQTextStream &); protected: - void display(QString, QTextStream&); + void display(TQString, TQTextStream&); private: /** * convert a special character in a latex command. */ - void convert(QString&, int, const char*); + void convert(TQString&, int, const char*); }; -QString convertSpecialChar(int); +TQString convertSpecialChar(int); #endif /* __KWORD_LATEX_TEXTZONE_H__ */ diff --git a/filters/kword/latex/export/variableformat.cc b/filters/kword/latex/export/variableformat.cc index 32c7a39c..5c6f9f40 100644 --- a/filters/kword/latex/export/variableformat.cc +++ b/filters/kword/latex/export/variableformat.cc @@ -65,7 +65,7 @@ /*void VariableFormat::setColor (const int r, const int g, const int b) { if(_textcolor == 0) - _textcolor = new QColor(r, g, b); + _textcolor = new TQColor(r, g, b); else _textcolor->setRgb(r, g, b); }*/ @@ -75,7 +75,7 @@ /*******************************************/ /* Get the set of info. about a text format*/ /*******************************************/ -void VariableFormat::analyseFormat(const QDomNode balise) +void VariableFormat::analyseFormat(const TQDomNode balise) { /* MARKUPS FORMAT id="1" pos="0" len="17">...</FORMAT> */ @@ -116,7 +116,7 @@ void VariableFormat::analyseFormat(const QDomNode balise) /*******************************************/ /* Get the date. */ /*******************************************/ -void VariableFormat::analyseDate(const QDomNode balise) +void VariableFormat::analyseDate(const TQDomNode balise) { setDay(getAttr(balise, "day").toInt()); setMonth(getAttr(balise, "month").toInt()); @@ -129,7 +129,7 @@ void VariableFormat::analyseDate(const QDomNode balise) /*******************************************/ /* Get the time. */ /*******************************************/ -void VariableFormat::analyseTime(const QDomNode balise) +void VariableFormat::analyseTime(const TQDomNode balise) { setHour(getAttr(balise, "day").toInt()); setMinute(getAttr(balise, "month").toInt()); @@ -137,7 +137,7 @@ void VariableFormat::analyseTime(const QDomNode balise) setFix(getAttr(balise, "fix").toInt()); } -void VariableFormat::analyseFootnote(const QDomNode balise) +void VariableFormat::analyseFootnote(const TQDomNode balise) { setNumberingtype(getAttr(balise, "numberingtype")); setNotetype(getAttr(balise, "notetype")); @@ -145,7 +145,7 @@ void VariableFormat::analyseFootnote(const QDomNode balise) setValue(getAttr(balise, "value")); } -void VariableFormat::analyseNote(const QDomNode balise) +void VariableFormat::analyseNote(const TQDomNode balise) { setNote(getAttr(balise, "note")); } @@ -155,7 +155,7 @@ void VariableFormat::analyseNote(const QDomNode balise) /*******************************************/ /* Get information about variable. */ /*******************************************/ -void VariableFormat::analyseType(const QDomNode balise) +void VariableFormat::analyseType(const TQDomNode balise) { setKey(getAttr(balise, "key")); setType(getAttr(balise, "type").toInt()); diff --git a/filters/kword/latex/export/variableformat.h b/filters/kword/latex/export/variableformat.h index 05b5a2d1..68810ca0 100644 --- a/filters/kword/latex/export/variableformat.h +++ b/filters/kword/latex/export/variableformat.h @@ -22,8 +22,8 @@ #ifndef __KWORD_VARIABLEFORMAT_H__ #define __KWORD_VARIABLEFORMAT_H__ -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> #include "textzone.h" enum _EVarType @@ -54,19 +54,19 @@ typedef enum _EVarType EVarType; */ class VariableFormat: public TextZone { - /*QString _police; + /*TQString _police; unsigned int _size;*/ /* Size of the police */ //unsigned int _weight; /* bold */ /*bool _italic; bool _underline; bool _strikeout; EAlign _vertalign; - QColor* _textcolor;*/ + TQColor* _textcolor;*/ /* VARIABLE */ - QString _key; + TQString _key; EVarType _varType; - QString _text; + TQString _text; /* DATE */ int _day; @@ -80,13 +80,13 @@ class VariableFormat: public TextZone int _seconde; /* FOOTNOTE */ - QString _numberingtype; - QString _notetype; - QString _frameset; - QString _value; + TQString _numberingtype; + TQString _notetype; + TQString _frameset; + TQString _value; /* NOTE */ - QString _note; + TQString _note; public: /** @@ -115,8 +115,8 @@ class VariableFormat: public TextZone virtual ~VariableFormat() {} /* ==== Getters ==== */ - QString getKey () const { return _key; } - QString getText () const { return _text; } + TQString getKey () const { return _key; } + TQString getText () const { return _text; } EVarType getType () const { return _varType; } int getDay () const { return _day; } int getMonth () const { return _month; } @@ -124,18 +124,18 @@ class VariableFormat: public TextZone int getHour () const { return _hour; } int getMinute () const { return _minute; } int getSeconde () const { return _seconde; } - QString getNumberingtype() const { return _numberingtype; } - QString getNotetype () const { return _notetype; } - QString getFrameset () const { return _frameset; } - QString getValue () const { return _value; } - QString getNote () const { return _note; } + TQString getNumberingtype() const { return _numberingtype; } + TQString getNotetype () const { return _notetype; } + TQString getFrameset () const { return _frameset; } + TQString getValue () const { return _value; } + TQString getNote () const { return _note; } bool isFix () const { return (_fix == true); } /* ==== Setters ==== */ void setType (const int t) { _varType = (EVarType) t; } - void setKey (QString k) { _key = k; } - void setText (QString t) { _text = t; } + void setKey (TQString k) { _key = k; } + void setText (TQString t) { _text = t; } void setFix (bool f) { _fix = f; } void setDay (const int d) { _day = d; } void setMonth (const int m) { _year = m; } @@ -144,19 +144,19 @@ class VariableFormat: public TextZone void setMinute (const int m) { _minute = m; } void setSeconde (const int s) { _seconde = s; } void setColor (const int, const int, const int); - void setNumberingtype(const QString nt) { _numberingtype = nt; } - void setNotetype (const QString nt) { _notetype = nt; } - void setFrameset (const QString fs) { _frameset = fs; } - void setValue (const QString val) { _value = val; } - void setNote (const QString note) { _note = note; } + void setNumberingtype(const TQString nt) { _numberingtype = nt; } + void setNotetype (const TQString nt) { _notetype = nt; } + void setFrameset (const TQString fs) { _frameset = fs; } + void setValue (const TQString val) { _value = val; } + void setNote (const TQString note) { _note = note; } /* ==== Helpfull functions ==== */ - void analyseFormat(const QDomNode); - void analyseDate (const QDomNode); - void analyseTime (const QDomNode); - void analyseFootnote (const QDomNode); - void analyseNote (const QDomNode); - void analyseType (const QDomNode); + void analyseFormat(const TQDomNode); + void analyseDate (const TQDomNode); + void analyseTime (const TQDomNode); + void analyseFootnote (const TQDomNode); + void analyseNote (const TQDomNode); + void analyseType (const TQDomNode); }; #endif /* __KWORD_VARIABLEFORMAT_H__ */ diff --git a/filters/kword/latex/export/variablezone.cc b/filters/kword/latex/export/variablezone.cc index 92ebd06a..09a16635 100644 --- a/filters/kword/latex/export/variablezone.cc +++ b/filters/kword/latex/export/variablezone.cc @@ -1,4 +1,4 @@ -/* MEMO: to see the unicode table +/* MEMO: to see the tqunicode table * xset +fp /usr/X11R6/lib/X11/fonts/ucs/ * xfd -fn '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1' */ @@ -45,7 +45,7 @@ VariableZone::VariableZone(Para* para): VariableFormat(para) /*******************************************/ /* VariableZone */ /*******************************************/ -VariableZone::VariableZone(QString text, Para* para): VariableFormat(para) +VariableZone::VariableZone(TQString text, Para* para): VariableFormat(para) { setTexte(text); /*setPara(para); @@ -70,7 +70,7 @@ VariableZone::~VariableZone() /* Analyse a text format, get the text used*/ /* by this format. */ /*******************************************/ -void VariableZone::analyse(const QDomNode balise) +void VariableZone::analyse(const TQDomNode balise) { kdDebug(30522) << "FORMAT" << endl; /* Get header information (size, position) @@ -92,7 +92,7 @@ void VariableZone::analyse(const QDomNode balise) /*******************************************/ /* Generate the text formated (if needed). */ /*******************************************/ -void VariableZone::generate(QTextStream &out) +void VariableZone::generate(TQTextStream &out) { if(useFormat()) diff --git a/filters/kword/latex/export/variablezone.h b/filters/kword/latex/export/variablezone.h index 2204fc12..bb3c2ba9 100644 --- a/filters/kword/latex/export/variablezone.h +++ b/filters/kword/latex/export/variablezone.h @@ -26,8 +26,8 @@ #ifndef __KWORD_VARIABLEZONE_H__ #define __KWORD_VARIABLEZONE_H__ -#include <qtextstream.h> -#include <qstring.h> +#include <tqtextstream.h> +#include <tqstring.h> #include "variableformat.h" /***********************************************************************/ @@ -46,7 +46,7 @@ class VariableZone: public VariableFormat /** * Creates a new instance of VariableZone. * - * @param Para which is the parent class. + * @param Para which is the tqparent class. */ VariableZone(Para* para); @@ -54,9 +54,9 @@ class VariableZone: public VariableFormat * Creates a new instance of TextZOne. * * @param text the text in this zone. - * @param para which is the parent class. + * @param para which is the tqparent class. */ - VariableZone(QString text, Para* para); + VariableZone(TQString text, Para* para); /* ==== Destructor ==== */ virtual ~VariableZone(); @@ -67,8 +67,8 @@ class VariableZone: public VariableFormat /* ==== Helpfull functions ==== */ - void analyse(const QDomNode); - void generate(QTextStream&); + void analyse(const TQDomNode); + void generate(TQTextStream&); }; diff --git a/filters/kword/latex/export/xml2latexparser.cc b/filters/kword/latex/export/xml2latexparser.cc index 4d01634e..88936c9a 100644 --- a/filters/kword/latex/export/xml2latexparser.cc +++ b/filters/kword/latex/export/xml2latexparser.cc @@ -25,7 +25,7 @@ #include "xml2latexparser.h" -Xml2LatexParser::Xml2LatexParser(const KoStore* in, QString fileOut, Config* config): +Xml2LatexParser::Xml2LatexParser(const KoStore* in, TQString fileOut, Config* config): XmlParser(config, in), _file(fileOut), _in( in ) { //kdDebug(30522) << fileIn.latin1() << endl; @@ -37,7 +37,7 @@ Xml2LatexParser::Xml2LatexParser(const KoStore* in, QString fileOut, Config* con void Xml2LatexParser::analyse() { - QDomNode balise; + TQDomNode balise; balise = init(); //balise = getChild(balise, "DOC"); kdDebug(30522) <<"HEADER -> PAPER" << endl; @@ -60,7 +60,7 @@ void Xml2LatexParser::generate() if(_file.open(IO_WriteOnly)) { kdDebug(30522) << "GENERATION" << endl; - _out.setDevice(&_file); + _out.setDevice(TQT_TQIODEVICE(&_file)); if(!Config::instance()->isEmbeded()) FileHeader::instance()->generate(_out); _document.generate(_out, !Config::instance()->isEmbeded()); diff --git a/filters/kword/latex/export/xml2latexparser.h b/filters/kword/latex/export/xml2latexparser.h index fc7e577d..38adc123 100644 --- a/filters/kword/latex/export/xml2latexparser.h +++ b/filters/kword/latex/export/xml2latexparser.h @@ -22,18 +22,18 @@ #ifndef __XML2LATEXPARSER_H__ #define __XML2LATEXPARSER_H__ -#include <qfile.h> /* for QFile class */ -#include <qtextstream.h> /* for QTextStream class */ -#include <qstring.h> /* for QString class */ +#include <tqfile.h> /* for TQFile class */ +#include <tqtextstream.h> /* for TQTextStream class */ +#include <tqstring.h> /* for TQString class */ #include "fileheader.h" #include "document.h" class Xml2LatexParser : public XmlParser { - QFile _file; - QTextStream _out; + TQFile _file; + TQTextStream _out; /** Name of the latex file. */ - //QString _filename; + //TQString _filename; /** The KWord document exported. */ const KoStore* _in; @@ -47,7 +47,7 @@ class Xml2LatexParser : public XmlParser * @param in The document from kword. * @param fileOut Output latex filename. */ - Xml2LatexParser(const KoStore* in, QString fileOut, Config* config); + Xml2LatexParser(const KoStore* in, TQString fileOut, Config* config); virtual ~Xml2LatexParser() {} diff --git a/filters/kword/latex/export/xmlparser.cc b/filters/kword/latex/export/xmlparser.cc index 4c66efc0..9c4c07e4 100644 --- a/filters/kword/latex/export/xmlparser.cc +++ b/filters/kword/latex/export/xmlparser.cc @@ -23,19 +23,19 @@ #include <KoStore.h> #include "xmlparser.h" -#include "qfile.h" +#include "tqfile.h" /* Init static data */ //FileHeader* XmlParser::_fileHeader = 0; Document* XmlParser::_root = 0; KoStore* XmlParser::_in = NULL; -QString XmlParser::_filename = ""; +TQString XmlParser::_filename = ""; -XmlParser::XmlParser(Config* config, QString filename):_config(config) +XmlParser::XmlParser(Config* config, TQString filename):_config(config) { //_filename = filename; - QFile f(filename); + TQFile f(filename); if(!f.open(IO_ReadOnly)) return; if(!_document.setContent(&f)) @@ -48,7 +48,7 @@ XmlParser::XmlParser(Config* config, QString filename):_config(config) //_eltCurrent = _document.documentElement(); } -XmlParser::XmlParser(Config* config, QByteArray in): _config(config) +XmlParser::XmlParser(Config* config, TQByteArray in): _config(config) { _document.setContent(in); } @@ -62,7 +62,7 @@ XmlParser::XmlParser(Config* config, const KoStore* in): _config(config) return; } /* input file Reading */ - QByteArray array = _in->read(_in->size()); + TQByteArray array = _in->read(_in->size()); _document.setContent(array); if(!_in->close()) { @@ -87,63 +87,63 @@ XmlParser::~XmlParser() _in->close();*/ } -QDomNode XmlParser::getChild(QDomNode balise, QString name) +TQDomNode XmlParser::getChild(TQDomNode balise, TQString name) { - QDomNode node = getChild(balise, name, 0); + TQDomNode node = getChild(balise, name, 0); kdDebug(30522) << node.nodeName() << endl; return node; } -bool XmlParser::isChild(QDomNode balise, QString name) +bool XmlParser::isChild(TQDomNode balise, TQString name) { if(balise.isElement()) return balise.toElement().elementsByTagName(name).count(); return false; } -QDomNode XmlParser::getChild(QDomNode balise, QString name, int index) +TQDomNode XmlParser::getChild(TQDomNode balise, TQString name, int index) { if(balise.isElement()) { - QDomNodeList children = balise.toElement().elementsByTagName(name); - if ( children.count() ) - return children.item(index); + TQDomNodeList tqchildren = balise.toElement().elementsByTagName(name); + if ( tqchildren.count() ) + return tqchildren.item(index); } - return QDomNode(); + return TQDomNode(); } -QDomNode XmlParser::getChild(QDomNode balise, int index) +TQDomNode XmlParser::getChild(TQDomNode balise, int index) { - QDomNodeList children = balise.childNodes(); - if ( children.count() ) - return children.item(index); - return QDomNode(); + TQDomNodeList tqchildren = balise.childNodes(); + if ( tqchildren.count() ) + return tqchildren.item(index); + return TQDomNode(); } -QString XmlParser::getData(QDomNode balise, int index) +TQString XmlParser::getData(TQDomNode balise, int index) { return getChild(getChild(balise, index), 0).nodeValue(); } -int XmlParser::getNbChild(QDomNode balise) +int XmlParser::getNbChild(TQDomNode balise) { return balise.childNodes().count(); } -int XmlParser::getNbChild(QDomNode balise, QString name) +int XmlParser::getNbChild(TQDomNode balise, TQString name) { if(balise.isElement()) return balise.toElement().elementsByTagName(name).count(); return -1; } -QString XmlParser::getChildName(QDomNode balise, int index) +TQString XmlParser::getChildName(TQDomNode balise, int index) { return balise.childNodes().item(index).nodeName(); } -QString XmlParser::getAttr(QDomNode balise, QString name) const +TQString XmlParser::getAttr(TQDomNode balise, TQString name) const { if(balise.isElement()) return balise.toElement().attributeNode(name).value(); - return QString(); + return TQString(); } diff --git a/filters/kword/latex/export/xmlparser.h b/filters/kword/latex/export/xmlparser.h index 09edbac1..a96d3a59 100644 --- a/filters/kword/latex/export/xmlparser.h +++ b/filters/kword/latex/export/xmlparser.h @@ -23,8 +23,8 @@ #ifndef __LATEX_XMLPARSER_H__ #define __LATEX_XMLPARSER_H__ -#include "qstring.h" -#include "qdom.h" +#include "tqstring.h" +#include "tqdom.h" #include "config.h" class FileHeader; @@ -40,7 +40,7 @@ class KoStore; class XmlParser { /** The Koffice app document stored in a XML DOM Tree. */ - QDomDocument _document; + TQDomDocument _document; /** The koffice document (maindoc, picture, ...). */ static KoStore* _in; /** Configuration */ @@ -53,34 +53,34 @@ class XmlParser //static FileHeader *_fileHeader; static Document *_root; /** Latex output file */ - static QString _filename; + static TQString _filename; public: - XmlParser(Config*, QString); - XmlParser(Config*, QByteArray); /* deprecated */ + XmlParser(Config*, TQString); + XmlParser(Config*, TQByteArray); /* deprecated */ XmlParser(Config*, const KoStore*); XmlParser(); virtual ~XmlParser(); - QString getFilename () const { return _filename; } - QString getDocument () const { return _document.toString(); } + TQString getFilename () const { return _filename; } + TQString getDocument () const { return _document.toString(); } Document* getRoot () const { return _root; } //FileHeader* getFileHeader () const { return _fileHeader; } KoStore* getStorage () const { return _in; } - QString getChildName(QDomNode, int); - QDomNode getChild(QDomNode, QString); - QDomNode getChild(QDomNode, QString, int); - QDomNode getChild(QDomNode, int); - QString getData(QDomNode, int); - int getNbChild(QDomNode, QString); - int getNbChild(QDomNode); - QString getAttr(QDomNode, QString) const; - bool isChild(QDomNode, QString); + TQString getChildName(TQDomNode, int); + TQDomNode getChild(TQDomNode, TQString); + TQDomNode getChild(TQDomNode, TQString, int); + TQDomNode getChild(TQDomNode, int); + TQString getData(TQDomNode, int); + int getNbChild(TQDomNode, TQString); + int getNbChild(TQDomNode); + TQString getAttr(TQDomNode, TQString) const; + bool isChild(TQDomNode, TQString); //void setFileHeader(FileHeader* h) { _fileHeader = h; } void setRoot (Document* r) { _root = r; } - QDomNode init() { return _document.documentElement(); } + TQDomNode init() { return _document.documentElement(); } }; diff --git a/filters/kword/latex/import/generator/body.cc b/filters/kword/latex/import/generator/body.cc index b69f159d..fcf5e534 100644 --- a/filters/kword/latex/import/generator/body.cc +++ b/filters/kword/latex/import/generator/body.cc @@ -19,17 +19,17 @@ #include "body.h" #include <element.h> -#include <qdom.h> +#include <tqdom.h> bool Body::analyse(Element* body) { } -bool Body::generate(QDomElement& framesetsNode, QDomDocument& doc) +bool Body::generate(TQDomElement& framesetsNode, TQDomDocument& doc) { /* FRAMESET */ - QDomElement framesetNode = doc.createElement("FRAMESET"); + TQDomElement framesetNode = doc.createElement("FRAMESET"); /* required attributes */ framesetNode.setAttribute("frameType", TEXTFRAME); @@ -38,7 +38,7 @@ bool Body::generate(QDomElement& framesetsNode, QDomDocument& doc) framesetsNode.appendChild(framesetNode); /* FRAME */ - QDomElement frameNode = doc.createElement("FRAME"); + TQDomElement frameNode = doc.createElement("FRAME"); /* required attributes */ frameNode.setAttribute("newFrameBehavior", "0"); diff --git a/filters/kword/latex/import/generator/body.h b/filters/kword/latex/import/generator/body.h index 73a12c92..e06db774 100644 --- a/filters/kword/latex/import/generator/body.h +++ b/filters/kword/latex/import/generator/body.h @@ -20,12 +20,12 @@ #ifndef __KWORD_LATEX_IMPORT_BODY_H__ #define __KWORD_LATEX_IMPORT_BODY_H__ -#include <qptrlist.h> +#include <tqptrlist.h> #include "paragraph.h" class Element; -class QDomDocument; -class QDomElement; +class TQDomDocument; +class TQDomElement; #define NORMALTEXT 0 #define TEXTFRAME 1 @@ -61,7 +61,7 @@ class Body * * @return <code>true</code> if the generation success. */ - bool generate(QDomElement& framesets, QDomDocument& doc); + bool generate(TQDomElement& framesets, TQDomDocument& doc); private: /** Left margin in pt. */ @@ -73,7 +73,7 @@ class Body /** Botoom margin in pt. */ int _bottomMargin; /** The body of a document is a list of paragraphs. */ - QPtrList<Paragraph> _paragraphs; + TQPtrList<Paragraph> _paragraphs; }; #endif /* __KWORD_LATEX_IMPORT_BODY_H__ */ diff --git a/filters/kword/latex/import/generator/document.cc b/filters/kword/latex/import/generator/document.cc index d7f0bae8..13685e02 100644 --- a/filters/kword/latex/import/generator/document.cc +++ b/filters/kword/latex/import/generator/document.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qtextstream.h> +#include <tqdom.h> +#include <tqtextstream.h> #include "kdebug.h" #include <KoStore.h> @@ -27,7 +27,7 @@ #include <param.h> #include <command.h> -bool Document::analyse(QPtrList<Element>* root) +bool Document::analyse(TQPtrList<Element>* root) { bool error = true; error &= analyseDocumentClass((Command*) Latex::instance()->getCommand(root, "documentclass")); @@ -40,7 +40,7 @@ bool Document::analyse(QPtrList<Element>* root) bool Document::analyseDocumentClass(Command* documentclass) { kdWarning(documentclass != NULL) << "no documentclass found !" << endl; - QPtrList<Param> params = documentclass->getOptions(); + TQPtrList<Param> params = documentclass->getOptions(); Param* param; for ( param = params.first(); param; param = params.next() ) { @@ -55,12 +55,12 @@ bool Document::analyseDocumentClass(Command* documentclass) bool Document::generate(KoStore* store) { - QDomDocument doc("KWORD"); + TQDomDocument doc("KWORD"); doc.appendChild(doc.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"")); /* DOC */ - QDomElement root = doc.createElement("DOC"); + TQDomElement root = doc.createElement("DOC"); root.setAttribute("editor", "LaTex Import Filter"); root.setAttribute("mime", "application/x-kword"); root.setAttribute("syntaxVersion", "1"); @@ -71,7 +71,7 @@ bool Document::generate(KoStore* store) /* ATTRIBUTES */ /* FRAMESETS */ - QDomElement body = doc.createElement("FRAMESETS"); + TQDomElement body = doc.createElement("FRAMESETS"); root.appendChild(body); /* generate body */ @@ -82,9 +82,9 @@ bool Document::generate(KoStore* store) return true; } -void Document::serialize(KoStore* store, QDomDocument doc) +void Document::serialize(KoStore* store, TQDomDocument doc) { - QCString str = doc.toCString(); + TQCString str = doc.toCString(); qWarning(str); if(store->open("root")) { diff --git a/filters/kword/latex/import/generator/document.h b/filters/kword/latex/import/generator/document.h index 897b829a..c02d61dc 100644 --- a/filters/kword/latex/import/generator/document.h +++ b/filters/kword/latex/import/generator/document.h @@ -21,11 +21,11 @@ #define __KWORD_LATEX_IMPORT_DOCUMENT__ #include <element.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include "body.h" class KoStore; -class QDomNode; +class TQDomNode; class Command; class Document @@ -46,7 +46,7 @@ class Document * * @return <code>false/code> if the analyse failed. */ - bool analyse(QPtrList<Element>* elt); + bool analyse(TQPtrList<Element>* elt); /** * Analyse and get all information in a documentclass command. @@ -69,7 +69,7 @@ class Document * @param tree The tree to copy. * @param indent The tabulation to indent the XML tree. */ - void serialize(KoStore* store, QDomDocument tree); + void serialize(KoStore* store, TQDomDocument tree); private: Body _body; diff --git a/filters/kword/latex/import/generator/kwordgenerator.cc b/filters/kword/latex/import/generator/kwordgenerator.cc index 208029ad..0b0e7aa3 100644 --- a/filters/kword/latex/import/generator/kwordgenerator.cc +++ b/filters/kword/latex/import/generator/kwordgenerator.cc @@ -19,9 +19,9 @@ #include <kdebug.h> #include <ktempfile.h> -#include <qfile.h> +#include <tqfile.h> -#include <qdom.h> +#include <tqdom.h> #include "kwordgenerator.h" #include "document.h" @@ -30,12 +30,12 @@ void KwordGenerator::convert(KoStore* out) { //KTempFile temp("lateximport", ".kwd"); //temp.setAutoDelete(true); - //QFile* tempFile = temp.file(); + //TQFile* tempFile = temp.file(); /*if(out->open("root")) {*/ Document document; document.analyse(_root); - //QTextStream output(tempFile); + //TQTextStream output(tempFile); document.generate(out); //tempFile->close(); //out->write(tempFile->readAll()); diff --git a/filters/kword/latex/import/generator/kwordgenerator.h b/filters/kword/latex/import/generator/kwordgenerator.h index 534a7b56..68d6fb51 100644 --- a/filters/kword/latex/import/generator/kwordgenerator.h +++ b/filters/kword/latex/import/generator/kwordgenerator.h @@ -27,7 +27,7 @@ class KwordGenerator { - QPtrList<Element>* _root; + TQPtrList<Element>* _root; //Document _doc; public: @@ -35,7 +35,7 @@ class KwordGenerator { } - KwordGenerator(QPtrList<Element>* root) + KwordGenerator(TQPtrList<Element>* root) { _root = root; } diff --git a/filters/kword/latex/import/generator/latex.cc b/filters/kword/latex/import/generator/latex.cc index 639845b8..22c773d8 100644 --- a/filters/kword/latex/import/generator/latex.cc +++ b/filters/kword/latex/import/generator/latex.cc @@ -21,7 +21,7 @@ Latex* Latex::_instance = 0; -Element* Latex::getEnv(QPtrList<Element>* root, const char* name) +Element* Latex::getEnv(TQPtrList<Element>* root, const char* name) { Element* elt; for ( elt = root->first(); elt; elt = root->next() ) @@ -32,7 +32,7 @@ Element* Latex::getEnv(QPtrList<Element>* root, const char* name) return 0; } -Element* Latex::getCommand(QPtrList<Element>* root, const char* name) +Element* Latex::getCommand(TQPtrList<Element>* root, const char* name) { Element* elt; for ( elt = root->first(); elt; elt = root->next() ) diff --git a/filters/kword/latex/import/generator/latex.h b/filters/kword/latex/import/generator/latex.h index b8a1774a..ae86c98a 100644 --- a/filters/kword/latex/import/generator/latex.h +++ b/filters/kword/latex/import/generator/latex.h @@ -19,7 +19,7 @@ #ifndef __LATEX_IMPORT_LATEXUTILS__ #define __LATEX_IMPORT_LATEXUTILS__ -#include <qptrlist.h> +#include <tqptrlist.h> class Element; @@ -34,8 +34,8 @@ class Latex return _instance; } - Element* getEnv(QPtrList<Element>* root, const char* name); - Element* getCommand(QPtrList<Element>* root, const char* name); + Element* getEnv(TQPtrList<Element>* root, const char* name); + Element* getCommand(TQPtrList<Element>* root, const char* name); private: static Latex* _instance; diff --git a/filters/kword/latex/import/generator/paragraph.cc b/filters/kword/latex/import/generator/paragraph.cc index c574ab22..c25ab994 100644 --- a/filters/kword/latex/import/generator/paragraph.cc +++ b/filters/kword/latex/import/generator/paragraph.cc @@ -19,17 +19,17 @@ #include "paragraph.h" #include <element.h> -#include <qdom.h> +#include <tqdom.h> -bool Paragraph::analyse(QPtrList<Element>* body) +bool Paragraph::analyse(TQPtrList<Element>* body) { } -bool Paragraph::generate(QDomElement& paragraphNode, QDomDocument& doc) +bool Paragraph::generate(TQDomElement& paragraphNode, TQDomDocument& doc) { /* FRAMESET */ - QDomElement textNode = doc.createElement("TEXT"); + TQDomElement textNode = doc.createElement("TEXT"); /* required attributes */ /*framesetNode.setAttribute("frameType", TEXTFRAME); @@ -38,7 +38,7 @@ bool Paragraph::generate(QDomElement& paragraphNode, QDomDocument& doc) paragraphNode.appendChild(textNode); /* FRAME */ - //QDomElement frameNode = doc.createElement("FRAME"); + //TQDomElement frameNode = doc.createElement("FRAME"); /* required attributes */ /*frameNode.setAttribute("newFrameBehavior", "0"); diff --git a/filters/kword/latex/import/generator/paragraph.h b/filters/kword/latex/import/generator/paragraph.h index 9b32cf8b..6db1b4ed 100644 --- a/filters/kword/latex/import/generator/paragraph.h +++ b/filters/kword/latex/import/generator/paragraph.h @@ -20,11 +20,11 @@ #ifndef __KWORD_LATEX_IMPORT_PARAGRAPH_H__ #define __KWORD_LATEX_IMPORT_PARAGRAPH_H__ -#include <qptrlist.h> +#include <tqptrlist.h> class Element; -class QDomDocument; -class QDomElement; +class TQDomDocument; +class TQDomElement; //class TextZone; /** @@ -47,7 +47,7 @@ class Paragraph * * @return <code>false/code> if the analyse failed. */ - bool analyse(QPtrList<Element>* elt); + bool analyse(TQPtrList<Element>* elt); /** * Generate a kword document. @@ -56,11 +56,11 @@ class Paragraph * * @return <code>true</code> if the generation success. */ - bool generate(QDomElement& paragraph, QDomDocument& doc); + bool generate(TQDomElement& paragraph, TQDomDocument& doc); private: /** A paragraph is a list of text zones. */ - //QPtrList<TextZone> _textzones; + //TQPtrList<TextZone> _textzones; }; #endif /* __KWORD_LATEX_IMPORT_PARAGRAPH_H__ */ diff --git a/filters/kword/latex/import/lateximport.cc b/filters/kword/latex/import/lateximport.cc index 6986bc06..f644910a 100644 --- a/filters/kword/latex/import/lateximport.cc +++ b/filters/kword/latex/import/lateximport.cc @@ -24,25 +24,25 @@ #include <kgenericfactory.h> #include <kglobal.h> #include <klocale.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include "lateximportdia.h" typedef KGenericFactory<LATEXImport, KoFilter> LATEXImportFactory; K_EXPORT_COMPONENT_FACTORY( libkwordlateximport, LATEXImportFactory( "kofficefilters" ) ) -LATEXImport::LATEXImport(KoFilter *, const char *, const QStringList&) : +LATEXImport::LATEXImport(KoFilter *, const char *, const TQStringList&) : KoFilter() { } -KoFilter::ConversionStatus LATEXImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus LATEXImport::convert( const TQCString& from, const TQCString& to ) { - QString config; + TQString config; if(from != "text/x-tex" || to != "application/x-kword") return KoFilter::NotImplemented; - KoStore* out = KoStore::createStore(QString(m_chain->outputFile()), + KoStore* out = KoStore::createStore(TQString(m_chain->outputFile()), KoStore::Write, "application/x-kword"); /*if(!out || !out->open("root")) { kdError(30503) << "Unable to open output file!" << endl; diff --git a/filters/kword/latex/import/lateximport.h b/filters/kword/latex/import/lateximport.h index 6186120a..a3cba4d0 100644 --- a/filters/kword/latex/import/lateximport.h +++ b/filters/kword/latex/import/lateximport.h @@ -20,10 +20,10 @@ #ifndef __LATEXIMPORT_H__ #define __LATEXIMPORT_H__ -#include <qstring.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -32,12 +32,13 @@ class LATEXImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - LATEXImport(KoFilter *parent, const char *name, const QStringList&); + LATEXImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~LATEXImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif /* __LATEXIMPORT_H__ */ diff --git a/filters/kword/latex/import/lateximportdia.cc b/filters/kword/latex/import/lateximportdia.cc index 09fd39d0..c6c28a77 100644 --- a/filters/kword/latex/import/lateximportdia.cc +++ b/filters/kword/latex/import/lateximportdia.cc @@ -37,15 +37,15 @@ #include <lateximportdia.moc> #include <dcopclient.h> #include <ktempfile.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include "latexparser.h" #include "config.h" #include "generator/kwordgenerator.h" -LATEXImportDia::LATEXImportDia(KoStore* out, QWidget *parent, const char *name) : - KDialogBase(parent, name, true, i18n("Latex Import Filter Parameters"), +LATEXImportDia::LATEXImportDia(KoStore* out, TQWidget *tqparent, const char *name) : + KDialogBase(tqparent, name, true, i18n("Latex Import Filter Parameters"), Ok|Cancel), DCOPObject("FilterConfigDia"), _out(out) { @@ -62,19 +62,19 @@ LATEXImportDia::LATEXImportDia(KoStore* out, QWidget *parent, const char *name) void LATEXImportDia::createDialog() { resize(size()); - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QBoxLayout *mainLayout = new QVBoxLayout(page, KDialog::marginHint(), KDialog::spacingHint()); - styleBox = new QVButtonGroup(i18n("Document Style"), page); + TQBoxLayout *mainLayout = new TQVBoxLayout(page, KDialog::marginHint(), KDialog::spacingHint()); + styleBox = new TQVButtonGroup(i18n("Document Style"), page); mainLayout->addWidget(styleBox); /* First part */ - QBoxLayout *styleLayout = new QVBoxLayout(page); + TQBoxLayout *styleLayout = new TQVBoxLayout(page); - latexStyleRBtn = new QRadioButton(i18n("Latex style"), styleBox); + latexStyleRBtn = new TQRadioButton(i18n("Latex style"), styleBox); styleLayout->addWidget(latexStyleRBtn); - kwordStyleRBtn = new QRadioButton(i18n("KWord style"), styleBox); + kwordStyleRBtn = new TQRadioButton(i18n("KWord style"), styleBox); styleLayout->addWidget(kwordStyleRBtn); /*typeLabel = new ... @@ -87,15 +87,15 @@ void LATEXImportDia::createDialog() styleLayout->activate(); /* Second part */ - langBox = new QVButtonGroup(i18n("Language"), page); + langBox = new TQVButtonGroup(i18n("Language"), page); mainLayout->addWidget(langBox); - QBoxLayout *langLayout = new QVBoxLayout(langBox); + TQBoxLayout *langLayout = new TQVBoxLayout(langBox); - unicodeRBtn = new QRadioButton(i18n("Unicode"), langBox); - langLayout->addWidget(unicodeRBtn); + tqunicodeRBtn = new TQRadioButton(i18n("Unicode"), langBox); + langLayout->addWidget(tqunicodeRBtn); - latin1RBtn = new QRadioButton(i18n("latin1"), langBox); + latin1RBtn = new TQRadioButton(i18n("latin1"), langBox); langLayout->addWidget(latin1RBtn); /*babelCheckBox = new ... @@ -109,22 +109,22 @@ void LATEXImportDia::createDialog() langLayout->activate(); /* Third part */ - docBox = new QVButtonGroup(i18n("Document Type"), page); + docBox = new TQVButtonGroup(i18n("Document Type"), page); mainLayout->addWidget(docBox); - QBoxLayout *docLayout = new QVBoxLayout(docBox); + TQBoxLayout *docLayout = new TQVBoxLayout(docBox); - newDocRBtn = new QRadioButton(i18n("New document"), docBox); + newDocRBtn = new TQRadioButton(i18n("New document"), docBox); docLayout->addWidget(newDocRBtn); - embededRBtn = new QRadioButton(i18n("Embedded document"), docBox); + embededRBtn = new TQRadioButton(i18n("Embedded document"), docBox); docLayout->addWidget(embededRBtn); docBox->setExclusive(true); docBox->setButton(0); /* NEW DOC IS THE DEFAULT. */ docLayout->activate(); - /* Display the main layout */ + /* Display the main tqlayout */ mainLayout->addStretch(5); mainLayout->activate(); } @@ -138,7 +138,7 @@ void LATEXImportDia::state() else if(embededRBtn == docBox->selected()) config.setType(TYPE_EMBEDED); - if(unicodeRBtn == langBox->selected()) + if(tqunicodeRBtn == langBox->selected()) config.setEncoding(ENC_UNICODE); else if(latin1RBtn == langBox->selected()) config.setEncoding(ENC_LATIN1); @@ -155,7 +155,7 @@ void LATEXImportDia::slotOk() state(); kdDebug(30522) << "LATEX FILTER --> BEGIN" << endl; LatexParser parser(_fileIn); - QPtrList<Element>* root = parser.parse(); + TQPtrList<Element>* root = parser.parse(); kdDebug(30522) << "---------- generate file -------------" << endl; kdDebug(30522) << "command: " << root->count() << endl; Element* elt; diff --git a/filters/kword/latex/import/lateximportdia.h b/filters/kword/latex/import/lateximportdia.h index 58819a51..4f4c8c39 100644 --- a/filters/kword/latex/import/lateximportdia.h +++ b/filters/kword/latex/import/lateximportdia.h @@ -35,11 +35,11 @@ #ifndef __LATEXIMPORTDIA_H__ #define __LATEXIMPORTDIA_H__ -#include <qwidget.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> +#include <tqwidget.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> #include <klocale.h> #include <dcopobject.h> @@ -53,26 +53,27 @@ class LATEXImportDia : public KDialogBase, public DCOPObject K_DCOP Q_OBJECT + TQ_OBJECT - QString _fileIn; - QByteArray _arrayIn; + TQString _fileIn; + TQByteArray _arrayIn; KoStore* _out; /* the zipped file containing all pictures, part, ... */ public: - LATEXImportDia(KoStore*, QWidget *parent=0L, const char *name=0L); + LATEXImportDia(KoStore*, TQWidget *tqparent=0L, const char *name=0L); virtual ~LATEXImportDia() {} void createDialog(); virtual void state(); - void setInputFile(QString file) { _fileIn = file; } - //void setOutputFile(QString file) { _fileOut = file; } + void setInputFile(TQString file) { _fileIn = file; } + //void setOutputFile(TQString file) { _fileOut = file; } private: - QVButtonGroup* styleBox, *langBox, *docBox; - QRadioButton* latexStyleRBtn, *kwordStyleRBtn; /* Document style */ - QRadioButton* unicodeRBtn, *latin1RBtn; /* Language */ - QRadioButton* newDocRBtn, *embededRBtn; /* Latex file */ + TQVButtonGroup* styleBox, *langBox, *docBox; + TQRadioButton* latexStyleRBtn, *kwordStyleRBtn; /* Document style */ + TQRadioButton* tqunicodeRBtn, *latin1RBtn; /* Language */ + TQRadioButton* newDocRBtn, *embededRBtn; /* Latex file */ k_dcop: void useDefaultConfig() { slotOk(); } diff --git a/filters/kword/latex/import/parser/command.cc b/filters/kword/latex/import/parser/command.cc index bd00141a..9b7d1979 100644 --- a/filters/kword/latex/import/parser/command.cc +++ b/filters/kword/latex/import/parser/command.cc @@ -37,7 +37,7 @@ Command::Command(const char* name) _name = _name.stripWhiteSpace(); } -Command::Command(const char* name, QPtrList<QPtrList<Element> >* groups) +Command::Command(const char* name, TQPtrList<TQPtrList<Element> >* groups) { setType(Element::LATEX_COMMAND); _options.setAutoDelete(true); @@ -48,8 +48,8 @@ Command::Command(const char* name, QPtrList<QPtrList<Element> >* groups) _name = _name.stripWhiteSpace(); } -Command::Command(const char* name, QPtrList<QPtrList<Param> >* params, - QPtrList<QPtrList<Element> >* groups) +Command::Command(const char* name, TQPtrList<TQPtrList<Param> >* params, + TQPtrList<TQPtrList<Element> >* groups) { setType(Element::LATEX_COMMAND); _options.setAutoDelete(true); @@ -62,8 +62,8 @@ Command::Command(const char* name, QPtrList<QPtrList<Param> >* params, _name = _name.stripWhiteSpace(); } -Command::Command(const char* name, QPtrList<QPtrList<Param> >* params, QPtrList<Param>* options, - QPtrList<QPtrList<Element> >* groups) +Command::Command(const char* name, TQPtrList<TQPtrList<Param> >* params, TQPtrList<Param>* options, + TQPtrList<TQPtrList<Element> >* groups) { setType(Element::LATEX_COMMAND); _options.setAutoDelete(true); @@ -85,24 +85,24 @@ Command::~Command() void Command::addParam(const char* ) { - /*QString test = QString(name); - QString key = test.left(test.find("=")); - QString value = test.right(test.find("=")); + /*TQString test = TQString(name); + TQString key = test.left(test.tqfind("=")); + TQString value = test.right(test.tqfind("=")); addParam(key, value);*/ } void Command::addOption(const char* ) { - /*QString test = QString(name); - QString key = test.left(test.find("=")); - QString value = test.right(test.find("=")); + /*TQString test = TQString(name); + TQString key = test.left(test.tqfind("=")); + TQString value = test.right(test.tqfind("=")); addOption(key, value);*/ } void Command::print(int tab) { cout << _name.latin1(); - QPtrList<Param>* params; + TQPtrList<Param>* params; for ( params = _params.first(); params; params = _params.next() ) { cout << "["; @@ -128,7 +128,7 @@ void Command::print(int tab) cout << "]"; } - QPtrList<Element>* group; + TQPtrList<Element>* group; for(group = _elements.first(); group; group = _elements.next() ) { cout << " {"; diff --git a/filters/kword/latex/import/parser/command.h b/filters/kword/latex/import/parser/command.h index f7079d37..41f44ed6 100644 --- a/filters/kword/latex/import/parser/command.h +++ b/filters/kword/latex/import/parser/command.h @@ -24,9 +24,9 @@ //#include "option.h" #include "element.h" -#include <qstring.h> -#include <qmap.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqptrlist.h> class Command: public Element { @@ -40,50 +40,50 @@ class Command: public Element /** * Create a command which match to \\renewcommand{\\headrulewidth}{opt} */ - Command(const char* name, QPtrList<QPtrList<Element> >* groups); + Command(const char* name, TQPtrList<TQPtrList<Element> >* groups); /** * Create a command which match to * \\put(1,1){\\circle[}}. */ - Command(const char* name, QPtrList<QPtrList<Param> >* options, - QPtrList<QPtrList<Element> >* groups); + Command(const char* name, TQPtrList<TQPtrList<Param> >* options, + TQPtrList<TQPtrList<Element> >* groups); /** * Create a command which match to \\parpic(3cm,3cm)[f]{text} or * \\documentclass[11pt]{guidepra} */ - Command(const char* name, QPtrList<QPtrList<Param> >* params, QPtrList<Param>* options, QPtrList<QPtrList<Element> >* groups); + Command(const char* name, TQPtrList<TQPtrList<Param> >* params, TQPtrList<Param>* options, TQPtrList<TQPtrList<Element> >* groups); ~Command(); - QString getName() const { return _name; } + TQString getName() const { return _name; } - QPtrList<QPtrList<Param> > getParams() const { return _params; } + TQPtrList<TQPtrList<Param> > getParams() const { return _params; } - QPtrList<Param> getOptions() const { return _options; } + TQPtrList<Param> getOptions() const { return _options; } - QPtrList<QPtrList<Element> > getChildren() const { return _elements; } + TQPtrList<TQPtrList<Element> > getChildren() const { return _elements; } void setName(const char* name) { _name = name; } void addParam(const char* param); - //void addParam(QString key, QString value) { _params.append(new Param(key, value)); } - //void addParams(QPtrList<Param> params) { _params = params; } - void addGroups(QPtrList<QPtrList<Element> >* elts) { _elements = *elts; } + //void addParam(TQString key, TQString value) { _params.append(new Param(key, value)); } + //void addParams(TQPtrList<Param> params) { _params = params; } + void addGroups(TQPtrList<TQPtrList<Element> >* elts) { _elements = *elts; } void addOption(const char* option); - void addOption(QString key, QString value) { _options.append(new Param(key, value)); } + void addOption(TQString key, TQString value) { _options.append(new Param(key, value)); } - void addChild(QPtrList<Element>* elt) { _elements.append(elt); } + void addChild(TQPtrList<Element>* elt) { _elements.append(elt); } /* useful method */ void print(int tab = 0); private: - QString _name; - QPtrList<QPtrList<Param> > _params; - QPtrList<Param> _options; - QPtrList<QPtrList<Element> > _elements; + TQString _name; + TQPtrList<TQPtrList<Param> > _params; + TQPtrList<Param> _options; + TQPtrList<TQPtrList<Element> > _elements; }; diff --git a/filters/kword/latex/import/parser/comment.h b/filters/kword/latex/import/parser/comment.h index eeccf963..dfaf08e2 100644 --- a/filters/kword/latex/import/parser/comment.h +++ b/filters/kword/latex/import/parser/comment.h @@ -22,7 +22,7 @@ #include "element.h" -#include <qstring.h> +#include <tqstring.h> class Comment: public Element { @@ -32,14 +32,14 @@ class Comment: public Element Comment(const char* comment); ~Comment(); - QString getComment() const { return _comment; } + TQString getComment() const { return _comment; } - void setComment(QString comment) { _comment = comment; } + void setComment(TQString comment) { _comment = comment; } void print(int tab = 0); private: - QString _comment; + TQString _comment; }; diff --git a/filters/kword/latex/import/parser/element.h b/filters/kword/latex/import/parser/element.h index 43b1cbc0..bec4975b 100644 --- a/filters/kword/latex/import/parser/element.h +++ b/filters/kword/latex/import/parser/element.h @@ -20,7 +20,7 @@ #ifndef __LATEXPARSER_ELEMENT_H__ #define __LATEXPARSER_ELEMENT_H__ -#include <qstring.h> +#include <tqstring.h> class Element { @@ -40,14 +40,14 @@ class Element /* getters */ EType getType() const { return _type; } - virtual QString getName() const { return ""; } + virtual TQString getName() const { return ""; } /* setters */ void setType(EType t) { _type = t; } /* useful methods */ - //void addParams(QPtrList<Param> params) { } - //void addGroups(QPtrList<QPtrList<Element> >* elts) { } + //void addParams(TQPtrList<Param> params) { } + //void addGroups(TQPtrList<TQPtrList<Element> >* elts) { } virtual void print(int tab = 0) = 0; private: diff --git a/filters/kword/latex/import/parser/env.cc b/filters/kword/latex/import/parser/env.cc index df5637a6..a490d328 100644 --- a/filters/kword/latex/import/parser/env.cc +++ b/filters/kword/latex/import/parser/env.cc @@ -29,15 +29,15 @@ Env::Env(const char* command) { setType(Element::LATEX_ENV); /* Parse the command name */ - QString pattern = QString(command); - int pos = pattern.find("{"); + TQString pattern = TQString(command); + int pos = pattern.tqfind("{"); /* Remove \begin{ at the begining and the } at the end. */ if(pos != -1) _name = pattern.mid(pos + 1, pattern.length() - pos - 2); _name = _name.stripWhiteSpace(); } -Env::Env(QString name) : _name(name) +Env::Env(TQString name) : _name(name) { setType(Element::LATEX_ENV); _name = _name.stripWhiteSpace(); @@ -47,10 +47,10 @@ Env::~Env() { } -void Env::setChildren(QPtrList<Element>* children) +void Env::setChildren(TQPtrList<Element>* tqchildren) { - if(children != NULL) - _children = *children; + if(tqchildren != NULL) + _tqchildren = *tqchildren; } void Env::print(int tab) @@ -58,7 +58,7 @@ void Env::print(int tab) cout << "ENV " << getName().latin1() << "{" << endl; Element* elt; - for ( elt = _children.first(); elt; elt = _children.next() ) + for ( elt = _tqchildren.first(); elt; elt = _tqchildren.next() ) { elt->print(tab); } diff --git a/filters/kword/latex/import/parser/env.h b/filters/kword/latex/import/parser/env.h index eb36ef9d..cef56b29 100644 --- a/filters/kword/latex/import/parser/env.h +++ b/filters/kword/latex/import/parser/env.h @@ -22,27 +22,27 @@ #include "element.h" -#include <qstring.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqptrlist.h> class Env: public Element { - QPtrList<Element> _children; - QString _name; + TQPtrList<Element> _tqchildren; + TQString _name; public: Env(); Env(const char*); - Env(QString); + Env(TQString); ~Env(); - QString getName() const { return _name; } + TQString getName() const { return _name; } - void setName(QString name) { _name = name; } - void setChildren(QPtrList<Element>*); + void setName(TQString name) { _name = name; } + void setChildren(TQPtrList<Element>*); void print(int tab = 0); }; diff --git a/filters/kword/latex/import/parser/group.h b/filters/kword/latex/import/parser/group.h index af50cf6d..891305f2 100644 --- a/filters/kword/latex/import/parser/group.h +++ b/filters/kword/latex/import/parser/group.h @@ -2,11 +2,11 @@ #ifndef __LATEXPARSER_GROUP_H__ #define __LATEXPARSER_GROUP_H__ -#include <qptrlist.h> +#include <tqptrlist.h> #include "element.h" -class Group: public Element, public QPtrList<Element> +class Group: public Element, public TQPtrList<Element> { public: Group(); diff --git a/filters/kword/latex/import/parser/latexparser.cc b/filters/kword/latex/import/parser/latexparser.cc index c4f8b6f9..a5b3a822 100644 --- a/filters/kword/latex/import/parser/latexparser.cc +++ b/filters/kword/latex/import/parser/latexparser.cc @@ -5,14 +5,14 @@ #include <iostream.h> //extern void yylex(); -extern QPtrList<Element>* _root; -extern bool texparse(QString); +extern TQPtrList<Element>* _root; +extern bool texparse(TQString); LatexParser::LatexParser() { } -LatexParser::LatexParser(QString fileIn) +LatexParser::LatexParser(TQString fileIn) { _filename= fileIn; } @@ -21,7 +21,7 @@ LatexParser::~LatexParser() { } -QPtrList<Element>* LatexParser::parse() +TQPtrList<Element>* LatexParser::parse() { texparse(_filename); return _root; diff --git a/filters/kword/latex/import/parser/latexparser.h b/filters/kword/latex/import/parser/latexparser.h index 4768b537..3a584c8d 100644 --- a/filters/kword/latex/import/parser/latexparser.h +++ b/filters/kword/latex/import/parser/latexparser.h @@ -22,27 +22,27 @@ #include "element.h" -#include <qstring.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqptrlist.h> class LatexParser { public: LatexParser(); - LatexParser(QString fileIn); + LatexParser(TQString fileIn); ~LatexParser(); - QString getInputFile() const { return _filename; } + TQString getInputFile() const { return _filename; } - void setInputFile(QString filename) { _filename = filename; } + void setInputFile(TQString filename) { _filename = filename; } - QPtrList<Element>* parse(); + TQPtrList<Element>* parse(); void convert(); private: - QString _filename; + TQString _filename; }; diff --git a/filters/kword/latex/import/parser/option.h b/filters/kword/latex/import/parser/option.h index 5f93336d..a1725f8c 100644 --- a/filters/kword/latex/import/parser/option.h +++ b/filters/kword/latex/import/parser/option.h @@ -2,7 +2,7 @@ #ifndef __LATEXPARSER_OPTION_H__ #define __LATEXPARSER_OPTION_H__ -#include <qstring.h> +#include <tqstring.h> class Option { @@ -11,17 +11,17 @@ class Option ~Option() { } - QString getKey() const { return _key; } + TQString getKey() const { return _key; } - QString getValue() const { return _value; } + TQString getValue() const { return _value; } - void setKey(QString key) { _key = key; } + void setKey(TQString key) { _key = key; } - void setValue(QString value) { _value = value; } + void setValue(TQString value) { _value = value; } private: - QString _key; - QString _value; + TQString _key; + TQString _value; }; #endif /* __LATEXPARSER_OPTION_H__ */ diff --git a/filters/kword/latex/import/parser/param.cc b/filters/kword/latex/import/parser/param.cc index c7311c67..66bb7fff 100644 --- a/filters/kword/latex/import/parser/param.cc +++ b/filters/kword/latex/import/parser/param.cc @@ -33,7 +33,7 @@ Param::Param(const char* key, const char* value) _value = _value.stripWhiteSpace(); } -Param::Param(QString key, QString value) +Param::Param(TQString key, TQString value) { _key = key; _key = _key.stripWhiteSpace(); diff --git a/filters/kword/latex/import/parser/param.h b/filters/kword/latex/import/parser/param.h index 95eb5ee0..3555e2f1 100644 --- a/filters/kword/latex/import/parser/param.h +++ b/filters/kword/latex/import/parser/param.h @@ -20,30 +20,30 @@ #ifndef __LATEXPARSER_PARAM_H__ #define __LATEXPARSER_PARAM_H__ -#include <qstring.h> +#include <tqstring.h> class Param { public: Param(); Param(const char* key, const char* value); - Param(QString key, QString value); + Param(TQString key, TQString value); virtual ~Param(); - QString getKey() const { return _key; } + TQString getKey() const { return _key; } - QString getValue() const { return _value; } + TQString getValue() const { return _value; } - void setKey(QString key) { _key = key; } + void setKey(TQString key) { _key = key; } - void setValue(QString value) { _value = value; } + void setValue(TQString value) { _value = value; } void print(int tab = 0); private: - QString _key; - QString _value; + TQString _key; + TQString _value; }; #endif /* __LATEXPARSER_PARAM_H__ */ diff --git a/filters/kword/latex/import/parser/stack.h b/filters/kword/latex/import/parser/stack.h index c73f8dd7..2b0bbf7e 100644 --- a/filters/kword/latex/import/parser/stack.h +++ b/filters/kword/latex/import/parser/stack.h @@ -22,8 +22,8 @@ -#include <qptrlist.h> -#include <qptrstack.h> +#include <tqptrlist.h> +#include <tqptrstack.h> #define GROUP_STACK_SIZE 10 @@ -37,6 +37,6 @@ static int stack_size = GROUP_STACK_SIZE; static int stackp = 0; static Element * _currentElement = 0; static Group* _tree = 0; -static QPtrStack<Element> _stackElement;*/ +static TQPtrStack<Element> _stackElement;*/ #endif /* __STACK_H__ */ diff --git a/filters/kword/latex/import/parser/text.h b/filters/kword/latex/import/parser/text.h index 880dcd22..504b3038 100644 --- a/filters/kword/latex/import/parser/text.h +++ b/filters/kword/latex/import/parser/text.h @@ -22,7 +22,7 @@ #include "element.h" -#include <qstring.h> +#include <tqstring.h> class Text: public Element { @@ -32,14 +32,14 @@ class Text: public Element ~Text(); - QString getText() const { return _text; } + TQString getText() const { return _text; } - void setText(QString text) { _text = text; } + void setText(TQString text) { _text = text; } void print(int tab = 0); private: - QString _text; + TQString _text; }; diff --git a/filters/kword/latex/status.html b/filters/kword/latex/status.html index 6f06bdb3..ea2a527c 100644 --- a/filters/kword/latex/status.html +++ b/filters/kword/latex/status.html @@ -131,14 +131,14 @@ <B>VERSION 1:</B> <table BORDER="0" WIDTH="100%"> <tr><td>text with accent</td> <td>DONE</td></tr> -<tr><td>text with special characters</td> <td>A LOT OF SPECIAL CHARS SUPPORTED for latin1 (all for unicode)!</td></tr> -<tr><td>layout</td> <td>DONE</td></tr> +<tr><td>text with special characters</td> <td>A LOT OF SPECIAL CHARS SUPPORTED for latin1 (all for tqunicode)!</td></tr> +<tr><td>tqlayout</td> <td>DONE</td></tr> <tr><td>title</td> <td>DONE</td></tr> <tr><td>list</td> <td>DONE</td></tr> <tr><td>paper</td> <td>DONE</td></tr> <tr><td>footnote, head</td> <td>DONE (still a little bug for first foot/header and a line is added)</td></tr> <tr><td>comments with kdoc</td> <td>STARTED</td></tr> -<tr><td>unicode support</td> <td>DONE (omega package)</td></tr> +<tr><td>tqunicode support</td> <td>DONE (omega package)</td></tr> <tr><td>break (line, page)</td> <td>STARTED</td></tr> <tr><td>indent list</td> <td></td></tr> </table> @@ -209,7 +209,7 @@ <ul> <li>features <ul> - <li>support of unicode with omega</li> + <li>support of tqunicode with omega</li> </ul> </li> </ul> @@ -264,7 +264,7 @@ <li>features <ul> <li>generate embedable file</li> - <li>new xml parser = QDom</li> + <li>new xml parser = TQDom</li> </ul> </li> </ul> @@ -281,7 +281,7 @@ </ul> </li> <li>clean code generated</li> - <li>use QList for all lists</li> + <li>use TQList for all lists</li> <li>improve the table generation. Now it is pretty good.</li> <li>new features <ul> diff --git a/filters/kword/libexport/KWEFBaseWorker.cc b/filters/kword/libexport/KWEFBaseWorker.cc index 96de938b..d3d41ff3 100644 --- a/filters/kword/libexport/KWEFBaseWorker.cc +++ b/filters/kword/libexport/KWEFBaseWorker.cc @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qbuffer.h> -#include <qimage.h> +#include <tqbuffer.h> +#include <tqimage.h> #include <kdebug.h> @@ -44,7 +44,7 @@ bool KWEFBaseWorker::doAbortFile(void) return doCloseFile(); } -bool KWEFBaseWorker::doFullDocument (const QValueList<ParaData>& paraList) +bool KWEFBaseWorker::doFullDocument (const TQValueList<ParaData>& paraList) { if (!doOpenTextFrameSet()) return false; @@ -56,19 +56,19 @@ bool KWEFBaseWorker::doFullDocument (const QValueList<ParaData>& paraList) return true; } -bool KWEFBaseWorker::doFullAllParagraphs (const QValueList<ParaData>& paraList) +bool KWEFBaseWorker::doFullAllParagraphs (const TQValueList<ParaData>& paraList) { - QValueList<ParaData>::ConstIterator it; - QValueList<ParaData>::ConstIterator end(paraList.end()); + TQValueList<ParaData>::ConstIterator it; + TQValueList<ParaData>::ConstIterator end(paraList.end()); for (it=paraList.begin();it!=end;++it) { - if (!doFullParagraph((*it).text,(*it).layout,(*it).formattingList)) + if (!doFullParagraph((*it).text,(*it).tqlayout,(*it).formattingList)) return false; } return true; } -bool KWEFBaseWorker::loadSubFile(const QString& fileName, QByteArray& array) const +bool KWEFBaseWorker::loadSubFile(const TQString& fileName, TQByteArray& array) const // return value: // true if the file is not empty // false if the file is empty or if an error occurred @@ -85,7 +85,7 @@ bool KWEFBaseWorker::loadSubFile(const QString& fileName, QByteArray& array) con return flag; } -QIODevice* KWEFBaseWorker::getSubFileDevice(const QString& fileName) const +TQIODevice* KWEFBaseWorker::getSubFileDevice(const TQString& fileName) const { if (!m_kwordLeader) { @@ -95,13 +95,13 @@ QIODevice* KWEFBaseWorker::getSubFileDevice(const QString& fileName) const return m_kwordLeader->getSubFileDevice(fileName); } -QImage KWEFBaseWorker::loadAndConvertToImage(const QString& strName, const QString& inExtension) const +TQImage KWEFBaseWorker::loadAndConvertToImage(const TQString& strName, const TQString& inExtension) const { - QIODevice* io=getSubFileDevice(strName); + TQIODevice* io=getSubFileDevice(strName); if (!io) { // NO message error, as there must be already one - return QImage(); + return TQImage(); } kdDebug(30508) << "Picture " << strName << " has size: " << io->size() << endl; @@ -110,15 +110,15 @@ QImage KWEFBaseWorker::loadAndConvertToImage(const QString& strName, const QStri if (!picture.load(io, inExtension)) // we do not care about KoPictureKey { kdWarning(30508) << "Could not read picture: " << strName << " (KWEFBaseWorker::loadAndConvertToImage)" << endl; - return QImage(); + return TQImage(); } return picture.generateImage(picture.getOriginalSize()); // ### TODO: KoPicture::getOriginalSize is bad for cliparts } -bool KWEFBaseWorker::loadAndConvertToImage(const QString& strName, const QString& inExtension, const QString& outExtension, QByteArray& image) const +bool KWEFBaseWorker::loadAndConvertToImage(const TQString& strName, const TQString& inExtension, const TQString& outExtension, TQByteArray& image) const { - QImage qimage(loadAndConvertToImage(strName,inExtension)); + TQImage qimage(loadAndConvertToImage(strName,inExtension)); if (qimage.isNull()) { @@ -126,17 +126,17 @@ bool KWEFBaseWorker::loadAndConvertToImage(const QString& strName, const QString return false; } - QImageIO imageIO; + TQImageIO imageIO; imageIO.setImage(qimage); - QBuffer buffer(image); // A QBuffer is a QIODevice + TQBuffer buffer(image); // A TQBuffer is a TQIODevice if (!buffer.open(IO_WriteOnly)) { kdWarning(30508) << "Could not open buffer! (KWEFBaseWorker::loadAndConvertToImage)" << endl; return false; } - imageIO.setIODevice(&buffer); + imageIO.setIODevice(TQT_TQIODEVICE(&buffer)); imageIO.setFormat(outExtension.utf8()); if (!imageIO.write()) @@ -161,13 +161,13 @@ bool KWEFBaseWorker::loadAndConvertToImage(const QString& strName, const QString return false;\ } -DO_FALSE_DEFINITION (doOpenFile (const QString& , const QString& )) +DO_FALSE_DEFINITION (doOpenFile (const TQString& , const TQString& )) DO_FALSE_DEFINITION (doCloseFile (void)) DO_FALSE_DEFINITION (doOpenDocument (void)) DO_FALSE_DEFINITION (doCloseDocument (void)) // The following is not generated by the leader -DO_FALSE_DEFINITION (doFullParagraph(const QString&, const LayoutData&, const ValueListFormatData&)) +DO_FALSE_DEFINITION (doFullParagraph(const TQString&, const LayoutData&, const ValueListFormatData&)) // // Thirdly, define all methods returning true @@ -194,10 +194,10 @@ DO_TRUE_DEFINITION (doCloseStyles (void)) DO_TRUE_DEFINITION (doFullDefineStyle (LayoutData&)) DO_TRUE_DEFINITION (doOpenSpellCheckIgnoreList (void)) DO_TRUE_DEFINITION (doCloseSpellCheckIgnoreList (void)) -DO_TRUE_DEFINITION (doFullSpellCheckIgnoreWord (const QString&)) +DO_TRUE_DEFINITION (doFullSpellCheckIgnoreWord (const TQString&)) DO_TRUE_DEFINITION (doHeader(const HeaderData&)) DO_TRUE_DEFINITION (doFooter(const FooterData&)) -DO_TRUE_DEFINITION ( doDeclareNonInlinedFramesets( QValueList<FrameAnchor>&, QValueList<FrameAnchor>& ) ) +DO_TRUE_DEFINITION ( doDeclareNonInlinedFramesets( TQValueList<FrameAnchor>&, TQValueList<FrameAnchor>& ) ) // The following are not generated by the leader DO_TRUE_DEFINITION (doOpenTextFrameSet (void)) diff --git a/filters/kword/libexport/KWEFBaseWorker.h b/filters/kword/libexport/KWEFBaseWorker.h index 9a1f43ca..e2046913 100644 --- a/filters/kword/libexport/KWEFBaseWorker.h +++ b/filters/kword/libexport/KWEFBaseWorker.h @@ -21,8 +21,8 @@ #ifndef KWEF_BASEWORKER_H #define KWEF_BASEWORKER_H -#include <qstring.h> -#include <qiodevice.h> +#include <tqstring.h> +#include <tqiodevice.h> #include <KWEFStructures.h> #include <koffice_export.h> @@ -40,13 +40,13 @@ class KOFFICEFILTER_EXPORT KWEFBaseWorker public: void registerKWordLeader(KWEFKWordLeader* leader); public: // callbacks to Leader - bool loadSubFile(const QString& fileName, QByteArray& array) const; - QIODevice* getSubFileDevice(const QString& fileName) const; + bool loadSubFile(const TQString& fileName, TQByteArray& array) const; + TQIODevice* getSubFileDevice(const TQString& fileName) const; public: // indirect callbacks to Leader: - QImage loadAndConvertToImage(const QString& strName, const QString& inExtension) const; - bool loadAndConvertToImage(const QString& strName, const QString& inExtension, const QString& outExtension, QByteArray& image) const; + TQImage loadAndConvertToImage(const TQString& strName, const TQString& inExtension) const; + bool loadAndConvertToImage(const TQString& strName, const TQString& inExtension, const TQString& outExtension, TQByteArray& image) const; public: // leader/worker functions - virtual bool doOpenFile (const QString& filenameOut, const QString& to); + virtual bool doOpenFile (const TQString& filenameOut, const TQString& to); virtual bool doCloseFile (void); // Close file in normal conditions virtual bool doAbortFile (void); // Close file after errors virtual bool doOpenDocument (void); // Like HTML's <html> @@ -55,9 +55,9 @@ class KOFFICEFILTER_EXPORT KWEFBaseWorker virtual bool doCloseTextFrameSet (void); // Like AbiWord's </section> virtual bool doFullDocumentInfo (const KWEFDocumentInfo &docInfo); virtual bool doVariableSettings (const VariableSettingsData &varSettings); - virtual bool doFullDocument (const QValueList<ParaData> &); - virtual bool doFullAllParagraphs (const QValueList<ParaData>& paraList); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullDocument (const TQValueList<ParaData> &); + virtual bool doFullAllParagraphs (const TQValueList<ParaData>& paraList); + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); virtual bool doFullPaperFormat (const int format, const double width, const double height, const int orientation); ///< Like AbiWord's \<papersize\> @@ -77,11 +77,11 @@ class KOFFICEFILTER_EXPORT KWEFBaseWorker virtual bool doCloseBody (void); ///< Like HTML's \</BODY\> virtual bool doOpenStyles (void); ///< Like HTML's \<style\> virtual bool doCloseStyles (void); ///< Like HTML's \</style\> - virtual bool doFullDefineStyle (LayoutData& layout); ///< Defines a single style + virtual bool doFullDefineStyle (LayoutData& tqlayout); ///< Defines a single style virtual bool doOpenSpellCheckIgnoreList (void); ///< like AbiWord's \<ignorewords\> and KWord's \<SPELLCHECKIGNORELIST\> virtual bool doCloseSpellCheckIgnoreList (void); ///< like AbiWord's \</ignorewords\> and Kwords \</SPELLCHECKIGNORELIST\> - virtual bool doFullSpellCheckIgnoreWord (const QString& ignoreword); ///< like AbiWord's \<iw\> and Kwords \</SPELLCHECKIGNOREWORD\> - virtual bool doDeclareNonInlinedFramesets( QValueList<FrameAnchor>& pictureAnchors, QValueList<FrameAnchor>& tableAnchors ); ///< @since 1.4 + virtual bool doFullSpellCheckIgnoreWord (const TQString& ignoreword); ///< like AbiWord's \<iw\> and Kwords \</SPELLCHECKIGNOREWORD\> + virtual bool doDeclareNonInlinedFramesets( TQValueList<FrameAnchor>& pictureAnchors, TQValueList<FrameAnchor>& tableAnchors ); ///< @since 1.4 protected: KWEFKWordLeader* m_kwordLeader; }; diff --git a/filters/kword/libexport/KWEFKWordLeader.cc b/filters/kword/libexport/KWEFKWordLeader.cc index 2d3c0547..4a966dad 100644 --- a/filters/kword/libexport/KWEFKWordLeader.cc +++ b/filters/kword/libexport/KWEFKWordLeader.cc @@ -33,8 +33,8 @@ License version 2. */ -#include <qfile.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqdom.h> #include <kdebug.h> #include <klocale.h> @@ -65,10 +65,10 @@ KWEFKWordLeader::~KWEFKWordLeader(void) } static FrameAnchor *findAnchor ( const KoPictureKey& key, - QValueList<ParaData>& paraList ) + TQValueList<ParaData>& paraList ) { kdDebug(30508) << "findAnchor " << key.toString() << endl; - QValueList<ParaData>::Iterator paraIt; + TQValueList<ParaData>::Iterator paraIt; for ( paraIt = paraList.begin (); paraIt != paraList.end (); ++paraIt ) { @@ -91,18 +91,18 @@ static FrameAnchor *findAnchor ( const KoPictureKey& key, return NULL; } -static void ProcessHardBrkTag ( QDomNode myNode, void* tagData, KWEFKWordLeader* ) +static void ProcessHardBrkTag ( TQDomNode myNode, void* tagData, KWEFKWordLeader* ) { // <HARDBRK> bool* flag = (bool*) tagData; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "frame", *flag ); ProcessAttributes (myNode, attrProcessingList); if (*flag) kdDebug(30508) << "<HARDBRK frame=\"1\"> found" << endl; } -static void InsertBookmarkFormatData (const int pos, const QString& name, const bool start, +static void InsertBookmarkFormatData (const int pos, const TQString& name, const bool start, ValueListFormatData ¶FormatDataList) { ValueListFormatData::Iterator paraFormatDataIt; @@ -143,7 +143,7 @@ void KWEFKWordLeader::createBookmarkFormatData( ParaData& paraData ) { const int paraCount = m_paraCountMap[ m_currentFramesetName ]; - QValueList<Bookmark>::ConstIterator it; + TQValueList<Bookmark>::ConstIterator it; for (it = m_bookmarkList.begin(); it != m_bookmarkList.end(); ++it ) { if ( (*(it)).m_frameset != m_currentFramesetName ) @@ -165,7 +165,7 @@ void KWEFKWordLeader::createBookmarkFormatData( ParaData& paraData ) } } -static void ProcessParagraphTag ( QDomNode myNode, +static void ProcessParagraphTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { @@ -173,12 +173,12 @@ static void ProcessParagraphTag ( QDomNode myNode, kdDebug (30508) << "ProcessParagraphTag () - Begin" << endl; #endif - QValueList<ParaData> *paraList = (QValueList<ParaData> *) tagData; + TQValueList<ParaData> *paraList = (TQValueList<ParaData> *) tagData; AllowNoAttributes (myNode); // We need to adjust the paragraph number (0 if first) - QMap<QString,int>::Iterator it = leader->m_paraCountMap.find( leader->m_currentFramesetName ); + TQMap<TQString,int>::Iterator it = leader->m_paraCountMap.tqfind( leader->m_currentFramesetName ); if ( it == leader->m_paraCountMap.end() ) leader->m_paraCountMap.insert( leader->m_currentFramesetName, 0 ); else @@ -186,14 +186,14 @@ static void ProcessParagraphTag ( QDomNode myNode, ParaData paraData; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "TEXT", ProcessTextTag, ¶Data.text ) << TagProcessing ( "FORMATS", ProcessFormatsTag, ¶Data.formattingList ) - << TagProcessing ( "LAYOUT", ProcessLayoutTag, ¶Data.layout ); + << TagProcessing ( "LAYOUT", ProcessLayoutTag, ¶Data.tqlayout ); if ( leader->m_oldSyntax ) { - tagProcessingList.append( TagProcessing( "HARDBRK", ProcessHardBrkTag, ¶Data.layout.pageBreakBefore ) ); + tagProcessingList.append( TagProcessing( "HARDBRK", ProcessHardBrkTag, ¶Data.tqlayout.pageBreakBefore ) ); } ProcessSubtags (myNode, tagProcessingList, leader); @@ -203,9 +203,9 @@ static void ProcessParagraphTag ( QDomNode myNode, // TODO/FIXME: why !paraData.text.isEmpty() if ( paraData.formattingList.isEmpty () && !paraData.text.isEmpty () ) { - if ( paraData.layout.formatData.id == 1 ) + if ( paraData.tqlayout.formatData.id == 1 ) { - paraData.formattingList << paraData.layout.formatData; + paraData.formattingList << paraData.tqlayout.formatData; } else { @@ -222,7 +222,7 @@ static void ProcessParagraphTag ( QDomNode myNode, } -static void ProcessFrameTag ( QDomNode myNode, void *tagData, +static void ProcessFrameTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { FrameAnchor* frameAnchor= (FrameAnchor*) tagData; @@ -238,7 +238,7 @@ static void ProcessFrameTag ( QDomNode myNode, void *tagData, frameAnchor->frame.tWidth=0.0; frameAnchor->frame.bWidth=0.0; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "right", frameAnchor->frame.right ) << AttrProcessing ( "left", frameAnchor->frame.left ) @@ -321,11 +321,11 @@ static void ProcessFrameTag ( QDomNode myNode, void *tagData, AllowNoSubtags (myNode, leader); } -static void ProcessPictureAnchor( QDomNode myNode, KWEFKWordLeader *leader, FrameAnchor* frameAnchor, const int frameType ) +static void ProcessPictureAnchor( TQDomNode myNode, KWEFKWordLeader *leader, FrameAnchor* frameAnchor, const int frameType ) { frameAnchor->type = frameType; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "FRAME", ProcessFrameTag, frameAnchor ) << TagProcessing ( "PICTURE", ProcessImageTag, &frameAnchor->picture.key ) @@ -339,13 +339,13 @@ static void ProcessPictureAnchor( QDomNode myNode, KWEFKWordLeader *leader, Fram frameAnchor->key = frameAnchor->picture.key; } -static void ProcessTableAnchor( QDomNode myNode, KWEFKWordLeader *leader, FrameAnchor* frameAnchor, +static void ProcessTableAnchor( TQDomNode myNode, KWEFKWordLeader *leader, FrameAnchor* frameAnchor, const int col, const int row, const int cols, const int rows ) { frameAnchor->type = 6; // Table - QValueList<ParaData> cellParaList; - QValueList<TagProcessing> tagProcessingList; + TQValueList<ParaData> cellParaList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "FRAME", ProcessFrameTag, frameAnchor ) << TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &cellParaList ); ProcessSubtags (myNode, tagProcessingList, leader); @@ -353,7 +353,7 @@ static void ProcessTableAnchor( QDomNode myNode, KWEFKWordLeader *leader, FrameA frameAnchor->table.addCell (col, row, cols, rows, cellParaList, frameAnchor->frame); } -static void ProcessFramesetTag ( QDomNode myNode, +static void ProcessFramesetTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { @@ -361,7 +361,7 @@ static void ProcessFramesetTag ( QDomNode myNode, kdDebug (30508) << "ProcessFramesetTag () - Begin" << endl; #endif - QValueList<ParaData> *paraList = (QValueList<ParaData> *) tagData; + TQValueList<ParaData> *paraList = (TQValueList<ParaData> *) tagData; int frameType = -1; int frameInfo = -1; @@ -369,11 +369,11 @@ static void ProcessFramesetTag ( QDomNode myNode, int row = -1; int cols = -1; int rows = -1; - QString grpMgr; + TQString grpMgr; - const QString oldName ( leader->m_currentFramesetName ); + const TQString oldName ( leader->m_currentFramesetName ); - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "name", leader->m_currentFramesetName ) << AttrProcessing ( "frameType", frameType ) << AttrProcessing ( "frameInfo", frameInfo ) @@ -399,7 +399,7 @@ static void ProcessFramesetTag ( QDomNode myNode, { // Normal Text kdDebug(30508) << "Processing Frameset: " << leader->m_currentFramesetName << endl; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, paraList )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -409,7 +409,7 @@ static void ProcessFramesetTag ( QDomNode myNode, // header for first page HeaderData header; header.page = HeaderData::PAGE_FIRST; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &header.para )); @@ -421,7 +421,7 @@ static void ProcessFramesetTag ( QDomNode myNode, // header for even page HeaderData header; header.page = HeaderData::PAGE_EVEN; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &header.para )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -432,7 +432,7 @@ static void ProcessFramesetTag ( QDomNode myNode, // header for odd page (or all page, if hType=0) HeaderData header; header.page = (leader->headerType() != 0 ) ? HeaderData::PAGE_ODD : HeaderData::PAGE_ALL; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &header.para )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -443,7 +443,7 @@ static void ProcessFramesetTag ( QDomNode myNode, // footer for first page FooterData footer; footer.page = FooterData::PAGE_FIRST; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &footer.para )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -454,7 +454,7 @@ static void ProcessFramesetTag ( QDomNode myNode, // footer for even page FooterData footer; footer.page = FooterData::PAGE_EVEN; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &footer.para )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -465,7 +465,7 @@ static void ProcessFramesetTag ( QDomNode myNode, // footer for odd page (or all page, if fType=0) FooterData footer; footer.page = (leader->footerType() != 0) ? FooterData::PAGE_ODD : FooterData::PAGE_ALL; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &footer.para )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -491,7 +491,7 @@ static void ProcessFramesetTag ( QDomNode myNode, { bool found = false; KoPictureKey key( grpMgr ); - QValueList<FrameAnchor>::Iterator it; + TQValueList<FrameAnchor>::Iterator it; for ( it = leader->m_nonInlinedTableAnchors.begin(); it != leader->m_nonInlinedTableAnchors.end(); ++it ) { if ( (*it).key == key ) @@ -578,34 +578,34 @@ static void ProcessFramesetTag ( QDomNode myNode, } -static void ProcessFramesetsTag ( QDomNode myNode, +static void ProcessFramesetsTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { AllowNoAttributes (myNode); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "FRAMESET", ProcessFramesetTag, tagData ); ProcessSubtags (myNode, tagProcessingList, leader); } -static void ProcessStyleTag (QDomNode myNode, void *, KWEFKWordLeader *leader ) +static void ProcessStyleTag (TQDomNode myNode, void *, KWEFKWordLeader *leader ) { - LayoutData layout; + LayoutData tqlayout; - ProcessLayoutTag (myNode, &layout, leader); + ProcessLayoutTag (myNode, &tqlayout, leader); - leader->doFullDefineStyle (layout); + leader->doFullDefineStyle (tqlayout); } -static void ProcessStylesPluralTag (QDomNode myNode, void *, KWEFKWordLeader *leader ) +static void ProcessStylesPluralTag (TQDomNode myNode, void *, KWEFKWordLeader *leader ) { AllowNoAttributes (myNode); leader->doOpenStyles (); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "STYLE", ProcessStyleTag, leader ); ProcessSubtags (myNode, tagProcessingList, leader); @@ -613,7 +613,7 @@ static void ProcessStylesPluralTag (QDomNode myNode, void *, KWEFKWordLeader *le } -static void ProcessPaperBordersTag (QDomNode myNode, void*, KWEFKWordLeader* leader) +static void ProcessPaperBordersTag (TQDomNode myNode, void*, KWEFKWordLeader* leader) { double left = 0.0; @@ -621,7 +621,7 @@ static void ProcessPaperBordersTag (QDomNode myNode, void*, KWEFKWordLeader* lea double top = 0.0; double bottom = 0.0; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; if ( leader->m_oldSyntax ) { attrProcessingList @@ -655,7 +655,7 @@ static void ProcessPaperBordersTag (QDomNode myNode, void*, KWEFKWordLeader* lea AllowNoSubtags (myNode, leader); } -static void ProcessPaperTag (QDomNode myNode, void *, KWEFKWordLeader *leader) +static void ProcessPaperTag (TQDomNode myNode, void *, KWEFKWordLeader *leader) { int format = -1; @@ -668,7 +668,7 @@ static void ProcessPaperTag (QDomNode myNode, void *, KWEFKWordLeader *leader) double columnspacing = 36.0; // Half-inch int numPages = -1; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "format", format ) << AttrProcessing ( "width", width ) << AttrProcessing ( "height", height ) @@ -711,7 +711,7 @@ static void ProcessPaperTag (QDomNode myNode, void *, KWEFKWordLeader *leader) leader->doFullPaperFormat (format, width, height, orientation); leader->doFullPaperFormatOther( columns, columnspacing, numPages ); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "PAPERBORDERS", ProcessPaperBordersTag, NULL ) ; @@ -719,10 +719,10 @@ static void ProcessPaperTag (QDomNode myNode, void *, KWEFKWordLeader *leader) ProcessSubtags (myNode, tagProcessingList, leader); } -static void ProcessVariableSettingsTag (QDomNode myNode, void *, KWEFKWordLeader *leader) +static void ProcessVariableSettingsTag (TQDomNode myNode, void *, KWEFKWordLeader *leader) { VariableSettingsData vs; - QString print, creation, modification; // Dates (in ISO 8601 format) + TQString print, creation, modification; // Dates (in ISO 8601 format) int creationYear = -1; int creationMonth = -1; int creationDay = -1; @@ -730,7 +730,7 @@ static void ProcessVariableSettingsTag (QDomNode myNode, void *, KWEFKWordLeader int modificationMonth = -1; int modificationDay = -1; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "startingPageNumber", vs.startingPageNumber ) << AttrProcessing ( "displaylink", vs.displaylink ) << AttrProcessing ( "underlinelink", vs.underlinelink ) @@ -761,38 +761,38 @@ static void ProcessVariableSettingsTag (QDomNode myNode, void *, KWEFKWordLeader if ( creation.isEmpty() ) { - if ( ( creationYear >= 1970 ) && QDate::isValid( creationYear, creationMonth, creationDay ) ) + if ( ( creationYear >= 1970 ) && TQDate::isValid( creationYear, creationMonth, creationDay ) ) { - vs.creationTime = QDateTime( QDate( creationYear, creationMonth, creationDay ) ); + vs.creationTime = TQDateTime( TQDate( creationYear, creationMonth, creationDay ) ); } } else - vs.creationTime=QDateTime::fromString(creation, Qt::ISODate); + vs.creationTime=TQDateTime::fromString(creation, Qt::ISODate); //kdDebug(30508) << "Creation time: " << vs.creationTime.toString( Qt::ISODate ) << endl; if ( modification.isEmpty() ) { - if ( ( modificationYear >= 1970 ) && QDate::isValid( modificationYear, modificationMonth, modificationDay ) ) + if ( ( modificationYear >= 1970 ) && TQDate::isValid( modificationYear, modificationMonth, modificationDay ) ) { - vs.modificationTime = QDateTime( QDate( modificationYear, modificationMonth, modificationDay ) ); + vs.modificationTime = TQDateTime( TQDate( modificationYear, modificationMonth, modificationDay ) ); } } else - vs.modificationTime=QDateTime::fromString(modification, Qt::ISODate); + vs.modificationTime=TQDateTime::fromString(modification, Qt::ISODate); //kdDebug(30508) << "Modification time: " << vs.modificationTime.toString( Qt::ISODate ) << endl; if (!print.isEmpty()) - vs.printTime=QDateTime::fromString(print, Qt::ISODate); + vs.printTime=TQDateTime::fromString(print, Qt::ISODate); //kdDebug(30508) << "Print time: " << vs.printTime.toString( Qt::ISODate ) << endl; leader->doVariableSettings (vs); } -static void ProcessSpellCheckIgnoreWordTag (QDomNode myNode, void *, KWEFKWordLeader *leader ) +static void ProcessSpellCheckIgnoreWordTag (TQDomNode myNode, void *, KWEFKWordLeader *leader ) { - QString ignoreword; + TQString ignoreword; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "word", ignoreword ) ; @@ -804,13 +804,13 @@ static void ProcessSpellCheckIgnoreWordTag (QDomNode myNode, void *, KWEFKWordLe } -static void ProcessSpellCheckIgnoreListTag (QDomNode myNode, void *, KWEFKWordLeader *leader ) +static void ProcessSpellCheckIgnoreListTag (TQDomNode myNode, void *, KWEFKWordLeader *leader ) { AllowNoAttributes (myNode); leader->doOpenSpellCheckIgnoreList (); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "SPELLCHECKIGNOREWORD", ProcessSpellCheckIgnoreWordTag, leader ); ProcessSubtags (myNode, tagProcessingList, leader); @@ -818,17 +818,17 @@ static void ProcessSpellCheckIgnoreListTag (QDomNode myNode, void *, KWEFKWordLe } -static void ProcessPixmapsKeyTag ( QDomNode myNode, +static void ProcessPixmapsKeyTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - QValueList<ParaData> *paraList = (QValueList<ParaData> *) tagData; + TQValueList<ParaData> *paraList = (TQValueList<ParaData> *) tagData; KoPictureKey key; // Let KoPictureKey do most of the loading key.loadAttributes(myNode.toElement()); - const QString name(myNode.toElement().attribute("name")); + const TQString name(myNode.toElement().attribute("name")); kdDebug(30508) << "search anchors: " << key.toString() << endl; bool found = false; @@ -836,7 +836,7 @@ static void ProcessPixmapsKeyTag ( QDomNode myNode, // NOTE: we must always search in both inlined and non-inlined pictures. A picture can be used in both ways and a few times in each! // Process inlined pictures - QValueList<ParaData>::Iterator paraIt; + TQValueList<ParaData>::Iterator paraIt; for ( paraIt = paraList->begin(); paraIt != paraList->end(); ++paraIt ) { @@ -855,7 +855,7 @@ static void ProcessPixmapsKeyTag ( QDomNode myNode, } } // Process non-inline pictures - QValueList<FrameAnchor>::Iterator it; + TQValueList<FrameAnchor>::Iterator it; for ( it = leader->m_nonInlinedPictureAnchors.begin(); it != leader->m_nonInlinedPictureAnchors.end(); ++it ) { if ( (*it).key == key ) @@ -875,21 +875,21 @@ static void ProcessPixmapsKeyTag ( QDomNode myNode, } -static void ProcessPixmapsTag ( QDomNode myNode, +static void ProcessPixmapsTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { AllowNoAttributes (myNode); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "KEY", ProcessPixmapsKeyTag, tagData ); ProcessSubtags (myNode, tagProcessingList, leader); } -static void FreeCellParaLists ( QValueList<ParaData> ¶List ) +static void FreeCellParaLists ( TQValueList<ParaData> ¶List ) { - QValueList<ParaData>::Iterator paraIt; + TQValueList<ParaData>::Iterator paraIt; for ( paraIt = paraList.begin (); paraIt != paraList.end (); ++paraIt ) { @@ -901,7 +901,7 @@ static void FreeCellParaLists ( QValueList<ParaData> ¶List ) { if ( (*formattingIt).id == 6 && (*formattingIt).frameAnchor.type == 6 ) { - QValueList<TableCell>::Iterator cellIt; + TQValueList<TableCell>::Iterator cellIt; for ( cellIt = (*formattingIt).frameAnchor.table.cellList.begin (); cellIt != (*formattingIt).frameAnchor.table.cellList.end (); @@ -916,13 +916,13 @@ static void FreeCellParaLists ( QValueList<ParaData> ¶List ) } // like ProcessFramesetTag, but only handle footnotes -static void ProcessFootnoteFramesetTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessFootnoteFramesetTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - QString frameName; + TQString frameName; int frameType = -1, frameInfo = -1; bool visible = false; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "name", frameName ) << AttrProcessing ( "frameType", frameType ) @@ -943,7 +943,7 @@ static void ProcessFootnoteFramesetTag ( QDomNode myNode, void *tagData, KWEFKWo { FootnoteData footnote; footnote.frameName = frameName; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing ( "FRAME" )); tagProcessingList.append(TagProcessing ( "PARAGRAPH", ProcessParagraphTag, &footnote.para )); ProcessSubtags (myNode, tagProcessingList, leader); @@ -952,22 +952,22 @@ static void ProcessFootnoteFramesetTag ( QDomNode myNode, void *tagData, KWEFKWo } // like ProcessFramesetsTag, but only handle footnotes -static void ProcessFootnoteFramesetsTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessFootnoteFramesetsTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { AllowNoAttributes (myNode); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "FRAMESET", ProcessFootnoteFramesetTag, tagData ); ProcessSubtags (myNode, tagProcessingList, leader); } -static void ProcessBookmarkItemTag ( QDomNode myNode, void* tag, KWEFKWordLeader *leader ) +static void ProcessBookmarkItemTag ( TQDomNode myNode, void* tag, KWEFKWordLeader *leader ) { - QValueList<Bookmark> * bookmarkList = static_cast< QValueList<Bookmark> * > ( tag ); + TQValueList<Bookmark> * bookmarkList = static_cast< TQValueList<Bookmark> * > ( tag ); Bookmark bookmark; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "name", bookmark.m_name ) << AttrProcessing ( "cursorIndexStart", bookmark.m_cursorIndexStart ) @@ -988,23 +988,23 @@ static void ProcessBookmarkItemTag ( QDomNode myNode, void* tag, KWEFKWordLeader bookmarkList->append( bookmark ); } -static void ProcessBookmarksTag ( QDomNode myNode, void* tag, KWEFKWordLeader *leader ) +static void ProcessBookmarksTag ( TQDomNode myNode, void* tag, KWEFKWordLeader *leader ) { AllowNoAttributes (myNode); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "BOOKMARKITEM", ProcessBookmarkItemTag, tag ); ProcessSubtags (myNode, tagProcessingList, leader); } -void ProcessDocTag ( QDomNode myNode, +void ProcessDocTag ( TQDomNode myNode, void* /*tagData*/, KWEFKWordLeader* leader ) { //kdDebug (30508) << "Entering ProcessDocTag" << endl; - QString editor, author; + TQString editor, author; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "xmlns" ) @@ -1042,42 +1042,42 @@ void ProcessDocTag ( QDomNode myNode, leader->doOpenHead(); // At first, process <SPELLCHECKIGNORELIST>, even if mostly it will not be needed - QDomNode nodeIgnoreList=myNode.namedItem("SPELLCHECKIGNORELIST"); + TQDomNode nodeIgnoreList=myNode.namedItem("SPELLCHECKIGNORELIST"); if ( nodeIgnoreList.isNull () ) kdDebug (30508) << "No <SPELLCHECKIGNORELIST>" << endl; // Most files will not have it! else ProcessSpellCheckIgnoreListTag (nodeIgnoreList, NULL, leader); // Process <PAPER> now, even if mostly the output will need to be delayed. - QDomNode nodePaper=myNode.namedItem("PAPER"); + TQDomNode nodePaper=myNode.namedItem("PAPER"); if ( nodePaper.isNull () ) kdWarning (30508) << "No <PAPER>" << endl; else ProcessPaperTag (nodePaper, NULL, leader); // Process <VARIABLESETTINGS> - QDomNode nodeVariableSettings=myNode.namedItem("VARIABLESETTINGS"); + TQDomNode nodeVariableSettings=myNode.namedItem("VARIABLESETTINGS"); if ( nodeVariableSettings.isNull () ) kdWarning (30508) << "No <VARIABLESETTINGS>" << endl; else ProcessVariableSettingsTag (nodeVariableSettings, NULL, leader); // Then we process the styles - QDomNode nodeStyles=myNode.namedItem("STYLES"); + TQDomNode nodeStyles=myNode.namedItem("STYLES"); if ( nodeStyles.isNull () ) kdWarning (30508) << "No <STYLES>" << endl; else ProcessStylesPluralTag (nodeStyles, NULL, leader); // Process framesets, but only to find and extract footnotes (also endnotes) - QValueList<FootnoteData> footnotes; - QDomNode nodeFramesets=myNode.namedItem("FRAMESETS"); + TQValueList<FootnoteData> footnotes; + TQDomNode nodeFramesets=myNode.namedItem("FRAMESETS"); if ( !nodeFramesets.isNull() ) ProcessFootnoteFramesetsTag(nodeFramesets, &footnotes, leader ); // Process all framesets and pictures - QValueList<TagProcessing> tagProcessingList; - QValueList<ParaData> paraList; + TQValueList<TagProcessing> tagProcessingList; + TQValueList<ParaData> paraList; tagProcessingList << TagProcessing ( "PAPER" ) // Already done @@ -1104,7 +1104,7 @@ void ProcessDocTag ( QDomNode myNode, leader->doFullDocument (paraList); kdDebug(30508) << "Unachored Framesets : START" << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = leader->m_unanchoredFramesets.begin(); it != leader->m_unanchoredFramesets.end(); ++it ) { kdDebug(30508) << (*it) << endl; @@ -1144,7 +1144,7 @@ KWEFBaseWorker *KWEFKWordLeader::getWorker(void) const } -bool KWEFKWordLeader::doOpenFile ( const QString &filenameOut, const QString &to ) +bool KWEFKWordLeader::doOpenFile ( const TQString &filenameOut, const TQString &to ) { if ( m_worker ) return m_worker->doOpenFile (filenameOut, to); @@ -1187,7 +1187,7 @@ bool KWEFKWordLeader::doVariableSettings (const VariableSettingsData &varSetting } -bool KWEFKWordLeader::doFullDocument (const QValueList<ParaData> ¶List) +bool KWEFKWordLeader::doFullDocument (const TQValueList<ParaData> ¶List) { if ( m_worker ) return m_worker->doFullDocument (paraList); @@ -1227,15 +1227,15 @@ bool KWEFKWordLeader::doFullPaperFormatOther ( const int columns, const double c return false; } -bool KWEFKWordLeader::doFullDefineStyle ( LayoutData &layout ) +bool KWEFKWordLeader::doFullDefineStyle ( LayoutData &tqlayout ) { if ( m_worker ) - return m_worker->doFullDefineStyle (layout); + return m_worker->doFullDefineStyle (tqlayout); return false; } -bool KWEFKWordLeader::doFullSpellCheckIgnoreWord (const QString& ignoreword) +bool KWEFKWordLeader::doFullSpellCheckIgnoreWord (const TQString& ignoreword) { if ( m_worker ) return m_worker->doFullSpellCheckIgnoreWord (ignoreword); @@ -1259,7 +1259,7 @@ bool KWEFKWordLeader::doFooter ( const FooterData& footer ) return false; } -bool KWEFKWordLeader::doDeclareNonInlinedFramesets( QValueList<FrameAnchor>& pictureAnchors, QValueList<FrameAnchor>& tableAnchors ) +bool KWEFKWordLeader::doDeclareNonInlinedFramesets( TQValueList<FrameAnchor>& pictureAnchors, TQValueList<FrameAnchor>& tableAnchors ) { if ( m_worker ) return m_worker->doDeclareNonInlinedFramesets( pictureAnchors, tableAnchors ); @@ -1267,9 +1267,9 @@ bool KWEFKWordLeader::doDeclareNonInlinedFramesets( QValueList<FrameAnchor>& pic return false; } -static bool ParseFile ( QIODevice* subFile, QDomDocument& doc) +static bool ParseFile ( TQIODevice* subFile, TQDomDocument& doc) { - QString errorMsg; + TQString errorMsg; int errorLine; int errorColumn; @@ -1280,15 +1280,15 @@ static bool ParseFile ( QIODevice* subFile, QDomDocument& doc) << " Message: " << errorMsg << endl; // ### TODO: the error is in which sub-file? KMessageBox::error( 0L, i18n("An error has occurred while parsing the KWord file.\nAt line: %1, column %2\nError message: %3") - .arg( errorLine ).arg( errorColumn ).arg(i18n( "QXml", errorMsg.utf8() ) ), + .tqarg( errorLine ).tqarg( errorColumn ).tqarg(i18n( "TQXml", errorMsg.utf8() ) ), i18n("KWord Export Filter Library"), 0 ); return false; } return true; } -static bool ProcessStoreFile ( QIODevice* subFile, - void (*processor) (QDomNode, void *, KWEFKWordLeader *), +static bool ProcessStoreFile ( TQIODevice* subFile, + void (*processor) (TQDomNode, void *, KWEFKWordLeader *), KWEFKWordLeader* leader) { if (!subFile) @@ -1298,7 +1298,7 @@ static bool ProcessStoreFile ( QIODevice* subFile, else if ( subFile->open ( IO_ReadOnly ) ) { kdDebug (30508) << "Processing Document..." << endl; - QDomDocument doc; + TQDomDocument doc; if (!ParseFile(subFile, doc)) { subFile->close(); @@ -1309,7 +1309,7 @@ static bool ProcessStoreFile ( QIODevice* subFile, // However, it would crash if two sub files are opened together subFile->close(); - QDomNode docNode = doc.documentElement(); + TQDomNode docNode = doc.documentElement(); processor (docNode, NULL, leader); return true; } @@ -1321,7 +1321,7 @@ static bool ProcessStoreFile ( QIODevice* subFile, return false; } -QIODevice* KWEFKWordLeader::getSubFileDevice(const QString& fileName) +TQIODevice* KWEFKWordLeader::getSubFileDevice(const TQString& fileName) { KoStoreDevice* subFile; @@ -1336,7 +1336,7 @@ QIODevice* KWEFKWordLeader::getSubFileDevice(const QString& fileName) } -bool KWEFKWordLeader::loadSubFile(const QString& fileName, QByteArray& array) +bool KWEFKWordLeader::loadSubFile(const TQString& fileName, TQByteArray& array) { KoStoreDevice* subFile; @@ -1361,8 +1361,8 @@ bool KWEFKWordLeader::loadSubFile(const QString& fileName, QByteArray& array) return true; } -KoFilter::ConversionStatus KWEFKWordLeader::convert( KoFilterChain* chain, - const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus KWEFKWordLeader::convert( KoFilterChain* chain, + const TQCString& from, const TQCString& to) { if ( from != "application/x-kword" ) { @@ -1403,7 +1403,7 @@ KoFilter::ConversionStatus KWEFKWordLeader::convert( KoFilterChain* chain, { kdWarning(30508) << "Opening root has failed. Trying raw XML file!" << endl; - const QString filename( chain->inputFile() ); + const TQString filename( chain->inputFile() ); if (filename.isEmpty() ) { kdError(30508) << "Could not open document as raw XML! Aborting!" << endl; @@ -1412,8 +1412,8 @@ KoFilter::ConversionStatus KWEFKWordLeader::convert( KoFilterChain* chain, } else { - QFile file( filename ); - if ( ! ProcessStoreFile( &file, ProcessDocTag, this ) ) + TQFile file( filename ); + if ( ! ProcessStoreFile( TQT_TQIODEVICE(&file), ProcessDocTag, this ) ) { kdError(30508) << "Could not process document! Aborting!" << endl; doAbortFile(); diff --git a/filters/kword/libexport/KWEFKWordLeader.h b/filters/kword/libexport/KWEFKWordLeader.h index 1aef9274..78ce1348 100644 --- a/filters/kword/libexport/KWEFKWordLeader.h +++ b/filters/kword/libexport/KWEFKWordLeader.h @@ -21,7 +21,7 @@ #ifndef KWEF_KWORDLEADER_H #define KWEF_KWORDLEADER_H -#include <qiodevice.h> +#include <tqiodevice.h> #include <KoFilterChain.h> @@ -38,17 +38,17 @@ class KOFFICEFILTER_EXPORT KWEFKWordLeader public: void setWorker ( KWEFBaseWorker *newWorker ); KWEFBaseWorker *getWorker(void) const; - KoFilter::ConversionStatus convert( KoFilterChain* chain, - const QCString& from, const QCString& to); + KoFilter::ConversiontqStatus convert( KoFilterChain* chain, + const TQCString& from, const TQCString& to); public: // ### TODO: where to put in the end? void createBookmarkFormatData( ParaData& paraData ); public: // callbacks - bool loadSubFile(const QString& fileName, QByteArray& array); - QIODevice* getSubFileDevice(const QString& fileName); + bool loadSubFile(const TQString& fileName, TQByteArray& array); + TQIODevice* getSubFileDevice(const TQString& fileName); public: // public leader/worker functions (DO NOT use in your own code!) bool doFullDocumentInfo (const KWEFDocumentInfo &docInfo); bool doVariableSettings (const VariableSettingsData &varSettings); - bool doFullDocument (const QValueList<ParaData> &); + bool doFullDocument (const TQValueList<ParaData> &); bool doPageInfo (const int headerType, const int footerType); bool doFullPaperFormat (const int format, const double width, const double height, const int orientation); bool doFullPaperBorders (const double top, const double left, const double bottom, const double right); @@ -63,15 +63,15 @@ class KOFFICEFILTER_EXPORT KWEFKWordLeader bool doCloseBody (void); bool doOpenStyles (void); bool doCloseStyles (void); - bool doFullDefineStyle (LayoutData& layout); + bool doFullDefineStyle (LayoutData& tqlayout); bool doOpenSpellCheckIgnoreList (void); bool doCloseSpellCheckIgnoreList (void); - bool doFullSpellCheckIgnoreWord (const QString& ignoreword); + bool doFullSpellCheckIgnoreWord (const TQString& ignoreword); bool doHeader(const HeaderData&); bool doFooter(const FooterData&); - bool doDeclareNonInlinedFramesets( QValueList<FrameAnchor>& pictureAnchors, QValueList<FrameAnchor>& tableAnchors ); ///< @since 1.4 + bool doDeclareNonInlinedFramesets( TQValueList<FrameAnchor>& pictureAnchors, TQValueList<FrameAnchor>& tableAnchors ); ///< @since 1.4 - QValueList<FootnoteData> footnoteList; + TQValueList<FootnoteData> footnoteList; void setHeaderType(int hType) { m_hType = hType; } void setFooterType(int fType) { m_fType = fType; } @@ -79,7 +79,7 @@ class KOFFICEFILTER_EXPORT KWEFKWordLeader int footerType() { return m_fType; } protected: // leader/worker functions - bool doOpenFile (const QString& filenameOut, const QString& to); + bool doOpenFile (const TQString& filenameOut, const TQString& to); bool doCloseFile (void); bool doAbortFile (void); bool doOpenDocument (void); @@ -90,14 +90,14 @@ class KOFFICEFILTER_EXPORT KWEFKWordLeader /// true if oldSyntax (KWord 0.8) bool m_oldSyntax; /// Name of the current frame set - QString m_currentFramesetName; + TQString m_currentFramesetName; /// Number of paragraph in each frameset (for bookmarks) - QMap<QString,int> m_paraCountMap; + TQMap<TQString,int> m_paraCountMap; /// List of bookmarks - QValueList<Bookmark> m_bookmarkList; - QStringList m_unanchoredFramesets; ///< List of framesets where an anchor was searched but not found (DEBUG) @since 1.4 - QValueList<FrameAnchor> m_nonInlinedPictureAnchors; ///< Pseudo-anchors for non-inlined anchors @since 1.4 - QValueList<FrameAnchor> m_nonInlinedTableAnchors; ///< Pseudo-anchors for non-inlined tables @since 1.4 + TQValueList<Bookmark> m_bookmarkList; + TQStringList m_unanchoredFramesets; ///< List of framesets where an anchor was searched but not found (DEBUG) @since 1.4 + TQValueList<FrameAnchor> m_nonInlinedPictureAnchors; ///< Pseudo-anchors for non-inlined anchors @since 1.4 + TQValueList<FrameAnchor> m_nonInlinedTableAnchors; ///< Pseudo-anchors for non-inlined tables @since 1.4 private: KWEFBaseWorker *m_worker; KoFilterChain* m_chain; diff --git a/filters/kword/libexport/KWEFStructures.cc b/filters/kword/libexport/KWEFStructures.cc index 36c1859c..6c9c301f 100644 --- a/filters/kword/libexport/KWEFStructures.cc +++ b/filters/kword/libexport/KWEFStructures.cc @@ -38,14 +38,14 @@ TableCell::~TableCell ( void ) #endif } -void Table::addCell ( int c, int r, int _cols, int _rows, QValueList<ParaData> &p, FrameData &frameData ) +void Table::addCell ( int c, int r, int _cols, int _rows, TQValueList<ParaData> &p, FrameData &frameData ) { if ( c + _cols > cols ) { cols = c + _cols; } - cellList << TableCell ( c, r, _cols, _rows, new QValueList<ParaData> (p), frameData ); + cellList << TableCell ( c, r, _cols, _rows, new TQValueList<ParaData> (p), frameData ); } bool TabulatorData::operator == (const TabulatorData& other) const @@ -56,23 +56,23 @@ bool TabulatorData::operator == (const TabulatorData& other) const && (m_width==other.m_width)); } -void VariableData::setLink(const QString& linkName, const QString& hrefName) +void VariableData::setLink(const TQString& linkName, const TQString& hrefName) { propertyMap["link:linkName"]=linkName; propertyMap["link:hrefName"]=hrefName; } -QString VariableData::getLinkName(void) const +TQString VariableData::getLinkName(void) const { return propertyMap["link:linkName"]; } -QString VariableData::getHrefName(void) const +TQString VariableData::getHrefName(void) const { return propertyMap["link:hrefName"]; } -void VariableData::setPgNum(const QString& subtype, const QString& value) +void VariableData::setPgNum(const TQString& subtype, const TQString& value) { propertyMap["pgnum:subtype"]=subtype; propertyMap["pgnum:value"]=value; @@ -90,23 +90,23 @@ bool VariableData::isPageCount(void) const return (num==1); } -void VariableData::setField(const QString& name, const QString& value) +void VariableData::setField(const TQString& name, const TQString& value) { propertyMap["field:name"]=name; propertyMap["field:value"]=value; } -QString VariableData::getFieldName(void) const +TQString VariableData::getFieldName(void) const { return propertyMap["field:name"]; } -QString VariableData::getFieldValue(void) const +TQString VariableData::getFieldValue(void) const { return propertyMap["field:value"]; } -void VariableData::setFootnote( const QString& notetype, const QString& automatic,const QString& value, QValueList<ParaData>* para) +void VariableData::setFootnote( const TQString& notetype, const TQString& automatic,const TQString& value, TQValueList<ParaData>* para) { propertyMap["footnote:value"] = value; propertyMap["footnote:auto"] = automatic; @@ -119,7 +119,7 @@ bool VariableData::getFootnoteAuto(void) const return propertyMap["footnote:auto"]=="auto"; } -QString VariableData::getFootnoteValue(void) const +TQString VariableData::getFootnoteValue(void) const { return propertyMap["footnote:value"]; } @@ -129,17 +129,17 @@ bool VariableData::getFootnoteType( void ) const return propertyMap["footnote:notetype"] == "footnote"; } -QValueList<ParaData>* VariableData::getFootnotePara(void) const +TQValueList<ParaData>* VariableData::getFootnotePara(void) const { return footnotePara; } -void VariableData::setGenericData( const QString& key, const QString& data ) +void VariableData::setGenericData( const TQString& key, const TQString& data ) { propertyMap[ key ] = data ; } -QString VariableData::getGenericData( const QString& key ) const +TQString VariableData::getGenericData( const TQString& key ) const { return propertyMap[ key ]; } @@ -149,7 +149,7 @@ Bookmark::Bookmark() { } -void CreateMissingFormatData (QString ¶Text, ValueListFormatData ¶FormatDataList) +void CreateMissingFormatData (TQString ¶Text, ValueListFormatData ¶FormatDataList) { ValueListFormatData::Iterator paraFormatDataIt; int lastPos=0; // last position diff --git a/filters/kword/libexport/KWEFStructures.h b/filters/kword/libexport/KWEFStructures.h index d9efe278..dbee22d0 100644 --- a/filters/kword/libexport/KWEFStructures.h +++ b/filters/kword/libexport/KWEFStructures.h @@ -40,12 +40,12 @@ #ifndef EXPORTFILTERSSTRUCTURES_H #define EXPORTFILTERSSTRUCTURES_H -#include <qvaluelist.h> -#include <qstring.h> -#include <qmap.h> -#include <qcolor.h> -#include <qdom.h> -#include <qdatetime.h> +#include <tqvaluelist.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqcolor.h> +#include <tqdom.h> +#include <tqdatetime.h> #include <KoPictureKey.h> #include <koffice_export.h> @@ -65,48 +65,48 @@ class TextFormatting weight (50), fontSize (0), verticalAlignment (0), missing (newMissing) {} - TextFormatting ( QString f, + TextFormatting ( TQString f, bool i, bool u, bool s, int w, int sz, - QColor fg, - QColor bg, + TQColor fg, + TQColor bg, int v) : fontName (f), italic (i), underline (u), underlineWord(false), strikeout(s), strikeoutWord( false ), weight (w), fontSize (sz), fgColor (fg), bgColor (bg), verticalAlignment (v), missing (false) {} - QString fontName; + TQString fontName; bool italic; bool underline; ///< Any underline? (If true, we do not know if simple or double or what else) - QString underlineValue; ///< "value" of the underline: single, double, bold-single... - QString underlineStyle; ///< underline style: solid, dash, dot dash, .... + TQString underlineValue; ///< "value" of the underline: single, double, bold-single... + TQString underlineStyle; ///< underline style: solid, dash, dot dash, .... bool underlineWord; ///< true if word-by-word (i.e spaces are not underlined) - QColor underlineColor; ///< color of the line + TQColor underlineColor; ///< color of the line bool strikeout; ///< true if strikeout - QString strikeoutType; ///< type of strikeout: single, bold, double - QString strikeoutLineStyle; ///< type of the strikeout line: solid, dash, dot, .... + TQString strikeoutType; ///< type of strikeout: single, bold, double + TQString strikeoutLineStyle; ///< type of the strikeout line: solid, dash, dot, .... bool strikeoutWord; ///< \todo: not finished ### int weight; int fontSize; - QColor fgColor; - QColor bgColor; + TQColor fgColor; + TQColor bgColor; int verticalAlignment; - QString fontAttribute; + TQString fontAttribute; /** * Language code * @note the test language "xx" in converted to "en_US" */ - QString language; + TQString language; bool missing; ///< true if this TextFormatting object does not correspond to a real \<FORMAT\> element }; @@ -118,7 +118,7 @@ class Picture Picture () {} KoPictureKey key; ///< Picture key: where the picture came from - QString koStoreName; ///< Picture store name: filename within KWord archive + TQString koStoreName; ///< Picture store name: filename within KWord archive }; /** @@ -135,7 +135,7 @@ public: double bottom; double minHeight; int runaround; - QString runaroundSide; + TQString runaroundSide; double runaroundGap; int autoCreateNewFrame; int newFrameBehavior; @@ -144,14 +144,14 @@ public: double lWidth, rWidth, tWidth, bWidth; - QColor lColor; - QColor rColor; - QColor tColor; - QColor bColor; + TQColor lColor; + TQColor rColor; + TQColor tColor; + TQColor bColor; int lStyle, rStyle, tStyle, bStyle; - QColor bkColor; + TQColor bkColor; int bkStyle; double bleftpt, brightpt, btoppt, bbottompt; }; @@ -165,7 +165,7 @@ class KOFFICEFILTER_EXPORT TableCell TableCell (): col( 0 ), row( 0 ), m_cols( 0 ), m_rows( 0 ), paraList( 0 ) {} /// \since 1.4 (changes of parameters) - TableCell ( int c, int r, int _cols, int _rows, QValueList<ParaData> *p, FrameData &frameData ) + TableCell ( int c, int r, int _cols, int _rows, TQValueList<ParaData> *p, FrameData &frameData ) : col (c), row (r), m_cols( _cols ), m_rows( _rows ), paraList (p), frame (frameData) {} ~TableCell (); @@ -174,7 +174,7 @@ class KOFFICEFILTER_EXPORT TableCell int row; int m_cols; ///< \since 1.4 int m_rows; ///< \since 1.4 - QValueList<ParaData> *paraList; + TQValueList<ParaData> *paraList; FrameData frame; }; @@ -185,10 +185,10 @@ class Table Table () : cols (0) {} /// \since 1.4 (change of parameters) - void addCell ( int c, int r, int _cols, int _rows, QValueList<ParaData> &p, FrameData &frameData ); + void addCell ( int c, int r, int _cols, int _rows, TQValueList<ParaData> &p, FrameData &frameData ); int cols; - QValueList<TableCell> cellList; + TQValueList<TableCell> cellList; }; @@ -216,7 +216,7 @@ class KOFFICEFILTER_EXPORT VariableData { public: VariableData (): m_type(-1), footnotePara(0) {} - VariableData ( const QString& text ) : m_text(text), m_type(-1) {} + VariableData ( const TQString& text ) : m_text(text), m_type(-1) {} VariableData ( const VariableData& other ) : m_key(other.m_key), m_text(other.m_text), m_type(other.m_type), propertyMap(other.propertyMap), @@ -225,33 +225,33 @@ public: /** * Set parameters of a LINK element */ - void setLink(const QString& linkName, const QString& hrefName); - QString getLinkName(void) const; ///< Name of link (attribute "linkName" of \<LINK\>) - QString getHrefName(void) const; ///< Reference of link (attribute "hrefName" of \<LINK\>) + void setLink(const TQString& linkName, const TQString& hrefName); + TQString getLinkName(void) const; ///< Name of link (attribute "linkName" of \<LINK\>) + TQString getHrefName(void) const; ///< Reference of link (attribute "hrefName" of \<LINK\>) /** * Set parameters of a PGNUM element */ - void setPgNum(const QString& subtype, const QString& value); + void setPgNum(const TQString& subtype, const TQString& value); bool isPageNumber(void) const; bool isPageCount(void) const; /** * Set parameters of a FIELD element */ - void setField(const QString& subtype, const QString& value); - QString getFieldName(void) const; - QString getFieldValue(void) const; + void setField(const TQString& subtype, const TQString& value); + TQString getFieldName(void) const; + TQString getFieldValue(void) const; /** * Set parameters of a \<FOOTNOTE\> element * @since 1.4 (change of parameters) */ - void setFootnote( const QString& notetype, const QString& automatic, const QString& value, QValueList<ParaData>* para ); + void setFootnote( const TQString& notetype, const TQString& automatic, const TQString& value, TQValueList<ParaData>* para ); /** * Is the footnote an automatic one? * @return true for an automatical foornote, false for a manual footnote */ bool getFootnoteAuto(void) const; /// Get the value (counter) of the footnote - QString getFootnoteValue(void) const; + TQString getFootnoteValue(void) const; /** * Get type of footnote * @return true for footnote, false for endnote @@ -259,26 +259,26 @@ public: */ bool getFootnoteType( void ) const; /// Paragrapgh of the footnote - QValueList<ParaData>* getFootnotePara(void) const; + TQValueList<ParaData>* getFootnotePara(void) const; /** * Set generic variable data * @since 1.3.1, 1.4 */ - void setGenericData( const QString& key, const QString& data ); + void setGenericData( const TQString& key, const TQString& data ); /** * Get generic variable data * @since 1.3.1, 1.4 */ - QString getGenericData( const QString& key ) const; + TQString getGenericData( const TQString& key ) const; - QString m_key; - QString m_text; + TQString m_key; + TQString m_text; int m_type; protected: - QMap<QString,QString> propertyMap; - QValueList<ParaData>* footnotePara; + TQMap<TQString,TQString> propertyMap; + TQValueList<ParaData>* footnotePara; }; class FormatData @@ -310,7 +310,7 @@ public: }; -class ValueListFormatData : public QValueList<FormatData> +class ValueListFormatData : public TQValueList<FormatData> { public: ValueListFormatData (void) { } @@ -353,14 +353,14 @@ public: Style style; /*unsigned*/ int depth; int start; - QString lefttext; - QString righttext; + TQString lefttext; + TQString righttext; - int /*QChar*/ customCharacter; - QString customFont; - //QString custom; + int /*TQChar*/ customCharacter; + TQString customFont; + //TQString custom; - QString text; ///< text at the time of saving (no formatting info though) + TQString text; ///< text at the time of saving (no formatting info though) }; @@ -370,7 +370,7 @@ class BorderData public: BorderData() : style(0), width(0.0) {} public: - QColor color; + TQColor color; int style; double width; }; @@ -405,14 +405,14 @@ public: /** * List of tabulators */ -class TabulatorList : public QValueList<TabulatorData> +class TabulatorList : public TQValueList<TabulatorData> { public: TabulatorList(void) {} virtual ~TabulatorList(void) {} }; -/// Paragraph layout +/// Paragraph tqlayout class LayoutData { public: @@ -426,9 +426,9 @@ public: enum { LS_CUSTOM = 0, LS_SINGLE = 10, LS_ONEANDHALF = 15, LS_DOUBLE = 20, LS_ATLEAST = 30, LS_MULTIPLE = 40, LS_FIXED = 50 }; - QString styleName; - QString styleFollowing; - QString alignment; ///< left, right, center, justify + TQString styleName; + TQString styleFollowing; + TQString tqalignment; ///< left, right, center, justify CounterData counter; FormatData formatData; double indentFirst; ///< indentation correction of first line (can be negative!) @@ -446,7 +446,7 @@ public: double shadowDistance; ///< distance of \<SHADOW\> int shadowDirection;///< direction of \<SHADOW\> - QColor shadowColor; ///< red, green, blue of \<SHADOW\> + TQColor shadowColor; ///< red, green, blue of \<SHADOW\> BorderData leftBorder; BorderData rightBorder; BorderData topBorder; @@ -457,9 +457,9 @@ public: struct ParaData { - QString text; + TQString text; ValueListFormatData formattingList; - LayoutData layout; + LayoutData tqlayout; }; struct HeaderFooterData @@ -473,7 +473,7 @@ struct HeaderFooterData }; HeaderFooterPage page; - QValueList<ParaData> para; + TQValueList<ParaData> para; }; typedef HeaderFooterData HeaderData; @@ -482,8 +482,8 @@ typedef HeaderFooterData FooterData; /// data for \<FRAMESET\> which holds footnotes struct FootnoteData { - QString frameName; - QValueList<ParaData> para; + TQString frameName; + TQValueList<ParaData> para; }; /// see \<VARIABLESETTINGS\> in the KWord DTD @@ -503,35 +503,35 @@ public: bool underlinelink; bool displaycomment; bool displayfieldcode; - QDateTime creationTime; - QDateTime modificationTime; - QDateTime printTime; + TQDateTime creationTime; + TQDateTime modificationTime; + TQDateTime printTime; }; class KWEFDocumentInfo { public: - KWEFDocumentInfo(void) { } // Initiate all QString + KWEFDocumentInfo(void) { } // Initiate all TQString public: // <ABOUT> - QString title; - QString abstract; - QString keywords; - QString subject; + TQString title; + TQString abstract; + TQString keywords; + TQString subject; // <AUTHOR> - QString fullName; - QString jobTitle; - QString company; - QString email; - QString telephone; - QString fax; - QString country; - QString postalCode; - QString city; - QString street; - QString initial; - QString position; - QString telephonework; + TQString fullName; + TQString jobTitle; + TQString company; + TQString email; + TQString telephone; + TQString fax; + TQString country; + TQString postalCode; + TQString city; + TQString street; + TQString initial; + TQString position; + TQString telephonework; }; /// \since 1.4 @@ -540,9 +540,9 @@ class Bookmark public: Bookmark(); /// Bookmark name - QString m_name; + TQString m_name; /// Name of the frameset where the bookmark is - QString m_frameset; + TQString m_frameset; /// Number of the paragrapgh where the booksmark starts int m_startparag; /// Number of the paragrapgh where the booksmark starts @@ -555,6 +555,6 @@ public: // Helper functions -void CreateMissingFormatData ( QString ¶Text, ValueListFormatData ¶FormatDataList ); +void CreateMissingFormatData ( TQString ¶Text, ValueListFormatData ¶FormatDataList ); #endif /* EXPORTFILTERSSTRUCTURES_H */ diff --git a/filters/kword/libexport/KWEFUtil.cc b/filters/kword/libexport/KWEFUtil.cc index 6dc80de6..56e2b669 100644 --- a/filters/kword/libexport/KWEFUtil.cc +++ b/filters/kword/libexport/KWEFUtil.cc @@ -18,25 +18,25 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextcodec.h> +#include <tqstring.h> +#include <tqtextcodec.h> #include <KoPageLayout.h> #include "KWEFUtil.h" -QString KWEFUtil::EscapeSgmlText(const QTextCodec* codec, - const QString& strIn, +TQString KWEFUtil::EscapeSgmlText(const TQTextCodec* codec, + const TQString& strIn, const bool quot /* = false */ , const bool apos /* = false */ ) { - QString strReturn; - QChar ch; + TQString strReturn; + TQChar ch; for (uint i=0; i<strIn.length(); i++) { ch=strIn[i]; - switch (ch.unicode()) + switch (ch.tqunicode()) { case 38: // & { @@ -78,7 +78,7 @@ QString KWEFUtil::EscapeSgmlText(const QTextCodec* codec, { if (!codec->canEncode(ch)) { - strReturn+=QString("&#%1;").arg(ch.unicode()); + strReturn+=TQString("&#%1;").tqarg(ch.tqunicode()); break; } } @@ -92,7 +92,7 @@ QString KWEFUtil::EscapeSgmlText(const QTextCodec* codec, } void KWEFUtil::GetNativePaperFormat(const int format, - QString& width, QString& height, QString& units) + TQString& width, TQString& height, TQString& units) // Find data for paper format, as needed for AbiWord and CSS { switch (format) @@ -196,9 +196,9 @@ void KWEFUtil::GetNativePaperFormat(const int format, default: { // TODO - width=QString::null; - height=QString::null; - units=QString::null; + width=TQString(); + height=TQString(); + units=TQString(); break; } } diff --git a/filters/kword/libexport/KWEFUtil.h b/filters/kword/libexport/KWEFUtil.h index 0ec2feb1..2876c3c3 100644 --- a/filters/kword/libexport/KWEFUtil.h +++ b/filters/kword/libexport/KWEFUtil.h @@ -25,14 +25,14 @@ namespace KWEFUtil { -KOFFICEFILTER_EXPORT QString EscapeSgmlText(const QTextCodec* codec, const QString& strIn, +KOFFICEFILTER_EXPORT TQString EscapeSgmlText(const TQTextCodec* codec, const TQString& strIn, const bool quot = false, const bool apos = false ); KOFFICEFILTER_EXPORT void GetNativePaperFormat(const int format, - QString& width, QString& height, QString& units); + TQString& width, TQString& height, TQString& units); } // Deprecated! Use KWEFUtil::EscapeSgmlText -static inline QString EscapeXmlText(const QString& strIn, +static inline TQString EscapeXmlText(const TQString& strIn, const bool quot = false, const bool apos = false ) { return KWEFUtil::EscapeSgmlText(NULL,strIn,quot,apos); diff --git a/filters/kword/libexport/ProcessDocument.cc b/filters/kword/libexport/ProcessDocument.cc index 345dba2f..ed5a7bfc 100644 --- a/filters/kword/libexport/ProcessDocument.cc +++ b/filters/kword/libexport/ProcessDocument.cc @@ -39,8 +39,8 @@ Copyright 2001 Michael Johnson <mikej@xnet.com> */ -#include <qdom.h> -#include <qvaluelist.h> +#include <tqdom.h> +#include <tqvaluelist.h> #include <kdebug.h> @@ -54,20 +54,20 @@ // TODO: verify that all document info is read! -void ProcessTextTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +void ProcessTextTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - QString *tagText = (QString *) tagData; + TQString *tagText = (TQString *) tagData; *tagText = myNode.toElement().text(); // Get the text, also from a CDATA section - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append ( TagProcessing ( "xml:space" ) ); ProcessSubtags (myNode, tagProcessingList, leader); AllowNoSubtags (myNode, leader); } -static void ProcessAboutTag ( QDomNode myNode, +static void ProcessAboutTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { @@ -75,7 +75,7 @@ static void ProcessAboutTag ( QDomNode myNode, AllowNoAttributes (myNode); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append ( TagProcessing ( "title", ProcessTextTag, &docInfo->title ) ); tagProcessingList.append ( TagProcessing ( "abstract", ProcessTextTag, &docInfo->abstract ) ); tagProcessingList.append ( TagProcessing ( "keyword", ProcessTextTag, &docInfo->keywords ) ); @@ -84,7 +84,7 @@ static void ProcessAboutTag ( QDomNode myNode, } -static void ProcessAuthorTag ( QDomNode myNode, +static void ProcessAuthorTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { @@ -92,7 +92,7 @@ static void ProcessAuthorTag ( QDomNode myNode, AllowNoAttributes (myNode); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append ( TagProcessing ( "full-name", ProcessTextTag, &docInfo->fullName ) ); tagProcessingList.append ( TagProcessing ( "title", ProcessTextTag, &docInfo->jobTitle ) ); tagProcessingList.append ( TagProcessing ( "company", ProcessTextTag, &docInfo->company ) ); @@ -110,7 +110,7 @@ static void ProcessAuthorTag ( QDomNode myNode, } -void ProcessDocumentInfoTag ( QDomNode myNode, +void ProcessDocumentInfoTag ( TQDomNode myNode, void *, KWEFKWordLeader *leader ) { @@ -118,7 +118,7 @@ void ProcessDocumentInfoTag ( QDomNode myNode, KWEFDocumentInfo docInfo; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append ( TagProcessing ( "log" ) ); tagProcessingList.append ( TagProcessing ( "author", ProcessAuthorTag, &docInfo ) ); tagProcessingList.append ( TagProcessing ( "about", ProcessAboutTag, &docInfo ) ); @@ -134,7 +134,7 @@ void ProcessDocumentInfoTag ( QDomNode myNode, // have the same parameters since the functions are passed to // ProcessSubtags throuch the TagProcessing class. The top level // function is ProcessDocTag and can be called with the node returned -// by QDomDocument::documentElement (). The tagData argument can be +// by TQDomDocument::documentElement (). The tagData argument can be // used to either pass variables down to the subtags or to allow // subtags to return values. As a bare minimum the tag processing // functions must handle the tag's attributes and the tag's subtags @@ -157,13 +157,13 @@ void ProcessDocumentInfoTag ( QDomNode myNode, // -------------------------------------------------------------------------------- -static void ProcessOneAttrTag ( QDomNode myNode, - QString attrName, - QString attrType, +static void ProcessOneAttrTag ( TQDomNode myNode, + TQString attrName, + TQString attrType, void *attrData, KWEFKWordLeader *leader ) { - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing (attrName, attrType, attrData); ProcessAttributes (myNode, attrProcessingList); @@ -171,13 +171,13 @@ static void ProcessOneAttrTag ( QDomNode myNode, } -static void ProcessColorAttrTag ( QDomNode myNode, void *tagData, KWEFKWordLeader * ) +static void ProcessColorAttrTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader * ) { - QColor *attrValue = (QColor *) tagData; + TQColor *attrValue = (TQColor *) tagData; int red, green, blue; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "red", red ); attrProcessingList << AttrProcessing ( "green", green ); attrProcessingList << AttrProcessing ( "blue", blue ); @@ -187,8 +187,8 @@ static void ProcessColorAttrTag ( QDomNode myNode, void *tagData, KWEFKWordLeade } -static void ProcessBoolIntAttrTag ( QDomNode myNode, - QString attrName, +static void ProcessBoolIntAttrTag ( TQDomNode myNode, + TQString attrName, void *attrData, KWEFKWordLeader *leader ) { @@ -199,35 +199,35 @@ static void ProcessBoolIntAttrTag ( QDomNode myNode, // -------------------------------------------------------------------------------- -static void ProcessIntValueTag (QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessIntValueTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { ProcessOneAttrTag (myNode, "value", "int", tagData, leader); } -static void ProcessBoolIntValueTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessBoolIntValueTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { ProcessBoolIntAttrTag (myNode, "value", tagData, leader); } -static void ProcessStringValueTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessStringValueTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - ProcessOneAttrTag (myNode, "value", "QString", tagData, leader); + ProcessOneAttrTag (myNode, "value", TQSTRING_OBJECT_NAME_STRING, tagData, leader); } -static void ProcessStringNameTag (QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessStringNameTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - ProcessOneAttrTag (myNode, "name", "QString", tagData, leader); + ProcessOneAttrTag (myNode, "name", TQSTRING_OBJECT_NAME_STRING, tagData, leader); } // -------------------------------------------------------------------------------- -static void ProcessOldLayoutChildTag (QDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/) +static void ProcessOldLayoutChildTag (TQDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/) { - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; double* d = (double*) ( tagData ); *d = 0.0; // Put a sensible default @@ -240,15 +240,15 @@ static void ProcessOldLayoutChildTag (QDomNode myNode, void *tagData, KWEFKWordL ProcessAttributes (myNode, attrProcessingList); } -static void ProcessUnderlineTag (QDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) +static void ProcessUnderlineTag (TQDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) { TextFormatting* text=(TextFormatting*) tagData; - QString str,style; - QString strColor; + TQString str,style; + TQString strColor; text->underlineWord = false; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "value", str ) @@ -273,14 +273,14 @@ static void ProcessUnderlineTag (QDomNode myNode, void *tagData, KWEFKWordLeader } } -static void ProcessStrikeoutTag (QDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) +static void ProcessStrikeoutTag (TQDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) { TextFormatting* text=(TextFormatting*) tagData; - QString type, linestyle; + TQString type, linestyle; text->strikeoutWord = false; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ("value" , type ); attrProcessingList << AttrProcessing ("styleline" , linestyle ); attrProcessingList << AttrProcessing ( "wordbyword", text->strikeoutWord ); @@ -301,17 +301,17 @@ static void ProcessStrikeoutTag (QDomNode myNode, void *tagData, KWEFKWordLeader } -void ProcessAnchorTag ( QDomNode myNode, +void ProcessAnchorTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - QString *instance = (QString *) tagData; + TQString *instance = (TQString *) tagData; - QString type; - *instance = QString::null; - QValueList<AttrProcessing> attrProcessingList; + TQString type; + *instance = TQString(); + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "type", type ) - << AttrProcessing ( "instance", "QString", instance ); + << AttrProcessing ( "instance", TQSTRING_OBJECT_NAME_STRING, instance ); ProcessAttributes (myNode, attrProcessingList); if ( type != "frameset" ) @@ -328,13 +328,13 @@ void ProcessAnchorTag ( QDomNode myNode, } -static void ProcessLinkTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) +static void ProcessLinkTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *) { VariableData *variable = (VariableData *) tagData; - QString linkName, hrefName; + TQString linkName, hrefName; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList.append ( AttrProcessing ("linkName", linkName) ); attrProcessingList.append ( AttrProcessing ("hrefName", hrefName) ); ProcessAttributes (myNode, attrProcessingList); @@ -343,13 +343,13 @@ static void ProcessLinkTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) } -static void ProcessPgNumTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) +static void ProcessPgNumTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *) { VariableData *variable = (VariableData *) tagData; - QString subtype, value; + TQString subtype, value; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList.append ( AttrProcessing ("subtype", subtype) ); attrProcessingList.append ( AttrProcessing ("value", value ) ); ProcessAttributes (myNode, attrProcessingList); @@ -358,24 +358,24 @@ static void ProcessPgNumTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) } -static void ProcessTypeTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) +static void ProcessTypeTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *) { VariableData *variable = (VariableData *) tagData; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList.append ( AttrProcessing ("key", variable->m_key ) ); attrProcessingList.append ( AttrProcessing ("text", variable->m_text) ); attrProcessingList.append ( AttrProcessing ("type", variable->m_type) ); ProcessAttributes (myNode, attrProcessingList); } -static void ProcessFieldTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) +static void ProcessFieldTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *) { VariableData *variable = (VariableData *) tagData; int subtype; - QString name, value; + TQString name, value; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList.append ( AttrProcessing ("subtype", subtype) ); attrProcessingList.append ( AttrProcessing ("value", value ) ); ProcessAttributes (myNode, attrProcessingList); @@ -397,12 +397,12 @@ static void ProcessFieldTag (QDomNode myNode, void *tagData, KWEFKWordLeader *) variable->setField(name, value); } -static void ProcessFootnoteTag (QDomNode myNode, void *tagData, KWEFKWordLeader *leader) +static void ProcessFootnoteTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *leader) { VariableData *variable = (VariableData *) tagData; - QString frameset, value, numberingtype, notetype; + TQString frameset, value, numberingtype, notetype; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "value", value ) << AttrProcessing ( "numberingtype", numberingtype ) @@ -422,13 +422,13 @@ static void ProcessFootnoteTag (QDomNode myNode, void *tagData, KWEFKWordLeader } } -static void ProcessNoteTag (QDomNode myNode, void *tagData, KWEFKWordLeader *leader) +static void ProcessNoteTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *leader) { VariableData *variable = (VariableData *) tagData; - QString note; + TQString note; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "note", note ) ; @@ -438,12 +438,12 @@ static void ProcessNoteTag (QDomNode myNode, void *tagData, KWEFKWordLeader *lea variable->setGenericData( "note", note ); } -// ### TODO: some files have not a <VARIABLE> tag but its supposed children are directly children of <FORMAT id="4"> -static void ProcessVariableTag (QDomNode myNode, void* tagData, KWEFKWordLeader* leader) +// ### TODO: some files have not a <VARIABLE> tag but its supposed tqchildren are directly tqchildren of <FORMAT id="4"> +static void ProcessVariableTag (TQDomNode myNode, void* tagData, KWEFKWordLeader* leader) { VariableData *variable = (VariableData *) tagData; - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; // "TYPE|PGNUM|DATE|TIME|CUSTOM|SERIALLETTER|FIELD|LINK|NOTE" tagProcessingList << TagProcessing ( "TYPE", ProcessTypeTag, variable ) @@ -460,7 +460,7 @@ static void ProcessVariableTag (QDomNode myNode, void* tagData, KWEFKWordLeader* ProcessSubtags (myNode, tagProcessingList, leader); } -static void AppendTagProcessingFormatOne(QValueList<TagProcessing>& tagProcessingList, FormatData& formatData) +static void AppendTagProcessingFormatOne(TQValueList<TagProcessing>& tagProcessingList, FormatData& formatData) { tagProcessingList << TagProcessing ( "COLOR", ProcessColorAttrTag, &formatData.text.fgColor ) @@ -492,7 +492,7 @@ static void AppendTagProcessingFormatOne(QValueList<TagProcessing>& tagProcessin } -static void SubProcessFormatOneTag(QDomNode myNode, +static void SubProcessFormatOneTag(TQDomNode myNode, ValueListFormatData *formatDataList, int formatPos, int formatLen, KWEFKWordLeader *leader) { @@ -513,7 +513,7 @@ static void SubProcessFormatOneTag(QDomNode myNode, } FormatData formatData(1, formatPos, formatLen); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; AppendTagProcessingFormatOne(tagProcessingList,formatData); ProcessSubtags (myNode, tagProcessingList, leader); @@ -521,7 +521,7 @@ static void SubProcessFormatOneTag(QDomNode myNode, } -static void SubProcessFormatTwoTag(QDomNode myNode, +static void SubProcessFormatTwoTag(TQDomNode myNode, ValueListFormatData *formatDataList, int formatPos, int formatLen, KWEFKWordLeader *leader) { @@ -536,9 +536,9 @@ static void SubProcessFormatTwoTag(QDomNode myNode, formatLen = 1; FormatData formatData(2, formatPos, formatLen); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; - QString fileName; // KWord 0.8 + TQString fileName; // KWord 0.8 KoPictureKey key; // Re-saved by KWord 1.2 or KWord 1.3 tagProcessingList.append(TagProcessing( "FILENAME", ProcessStringValueTag, &fileName)); tagProcessingList.append(TagProcessing( "PICTURE", ProcessImageTag, &key )); @@ -561,7 +561,7 @@ static void SubProcessFormatTwoTag(QDomNode myNode, } -static void SubProcessFormatThreeTag(QDomNode myNode, +static void SubProcessFormatThreeTag(TQDomNode myNode, ValueListFormatData *formatDataList, int formatPos, int /*formatLen*/, KWEFKWordLeader *leader) { @@ -577,7 +577,7 @@ static void SubProcessFormatThreeTag(QDomNode myNode, (*formatDataList) << formatData; } -static void SubProcessFormatFourTag(QDomNode myNode, +static void SubProcessFormatFourTag(TQDomNode myNode, ValueListFormatData *formatDataList, int formatPos, int formatLen, KWEFKWordLeader *leader) { @@ -588,7 +588,7 @@ static void SubProcessFormatFourTag(QDomNode myNode, return; } FormatData formatData(4, formatPos, formatLen); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList.append(TagProcessing("VARIABLE", ProcessVariableTag, &formatData.variable)); // As variables can have a formating too, we have to process formating AppendTagProcessingFormatOne(tagProcessingList,formatData); @@ -598,16 +598,16 @@ static void SubProcessFormatFourTag(QDomNode myNode, } -static void SubProcessFormatSixTag(QDomNode myNode, +static void SubProcessFormatSixTag(TQDomNode myNode, ValueListFormatData *formatDataList, int formatPos, int formatLen, KWEFKWordLeader *leader) { if ( formatPos != -1 && formatLen != -1 ) { - QString instance; + TQString instance; - QValueList<TagProcessing> tagProcessingList; - // TODO: We can have all layout information as in regular texts + TQValueList<TagProcessing> tagProcessingList; + // TODO: We can have all tqlayout information as in regular texts // They simply apply to the table frames // FONT is just the first that we've come across so far tagProcessingList << TagProcessing ( "FONT" ) @@ -625,14 +625,14 @@ static void SubProcessFormatSixTag(QDomNode myNode, } } -static void ProcessFormatTag (QDomNode myNode, void *tagData, KWEFKWordLeader *leader) +static void ProcessFormatTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *leader) { ValueListFormatData *formatDataList = (ValueListFormatData *) tagData; int formatId = -1; int formatPos = -1; int formatLen = -1; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "id", formatId ); attrProcessingList << AttrProcessing ( "pos", formatPos ); attrProcessingList << AttrProcessing ( "len", formatLen ); @@ -685,14 +685,14 @@ static void ProcessFormatTag (QDomNode myNode, void *tagData, KWEFKWordLeader *l } -void ProcessFormatsTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +void ProcessFormatsTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { ValueListFormatData *formatDataList = (ValueListFormatData *) tagData; AllowNoAttributes (myNode); (*formatDataList).clear (); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "FORMAT", ProcessFormatTag, formatDataList ); ProcessSubtags (myNode, tagProcessingList, leader); } @@ -701,7 +701,7 @@ void ProcessFormatsTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader // -------------------------------------------------------------------------------- -static void ProcessCounterTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessCounterTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { CounterData *counter = (CounterData *) tagData; @@ -709,7 +709,7 @@ static void ProcessCounterTag ( QDomNode myNode, void *tagData, KWEFKWordLeader int counterStyle = counter->style; int counterNumbering = counter->numbering; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "type", counterStyle ); attrProcessingList << AttrProcessing ( "depth", counter->depth ); attrProcessingList << AttrProcessing ( "bullet", counter->customCharacter ); @@ -731,13 +731,13 @@ static void ProcessCounterTag ( QDomNode myNode, void *tagData, KWEFKWordLeader } -static void ProcessLayoutTabulatorTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessLayoutTabulatorTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { TabulatorList* tabulatorList = (TabulatorList*) tagData; TabulatorData tabulator; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "ptpos", tabulator.m_ptpos ) @@ -763,43 +763,43 @@ static void ProcessLayoutTabulatorTag ( QDomNode myNode, void *tagData, KWEFKWor } -static void ProcessIndentsTag (QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessIndentsTag (TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; - QValueList<AttrProcessing> attrProcessingList; - attrProcessingList << AttrProcessing ("first" , layout->indentFirst ); - attrProcessingList << AttrProcessing ("left" , layout->indentLeft ); - attrProcessingList << AttrProcessing ("right" , layout->indentRight ); + TQValueList<AttrProcessing> attrProcessingList; + attrProcessingList << AttrProcessing ("first" , tqlayout->indentFirst ); + attrProcessingList << AttrProcessing ("left" , tqlayout->indentLeft ); + attrProcessingList << AttrProcessing ("right" , tqlayout->indentRight ); ProcessAttributes (myNode, attrProcessingList); AllowNoSubtags (myNode, leader); } -static void ProcessLayoutOffsetTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessLayoutOffsetTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; - QValueList<AttrProcessing> attrProcessingList; - attrProcessingList << AttrProcessing ("after" , layout->marginBottom ); - attrProcessingList << AttrProcessing ("before" , layout->marginTop ); + TQValueList<AttrProcessing> attrProcessingList; + attrProcessingList << AttrProcessing ("after" , tqlayout->marginBottom ); + attrProcessingList << AttrProcessing ("before" , tqlayout->marginTop ); ProcessAttributes (myNode, attrProcessingList); AllowNoSubtags (myNode, leader); } -static void ProcessLineBreakingTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessLineBreakingTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; - QString strBefore, strAfter; + TQString strBefore, strAfter; - QValueList<AttrProcessing> attrProcessingList; - attrProcessingList << AttrProcessing ( "linesTogether", layout->keepLinesTogether ); - attrProcessingList << AttrProcessing ( "hardFrameBreak", layout->pageBreakBefore ); - attrProcessingList << AttrProcessing ( "hardFrameBreakAfter", layout->pageBreakAfter ); + TQValueList<AttrProcessing> attrProcessingList; + attrProcessingList << AttrProcessing ( "linesTogether", tqlayout->keepLinesTogether ); + attrProcessingList << AttrProcessing ( "hardFrameBreak", tqlayout->pageBreakBefore ); + attrProcessingList << AttrProcessing ( "hardFrameBreakAfter", tqlayout->pageBreakAfter ); attrProcessingList << AttrProcessing ( "keepWithNext" ); // RTF import filter ProcessAttributes (myNode, attrProcessingList); @@ -807,28 +807,28 @@ static void ProcessLineBreakingTag ( QDomNode myNode, void *tagData, KWEFKWordLe } -static void ProcessShadowTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader) +static void ProcessShadowTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader) { - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; int red=0; int green=0; int blue=0; - QValueList<AttrProcessing> attrProcessingList; - attrProcessingList << AttrProcessing ( "distance", layout->shadowDistance ); - attrProcessingList << AttrProcessing ( "direction", layout->shadowDirection ); + TQValueList<AttrProcessing> attrProcessingList; + attrProcessingList << AttrProcessing ( "distance", tqlayout->shadowDistance ); + attrProcessingList << AttrProcessing ( "direction", tqlayout->shadowDirection ); attrProcessingList << AttrProcessing ( "red", red ); attrProcessingList << AttrProcessing ( "green", green ); attrProcessingList << AttrProcessing ( "blue", blue ); ProcessAttributes (myNode, attrProcessingList); - layout->shadowColor.setRgb(red,green,blue); + tqlayout->shadowColor.setRgb(red,green,blue); AllowNoSubtags (myNode, leader); } -static void ProcessAnyBorderTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessAnyBorderTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { BorderData *border = static_cast <BorderData*> (tagData); @@ -836,7 +836,7 @@ static void ProcessAnyBorderTag ( QDomNode myNode, void *tagData, KWEFKWordLeade int green=0; int blue=0; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "red", red ); attrProcessingList << AttrProcessing ( "green", green ); attrProcessingList << AttrProcessing ( "blue", blue ); @@ -849,18 +849,18 @@ static void ProcessAnyBorderTag ( QDomNode myNode, void *tagData, KWEFKWordLeade AllowNoSubtags (myNode, leader); } -static void ProcessFollowingTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessFollowingTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - ProcessOneAttrTag (myNode, "name", "QString", tagData, leader); + ProcessOneAttrTag (myNode, "name", TQSTRING_OBJECT_NAME_STRING, tagData, leader); } -static void ProcessLinespacingTag (QDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) +static void ProcessLinespacingTag (TQDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) { - LayoutData *layout = (LayoutData *) tagData; - QString oldValue, spacingType; + LayoutData *tqlayout = (LayoutData *) tagData; + TQString oldValue, spacingType; double spacingValue; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ("value" , oldValue ); attrProcessingList << AttrProcessing ("type" , spacingType ); attrProcessingList << AttrProcessing ("spacingvalue" , spacingValue ); @@ -873,9 +873,9 @@ static void ProcessLinespacingTag (QDomNode myNode, void *tagData, KWEFKWordLead { // for old format if( oldValue == "oneandhalf" ) - layout->lineSpacingType = LayoutData::LS_ONEANDHALF; + tqlayout->lineSpacingType = LayoutData::LS_ONEANDHALF; else if ( oldValue == "double" ) - layout->lineSpacingType = LayoutData::LS_DOUBLE; + tqlayout->lineSpacingType = LayoutData::LS_DOUBLE; else { bool ok = false; @@ -883,57 +883,57 @@ static void ProcessLinespacingTag (QDomNode myNode, void *tagData, KWEFKWordLead if ( ok && ( size >= 0.0 ) ) // 0 is allowed but negative values are not { // We have a valid size - layout->lineSpacingType = LayoutData::LS_CUSTOM; // set to custom - layout->lineSpacing = size; + tqlayout->lineSpacingType = LayoutData::LS_CUSTOM; // set to custom + tqlayout->lineSpacing = size; } else - layout->lineSpacingType = LayoutData::LS_SINGLE; // assume single linespace + tqlayout->lineSpacingType = LayoutData::LS_SINGLE; // assume single linespace } } else { // for new format if( spacingType == "oneandhalf" ) - layout->lineSpacingType = LayoutData::LS_ONEANDHALF; + tqlayout->lineSpacingType = LayoutData::LS_ONEANDHALF; else if ( spacingType == "double" ) - layout->lineSpacingType = LayoutData::LS_DOUBLE; + tqlayout->lineSpacingType = LayoutData::LS_DOUBLE; else if ( spacingType == "custom" ) - layout->lineSpacingType = LayoutData::LS_CUSTOM; + tqlayout->lineSpacingType = LayoutData::LS_CUSTOM; else if ( spacingType == "atleast" ) - layout->lineSpacingType = LayoutData::LS_ATLEAST; + tqlayout->lineSpacingType = LayoutData::LS_ATLEAST; else if ( spacingType == "multiple" ) - layout->lineSpacingType = LayoutData::LS_MULTIPLE; + tqlayout->lineSpacingType = LayoutData::LS_MULTIPLE; else if ( spacingType == "fixed" ) - layout->lineSpacingType = LayoutData::LS_FIXED; + tqlayout->lineSpacingType = LayoutData::LS_FIXED; else - layout->lineSpacingType = LayoutData::LS_SINGLE; // assume single linespace - layout->lineSpacing = spacingValue; + tqlayout->lineSpacingType = LayoutData::LS_SINGLE; // assume single linespace + tqlayout->lineSpacing = spacingValue; } } -static void ProcessLineSpaceTag (QDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) +static void ProcessLineSpaceTag (TQDomNode myNode, void *tagData, KWEFKWordLeader* /*leader*/ ) { // <LINESPACE> is an old tag, of before syntax 1 - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; double spacingValue = 0.0; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "pt", spacingValue ); attrProcessingList << AttrProcessing ( "mm" ); attrProcessingList << AttrProcessing ( "inch" ); ProcessAttributes (myNode, attrProcessingList); - layout->lineSpacingType = LayoutData::LS_CUSTOM; // set to custom - layout->lineSpacing = spacingValue; + tqlayout->lineSpacingType = LayoutData::LS_CUSTOM; // set to custom + tqlayout->lineSpacing = spacingValue; } -static void ProcessFlowTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +static void ProcessFlowTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; - QString oldAlign, normalAlign; + TQString oldAlign, normalAlign; - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; if ( leader->m_oldSyntax ) { // KWord 0.8 @@ -948,7 +948,7 @@ static void ProcessFlowTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *le { if ( oldAlign.isEmpty() ) { - layout->alignment = "left"; // KWord 0.8 did not support right-to-left + tqlayout->tqalignment = "left"; // KWord 0.8 did not support right-to-left } else { @@ -956,61 +956,61 @@ static void ProcessFlowTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *le if ( ( align < 0 ) || ( align > 3) ) { kdWarning(30508) << "KWord 0.8 flow unknown: " << oldAlign << endl; - layout->alignment = "left"; // Unknown, so assume left + tqlayout->tqalignment = "left"; // Unknown, so assume left } else { const char* flows[]={"left", "right", "center", "justify" }; - layout->alignment = flows[ align ]; + tqlayout->tqalignment = flows[ align ]; } } - kdDebug(30508) << "KWord 0.8 flow: " << oldAlign << " corrected: " << layout->alignment << endl; + kdDebug(30508) << "KWord 0.8 flow: " << oldAlign << " corrected: " << tqlayout->tqalignment << endl; } else { - layout->alignment = normalAlign; + tqlayout->tqalignment = normalAlign; } } -void ProcessLayoutTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ) +void ProcessLayoutTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) // Processes <LAYOUT> and <STYLE> { - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "outline" ); // Only in <STYLE> ProcessAttributes (myNode, attrProcessingList); - LayoutData *layout = (LayoutData *) tagData; + LayoutData *tqlayout = (LayoutData *) tagData; ValueListFormatData formatDataList; - QValueList<TagProcessing> tagProcessingList; - tagProcessingList << TagProcessing ( "NAME", ProcessStringValueTag, &layout->styleName ); - tagProcessingList << TagProcessing ( "FOLLOWING", ProcessFollowingTag, &layout->styleFollowing ); - tagProcessingList << TagProcessing ( "FLOW", ProcessFlowTag, layout ); - tagProcessingList << TagProcessing ( "INDENTS", ProcessIndentsTag, layout ); - tagProcessingList << TagProcessing ( "OFFSETS", ProcessLayoutOffsetTag, layout ); - tagProcessingList << TagProcessing ( "LINESPACING", ProcessLinespacingTag, layout ); - tagProcessingList << TagProcessing ( "PAGEBREAKING", ProcessLineBreakingTag, layout ); - tagProcessingList << TagProcessing ( "LEFTBORDER", ProcessAnyBorderTag, &layout->leftBorder ); - tagProcessingList << TagProcessing ( "RIGHTBORDER", ProcessAnyBorderTag, &layout->rightBorder ); - tagProcessingList << TagProcessing ( "TOPBORDER", ProcessAnyBorderTag, &layout->topBorder ); - tagProcessingList << TagProcessing ( "BOTTOMBORDER", ProcessAnyBorderTag, &layout->bottomBorder ); - tagProcessingList << TagProcessing ( "COUNTER", ProcessCounterTag, &layout->counter ); + TQValueList<TagProcessing> tagProcessingList; + tagProcessingList << TagProcessing ( "NAME", ProcessStringValueTag, &tqlayout->styleName ); + tagProcessingList << TagProcessing ( "FOLLOWING", ProcessFollowingTag, &tqlayout->styleFollowing ); + tagProcessingList << TagProcessing ( "FLOW", ProcessFlowTag, tqlayout ); + tagProcessingList << TagProcessing ( "INDENTS", ProcessIndentsTag, tqlayout ); + tagProcessingList << TagProcessing ( "OFFSETS", ProcessLayoutOffsetTag, tqlayout ); + tagProcessingList << TagProcessing ( "LINESPACING", ProcessLinespacingTag, tqlayout ); + tagProcessingList << TagProcessing ( "PAGEBREAKING", ProcessLineBreakingTag, tqlayout ); + tagProcessingList << TagProcessing ( "LEFTBORDER", ProcessAnyBorderTag, &tqlayout->leftBorder ); + tagProcessingList << TagProcessing ( "RIGHTBORDER", ProcessAnyBorderTag, &tqlayout->rightBorder ); + tagProcessingList << TagProcessing ( "TOPBORDER", ProcessAnyBorderTag, &tqlayout->topBorder ); + tagProcessingList << TagProcessing ( "BOTTOMBORDER", ProcessAnyBorderTag, &tqlayout->bottomBorder ); + tagProcessingList << TagProcessing ( "COUNTER", ProcessCounterTag, &tqlayout->counter ); tagProcessingList << TagProcessing ( "FORMAT", ProcessFormatTag, &formatDataList ); - tagProcessingList << TagProcessing ( "TABULATOR", ProcessLayoutTabulatorTag, &layout->tabulatorList ); - tagProcessingList << TagProcessing ( "SHADOW", ProcessShadowTag, layout ); + tagProcessingList << TagProcessing ( "TABULATOR", ProcessLayoutTabulatorTag, &tqlayout->tabulatorList ); + tagProcessingList << TagProcessing ( "SHADOW", ProcessShadowTag, tqlayout ); if ( leader->m_oldSyntax ) { - layout->indentLeft = 0.0; // ### TODO: needed or not? + tqlayout->indentLeft = 0.0; // ### TODO: needed or not? tagProcessingList - << TagProcessing ( "OHEAD", ProcessOldLayoutChildTag, &layout->marginTop ) - << TagProcessing ( "OFOOT", ProcessOldLayoutChildTag, &layout->marginBottom ) - << TagProcessing ( "ILEFT", ProcessOldLayoutChildTag, &layout->indentLeft ) - << TagProcessing ( "IFIRST", ProcessOldLayoutChildTag, &layout->indentFirst ) - << TagProcessing ( "LINESPACE", ProcessLineSpaceTag, layout ) + << TagProcessing ( "OHEAD", ProcessOldLayoutChildTag, &tqlayout->marginTop ) + << TagProcessing ( "OFOOT", ProcessOldLayoutChildTag, &tqlayout->marginBottom ) + << TagProcessing ( "ILEFT", ProcessOldLayoutChildTag, &tqlayout->indentLeft ) + << TagProcessing ( "IFIRST", ProcessOldLayoutChildTag, &tqlayout->indentFirst ) + << TagProcessing ( "LINESPACE", ProcessLineSpaceTag, tqlayout ) ; } @@ -1023,7 +1023,7 @@ void ProcessLayoutTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader } else { - layout->formatData = formatDataList.first (); + tqlayout->formatData = formatDataList.first (); if ( formatDataList.count () > 1 ) { @@ -1031,16 +1031,16 @@ void ProcessLayoutTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader } } - if ( layout->styleName.isEmpty () ) + if ( tqlayout->styleName.isEmpty () ) { - layout->styleName = "Standard"; - kdWarning (30508) << "Empty layout name!" << endl; + tqlayout->styleName = "Standard"; + kdWarning (30508) << "Empty tqlayout name!" << endl; } } -static void ProcessImageKeyTag ( QDomNode myNode, +static void ProcessImageKeyTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *) { KoPictureKey *key = (KoPictureKey*) tagData; @@ -1049,14 +1049,14 @@ static void ProcessImageKeyTag ( QDomNode myNode, key->loadAttributes(myNode.toElement()); } -void ProcessImageTag ( QDomNode myNode, +void ProcessImageTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ) { // <PICTURE> - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; attrProcessingList << AttrProcessing ( "keepAspectRatio" ); ProcessAttributes (myNode, attrProcessingList); - QValueList<TagProcessing> tagProcessingList; + TQValueList<TagProcessing> tagProcessingList; tagProcessingList << TagProcessing ( "KEY", ProcessImageKeyTag, tagData ); ProcessSubtags (myNode, tagProcessingList, leader); } diff --git a/filters/kword/libexport/ProcessDocument.h b/filters/kword/libexport/ProcessDocument.h index cde4dfdc..cb0b74d6 100644 --- a/filters/kword/libexport/ProcessDocument.h +++ b/filters/kword/libexport/ProcessDocument.h @@ -21,31 +21,31 @@ #ifndef PROCESS_DOCUMENT_H #define PROCESS_DOCUMENT_H -#include <qdom.h> +#include <tqdom.h> class KWEFKWordLeader; /** * @internal */ -void ProcessLayoutTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ); +void ProcessLayoutTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ); /** * @internal */ -void ProcessFormatsTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ); +void ProcessFormatsTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ); /** * @internal */ -void ProcessTextTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ); +void ProcessTextTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ); /** * @internal */ -void ProcessDocumentInfoTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ); +void ProcessDocumentInfoTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ); /** * @internal * @since 1.4 (made public) */ -void ProcessImageTag ( QDomNode myNode, void *tagData, KWEFKWordLeader *leader ); +void ProcessImageTag ( TQDomNode myNode, void *tagData, KWEFKWordLeader *leader ); #endif /* PROCESS_DOCUMENT_H */ diff --git a/filters/kword/libexport/TagProcessing.cc b/filters/kword/libexport/TagProcessing.cc index a640255e..ca47f1ef 100644 --- a/filters/kword/libexport/TagProcessing.cc +++ b/filters/kword/libexport/TagProcessing.cc @@ -34,7 +34,7 @@ */ #include <kdebug.h> -#include <qdom.h> +#include <tqdom.h> #include "TagProcessing.h" @@ -42,21 +42,21 @@ // #define DEBUG_KWORD_IGNORED_TAGS -void ProcessSubtags ( const QDomNode &parentNode, - QValueList<TagProcessing> &tagProcessingList, +void ProcessSubtags ( const TQDomNode &tqparentNode, + TQValueList<TagProcessing> &tagProcessingList, KWEFKWordLeader *leader) { - //kdDebug(30508) << "Starting ProcessSubtags for node: " << parentNode.nodeName() << endl; + //kdDebug(30508) << "Starting ProcessSubtags for node: " << tqparentNode.nodeName() << endl; - QDomNode childNode; + TQDomNode childNode; - for ( childNode = parentNode.firstChild (); !childNode.isNull (); childNode = childNode.nextSibling () ) + for ( childNode = tqparentNode.firstChild (); !childNode.isNull (); childNode = childNode.nextSibling () ) { if ( childNode.isElement () ) { bool found = false; - QValueList<TagProcessing>::Iterator tagProcessingIt; + TQValueList<TagProcessing>::Iterator tagProcessingIt; for ( tagProcessingIt = tagProcessingList.begin (); tagProcessingIt != tagProcessingList.end (); @@ -74,7 +74,7 @@ void ProcessSubtags ( const QDomNode &parentNode, else { kdDebug(30508) << "Ignoring " << childNode.nodeName () - << " tag in " << parentNode.nodeName () << endl; + << " tag in " << tqparentNode.nodeName () << endl; } #endif break; @@ -84,31 +84,31 @@ void ProcessSubtags ( const QDomNode &parentNode, if ( !found ) { kdDebug(30508) << "Unexpected tag " << childNode.nodeName () - << " in " << parentNode.nodeName () << "!" << endl; + << " in " << tqparentNode.nodeName () << "!" << endl; } } } - //kdDebug(30508) << "Ending ProcessSubtags for node: " << parentNode.nodeName() << endl; + //kdDebug(30508) << "Ending ProcessSubtags for node: " << tqparentNode.nodeName() << endl; } -void AllowNoSubtags ( const QDomNode& myNode, KWEFKWordLeader *leader ) +void AllowNoSubtags ( const TQDomNode& myNode, KWEFKWordLeader *leader ) { #ifdef DEBUG_KWORD_TAGS - QString outputText; - QValueList<TagProcessing> tagProcessingList; + TQString outputText; + TQValueList<TagProcessing> tagProcessingList; ProcessSubtags (myNode, tagProcessingList, leader); #else @_UNUSED( leader ): #endif } -AttrProcessing::AttrProcessing ( const QString& n, const QString& t, void *d ) +AttrProcessing::AttrProcessing ( const TQString& n, const TQString& t, void *d ) : name (n), data (d) { if ( t == "int" ) type = AttrInt; - else if ( t == "QString" ) - type = AttrQString; + else if ( t == TQSTRING_OBJECT_NAME_STRING ) + type = AttrTQString; else if ( t == "double" ) type = AttrDouble; else if ( t == "bool" ) @@ -123,22 +123,22 @@ AttrProcessing::AttrProcessing ( const QString& n, const QString& t, void *d ) } -void ProcessAttributes ( const QDomNode &myNode, - QValueList<AttrProcessing> &attrProcessingList ) +void ProcessAttributes ( const TQDomNode &myNode, + TQValueList<AttrProcessing> &attrProcessingList ) { //kdDebug(30508) << "Starting ProcessAttributes for node: " << myNode.nodeName() << endl; - QDomNamedNodeMap myAttribs ( myNode.attributes () ); + TQDomNamedNodeMap myAttribs ( myNode.attributes () ); //kdDebug(30508) << "Attributes = " << myAttribs.length () <<endl; for ( uint i = 0; i < myAttribs.length (); i++ ) { - QDomAttr myAttrib ( myAttribs.item (i).toAttr () ); + TQDomAttr myAttrib ( myAttribs.item (i).toAttr () ); if ( !myAttrib.isNull () ) { bool found = false; - QValueList<AttrProcessing>::Iterator attrProcessingIt; + TQValueList<AttrProcessing>::Iterator attrProcessingIt; for ( attrProcessingIt = attrProcessingList.begin (); attrProcessingIt != attrProcessingList.end (); @@ -153,9 +153,9 @@ void ProcessAttributes ( const QDomNode &myNode, { switch ( (*attrProcessingIt).type ) { - case AttrProcessing::AttrQString: + case AttrProcessing::AttrTQString: { - *((QString *) (*attrProcessingIt).data) = myAttrib.value (); + *((TQString *) (*attrProcessingIt).data) = myAttrib.value (); break; } case AttrProcessing::AttrInt: @@ -170,7 +170,7 @@ void ProcessAttributes ( const QDomNode &myNode, } case AttrProcessing::AttrBool: { - const QString strAttr ( myAttrib.value().simplifyWhiteSpace() ); + const TQString strAttr ( myAttrib.value().simplifyWhiteSpace() ); bool flag; if ((strAttr=="yes")||(strAttr=="1")||(strAttr=="true")) { @@ -224,10 +224,10 @@ void ProcessAttributes ( const QDomNode &myNode, //kdDebug(30508) << "Ending ProcessAttributes for node: " << myNode.nodeName() << endl; } -void AllowNoAttributes ( const QDomNode & myNode ) +void AllowNoAttributes ( const TQDomNode & myNode ) { #ifdef DEBUG_KWORD_TAGS - QValueList<AttrProcessing> attrProcessingList; + TQValueList<AttrProcessing> attrProcessingList; ProcessAttributes (myNode, attrProcessingList); #else Q_UNUSED( myNode ); diff --git a/filters/kword/libexport/TagProcessing.h b/filters/kword/libexport/TagProcessing.h index 85cfa37d..01080d50 100644 --- a/filters/kword/libexport/TagProcessing.h +++ b/filters/kword/libexport/TagProcessing.h @@ -34,8 +34,8 @@ #ifndef EXPORTTAGPROCESSING_H #define EXPORTTAGPROCESSING_H -#include <qdom.h> -#include <qvaluelist.h> +#include <tqdom.h> +#include <tqvaluelist.h> #include <kdemacros.h> #include <kdebug.h> @@ -47,7 +47,7 @@ class KWEFKWordLeader; * AllowNoSubtags () allow for easing parsing of subtags in the * current tag. If don't expect any subtags you call AllowNoSubtags (). * Otherwise you create a list of TagProcessing elements and pass that - * to ProcessSubtags () which will go through all subtags it can find, + * to ProcessSubtags () which will go through all subtags it can tqfind, * call the corresponding processing function, and do all the * necessary error handling. */ @@ -58,8 +58,8 @@ class TagProcessing TagProcessing () {} - TagProcessing (const QString& n, - void (*p)(QDomNode, void *, KWEFKWordLeader*), + TagProcessing (const TQString& n, + void (*p)(TQDomNode, void *, KWEFKWordLeader*), void *d) : name (n), processor (p), data (d) {} @@ -68,19 +68,19 @@ class TagProcessing * * Avoids a warning that a tag is unknown. */ - TagProcessing (const QString& _name) : name(_name), processor(0), data(0) + TagProcessing (const TQString& _name) : name(_name), processor(0), data(0) {} - QString name; - void (*processor)(QDomNode, void *, KWEFKWordLeader*); + TQString name; + void (*processor)(TQDomNode, void *, KWEFKWordLeader*); void *data; }; -void ProcessSubtags ( const QDomNode &parentNode, - QValueList<TagProcessing> &tagProcessingList, +void ProcessSubtags ( const TQDomNode &tqparentNode, + TQValueList<TagProcessing> &tagProcessingList, KWEFKWordLeader *leader); -void AllowNoSubtags ( const QDomNode& myNode, KWEFKWordLeader *leader ); +void AllowNoSubtags ( const TQDomNode& myNode, KWEFKWordLeader *leader ); /** @@ -89,7 +89,7 @@ void AllowNoSubtags ( const QDomNode& myNode, KWEFKWordLeader *leader ); * attributes. If don't expect any attributes you call AllowNoAttributes (). * Otherwise you create a list of AttrProcessing elements and pass * that to ProcessAttributes () which will go through all attributes - * it can find, retrieve the value in the datatype defined, and do all + * it can tqfind, retrieve the value in the datatype defined, and do all * the necessary error handling. */ @@ -98,7 +98,7 @@ class AttrProcessing public: enum AttrType - { AttrNull = 0, AttrInt, AttrDouble, AttrBool, AttrQString }; + { AttrNull = 0, AttrInt, AttrDouble, AttrBool, AttrTQString }; /** * @brief Default constructor @@ -109,14 +109,14 @@ public: * @brief Old constructor (without type checking) * @deprecated do not use for new code */ - AttrProcessing ( const QString& n, const QString& t, void *d ) KDE_DEPRECATED; + AttrProcessing ( const TQString& n, const TQString& t, void *d ) KDE_DEPRECATED; /** * @brief No-op constructor * * This just avoids that a warning is triggered that an attribute is not known */ - AttrProcessing ( const QString& _name ) + AttrProcessing ( const TQString& _name ) : name( _name ), type( AttrNull ), data( 0 ) {} /** @@ -124,7 +124,7 @@ public: * * Get the attribute value as an integer */ - AttrProcessing ( const QString& _name, int& i ) + AttrProcessing ( const TQString& _name, int& i ) : name( _name ), type( AttrInt ), data( &i ) {} /** @@ -132,7 +132,7 @@ public: * * Get the attribute value as a double */ - AttrProcessing ( const QString& _name, double& d ) + AttrProcessing ( const TQString& _name, double& d ) : name( _name ), type( AttrDouble ), data( &d ) {} /** @@ -141,27 +141,27 @@ public: * Get the attribute value as a bool * (The values "yes,", "no", "true", "false", "0" and "1" are supported) */ - AttrProcessing ( const QString& _name, bool& flag ) + AttrProcessing ( const TQString& _name, bool& flag ) : name( _name ), type( AttrBool ), data( &flag ) {} /** * @brief String constructor * - * Get the attribute value as a QString + * Get the attribute value as a TQString */ - AttrProcessing ( const QString& _name, QString& str ) - : name( _name ), type( AttrQString ), data( &str ) {} + AttrProcessing ( const TQString& _name, TQString& str ) + : name( _name ), type( AttrTQString ), data( &str ) {} public: - QString name; + TQString name; AttrType type; void *data; }; -void ProcessAttributes ( const QDomNode &myNode, - QValueList<AttrProcessing> &attrProcessingList ); +void ProcessAttributes ( const TQDomNode &myNode, + TQValueList<AttrProcessing> &attrProcessingList ); -void AllowNoAttributes ( const QDomNode& myNode ); +void AllowNoAttributes ( const TQDomNode& myNode ); #endif diff --git a/filters/kword/msword/conversion.cpp b/filters/kword/msword/conversion.cpp index 18153b36..4b221051 100644 --- a/filters/kword/msword/conversion.cpp +++ b/filters/kword/msword/conversion.cpp @@ -24,54 +24,54 @@ #include <wv2/fields.h> #include <kdebug.h> -#include <qregexp.h> -#include <qdom.h> +#include <tqregexp.h> +#include <tqdom.h> #include <klocale.h> -QColor Conversion::color(int number, int defaultcolor, bool defaultWhite) +TQColor Conversion::color(int number, int defaultcolor, bool defaultWhite) { switch(number) { case 0: if(defaultWhite) - return Qt::white; + return TQt::white; case 1: - return Qt::black; + return TQt::black; case 2: - return Qt::blue; + return TQt::blue; case 3: - return Qt::cyan; + return TQt::cyan; case 4: - return Qt::green; + return TQt::green; case 5: - return Qt::magenta; + return TQt::magenta; case 6: - return Qt::red; + return TQt::red; case 7: - return Qt::yellow; + return TQt::yellow; case 8: - return Qt::white; + return TQt::white; case 9: - return Qt::darkBlue; + return TQt::darkBlue; case 10: - return Qt::darkCyan; + return TQt::darkCyan; case 11: - return Qt::darkGreen; + return TQt::darkGreen; case 12: - return Qt::darkMagenta; + return TQt::darkMagenta; case 13: - return Qt::darkRed; + return TQt::darkRed; case 14: - return Qt::darkYellow; + return TQt::darkYellow; case 15: - return Qt::darkGray; + return TQt::darkGray; case 16: - return Qt::lightGray; + return TQt::lightGray; default: kdDebug(30513) << "Conversion::color: unknown color: " << number << endl; if(defaultcolor == -1) - return QColor("black"); + return TQColor("black"); else return color(defaultcolor, -1); } @@ -79,21 +79,21 @@ QColor Conversion::color(int number, int defaultcolor, bool defaultWhite) int Conversion::fillPatternStyle( int ipat ) { - // See $QTDIR/doc/html/qbrush.html#setStyle + // See $TQTDIR/doc/html/qbrush.html#setStyle switch( ipat ) { - case 0: // Automatic (Apparently it means Solid from background color instead of foreground) + case 0: // Automatic (Aptqparently it means Solid from background color instead of foreground) case 1: // Solid - return Qt::SolidPattern; + return TQt::SolidPattern; case 2: // 5% case 35: // 2.5 Percent case 36: // 7.5 Percent - return Qt::Dense7Pattern; + return TQt::Dense7Pattern; case 3: // 10% case 37: // 12.5 Percent case 38: // 15 Percent case 39: // 17.5 Percent case 4: // 20% - return Qt::Dense6Pattern; + return TQt::Dense6Pattern; case 40: // 22.5 Percent case 5: // 25% case 41: // 27.5 Percent @@ -102,14 +102,14 @@ int Conversion::fillPatternStyle( int ipat ) case 43: // 35 Percent case 44: // 37.5 Percent case 7: // 40% - return Qt::Dense5Pattern; + return TQt::Dense5Pattern; case 45: // 42.5 Percent case 46: // 45 Percent case 47: // 47.5 Percent case 8: // 50% case 48: // 52.5 Percent case 49: // 55 Percent - return Qt::Dense4Pattern; + return TQt::Dense4Pattern; case 50: // 57.5 Percent case 9: // 60% case 51: // 62.5 Percent @@ -117,7 +117,7 @@ int Conversion::fillPatternStyle( int ipat ) case 53: // 67.5 Percent case 10: // 70% case 54: // 72.5 Percent - return Qt::Dense3Pattern; + return TQt::Dense3Pattern; case 11: // 75% case 55: // 77.5 Percent case 12: // 80% @@ -125,33 +125,33 @@ int Conversion::fillPatternStyle( int ipat ) case 57: // 85 Percent case 58: // 87.5 Percent case 13: // 90% - return Qt::Dense2Pattern; + return TQt::Dense2Pattern; case 59: // 92.5 Percent case 60: // 95 Percent case 61: // 97.5 Percent case 62: // 97 Percent - return Qt::Dense1Pattern; - case 14: // Dark Horizontal - case 20: // Horizontal - return Qt::HorPattern; - case 15: // Dark Vertical - case 21: // Vertical - return Qt::VerPattern; + return TQt::Dense1Pattern; + case 14: // DarkQt::Horizontal + case 20: //Qt::Horizontal + return TQt::HorPattern; + case 15: // DarkQt::Vertical + case 21: //Qt::Vertical + return TQt::VerPattern; case 16: // Dark Forward Diagonal case 22: // Forward Diagonal - return Qt::FDiagPattern; + return TQt::FDiagPattern; case 17: // Dark Backward Diagonal case 23: // Backward Diagonal - return Qt::BDiagPattern; + return TQt::BDiagPattern; case 18: // Dark Cross case 24: // Cross - return Qt::CrossPattern; + return TQt::CrossPattern; case 19: // Dark Diagonal Cross case 25: // Diagonal Cross - return Qt::DiagCrossPattern; + return TQt::DiagCrossPattern; default: kdWarning(30513) << "Unhandled undocumented SHD ipat value: " << ipat << endl; - return Qt::NoBrush; + return TQt::NoBrush; } } @@ -161,93 +161,93 @@ int Conversion::ditheringToGray( int ipat, bool* ok ) *ok = true; // optimistic ;) switch( ipat ) { case 2: // 5% - return 255 - qRound(0.05 * 255); + return 255 - tqRound(0.05 * 255); case 35: // 2.5 Percent - return 255 - qRound(0.025 * 255); + return 255 - tqRound(0.025 * 255); case 36: // 7.5 Percent - return 255 - qRound(0.075 * 255); + return 255 - tqRound(0.075 * 255); case 3: // 10% - return 255 - qRound(0.1 * 255); + return 255 - tqRound(0.1 * 255); case 37: // 12.5 Percent - return 255 - qRound(0.125 * 255); + return 255 - tqRound(0.125 * 255); case 38: // 15 Percent - return 255 - qRound(0.15 * 255); + return 255 - tqRound(0.15 * 255); case 39: // 17.5 Percent - return 255 - qRound(0.175 * 255); + return 255 - tqRound(0.175 * 255); case 4: // 20% - return 255 - qRound(0.2 * 255); + return 255 - tqRound(0.2 * 255); case 40: // 22.5 Percent - return 255 - qRound(0.225 * 255); + return 255 - tqRound(0.225 * 255); case 5: // 25% - return 255 - qRound(0.25 * 255); + return 255 - tqRound(0.25 * 255); case 41: // 27.5 Percent - return 255 - qRound(0.275 * 255); + return 255 - tqRound(0.275 * 255); case 6: // 30% - return 255 - qRound(0.3 * 255); + return 255 - tqRound(0.3 * 255); case 42: // 32.5 Percent - return 255 - qRound(0.325 * 255); + return 255 - tqRound(0.325 * 255); case 43: // 35 Percent - return 255 - qRound(0.35 * 255); + return 255 - tqRound(0.35 * 255); case 44: // 37.5 Percent - return 255 - qRound(0.375 * 255); + return 255 - tqRound(0.375 * 255); case 7: // 40% - return 255 - qRound(0.4 * 255); + return 255 - tqRound(0.4 * 255); case 45: // 42.5 Percent - return 255 - qRound(0.425 * 255); + return 255 - tqRound(0.425 * 255); case 46: // 45 Percent - return 255 - qRound(0.45 * 255); + return 255 - tqRound(0.45 * 255); case 47: // 47.5 Percent - return 255 - qRound(0.475 * 255); + return 255 - tqRound(0.475 * 255); case 8: // 50% - return 255 - qRound(0.5 * 255); + return 255 - tqRound(0.5 * 255); case 48: // 52.5 Percent - return 255 - qRound(0.525 * 255); + return 255 - tqRound(0.525 * 255); case 49: // 55 Percent - return 255 - qRound(0.55 * 255); + return 255 - tqRound(0.55 * 255); case 50: // 57.5 Percent - return 255 - qRound(0.575 * 255); + return 255 - tqRound(0.575 * 255); case 9: // 60% - return 255 - qRound(0.6 * 255); + return 255 - tqRound(0.6 * 255); case 51: // 62.5 Percent - return 255 - qRound(0.625 * 255); + return 255 - tqRound(0.625 * 255); case 52: // 65 Percent - return 255 - qRound(0.65 * 255); + return 255 - tqRound(0.65 * 255); case 53: // 67.5 Percent - return 255 - qRound(0.675 * 255); + return 255 - tqRound(0.675 * 255); case 10: // 70% - return 255 - qRound(0.7 * 255); + return 255 - tqRound(0.7 * 255); case 54: // 72.5 Percent - return 255 - qRound(0.725 * 255); + return 255 - tqRound(0.725 * 255); case 11: // 75% - return 255 - qRound(0.75 * 255); + return 255 - tqRound(0.75 * 255); case 55: // 77.5 Percent - return 255 - qRound(0.775 * 255); + return 255 - tqRound(0.775 * 255); case 12: // 80% - return 255 - qRound(0.8 * 255); + return 255 - tqRound(0.8 * 255); case 56: // 82.5 Percent - return 255 - qRound(0.825 * 255); + return 255 - tqRound(0.825 * 255); case 57: // 85 Percent - return 255 - qRound(0.85 * 255); + return 255 - tqRound(0.85 * 255); case 58: // 87.5 Percent - return 255 - qRound(0.875 * 255); + return 255 - tqRound(0.875 * 255); case 13: // 90% - return 255 - qRound(0.9 * 255); + return 255 - tqRound(0.9 * 255); case 59: // 92.5 Percent - return 255 - qRound(0.925 * 255); + return 255 - tqRound(0.925 * 255); case 60: // 95 Percent - return 255 - qRound(0.95 * 255); + return 255 - tqRound(0.95 * 255); case 61: // 97.5 Percent - return 255 - qRound(0.975 * 255); + return 255 - tqRound(0.975 * 255); case 62: // 97 Percent - return 255 - qRound(0.97 * 255); + return 255 - tqRound(0.97 * 255); default: *ok = false; return 0; } } -QString Conversion::alignment( int jc ) { - QString value( "left" ); +TQString Conversion::tqalignment( int jc ) { + TQString value( "left" ); if ( jc == 1 ) value = "center"; else if ( jc == 2 ) @@ -257,14 +257,14 @@ QString Conversion::alignment( int jc ) { return value; } -QString Conversion::lineSpacing( const wvWare::Word97::LSPD& lspd ) +TQString Conversion::lineSpacing( const wvWare::Word97::LSPD& lspd ) { - QString value( "0" ); + TQString value( "0" ); if ( lspd.fMultLinespace == 1 ) { // This will be e.g. 1.5 for a 1.5 linespacing. float proportionalLineSpacing = (float)lspd.dyaLine / 240.0; - if ( QABS(proportionalLineSpacing - 1.5) <= 0.25 ) // close to 1.5? + if ( TQABS(proportionalLineSpacing - 1.5) <= 0.25 ) // close to 1.5? value = "oneandhalf"; else if ( proportionalLineSpacing > 1.75) // close to 2.0, or more? value = "double"; @@ -272,7 +272,7 @@ QString Conversion::lineSpacing( const wvWare::Word97::LSPD& lspd ) else if ( lspd.fMultLinespace == 0 ) { // see sprmPDyaLine in generator_wword8.htm - //float value = QABS((float)lspd.dyaLine / 20.0); // twip -> pt + //float value = TQABS((float)lspd.dyaLine / 20.0); // twip -> pt // lspd.dyaLine > 0 means "at least", < 0 means "exactly" // "at least" is now possible in kword, but here it's the size of the whole // line, not the spacing between the line (!) @@ -285,22 +285,22 @@ QString Conversion::lineSpacing( const wvWare::Word97::LSPD& lspd ) return value; } -void Conversion::setColorAttributes( QDomElement& element, int ico, const QString& prefix, bool defaultWhite ) +void Conversion::setColorAttributes( TQDomElement& element, int ico, const TQString& prefix, bool defaultWhite ) { - QColor color = Conversion::color( ico, -1, defaultWhite ); + TQColor color = Conversion::color( ico, -1, defaultWhite ); element.setAttribute( prefix.isNull() ? "red" : prefix+"Red", color.red() ); element.setAttribute( prefix.isNull() ? "blue" : prefix+"Blue", color.blue() ); element.setAttribute( prefix.isNull() ? "green" : prefix+"Green", color.green() ); } -void Conversion::setBorderAttributes( QDomElement& borderElement, const wvWare::Word97::BRC& brc, const QString& prefix ) +void Conversion::setBorderAttributes( TQDomElement& borderElement, const wvWare::Word97::BRC& brc, const TQString& prefix ) { setColorAttributes( borderElement, brc.cv, prefix, false ); borderElement.setAttribute( prefix.isNull() ? "width" : prefix+"Width", (double)brc.dptLineWidth / 8.0 ); - QString style = "0"; // KWord: solid + TQString style = "0"; // KWord: solid switch ( brc.brcType ) { case 0: // none Q_ASSERT( brc.dptLineWidth == 0 ); // otherwise kword will show a border! @@ -373,7 +373,7 @@ int Conversion::headerTypeToFrameInfo( unsigned char type ) return 0; } -QString Conversion::headerTypeToFramesetName( unsigned char type ) +TQString Conversion::headerTypeToFramesetName( unsigned char type ) { switch (type) { case wvWare::HeaderData::HeaderEven: @@ -389,7 +389,7 @@ QString Conversion::headerTypeToFramesetName( unsigned char type ) case wvWare::HeaderData::FooterFirst: return i18n("First Page Footer"); } - return QString::null; + return TQString(); } bool Conversion::isHeader( unsigned char type ) @@ -403,21 +403,21 @@ bool Conversion::isHeader( unsigned char type ) return false; } -int Conversion::headerMaskToHType( unsigned char mask ) +int Conversion::headerMaskToHType( unsigned char tqmask ) { - bool hasFirst = ( mask & wvWare::HeaderData::HeaderFirst ); + bool hasFirst = ( tqmask & wvWare::HeaderData::HeaderFirst ); // Odd is always there. We have even!=odd only if Even is there too. - bool hasEvenOdd = ( mask & wvWare::HeaderData::HeaderEven ); + bool hasEvenOdd = ( tqmask & wvWare::HeaderData::HeaderEven ); //kdDebug(30513) << k_funcinfo << " hasEvenOdd=" << hasEvenOdd << endl; if ( hasFirst ) return hasEvenOdd ? 1 : 2; return hasEvenOdd ? 3 : 0; } -int Conversion::headerMaskToFType( unsigned char mask ) +int Conversion::headerMaskToFType( unsigned char tqmask ) { - bool hasFirst = ( mask & wvWare::HeaderData::FooterFirst ); - bool hasEvenOdd = ( mask & wvWare::HeaderData::FooterEven ); + bool hasFirst = ( tqmask & wvWare::HeaderData::FooterFirst ); + bool hasEvenOdd = ( tqmask & wvWare::HeaderData::FooterEven ); // Odd is always there. We have even!=odd only if Even is there too. kdDebug(30513) << k_funcinfo << " hasEvenOdd=" << hasEvenOdd << endl; if ( hasFirst ) diff --git a/filters/kword/msword/conversion.h b/filters/kword/msword/conversion.h index 868b42e7..8a9781ce 100644 --- a/filters/kword/msword/conversion.h +++ b/filters/kword/msword/conversion.h @@ -21,10 +21,10 @@ #define CONVERSION_H #include <wv2/ustring.h> -#include <qstring.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqcolor.h> -class QDomElement; +class TQDomElement; namespace wvWare { namespace Word97 { class LSPD; @@ -38,30 +38,30 @@ namespace wvWare { namespace Conversion { - // UString -> QConstString conversion. Use .string() to get the QString. - // Always store the QConstString into a variable first, to avoid a deep copy. - inline QConstString string( const wvWare::UString& str ) { - // Let's hope there's no copying of the QConstString happening... - return QConstString( reinterpret_cast<const QChar*>( str.data() ), str.length() ); + // UString -> TQConstString conversion. Use .string() to get the TQString. + // Always store the TQConstString into a variable first, to avoid a deep copy. + inline TQConstString string( const wvWare::UString& str ) { + // Let's hope there's no copying of the TQConstString happening... + return TQConstString( reinterpret_cast<const TQChar*>( str.data() ), str.length() ); } // Prepare text for inclusion in XML - void encodeText(QString &text); + void encodeText(TQString &text); - // Convert color code (ico) to QColor - QColor color(int number, int defaultcolor, bool defaultWhite = false); + // Convert color code (ico) to TQColor + TQColor color(int number, int defaultcolor, bool defaultWhite = false); - // Convert pattern style (ipat) to QBrush::BrushStyle + // Convert pattern style (ipat) to TQBrush::BrushStyle int fillPatternStyle( int ipat ); // Hackery for gray levels int ditheringToGray( int ipat, bool* ok ); - // Convert alignment code to string - QString alignment( int jc ); + // Convert tqalignment code to string + TQString tqalignment( int jc ); // Convert linespacing struct to string - QString lineSpacing( const wvWare::Word97::LSPD& lspd ); + TQString lineSpacing( const wvWare::Word97::LSPD& lspd ); // Convert number format code to KWord's COUNTER.type code int numberFormatCode( int nfc ); @@ -69,24 +69,24 @@ namespace Conversion // Set the 3 color attributes in the XML element, from a color code (ico) // prefix: if empty, the attribute names will be red/blue/green // if not empty, they will be xRed/xBlue/xGreen - void setColorAttributes( QDomElement& element, int ico, const QString& prefix = QString::null, bool defaultWhite = false ); + void setColorAttributes( TQDomElement& element, int ico, const TQString& prefix = TQString(), bool defaultWhite = false ); // Set all border attributes in the XML element, from a BRC structure // prefix: if empty, the attribute names will be red/blue/green/width/style // if not empty, they will be xRed/xBlue/xGreen/xWidth/xStyle - void setBorderAttributes( QDomElement& borderElement, const wvWare::Word97::BRC& brc, const QString& prefix = QString::null ); + void setBorderAttributes( TQDomElement& borderElement, const wvWare::Word97::BRC& brc, const TQString& prefix = TQString() ); // Convert wv2's Header Type to a KWord frameInfo value int headerTypeToFrameInfo( unsigned char type ); // Convert wv2's Header Type to a KWord frameset name - QString headerTypeToFramesetName( unsigned char type ); + TQString headerTypeToFramesetName( unsigned char type ); - // Convert a mask of Header Types to the hType value for KWord - int headerMaskToHType( unsigned char mask ); + // Convert a tqmask of Header Types to the hType value for KWord + int headerMaskToHType( unsigned char tqmask ); - // Convert a mask of Header Types to the fType value for KWord - int headerMaskToFType( unsigned char mask ); + // Convert a tqmask of Header Types to the fType value for KWord + int headerMaskToFType( unsigned char tqmask ); // Convert wv2's FLD to KWord FIELD.subtype (or -1 if can't be handled) int fldToFieldType( const wvWare::FLD* fld ); diff --git a/filters/kword/msword/document.cpp b/filters/kword/msword/document.cpp index 9d2eab18..f5737200 100644 --- a/filters/kword/msword/document.cpp +++ b/filters/kword/msword/document.cpp @@ -40,7 +40,7 @@ #include <KoFilterChain.h> -Document::Document( const std::string& fileName, QDomDocument& mainDocument, QDomDocument& documentInfo, QDomElement& framesetsElement, KoFilterChain* chain ) +Document::Document( const std::string& fileName, TQDomDocument& mainDocument, TQDomDocument& documentInfo, TQDomElement& framesetsElement, KoFilterChain* chain ) : m_mainDocument( mainDocument ), m_documentInfo ( documentInfo ), m_framesetsElement( framesetsElement ), m_replacementHandler( new KWordReplacementHandler ), m_tableHandler( new KWordTableHandler ), @@ -52,12 +52,12 @@ Document::Document( const std::string& fileName, QDomDocument& mainDocument, QDo if ( m_parser ) // 0 in case of major error (e.g. unsupported format) { m_textHandler = new KWordTextHandler( m_parser ); - connect( m_textHandler, SIGNAL( subDocFound( const wvWare::FunctorBase*, int ) ), - this, SLOT( slotSubDocFound( const wvWare::FunctorBase*, int ) ) ); - connect( m_textHandler, SIGNAL( tableFound( const KWord::Table& ) ), - this, SLOT( slotTableFound( const KWord::Table& ) ) ); - connect( m_textHandler, SIGNAL( pictureFound( const QString&, const QString&, const wvWare::FunctorBase* ) ), - this, SLOT( slotPictureFound( const QString&, const QString&, const wvWare::FunctorBase* ) ) ); + connect( m_textHandler, TQT_SIGNAL( subDocFound( const wvWare::FunctorBase*, int ) ), + this, TQT_SLOT( slotSubDocFound( const wvWare::FunctorBase*, int ) ) ); + connect( m_textHandler, TQT_SIGNAL( tableFound( const KWord::Table& ) ), + this, TQT_SLOT( slotTableFound( const KWord::Table& ) ) ); + connect( m_textHandler, TQT_SIGNAL( pictureFound( const TQString&, const TQString&, const wvWare::FunctorBase* ) ), + this, TQT_SLOT( slotPictureFound( const TQString&, const TQString&, const wvWare::FunctorBase* ) ) ); m_parser->setSubDocumentHandler( this ); m_parser->setTextHandler( m_textHandler ); m_parser->setTableHandler( m_tableHandler ); @@ -67,10 +67,10 @@ Document::Document( const std::string& fileName, QDomDocument& mainDocument, QDo m_parser->setInlineReplacementHandler( m_replacementHandler ); processStyles(); processAssociatedStrings(); - connect( m_tableHandler, SIGNAL( sigTableCellStart( int, int, int, int, const KoRect&, const QString&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::SHD& ) ), - this, SLOT( slotTableCellStart( int, int, int, int, const KoRect&, const QString&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::SHD& ) ) ); - connect( m_tableHandler, SIGNAL( sigTableCellEnd() ), - this, SLOT( slotTableCellEnd() ) ); + connect( m_tableHandler, TQT_SIGNAL( sigTableCellStart( int, int, int, int, const KoRect&, const TQString&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::SHD& ) ), + this, TQT_SLOT( slotTableCellStart( int, int, int, int, const KoRect&, const TQString&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::BRC&, const wvWare::Word97::SHD& ) ) ); + connect( m_tableHandler, TQT_SIGNAL( sigTableCellEnd() ), + this, TQT_SLOT( slotTableCellEnd() ) ); } } @@ -86,9 +86,9 @@ void Document::finishDocument() { const wvWare::Word97::DOP& dop = m_parser->dop(); - QDomElement elementDoc = m_mainDocument.documentElement(); + TQDomElement elementDoc = m_mainDocument.documentElement(); - QDomElement element; + TQDomElement element; element = m_mainDocument.createElement("ATTRIBUTES"); element.setAttribute("processing",0); // WP char allHeaders = ( wvWare::HeaderData::HeaderEven | @@ -116,7 +116,7 @@ void Document::finishDocument() // Done at the end: write the type of headers/footers, // depending on which kind of headers and footers we received. - QDomElement paperElement = elementDoc.namedItem("PAPER").toElement(); + TQDomElement paperElement = elementDoc.namedItem("PAPER").toElement(); Q_ASSERT ( !paperElement.isNull() ); // slotFirstSectionFound should have been called! if ( !paperElement.isNull() ) { @@ -126,10 +126,10 @@ void Document::finishDocument() } // Write out <PICTURES> tag - QDomElement picturesElem = m_mainDocument.createElement("PICTURES"); + TQDomElement picturesElem = m_mainDocument.createElement("PICTURES"); elementDoc.appendChild( picturesElem ); - for( QStringList::Iterator it = m_pictureList.begin(); it != m_pictureList.end(); ++it ) { - QDomElement keyElem = m_mainDocument.createElement("KEY"); + for( TQStringList::Iterator it = m_pictureList.begin(); it != m_pictureList.end(); ++it ) { + TQDomElement keyElem = m_mainDocument.createElement("KEY"); picturesElem.appendChild( keyElem ); keyElem.setAttribute( "filename", *it ); keyElem.setAttribute( "name", *it ); @@ -139,11 +139,11 @@ void Document::finishDocument() void Document::processAssociatedStrings() { wvWare::AssociatedStrings strings( m_parser->associatedStrings() ); - QDomElement infodoc = m_documentInfo.createElement( "document-info" ); - QDomElement author = m_documentInfo.createElement( "author" ); - QDomElement fullname = m_documentInfo.createElement( "full-name" ); - QDomElement title = m_documentInfo.createElement( "title" ); - QDomElement about = m_documentInfo.createElement( "about" ); + TQDomElement infodoc = m_documentInfo.createElement( "document-info" ); + TQDomElement author = m_documentInfo.createElement( "author" ); + TQDomElement fullname = m_documentInfo.createElement( "full-name" ); + TQDomElement title = m_documentInfo.createElement( "title" ); + TQDomElement about = m_documentInfo.createElement( "about" ); m_documentInfo.appendChild(infodoc); @@ -171,7 +171,7 @@ void Document::processAssociatedStrings() { void Document::processStyles() { - QDomElement stylesElem = m_mainDocument.createElement( "STYLES" ); + TQDomElement stylesElem = m_mainDocument.createElement( "STYLES" ); m_mainDocument.documentElement().appendChild( stylesElem ); m_textHandler->setFrameSetElement( stylesElem ); /// ### naming! @@ -185,11 +185,11 @@ void Document::processStyles() //kdDebug(30513) << k_funcinfo << "style " << i << " " << style << endl; if ( style && style->type() == wvWare::Style::sgcPara ) { - QDomElement styleElem = m_mainDocument.createElement("STYLE"); + TQDomElement styleElem = m_mainDocument.createElement("STYLE"); stylesElem.appendChild( styleElem ); - QConstString name = Conversion::string( style->name() ); - QDomElement element = m_mainDocument.createElement("NAME"); + TQConstString name = Conversion::string( style->name() ); + TQDomElement element = m_mainDocument.createElement("NAME"); element.setAttribute( "value", name.string() ); styleElem.appendChild( element ); @@ -198,7 +198,7 @@ void Document::processStyles() const wvWare::Style* followingStyle = styles.styleByID( style->followingStyle() ); if ( followingStyle && followingStyle != style ) { - QConstString followingName = Conversion::string( followingStyle->name() ); + TQConstString followingName = Conversion::string( followingStyle->name() ); element = m_mainDocument.createElement("FOLLOWING"); element.setAttribute( "name", followingName.string() ); styleElem.appendChild( element ); @@ -226,7 +226,7 @@ void Document::bodyStart() { kdDebug(30513) << k_funcinfo << endl; - QDomElement mainFramesetElement = m_mainDocument.createElement("FRAMESET"); + TQDomElement mainFramesetElement = m_mainDocument.createElement("FRAMESET"); mainFramesetElement.setAttribute("frameType",1); mainFramesetElement.setAttribute("frameInfo",0); // TODO: "name" attribute (needs I18N) @@ -236,25 +236,25 @@ void Document::bodyStart() createInitialFrame( mainFramesetElement, 29, 798, 42, 566, false, Reconnect ); m_textHandler->setFrameSetElement( mainFramesetElement ); - connect( m_textHandler, SIGNAL( firstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ), - this, SLOT( slotFirstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ) ); + connect( m_textHandler, TQT_SIGNAL( firstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ), + this, TQT_SLOT( slotFirstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ) ); m_bodyFound = true; } void Document::bodyEnd() { kdDebug(30513) << k_funcinfo << endl; - disconnect( m_textHandler, SIGNAL( firstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ), - this, SLOT( slotFirstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ) ); + disconnect( m_textHandler, TQT_SIGNAL( firstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ), + this, TQT_SLOT( slotFirstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ) ) ); } void Document::slotFirstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> sep ) { kdDebug(30513) << k_funcinfo << endl; - QDomElement elementDoc = m_mainDocument.documentElement(); + TQDomElement elementDoc = m_mainDocument.documentElement(); - QDomElement elementPaper = m_mainDocument.createElement("PAPER"); + TQDomElement elementPaper = m_mainDocument.createElement("PAPER"); bool landscape = (sep->dmOrientPage == 2); double width = (double)sep->xaPage / 20.0; double height = (double)sep->yaPage / 20.0; @@ -275,7 +275,7 @@ void Document::slotFirstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SE // elementPaper.setAttribute("zoom",100); // not a doc property in kword elementDoc.appendChild(elementPaper); - QDomElement element = m_mainDocument.createElement("PAPERBORDERS"); + TQDomElement element = m_mainDocument.createElement("PAPERBORDERS"); element.setAttribute("left", (double)sep->dxaLeft / 20.0); element.setAttribute("top",(double)sep->dyaTop / 20.0); element.setAttribute("right", (double)sep->dxaRight / 20.0); @@ -291,7 +291,7 @@ void Document::headerStart( wvWare::HeaderData::Type type ) kdDebug(30513) << "startHeader type=" << type << " (" << Conversion::headerTypeToFramesetName( type ) << ")" << endl; // Werner says the headers are always emitted in the order of the Type enum. - QDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); + TQDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); framesetElement.setAttribute( "frameType", 1 ); framesetElement.setAttribute( "frameInfo", Conversion::headerTypeToFrameInfo( type ) ); framesetElement.setAttribute( "name", Conversion::headerTypeToFramesetName( type ) ); @@ -313,7 +313,7 @@ void Document::headerStart( wvWare::HeaderData::Type type ) void Document::headerEnd() { - m_textHandler->setFrameSetElement( QDomElement() ); + m_textHandler->setFrameSetElement( TQDomElement() ); } void Document::footnoteStart() @@ -323,15 +323,15 @@ void Document::footnoteStart() int type = subdoc.data; // Create footnote/endnote frameset - QDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); + TQDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); framesetElement.setAttribute( "frameType", 1 /* text */ ); framesetElement.setAttribute( "frameInfo", 7 /* footnote/endnote */ ); if ( type == wvWare::FootnoteData::Endnote ) // Keep name in sync with KWordTextHandler::footnoteFound - framesetElement.setAttribute("name", i18n("Endnote %1").arg( ++m_endNoteNumber ) ); + framesetElement.setAttribute("name", i18n("Endnote %1").tqarg( ++m_endNoteNumber ) ); else // Keep name in sync with KWordTextHandler::footnoteFound - framesetElement.setAttribute("name", i18n("Footnote %1").arg( ++m_footNoteNumber ) ); + framesetElement.setAttribute("name", i18n("Footnote %1").tqarg( ++m_footNoteNumber ) ); m_framesetsElement.appendChild(framesetElement); createInitialFrame( framesetElement, 29, 798, 567, 567+41, true, NoFollowup ); @@ -342,17 +342,17 @@ void Document::footnoteStart() void Document::footnoteEnd() { kdDebug(30513) << k_funcinfo << endl; - m_textHandler->setFrameSetElement( QDomElement() ); + m_textHandler->setFrameSetElement( TQDomElement() ); } -void Document::slotTableCellStart( int row, int column, int rowSpan, int columnSpan, const KoRect& cellRect, const QString& tableName, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ) +void Document::slotTableCellStart( int row, int column, int rowSpan, int columnSpan, const KoRect& cellRect, const TQString& tableName, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ) { // Create footnote/endnote frameset - QDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); + TQDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); framesetElement.setAttribute( "frameType", 1 /* text */ ); framesetElement.setAttribute( "frameInfo", 0 /* normal text */ ); framesetElement.setAttribute( "grpMgr", tableName ); - QString name = i18n("Table_Name Cell row,column", "%1 Cell %2,%3").arg(tableName).arg(row).arg(column); + TQString name = i18n("Table_Name Cell row,column", "%1 Cell %2,%3").tqarg(tableName).tqarg(row).tqarg(column); framesetElement.setAttribute( "name", name ); framesetElement.setAttribute( "row", row ); framesetElement.setAttribute( "col", column ); @@ -360,7 +360,7 @@ void Document::slotTableCellStart( int row, int column, int rowSpan, int columnS framesetElement.setAttribute( "cols", columnSpan ); m_framesetsElement.appendChild(framesetElement); - QDomElement frameElem = createInitialFrame( framesetElement, cellRect.left(), cellRect.right(), cellRect.top(), cellRect.bottom(), true, NoFollowup ); + TQDomElement frameElem = createInitialFrame( framesetElement, cellRect.left(), cellRect.right(), cellRect.top(), cellRect.bottom(), true, NoFollowup ); generateFrameBorder( frameElem, brcTop, brcBottom, brcLeft, brcRight, shd ); m_textHandler->setFrameSetElement( framesetElement ); @@ -368,12 +368,12 @@ void Document::slotTableCellStart( int row, int column, int rowSpan, int columnS void Document::slotTableCellEnd() { - m_textHandler->setFrameSetElement( QDomElement() ); + m_textHandler->setFrameSetElement( TQDomElement() ); } -QDomElement Document::createInitialFrame( QDomElement& parentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ) +TQDomElement Document::createInitialFrame( TQDomElement& tqparentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ) { - QDomElement frameElementOut = parentFramesetElem.ownerDocument().createElement("FRAME"); + TQDomElement frameElementOut = tqparentFramesetElem.ownerDocument().createElement("FRAME"); frameElementOut.setAttribute( "left", left ); frameElementOut.setAttribute( "right", right ); frameElementOut.setAttribute( "top", top ); @@ -382,11 +382,11 @@ QDomElement Document::createInitialFrame( QDomElement& parentFramesetElem, doubl // AutoExtendFrame for header/footer/footnote/endnote, AutoCreateNewFrame for body text frameElementOut.setAttribute( "autoCreateNewFrame", autoExtend ? 0 : 1 ); frameElementOut.setAttribute( "newFrameBehavior", nfb ); - parentFramesetElem.appendChild( frameElementOut ); + tqparentFramesetElem.appendChild( frameElementOut ); return frameElementOut; } -void Document::generateFrameBorder( QDomElement& frameElementOut, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ) +void Document::generateFrameBorder( TQDomElement& frameElementOut, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ) { // Frame borders @@ -405,12 +405,12 @@ void Document::generateFrameBorder( QDomElement& frameElementOut, const wvWare:: // If ipat = 0 (solid fill), icoBack is the background color. // But otherwise, icoFore is the one we need to set as bkColor // (and icoBack is usually white; it's the other colour of the pattern, - // something that we can't set in Qt apparently). + // something that we can't set in TQt aptqparently). int bkColor = shd.ipat ? shd.cvFore : shd.cvBack; kdDebug(30513) << "generateFrameBorder: " << " icoFore=" << shd.cvFore << " icoBack=" << shd.cvBack << " ipat=" << shd.ipat << " -> bkColor=" << bkColor << endl; // Reverse-engineer MSWord's own hackery: it models various gray levels - // using dithering. But this looks crappy with Qt. So we go back to a QColor. + // using dithering. But this looks crappy with TQt. So we go back to a TQColor. bool grayHack = ( shd.ipat && shd.cvFore == 1 && shd.cvBack == 8 ); if ( grayHack ) { @@ -418,8 +418,8 @@ void Document::generateFrameBorder( QDomElement& frameElementOut, const wvWare:: int grayLevel = Conversion::ditheringToGray( shd.ipat, &ok ); if ( ok ) { - QColor color( 0, 0, grayLevel, QColor::Hsv ); - QString prefix = "bk"; + TQColor color( 0, 0, grayLevel, TQColor::Hsv ); + TQString prefix = "bk"; frameElementOut.setAttribute( "bkRed", color.red() ); frameElementOut.setAttribute( "bkBlue", color.blue() ); frameElementOut.setAttribute( "bkGreen", color.green() ); @@ -438,7 +438,7 @@ void Document::generateFrameBorder( QDomElement& frameElementOut, const wvWare:: void Document::slotSubDocFound( const wvWare::FunctorBase* functor, int data ) { - SubDocument subdoc( functor, data, QString::null, QString::null ); + SubDocument subdoc( functor, data, TQString(), TQString() ); m_subdocQueue.push( subdoc ); } @@ -447,7 +447,7 @@ void Document::slotTableFound( const KWord::Table& table ) m_tableQueue.push( table ); } -void Document::slotPictureFound( const QString& frameName, const QString& pictureName, +void Document::slotPictureFound( const TQString& frameName, const TQString& pictureName, const wvWare::FunctorBase* pictureFunctor ) { SubDocument subdoc( pictureFunctor, 0, frameName, pictureName ); @@ -472,8 +472,8 @@ void Document::processSubDocQueue() { KWord::Table& table = m_tableQueue.front(); m_tableHandler->tableStart( &table ); - QValueList<KWord::Row> &rows = table.rows; - for( QValueList<KWord::Row>::Iterator it = rows.begin(); it != rows.end(); ++it ) { + TQValueList<KWord::Row> &rows = table.rows; + for( TQValueList<KWord::Row>::Iterator it = rows.begin(); it != rows.end(); ++it ) { KWord::TableRowFunctorPtr f = (*it).functorPtr; Q_ASSERT( f ); (*f)(); // call it @@ -490,7 +490,7 @@ KoStoreDevice* Document::createPictureFrameSet( const KoSize& size ) // Grab data that was stored with the functor, that triggered this parsing SubDocument subdoc( m_subdocQueue.front() ); - QDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); + TQDomElement framesetElement = m_mainDocument.createElement("FRAMESET"); framesetElement.setAttribute( "frameType", 2 /*picture*/ ); framesetElement.setAttribute( "frameInfo", 0 ); framesetElement.setAttribute( "name", subdoc.name ); @@ -503,10 +503,10 @@ KoStoreDevice* Document::createPictureFrameSet( const KoSize& size ) // if (aPic.dxaGoal == 1000 && aPic.mx == 1) //100% hack ? (from ww8graf2.cxx) createInitialFrame( framesetElement, 0, size.width(), 0, size.height(), false, NoFollowup ); - QDomElement pictureElem = m_mainDocument.createElement("PICTURE"); + TQDomElement pictureElem = m_mainDocument.createElement("PICTURE"); framesetElement.appendChild( pictureElem ); - QDomElement keyElem = m_mainDocument.createElement("KEY"); + TQDomElement keyElem = m_mainDocument.createElement("KEY"); pictureElem.appendChild( keyElem ); keyElem.setAttribute( "filename", subdoc.extraName ); m_pictureList.append( subdoc.extraName ); diff --git a/filters/kword/msword/document.h b/filters/kword/msword/document.h index f779f35d..0e79065a 100644 --- a/filters/kword/msword/document.h +++ b/filters/kword/msword/document.h @@ -25,10 +25,10 @@ #include <wv2/handlers.h> #include <wv2/functor.h> -#include <qstring.h> -#include <qdom.h> -#include <qobject.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqdom.h> +#include <tqobject.h> +#include <tqstringlist.h> #include <queue> #include <string> @@ -49,11 +49,12 @@ class KWordTableHandler; class KWordPictureHandler; class KWordTextHandler; -class Document : public QObject, public wvWare::SubDocumentHandler +class Document : public TQObject, public wvWare::SubDocumentHandler { Q_OBJECT + TQ_OBJECT public: - Document( const std::string& fileName, QDomDocument& mainDocument, QDomDocument &documentInfo, QDomElement& framesetsElement, KoFilterChain* chain ); + Document( const std::string& fileName, TQDomDocument& mainDocument, TQDomDocument &documentInfo, TQDomElement& framesetsElement, KoFilterChain* chain ); virtual ~Document(); bool hasParser() const { return m_parser != 0L; } @@ -77,13 +78,13 @@ public: typedef const wvWare::FunctorBase* FunctorPtr; struct SubDocument { - SubDocument( FunctorPtr ptr, int d, const QString& n, const QString& extra ) + SubDocument( FunctorPtr ptr, int d, const TQString& n, const TQString& extra ) : functorPtr(ptr), data(d), name(n), extraName(extra) {} ~SubDocument() {} FunctorPtr functorPtr; int data; - QString name; - QString extraName; + TQString name; + TQString extraName; }; // Called by PictureHandler @@ -101,23 +102,23 @@ protected slots: void slotTableFound( const KWord::Table& table ); // Write out the frameset and add the key to the PICTURES tag - void slotPictureFound( const QString& frameName, const QString& pictureName, const wvWare::FunctorBase* ); + void slotPictureFound( const TQString& frameName, const TQString& pictureName, const wvWare::FunctorBase* ); // Similar to footnoteStart/footnoteEnd but for cells. // This is connected to KWordTableHandler - void slotTableCellStart( int row, int column, int rowSize, int columnSize, const KoRect& cellRect, const QString& tableName, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ); + void slotTableCellStart( int row, int column, int rowSize, int columnSize, const KoRect& cellRect, const TQString& tableName, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ); void slotTableCellEnd(); private: void processStyles(); void processAssociatedStrings(); enum NewFrameBehavior { Reconnect=0, NoFollowup=1, Copy=2 }; - QDomElement createInitialFrame( QDomElement& parentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ); - void generateFrameBorder( QDomElement& frameElementOut, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ); + TQDomElement createInitialFrame( TQDomElement& tqparentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ); + void generateFrameBorder( TQDomElement& frameElementOut, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ); - QDomDocument& m_mainDocument; - QDomDocument& m_documentInfo; - QDomElement& m_framesetsElement; + TQDomDocument& m_mainDocument; + TQDomDocument& m_documentInfo; + TQDomElement& m_framesetsElement; KWordReplacementHandler* m_replacementHandler; KWordTableHandler* m_tableHandler; KWordPictureHandler* m_pictureHandler; @@ -126,8 +127,8 @@ private: wvWare::SharedPtr<wvWare::Parser> m_parser; std::queue<SubDocument> m_subdocQueue; std::queue<KWord::Table> m_tableQueue; - QStringList m_pictureList; // for <PICTURES> - unsigned char m_headerFooters; // a mask of HeaderData::Type bits + TQStringList m_pictureList; // for <PICTURES> + unsigned char m_headerFooters; // a tqmask of HeaderData::Type bits bool m_bodyFound; int m_footNoteNumber; // number of footnote _framesets_ written out int m_endNoteNumber; // number of endnote _framesets_ written out diff --git a/filters/kword/msword/graphicshandler.cpp b/filters/kword/msword/graphicshandler.cpp index c31d5d8c..efcef0e7 100644 --- a/filters/kword/msword/graphicshandler.cpp +++ b/filters/kword/msword/graphicshandler.cpp @@ -28,7 +28,7 @@ using namespace wvWare; -KWordPictureHandler::KWordPictureHandler( Document* doc ) : QObject(), m_doc(doc) +KWordPictureHandler::KWordPictureHandler( Document* doc ) : TQObject(), m_doc(doc) { } @@ -57,10 +57,10 @@ void KWordPictureHandler::wmfData( OLEImageReader& reader, SharedPtr<const Word9 #define IMG_BUF_SIZE 2048 wvWare::U8 buf[IMG_BUF_SIZE]; - Q_LONG len = reader.size(); + TQ_LONG len = reader.size(); while ( len > 0 ) { - size_t n = reader.read( buf, QMIN( len, IMG_BUF_SIZE ) ); - Q_LONG n1 = dev->writeBlock( (const char*)buf, n ); + size_t n = reader.read( buf, TQMIN( len, IMG_BUF_SIZE ) ); + TQ_LONG n1 = dev->writeBlock( (const char*)buf, n ); Q_ASSERT( (size_t)n1 == n ); if ( (size_t)n1 != n ) return; // ouch diff --git a/filters/kword/msword/graphicshandler.h b/filters/kword/msword/graphicshandler.h index b740ddec..341ebbb5 100644 --- a/filters/kword/msword/graphicshandler.h +++ b/filters/kword/msword/graphicshandler.h @@ -23,7 +23,7 @@ #include <wv2/functor.h> #include <wv2/handlers.h> -#include <qobject.h> +#include <tqobject.h> #include "document.h" #include "versionmagic.h" @@ -36,9 +36,10 @@ namespace wvWare } #endif // IMAGE_IMPORT -class KWordPictureHandler : public QObject, public wvWare::PictureHandler +class KWordPictureHandler : public TQObject, public wvWare::PictureHandler { Q_OBJECT + TQ_OBJECT public: KWordPictureHandler( Document* doc ); diff --git a/filters/kword/msword/mswordimport.cpp b/filters/kword/msword/mswordimport.cpp index 1f6df6af..3be95f7a 100644 --- a/filters/kword/msword/mswordimport.cpp +++ b/filters/kword/msword/mswordimport.cpp @@ -19,9 +19,9 @@ #include "mswordimport.h" -#include <qdom.h> -#include <qfontinfo.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfontinfo.h> +#include <tqfile.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -33,7 +33,7 @@ typedef KGenericFactory<MSWordImport, KoFilter> MSWordImportFactory; K_EXPORT_COMPONENT_FACTORY( libmswordimport, MSWordImportFactory( "kofficefilters" ) ) -MSWordImport::MSWordImport( KoFilter *, const char *, const QStringList& ) : KoFilter() +MSWordImport::MSWordImport( KoFilter *, const char *, const TQStringList& ) : KoFilter() { } @@ -41,7 +41,7 @@ MSWordImport::~MSWordImport() { } -KoFilter::ConversionStatus MSWordImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus MSWordImport::convert( const TQCString& from, const TQCString& to ) { // check for proper conversion if ( to != "application/x-kword" || from != "application/msword" ) @@ -49,14 +49,14 @@ KoFilter::ConversionStatus MSWordImport::convert( const QCString& from, const QC kdDebug(30513) << "######################## MSWordImport::convert ########################" << endl; - QDomDocument mainDocument; - QDomElement framesetsElem; + TQDomDocument mainDocument; + TQDomElement framesetsElem; prepareDocument( mainDocument, framesetsElem ); - QDomDocument documentInfo; + TQDomDocument documentInfo; documentInfo.appendChild (documentInfo.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) ); - Document document( QFile::encodeName( m_chain->inputFile() ).data(), mainDocument, documentInfo, framesetsElem, m_chain ); + Document document( TQFile::encodeName( m_chain->inputFile() ).data(), mainDocument, documentInfo, framesetsElem, m_chain ); if ( !document.hasParser() ) return KoFilter::WrongFormat; @@ -72,8 +72,8 @@ KoFilter::ConversionStatus MSWordImport::convert( const QCString& from, const QC kdError(30502) << "Unable to open output file!" << endl; return KoFilter::StorageCreationError; } - QCString cstr = mainDocument.toCString(); - // WARNING: we cannot use KoStore::write(const QByteArray&) because it gives an extra NULL character at the end. + TQCString cstr = mainDocument.toCString(); + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it gives an extra NULL character at the end. out->writeBlock( cstr, cstr.length() ); out->close(); @@ -90,11 +90,11 @@ KoFilter::ConversionStatus MSWordImport::convert( const QCString& from, const QC return KoFilter::OK; } -void MSWordImport::prepareDocument( QDomDocument& mainDocument, QDomElement& framesetsElem ) +void MSWordImport::prepareDocument( TQDomDocument& mainDocument, TQDomElement& framesetsElem ) { mainDocument.appendChild( mainDocument.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement elementDoc; + TQDomElement elementDoc; elementDoc=mainDocument.createElement("DOC"); elementDoc.setAttribute("editor","KWord's MS Word Import Filter"); elementDoc.setAttribute("mime","application/x-kword"); diff --git a/filters/kword/msword/mswordimport.h b/filters/kword/msword/mswordimport.h index e41959a9..a961e071 100644 --- a/filters/kword/msword/mswordimport.h +++ b/filters/kword/msword/mswordimport.h @@ -22,20 +22,21 @@ #include <KoFilter.h> -class QDomDocument; -class QDomElement; +class TQDomDocument; +class TQDomElement; class MSWordImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - MSWordImport( KoFilter* parent, const char* name, const QStringList& ); + MSWordImport( KoFilter* tqparent, const char* name, const TQStringList& ); virtual ~MSWordImport(); - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: - void prepareDocument( QDomDocument& mainDocument, QDomElement& framesetsElem ); + void prepareDocument( TQDomDocument& mainDocument, TQDomElement& framesetsElem ); }; #endif // MSWORDIMPORT_H diff --git a/filters/kword/msword/tablehandler.cpp b/filters/kword/msword/tablehandler.cpp index d62644b8..9e933249 100644 --- a/filters/kword/msword/tablehandler.cpp +++ b/filters/kword/msword/tablehandler.cpp @@ -23,7 +23,7 @@ #include <kdebug.h> #include <KoRect.h> -#include <qtl.h> +#include <tqtl.h> KWordTableHandler::KWordTableHandler() { @@ -112,15 +112,15 @@ void KWordTableHandler::tableCellStart() //kdDebug(30513) << "fVertRestart is set!" << endl; // This cell is the first one of a series of vertically merged cells -> // we want to find out its size. - QValueList<KWord::Row>::Iterator it = m_currentTable->rows.at( m_row + 1 ); + TQValueList<KWord::Row>::Iterator it = m_currentTable->rows.at( m_row + 1 ); for( ; it != m_currentTable->rows.end(); ++it ) { // Find cell right below us in row (*it), if any KWord::TAPptr tapBelow = (*it).tap; const wvWare::Word97::TC* tcBelow = 0L; for ( int c = 0; !tcBelow && c < tapBelow->itcMac ; ++c ) { - if ( QABS( tapBelow->rgdxaCenter[ c ] - left ) <= 3 - && QABS( tapBelow->rgdxaCenter[ c + 1 ] - right ) <= 3 ) { + if ( TQABS( tapBelow->rgdxaCenter[ c ] - left ) <= 3 + && TQABS( tapBelow->rgdxaCenter[ c + 1 ] - right ) <= 3 ) { tcBelow = &tapBelow->rgtc[ c ]; //kdDebug(30513) << "found cell below, at (Word) column " << c << " fVertMerge:" << tcBelow->fVertMerge << endl; } @@ -201,7 +201,7 @@ void KWord::Table::cacheCellEdge(int cellEdge) } // Add the edge to the array. - m_cellEdges.resize(size + 1, QGArray::SpeedOptim); + m_cellEdges.resize(size + 1, TQGArray::SpeedOptim); m_cellEdges[size] = cellEdge; kdDebug(30513) << k_funcinfo << cellEdge << " -> added. Size=" << size+1 << endl; } @@ -222,7 +222,7 @@ int KWord::Table::columnNumber(int cellEdge) const double KWordTableHandler::rowHeight() const { - return QMAX( m_tap->dyaRowHeight / 20.0, 20); + return TQMAX( m_tap->dyaRowHeight / 20.0, 20); } #include "tablehandler.moc" diff --git a/filters/kword/msword/tablehandler.h b/filters/kword/msword/tablehandler.h index 3164cf1f..95fbdba9 100644 --- a/filters/kword/msword/tablehandler.h +++ b/filters/kword/msword/tablehandler.h @@ -23,9 +23,9 @@ #include <wv2/functor.h> #include <wv2/word97_generated.h> // for TAP #include <wv2/handlers.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqobject.h> #include <deque> namespace wvWare { @@ -44,7 +44,7 @@ namespace KWord // Data for a given row table. This struct is used by the Table struct. struct Row { - Row() : functorPtr( 0L ), tap( 0L ) {} // QValueList wants that one + Row() : functorPtr( 0L ), tap( 0L ) {} // TQValueList wants that one Row( TableRowFunctorPtr ptr, TAPptr _tap ) : functorPtr(ptr), tap(_tap) {} ~Row() {} @@ -57,8 +57,8 @@ namespace KWord // during text parsing and the final generation of table cells. struct Table { - QString name; // kword's grpMgr attribute - QValueList<Row> rows; // need to use QValueList to benefit from implicit sharing + TQString name; // kword's grpMgr attribute + TQValueList<Row> rows; // need to use TQValueList to benefit from implicit sharing // Word has a very flexible concept of columns: each row can vary the // edges of each column. We must map this onto a set of fixed-width columns @@ -66,16 +66,17 @@ namespace KWord // the original Word cells. We accumulate all the known edges for a given // table in an array. // Important: don't use unsigned int. Value can be negative (relative to margin...). - QMemArray<int> m_cellEdges; + TQMemArray<int> m_cellEdges; void cacheCellEdge( int cellEdge ); int columnNumber( int cellEdge ) const; }; } -class KWordTableHandler : public QObject, public wvWare::TableHandler +class KWordTableHandler : public TQObject, public wvWare::TableHandler { Q_OBJECT + TQ_OBJECT public: KWordTableHandler(); @@ -91,7 +92,7 @@ public: signals: // Tells Document to create frameset for cell - void sigTableCellStart( int row, int column, int rowSpan, int columnSpan, const KoRect& cellRect, const QString& tableName, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ); + void sigTableCellStart( int row, int column, int rowSpan, int columnSpan, const KoRect& cellRect, const TQString& tableName, const wvWare::Word97::BRC& brcTop, const wvWare::Word97::BRC& brcBottom, const wvWare::Word97::BRC& brcLeft, const wvWare::Word97::BRC& brcRight, const wvWare::Word97::SHD& shd ); void sigTableCellEnd(); protected: diff --git a/filters/kword/msword/texthandler.cpp b/filters/kword/msword/texthandler.cpp index c9586da4..0dcffdbb 100644 --- a/filters/kword/msword/texthandler.cpp +++ b/filters/kword/msword/texthandler.cpp @@ -29,8 +29,8 @@ #include <wv2/parser.h> #include <wv2/fields.h> -#include <qfont.h> -#include <qfontinfo.h> +#include <tqfont.h> +#include <tqfontinfo.h> #include <kdebug.h> #include <klocale.h> @@ -90,7 +90,7 @@ void KWordTextHandler::sectionEnd() void KWordTextHandler::pageBreak() { // Check if PAGEBREAKING already exists (e.g. due to linesTogether) - QDomElement pageBreak = m_oldLayout.namedItem( "PAGEBREAKING" ).toElement(); + TQDomElement pageBreak = m_oldLayout.namedItem( "PAGEBREAKING" ).toElement(); if ( pageBreak.isNull() ) { pageBreak = mainDocument().createElement( "PAGEBREAKING" ); @@ -113,37 +113,37 @@ void KWordTextHandler::footnoteFound( wvWare::FootnoteData::Type type, const wvWare::FootnoteFunctor& parseFootnote ) { bool autoNumbered = (character.unicode() == 2); - QDomElement varElem = insertVariable( 11 /*KWord code for footnotes*/, chp, "STRI" ); - QDomElement footnoteElem = varElem.ownerDocument().createElement( "FOOTNOTE" ); + TQDomElement varElem = insertVariable( 11 /*KWord code for footnotes*/, chp, "STRI" ); + TQDomElement footnoteElem = varElem.ownerDocument().createElement( "FOOTNOTE" ); if ( autoNumbered ) footnoteElem.setAttribute( "value", 1 ); // KWord will renumber anyway else - footnoteElem.setAttribute( "value", QString(QChar(character.unicode())) ); + footnoteElem.setAttribute( "value", TQString(TQChar(character.unicode())) ); footnoteElem.setAttribute( "notetype", type == wvWare::FootnoteData::Endnote ? "endnote" : "footnote" ); footnoteElem.setAttribute( "numberingtype", autoNumbered ? "auto" : "manual" ); if ( type == wvWare::FootnoteData::Endnote ) // Keep name in sync with Document::startFootnote - footnoteElem.setAttribute( "frameset", i18n("Endnote %1").arg( ++m_endNoteNumber ) ); + footnoteElem.setAttribute( "frameset", i18n("Endnote %1").tqarg( ++m_endNoteNumber ) ); else // Keep name in sync with Document::startFootnote - footnoteElem.setAttribute( "frameset", i18n("Footnote %1").arg( ++m_footNoteNumber ) ); + footnoteElem.setAttribute( "frameset", i18n("Footnote %1").tqarg( ++m_footNoteNumber ) ); varElem.appendChild( footnoteElem ); // Remember to parse the footnote text later emit subDocFound( new wvWare::FootnoteFunctor( parseFootnote ), type ); } -QDomElement KWordTextHandler::insertVariable( int type, wvWare::SharedPtr<const wvWare::Word97::CHP> chp, const QString& format ) +TQDomElement KWordTextHandler::insertVariable( int type, wvWare::SharedPtr<const wvWare::Word97::CHP> chp, const TQString& format ) { m_paragraph += '#'; - QDomElement formatElem; + TQDomElement formatElem; writeFormat( m_formats, chp, m_currentStyle ? &m_currentStyle->chp() : 0, m_index, 1, 4 /*id*/, &formatElem ); m_index += 1; - QDomElement varElem = m_formats.ownerDocument().createElement( "VARIABLE" ); - QDomElement typeElem = m_formats.ownerDocument().createElement( "TYPE" ); + TQDomElement varElem = m_formats.ownerDocument().createElement( "VARIABLE" ); + TQDomElement typeElem = m_formats.ownerDocument().createElement( "TYPE" ); typeElem.setAttribute( "type", type ); typeElem.setAttribute( "key", format ); varElem.appendChild( typeElem ); @@ -160,7 +160,7 @@ void KWordTextHandler::tableRowFound( const wvWare::TableRowFunctor& functor, wv paragraphStart( 0L ); static int s_tableNumber = 0; m_currentTable = new KWord::Table(); - m_currentTable->name = i18n("Table %1").arg( ++s_tableNumber ); + m_currentTable->name = i18n("Table %1").tqarg( ++s_tableNumber ); insertAnchor( m_currentTable->name ); } @@ -178,10 +178,10 @@ void KWordTextHandler::pictureFound( const wvWare::PictureFunctor& pictureFuncto wvWare::SharedPtr<const wvWare::Word97::CHP> /*chp*/ ) { static unsigned int s_pictureNumber = 0; - QString pictureName = "pictures/picture"; - pictureName += QString::number( s_pictureNumber ); // filenames start at 0 + TQString pictureName = "pictures/picture"; + pictureName += TQString::number( s_pictureNumber ); // filenames start at 0 // looks better to the user if frame names start at 1 - QString frameName = i18n("Picture %1").arg( ++s_pictureNumber ); + TQString frameName = i18n("Picture %1").tqarg( ++s_pictureNumber ); insertAnchor( frameName ); switch ( picf->mfp.mm ) { @@ -200,21 +200,21 @@ void KWordTextHandler::pictureFound( const wvWare::PictureFunctor& pictureFuncto } #endif // IMAGE_IMPORT -QDomElement KWordTextHandler::insertAnchor( const QString& fsname ) +TQDomElement KWordTextHandler::insertAnchor( const TQString& fsname ) { m_paragraph += '#'; // Can't call writeFormat, we have no chp. - QDomElement format( mainDocument().createElement( "FORMAT" ) ); + TQDomElement format( mainDocument().createElement( "FORMAT" ) ); format.setAttribute( "id", 6 ); format.setAttribute( "pos", m_index ); format.setAttribute( "len", 1 ); m_formats.appendChild( format ); - QDomElement formatElem = format; + TQDomElement formatElem = format; m_index += 1; - QDomElement anchorElem = m_formats.ownerDocument().createElement( "ANCHOR" ); + TQDomElement anchorElem = m_formats.ownerDocument().createElement( "ANCHOR" ); anchorElem.setAttribute( "type", "frameset" ); anchorElem.setAttribute( "instance", fsname ); formatElem.appendChild( anchorElem ); @@ -253,7 +253,7 @@ void KWordTextHandler::paragraphEnd() m_currentTable = 0L; } if ( m_currentStyle ) { - QConstString styleName = Conversion::string( m_currentStyle->name() ); + TQConstString styleName = Conversion::string( m_currentStyle->name() ); writeOutParagraph( styleName.string(), m_paragraph ); } else writeOutParagraph( "Standard", m_paragraph ); @@ -278,8 +278,8 @@ void KWordTextHandler::fieldEnd( const wvWare::FLD* /*fld*/, wvWare::SharedPtr<c // only for handled field type if( m_fieldType >= 0 ) { - QDomElement varElem = insertVariable( 8, chp, "STRING" ); - QDomElement fieldElem = varElem.ownerDocument().createElement( "FIELD" ); + TQDomElement varElem = insertVariable( 8, chp, "STRING" ); + TQDomElement fieldElem = varElem.ownerDocument().createElement( "FIELD" ); fieldElem.setAttribute( "subtype", m_fieldType ); fieldElem.setAttribute( "value", m_fieldValue ); varElem.appendChild( fieldElem ); @@ -294,7 +294,7 @@ void KWordTextHandler::fieldEnd( const wvWare::FLD* /*fld*/, wvWare::SharedPtr<c void KWordTextHandler::runOfText( const wvWare::UString& text, wvWare::SharedPtr<const wvWare::Word97::CHP> chp ) { - QConstString newText( Conversion::string( text ) ); + TQConstString newText( Conversion::string( text ) ); //kdDebug(30513) << "runOfText: " << newText.string() << endl; // text after fieldStart and before fieldSeparator is useless @@ -315,17 +315,17 @@ void KWordTextHandler::runOfText( const wvWare::UString& text, wvWare::SharedPtr } -void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Word97::CHP* chp, const wvWare::Word97::CHP* refChp, int pos, int len, int formatId, QDomElement* pChildElement ) +void KWordTextHandler::writeFormat( TQDomElement& tqparentElement, const wvWare::Word97::CHP* chp, const wvWare::Word97::CHP* refChp, int pos, int len, int formatId, TQDomElement* pChildElement ) { - QDomElement format( mainDocument().createElement( "FORMAT" ) ); + TQDomElement format( mainDocument().createElement( "FORMAT" ) ); format.setAttribute( "id", formatId ); format.setAttribute( "pos", pos ); format.setAttribute( "len", len ); if ( !refChp || refChp->cv != chp->cv ) { - QColor color = Conversion::color( chp->cv, -1 ); - QDomElement colorElem( mainDocument().createElement( "COLOR" ) ); + TQColor color = Conversion::color( chp->cv, -1 ); + TQDomElement colorElem( mainDocument().createElement( "COLOR" ) ); colorElem.setAttribute( "red", color.red() ); colorElem.setAttribute( "blue", color.blue() ); colorElem.setAttribute( "green", color.green() ); @@ -336,11 +336,11 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo // TBD: We only use the Ascii font code. We should work out how/when to use the FE and Other font codes. if ( !refChp || refChp->ftcAscii != chp->ftcAscii ) { - QString fontName = getFont( chp->ftcAscii ); + TQString fontName = getFont( chp->ftcAscii ); if ( !fontName.isEmpty() ) { - QDomElement fontElem( mainDocument().createElement( "FONT" ) ); + TQDomElement fontElem( mainDocument().createElement( "FONT" ) ); fontElem.setAttribute( "name", fontName ); format.appendChild( fontElem ); } @@ -349,24 +349,24 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo if ( !refChp || refChp->hps != chp->hps ) { //kdDebug(30513) << " font size: " << chp->hps/2 << endl; - QDomElement fontSize( mainDocument().createElement( "SIZE" ) ); + TQDomElement fontSize( mainDocument().createElement( "SIZE" ) ); fontSize.setAttribute( "value", (int)(chp->hps / 2) ); // hps is in half points format.appendChild( fontSize ); } if ( !refChp || refChp->fBold != chp->fBold ) { - QDomElement weight( mainDocument().createElement( "WEIGHT" ) ); + TQDomElement weight( mainDocument().createElement( "WEIGHT" ) ); weight.setAttribute( "value", chp->fBold ? 75 : 50 ); format.appendChild( weight ); } if ( !refChp || refChp->fItalic != chp->fItalic ) { - QDomElement italic( mainDocument().createElement( "ITALIC" ) ); + TQDomElement italic( mainDocument().createElement( "ITALIC" ) ); italic.setAttribute( "value", chp->fItalic ? 1 : 0 ); format.appendChild( italic ); } if ( !refChp || refChp->kul != chp->kul ) { - QDomElement underline( mainDocument().createElement( "UNDERLINE" ) ); - QString val = (chp->kul == 0) ? "0" : "1"; + TQDomElement underline( mainDocument().createElement( "UNDERLINE" ) ); + TQString val = (chp->kul == 0) ? "0" : "1"; switch ( chp->kul ) { case 3: // double underline.setAttribute( "styleline", "solid" ); @@ -404,7 +404,7 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo format.appendChild( underline ); } if ( !refChp || refChp->fStrike != chp->fStrike || refChp->fDStrike != chp->fDStrike ) { - QDomElement strikeout( mainDocument().createElement( "STRIKEOUT" ) ); + TQDomElement strikeout( mainDocument().createElement( "STRIKEOUT" ) ); if ( chp->fDStrike ) // double strikethrough { strikeout.setAttribute( "value", "double" ); @@ -423,12 +423,12 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo // font attribute (uppercase, lowercase (not in MSWord), small caps) if ( !refChp || refChp->fCaps != chp->fCaps || refChp->fSmallCaps != chp->fSmallCaps ) { - QDomElement fontAttrib( mainDocument().createElement( "FONTATTRIBUTE" ) ); + TQDomElement fontAttrib( mainDocument().createElement( "FONTATTRIBUTE" ) ); fontAttrib.setAttribute( "value", chp->fSmallCaps ? "smallcaps" : chp->fCaps ? "uppercase" : "none" ); format.appendChild( fontAttrib ); } if ( !refChp || refChp->iss != chp->iss ) { // superscript/subscript - QDomElement vertAlign( mainDocument().createElement( "VERTALIGN" ) ); + TQDomElement vertAlign( mainDocument().createElement( "VERTALIGN" ) ); // Obviously the values are reversed between the two file formats :) int kwordVAlign = (chp->iss==1 ? 2 : chp->iss==2 ? 1 : 0); vertAlign.setAttribute( "value", kwordVAlign ); @@ -437,10 +437,10 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo // background color is known as "highlight" in msword if ( !refChp || refChp->fHighlight != chp->fHighlight || refChp->icoHighlight != chp->icoHighlight ) { - QDomElement bgcolElem( mainDocument().createElement( "TEXTBACKGROUNDCOLOR" ) ); + TQDomElement bgcolElem( mainDocument().createElement( "TEXTBACKGROUNDCOLOR" ) ); if ( chp->fHighlight ) { - QColor color = Conversion::color( chp->icoHighlight, -1 ); + TQColor color = Conversion::color( chp->icoHighlight, -1 ); bgcolElem.setAttribute( "red", color.red() ); bgcolElem.setAttribute( "blue", color.blue() ); bgcolElem.setAttribute( "green", color.green() ); @@ -454,8 +454,8 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo // Shadow text. Only on/off. The properties are defined at the paragraph level (in KWord). if ( !refChp || refChp->fShadow != chp->fShadow || refChp->fImprint != chp->fImprint ) { - QDomElement shadowElem( mainDocument().createElement( "SHADOW" ) ); - QString css = "none"; + TQDomElement shadowElem( mainDocument().createElement( "SHADOW" ) ); + TQString css = "none"; // Generate a shadow with hardcoded values that make it look like in MSWord. // We need to make the distance depend on the font size though, to look good if (chp->fShadow || chp->fImprint) @@ -464,14 +464,14 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo int dist = fontSize > 20 ? 2 : 1; if (chp->fImprint) // ## no real support for imprint, we use a topleft shadow dist = -dist; - css = QString::fromLatin1("#bebebe %1pt %1pt").arg(dist).arg(dist); + css = TQString::tqfromLatin1("#bebebe %1pt %1pt").tqarg(dist).tqarg(dist); } shadowElem.setAttribute( "text-shadow", css ); format.appendChild( shadowElem ); } if ( pChildElement || !format.firstChild().isNull() ) // Don't save an empty format tag, unless the caller asked for it - parentElement.appendChild( format ); + tqparentElement.appendChild( format ); if ( pChildElement ) *pChildElement = format; } @@ -480,15 +480,15 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo // Return the name of a font. We have to convert the Microsoft font names to // something that might just be present under X11. -QString KWordTextHandler::getFont(unsigned fc) const +TQString KWordTextHandler::getFont(unsigned fc) const { Q_ASSERT( m_parser ); if ( !m_parser ) - return QString::null; + return TQString(); const wvWare::Word97::FFN& ffn ( m_parser->font( fc ) ); - QConstString fontName( Conversion::string( ffn.xszFfn ) ); - QString font = fontName.string(); + TQConstString fontName( Conversion::string( ffn.xszFfn ) ); + TQString font = fontName.string(); #ifdef FONT_DEBUG kdDebug(30513) << " MS-FONT: " << font << endl; @@ -497,7 +497,7 @@ QString KWordTextHandler::getFont(unsigned fc) const static const unsigned ENTRIES = 6; static const char* const fuzzyLookup[ENTRIES][2] = { - // MS contains X11 font family + // MS tqcontains X11 font family // substring. non-Xft name. { "times", "times" }, { "courier", "courier" }, @@ -507,7 +507,7 @@ QString KWordTextHandler::getFont(unsigned fc) const { "helvetica", "helvetica" } }; - // When Xft is available, Qt will do a good job of looking up our local + // When Xft is available, TQt will do a good job of looking up our local // equivalent of the MS font. But, we want to work even without Xft. // So, first, we do a fuzzy match of some common MS font names. unsigned i; @@ -515,7 +515,7 @@ QString KWordTextHandler::getFont(unsigned fc) const for (i = 0; i < ENTRIES; i++) { // The loop will leave unchanged any MS font name not fuzzy-matched. - if (font.find(fuzzyLookup[i][0], 0, FALSE) != -1) + if (font.tqfind(fuzzyLookup[i][0], 0, FALSE) != -1) { font = fuzzyLookup[i][1]; break; @@ -526,9 +526,9 @@ QString KWordTextHandler::getFont(unsigned fc) const kdDebug(30513) << " FUZZY-FONT: " << font << endl; #endif - // Use Qt to look up our canonical equivalent of the font name. - QFont xFont( font ); - QFontInfo info( xFont ); + // Use TQt to look up our canonical equivalent of the font name. + TQFont xFont( font ); + TQFontInfo info( xFont ); #ifdef FONT_DEBUG kdDebug(30513) << " QT-FONT: " << info.family() << endl; @@ -537,7 +537,7 @@ QString KWordTextHandler::getFont(unsigned fc) const return info.family(); } -void KWordTextHandler::writeOutParagraph( const QString& styleName, const QString& text ) +void KWordTextHandler::writeOutParagraph( const TQString& styleName, const TQString& text ) { if ( m_framesetElement.isNull() ) { @@ -545,105 +545,105 @@ void KWordTextHandler::writeOutParagraph( const QString& styleName, const QStrin kdWarning(30513) << "KWordTextHandler: no frameset element to write to! text=" << text << endl; return; } - QDomElement paragraphElementOut=mainDocument().createElement("PARAGRAPH"); + TQDomElement paragraphElementOut=mainDocument().createElement("PARAGRAPH"); m_framesetElement.appendChild(paragraphElementOut); - QDomElement textElement=mainDocument().createElement("TEXT"); + TQDomElement textElement=mainDocument().createElement("TEXT"); textElement.setAttribute( "xml:space", "preserve" ); paragraphElementOut.appendChild(textElement); paragraphElementOut.appendChild( m_formats ); - QDomElement layoutElement=mainDocument().createElement("LAYOUT"); - paragraphElementOut.appendChild(layoutElement); + TQDomElement tqlayoutElement=mainDocument().createElement("LAYOUT"); + paragraphElementOut.appendChild(tqlayoutElement); - QDomElement nameElement = mainDocument().createElement("NAME"); + TQDomElement nameElement = mainDocument().createElement("NAME"); nameElement.setAttribute("value", styleName); - layoutElement.appendChild(nameElement); + tqlayoutElement.appendChild(nameElement); if ( m_paragraphProperties ) { // Write out the properties of the paragraph - writeLayout( layoutElement, *m_paragraphProperties, m_currentStyle ); + writeLayout( tqlayoutElement, *m_paragraphProperties, m_currentStyle ); } textElement.appendChild(mainDocument().createTextNode(text)); - m_paragraph = QString( "" ); + m_paragraph = TQString( "" ); m_index = 0; - m_oldLayout = layoutElement; // Keep a reference to the old layout for some hacks + m_oldLayout = tqlayoutElement; // Keep a reference to the old tqlayout for some hacks } -void KWordTextHandler::writeLayout( QDomElement& parentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ) +void KWordTextHandler::writeLayout( TQDomElement& tqparentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ) { const wvWare::Word97::PAP& pap = paragraphProperties.pap(); - // Always write out the alignment, it's required - QDomElement flowElement = mainDocument().createElement("FLOW"); - QString alignment = Conversion::alignment( pap.jc ); - flowElement.setAttribute( "align", alignment ); - parentElement.appendChild( flowElement ); + // Always write out the tqalignment, it's required + TQDomElement flowElement = mainDocument().createElement("FLOW"); + TQString tqalignment = Conversion::tqalignment( pap.jc ); + flowElement.setAttribute( "align", tqalignment ); + tqparentElement.appendChild( flowElement ); //kdDebug(30513) << k_funcinfo << " dxaLeft1=" << pap.dxaLeft1 << " dxaLeft=" << pap.dxaLeft << " dxaRight=" << pap.dxaRight << " dyaBefore=" << pap.dyaBefore << " dyaAfter=" << pap.dyaAfter << " lspd=" << pap.lspd.dyaLine << "/" << pap.lspd.fMultLinespace << endl; if ( pap.dxaLeft1 || pap.dxaLeft || pap.dxaRight ) { - QDomElement indentsElement = mainDocument().createElement("INDENTS"); + TQDomElement indentsElement = mainDocument().createElement("INDENTS"); // 'first' is relative to 'left' in both formats indentsElement.setAttribute( "first", (double)pap.dxaLeft1 / 20.0 ); indentsElement.setAttribute( "left", (double)pap.dxaLeft / 20.0 ); indentsElement.setAttribute( "right", (double)pap.dxaRight / 20.0 ); - parentElement.appendChild( indentsElement ); + tqparentElement.appendChild( indentsElement ); } if ( pap.dyaBefore || pap.dyaAfter ) { - QDomElement offsetsElement = mainDocument().createElement("OFFSETS"); + TQDomElement offsetsElement = mainDocument().createElement("OFFSETS"); offsetsElement.setAttribute( "before", (double)pap.dyaBefore / 20.0 ); offsetsElement.setAttribute( "after", (double)pap.dyaAfter / 20.0 ); - parentElement.appendChild( offsetsElement ); + tqparentElement.appendChild( offsetsElement ); } // Linespacing - QString lineSpacing = Conversion::lineSpacing( pap.lspd ); + TQString lineSpacing = Conversion::lineSpacing( pap.lspd ); if ( lineSpacing != "0" ) { - QDomElement lineSpacingElem = mainDocument().createElement( "LINESPACING" ); + TQDomElement lineSpacingElem = mainDocument().createElement( "LINESPACING" ); lineSpacingElem.setAttribute("value", lineSpacing ); - parentElement.appendChild( lineSpacingElem ); + tqparentElement.appendChild( lineSpacingElem ); } if ( pap.fKeep || pap.fKeepFollow || pap.fPageBreakBefore ) { - QDomElement pageBreak = mainDocument().createElement( "PAGEBREAKING" ); + TQDomElement pageBreak = mainDocument().createElement( "PAGEBREAKING" ); if ( pap.fKeep ) pageBreak.setAttribute("linesTogether", "true"); if ( pap.fPageBreakBefore ) pageBreak.setAttribute("hardFrameBreak", "true" ); if ( pap.fKeepFollow ) pageBreak.setAttribute("keepWithNext", "true" ); - parentElement.appendChild( pageBreak ); + tqparentElement.appendChild( pageBreak ); } // Borders if ( pap.brcTop.brcType ) { - QDomElement borderElement = mainDocument().createElement( "TOPBORDER" ); + TQDomElement borderElement = mainDocument().createElement( "TOPBORDER" ); Conversion::setBorderAttributes( borderElement, pap.brcTop ); - parentElement.appendChild( borderElement ); + tqparentElement.appendChild( borderElement ); } if ( pap.brcBottom.brcType ) { - QDomElement borderElement = mainDocument().createElement( "BOTTOMBORDER" ); + TQDomElement borderElement = mainDocument().createElement( "BOTTOMBORDER" ); Conversion::setBorderAttributes( borderElement, pap.brcBottom ); - parentElement.appendChild( borderElement ); + tqparentElement.appendChild( borderElement ); } if ( pap.brcLeft.brcType ) { - QDomElement borderElement = mainDocument().createElement( "LEFTBORDER" ); + TQDomElement borderElement = mainDocument().createElement( "LEFTBORDER" ); Conversion::setBorderAttributes( borderElement, pap.brcLeft ); - parentElement.appendChild( borderElement ); + tqparentElement.appendChild( borderElement ); } if ( pap.brcRight.brcType ) { - QDomElement borderElement = mainDocument().createElement( "RIGHTBORDER" ); + TQDomElement borderElement = mainDocument().createElement( "RIGHTBORDER" ); Conversion::setBorderAttributes( borderElement, pap.brcRight ); - parentElement.appendChild( borderElement ); + tqparentElement.appendChild( borderElement ); } // Tabulators @@ -652,14 +652,14 @@ void KWordTextHandler::writeLayout( QDomElement& parentElement, const wvWare::Pa for ( int i = 0 ; i < pap.itbdMac ; ++i ) { const wvWare::Word97::TabDescriptor &td = pap.rgdxaTab[i]; - QDomElement tabElement = mainDocument().createElement( "TABULATOR" ); + TQDomElement tabElement = mainDocument().createElement( "TABULATOR" ); tabElement.setAttribute( "ptpos", (double)td.dxaTab / 20.0 ); //kdDebug(30513) << "ptpos=" << (double)td.dxaTab / 20.0 << endl; // Wow, lucky here. The type enum matches. Only, MSWord has 4=bar, // which kword doesn't support. We map it to 0 with a clever '%4' :) tabElement.setAttribute( "type", td.tbd.jc % 4 ); int filling = 0; - double width = 0.5; // default kword value, see koparaglayout.cc + double width = 0.5; // default kword value, see koparagtqlayout.cc switch ( td.tbd.tlc ) { case 1: // dots case 2: // hyphenated @@ -674,17 +674,17 @@ void KWordTextHandler::writeLayout( QDomElement& parentElement, const wvWare::Pa } tabElement.setAttribute( "filling", filling ); tabElement.setAttribute( "width", width ); - parentElement.appendChild( tabElement ); + tqparentElement.appendChild( tabElement ); } } if ( pap.ilfo > 0 ) { - writeCounter( parentElement, paragraphProperties, style ); + writeCounter( tqparentElement, paragraphProperties, style ); } } -void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ) +void KWordTextHandler::writeCounter( TQDomElement& tqparentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ) { const wvWare::ListInfo* listInfo = paragraphProperties.listInfo(); if ( !listInfo ) @@ -694,7 +694,7 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P listInfo->dump(); #endif - QDomElement counterElement = mainDocument().createElement( "COUNTER" ); + TQDomElement counterElement = mainDocument().createElement( "COUNTER" ); // numbering type: 0==list 1==chapter. First we determine it for word6 docs. // But we can also activate it if the text() looks that way int numberingType = listInfo->isWord6() && listInfo->prev() ? 1 : 0; @@ -717,10 +717,10 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P counterElement.setAttribute( "type", 11 ); // Box. We have no triangle. } else { // Map all other bullets to a "custom bullet" in kword. - kdDebug(30513) << "custom bullet, code=" << QString::number(code,16) << endl; + kdDebug(30513) << "custom bullet, code=" << TQString::number(code,16) << endl; counterElement.setAttribute( "type", 6 ); // custom counterElement.setAttribute( "bullet", code ); - QString paragFont = getFont( style->chp().ftcAscii ); + TQString paragFont = getFont( style->chp().ftcAscii ); counterElement.setAttribute( "bulletfont", paragFont ); } } else @@ -744,7 +744,7 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P // Now we need to parse the text, to try and convert msword's powerful list template // stuff, into what KWord can do right now. - QString prefix, suffix; + TQString prefix, suffix; bool depthFound = false; int displayLevels = 1; // We parse <0>.<2>.<1>. as "level 2 with suffix='.'" (no prefix) @@ -760,18 +760,18 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P kdWarning(30513) << "ilvl " << pap.ilvl << " found twice in listInfo text..." << endl; else depthFound = true; - suffix = QString::null; + suffix = TQString(); } else { Q_ASSERT( ch < pap.ilvl ); // Can't see how level 1 would have a <0> in it... if ( ch < pap.ilvl ) - ++displayLevels; // we found a 'parent level', to be displayed - prefix = QString::null; // get rid of previous prefixes + ++displayLevels; // we found a 'tqparent level', to be displayed + prefix = TQString(); // get rid of previous prefixes } } else { // Normal character if ( depthFound ) - suffix += QChar(ch); + suffix += TQChar(ch); else - prefix += QChar(ch); + prefix += TQChar(ch); } } if ( displayLevels > 1 ) @@ -779,10 +779,10 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P // This is a hierarchical list numbering e.g. <0>.<1>. // (unless this is about a heading, in which case we've set numberingtype to 1 already // so it will indeed look like that). - // The question is whether the '.' is the suffix of the parent level already.. + // The question is whether the '.' is the suffix of the tqparent level already.. if ( depth > 0 && !prefix.isEmpty() && m_listSuffixes[ depth - 1 ] == prefix ) { - prefix = QString::null; // it's already the parent's suffix -> remove it - kdDebug(30513) << "depth=" << depth << " parent suffix is " << prefix << " -> clearing" << endl; + prefix = TQString(); // it's already the tqparent's suffix -> remove it + kdDebug(30513) << "depth=" << depth << " tqparent suffix is " << prefix << " -> clearing" << endl; } } if ( isHeading ) @@ -810,7 +810,7 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P ( numberingType == 0 &&m_previousEnumLSID != 0 && m_previousEnumLSID != listInfo->lsid() ) ) counterElement.setAttribute( "restart", "true" ); - // listInfo->alignment() is not supported in KWord + // listInfo->tqalignment() is not supported in KWord // listInfo->isLegal() hmm // listInfo->notRestarted() [by higher level of lists] not supported // listInfo->followingchar() ignored, it's always a space in KWord currently @@ -820,17 +820,17 @@ void KWordTextHandler::writeCounter( QDomElement& parentElement, const wvWare::P else m_previousEnumLSID = listInfo->lsid(); counterElement.setAttribute( "numberingtype", numberingType ); - parentElement.appendChild( counterElement ); + tqparentElement.appendChild( counterElement ); } -void KWordTextHandler::setFrameSetElement( const QDomElement& frameset ) +void KWordTextHandler::setFrameSetElement( const TQDomElement& frameset ) { m_framesetElement = frameset; for ( uint i = 0 ; i < 9 ; ++i ) - m_listSuffixes[i] = QString::null; + m_listSuffixes[i] = TQString(); } -QDomDocument KWordTextHandler::mainDocument() const +TQDomDocument KWordTextHandler::mainDocument() const { return m_framesetElement.ownerDocument(); } diff --git a/filters/kword/msword/texthandler.h b/filters/kword/msword/texthandler.h index 7a68138f..3075803b 100644 --- a/filters/kword/msword/texthandler.h +++ b/filters/kword/msword/texthandler.h @@ -24,9 +24,9 @@ #include "versionmagic.h" #include <wv2/handlers.h> -#include <qstring.h> -#include <qobject.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqdom.h> #include <string> @@ -48,13 +48,14 @@ public: }; -class KWordTextHandler : public QObject, public wvWare::TextHandler +class KWordTextHandler : public TQObject, public wvWare::TextHandler { Q_OBJECT + TQ_OBJECT public: KWordTextHandler( wvWare::SharedPtr<wvWare::Parser> parser ); - void setFrameSetElement( const QDomElement& frameset ); + void setFrameSetElement( const TQDomElement& frameset ); //////// TextHandler interface @@ -85,30 +86,30 @@ public: // Write a <FORMAT> tag from the given CHP // Returns that element into pChildElement if set (in that case even an empty FORMAT can be appended) - void writeFormat( QDomElement& parentElement, const wvWare::Word97::CHP* chp, const wvWare::Word97::CHP* refChp, int pos, int len, int formatId, QDomElement* pChildElement ); + void writeFormat( TQDomElement& tqparentElement, const wvWare::Word97::CHP* chp, const wvWare::Word97::CHP* refChp, int pos, int len, int formatId, TQDomElement* pChildElement ); - // Write the _contents_ (children) of a <LAYOUT> or <STYLE> tag, from the given parag props - void writeLayout( QDomElement& parentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ); + // Write the _contents_ (tqchildren) of a <LAYOUT> or <STYLE> tag, from the given parag props + void writeLayout( TQDomElement& tqparentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ); // Communication with Document, without having to know about Document signals: void firstSectionFound( wvWare::SharedPtr<const wvWare::Word97::SEP> ); void subDocFound( const wvWare::FunctorBase* parsingFunctor, int data ); void tableFound( const KWord::Table& table ); - void pictureFound( const QString& frameName, const QString& pictureName, const wvWare::FunctorBase* pictureFunctor ); + void pictureFound( const TQString& frameName, const TQString& pictureName, const wvWare::FunctorBase* pictureFunctor ); protected: - void writeOutParagraph( const QString& styleName, const QString& text ); - void writeCounter( QDomElement& parentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ); - QDomElement insertVariable( int type, wvWare::SharedPtr<const wvWare::Word97::CHP> chp, const QString& format ); - QDomElement insertAnchor( const QString& fsname ); - QString getFont(unsigned fc) const; - QDomDocument mainDocument() const; + void writeOutParagraph( const TQString& styleName, const TQString& text ); + void writeCounter( TQDomElement& tqparentElement, const wvWare::ParagraphProperties& paragraphProperties, const wvWare::Style* style ); + TQDomElement insertVariable( int type, wvWare::SharedPtr<const wvWare::Word97::CHP> chp, const TQString& format ); + TQDomElement insertAnchor( const TQString& fsname ); + TQString getFont(unsigned fc) const; + TQDomDocument mainDocument() const; private: wvWare::SharedPtr<wvWare::Parser> m_parser; - QString m_listSuffixes[9]; // The suffix for every list level seen so far - QDomElement m_framesetElement; + TQString m_listSuffixes[9]; // The suffix for every list level seen so far + TQDomElement m_framesetElement; int m_sectionNumber; int m_footNoteNumber; // number of footnote _vars_ written out int m_endNoteNumber; // number of endnote _vars_ written out @@ -116,18 +117,18 @@ private: int m_previousEnumLSID; // The list id of the previous enum-list item // Current paragraph - QString m_paragraph; + TQString m_paragraph; const wvWare::Style* m_currentStyle; wvWare::SharedPtr<const wvWare::ParagraphProperties> m_paragraphProperties; enum { NoShadow, Shadow, Imprint } m_shadowTextFound; int m_index; - QDomElement m_formats; - QDomElement m_oldLayout; + TQDomElement m_formats; + TQDomElement m_oldLayout; KWord::Table* m_currentTable; bool m_bInParagraph; - QString m_fieldValue; + TQString m_fieldValue; bool m_insideField; bool m_fieldAfterSeparator; int m_fieldType; // 0 for no field diff --git a/filters/kword/mswrite/ImportDialog.cc b/filters/kword/mswrite/ImportDialog.cc index e6b81555..de8fece1 100644 --- a/filters/kword/mswrite/ImportDialog.cc +++ b/filters/kword/mswrite/ImportDialog.cc @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <klocale.h> #include <kcharsets.h> @@ -28,15 +28,15 @@ #include <ImportDialogUI.h> #include <ImportDialog.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> -#include <qcombobox.h> -#include <qcheckbox.h> - -MSWriteImportDialog :: MSWriteImportDialog(QWidget* parent) - : KDialogBase(parent, 0, true, i18n("KWord's MS Write Import Filter"), Ok|Cancel, No, true), +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> + +MSWriteImportDialog :: MSWriteImportDialog(TQWidget* tqparent) + : KDialogBase(tqparent, 0, true, i18n("KWord's MS Write Import Filter"), Ok|Cancel, No, true), m_dialog(new ImportDialogUI(this)) { kapp->restoreOverrideCursor(); @@ -48,40 +48,40 @@ MSWriteImportDialog :: MSWriteImportDialog(QWidget* parent) setMainWidget(m_dialog); - connect(m_dialog->comboBoxEncoding, SIGNAL(activated(int)), this, - SLOT(comboBoxEncodingActivated(int))); + connect(m_dialog->comboBoxEncoding, TQT_SIGNAL(activated(int)), this, + TQT_SLOT(comboBoxEncodingActivated(int))); } MSWriteImportDialog :: ~MSWriteImportDialog(void) { - kapp->setOverrideCursor(Qt::waitCursor); + kapp->setOverrideCursor(TQt::waitCursor); } -QTextCodec* MSWriteImportDialog::getCodec(void) const +TQTextCodec* MSWriteImportDialog::getCodec(void) const { - QTextCodec* codec=NULL; + TQTextCodec* codec=NULL; if (m_dialog->radioEncodingDefault==m_dialog->buttonGroupEncoding->selected()) { kdDebug(30509) << "Encoding: CP 1252" << endl; - codec=QTextCodec::codecForName("CP 1252"); + codec=TQTextCodec::codecForName("CP 1252"); } /*else if (m_dialog->radioEncodingLocal==m_dialog->buttonGroupEncoding->selected()) { kdDebug(30503) << "Encoding: Locale" << endl; - codec=QTextCodec::codecForLocale(); + codec=TQTextCodec::codecForLocale(); }*/ else if (m_dialog->radioEncodingOther==m_dialog->buttonGroupEncoding->selected()) { - QString strCodec=m_dialog->comboBoxEncoding->currentText(); + TQString strCodec=m_dialog->comboBoxEncoding->currentText(); kdDebug(30509) << "Encoding: " << strCodec << endl; if (strCodec.isEmpty()) { - codec=QTextCodec::codecForLocale(); + codec=TQTextCodec::codecForLocale(); } else { - // We do not use QTextCodec::codecForName here + // We do not use TQTextCodec::codecForName here // because we fear subtle problems codec=KGlobal::charsets()->codecForName(strCodec); } @@ -91,7 +91,7 @@ QTextCodec* MSWriteImportDialog::getCodec(void) const { // Default: UTF-8 kdWarning(30509) << "No codec set, assuming UTF-8" << endl; - codec=QTextCodec::codecForName("UTF-8"); + codec=TQTextCodec::codecForName("UTF-8"); } return codec; diff --git a/filters/kword/mswrite/ImportDialog.h b/filters/kword/mswrite/ImportDialog.h index abcece8c..29cd2e6f 100644 --- a/filters/kword/mswrite/ImportDialog.h +++ b/filters/kword/mswrite/ImportDialog.h @@ -21,7 +21,7 @@ #ifndef _IMPORT_DIALOG_H #define _IMPORT_DIALOG_H -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> @@ -29,11 +29,12 @@ class ImportDialogUI; class MSWriteImportDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - MSWriteImportDialog(QWidget* parent=NULL); + MSWriteImportDialog(TQWidget* tqparent=NULL); ~MSWriteImportDialog(void); - QTextCodec* getCodec(void) const; + TQTextCodec* getCodec(void) const; bool getSimulateLinespacing(void) const; bool getSimulateImageOffset (void) const; private: diff --git a/filters/kword/mswrite/ImportDialogUI.ui b/filters/kword/mswrite/ImportDialogUI.ui index 2767210f..953caac6 100644 --- a/filters/kword/mswrite/ImportDialogUI.ui +++ b/filters/kword/mswrite/ImportDialogUI.ui @@ -2,7 +2,7 @@ <class>ImportDialogUI</class> <comment>Import dialog for KWord's MS Write import filter</comment> <author>Nicolas GOUTTE <goutte@kde.org></author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ImportDialogUI</cstring> </property> @@ -27,7 +27,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>buttonGroupEncoding</cstring> </property> @@ -55,7 +55,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QComboBox" row="1" column="1" rowspan="1" colspan="2"> + <widget class="TQComboBox" row="1" column="1" rowspan="1" colspan="2"> <property name="name"> <cstring>comboBoxEncoding</cstring> </property> @@ -68,7 +68,7 @@ </sizepolicy> </property> </widget> - <widget class="QRadioButton" row="1" column="0"> + <widget class="TQRadioButton" row="1" column="0"> <property name="name"> <cstring>radioEncodingOther</cstring> </property> @@ -92,14 +92,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>radioEncodingDefault</cstring> </property> @@ -126,7 +126,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -135,7 +135,7 @@ </spacer> </grid> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupAdvanced</cstring> </property> @@ -155,7 +155,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>checkBoxLinespacing</cstring> </property> @@ -187,14 +187,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>checkBoxImageOffset</cstring> </property> @@ -218,7 +218,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -237,7 +237,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -252,5 +252,5 @@ <tabstop>checkBoxLinespacing</tabstop> <tabstop>checkBoxImageOffset</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/filters/kword/mswrite/mswriteexport.cc b/filters/kword/mswrite/mswriteexport.cc index 21f9ac2d..efc4020c 100644 --- a/filters/kword/mswrite/mswriteexport.cc +++ b/filters/kword/mswrite/mswriteexport.cc @@ -21,14 +21,14 @@ #include <stdlib.h> #include <string.h> -#include <qbuffer.h> -#include <qcstring.h> -#include <qfile.h> -#include <qfont.h> -#include <qimage.h> -#include <qtextcodec.h> -#include <qvaluelist.h> -#include <qvaluestack.h> +#include <tqbuffer.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqimage.h> +#include <tqtextcodec.h> +#include <tqvaluelist.h> +#include <tqvaluestack.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -232,11 +232,11 @@ private: MSWrite::Word m_pageNumberStart; // for charset conversion - QTextCodec *m_codec; - QTextEncoder *m_encoder; + TQTextCodec *m_codec; + TQTextEncoder *m_encoder; - QValueList <HeaderData> m_headerData; - QValueList <FooterData> m_footerData; + TQValueList <HeaderData> m_headerData; + TQValueList <FooterData> m_footerData; int m_headerType, m_footerType; bool m_hasHeader, m_isHeaderOnFirstPage; @@ -260,7 +260,7 @@ public: m_inWhat (Nothing) { // just select windows-1252 until the "Select Encoding" dialog works - m_codec = QTextCodec::codecForName ("CP 1252"); + m_codec = TQTextCodec::codecForName ("CP 1252"); if (m_codec) m_encoder = m_codec->makeEncoder(); @@ -296,13 +296,13 @@ public: return m_device->bad (); } - bool doOpenFile (const QString &outFileName, const QString &) + bool doOpenFile (const TQString &outFileName, const TQString &) { // constructor failed? if (!m_device || !m_generator) return false; - if (!m_device->openFile (QFile::encodeName (outFileName))) return false; + if (!m_device->openFile (TQFile::encodeName (outFileName))) return false; return true; } @@ -456,7 +456,7 @@ public: return true; } - bool isParaListEmpty (const QValueList <ParaData> ¶) + bool isParaListEmpty (const TQValueList <ParaData> ¶) { if (para.count () == 1) { @@ -560,7 +560,7 @@ public: bool wroteFooter = false; m_inWhat = Footer; - for (QValueList <FooterData>::Iterator it = m_footerData.begin (); + for (TQValueList <FooterData>::Iterator it = m_footerData.begin (); it != m_footerData.end (); it++) { @@ -582,7 +582,7 @@ public: bool wroteHeader = false; m_inWhat = Header; - for (QValueList <HeaderData>::Iterator it = m_headerData.begin (); + for (TQValueList <HeaderData>::Iterator it = m_headerData.begin (); it != m_headerData.end (); it++) { @@ -614,7 +614,7 @@ public: #if 0 // dump remaining header paragraphs at the start of the body - for (QValueList <HeaderData>::Iterator it = m_headerData.begin (); + for (TQValueList <HeaderData>::Iterator it = m_headerData.begin (); it != m_headerData.end (); it++) { @@ -624,7 +624,7 @@ public: } // dump remaining footer paragraphs too - for (QValueList <FooterData>::Iterator it = m_footerData.begin (); + for (TQValueList <FooterData>::Iterator it = m_footerData.begin (); it != m_footerData.end (); it++) { @@ -646,24 +646,24 @@ public: return true; } - // device that can either read from or write to a QBuffer + // device that can either read from or write to a TQBuffer // (but not both at the same time, please :)) - class QBufferDevice : public MSWrite::Device + class TQBufferDevice : public MSWrite::Device { private: - QBuffer *m_buffer; + TQBuffer *m_buffer; public: - QBufferDevice (QBuffer *buffer) + TQBufferDevice (TQBuffer *buffer) { m_buffer = buffer; } bool read (MSWrite::Byte *buf, const MSWrite::DWord numBytes) { - if (m_buffer->readBlock ((char *) buf, (Q_ULONG) numBytes) != Q_LONG (numBytes)) + if (m_buffer->readBlock ((char *) buf, (TQ_ULONG) numBytes) != TQ_LONG (numBytes)) { - error (MSWrite::Error::FileError, "could not read from QBuffer (not really a FileError)\n"); + error (MSWrite::Error::FileError, "could not read from TQBuffer (not really a FileError)\n"); return false; } else @@ -672,9 +672,9 @@ public: bool write (const MSWrite::Byte *buf, const MSWrite::DWord numBytes) { - if (m_buffer->writeBlock ((char *) buf, (Q_ULONG) numBytes) != Q_LONG (numBytes)) + if (m_buffer->writeBlock ((char *) buf, (TQ_ULONG) numBytes) != TQ_LONG (numBytes)) { - error (MSWrite::Error::FileError, "could not write to QBuffer (not really a FileError)\n"); + error (MSWrite::Error::FileError, "could not write to TQBuffer (not really a FileError)\n"); return false; } else @@ -710,7 +710,7 @@ public: if (!m_buffer->at (absoffset)) { - error (MSWrite::Error::FileError, "QBuffer could not seek (not really a FileError)\n"); + error (MSWrite::Error::FileError, "TQBuffer could not seek (not really a FileError)\n"); return false; } @@ -1027,12 +1027,12 @@ public: double imageActualWidth = -1, imageActualHeight = -1; MSWrite::DWord imageSize = 0; - QString imageType; - int pos = frameAnchor.picture.koStoreName.findRev ('.'); + TQString imageType; + int pos = frameAnchor.picture.koStoreName.tqfindRev ('.'); if (pos != -1) imageType = frameAnchor.picture.koStoreName.mid (pos).lower (); kdDebug (30509) << "\timageType: " << imageType << endl; - QByteArray imageData; + TQByteArray imageData; kdDebug (30509) << "\tReading image: " << frameAnchor.picture.koStoreName << endl; if (!loadSubFile (frameAnchor.picture.koStoreName, imageData)) ErrorAndQuit (MSWrite::Error::FileError, "could not open image from store\n"); @@ -1054,7 +1054,7 @@ public: } // get raw dimensions - QRect dimen = wmf.boundingRect (); + TQRect dimen = wmf.boundingRect (); int width = abs (dimen.width ()); int height = abs (dimen.height ()); kdDebug (30509) << "\tRaw WMF dimensions: " << width << "x" << height << endl; @@ -1082,7 +1082,7 @@ public: } else if (wmf.isEnhanced ()) { - kdError (30509) << "Enhanced WMF unsupported by QWmf, internal error!" << endl; + kdError (30509) << "Enhanced WMF unsupported by TQWmf, internal error!" << endl; return true; } @@ -1108,10 +1108,10 @@ public: // TODO: DDB? else if (imageType == ".bmp") { - QImage image (imageData); + TQImage image (imageData); if (image.isNull ()) { - kdError (30509) << "QImage IsNull: Line=" << __LINE__ << endl; + kdError (30509) << "TQImage IsNull: Line=" << __LINE__ << endl; return true; } @@ -1126,16 +1126,16 @@ public: << " size=" << imageSize << endl; - QByteArray imageWMF; + TQByteArray imageWMF; // input device - QBuffer inBuffer (imageData); + TQBuffer inBuffer (imageData); inBuffer.open (IO_ReadOnly); - QBufferDevice inDevice (&inBuffer); + TQBufferDevice inDevice (&inBuffer); // output device - QBuffer outBuffer (imageWMF); + TQBuffer outBuffer (imageWMF); outBuffer.open (IO_WriteOnly); - QBufferDevice outDevice (&outBuffer); + TQBufferDevice outDevice (&outBuffer); // BMP --> WMF if (!BMP2WMF (inDevice, outDevice)) @@ -1154,10 +1154,10 @@ public: { if (imageActualWidth == -1 && imageActualHeight == -1) { - QImage image (imageData); + TQImage image (imageData); if (image.isNull()) { - kdError (30509) << "QImage isNull: Line=" << __LINE__ << endl; + kdError (30509) << "TQImage isNull: Line=" << __LINE__ << endl; return true; } @@ -1170,13 +1170,13 @@ public: << " size=" << imageSize << endl; - QByteArray imageBMP; + TQByteArray imageBMP; // input device - QBuffer inBuffer (imageData); + TQBuffer inBuffer (imageData); inBuffer.open (IO_ReadOnly); // read foreign image - QImageIO imageIO (&inBuffer, NULL); + TQImageIO imageIO (&inBuffer, NULL); if (!imageIO.read ()) { kdError (30509) << "Could not read foreign format" << endl; @@ -1184,11 +1184,11 @@ public: } // output device - QBuffer outBuffer (imageBMP); + TQBuffer outBuffer (imageBMP); outBuffer.open (IO_WriteOnly); // write BMP - imageIO.setIODevice (&outBuffer); + imageIO.setIODevice (TQT_TQIODEVICE(&outBuffer)); imageIO.setFormat ("BMP"); if (!imageIO.write ()) { @@ -1286,8 +1286,8 @@ public: bool processTable (const Table &table) { - // just dump the table out for now (no layout) - for (QValueList <TableCell>::ConstIterator it = table.cellList.begin (); + // just dump the table out for now (no tqlayout) + for (TQValueList <TableCell>::ConstIterator it = table.cellList.begin (); it != table.cellList.end (); it++) { @@ -1326,28 +1326,28 @@ public: #endif // get Font Family - QFont QTFontInfo (f.fontName); - switch (QTFontInfo.styleHint ()) + TQFont TQTFontInfo (f.fontName); + switch (TQTFontInfo.styleHint ()) { - case QFont::Serif: + case TQFont::Serif: #ifdef KMF_DEBUG_FONT kdDebug (30509) << "FontFamily Serif" << endl; #endif font.setFamily (MSWrite::Font::Roman); break; - case QFont::SansSerif: + case TQFont::SansSerif: #ifdef KMF_DEBUG_FONT kdDebug (30509) << "FontFamily SansSerif" << endl; #endif font.setFamily (MSWrite::Font::Swiss); break; - case QFont::Courier: + case TQFont::Courier: #ifdef KMF_DEBUG_FONT kdDebug (30509) << "FontFamily Courier" << endl; #endif font.setFamily (MSWrite::Font::Modern); break; - case QFont::OldEnglish: + case TQFont::OldEnglish: #ifdef KMF_DEBUG_FONT kdDebug (30509) << "FontFamily OldEnglish" << endl; #endif @@ -1402,9 +1402,9 @@ public: #endif } - bool doFullParagraphList (const QValueList <ParaData> ¶List) + bool doFullParagraphList (const TQValueList <ParaData> ¶List) { - for (QValueList <ParaData>::ConstIterator it = paraList.begin (); + for (TQValueList <ParaData>::ConstIterator it = paraList.begin (); it != paraList.end (); it ++) { @@ -1417,12 +1417,12 @@ public: bool doFullParagraph (const ParaData ¶Data) { return doFullParagraph (paraData.text, - paraData.layout, + paraData.tqlayout, paraData.formattingList); } - bool doFullParagraph (const QString ¶Text, - const LayoutData &layout, + bool doFullParagraph (const TQString ¶Text, + const LayoutData &tqlayout, const ValueListFormatData ¶FormatDataList) { MSWrite::FormatParaProperty paraProp; @@ -1446,34 +1446,34 @@ public: paraProp.setIsText (true); // Alignment - if (!layout.alignment.isEmpty ()) + if (!tqlayout.tqalignment.isEmpty ()) { - if (layout.alignment == "left") + if (tqlayout.tqalignment == "left") // quite useless since MSWrite::Alignment::Left is the default anyway - paraProp.setAlignment (MSWrite::Alignment::Left); - else if (layout.alignment == "right") - paraProp.setAlignment (MSWrite::Alignment::Right); - else if (layout.alignment == "center") - paraProp.setAlignment (MSWrite::Alignment::Center); - else if (layout.alignment == "justify") - paraProp.setAlignment (MSWrite::Alignment::Justify); + paraProp.tqsetAlignment (MSWrite::Alignment::Left); + else if (tqlayout.tqalignment == "right") + paraProp.tqsetAlignment (MSWrite::Alignment::Right); + else if (tqlayout.tqalignment == "center") + paraProp.tqsetAlignment (MSWrite::Alignment::Center); + else if (tqlayout.tqalignment == "justify") + paraProp.tqsetAlignment (MSWrite::Alignment::Justify); else - kdWarning (30509) << "Unknown Alignment: " << layout.alignment << endl; + kdWarning (30509) << "Unknown Alignment: " << tqlayout.tqalignment << endl; } // Indentation - if (layout.indentFirst) paraProp.setLeftIndentFirstLine (MSWrite::Short (Point2Twip (layout.indentFirst))); - if (layout.indentLeft >= 0) paraProp.setLeftIndent (MSWrite::Word (Point2Twip (layout.indentLeft))); - if (layout.indentRight >= 0) paraProp.setRightIndent (MSWrite::Word (Point2Twip (layout.indentRight))); + if (tqlayout.indentFirst) paraProp.setLeftIndentFirstLine (MSWrite::Short (Point2Twip (tqlayout.indentFirst))); + if (tqlayout.indentLeft >= 0) paraProp.setLeftIndent (MSWrite::Word (Point2Twip (tqlayout.indentLeft))); + if (tqlayout.indentRight >= 0) paraProp.setRightIndent (MSWrite::Word (Point2Twip (tqlayout.indentRight))); #if 0 - kdDebug (30509) << "Indent: " << Point2Twip (layout.indentFirst) << " " - << Point2Twip (layout.indentLeft) << " " - << Point2Twip (layout.indentRight) << endl; + kdDebug (30509) << "Indent: " << Point2Twip (tqlayout.indentFirst) << " " + << Point2Twip (tqlayout.indentLeft) << " " + << Point2Twip (tqlayout.indentRight) << endl; #endif // Line Spacing MSWrite::Word lineSpacing = MSWrite::LineSpacing::Normal; - switch (layout.lineSpacingType) + switch (tqlayout.lineSpacingType) { case LayoutData::LS_SINGLE: lineSpacing = MSWrite::LineSpacing::Normal; @@ -1487,12 +1487,12 @@ public: case LayoutData::LS_CUSTOM: case LayoutData::LS_FIXED: case LayoutData::LS_ATLEAST: - lineSpacing = getClosestLineSpacing (layout.lineSpacing); + lineSpacing = getClosestLineSpacing (tqlayout.lineSpacing); break; case LayoutData::LS_MULTIPLE: break; default: - kdWarning (30509) << "unknown lineSpacingType \'" << layout.lineSpacingType << "\'" << endl; + kdWarning (30509) << "unknown lineSpacingType \'" << tqlayout.lineSpacingType << "\'" << endl; } paraProp.setLineSpacing (lineSpacing); @@ -1500,8 +1500,8 @@ public: // It seems that Write applies the 1st paragraph's Tabulator settings to the _entire_ document // Word97 and KWord, however, will treat them like a Paragraph Property int numTabs = 0; - for (TabulatorList::ConstIterator tabIt = layout.tabulatorList.begin (); - tabIt != layout.tabulatorList.end (); + for (TabulatorList::ConstIterator tabIt = tqlayout.tabulatorList.begin (); + tabIt != tqlayout.tabulatorList.end (); tabIt++) { MSWrite::FormatParaPropertyTabulator tab; @@ -1537,14 +1537,14 @@ public: // TODO: double marginTop; // space before the paragraph (a negative value means invalid) // TODO: double marginBottom; // space after the paragraph (a negative value means invalid) - // TODO: QString styleName; - // TODO: QString styleFollowing; + // TODO: TQString styleName; + // TODO: TQString styleFollowing; if (!m_generator->writeParaInfoBegin (¶Prop)) return false; // get this paragraph's "default formatting" MSWrite::FormatCharProperty charPropDefault; - processFormatData (charPropDefault, layout.formatData.text); + processFormatData (charPropDefault, tqlayout.formatData.text); MSWrite::DWord uptoByte = 0; // relative to start of KWord paragraph MSWrite::DWord numBytes = paraText.length (); // relative to start of KWord paragraph @@ -1561,18 +1561,18 @@ public: if (!m_generator->writeCharInfoBegin (&charPropDefault)) return false; // page break at start of paragraph? - if (layout.pageBreakBefore) + if (tqlayout.pageBreakBefore) if (!m_generator->writePageBreak ()) return false; // counter data - processCounter (layout.counter); + processCounter (tqlayout.counter); // end of line if (!m_generator->writeCarriageReturn ()) return false; if (!m_generator->writeNewLine (true/*end of paragraph*/)) return false; // page break at end of paragraph? - if (layout.pageBreakAfter) + if (tqlayout.pageBreakAfter) if (!m_generator->writePageBreak ()) return false; // write default character property end @@ -1595,11 +1595,11 @@ public: if (uptoByte == 0) { // page break at start of paragraph? - if (layout.pageBreakBefore) + if (tqlayout.pageBreakBefore) if (!m_generator->writePageBreak ()) return false; // counter data - processCounter (layout.counter); + processCounter (tqlayout.counter); } // yes, this is slightly premature but it doesn't matter @@ -1733,7 +1733,7 @@ public: } // page break at end of paragraph? - if (layout.pageBreakAfter) + if (tqlayout.pageBreakAfter) if (!m_generator->writePageBreak ()) return false; } @@ -1758,7 +1758,7 @@ public: #ifndef NDEBUG //#define DEBUG_PROCESS_TEXT #endif - bool processText (const QString &stringUnicode) + bool processText (const TQString &stringUnicode) { // // Look out for characters in the string and emit signals as appropriate: @@ -1783,19 +1783,19 @@ public: if (softHyphen == -2) { - softHyphen = stringUnicode.find (QChar (0xAD), upto); + softHyphen = stringUnicode.tqfind (TQChar (0xAD), upto); if (softHyphen == -1) softHyphen = INT_MAX; } if (nonBreakingSpace == -2) { - nonBreakingSpace = stringUnicode.find (QChar (0xA0), upto); + nonBreakingSpace = stringUnicode.tqfind (TQChar (0xA0), upto); if (nonBreakingSpace == -1) nonBreakingSpace = INT_MAX; } if (newLine == -2) { - newLine = stringUnicode.find (QChar ('\n'), upto); + newLine = stringUnicode.tqfind (TQChar ('\n'), upto); if (newLine == -1) newLine = INT_MAX; } @@ -1807,7 +1807,7 @@ public: int length = stringUnicodeLength - upto; if (specialLocation != INT_MAX) length = specialLocation - upto; - QString substring = stringUnicode.mid (upto, length); + TQString substring = stringUnicode.mid (upto, length); #ifdef DEBUG_PROCESS_TEXT kdDebug (30509) << "Parent string: upto=" << upto @@ -1820,7 +1820,7 @@ public: // convert substring to windows-1251 // - QCString stringWin; + TQCString stringWin; // there is a codec, therefore there is an encoder... if (m_codec) @@ -1894,7 +1894,7 @@ public: }; -MSWriteExport::MSWriteExport (KoFilter *, const char *, const QStringList &) +MSWriteExport::MSWriteExport (KoFilter *, const char *, const TQStringList &) : KoFilter() { } @@ -1903,7 +1903,7 @@ MSWriteExport::~MSWriteExport () { } -KoFilter::ConversionStatus MSWriteExport::convert (const QCString &from, const QCString &to) +KoFilter::ConversiontqStatus MSWriteExport::convert (const TQCString &from, const TQCString &to) { kdDebug (30509) << "MSWriteExport $Date: 2006-02-12 19:28:12 +0100 (Sun, 12 Feb 2006) $ using LibMSWrite " << MSWrite::Version << endl; @@ -1929,7 +1929,7 @@ KoFilter::ConversionStatus MSWriteExport::convert (const QCString &from, const Q return KoFilter::OutOfMemory; } - KoFilter::ConversionStatus ret = leader->convert (m_chain, from, to); + KoFilter::ConversiontqStatus ret = leader->convert (m_chain, from, to); int errorCode = worker->getError (); delete leader; diff --git a/filters/kword/mswrite/mswriteexport.h b/filters/kword/mswrite/mswriteexport.h index 242b0984..e2ab8fb4 100644 --- a/filters/kword/mswrite/mswriteexport.h +++ b/filters/kword/mswrite/mswriteexport.h @@ -25,12 +25,13 @@ class MSWriteExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - MSWriteExport (KoFilter *parent, const char *name, const QStringList &); + MSWriteExport (KoFilter *tqparent, const char *name, const TQStringList &); virtual ~MSWriteExport (); - KoFilter::ConversionStatus convert (const QCString &from, const QCString &to); + KoFilter::ConversiontqStatus convert (const TQCString &from, const TQCString &to); }; #endif // MSWRITEEXPORT_H diff --git a/filters/kword/mswrite/mswriteimport.cc b/filters/kword/mswrite/mswriteimport.cc index 8636c8b8..feff4917 100644 --- a/filters/kword/mswrite/mswriteimport.cc +++ b/filters/kword/mswrite/mswriteimport.cc @@ -24,11 +24,11 @@ #include <string.h> #include <stdarg.h> -#include <qfile.h> -#include <qobject.h> -#include <qstring.h> -#include <qtextcodec.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqtextstream.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -183,7 +183,7 @@ private: MSWrite::Byte *m_data; MSWrite::DWord m_dataLength; MSWrite::DWord m_dataUpto; - QString m_nameInStore; + TQString m_nameInStore; WRIObject () : m_data (NULL), m_dataLength (0), m_dataUpto (0) { @@ -241,15 +241,15 @@ private: KoStoreDevice *m_outfile; // for charset conversion - QTextCodec *m_codec; - QTextDecoder *m_decoder; + TQTextCodec *m_codec; + TQTextDecoder *m_decoder; // import options (compensate for differences between KWord and MS Write) bool m_simulateLineSpacing; bool m_simulateImageOffset; // formatting - QString m_formatOutput; + TQString m_formatOutput; int m_charInfoCountStart, m_charInfoCountLen; bool m_pageBreak, m_needAnotherParagraph; int m_pageBreakOffset; @@ -257,9 +257,9 @@ private: // picture counters int m_numPictures; - QString m_pictures; + TQString m_pictures; - QString m_objectFrameset; + TQString m_objectFrameset; MSWrite::List <WRIObject> m_objectList; @@ -271,7 +271,7 @@ private: // XML output that is held back until after "Text Frameset 1" is output // (i.e. header & footer must come after the Body in KWord) bool m_delayOutput; - QString m_heldOutput; + TQString m_heldOutput; void delayOutput (const bool yes) { @@ -280,7 +280,7 @@ private: bool delayOutputFlush (void) { - QCString strUtf8 = m_heldOutput.utf8 (); + TQCString strUtf8 = m_heldOutput.utf8 (); int strLength = strUtf8.length (); if (m_outfile->writeBlock (strUtf8, strLength) != strLength) @@ -305,7 +305,7 @@ public: delayOutput (false); // just select windows-1252 until the "Select Encoding" dialog works - m_codec = QTextCodec::codecForName ("CP 1252"); + m_codec = TQTextCodec::codecForName ("CP 1252"); if (m_codec) m_decoder = m_codec->makeDecoder(); @@ -499,7 +499,7 @@ public: ErrorAndQuit (MSWrite::Error::FileError, "could not open image in store\n"); if (m_outfile->writeBlock ((const char *) (*it).m_data, (*it).m_dataLength) - != (Q_LONG) (*it).m_dataLength) + != (TQ_LONG) (*it).m_dataLength) ErrorAndQuit (MSWrite::Error::FileError, "could not write image to store\n"); // close object in store @@ -692,21 +692,21 @@ public: { kdDebug (30509) << "Paragraph is an image!" << endl; - QString imageName; - QString fileInStore; + TQString imageName; + TQString fileInStore; // give picture a name // imageName = "Picture "; - imageName += QString::number (m_numPictures + 1); // image numbers start at 1... + imageName += TQString::number (m_numPictures + 1); // image numbers start at 1... // give picture a filename // - fileInStore = "pictures/picture" + QString::number (m_numPictures + 1); + fileInStore = "pictures/picture" + TQString::number (m_numPictures + 1); kdDebug (30509) << "\tGetting type..." << endl; @@ -743,21 +743,21 @@ public: const double imageLeft = double (m_left) + Twip2Point (double (image->getIndent ())); m_objectFrameset += " left=\""; - m_objectFrameset += QString::number (imageLeft); + m_objectFrameset += TQString::number (imageLeft); m_objectFrameset += "\""; const double imageWidth = Twip2Point (double (image->getDisplayedWidth ())); m_objectFrameset += " right=\""; - m_objectFrameset += QString::number (imageLeft + imageWidth - 1); + m_objectFrameset += TQString::number (imageLeft + imageWidth - 1); m_objectFrameset += "\""; m_objectFrameset += " top=\""; - m_objectFrameset += QString::number (m_top); + m_objectFrameset += TQString::number (m_top); m_objectFrameset += "\""; const double imageHeight = Twip2Point (double (image->getDisplayedHeight ())); m_objectFrameset += " bottom=\""; - m_objectFrameset += QString::number (double (m_top) + imageHeight - 1); + m_objectFrameset += TQString::number (double (m_top) + imageHeight - 1); m_objectFrameset += "\"/>"; m_objectFrameset += "<PICTURE keepAspectRatio=\"false\">"; @@ -833,7 +833,7 @@ public: << ")" << endl; } - QString output; + TQString output; output += "</TEXT>"; output += "<LAYOUT>"; @@ -897,9 +897,9 @@ public: if (indentFirst || indentLeft || indentRight) { output += "<INDENTS"; - if (indentFirst) output += " first=\"" + QString::number (indentFirst) + "\""; - if (indentLeft) output += " left=\"" + QString::number (indentLeft) + "\""; - if (indentRight) output += " right=\"" + QString::number (indentRight) + "\""; + if (indentFirst) output += " first=\"" + TQString::number (indentFirst) + "\""; + if (indentLeft) output += " left=\"" + TQString::number (indentLeft) + "\""; + if (indentRight) output += " right=\"" + TQString::number (indentRight) + "\""; output += "/>"; } @@ -908,7 +908,7 @@ public: if (lineSpacing != MSWrite::LineSpacing::Single) { #if 1 - output += "<LINESPACING type=\"atleast\" spacingvalue=\"" + QString::number (Twip2Point (lineSpacing)) + "\"/>"; + output += "<LINESPACING type=\"atleast\" spacingvalue=\"" + TQString::number (Twip2Point (lineSpacing)) + "\"/>"; #else // old way output += "<LINESPACING type=\""; switch (lineSpacing) @@ -925,7 +925,7 @@ public: kdWarning (30509) << "non-\"standard\" linespacing value: " << lineSpacing << endl; output += "atleast\" "; output += "spacingvalue=\""; - output += QString::number (Twip2Point (lineSpacing)); + output += TQString::number (Twip2Point (lineSpacing)); break; } output += "\"/>"; @@ -963,7 +963,7 @@ public: amount -= m_lineSpacingFromAbove; if (amount <= 0) amount = 0; // no emulation can be perfect... - output += QString::number (amount); + output += TQString::number (amount); output += "\" />"; } @@ -1023,7 +1023,7 @@ public: else output += " type=\"0\""; - output += " ptpos=\"" + QString::number (Twip2Point (double (tab->getIndent ()))) + "\"/>"; + output += " ptpos=\"" + TQString::number (Twip2Point (double (tab->getIndent ()))) + "\"/>"; //debug ("Tab: isNormal: %i ptPos: %i\n", // paraProperty->tbd [i].isTabNormal (), paraProperty->tbd [i].getTabNumPoints ()); @@ -1076,8 +1076,8 @@ public: m_formatOutput += "1"; m_formatOutput += "\" "; - m_formatOutput += "pos=\""; m_formatOutput += QString::number (m_charInfoCountStart); m_formatOutput += "\" "; - m_formatOutput += "len=\""; m_formatOutput += QString::number (m_charInfoCountLen); m_formatOutput += "\">"; + m_formatOutput += "pos=\""; m_formatOutput += TQString::number (m_charInfoCountStart); m_formatOutput += "\" "; + m_formatOutput += "len=\""; m_formatOutput += TQString::number (m_charInfoCountLen); m_formatOutput += "\">"; m_charInfoCountStart += m_charInfoCountLen; m_charInfoCountLen = 0; @@ -1094,7 +1094,7 @@ public: m_formatOutput += (const char *) (charProperty->getFont ()->getName ()); m_formatOutput += "\"/>"; m_formatOutput += "<SIZE value=\""; - m_formatOutput += QString::number (charProperty->getFontSize ()); + m_formatOutput += TQString::number (charProperty->getFontSize ()); m_formatOutput += "\"/>"; if (charProperty->getIsBold ()) @@ -1163,7 +1163,7 @@ public: bool writeText (const MSWrite::Byte *string) { // from Win Character Set... - QString strUnicode; + TQString strUnicode; // there is a codec, therefore there is a decoder... if (m_codec) @@ -1182,11 +1182,11 @@ public: m_charInfoCountLen += strUnicode.length (); // make string XML-friendly (TODO: speed up) - strUnicode.replace ('&', "&"); - strUnicode.replace ('<', "<"); - strUnicode.replace ('>', ">"); - strUnicode.replace ('\"', """); - strUnicode.replace ('\'', "'"); + strUnicode.tqreplace ('&', "&"); + strUnicode.tqreplace ('<', "<"); + strUnicode.tqreplace ('>', ">"); + strUnicode.tqreplace ('\"', """); + strUnicode.tqreplace ('\'', "'"); return writeTextInternal (strUnicode); } @@ -1194,7 +1194,7 @@ public: bool writeTextInternal (const MSWrite::Byte *str) { #if 0 - return textWrite_lowLevel (QString (str)); + return textWrite_lowLevel (TQString (str)); #else // while this is code duplication (of below func), this ensures that no // characters are mysteriously converted (this makes writeOptionalHyphen () work) if (m_delayOutput) @@ -1217,7 +1217,7 @@ public: #endif } - bool writeTextInternal (const QString &str) + bool writeTextInternal (const TQString &str) { if (m_delayOutput) { @@ -1227,7 +1227,7 @@ public: } else { - QCString strUtf8 = str.utf8 (); + TQCString strUtf8 = str.utf8 (); int strLength = strUtf8.length (); if (m_outfile->writeBlock (strUtf8, strLength) != strLength) @@ -1241,7 +1241,7 @@ public: bool writeTextInternal (const int num) { - return writeTextInternal (QString::number (num)); + return writeTextInternal (TQString::number (num)); } bool writeTextInternal (const char *format, ...) @@ -1333,7 +1333,7 @@ public: // KoFilter // -MSWriteImport::MSWriteImport (KoFilter *, const char *, const QStringList &) +MSWriteImport::MSWriteImport (KoFilter *, const char *, const TQStringList &) : m_device (NULL), m_parser (NULL), m_generator (NULL) { } @@ -1345,7 +1345,7 @@ MSWriteImport::~MSWriteImport () delete m_device; } -KoFilter::ConversionStatus MSWriteImport::convert (const QCString &from, const QCString &to) +KoFilter::ConversiontqStatus MSWriteImport::convert (const TQCString &from, const TQCString &to) { kdDebug (30509) << "MSWriteImport $Date: 2006-02-12 19:28:12 +0100 (Sun, 12 Feb 2006) $ using LibMSWrite " << MSWrite::Version << endl; @@ -1396,7 +1396,7 @@ KoFilter::ConversionStatus MSWriteImport::convert (const QCString &from, const Q } // open the .WRI file - if (!m_device->openFile (QFile::encodeName (m_chain->inputFile ()))) + if (!m_device->openFile (TQFile::encodeName (m_chain->inputFile ()))) { kdError (30509) << "Could not open \'" << m_chain->inputFile () << "\'" << endl; return KoFilter::FileNotFound; diff --git a/filters/kword/mswrite/mswriteimport.h b/filters/kword/mswrite/mswriteimport.h index ad1620d6..81f9511c 100644 --- a/filters/kword/mswrite/mswriteimport.h +++ b/filters/kword/mswrite/mswriteimport.h @@ -29,6 +29,7 @@ class KWordGenerator; class MSWriteImport : public KoFilter { Q_OBJECT + TQ_OBJECT private: WRIDevice *m_device; @@ -36,10 +37,10 @@ private: KWordGenerator *m_generator; public: - MSWriteImport (KoFilter *parent, const char *name, const QStringList &); + MSWriteImport (KoFilter *tqparent, const char *name, const TQStringList &); virtual ~MSWriteImport (); - KoFilter::ConversionStatus convert (const QCString &from, const QCString &to); + KoFilter::ConversiontqStatus convert (const TQCString &from, const TQCString &to); void sigProgress (const int value) { diff --git a/filters/kword/mswrite/status.html b/filters/kword/mswrite/status.html index ce8db955..6ede1caf 100644 --- a/filters/kword/mswrite/status.html +++ b/filters/kword/mswrite/status.html @@ -51,7 +51,7 @@ <td><b>Imports almost everything except OLE from MS WinWrite (3.0 & 3.1) documents</b> <br> - Character formatting (fonts, bold, italic, underline, superscript, subscript, "(page)" numbering) <br> - Optional/Soft Hyphenation <br> - - Paragraph formatting (alignment, linespacing, indentation, tabulation) <br> + - Paragraph formatting (tqalignment, linespacing, indentation, tabulation) <br> - Paragraphs with multiple newlines <br> - Pagebreaking (at the start or end of the line and on the next line) <br> - Images (Standard WMFs, monochrome BMPs, position from left margin) <br> @@ -101,7 +101,7 @@ <b> Version 0.3-1: KOffice 1.2 Beta1 </b> <br> - fixed mswritelib.cc crash on files with an unusual font table <br> - emulates image position from left margin by using paragraph indents <br> - - WMFs now render correctly in KWord (thanks to Lorthiois Thierry); note that only QWMF code was changed <br> + - WMFs now render correctly in KWord (thanks to Lorthiois Thierry); note that only TQWMF code was changed <br> - gcc 2.95.3 internal error workaround <br> - more *.desktop fixes <br> @@ -126,7 +126,7 @@ <br> <b> Version 0.1 (7 Oct 2001): Initial release </b> <br> - - the underlying code to read in the format is there but the filter can only do plain text with alignment + - the underlying code to read in the format is there but the filter can only do plain text with tqalignment <br> </td> </tr> diff --git a/filters/kword/mswrite/structures.h b/filters/kword/mswrite/structures.h index 5aa4f6a3..af687b3a 100644 --- a/filters/kword/mswrite/structures.h +++ b/filters/kword/mswrite/structures.h @@ -378,7 +378,7 @@ namespace MSWrite // convenience functions Byte getAlign (void) const { return getAlignment (); } - void setAlign (const Byte val) { setAlignment (val); } + void setAlign (const Byte val) { tqsetAlignment (val); } Short getLeftIndentFirstLine (const bool purist = false) const { diff --git a/filters/kword/mswrite/structures_generated.cpp b/filters/kword/mswrite/structures_generated.cpp index c443f252..6b6e5575 100644 --- a/filters/kword/mswrite/structures_generated.cpp +++ b/filters/kword/mswrite/structures_generated.cpp @@ -1166,7 +1166,7 @@ namespace MSWrite // --- set defaults in raw array (needed because it's a useThisMuch structure) --- WriteByte ((Byte) (60), m_data + 1);// magic0_60_or_61 - m_data [2] = 0; // alignment + m_data [2] = 0; // tqalignment WriteWord ((Word) (30), m_data + 3);// magic30 memset (m_data + 5, 0, 6); // rightIndent, leftIndent, leftIndentFirstLine WriteWord ((Word) (240), m_data + 11);// lineSpacing @@ -1176,7 +1176,7 @@ namespace MSWrite // --- set defaults for variables -- m_numDataBytes = (Byte) (0); m_magic0_60_or_61 = (Byte) (60); - m_alignment = (Byte) (0); + m_tqalignment = (Byte) (0); m_magic30 = (Word) (30); m_rightIndent = (Word) (0); m_leftIndent = (Word) (0); @@ -1210,7 +1210,7 @@ namespace MSWrite m_numDataBytes = rhs.m_numDataBytes; m_magic0_60_or_61 = rhs.m_magic0_60_or_61; - m_alignment = rhs.m_alignment; + m_tqalignment = rhs.m_tqalignment; m_magic30 = rhs.m_magic30; m_rightIndent = rhs.m_rightIndent; m_leftIndent = rhs.m_leftIndent; @@ -1235,7 +1235,7 @@ namespace MSWrite if (!Verify (Error::InvalidFormat, m_numDataBytes >= 1 && m_numDataBytes <= s_size - sizeof (Byte), DWord (m_numDataBytes))) return false; if (!Verify (Error::Warn, m_magic0_60_or_61 == 0 || m_magic0_60_or_61 == 60 || m_magic0_60_or_61 == 61, DWord (m_magic0_60_or_61))) return false; - // m_alignment will not be checked + // m_tqalignment will not be checked if (!Verify (Error::Warn, m_magic30 == 30, DWord (m_magic30))) return false; // m_rightIndent will not be checked // m_leftIndent will not be checked @@ -1275,8 +1275,8 @@ namespace MSWrite ReadByte (m_magic0_60_or_61, m_data + 1); signalHaveSetData (m_magic0_60_or_61 == Byte (60), 0/*offset*/ + 8/*size*/); - ReadByte (m_alignment, m_data + 2); - signalHaveSetData (m_alignment == Byte (0), 8/*offset*/ + 8/*size*/); + ReadByte (m_tqalignment, m_data + 2); + signalHaveSetData (m_tqalignment == Byte (0), 8/*offset*/ + 8/*size*/); ReadWord (m_magic30, m_data + 3); signalHaveSetData (m_magic30 == Word (30), 16/*offset*/ + 16/*size*/); ReadWord (m_rightIndent, m_data + 5); @@ -1323,7 +1323,7 @@ namespace MSWrite WriteByte (m_numDataBytes, m_data + 0); WriteByte (m_magic0_60_or_61, m_data + 1); - WriteByte (m_alignment, m_data + 2); + WriteByte (m_tqalignment, m_data + 2); WriteWord (m_magic30, m_data + 3); WriteWord (m_rightIndent, m_data + 5); WriteWord (m_leftIndent, m_data + 7); diff --git a/filters/kword/mswrite/structures_generated.h b/filters/kword/mswrite/structures_generated.h index c57ad4aa..6ee59103 100644 --- a/filters/kword/mswrite/structures_generated.h +++ b/filters/kword/mswrite/structures_generated.h @@ -70,7 +70,7 @@ namespace MSWrite // // Structure Fields: // - // name #REQUIRED + // name #RETQUIRED // type #IMPLIED "Word" // default #IMPLIED "" // description #IMPLIED "" (also valid for Structures) @@ -183,7 +183,7 @@ namespace MSWrite void setNumPages (const Word val) { m_numPages = val; } }; - // Page layout information (margins, dimensions, ...) + // Page tqlayout information (margins, dimensions, ...) class PageLayoutGenerated : public NeedsDevice { public: @@ -701,7 +701,7 @@ namespace MSWrite Byte m_numDataBytes; // number of bytes that follow Byte m_magic0_60_or_61; // =0? =60? =61? 60 is the most common - Byte m_alignment; + Byte m_tqalignment; Word m_magic30; // =30? Word m_rightIndent; // indent from right margin + right margin (if in header/footer) Word m_leftIndent; // indent from left margin + left margin (if in header/footer) @@ -730,7 +730,7 @@ namespace MSWrite static const Byte numDataBytesDefault = Byte (0); static const Byte magic0_60_or_61Default = Byte (60); - static const Byte alignmentDefault = Byte (0); + static const Byte tqalignmentDefault = Byte (0); static const Word magic30Default = Word (30); static const Word rightIndentDefault = Word (0); static const Word leftIndentDefault = Word (0); @@ -758,8 +758,8 @@ namespace MSWrite // get and set functions // - Byte getAlignment (void) const { return m_alignment; } - void setAlignment (const Byte val) { m_alignment = val; signalHaveSetData (m_alignment == Byte (0), 8/*offset*/ + 8/*size*/); } + Byte getAlignment (void) const { return m_tqalignment; } + void tqsetAlignment (const Byte val) { m_tqalignment = val; signalHaveSetData (m_tqalignment == Byte (0), 8/*offset*/ + 8/*size*/); } Word getRightIndent (void) const { return m_rightIndent; } void setRightIndent (const Word val) { m_rightIndent = val; signalHaveSetData (m_rightIndent == Word (0), 32/*offset*/ + 16/*size*/); } diff --git a/filters/kword/mswrite/structures_private.cpp b/filters/kword/mswrite/structures_private.cpp index 6779e1d7..dec806c0 100644 --- a/filters/kword/mswrite/structures_private.cpp +++ b/filters/kword/mswrite/structures_private.cpp @@ -479,7 +479,7 @@ namespace MSWrite code++; } - // couldn't find + // couldn't tqfind return 0xFFFFFFFF; } diff --git a/filters/kword/oowriter/ExportFilter.cc b/filters/kword/oowriter/ExportFilter.cc index 59b1598a..3432d611 100644 --- a/filters/kword/oowriter/ExportFilter.cc +++ b/filters/kword/oowriter/ExportFilter.cc @@ -30,11 +30,11 @@ License version 2. */ -#include <qmap.h> -#include <qiodevice.h> -#include <qbuffer.h> -#include <qtextstream.h> -#include <qdom.h> +#include <tqmap.h> +#include <tqiodevice.h> +#include <tqbuffer.h> +#include <tqtextstream.h> +#include <tqdom.h> #include <kdebug.h> #include <klocale.h> @@ -60,18 +60,18 @@ OOWriterWorker::OOWriterWorker(void) : m_streamOut(NULL), { } -QString OOWriterWorker::escapeOOText(const QString& strText) const +TQString OOWriterWorker::escapeOOText(const TQString& strText) const { // Escape quotes (needed in attributes) // Escape apostrophs (allowed by XML) return KWEFUtil::EscapeSgmlText(NULL,strText,true,true); } -QString OOWriterWorker::escapeOOSpan(const QString& strText) const +TQString OOWriterWorker::escapeOOSpan(const TQString& strText) const // We need not only to escape the classical XML stuff but also to take care of spaces and tabs. { - QString strReturn; - QChar ch; + TQString strReturn; + TQChar ch; int spaceNumber = 0; // How many spaces should be written for (uint i=0; i<strText.length(); i++) @@ -88,7 +88,7 @@ QString OOWriterWorker::escapeOOSpan(const QString& strText) const if ( spaceNumber > 0 ) { strReturn += "<text:s text:c=\""; - strReturn += QString::number( spaceNumber ); + strReturn += TQString::number( spaceNumber ); strReturn += "\"/>"; } spaceNumber = 0; @@ -96,7 +96,7 @@ QString OOWriterWorker::escapeOOSpan(const QString& strText) const } // ### TODO: would be switch/case or if/elseif the best? - switch (ch.unicode()) + switch (ch.tqunicode()) { case 9: // Tab { @@ -180,7 +180,7 @@ QString OOWriterWorker::escapeOOSpan(const QString& strText) const case 30: case 31: { - kdWarning(30518) << "Not allowed XML character: " << ch.unicode() << endl; + kdWarning(30518) << "Not allowed XML character: " << ch.tqunicode() << endl; strReturn += '?'; break; } @@ -201,7 +201,7 @@ QString OOWriterWorker::escapeOOSpan(const QString& strText) const if ( spaceNumber > 0 ) { strReturn += "<text:s text:c=\""; - strReturn += QString::number( spaceNumber ); + strReturn += TQString::number( spaceNumber ); strReturn += "\"/>"; } spaceNumber = 0; @@ -210,7 +210,7 @@ QString OOWriterWorker::escapeOOSpan(const QString& strText) const return strReturn; } -bool OOWriterWorker::doOpenFile(const QString& filenameOut, const QString& ) +bool OOWriterWorker::doOpenFile(const TQString& filenameOut, const TQString& ) { kdDebug(30518) << "Opening file: " << filenameOut << " (in OOWriterWorker::doOpenFile)" << endl; @@ -228,25 +228,25 @@ bool OOWriterWorker::doOpenFile(const QString& filenameOut, const QString& ) m_zip->setCompression( KZip::NoCompression ); m_zip->setExtraField( KZip::NoExtraField ); - const QCString appId( "application/vnd.sun.xml.writer" ); + const TQCString appId( "application/vnd.sun.xml.writer" ); - m_zip->writeFile( "mimetype", QString::null, QString::null, appId.length(), appId.data() ); + m_zip->writeFile( "mimetype", TQString(), TQString(), appId.length(), appId.data() ); m_zip->setCompression( KZip::DeflateCompression ); - m_streamOut=new QTextStream(m_contentBody, IO_WriteOnly); + m_streamOut=new TQTextStream(m_contentBody, IO_WriteOnly); - m_streamOut->setEncoding( QTextStream::UnicodeUTF8 ); + m_streamOut->setEncoding( TQTextStream::UnicodeUTF8 ); return true; } -bool OOWriterWorker::zipPrepareWriting(const QString& name) +bool OOWriterWorker::zipPrepareWriting(const TQString& name) { if (!m_zip) return false; m_size=0; - return m_zip->prepareWriting(name, QString::null, QString::null, 0); + return m_zip->prepareWriting(name, TQString(), TQString(), 0); } bool OOWriterWorker::zipDoneWriting(void) @@ -265,7 +265,7 @@ bool OOWriterWorker::zipWriteData(const char* str) return m_zip->writeData(str,size); } -bool OOWriterWorker::zipWriteData(const QByteArray& array) +bool OOWriterWorker::zipWriteData(const TQByteArray& array) { if (!m_zip) return false; @@ -274,7 +274,7 @@ bool OOWriterWorker::zipWriteData(const QByteArray& array) return m_zip->writeData(array.data(),size); } -bool OOWriterWorker::zipWriteData(const QCString& cstr) +bool OOWriterWorker::zipWriteData(const TQCString& cstr) { if (!m_zip) return false; @@ -283,12 +283,12 @@ bool OOWriterWorker::zipWriteData(const QCString& cstr) return m_zip->writeData(cstr.data(),size); } -bool OOWriterWorker::zipWriteData(const QString& str) +bool OOWriterWorker::zipWriteData(const TQString& str) { return zipWriteData(str.utf8()); } -void OOWriterWorker::writeStartOfFile(const QString& type) +void OOWriterWorker::writeStartOfFile(const TQString& type) { const bool noType=type.isEmpty(); zipWriteData("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); @@ -358,11 +358,11 @@ void OOWriterWorker::writeStartOfFile(const QString& type) void OOWriterWorker::writeFontDeclaration(void) { zipWriteData( " <office:font-decls>\n"); - QMap<QString,QString>::ConstIterator end(m_fontNames.end()); - for (QMap<QString,QString>::ConstIterator it=m_fontNames.begin(); it!=end; ++it) + TQMap<TQString,TQString>::ConstIterator end(m_fontNames.end()); + for (TQMap<TQString,TQString>::ConstIterator it=m_fontNames.begin(); it!=end; ++it) { - const bool space=(it.key().find(' ')>=0); // Does the font has at least a space in its name - const QString fontName(escapeOOText(it.key())); + const bool space=(it.key().tqfind(' ')>=0); // Does the font has at least a space in its name + const TQString fontName(escapeOOText(it.key())); zipWriteData(" <style:font-decl style:name=\""); zipWriteData(fontName); zipWriteData("\" fo:font-family=\""); @@ -403,9 +403,9 @@ void OOWriterWorker::writeStylesXml(void) zipWriteData( " style:page-usage=\"all\"" ); // ### TODO: check zipWriteData(" fo:page-width=\""); - zipWriteData(QString::number(m_paperWidth)); + zipWriteData(TQString::number(m_paperWidth)); zipWriteData("pt\" fo:page-height=\""); - zipWriteData(QString::number(m_paperHeight)); + zipWriteData(TQString::number(m_paperHeight)); zipWriteData("pt\" "); zipWriteData("style:print-orientation=\""); @@ -419,24 +419,24 @@ void OOWriterWorker::writeStylesXml(void) } zipWriteData("\" fo:margin-top=\""); - zipWriteData(QString::number(m_paperBorderTop)); + zipWriteData(TQString::number(m_paperBorderTop)); zipWriteData("pt\" fo:margin-bottom=\""); - zipWriteData(QString::number(m_paperBorderBottom)); + zipWriteData(TQString::number(m_paperBorderBottom)); zipWriteData("pt\" fo:margin-left=\""); - zipWriteData(QString::number(m_paperBorderLeft)); + zipWriteData(TQString::number(m_paperBorderLeft)); zipWriteData("pt\" fo:margin-right=\""); - zipWriteData(QString::number(m_paperBorderRight)); + zipWriteData(TQString::number(m_paperBorderRight)); zipWriteData("pt\" style:first-page-number=\""); - zipWriteData(QString::number(m_varSet.startingPageNumber)); + zipWriteData(TQString::number(m_varSet.startingPageNumber)); zipWriteData( "\">\n" ); if ( m_columns > 1 ) { zipWriteData( " <style:columns" ); zipWriteData( " fo:column-count=\"" ); - zipWriteData( QString::number( m_columns ) ); + zipWriteData( TQString::number( m_columns ) ); zipWriteData( "\" fo:column-gap=\"" ); - zipWriteData( QString::number( m_columnspacing ) ); + zipWriteData( TQString::number( m_columnspacing ) ); zipWriteData( "pt\">\n" ); for (int i=0; i < m_columns; ++i) @@ -474,7 +474,7 @@ void OOWriterWorker::writeContentXml(void) zipWriteData(" <office:automatic-styles>\n"); zipWriteData(m_contentAutomaticStyles); - m_contentAutomaticStyles = QString::null; // Release memory + m_contentAutomaticStyles = TQString(); // Release memory zipWriteData(" </office:automatic-styles>\n"); @@ -499,7 +499,7 @@ void OOWriterWorker::writeMetaXml(void) // Tell who we are in case that we have a bug in our filter output! zipWriteData(" <meta:generator>KWord's OOWriter Export Filter"); - zipWriteData(QString("$Revision: 515673 $").mid(10).remove('$')); // has a leading and a trailing space. + zipWriteData(TQString("$Revision: 515673 $").mid(10).remove('$')); // has a leading and a trailing space. zipWriteData("</meta:generator>\n"); @@ -543,16 +543,16 @@ void OOWriterWorker::writeMetaXml(void) if ( m_numPages > 0 ) { zipWriteData( " meta:page-count=\"" ); - zipWriteData( QString::number ( m_numPages ) ); + zipWriteData( TQString::number ( m_numPages ) ); zipWriteData( "\"" ); } zipWriteData( " meta:image-count=\"" ); // This is not specified in the OO specification section 2.1.19 - zipWriteData( QString::number ( m_pictureNumber ) ); + zipWriteData( TQString::number ( m_pictureNumber ) ); zipWriteData( "\"" ); zipWriteData( " meta:table-count=\"" ); - zipWriteData( QString::number ( m_tableNumber ) ); + zipWriteData( TQString::number ( m_tableNumber ) ); zipWriteData( "\"" ); zipWriteData( "/>\n" ); // meta:document-statistic @@ -596,7 +596,7 @@ bool OOWriterWorker::doCloseDocument(void) bool OOWriterWorker::doOpenBody(void) { - QValueList<FrameAnchor>::Iterator it; + TQValueList<FrameAnchor>::Iterator it; // We have to process all non-inline pictures kdDebug(30518) << "=== Processing non-inlined pictures ===" << endl; @@ -621,14 +621,14 @@ bool OOWriterWorker::doOpenBody(void) return true; } -QString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, - const TextFormatting& formatData, const bool force, QString& key) +TQString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, + const TextFormatting& formatData, const bool force, TQString& key) { // TODO: rename variable formatData - QString strElement; // TODO: rename this variable + TQString strElement; // TODO: rename this variable // Font name - QString fontName = formatData.fontName; + TQString fontName = formatData.fontName; declareFont(fontName); if ( !fontName.isEmpty() && (force || (formatOrigin.fontName!=formatData.fontName))) @@ -684,9 +684,9 @@ QString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, if (size>0) { strElement+="fo:font-size=\""; - strElement+=QString::number(size,10); + strElement+=TQString::number(size,10); strElement+="pt\" "; - key+=QString::number(size,10); + key+=TQString::number(size,10); } } @@ -726,8 +726,8 @@ QString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, strElement+="style:text-underline=\""; if ( formatData.underline ) { - QString underlineValue ( formatData.underlineValue ); - QString underlineStyle ( formatData.underlineStyle ); + TQString underlineValue ( formatData.underlineValue ); + TQString underlineStyle ( formatData.underlineStyle ); if ( underlineStyle.isEmpty() ) underlineStyle = "solid"; @@ -792,7 +792,7 @@ QString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, if ( formatData.underline && formatData.underlineColor.isValid() ) { - const QString colorName( formatData.underlineColor.name() ); + const TQString colorName( formatData.underlineColor.name() ); strElement += "style:text-underline-color=\""; strElement += colorName; strElement += "\" "; @@ -861,10 +861,10 @@ QString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, if ( force || ( formatOrigin.language != formatData.language ) ) { - const QString lang ( formatData.language ); + const TQString lang ( formatData.language ); if ( ! lang.isEmpty() ) { - const int res = lang.find( '_' ); + const int res = lang.tqfind( '_' ); if ( res >= 0 ) { @@ -941,20 +941,20 @@ QString OOWriterWorker::textFormatToStyle(const TextFormatting& formatOrigin, #define ALLOW_TABLE -QString OOWriterWorker::cellToProperties( const TableCell& cell, QString& key) const +TQString OOWriterWorker::cellToProperties( const TableCell& cell, TQString& key) const { #ifdef ALLOW_TABLE const FrameData& frame = cell.frame; - QString properties; + TQString properties; key += "!L"; // left border key += frame.lColor.name(); key += ","; - key += QString::number( frame.lWidth ); + key += TQString::number( frame.lWidth ); properties += " fo:border-left=\""; if ( frame.lColor.isValid() && frame.lWidth > 0.0 ) { - properties += QString::number( frame.lWidth ); + properties += TQString::number( frame.lWidth ); properties += "pt"; properties += " solid "; // ### TODO properties += frame.lColor.name(); @@ -968,11 +968,11 @@ QString OOWriterWorker::cellToProperties( const TableCell& cell, QString& key) c key += "!R"; // right border key += frame.rColor.name(); key += ","; - key += QString::number( frame.rWidth ); + key += TQString::number( frame.rWidth ); properties += " fo:border-right=\""; if ( frame.rColor.isValid() && frame.rWidth > 0.0 ) { - properties += QString::number( frame.rWidth ); + properties += TQString::number( frame.rWidth ); properties += "pt"; properties += " solid "; // ### TODO properties += frame.rColor.name(); @@ -986,11 +986,11 @@ QString OOWriterWorker::cellToProperties( const TableCell& cell, QString& key) c key += "!T"; // top border key += frame.tColor.name(); key += ","; - key += QString::number( frame.tWidth ); + key += TQString::number( frame.tWidth ); properties += " fo:border-top=\""; if ( frame.tColor.isValid() && frame.tWidth > 0.0 ) { - properties += QString::number( frame.tWidth ); + properties += TQString::number( frame.tWidth ); properties += "pt"; properties += " solid "; // ### TODO properties += frame.tColor.name(); @@ -1004,11 +1004,11 @@ QString OOWriterWorker::cellToProperties( const TableCell& cell, QString& key) c key += "!B"; // bottom border key += frame.bColor.name(); key += ","; - key += QString::number( frame.bWidth ); + key += TQString::number( frame.bWidth ); properties += " fo:border-bottom=\""; if ( frame.bColor.isValid() && frame.bWidth > 0.0 ) { - properties += QString::number( frame.bWidth ); + properties += TQString::number( frame.bWidth ); properties += "pt"; properties += " solid "; // ### TODO properties += frame.bColor.name(); @@ -1021,11 +1021,11 @@ QString OOWriterWorker::cellToProperties( const TableCell& cell, QString& key) c return properties; #else - return QString::null; + return TQString(); #endif } -bool OOWriterWorker::makeTableRows( const QString& tableName, const Table& table, int firstRowNumber ) +bool OOWriterWorker::makeTableRows( const TQString& tableName, const Table& table, int firstRowNumber ) { #ifdef ALLOW_TABLE // ### TODO: rows @@ -1038,9 +1038,9 @@ bool OOWriterWorker::makeTableRows( const QString& tableName, const Table& table ulong cellNumber = 0L; - QMap<QString,QString> mapCellStyleKeys; + TQMap<TQString,TQString> mapCellStyleKeys; - for ( QValueList<TableCell>::ConstIterator itCell ( table.cellList.begin() ); + for ( TQValueList<TableCell>::ConstIterator itCell ( table.cellList.begin() ); itCell != table.cellList.end(); ++itCell) { if ( rowCurrent != (*itCell).row ) @@ -1050,11 +1050,11 @@ bool OOWriterWorker::makeTableRows( const QString& tableName, const Table& table *m_streamOut << "<table:table-row>\n"; } - QString key; - const QString props ( cellToProperties( (*itCell), key ) ); + TQString key; + const TQString props ( cellToProperties( (*itCell), key ) ); - QString automaticCellStyle; - QMap<QString,QString>::ConstIterator it ( mapCellStyleKeys.find( key ) ); + TQString automaticCellStyle; + TQMap<TQString,TQString>::ConstIterator it ( mapCellStyleKeys.tqfind( key ) ); if ( it == mapCellStyleKeys.end() ) { automaticCellStyle = makeAutomaticStyleName( tableName + ".Cell", cellNumber ); @@ -1111,12 +1111,12 @@ bool OOWriterWorker::makeTableRows( const QString& tableName, const Table& table } #ifdef ALLOW_TABLE -static uint getColumnWidths( const Table& table, QMemArray<double>& widthArray, int firstRowNumber ) +static uint getColumnWidths( const Table& table, TQMemArray<double>& widthArray, int firstRowNumber ) { bool uniqueColumns = true; // We have not found any horizontally spanned cells yet. uint currentColumn = 0; int tryingRow = firstRowNumber; // We are trying the first row - QValueList<TableCell>::ConstIterator itCell; + TQValueList<TableCell>::ConstIterator itCell; for ( itCell = table.cellList.begin(); itCell != table.cellList.end(); ++itCell ) @@ -1150,7 +1150,7 @@ static uint getColumnWidths( const Table& table, QMemArray<double>& widthArray, const double width = ( (*itCell).frame.right - (*itCell).frame.left ); if ( currentColumn >= widthArray.size() ) - widthArray.resize( currentColumn + 4, QGArray::SpeedOptim); + widthArray.resize( currentColumn + 4, TQGArray::SpeedOptim); widthArray.at( currentColumn ) = width; ++currentColumn; @@ -1165,12 +1165,12 @@ static uint getColumnWidths( const Table& table, QMemArray<double>& widthArray, #endif #ifdef ALLOW_TABLE -static uint getFirstRowColumnWidths( const Table& table, QMemArray<double>& widthArray, int firstRowNumber ) +static uint getFirstRowColumnWidths( const Table& table, TQMemArray<double>& widthArray, int firstRowNumber ) // Get the column widths only by the first row. // This is used when all table rows have horizontally spanned cells. { uint currentColumn = 0; - QValueList<TableCell>::ConstIterator itCell; + TQValueList<TableCell>::ConstIterator itCell; for ( itCell = table.cellList.begin(); itCell != table.cellList.end(); ++itCell ) @@ -1187,7 +1187,7 @@ static uint getFirstRowColumnWidths( const Table& table, QMemArray<double>& widt const double width = ( (*itCell).frame.right - (*itCell).frame.left ) / cols; if ( currentColumn + cols > widthArray.size() ) - widthArray.resize( currentColumn + 4, QGArray::SpeedOptim); + widthArray.resize( currentColumn + 4, TQGArray::SpeedOptim); for ( int i = 0; i < cols; ++i ) { @@ -1204,15 +1204,15 @@ bool OOWriterWorker::makeTable( const FrameAnchor& anchor, const AnchorType anch #ifdef ALLOW_TABLE // Be careful that while being similar the following 5 strings have different purposes - const QString automaticTableStyle ( makeAutomaticStyleName( "Table", m_tableNumber ) ); // It also increases m_tableNumber - const QString tableName( QString( "Table" ) + QString::number( m_tableNumber ) ); // m_tableNumber was already increased - const QString translatedName( i18n( "Object name", "Table %1").arg( m_tableNumber ) ); - const QString automaticFrameStyle ( makeAutomaticStyleName( "TableFrame", m_textBoxNumber ) ); // It also increases m_textBoxNumber - const QString translatedFrameName( i18n( "Object name", "Table Frame %1").arg( m_textBoxNumber ) ); + const TQString automaticTableStyle ( makeAutomaticStyleName( "Table", m_tableNumber ) ); // It also increases m_tableNumber + const TQString tableName( TQString( "Table" ) + TQString::number( m_tableNumber ) ); // m_tableNumber was already increased + const TQString translatedName( i18n( "Object name", "Table %1").tqarg( m_tableNumber ) ); + const TQString automaticFrameStyle ( makeAutomaticStyleName( "TableFrame", m_textBoxNumber ) ); // It also increases m_textBoxNumber + const TQString translatedFrameName( i18n( "Object name", "Table Frame %1").tqarg( m_textBoxNumber ) ); kdDebug(30518) << "Processing table " << anchor.key.toString() << " => " << tableName << endl; - const QValueList<TableCell>::ConstIterator firstCell ( anchor.table.cellList.begin() ); + const TQValueList<TableCell>::ConstIterator firstCell ( anchor.table.cellList.begin() ); if ( firstCell == anchor.table.cellList.end() ) { @@ -1223,7 +1223,7 @@ bool OOWriterWorker::makeTable( const FrameAnchor& anchor, const AnchorType anch const int firstRowNumber = (*firstCell).row; kdDebug(30518) << "First row: " << firstRowNumber << endl; - QMemArray<double> widthArray(4); + TQMemArray<double> widthArray(4); uint numberColumns = getColumnWidths( anchor.table, widthArray, firstRowNumber ); @@ -1281,7 +1281,7 @@ bool OOWriterWorker::makeTable( const FrameAnchor& anchor, const AnchorType anch m_contentAutomaticStyles += " <style:style"; // for frame m_contentAutomaticStyles += " style:name=\"" + escapeOOText( automaticFrameStyle ) + "\""; m_contentAutomaticStyles += " style:family=\"graphics\""; - m_contentAutomaticStyles += " style:parent-style-name=\"Frame\""; // ### TODO: parent style needs to be correctly defined + m_contentAutomaticStyles += " style:tqparent-style-name=\"Frame\""; // ### TODO: tqparent style needs to be correctly defined m_contentAutomaticStyles += ">\n"; m_contentAutomaticStyles += " <style:properties "; // ### TODO m_contentAutomaticStyles += " text:anchor-type=\"as-char\""; // ### TODO: needed? @@ -1299,17 +1299,17 @@ bool OOWriterWorker::makeTable( const FrameAnchor& anchor, const AnchorType anch m_contentAutomaticStyles += " style:family=\"table\""; m_contentAutomaticStyles += ">\n"; m_contentAutomaticStyles += " <style:properties "; - m_contentAutomaticStyles += " style:width=\"" + QString::number( tableWidth ) + "pt\" "; + m_contentAutomaticStyles += " style:width=\"" + TQString::number( tableWidth ) + "pt\" "; m_contentAutomaticStyles += "/>\n"; m_contentAutomaticStyles += " </style:style>\n"; - QValueList<TableCell>::ConstIterator itCell; + TQValueList<TableCell>::ConstIterator itCell; ulong columnNumber = 0L; for ( i=0; i < numberColumns; ++i ) { - const QString automaticColumnStyle ( makeAutomaticStyleName( tableName + ".Column", columnNumber ) ); + const TQString automaticColumnStyle ( makeAutomaticStyleName( tableName + ".Column", columnNumber ) ); kdDebug(30518) << "Creating automatic column style: " << automaticColumnStyle /* << " key: " << styleKey */ << endl; m_contentAutomaticStyles += " <style:style"; @@ -1319,7 +1319,7 @@ bool OOWriterWorker::makeTable( const FrameAnchor& anchor, const AnchorType anch m_contentAutomaticStyles += " <style:properties "; // Despite that some OO specification examples use fo:width, OO specification section 4.19 tells to use style:column-width // and/or the relative variant: style:rel-column-width - m_contentAutomaticStyles += " style:column-width=\"" + QString::number( widthArray.at( i ) ) + "pt\" "; + m_contentAutomaticStyles += " style:column-width=\"" + TQString::number( widthArray.at( i ) ) + "pt\" "; m_contentAutomaticStyles += "/>\n"; m_contentAutomaticStyles += " </style:style>\n"; @@ -1344,12 +1344,12 @@ bool OOWriterWorker::makePicture( const FrameAnchor& anchor, const AnchorType an kdDebug(30518) << "New picture: " << anchor.picture.koStoreName << " , " << anchor.picture.key.toString() << endl; - const QString koStoreName(anchor.picture.koStoreName); + const TQString koStoreName(anchor.picture.koStoreName); - QByteArray image; + TQByteArray image; - QString strExtension(koStoreName.lower()); - const int result=koStoreName.findRev("."); + TQString strExtension(koStoreName.lower()); + const int result=koStoreName.tqfindRev("."); if (result>=0) { strExtension=koStoreName.mid(result+1); @@ -1397,12 +1397,12 @@ bool OOWriterWorker::makePicture( const FrameAnchor& anchor, const AnchorType an if ( anchorType == AnchorTextImage ) { // Text image have no frameset, so the only size information is in the picture itself. - QBuffer buffer( image.copy() ); // Be more safe than sorry and do not allow shallow copy + TQBuffer buffer( image.copy() ); // Be more safe than sorry and do not allow shallow copy KoPicture pic; buffer.open( IO_ReadOnly ); - if ( pic.load( &buffer, strExtension ) ) + if ( pic.load( TQT_TQIODEVICE(&buffer), strExtension ) ) { - const QSize size ( pic.getOriginalSize() ); + const TQSize size ( pic.getOriginalSize() ); height = size.height(); width = size.width(); } @@ -1432,11 +1432,11 @@ bool OOWriterWorker::makePicture( const FrameAnchor& anchor, const AnchorType an // We need a 32 digit hex value of the picture number // Please note: it is an exact 32 digit value, truncated if the value is more than 512 bits wide. :-) - QString number; + TQString number; number.fill('0',32); - number += QString::number(++m_pictureNumber,16); // in hex + number += TQString::number(++m_pictureNumber,16); // in hex - QString ooName("Pictures/"); + TQString ooName("Pictures/"); ooName += number.right(32); ooName += '.'; ooName += strExtension; @@ -1465,7 +1465,7 @@ bool OOWriterWorker::makePicture( const FrameAnchor& anchor, const AnchorType an { #if 0 // ### FIXME Why is the following line not working (at least with KDE 3.1)? (It makes unzip having problems with meta.xml) - m_zip->writeFile(ooName,QString::null, QString::null, image.size(), image.data()); + m_zip->writeFile(ooName,TQString(), TQString(), image.size(), image.data()); #else zipPrepareWriting(ooName); zipWriteData( image ); @@ -1476,12 +1476,12 @@ bool OOWriterWorker::makePicture( const FrameAnchor& anchor, const AnchorType an return true; } -void OOWriterWorker::processNormalText ( const QString ¶Text, +void OOWriterWorker::processNormalText ( const TQString ¶Text, const TextFormatting& formatLayout, const FormatData& formatData) { // Retrieve text and escape it (and necessary space, tabs and line-break tags) - const QString partialText( escapeOOSpan( paraText.mid( formatData.pos, formatData.len ) ) ); + const TQString partialText( escapeOOSpan( paraText.mid( formatData.pos, formatData.len ) ) ); if (formatData.text.missing) { @@ -1492,13 +1492,13 @@ void OOWriterWorker::processNormalText ( const QString ¶Text, { // Text with properties, so use a <text:span> element! *m_streamOut << "<text:span"; - QString styleKey; - const QString props ( textFormatToStyle(formatLayout,formatData.text,false,styleKey) ); + TQString styleKey; + const TQString props ( textFormatToStyle(formatLayout,formatData.text,false,styleKey) ); - QMap<QString,QString>::ConstIterator it ( m_mapTextStyleKeys.find(styleKey) ); + TQMap<TQString,TQString>::ConstIterator it ( m_mapTextStyleKeys.tqfind(styleKey) ); kdDebug(30518) << "Searching text key: " << styleKey << endl; - QString automaticStyle; + TQString automaticStyle; if (it==m_mapTextStyleKeys.end()) { // We have not any match, so we need a new automatic text style @@ -1531,10 +1531,10 @@ void OOWriterWorker::processNormalText ( const QString ¶Text, void OOWriterWorker::processFootnote( const VariableData& variable ) { // Footnote - const QValueList<ParaData> *paraList = variable.getFootnotePara(); + const TQValueList<ParaData> *paraList = variable.getFootnotePara(); if( paraList ) { - const QString value ( variable.getFootnoteValue() ); + const TQString value ( variable.getFootnoteValue() ); //const bool automatic = formatData.variable.getFootnoteAuto(); const bool flag = variable.getFootnoteType(); @@ -1596,7 +1596,7 @@ void OOWriterWorker::processNote( const VariableData& variable ) << "</office:annotation>"; } -void OOWriterWorker::processVariable ( const QString&, +void OOWriterWorker::processVariable ( const TQString&, const TextFormatting& /*formatLayout*/, const FormatData& formatData) { @@ -1650,7 +1650,7 @@ void OOWriterWorker::processVariable ( const QString&, } } -void OOWriterWorker::processAnchor ( const QString&, +void OOWriterWorker::processAnchor ( const TQString&, const TextFormatting& /*formatLayout*/, //TODO const FormatData& formatData) { @@ -1671,7 +1671,7 @@ void OOWriterWorker::processAnchor ( const QString&, } } -void OOWriterWorker::processTextImage ( const QString&, +void OOWriterWorker::processTextImage ( const TQString&, const TextFormatting& /*formatLayout*/, const FormatData& formatData) { @@ -1679,7 +1679,7 @@ void OOWriterWorker::processTextImage ( const QString&, makePicture( formatData.frameAnchor, AnchorTextImage ); } -void OOWriterWorker::processParagraphData ( const QString ¶Text, +void OOWriterWorker::processParagraphData ( const TQString ¶Text, const TextFormatting& formatLayout, const ValueListFormatData ¶FormatDataList) { @@ -1728,39 +1728,39 @@ void OOWriterWorker::processParagraphData ( const QString ¶Text, } } -QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force, QString& styleKey) +TQString OOWriterWorker::tqlayoutToParagraphStyle(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force, TQString& styleKey) { - QString props; // Props has to remain empty, if there is no difference. + TQString props; // Props has to remain empty, if there is no difference. - styleKey += layout.styleName; + styleKey += tqlayout.styleName; styleKey += ','; - if (force || (layoutOrigin.alignment!=layout.alignment)) + if (force || (tqlayoutOrigin.tqalignment!=tqlayout.tqalignment)) { // NOTE: OO 1.0.x uses start and end like left and right (section 3.11.4) // Unfortunately in XSL-FO's text-align, they are really supposed to be the start and the end. - if (layout.alignment == "left") + if (tqlayout.tqalignment == "left") { props += "fo:text-align=\"start\" "; styleKey += 'L'; } - else if (layout.alignment == "right") + else if (tqlayout.tqalignment == "right") { props += "fo:text-align=\"end\" "; styleKey += 'R'; } - else if (layout.alignment == "center") + else if (tqlayout.tqalignment == "center") { props += "fo:text-align=\"center\" "; styleKey += 'C'; } - else if (layout.alignment == "justify") + else if (tqlayout.tqalignment == "justify") { props += "fo:text-align=\"justify\" "; styleKey += 'J'; } - else if (layout.alignment == "auto") + else if (tqlayout.tqalignment == "auto") { props += "fo:text-align=\"start\" "; #ifndef STRICT_OOWRITER_VERSION_1 @@ -1770,68 +1770,68 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, } else { - kdWarning(30518) << "Unknown alignment: " << layout.alignment << endl; + kdWarning(30518) << "Unknown tqalignment: " << tqlayout.tqalignment << endl; } } styleKey += ','; - if ((layout.indentLeft>=0.0) - && (force || (layoutOrigin.indentLeft!=layout.indentLeft))) + if ((tqlayout.indentLeft>=0.0) + && (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft))) { - props += QString("fo:margin-left=\"%1pt\" ").arg(layout.indentLeft); - styleKey += QString::number(layout.indentLeft); + props += TQString("fo:margin-left=\"%1pt\" ").tqarg(tqlayout.indentLeft); + styleKey += TQString::number(tqlayout.indentLeft); } styleKey += ','; - if ((layout.indentRight>=0.0) - && (force || (layoutOrigin.indentRight!=layout.indentRight))) + if ((tqlayout.indentRight>=0.0) + && (force || (tqlayoutOrigin.indentRight!=tqlayout.indentRight))) { - props += QString("fo:margin-right=\"%1pt\" ").arg(layout.indentRight); - styleKey += QString::number(layout.indentRight); + props += TQString("fo:margin-right=\"%1pt\" ").tqarg(tqlayout.indentRight); + styleKey += TQString::number(tqlayout.indentRight); } styleKey += ','; - if (force || (layoutOrigin.indentLeft!=layout.indentLeft)) + if (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft)) { props += "fo:text-indent=\""; - props += QString::number(layout.indentFirst); + props += TQString::number(tqlayout.indentFirst); props += "\" "; - styleKey += QString::number(layout.indentFirst); + styleKey += TQString::number(tqlayout.indentFirst); } styleKey += ','; - if ((layout.marginBottom>=0.0) - && ( force || ( layoutOrigin.marginBottom != layout.marginBottom ) ) ) + if ((tqlayout.marginBottom>=0.0) + && ( force || ( tqlayoutOrigin.marginBottom != tqlayout.marginBottom ) ) ) { - props += QString("fo:margin-bottom=\"%1pt\" ").arg(layout.marginBottom); - styleKey += QString::number(layout.marginBottom); + props += TQString("fo:margin-bottom=\"%1pt\" ").tqarg(tqlayout.marginBottom); + styleKey += TQString::number(tqlayout.marginBottom); } styleKey += ','; - if ((layout.marginTop>=0.0) - && ( force || ( layoutOrigin.marginTop != layout.marginTop ) ) ) + if ((tqlayout.marginTop>=0.0) + && ( force || ( tqlayoutOrigin.marginTop != tqlayout.marginTop ) ) ) { - props += QString("fo:margin-top=\"%1pt\" ").arg(layout.marginTop); - styleKey += QString::number(layout.marginTop); + props += TQString("fo:margin-top=\"%1pt\" ").tqarg(tqlayout.marginTop); + styleKey += TQString::number(tqlayout.marginTop); } styleKey += ','; if (force - || ( layoutOrigin.lineSpacingType != layout.lineSpacingType ) - || ( layoutOrigin.lineSpacing != layout.lineSpacing ) ) + || ( tqlayoutOrigin.lineSpacingType != tqlayout.lineSpacingType ) + || ( tqlayoutOrigin.lineSpacing != tqlayout.lineSpacing ) ) { - switch ( layout.lineSpacingType ) + switch ( tqlayout.lineSpacingType ) { case LayoutData::LS_CUSTOM: { // We have a custom line spacing (in points) - const QString height ( QString::number(layout.lineSpacing) ); // ### TODO: rounding? + const TQString height ( TQString::number(tqlayout.lineSpacing) ); // ### TODO: rounding? props += "style:line-spacing=\""; props += height; props += "pt\" "; @@ -1860,7 +1860,7 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, case LayoutData::LS_MULTIPLE: { // OOWriter 1.1 only allows up to 200% - const QString mult ( QString::number( qRound( layout.lineSpacing * 100 ) ) ); + const TQString mult ( TQString::number( tqRound( tqlayout.lineSpacing * 100 ) ) ); props += "fo:line-height=\""; props += mult; props += "%\" "; @@ -1871,7 +1871,7 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, case LayoutData::LS_FIXED: { // We have a fixed line height (in points) - const QString height ( QString::number(layout.lineSpacing) ); // ### TODO: rounding? + const TQString height ( TQString::number(tqlayout.lineSpacing) ); // ### TODO: rounding? props += "fo:line-height=\""; props += height; props += "pt\" "; @@ -1882,7 +1882,7 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, case LayoutData::LS_ATLEAST: { // We have a at-least line height (in points) - const QString height ( QString::number(layout.lineSpacing) ); // ### TODO: rounding? + const TQString height ( TQString::number(tqlayout.lineSpacing) ); // ### TODO: rounding? props += "style:line-height-at-least=\""; props += height; props += "pt\" "; @@ -1892,7 +1892,7 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, } default: { - kdWarning(30518) << "Unsupported lineSpacingType: " << layout.lineSpacingType << " (Ignoring!)" << endl; + kdWarning(30518) << "Unsupported lineSpacingType: " << tqlayout.lineSpacingType << " (Ignoring!)" << endl; break; } } @@ -1900,7 +1900,7 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, styleKey += ','; - if ( layout.pageBreakBefore ) + if ( tqlayout.pageBreakBefore ) { // We have a page break before the paragraph props += "fo:page-break-before=\"page\" "; @@ -1909,7 +1909,7 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, styleKey += ','; - if ( layout.pageBreakAfter ) + if ( tqlayout.pageBreakAfter ) { // We have a page break after the paragraph props += "fo:page-break-after=\"page\" "; @@ -1918,25 +1918,25 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, styleKey += '@'; // A more visible seperator - props += textFormatToStyle(layoutOrigin.formatData.text,layout.formatData.text,force,styleKey); + props += textFormatToStyle(tqlayoutOrigin.formatData.text,tqlayout.formatData.text,force,styleKey); props += ">"; styleKey += '@'; // A more visible seperator // ### TODO/FIXME: what if all tabulators must be erased? - if (!layout.tabulatorList.isEmpty() - && (force || (layoutOrigin.tabulatorList!=layout.tabulatorList) )) + if (!tqlayout.tabulatorList.isEmpty() + && (force || (tqlayoutOrigin.tabulatorList!=tqlayout.tabulatorList) )) { props += "\n <style:tab-stops>\n"; TabulatorList::ConstIterator it; - TabulatorList::ConstIterator end(layout.tabulatorList.end()); - for (it=layout.tabulatorList.begin();it!=end;++it) + TabulatorList::ConstIterator end(tqlayout.tabulatorList.end()); + for (it=tqlayout.tabulatorList.begin();it!=end;++it) { props+=" <style:tab-stop style:position=\""; - props += QString::number((*it).m_ptpos); + props += TQString::number((*it).m_ptpos); props += "pt\""; - styleKey += QString::number((*it).m_ptpos); + styleKey += TQString::number((*it).m_ptpos); switch ((*it).m_type) { case 0: props += " style:type=\"left\""; styleKey += "L"; break; @@ -1966,33 +1966,33 @@ QString OOWriterWorker::layoutToParagraphStyle(const LayoutData& layoutOrigin, return props; } -bool OOWriterWorker::doFullParagraph(const QString& paraText, const LayoutData& layout, +bool OOWriterWorker::doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { - const bool header = ( (layout.counter.numbering == CounterData::NUM_CHAPTER) - && (layout.counter.depth<10) ); // ### TODO: Does OOWriter really limits to 10? + const bool header = ( (tqlayout.counter.numbering == CounterData::NUM_CHAPTER) + && (tqlayout.counter.depth<10) ); // ### TODO: Does OOWriter really limits to 10? if (header) { *m_streamOut << " <text:h text:level=\""; - *m_streamOut << QString::number(layout.counter.depth+1,10); + *m_streamOut << TQString::number(tqlayout.counter.depth+1,10); *m_streamOut << "\" "; } else *m_streamOut << " <text:p "; - const LayoutData& styleLayout=m_styleMap[layout.styleName]; + const LayoutData& styleLayout=m_styleMap[tqlayout.styleName]; - QString styleKey; - const QString props(layoutToParagraphStyle(styleLayout,layout,false,styleKey)); + TQString styleKey; + const TQString props(tqlayoutToParagraphStyle(styleLayout,tqlayout,false,styleKey)); - QString actualStyle(layout.styleName); + TQString actualStyle(tqlayout.styleName); if (!props.isEmpty()) { - QMap<QString,QString>::ConstIterator it ( m_mapParaStyleKeys.find(styleKey) ); + TQMap<TQString,TQString>::ConstIterator it ( m_mapParaStyleKeys.tqfind(styleKey) ); kdDebug(30518) << "Searching paragraph key: " << styleKey << endl; - QString automaticStyle; + TQString automaticStyle; if (it==m_mapParaStyleKeys.end()) { @@ -2003,7 +2003,7 @@ bool OOWriterWorker::doFullParagraph(const QString& paraText, const LayoutData& m_contentAutomaticStyles += " <style:style"; m_contentAutomaticStyles += " style:name=\"" + escapeOOText(automaticStyle) + "\""; - m_contentAutomaticStyles += " style:parent-style-name=\"" + escapeOOText(layout.styleName) + "\""; + m_contentAutomaticStyles += " style:tqparent-style-name=\"" + escapeOOText(tqlayout.styleName) + "\""; m_contentAutomaticStyles += " style:family=\"paragraph\" style:class=\"text\""; m_contentAutomaticStyles += ">\n"; m_contentAutomaticStyles += " <style:properties "; @@ -2032,7 +2032,7 @@ bool OOWriterWorker::doFullParagraph(const QString& paraText, const LayoutData& *m_streamOut << ">"; - processParagraphData(paraText, layout.formatData.text, paraFormatDataList); + processParagraphData(paraText, tqlayout.formatData.text, paraFormatDataList); if (header) *m_streamOut << "</text:h>\n"; @@ -2054,21 +2054,21 @@ bool OOWriterWorker::doOpenStyles(void) return true; } -bool OOWriterWorker::doFullDefineStyle(LayoutData& layout) +bool OOWriterWorker::doFullDefineStyle(LayoutData& tqlayout) { //Register style in the style map - m_styleMap[layout.styleName]=layout; + m_styleMap[tqlayout.styleName]=tqlayout; m_styles += " <style:style"; - m_styles += " style:name=\"" + escapeOOText( layout.styleName ) + "\""; - m_styles += " style:next-style-name=\"" + escapeOOText( layout.styleFollowing ) + "\""; + m_styles += " style:name=\"" + escapeOOText( tqlayout.styleName ) + "\""; + m_styles += " style:next-style-name=\"" + escapeOOText( tqlayout.styleFollowing ) + "\""; m_styles += " style:family=\"paragraph\" style:class=\"text\""; m_styles += ">\n"; m_styles += " <style:properties "; - QString debugKey; // Not needed - m_styles += layoutToParagraphStyle(layout,layout,true,debugKey); + TQString debugKey; // Not needed + m_styles += tqlayoutToParagraphStyle(tqlayout,tqlayout,true,debugKey); kdDebug(30518) << "Defining style: " << debugKey << endl; m_styles += "</style:properties>\n"; @@ -2144,46 +2144,46 @@ bool OOWriterWorker::doVariableSettings(const VariableSettingsData& vs) return true; } -bool OOWriterWorker::doDeclareNonInlinedFramesets( QValueList<FrameAnchor>& pictureAnchors, QValueList<FrameAnchor>& tableAnchors ) +bool OOWriterWorker::doDeclareNonInlinedFramesets( TQValueList<FrameAnchor>& pictureAnchors, TQValueList<FrameAnchor>& tableAnchors ) { m_nonInlinedPictureAnchors = pictureAnchors; m_nonInlinedTableAnchors = tableAnchors; return true; } -void OOWriterWorker::declareFont(const QString& fontName) +void OOWriterWorker::declareFont(const TQString& fontName) { if (fontName.isEmpty()) return; - if (m_fontNames.find(fontName)==m_fontNames.end()) + if (m_fontNames.tqfind(fontName)==m_fontNames.end()) { - QString props; + TQString props; - // Disabled, as QFontInfo::styleHint() cannot guess + // Disabled, as TQFontInfo::tqstyleHint() cannot guess #if 0 - QFont font(fontName); - QFontInfo info(font); + TQFont font(fontName); + TQFontInfo info(font); props+="style:font-family-generic=\"" - switch (info.styleHint()) + switch (info.tqstyleHint()) { - case QFont::SansSerif: + case TQFont::SansSerif: default: { props += "swiss"; break; } - case QFont::Serif: + case TQFont::Serif: { props += "roman"; break; } - case QFont::Courier: + case TQFont::Courier: { props += "modern"; break; } - case QFont::OldEnglish: + case TQFont::OldEnglish: { props += "decorative"; break; @@ -2198,29 +2198,29 @@ void OOWriterWorker::declareFont(const QString& fontName) } } -QString OOWriterWorker::makeAutomaticStyleName(const QString& prefix, ulong& counter) const +TQString OOWriterWorker::makeAutomaticStyleName(const TQString& prefix, ulong& counter) const { - const QString str (prefix + QString::number(++counter,10)); + const TQString str (prefix + TQString::number(++counter,10)); // Checks if the automatic style has not the same name as a user one. // If it is the case, change it! - if (m_styleMap.find(str)==m_styleMap.end()) + if (m_styleMap.tqfind(str)==m_styleMap.end()) return str; // Unique, so let's go! - QString str2(str+"_bis"); - if (m_styleMap.find(str2)==m_styleMap.end()) + TQString str2(str+"_bis"); + if (m_styleMap.tqfind(str2)==m_styleMap.end()) return str2; str2 = str+"_ter"; - if (m_styleMap.find(str2)==m_styleMap.end()) + if (m_styleMap.tqfind(str2)==m_styleMap.end()) return str2; // If it is still not unique, try a time stamp. - const QDateTime dt(QDateTime::currentDateTime(Qt::UTC)); + const TQDateTime dt(TQDateTime::tqcurrentDateTime(Qt::UTC)); - str2 = str + "_" + QString::number(dt.toTime_t(),16); - if (m_styleMap.find(str2)==m_styleMap.end()) + str2 = str + "_" + TQString::number(dt.toTime_t(),16); + if (m_styleMap.tqfind(str2)==m_styleMap.end()) return str2; kdWarning(30518) << "Could not make an unique style name: " << str2 << endl; diff --git a/filters/kword/oowriter/ExportFilter.h b/filters/kword/oowriter/ExportFilter.h index 7a0d5640..4e7a567e 100644 --- a/filters/kword/oowriter/ExportFilter.h +++ b/filters/kword/oowriter/ExportFilter.h @@ -42,7 +42,7 @@ class KZip; -class StyleMap : public QMap<QString,LayoutData> +class StyleMap : public TQMap<TQString,LayoutData> { public: StyleMap(void) {} @@ -64,11 +64,11 @@ public: AnchorTextImage ///< This is a text image (KWord 0.8; inlined; only for pictures) }; public: - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); ///< Close file in normal conditions virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); virtual bool doFullPaperFormat(const int format, const double width, const double height, const int orientation); @@ -81,67 +81,67 @@ public: virtual bool doFullPaperFormatOther ( const int columns, const double columnspacing, const int numPages ); virtual bool doOpenStyles(void); virtual bool doCloseStyles(void); - virtual bool doFullDefineStyle(LayoutData& layout); + virtual bool doFullDefineStyle(LayoutData& tqlayout); virtual bool doFullDocumentInfo(const KWEFDocumentInfo& docInfo); virtual bool doVariableSettings(const VariableSettingsData& vs); virtual bool doOpenBody (void); - virtual bool doDeclareNonInlinedFramesets( QValueList<FrameAnchor>& pictureAnchors, QValueList<FrameAnchor>& tableAnchors ); ///< @since 1.4 + virtual bool doDeclareNonInlinedFramesets( TQValueList<FrameAnchor>& pictureAnchors, TQValueList<FrameAnchor>& tableAnchors ); ///< @since 1.4 private: - void processParagraphData (const QString& paraText, + void processParagraphData (const TQString& paraText, const TextFormatting& formatLayout, const ValueListFormatData& paraFormatDataList); - void processNormalText ( const QString& paraText, + void processNormalText ( const TQString& paraText, const TextFormatting& formatLayout, const FormatData& formatData); void processFootnote( const VariableData& variable ); void processNote( const VariableData& variable ); - void processVariable ( const QString& paraText, + void processVariable ( const TQString& paraText, const TextFormatting& formatLayout, const FormatData& formatData); - void processAnchor ( const QString& paraText, + void processAnchor ( const TQString& paraText, const TextFormatting& formatLayout, const FormatData& formatData); - void processTextImage ( const QString&, + void processTextImage ( const TQString&, const TextFormatting& formatLayout, const FormatData& formatData); - QString textFormatToStyle(const TextFormatting& formatOrigin, - const TextFormatting& formatData, const bool force, QString& key); - QString layoutToParagraphStyle(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force, QString& styleKey); - QString escapeOOText(const QString& strText) const; - QString escapeOOSpan(const QString& strText) const; - QString cellToProperties( const TableCell& cell, QString& key) const; - bool makeTableRows( const QString& tableName, const Table& table, int firstRowNumber ); + TQString textFormatToStyle(const TextFormatting& formatOrigin, + const TextFormatting& formatData, const bool force, TQString& key); + TQString tqlayoutToParagraphStyle(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force, TQString& styleKey); + TQString escapeOOText(const TQString& strText) const; + TQString escapeOOSpan(const TQString& strText) const; + TQString cellToProperties( const TableCell& cell, TQString& key) const; + bool makeTableRows( const TQString& tableName, const Table& table, int firstRowNumber ); bool makeTable( const FrameAnchor& anchor, const AnchorType anchorType ); bool makePicture( const FrameAnchor& anchor, const AnchorType anchorType ); - bool convertUnknownPicture(const QString& name, const QString& extension, QByteArray& image); - void declareFont(const QString& fontName); + bool convertUnknownPicture(const TQString& name, const TQString& extension, TQByteArray& image); + void declareFont(const TQString& fontName); void writeFontDeclaration(void); void writeContentXml(void); void writeStylesXml(void); void writeMetaXml(void); - void writeStartOfFile(const QString& type); + void writeStartOfFile(const TQString& type); /** * For automatic styles: create the name from @p prefix and from the increased @p counter * (Yes, the counter is increased by the method.) */ - QString makeAutomaticStyleName(const QString& prefix, ulong& counter) const; + TQString makeAutomaticStyleName(const TQString& prefix, ulong& counter) const; private: // ZIP methods - bool zipPrepareWriting(const QString& name); + bool zipPrepareWriting(const TQString& name); bool zipDoneWriting(void); bool zipWriteData(const char* str); - bool zipWriteData(const QByteArray& array); - bool zipWriteData(const QCString& cstr); - bool zipWriteData(const QString& str); ///< Assumes UTF-8 + bool zipWriteData(const TQByteArray& array); + bool zipWriteData(const TQCString& cstr); + bool zipWriteData(const TQString& str); ///< Assumes UTF-8 private: - QTextStream* m_streamOut; - QString m_pagesize; + TQTextStream* m_streamOut; + TQString m_pagesize; StyleMap m_styleMap; double m_paperBorderTop,m_paperBorderLeft,m_paperBorderBottom,m_paperBorderRight; KWEFDocumentInfo m_docInfo; ///< document information - QByteArray m_contentBody; ///< office:body element of content.xml + TQByteArray m_contentBody; ///< office:body element of content.xml KZip* m_zip; ///< Output OOWriter file - QMap<QString,QString> m_fontNames; ///< List of used font names (the data() are extra attributes for font declaration time.) + TQMap<TQString,TQString> m_fontNames; ///< List of used font names (the data() are extra attributes for font declaration time.) ulong m_pictureNumber; ///< Number of picture (increment *before* use) ulong m_automaticParagraphStyleNumber; ///< Number of paragraph-based automatic styles (increment *before* use) @@ -151,8 +151,8 @@ private: ulong m_textBoxNumber; ///< Number of a textbox (for draw:text-box) (increment *before* use) - QString m_styles; ///< Normal paragraph styles (in OO format) - QString m_contentAutomaticStyles; ///< Automatic styles for content.xml (in OO format) + TQString m_styles; ///< Normal paragraph styles (in OO format) + TQString m_contentAutomaticStyles; ///< Automatic styles for content.xml (in OO format) uint m_size; ///< Size of ZIP entry int m_paperFormat; @@ -160,15 +160,15 @@ private: double m_paperHeight; int m_paperOrientation; - QMap<QString,QString> m_mapTextStyleKeys; ///< Map of keys to automatic text styles - QMap<QString,QString> m_mapParaStyleKeys; ///< Map of keys to automatic paragraph styles + TQMap<TQString,TQString> m_mapTextStyleKeys; ///< Map of keys to automatic text styles + TQMap<TQString,TQString> m_mapParaStyleKeys; ///< Map of keys to automatic paragraph styles VariableSettingsData m_varSet; ///< KWord's \<VARIABLESETTINGS\> int m_numPages; ///< Number of pages @note if the input file comes from a filter, this data is often missing. double m_columnspacing; ///< Spacing between columns int m_columns; ///< Number of columns private: // Variable that would need a link/glue from libexport - QValueList<FrameAnchor> m_nonInlinedPictureAnchors; ///< Pseudo-anchors for non-inlined anchors \todo: connection to libexport - QValueList<FrameAnchor> m_nonInlinedTableAnchors; ///< Pseudo-anchors for non-inlined tables \todo: connection to libexport + TQValueList<FrameAnchor> m_nonInlinedPictureAnchors; ///< Pseudo-anchors for non-inlined anchors \todo: connection to libexport + TQValueList<FrameAnchor> m_nonInlinedTableAnchors; ///< Pseudo-anchors for non-inlined tables \todo: connection to libexport }; #endif // _EXPORTFILTER_H diff --git a/filters/kword/oowriter/conversion.cc b/filters/kword/oowriter/conversion.cc index 8c7c4ebb..209b2bec 100644 --- a/filters/kword/oowriter/conversion.cc +++ b/filters/kword/oowriter/conversion.cc @@ -2,7 +2,7 @@ #include <kdebug.h> #include <klocale.h> -QString Conversion::importAlignment( const QString& align ) +TQString Conversion::importAlignment( const TQString& align ) { if ( align == "center" || align == "justify" ) return align; @@ -10,11 +10,11 @@ QString Conversion::importAlignment( const QString& align ) return "left"; if ( align == "end" ) return "right"; - kdWarning(30518) << "Conversion::importAlignment unknown alignment " << align << endl; + kdWarning(30518) << "Conversion::importAlignment unknown tqalignment " << align << endl; return "auto"; } -QString Conversion::exportAlignment( const QString& align ) +TQString Conversion::exportAlignment( const TQString& align ) { if ( align == "center" || align == "justify" ) return align; @@ -22,31 +22,31 @@ QString Conversion::exportAlignment( const QString& align ) return "start"; if ( align == "right" ) return "end"; - kdWarning(30518) << "Conversion::exportAlignment unknown alignment " << align << endl; + kdWarning(30518) << "Conversion::exportAlignment unknown tqalignment " << align << endl; return "auto"; } -QPair<int,QString> Conversion::importWrapping( const QString& oowrap ) +TQPair<int,TQString> Conversion::importWrapping( const TQString& oowrap ) { if ( oowrap == "none" ) // 'no wrap' means 'avoid horizontal space' - return qMakePair( 2, QString::null ); + return tqMakePair( 2, TQString() ); if ( oowrap == "left" || oowrap == "right" ) // Left and right, no problem - return qMakePair( 1, oowrap ); + return tqMakePair( 1, oowrap ); if ( oowrap == "run-through" ) - return qMakePair( 0, QString::null ); + return tqMakePair( 0, TQString() ); if ( oowrap == "biggest" ) // OASIS extension - return qMakePair( 1, QString::fromLatin1( "biggest" ) ); + return tqMakePair( 1, TQString::tqfromLatin1( "biggest" ) ); ////if ( oowrap == "parallel" || oowrap == "dynamic" ) // dynamic is called "optimal" in the OO GUI. It's different from biggest because it can lead to parallel. // Those are not supported in KWord, let's use biggest instead - return qMakePair( 1, QString::fromLatin1( "biggest" ) ); + return tqMakePair( 1, TQString::tqfromLatin1( "biggest" ) ); } -QString Conversion::exportWrapping( const QPair<int,QString>& runAroundAttribs ) +TQString Conversion::exportWrapping( const TQPair<int,TQString>& runAroundAttribs ) { switch( runAroundAttribs.first ) { case 0: @@ -60,7 +60,7 @@ QString Conversion::exportWrapping( const QPair<int,QString>& runAroundAttribs ) } } -int Conversion::importOverflowBehavior( const QString& oasisOverflowBehavior ) +int Conversion::importOverflowBehavior( const TQString& oasisOverflowBehavior ) { if ( oasisOverflowBehavior == "auto-extend-frame" ) return 0; // AutoExtendFrame @@ -72,7 +72,7 @@ int Conversion::importOverflowBehavior( const QString& oasisOverflowBehavior ) return 0; } -QString Conversion::exportOverflowBehavior( const QString& kwordAutoCreateNewFrame ) +TQString Conversion::exportOverflowBehavior( const TQString& kwordAutoCreateNewFrame ) { switch ( kwordAutoCreateNewFrame.toInt() ) { case 1: @@ -85,7 +85,7 @@ QString Conversion::exportOverflowBehavior( const QString& kwordAutoCreateNewFra } } -int Conversion::importCounterType( const QString& numFormat ) +int Conversion::importCounterType( const TQString& numFormat ) { if ( numFormat == "1" ) return 1; @@ -100,7 +100,7 @@ int Conversion::importCounterType( const QString& numFormat ) return 0; } -QString Conversion::headerTypeToFramesetName( const QString& localName, bool hasEvenOdd ) +TQString Conversion::headerTypeToFramesetName( const TQString& localName, bool hasEvenOdd ) { if ( localName == "header" ) return hasEvenOdd ? i18n("Odd Pages Header") : i18n( "Header" ); @@ -114,10 +114,10 @@ QString Conversion::headerTypeToFramesetName( const QString& localName, bool has // ###### //return i18n("First Page Header"); //return i18n("First Page Footer"); - return QString::null; + return TQString(); } -int Conversion::headerTypeToFrameInfo( const QString& localName, bool /*hasEvenOdd*/ ) +int Conversion::headerTypeToFrameInfo( const TQString& localName, bool /*hasEvenOdd*/ ) { if ( localName == "header" ) return 3; // odd headers diff --git a/filters/kword/oowriter/conversion.h b/filters/kword/oowriter/conversion.h index 1aa21489..d9388268 100644 --- a/filters/kword/oowriter/conversion.h +++ b/filters/kword/oowriter/conversion.h @@ -20,8 +20,8 @@ #ifndef CONVERSION_H #define CONVERSION_H -#include <qstring.h> -#include <qpair.h> +#include <tqstring.h> +#include <tqpair.h> // Static methods for simple OO<->KWord conversions // (enums etc.) @@ -32,25 +32,25 @@ namespace Conversion { - // Convert paragraph alignment value - QString importAlignment( const QString& ); - QString exportAlignment( const QString& ); + // Convert paragraph tqalignment value + TQString importAlignment( const TQString& ); + TQString exportAlignment( const TQString& ); // Convert frame wrapping (run-around) - // KWord-1.3 knows runaround(int) and runaroundSide(QString) - QPair<int,QString> importWrapping( const QString& ); - QString exportWrapping( const QPair<int,QString>& runAroundAttribs ); + // KWord-1.3 knows runaround(int) and runaroundSide(TQString) + TQPair<int,TQString> importWrapping( const TQString& ); + TQString exportWrapping( const TQPair<int,TQString>& runAroundAttribs ); // Convert overflow behavior ("what to do if the text is bigger than the frame") - int importOverflowBehavior( const QString& oasisOverflowBehavior ); - QString exportOverflowBehavior( const QString& kwordAutoCreateNewFrame ); + int importOverflowBehavior( const TQString& oasisOverflowBehavior ); + TQString exportOverflowBehavior( const TQString& kwordAutoCreateNewFrame ); // Convert numbering format (for a list) to a kword counter type - int importCounterType( const QString& numFormat ); + int importCounterType( const TQString& numFormat ); // Header-footer helpers - QString headerTypeToFramesetName( const QString& tagName, bool hasEvenOdd ); - int headerTypeToFrameInfo( const QString& tagName, bool hasEvenOdd ); + TQString headerTypeToFramesetName( const TQString& tagName, bool hasEvenOdd ); + int headerTypeToFrameInfo( const TQString& tagName, bool hasEvenOdd ); } #endif diff --git a/filters/kword/oowriter/oowriterexport.cc b/filters/kword/oowriter/oowriterexport.cc index 8e55e33d..15647164 100644 --- a/filters/kword/oowriter/oowriterexport.cc +++ b/filters/kword/oowriter/oowriterexport.cc @@ -48,11 +48,11 @@ public: K_EXPORT_COMPONENT_FACTORY( liboowriterexport, OOWRITERExportFactory() ) -OOWRITERExport::OOWRITERExport(KoFilter */*parent*/, const char */*name*/, const QStringList &) : +OOWRITERExport::OOWRITERExport(KoFilter */*tqparent*/, const char */*name*/, const TQStringList &) : KoFilter() { } -KoFilter::ConversionStatus OOWRITERExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus OOWRITERExport::convert( const TQCString& from, const TQCString& to ) { if ( to != "application/vnd.sun.xml.writer" || from != "application/x-kword" ) { @@ -79,7 +79,7 @@ KoFilter::ConversionStatus OOWRITERExport::convert( const QCString& from, const return KoFilter::StupidError; } - KoFilter::ConversionStatus result=leader->convert(m_chain,from,to); + KoFilter::ConversiontqStatus result=leader->convert(m_chain,from,to); delete leader; delete worker; diff --git a/filters/kword/oowriter/oowriterexport.h b/filters/kword/oowriter/oowriterexport.h index d4475337..3a4e77ff 100644 --- a/filters/kword/oowriter/oowriterexport.h +++ b/filters/kword/oowriter/oowriterexport.h @@ -32,8 +32,8 @@ #ifndef OOWRITEREXPORT_H #define OOWRITEREXPORT_H -#include <qstring.h> -#include <qcstring.h> +#include <tqstring.h> +#include <tqcstring.h> #include <KoFilter.h> @@ -41,11 +41,12 @@ class OOWRITERExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - OOWRITERExport(KoFilter *parent, const char *name, const QStringList &); + OOWRITERExport(KoFilter *tqparent, const char *name, const TQStringList &); virtual ~OOWRITERExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // OOWRITEREXPORT_H diff --git a/filters/kword/oowriter/oowriterimport.cc b/filters/kword/oowriter/oowriterimport.cc index 46623551..fa831de2 100644 --- a/filters/kword/oowriter/oowriterimport.cc +++ b/filters/kword/oowriter/oowriterimport.cc @@ -19,12 +19,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qcolor.h> -#include <qfile.h> -#include <qfont.h> -#include <qpen.h> -#include <qregexp.h> -#include <qimage.h> +#include <tqcolor.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqpen.h> +#include <tqregexp.h> +#include <tqimage.h> #include "oowriterimport.h" #include <ooutils.h> @@ -53,7 +53,7 @@ typedef KGenericFactory<OoWriterImport, KoFilter> OoWriterImportFactory; K_EXPORT_COMPONENT_FACTORY( liboowriterimport, OoWriterImportFactory( "kofficefilters" ) ) -OoWriterImport::OoWriterImport( KoFilter *, const char *, const QStringList & ) +OoWriterImport::OoWriterImport( KoFilter *, const char *, const TQStringList & ) : KoFilter(), m_styleStack( ooNS::style, ooNS::fo ), m_insideOrderedList( false ), m_nextItemIsListItem( false ), @@ -69,7 +69,7 @@ OoWriterImport::~OoWriterImport() { } -KoFilter::ConversionStatus OoWriterImport::convert( QCString const & from, QCString const & to ) +KoFilter::ConversiontqStatus OoWriterImport::convert( TQCString const & from, TQCString const & to ) { kdDebug(30518) << "Entering Oowriter Import filter: " << from << " - " << to << endl; @@ -99,25 +99,25 @@ KoFilter::ConversionStatus OoWriterImport::convert( QCString const & from, QCStr } - KoFilter::ConversionStatus preStatus = openFile(); + KoFilter::ConversiontqStatus pretqStatus = openFile(); - QImage thumbnail; - if ( preStatus == KoFilter::OK ) + TQImage thumbnail; + if ( pretqStatus == KoFilter::OK ) { // We do not care about the failure OoUtils::loadThumbnail( thumbnail, m_zip ); } - if ( preStatus != KoFilter::OK ) + if ( pretqStatus != KoFilter::OK ) { m_zip->close(); delete m_zip; - return preStatus; + return pretqStatus; } - m_currentMasterPage = QString::null; - QDomDocument mainDocument; - QDomElement framesetsElem; + m_currentMasterPage = TQString(); + TQDomDocument mainDocument; + TQDomElement framesetsElem; prepareDocument( mainDocument, framesetsElem ); // Load styles from style.xml @@ -128,7 +128,7 @@ KoFilter::ConversionStatus OoWriterImport::convert( QCString const & from, QCStr return KoFilter::UserCancelled; // Create main frameset - QDomElement mainFramesetElement = mainDocument.createElement("FRAMESET"); + TQDomElement mainFramesetElement = mainDocument.createElement("FRAMESET"); mainFramesetElement.setAttribute("frameType",1); mainFramesetElement.setAttribute("frameInfo",0); mainFramesetElement.setAttribute("visible",1); @@ -150,22 +150,22 @@ KoFilter::ConversionStatus OoWriterImport::convert( QCString const & from, QCStr } else { - QCString cstr = mainDocument.toCString(); + TQCString cstr = mainDocument.toCString(); kdDebug(30518)<<" maindoc: " << cstr << endl; - // WARNING: we cannot use KoStore::write(const QByteArray&) because it gives an extra NULL character at the end. + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it gives an extra NULL character at the end. out->writeBlock( cstr, cstr.length() ); } - QDomDocument docinfo; + TQDomDocument docinfo; createDocumentInfo( docinfo ); // store document info out = m_chain->storageFile( "documentinfo.xml", KoStore::Write ); if( out ) { - QCString info = docinfo.toCString(); + TQCString info = docinfo.toCString(); kdDebug(30518)<<" info :"<<info<<endl; - // WARNING: we cannot use KoStore::write(const QByteArray&) because it gives an extra NULL character at the end. + // WARNING: we cannot use KoStore::write(const TQByteArray&) because it gives an extra NULL character at the end. out->writeBlock( info , info.length() ); } @@ -175,7 +175,7 @@ KoFilter::ConversionStatus OoWriterImport::convert( QCString const & from, QCStr { // ### TODO: thumbnail.setAlphaBuffer( false ); // legacy KOffice previews have no alpha channel // Legacy KOffice previews are 256x256x8 instead of 128x128x32 - QImage preview( thumbnail.smoothScale( 256, 256 ).convertDepth(8, Qt::AvoidDither | Qt::DiffuseDither) ); + TQImage preview( thumbnail.smoothScale( 256, 256 ).convertDepth(8, Qt::AvoidDither | Qt::DiffuseDither) ); // Not to be able to generate a preview is not an error if ( !preview.isNull() ) { @@ -191,40 +191,40 @@ KoFilter::ConversionStatus OoWriterImport::convert( QCString const & from, QCStr return KoFilter::OK; } -void OoWriterImport::createStyles( QDomDocument& doc ) +void OoWriterImport::createStyles( TQDomDocument& doc ) { - QDomElement stylesElem = doc.createElement( "STYLES" ); + TQDomElement stylesElem = doc.createElement( "STYLES" ); doc.documentElement().appendChild( stylesElem ); - QDomNode fixedStyles = KoDom::namedItemNS( m_stylesDoc.documentElement(), ooNS::office, "styles" ); + TQDomNode fixedStyles = KoDom::namedItemNS( m_stylesDoc.documentElement(), ooNS::office, "styles" ); Q_ASSERT( !fixedStyles.isNull() ); - QDomElement e; + TQDomElement e; forEachElement( e, fixedStyles ) { if ( !e.hasAttributeNS( ooNS::style, "name" ) ) continue; // We only generate paragraph styles for now - if ( e.attributeNS( ooNS::style, "family", QString::null ) != "paragraph" ) + if ( e.attributeNS( ooNS::style, "family", TQString() ) != "paragraph" ) continue; - // We use the style stack, to flatten out parent styles + // We use the style stack, to flatten out tqparent styles // Once KWord supports style inheritance, replace this with a single m_styleStack.push. // (We still need to use StyleStack, since that's what writeLayout/writeFormat read from) addStyles( &e ); - QDomElement styleElem = doc.createElement("STYLE"); + TQDomElement styleElem = doc.createElement("STYLE"); stylesElem.appendChild( styleElem ); - QString styleName = kWordStyleName( e.attributeNS( ooNS::style, "name", QString::null ) ); - QDomElement element = doc.createElement("NAME"); + TQString styleName = kWordStyleName( e.attributeNS( ooNS::style, "name", TQString() ) ); + TQDomElement element = doc.createElement("NAME"); element.setAttribute( "value", styleName ); styleElem.appendChild( element ); //kdDebug(30518) << k_funcinfo << "generating style " << styleName << endl; - QString followingStyle = m_styleStack.attributeNS( ooNS::style, "next-style-name" ); + TQString followingStyle = m_styleStack.attributeNS( ooNS::style, "next-style-name" ); if ( !followingStyle.isEmpty() ) { - QDomElement element = doc.createElement( "FOLLOWING" ); + TQDomElement element = doc.createElement( "FOLLOWING" ); element.setAttribute( "name", kWordStyleName( followingStyle ) ); styleElem.appendChild( element ); } @@ -248,14 +248,14 @@ void OoWriterImport::createStyles( QDomDocument& doc ) if ( outline ) listOK = pushListLevelStyle( "<outline-style>", m_outlineStyle, level ); else { - const QString listStyleName = e.attributeNS( ooNS::style, "list-style-name", QString::null ); + const TQString listStyleName = e.attributeNS( ooNS::style, "list-style-name", TQString() ); listOK = !listStyleName.isEmpty(); if ( listOK ) listOK = pushListLevelStyle( listStyleName, level ); } } if ( listOK ) { - const QDomElement listStyle = m_listStyleStack.currentListStyle(); + const TQDomElement listStyle = m_listStyleStack.currentListStyle(); // The tag is either text:list-level-style-number or text:list-level-style-bullet bool ordered = listStyle.localName() == "list-level-style-number"; writeCounter( doc, styleElem, outline, level, ordered ); @@ -266,20 +266,20 @@ void OoWriterImport::createStyles( QDomDocument& doc ) } } -void OoWriterImport::parseBodyOrSimilar( QDomDocument &doc, const QDomElement& parent, QDomElement& currentFramesetElement ) +void OoWriterImport::parseBodyOrSimilar( TQDomDocument &doc, const TQDomElement& tqparent, TQDomElement& currentFramesetElement ) { - QDomElement oldCurrentFrameset = m_currentFrameset; + TQDomElement oldCurrentFrameset = m_currentFrameset; m_currentFrameset = currentFramesetElement; Q_ASSERT( !m_currentFrameset.isNull() ); - QDomElement t; - forEachElement( t, parent ) + TQDomElement t; + forEachElement( t, tqparent ) { m_styleStack.save(); - const QString localName = t.localName(); - const QString ns = t.namespaceURI(); + const TQString localName = t.localName(); + const TQString ns = t.namespaceURI(); const bool isTextNS = ns == ooNS::text; - QDomElement e; + TQDomElement e; if ( isTextNS && localName == "p" ) { // text paragraph fillStyleStack( t, ooNS::text, "style-name" ); e = parseParagraph( doc, t ); @@ -287,7 +287,7 @@ void OoWriterImport::parseBodyOrSimilar( QDomDocument &doc, const QDomElement& p else if ( isTextNS && localName == "h" ) // heading { fillStyleStack( t, ooNS::text, "style-name" ); - int level = t.attributeNS( ooNS::text, "level", QString::null ).toInt(); + int level = t.attributeNS( ooNS::text, "level", TQString() ).toInt(); bool listOK = false; // When a heading is inside a list, it seems that the list prevails. // Example: @@ -302,7 +302,7 @@ void OoWriterImport::parseBodyOrSimilar( QDomDocument &doc, const QDomElement& p m_nextItemIsListItem = true; if ( t.hasAttributeNS( ooNS::text, "start-value" ) ) // OASIS extension http://lists.oasis-open.org/archives/office/200310/msg00033.html - m_restartNumbering = t.attributeNS( ooNS::text, "start-value", QString::null ).toInt(); + m_restartNumbering = t.attributeNS( ooNS::text, "start-value", TQString() ).toInt(); e = parseParagraph( doc, t ); if ( listOK ) m_listStyleStack.pop(); @@ -355,11 +355,11 @@ void OoWriterImport::parseBodyOrSimilar( QDomDocument &doc, const QDomElement& p m_currentFrameset = oldCurrentFrameset; // in case of recursive invokations } -void OoWriterImport::createDocumentContent( QDomDocument &doc, QDomElement& mainFramesetElement ) +void OoWriterImport::createDocumentContent( TQDomDocument &doc, TQDomElement& mainFramesetElement ) { - QDomElement content = m_content.documentElement(); + TQDomElement content = m_content.documentElement(); - QDomElement body ( KoDom::namedItemNS( content, ooNS::office, "body" ) ); + TQDomElement body ( KoDom::namedItemNS( content, ooNS::office, "body" ) ); if ( body.isNull() ) { kdError(30518) << "No office:body found!" << endl; @@ -369,12 +369,12 @@ void OoWriterImport::createDocumentContent( QDomDocument &doc, QDomElement& main parseBodyOrSimilar( doc, body, mainFramesetElement ); } -void OoWriterImport::writePageLayout( QDomDocument& mainDocument, const QString& masterPageName ) +void OoWriterImport::writePageLayout( TQDomDocument& mainDocument, const TQString& masterPageName ) { - QDomElement docElement = mainDocument.documentElement(); + TQDomElement docElement = mainDocument.documentElement(); kdDebug(30518) << "writePageLayout " << masterPageName << endl; - QDomElement elementPaper = mainDocument.createElement("PAPER"); + TQDomElement elementPaper = mainDocument.createElement("PAPER"); KoOrientation orientation; double width, height; KoFormat paperFormat; @@ -382,18 +382,18 @@ void OoWriterImport::writePageLayout( QDomDocument& mainDocument, const QString& bool hasEvenOddHeader = false; bool hasEvenOddFooter = false; - QDomElement* masterPage = m_masterPages[ masterPageName ]; + TQDomElement* masterPage = m_masterPages[ masterPageName ]; Q_ASSERT( masterPage ); - kdDebug(30518) << "page-master-name: " << masterPage->attributeNS( ooNS::style, "page-master-name", QString::null ) << endl; - QDomElement *style = masterPage ? m_styles[masterPage->attributeNS( ooNS::style, "page-master-name", QString::null )] : 0; + kdDebug(30518) << "page-master-name: " << masterPage->attributeNS( ooNS::style, "page-master-name", TQString() ) << endl; + TQDomElement *style = masterPage ? m_styles[masterPage->attributeNS( ooNS::style, "page-master-name", TQString() )] : 0; Q_ASSERT( style ); if ( style ) { - QDomElement properties( KoDom::namedItemNS( *style, ooNS::style, "properties" ) ); + TQDomElement properties( KoDom::namedItemNS( *style, ooNS::style, "properties" ) ); Q_ASSERT( !properties.isNull() ); - orientation = ( (properties.attributeNS( ooNS::style, "print-orientation", QString::null) != "portrait") ? PG_LANDSCAPE : PG_PORTRAIT ); - width = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-width", QString::null)); - height = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-height", QString::null)); + orientation = ( (properties.attributeNS( ooNS::style, "print-orientation", TQString()) != "portrait") ? PG_LANDSCAPE : PG_PORTRAIT ); + width = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-width", TQString())); + height = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "page-height", TQString())); kdDebug(30518) << "width=" << width << " height=" << height << endl; // guessFormat takes millimeters if ( orientation == PG_LANDSCAPE ) @@ -401,49 +401,49 @@ void OoWriterImport::writePageLayout( QDomDocument& mainDocument, const QString& else paperFormat = KoPageFormat::guessFormat( POINT_TO_MM(width), POINT_TO_MM(height) ); - marginLeft = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-left", QString::null)); - marginTop = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-top", QString::null)); - marginRight = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-right", QString::null)); - marginBottom = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-bottom", QString::null)); + marginLeft = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-left", TQString())); + marginTop = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-top", TQString())); + marginRight = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-right", TQString())); + marginBottom = KoUnit::parseValue(properties.attributeNS( ooNS::fo, "margin-bottom", TQString())); - QDomElement footnoteSep = KoDom::namedItemNS( properties, ooNS::style, "footnote-sep" ); + TQDomElement footnoteSep = KoDom::namedItemNS( properties, ooNS::style, "footnote-sep" ); if ( !footnoteSep.isNull() ) { // style:width="0.018cm" style:distance-before-sep="0.101cm" // style:distance-after-sep="0.101cm" style:adjustment="left" // style:rel-width="25%" style:color="#000000" - QString width = footnoteSep.attributeNS( ooNS::style, "width", QString::null ); + TQString width = footnoteSep.attributeNS( ooNS::style, "width", TQString() ); elementPaper.setAttribute( "slFootNoteWidth", KoUnit::parseValue( width ) ); - QString pageWidth = footnoteSep.attributeNS( ooNS::style, "rel-width", QString::null ); + TQString pageWidth = footnoteSep.attributeNS( ooNS::style, "rel-width", TQString() ); if ( pageWidth.endsWith( "%" ) ) { pageWidth.truncate( pageWidth.length() - 1 ); // remove '%' elementPaper.setAttribute( "slFootNoteLenth", pageWidth ); } - elementPaper.setAttribute( "slFootNotePosition", footnoteSep.attributeNS( ooNS::style, "adjustment", QString::null ) ); + elementPaper.setAttribute( "slFootNotePosition", footnoteSep.attributeNS( ooNS::style, "adjustment", TQString() ) ); // Not in KWord: color, distance before and after separator // Not in OOo: line type of separator (solid, dot, dash etc.) } // Header/Footer - QDomElement headerStyle = KoDom::namedItemNS( *style, ooNS::style, "header-style" ); - QDomElement footerStyle = KoDom::namedItemNS( *style, ooNS::style, "footer-style" ); - QDomElement headerLeftElem = KoDom::namedItemNS( *masterPage, ooNS::style, "header-left" ); + TQDomElement headerStyle = KoDom::namedItemNS( *style, ooNS::style, "header-style" ); + TQDomElement footerStyle = KoDom::namedItemNS( *style, ooNS::style, "footer-style" ); + TQDomElement headerLeftElem = KoDom::namedItemNS( *masterPage, ooNS::style, "header-left" ); if ( !headerLeftElem.isNull() ) { kdDebug(30518) << "Found header-left" << endl; hasEvenOddHeader = true; importHeaderFooter( mainDocument, headerLeftElem, hasEvenOddHeader, headerStyle ); } - QDomElement headerElem = KoDom::namedItemNS( *masterPage, ooNS::style, "header" ); + TQDomElement headerElem = KoDom::namedItemNS( *masterPage, ooNS::style, "header" ); if ( !headerElem.isNull() ) { kdDebug(30518) << "Found header" << endl; importHeaderFooter( mainDocument, headerElem, hasEvenOddHeader, headerStyle ); } - QDomElement footerLeftElem = KoDom::namedItemNS( *masterPage, ooNS::style, "footer-left" ); + TQDomElement footerLeftElem = KoDom::namedItemNS( *masterPage, ooNS::style, "footer-left" ); if ( !footerLeftElem.isNull() ) { kdDebug(30518) << "Found footer-left" << endl; importHeaderFooter( mainDocument, footerLeftElem, hasEvenOddFooter, footerStyle ); } - QDomElement footerElem = KoDom::namedItemNS( *masterPage, ooNS::style, "footer" ); + TQDomElement footerElem = KoDom::namedItemNS( *masterPage, ooNS::style, "footer" ); if ( !footerElem.isNull() ) { kdDebug(30518) << "Found footer" << endl; importHeaderFooter( mainDocument, footerElem, hasEvenOddFooter, footerStyle ); @@ -478,7 +478,7 @@ void OoWriterImport::writePageLayout( QDomDocument& mainDocument, const QString& docElement.appendChild(elementPaper); // Page margins - QDomElement element = mainDocument.createElement("PAPERBORDERS"); + TQDomElement element = mainDocument.createElement("PAPERBORDERS"); element.setAttribute("left", marginLeft); element.setAttribute("top", marginTop); element.setAttribute("right", marginRight); @@ -486,10 +486,10 @@ void OoWriterImport::writePageLayout( QDomDocument& mainDocument, const QString& elementPaper.appendChild(element); } -void OoWriterImport::prepareDocument( QDomDocument& mainDocument, QDomElement& framesetsElem ) +void OoWriterImport::prepareDocument( TQDomDocument& mainDocument, TQDomElement& framesetsElem ) { mainDocument = KoDocument::createDomDocument( "kword", "DOC", "1.2" ); - QDomElement docElement = mainDocument.documentElement(); + TQDomElement docElement = mainDocument.documentElement(); docElement.setAttribute( "editor", "KWord's OOWriter Import Filter" ); docElement.setAttribute( "mime", "application/x-kword" ); docElement.setAttribute( "syntaxVersion", "2" ); @@ -498,12 +498,12 @@ void OoWriterImport::prepareDocument( QDomDocument& mainDocument, QDomElement& f docElement.appendChild(framesetsElem); // Now create VARIABLESETTINGS, mostly from meta.xml - QDomElement varSettings = mainDocument.createElement( "VARIABLESETTINGS" ); + TQDomElement varSettings = mainDocument.createElement( "VARIABLESETTINGS" ); docElement.appendChild( varSettings ); - QDomNode meta = KoDom::namedItemNS( m_meta, ooNS::office, "document-meta" ); - QDomNode office = KoDom::namedItemNS( meta, ooNS::office, "meta" ); + TQDomNode meta = KoDom::namedItemNS( m_meta, ooNS::office, "document-meta" ); + TQDomNode office = KoDom::namedItemNS( meta, ooNS::office, "meta" ); if ( !office.isNull() ) { - QDomElement date = KoDom::namedItemNS( office, ooNS::dc, "date" ); + TQDomElement date = KoDom::namedItemNS( office, ooNS::dc, "date" ); if ( !date.isNull() && !date.text().isEmpty() ) { // Both use ISO-8601, no conversion needed. varSettings.setAttribute( "modificationDate", date.text() ); @@ -520,9 +520,9 @@ void OoWriterImport::prepareDocument( QDomDocument& mainDocument, QDomElement& f } // Copied from the msword importer -QDomElement OoWriterImport::createInitialFrame( QDomElement& parentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ) +TQDomElement OoWriterImport::createInitialFrame( TQDomElement& tqparentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ) { - QDomElement frameElementOut = parentFramesetElem.ownerDocument().createElement("FRAME"); + TQDomElement frameElementOut = tqparentFramesetElem.ownerDocument().createElement("FRAME"); frameElementOut.setAttribute( "left", left ); frameElementOut.setAttribute( "right", right ); frameElementOut.setAttribute( "top", top ); @@ -531,18 +531,18 @@ QDomElement OoWriterImport::createInitialFrame( QDomElement& parentFramesetElem, // AutoExtendFrame for header/footer/footnote/endnote, AutoCreateNewFrame for body text frameElementOut.setAttribute( "autoCreateNewFrame", autoExtend ? 0 : 1 ); frameElementOut.setAttribute( "newFrameBehavior", nfb ); - parentFramesetElem.appendChild( frameElementOut ); + tqparentFramesetElem.appendChild( frameElementOut ); return frameElementOut; } -KoFilter::ConversionStatus OoWriterImport::loadAndParse(const QString& filename, QDomDocument& doc) +KoFilter::ConversiontqStatus OoWriterImport::loadAndParse(const TQString& filename, TQDomDocument& doc) { return OoUtils::loadAndParse( filename, doc, m_zip); } -KoFilter::ConversionStatus OoWriterImport::openFile() +KoFilter::ConversiontqStatus OoWriterImport::openFile() { - KoFilter::ConversionStatus status=loadAndParse("content.xml", m_content); + KoFilter::ConversiontqStatus status=loadAndParse("content.xml", m_content); if ( status != KoFilter::OK ) { kdError(30518) << "Content.xml could not be parsed correctly! Aborting!" << endl; @@ -551,12 +551,12 @@ KoFilter::ConversionStatus OoWriterImport::openFile() //kdDebug(30518)<<" m_content.toCString() :"<<m_content.toCString()<<endl; - // We need to keep the QDomDocument for styles too, unfortunately. - // Otherwise styleElement.parentNode() returns a null node + // We need to keep the TQDomDocument for styles too, unfortunately. + // Otherwise styleElement.tqparentNode() returns a null node // (see StyleStack::isUserStyle). Most of styles.xml is in m_styles // anyway, so this doesn't make a big difference. // We now also rely on this in createStyles. - //QDomDocument styles; + //TQDomDocument styles; // We do not stop if the following calls fail. loadAndParse("styles.xml", m_stylesDoc); @@ -569,7 +569,7 @@ KoFilter::ConversionStatus OoWriterImport::openFile() } // Very related to OoImpressImport::createDocumentInfo -void OoWriterImport::createDocumentInfo( QDomDocument &docinfo ) +void OoWriterImport::createDocumentInfo( TQDomDocument &docinfo ) { docinfo = KoDocument::createDomDocument( "document-info" /*DTD name*/, "document-info" /*tag name*/, "1.1" ); @@ -580,30 +580,30 @@ void OoWriterImport::createDocumentInfo( QDomDocument &docinfo ) // This mainly fills member variables with the styles. // The 'doc' argument is only for footnotes-configuration. -bool OoWriterImport::createStyleMap( const QDomDocument & styles, QDomDocument& doc ) +bool OoWriterImport::createStyleMap( const TQDomDocument & styles, TQDomDocument& doc ) { - QDomElement docElement = styles.documentElement(); - QDomNode docStyles = KoDom::namedItemNS( docElement, ooNS::office, "document-styles" ); + TQDomElement docElement = styles.documentElement(); + TQDomNode docStyles = KoDom::namedItemNS( docElement, ooNS::office, "document-styles" ); if ( docElement.hasAttributeNS( ooNS::office, "version" ) ) { bool ok = true; - double d = docElement.attributeNS( ooNS::office, "version", QString::null ).toDouble( &ok ); + double d = docElement.attributeNS( ooNS::office, "version", TQString() ).toDouble( &ok ); if ( ok ) { kdDebug(30518) << "OpenWriter version: " << d << endl; if ( d > 1.0 ) { - QString message( i18n("This document was created with OpenOffice.org version '%1'. This filter was written for version 1.0. Reading this file could cause strange behavior, crashes or incorrect display of the data. Do you want to continue converting the document?") ); - message = message.arg( docElement.attributeNS( ooNS::office, "version", QString::null ) ); + TQString message( i18n("This document was created with OpenOffice.org version '%1'. This filter was written for version 1.0. Reading this file could cause strange behavior, crashes or incorrect display of the data. Do you want to continue converting the document?") ); + message = message.tqarg( docElement.attributeNS( ooNS::office, "version", TQString() ) ); if ( KMessageBox::warningYesNo( 0, message, i18n( "Unsupported document version" ) ) == KMessageBox::No ) return false; } } } - QDomNode fontStyles = KoDom::namedItemNS( docElement, ooNS::office, "font-decls" ); + TQDomNode fontStyles = KoDom::namedItemNS( docElement, ooNS::office, "font-decls" ); if ( !fontStyles.isNull() ) { @@ -616,7 +616,7 @@ bool OoWriterImport::createStyleMap( const QDomDocument & styles, QDomDocument& kdDebug(30518) << "Starting reading in office:automatic-styles" << endl; - QDomNode autoStyles = KoDom::namedItemNS( docElement, ooNS::office, "automatic-styles" ); + TQDomNode autoStyles = KoDom::namedItemNS( docElement, ooNS::office, "automatic-styles" ); if ( !autoStyles.isNull() ) { insertStyles( autoStyles.toElement(), doc ); @@ -627,19 +627,19 @@ bool OoWriterImport::createStyleMap( const QDomDocument & styles, QDomDocument& kdDebug(30518) << "Reading in master styles" << endl; - QDomNode masterStyles = KoDom::namedItemNS( docElement, ooNS::office, "master-styles" ); + TQDomNode masterStyles = KoDom::namedItemNS( docElement, ooNS::office, "master-styles" ); if ( !masterStyles.isNull() ) { - QDomElement master; + TQDomElement master; forEachElement( master, masterStyles ) { if ( master.localName() == "master-page" && master.namespaceURI() == ooNS::style ) { - QString name = master.attributeNS( ooNS::style, "name", QString::null ); + TQString name = master.attributeNS( ooNS::style, "name", TQString() ); kdDebug(30518) << "Master style: '" << name << "' loaded " << endl; - m_masterPages.insert( name, new QDomElement( master ) ); + m_masterPages.insert( name, new TQDomElement( master ) ); } else kdWarning(30518) << "Unknown tag " << master.tagName() << " in office:master-styles" << endl; } @@ -648,7 +648,7 @@ bool OoWriterImport::createStyleMap( const QDomDocument & styles, QDomDocument& kdDebug(30518) << "Starting reading in office:styles" << endl; - QDomNode fixedStyles = KoDom::namedItemNS( docElement, ooNS::office, "styles" ); + TQDomNode fixedStyles = KoDom::namedItemNS( docElement, ooNS::office, "styles" ); if ( !fixedStyles.isNull() ) insertStyles( fixedStyles.toElement(), doc ); @@ -659,28 +659,28 @@ bool OoWriterImport::createStyleMap( const QDomDocument & styles, QDomDocument& } // started as a copy of OoImpressImport::insertStyles -void OoWriterImport::insertStyles( const QDomElement& styles, QDomDocument& doc ) +void OoWriterImport::insertStyles( const TQDomElement& styles, TQDomDocument& doc ) { //kdDebug(30518) << "Inserting styles from " << styles.tagName() << endl; - QDomElement e; + TQDomElement e; forEachElement( e, styles ) { - const QString localName = e.localName(); - const QString ns = e.namespaceURI(); + const TQString localName = e.localName(); + const TQString ns = e.namespaceURI(); - const QString name = e.attributeNS( ooNS::style, "name", QString::null ); + const TQString name = e.attributeNS( ooNS::style, "name", TQString() ); if ( ns == ooNS::style && ( localName == "style" || localName == "page-master" || localName == "font-decl" ) ) { - QDomElement* ep = new QDomElement( e ); + TQDomElement* ep = new TQDomElement( e ); m_styles.insert( name, ep ); kdDebug(30518) << "Style: '" << name << "' loaded " << endl; } else if ( localName == "default-style" && ns == ooNS::style ) { m_defaultStyle = e; } else if ( localName == "list-style" && ns == ooNS::text ) { - QDomElement* ep = new QDomElement( e ); + TQDomElement* ep = new TQDomElement( e ); m_listStyles.insert( name, ep ); kdDebug(30518) << "List style: '" << name << "' loaded " << endl; } else if ( localName == "outline-style" && ns == ooNS::text ) { @@ -703,20 +703,20 @@ void OoWriterImport::insertStyles( const QDomElement& styles, QDomDocument& doc } -// OO spec 2.5.4. p68. Conversion to Qt format: see qdate.html +// OO spec 2.5.4. p68. Conversion to TQt format: see qdate.html // OpenCalcImport::loadFormat has similar code, but slower, intermixed with other stuff, // lacking long-textual forms. -void OoWriterImport::importDateTimeStyle( const QDomElement& parent ) +void OoWriterImport::importDateTimeStyle( const TQDomElement& tqparent ) { - QString format; - QDomElement e; - forEachElement( e, parent ) + TQString format; + TQDomElement e; + forEachElement( e, tqparent ) { - const QString ns = e.namespaceURI(); + const TQString ns = e.namespaceURI(); if ( ns != ooNS::number ) continue; - const QString localName = e.localName(); - const QString numberStyle = e.attributeNS( ooNS::number, "style", QString::null ); + const TQString localName = e.localName(); + const TQString numberStyle = e.attributeNS( ooNS::number, "style", TQString() ); const bool shortForm = numberStyle == "short" || numberStyle.isEmpty(); if ( localName == "day" ) { format += shortForm ? "d" : "dd"; @@ -724,7 +724,7 @@ void OoWriterImport::importDateTimeStyle( const QDomElement& parent ) format += shortForm ? "ddd" : "dddd"; } else if ( localName == "month" ) { // TODO the spec has a strange mention of number:format-source - if ( e.attributeNS( ooNS::number, "textual", QString::null ) == "true" ) { + if ( e.attributeNS( ooNS::number, "textual", TQString() ) == "true" ) { format += shortForm ? "MMM" : "MMMM"; } else { // month number format += shortForm ? "M" : "MM"; @@ -732,7 +732,7 @@ void OoWriterImport::importDateTimeStyle( const QDomElement& parent ) } else if ( localName == "year" ) { format += shortForm ? "yy" : "yyyy"; } else if ( localName == "week-of-year" || localName == "quarter") { - // ### not supported in Qt + // ### not supported in TQt } else if ( localName == "hours" ) { format += shortForm ? "h" : "hh"; } else if ( localName == "minutes" ) { @@ -747,20 +747,20 @@ void OoWriterImport::importDateTimeStyle( const QDomElement& parent ) } #if 0 - // QDate doesn't work both ways!!! It can't parse something back from + // TQDate doesn't work both ways!!! It can't parse something back from // a string and a format (e.g. 01/02/03 and dd/MM/yy, it will assume MM/dd/yy). // So we also need to generate a KLocale-like format, to parse the value // Update: we don't need to parse the date back. - QString kdeFormat; - QDomElement e; - forEachElement( e, parent ) + TQString kdeFormat; + TQDomElement e; + forEachElement( e, tqparent ) { - const QString ns = e.namespaceURI(); + const TQString ns = e.namespaceURI(); if ( ns != ooNS::number ) continue; - QString localName = e.tagName(); - const QString numberStyle = e.attributeNS( ooNS::number, "style", QString::null ); + TQString localName = e.tagName(); + const TQString numberStyle = e.attributeNS( ooNS::number, "style", TQString() ); const bool shortForm = numberStyle == "short" || numberStyle.isEmpty(); if ( localName == "day" ) { kdeFormat += shortForm ? "%e" : "%d"; @@ -768,7 +768,7 @@ void OoWriterImport::importDateTimeStyle( const QDomElement& parent ) kdeFormat += shortForm ? "%a" : "%A"; } else if ( localName == "month" ) { // TODO the spec has a strange mention of number:format-source - if ( e.attributeNS( ooNS::number, "textual", QString::null ) == "true" ) { + if ( e.attributeNS( ooNS::number, "textual", TQString() ) == "true" ) { kdeFormat += shortForm ? "%b" : "%B"; } else { // month number kdeFormat += shortForm ? "%n" : "%m"; @@ -791,18 +791,18 @@ void OoWriterImport::importDateTimeStyle( const QDomElement& parent ) } #endif - QString styleName = parent.attributeNS( ooNS::style, "name", QString::null ); + TQString styleName = tqparent.attributeNS( ooNS::style, "name", TQString() ); kdDebug(30518) << "datetime style: " << styleName << " qt format=" << format << endl; m_dateTimeFormats.insert( styleName, format ); } -void OoWriterImport::fillStyleStack( const QDomElement& object, const char* nsURI, const QString& attrName ) +void OoWriterImport::fillStyleStack( const TQDomElement& object, const char* nsURI, const TQString& attrName ) { // find all styles associated with an object and push them on the stack // OoImpressImport has more tests here, but I don't think they're relevant to OoWriterImport if ( object.hasAttributeNS( nsURI, attrName ) ) { - const QString styleName = object.attributeNS( nsURI, attrName, QString::null ); - const QDomElement* style = m_styles[styleName]; + const TQString styleName = object.attributeNS( nsURI, attrName, TQString() ); + const TQDomElement* style = m_styles[styleName]; if ( style ) addStyles( style ); else @@ -810,42 +810,42 @@ void OoWriterImport::fillStyleStack( const QDomElement& object, const char* nsUR } } -void OoWriterImport::addStyles( const QDomElement* style ) +void OoWriterImport::addStyles( const TQDomElement* style ) { Q_ASSERT( style ); if ( !style ) return; - // this recursive function is necessary as parent styles can have parents themselves - if ( style->hasAttributeNS( ooNS::style, "parent-style-name" ) ) { - const QString parentStyleName = style->attributeNS( ooNS::style, "parent-style-name", QString::null ); - QDomElement* parentStyle = m_styles[ parentStyleName ]; - if ( parentStyle ) - addStyles( parentStyle ); + // this recursive function is necessary as tqparent styles can have tqparents themselves + if ( style->hasAttributeNS( ooNS::style, "tqparent-style-name" ) ) { + const TQString tqparentStyleName = style->attributeNS( ooNS::style, "tqparent-style-name", TQString() ); + TQDomElement* tqparentStyle = m_styles[ tqparentStyleName ]; + if ( tqparentStyle ) + addStyles( tqparentStyle ); else - kdWarning(30518) << "Parent style not found: " << parentStyleName << endl; + kdWarning(30518) << "Parent style not found: " << tqparentStyleName << endl; } else if ( !m_defaultStyle.isNull() ) // on top of all, the default style m_styleStack.push( m_defaultStyle ); - //kdDebug(30518) << "pushing style " << style->attributeNS( ooNS::style, "name", QString::null ) << endl; + //kdDebug(30518) << "pushing style " << style->attributeNS( ooNS::style, "name", TQString() ) << endl; m_styleStack.push( *style ); } -void OoWriterImport::applyListStyle( QDomDocument& doc, QDomElement& layoutElement, const QDomElement& paragraph ) +void OoWriterImport::applyListStyle( TQDomDocument& doc, TQDomElement& tqlayoutElement, const TQDomElement& paragraph ) { // Spec: see 3.3.5 p137 if ( m_listStyleStack.hasListStyle() && m_nextItemIsListItem ) { bool heading = paragraph.localName() == "h"; m_nextItemIsListItem = false; - int level = heading ? paragraph.attributeNS( ooNS::text, "level", QString::null ).toInt() : m_listStyleStack.level(); - writeCounter( doc, layoutElement, heading, level, m_insideOrderedList ); + int level = heading ? paragraph.attributeNS( ooNS::text, "level", TQString() ).toInt() : m_listStyleStack.level(); + writeCounter( doc, tqlayoutElement, heading, level, m_insideOrderedList ); } } -void OoWriterImport::writeCounter( QDomDocument& doc, QDomElement& layoutElement, bool heading, int level, bool ordered ) +void OoWriterImport::writeCounter( TQDomDocument& doc, TQDomElement& tqlayoutElement, bool heading, int level, bool ordered ) { - const QDomElement listStyle = m_listStyleStack.currentListStyle(); - //const QDomElement listStyleProperties = m_listStyleStack.currentListStyleProperties(); - QDomElement counter = doc.createElement( "COUNTER" ); + const TQDomElement listStyle = m_listStyleStack.currentListStyle(); + //const TQDomElement listStyleProperties = m_listStyleStack.currentListStyleProperties(); + TQDomElement counter = doc.createElement( "COUNTER" ); counter.setAttribute( "numberingtype", heading ? 1 : 0 ); counter.setAttribute( "depth", level - 1 ); // "depth" starts at 0 @@ -853,10 +853,10 @@ void OoWriterImport::writeCounter( QDomDocument& doc, QDomElement& layoutElement // << " m_restartNumbering=" << m_restartNumbering << endl; if ( ordered || heading ) { - counter.setAttribute( "type", Conversion::importCounterType( listStyle.attributeNS( ooNS::style, "num-format", QString::null ) ) ); - counter.setAttribute( "lefttext", listStyle.attributeNS( ooNS::style, "num-prefix", QString::null ) ); - counter.setAttribute( "righttext", listStyle.attributeNS( ooNS::style, "num-suffix", QString::null ) ); - QString dl = listStyle.attributeNS( ooNS::text, "display-levels", QString::null ); + counter.setAttribute( "type", Conversion::importCounterType( listStyle.attributeNS( ooNS::style, "num-format", TQString() ) ) ); + counter.setAttribute( "lefttext", listStyle.attributeNS( ooNS::style, "num-prefix", TQString() ) ); + counter.setAttribute( "righttext", listStyle.attributeNS( ooNS::style, "num-suffix", TQString() ) ); + TQString dl = listStyle.attributeNS( ooNS::text, "display-levels", TQString() ); if ( dl.isEmpty() ) dl = "1"; counter.setAttribute( "display-levels", dl ); @@ -865,21 +865,21 @@ void OoWriterImport::writeCounter( QDomDocument& doc, QDomElement& layoutElement counter.setAttribute( "restart", "true" ); } else { // useful? - counter.setAttribute( "start", listStyle.attributeNS( ooNS::text, "start-value", QString::null ) ); + counter.setAttribute( "start", listStyle.attributeNS( ooNS::text, "start-value", TQString() ) ); } } else { // bullets, see 3.3.6 p138 counter.setAttribute( "type", 6 ); - QString bulletChar = listStyle.attributeNS( ooNS::text, "bullet-char", QString::null ); + TQString bulletChar = listStyle.attributeNS( ooNS::text, "bullet-char", TQString() ); if ( !bulletChar.isEmpty() ) { #if 0 // doesn't work well. Fonts lack those symbols! - counter.setAttribute( "bullet", bulletChar[0].unicode() ); - kdDebug(30518) << "bullet code " << bulletChar[0].unicode() << endl; - QString fontName = listStyleProperties.attributeNS( ooNS::style, "font-name", QString::null ); + counter.setAttribute( "bullet", bulletChar[0].tqunicode() ); + kdDebug(30518) << "bullet code " << bulletChar[0].tqunicode() << endl; + TQString fontName = listStyleProperties.attributeNS( ooNS::style, "font-name", TQString() ); counter.setAttribute( "bulletfont", fontName ); #endif // Reverse engineering, I found those codes: - switch( bulletChar[0].unicode() ) { + switch( bulletChar[0].tqunicode() ) { case 0x2022: // small disc counter.setAttribute( "type", 10 ); // a disc bullet break; @@ -914,23 +914,23 @@ void OoWriterImport::writeCounter( QDomDocument& doc, QDomElement& layoutElement } } - layoutElement.appendChild(counter); + tqlayoutElement.appendChild(counter); } -static QDomElement findListLevelStyle( QDomElement& fullListStyle, int level ) +static TQDomElement findListLevelStyle( TQDomElement& fullListStyle, int level ) { - QDomElement listLevelItem; + TQDomElement listLevelItem; forEachElement( listLevelItem, fullListStyle ) { - if ( listLevelItem.attributeNS( ooNS::text, "level", QString::null ).toInt() == level ) + if ( listLevelItem.attributeNS( ooNS::text, "level", TQString() ).toInt() == level ) return listLevelItem; } - return QDomElement(); + return TQDomElement(); } -bool OoWriterImport::pushListLevelStyle( const QString& listStyleName, int level ) +bool OoWriterImport::pushListLevelStyle( const TQString& listStyleName, int level ) { - QDomElement* fullListStyle = m_listStyles[listStyleName]; + TQDomElement* fullListStyle = m_listStyles[listStyleName]; if ( !fullListStyle ) { kdWarning(30518) << "List style " << listStyleName << " not found!" << endl; return false; @@ -939,12 +939,12 @@ bool OoWriterImport::pushListLevelStyle( const QString& listStyleName, int level return pushListLevelStyle( listStyleName, *fullListStyle, level ); } -bool OoWriterImport::pushListLevelStyle( const QString& listStyleName, // for debug only - QDomElement& fullListStyle, int level ) +bool OoWriterImport::pushListLevelStyle( const TQString& listStyleName, // for debug only + TQDomElement& fullListStyle, int level ) { // Find applicable list-level-style for level int i = level; - QDomElement listLevelStyle; + TQDomElement listLevelStyle; while ( i > 0 && listLevelStyle.isNull() ) { listLevelStyle = findListLevelStyle( fullListStyle, i ); --i; @@ -958,14 +958,14 @@ bool OoWriterImport::pushListLevelStyle( const QString& listStyleName, // for de return true; } -void OoWriterImport::parseList( QDomDocument& doc, const QDomElement& list, QDomElement& currentFramesetElement ) +void OoWriterImport::parseList( TQDomDocument& doc, const TQDomElement& list, TQDomElement& currentFramesetElement ) { //kdDebug(30518) << k_funcinfo << "parseList"<< endl; m_insideOrderedList = ( list.localName() == "ordered-list" ); - QString oldListStyleName = m_currentListStyleName; + TQString oldListStyleName = m_currentListStyleName; if ( list.hasAttributeNS( ooNS::text, "style-name" ) ) - m_currentListStyleName = list.attributeNS( ooNS::text, "style-name", QString::null ); + m_currentListStyleName = list.attributeNS( ooNS::text, "style-name", TQString() ); bool listOK = !m_currentListStyleName.isEmpty(); const int level = m_listStyleStack.level() + 1; //kdDebug(30518) << k_funcinfo << " listOK=" << listOK << " level=" << level << endl; @@ -973,14 +973,14 @@ void OoWriterImport::parseList( QDomDocument& doc, const QDomElement& list, QDom listOK = pushListLevelStyle( m_currentListStyleName, level ); // Iterate over list items - QDomElement listItem; + TQDomElement listItem; forEachElement( listItem, list ) { // It's either list-header (normal text on top of list) or list-item m_nextItemIsListItem = ( listItem.localName() != "list-header" ); m_restartNumbering = -1; if ( listItem.hasAttributeNS( ooNS::text, "start-value" ) ) - m_restartNumbering = listItem.attributeNS( ooNS::text, "start-value", QString::null ).toInt(); + m_restartNumbering = listItem.attributeNS( ooNS::text, "start-value", TQString() ).toInt(); // ### Oasis: can be p h or list only. parseBodyOrSimilar( doc, listItem, currentFramesetElement ); m_restartNumbering = -1; @@ -990,31 +990,31 @@ void OoWriterImport::parseList( QDomDocument& doc, const QDomElement& list, QDom m_currentListStyleName = oldListStyleName; } -static int numberOfParagraphs( const QDomElement& frameset ) +static int numberOfParagraphs( const TQDomElement& frameset ) { - const QDomNodeList children = frameset.childNodes(); - const QString paragStr = "PARAGRAPH"; + const TQDomNodeList tqchildren = frameset.childNodes(); + const TQString paragStr = "PARAGRAPH"; int paragCount = 0; - for ( unsigned int i = 0 ; i < children.length() ; ++i ) { - if ( children.item( i ).toElement().tagName() == paragStr ) + for ( unsigned int i = 0 ; i < tqchildren.length() ; ++i ) { + if ( tqchildren.item( i ).toElement().tagName() == paragStr ) ++paragCount; } return paragCount; } -void OoWriterImport::parseSpanOrSimilar( QDomDocument& doc, const QDomElement& parent, - QDomElement& outputParagraph, QDomElement& outputFormats, QString& paragraphText, uint& pos) +void OoWriterImport::parseSpanOrSimilar( TQDomDocument& doc, const TQDomElement& tqparent, + TQDomElement& outputParagraph, TQDomElement& outputFormats, TQString& paragraphText, uint& pos) { - // Parse every child node of the parent + // Parse every child node of the tqparent // Can't use forEachElement here since we also care about text nodes - for( QDomNode node ( parent.firstChild() ); !node.isNull(); node = node.nextSibling() ) + for( TQDomNode node ( tqparent.firstChild() ); !node.isNull(); node = node.nextSibling() ) { - QDomElement ts ( node.toElement() ); - QString textData; - const QString localName( ts.localName() ); - const QString ns = ts.namespaceURI(); + TQDomElement ts ( node.toElement() ); + TQString textData; + const TQString localName( ts.localName() ); + const TQString ns = ts.namespaceURI(); const bool isTextNS = ns == ooNS::text; - QDomText t ( node.toText() ); + TQDomText t ( node.toText() ); bool shouldWriteFormat=false; // By default no <FORMAT> element should be written @@ -1034,7 +1034,7 @@ void OoWriterImport::parseSpanOrSimilar( QDomDocument& doc, const QDomElement& p else if ( isTextNS && localName == "tab-stop" ) // text:tab-stop { // KWord currently uses \t. - // Known bug: a line with only \t\t\t\t isn't loaded - XML (QDom) strips out whitespace. + // Known bug: a line with only \t\t\t\t isn't loaded - XML (TQDom) strips out whitespace. // One more good reason to switch to <text:tab-stop> instead... textData = '\t'; shouldWriteFormat=true; @@ -1053,19 +1053,19 @@ void OoWriterImport::parseSpanOrSimilar( QDomDocument& doc, const QDomElement& p else if ( localName == "image" && ns == ooNS::draw ) { textData = '#'; // anchor placeholder - QString frameName = appendPicture(doc, ts); + TQString frameName = appendPicture(doc, ts); anchorFrameset( doc, outputFormats, pos, frameName ); } else if ( localName == "text-box" && ns == ooNS::draw ) { textData = '#'; // anchor placeholder - QString frameName = appendTextBox(doc, ts); + TQString frameName = appendTextBox(doc, ts); anchorFrameset( doc, outputFormats, pos, frameName ); } else if ( isTextNS && localName == "a" ) { m_styleStack.save(); - QString href( ts.attributeNS( ooNS::xlink, "href", QString::null) ); + TQString href( ts.attributeNS( ooNS::xlink, "href", TQString()) ); if ( href.startsWith("#") ) { // We have a reference to a bookmark (### TODO) @@ -1076,13 +1076,13 @@ void OoWriterImport::parseSpanOrSimilar( QDomDocument& doc, const QDomElement& p { // The problem is that KWord's hyperlink text is not inside the normal text, but for OOWriter it is nearly a <text:span> // So we have to fake. - QDomElement fakeParagraph, fakeFormats; + TQDomElement fakeParagraph, fakeFormats; uint fakePos=0; - QString text; + TQString text; parseSpanOrSimilar( doc, ts, fakeParagraph, fakeFormats, text, fakePos); textData = '#'; // hyperlink placeholder - QDomElement linkElement (doc.createElement("LINK")); - linkElement.setAttribute("hrefName",ts.attributeNS( ooNS::xlink, "href", QString::null)); + TQDomElement linkElement (doc.createElement("LINK")); + linkElement.setAttribute("hrefName",ts.attributeNS( ooNS::xlink, "href", TQString())); linkElement.setAttribute("linkName",text); appendKWordVariable(doc, outputFormats, ts, pos, "STRING", 9, linkElement); } @@ -1121,21 +1121,21 @@ void OoWriterImport::parseSpanOrSimilar( QDomDocument& doc, const QDomElement& p // (-1 for starting at 0, +1 since not written yet) Q_ASSERT( !m_currentFrameset.isNull() ); appendBookmark( doc, numberOfParagraphs( m_currentFrameset ), - pos, ts.attributeNS( ooNS::text, "name", QString::null ) ); + pos, ts.attributeNS( ooNS::text, "name", TQString() ) ); } else if ( isTextNS && localName == "bookmark-start" ) { - m_bookmarkStarts.insert( ts.attributeNS( ooNS::text, "name", QString::null ), + m_bookmarkStarts.insert( ts.attributeNS( ooNS::text, "name", TQString() ), BookmarkStart( m_currentFrameset.attribute( "name" ), numberOfParagraphs( m_currentFrameset ), pos ) ); } else if ( isTextNS && localName == "bookmark-end" ) { - QString bkName = ts.attributeNS( ooNS::text, "name", QString::null ); - BookmarkStartsMap::iterator it = m_bookmarkStarts.find( bkName ); + TQString bkName = ts.attributeNS( ooNS::text, "name", TQString() ); + BookmarkStartsMap::iterator it = m_bookmarkStarts.tqfind( bkName ); if ( it == m_bookmarkStarts.end() ) { // bookmark end without start. This seems to happen.. // insert simple bookmark then appendBookmark( doc, numberOfParagraphs( m_currentFrameset ), - pos, ts.attributeNS( ooNS::text, "name", QString::null ) ); + pos, ts.attributeNS( ooNS::text, "name", TQString() ) ); } else { if ( (*it).frameSetName != m_currentFrameset.attribute( "name" ) ) { // Oh tell me this never happens... @@ -1170,51 +1170,51 @@ void OoWriterImport::parseSpanOrSimilar( QDomDocument& doc, const QDomElement& p } } -QDomElement OoWriterImport::parseParagraph( QDomDocument& doc, const QDomElement& paragraph ) +TQDomElement OoWriterImport::parseParagraph( TQDomDocument& doc, const TQDomElement& paragraph ) { - QDomElement p = doc.createElement( "PARAGRAPH" ); + TQDomElement p = doc.createElement( "PARAGRAPH" ); - QDomElement formats = doc.createElement( "FORMATS" ); + TQDomElement formats = doc.createElement( "FORMATS" ); - QString paragraphText; + TQString paragraphText; uint pos = 0; // parse every child node of the paragraph parseSpanOrSimilar( doc, paragraph, p, formats, paragraphText, pos); - QDomElement text = doc.createElement( "TEXT" ); + TQDomElement text = doc.createElement( "TEXT" ); text.appendChild( doc.createTextNode( paragraphText ) ); text.setAttribute( "xml:space", "preserve" ); p.appendChild( text ); //kdDebug(30518) << k_funcinfo << "Para text is: " << paragraphText << endl; p.appendChild( formats ); - QDomElement layoutElement = doc.createElement( "LAYOUT" ); - p.appendChild( layoutElement ); + TQDomElement tqlayoutElement = doc.createElement( "LAYOUT" ); + p.appendChild( tqlayoutElement ); // Style name - QString styleName = m_styleStack.userStyleName("paragraph"); + TQString styleName = m_styleStack.userStyleName("paragraph"); if ( !styleName.isEmpty() ) { - QDomElement nameElement = doc.createElement("NAME"); + TQDomElement nameElement = doc.createElement("NAME"); nameElement.setAttribute( "value", kWordStyleName(styleName) ); - layoutElement.appendChild(nameElement); + tqlayoutElement.appendChild(nameElement); } - writeLayout( doc, layoutElement ); - writeFormat( doc, layoutElement, 1, 0, 0 ); // paragraph format, useful for empty parags + writeLayout( doc, tqlayoutElement ); + writeFormat( doc, tqlayoutElement, 1, 0, 0 ); // paragraph format, useful for empty parags - applyListStyle( doc, layoutElement, paragraph ); + applyListStyle( doc, tqlayoutElement, paragraph ); - QDomElement* paragraphStyle = m_styles[paragraph.attributeNS( ooNS::text, "style-name", QString::null )]; - QString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( ooNS::style, "master-page-name", QString::null ) : QString::null; + TQDomElement* paragraphStyle = m_styles[paragraph.attributeNS( ooNS::text, "style-name", TQString() )]; + TQString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( ooNS::style, "master-page-name", TQString() ) : TQString(); if ( masterPageName.isEmpty() ) - masterPageName = "Standard"; // Seems to be a builtin name for the default layout... + masterPageName = "Standard"; // Seems to be a builtin name for the default tqlayout... if ( masterPageName != m_currentMasterPage ) { - // Detected a change in the master page -> this means we have to use a new page layout + // Detected a change in the master page -> this means we have to use a new page tqlayout // and insert a frame break if not on the first paragraph. - // In KWord we don't support sections so the first paragraph is the one that determines the page layout. + // In KWord we don't support sections so the first paragraph is the one that determines the page tqlayout. if ( m_currentMasterPage.isEmpty() ) { m_currentMasterPage = masterPageName; // before writePageLayout to avoid recursion writePageLayout( doc, masterPageName ); @@ -1222,23 +1222,23 @@ QDomElement OoWriterImport::parseParagraph( QDomDocument& doc, const QDomElement else { m_currentMasterPage = masterPageName; - QDomElement pageBreakElem = layoutElement.namedItem( "PAGEBREAKING" ).toElement(); + TQDomElement pageBreakElem = tqlayoutElement.namedItem( "PAGEBREAKING" ).toElement(); if ( !pageBreakElem.isNull() ) { pageBreakElem = doc.createElement( "PAGEBREAKING" ); - layoutElement.appendChild( pageBreakElem ); + tqlayoutElement.appendChild( pageBreakElem ); } pageBreakElem.setAttribute( "hardFrameBreak", "true" ); - // We have no way to store the new page layout, KWord doesn't have sections. + // We have no way to store the new page tqlayout, KWord doesn't have sections. } } return p; } -void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int id, int pos, int length ) +void OoWriterImport::writeFormat( TQDomDocument& doc, TQDomElement& formats, int id, int pos, int length ) { // Prepare a FORMAT element for this run of text - QDomElement format( doc.createElement( "FORMAT" ) ); + TQDomElement format( doc.createElement( "FORMAT" ) ); format.setAttribute( "id", id ); format.setAttribute( "pos", pos ); format.setAttribute( "len", length ); @@ -1254,8 +1254,8 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i // find a case that breaks yet. if ( m_styleStack.hasAttributeNS( ooNS::fo, "color" ) ) { // 3.10.3 - QColor color( m_styleStack.attributeNS( ooNS::fo, "color" ) ); // #rrggbb format - QDomElement colorElem( doc.createElement( "COLOR" ) ); + TQColor color( m_styleStack.attributeNS( ooNS::fo, "color" ) ); // #rrggbb format + TQDomElement colorElem( doc.createElement( "COLOR" ) ); colorElem.setAttribute( "red", color.red() ); colorElem.setAttribute( "blue", color.blue() ); colorElem.setAttribute( "green", color.green() ); @@ -1265,7 +1265,7 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i || m_styleStack.hasAttributeNS( ooNS::style, "font-name") ) // 3.10.8 { // Hmm, the remove "'" could break it's in the middle of the fontname... - QString fontName = m_styleStack.attributeNS( ooNS::fo, "font-family" ).remove( "'" ); + TQString fontName = m_styleStack.attributeNS( ooNS::fo, "font-family" ).remove( "'" ); if (fontName.isEmpty()) { // ##### TODO. This is wrong. style:font-name refers to a font-decl entry. @@ -1277,22 +1277,22 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i if ( fontName == "Thorndale" ) fontName = "Times New Roman"; - fontName.remove(QRegExp("\\sCE$")); // Arial CE -> Arial + fontName.remove(TQRegExp("\\sCE$")); // Arial CE -> Arial - QDomElement fontElem( doc.createElement( "FONT" ) ); + TQDomElement fontElem( doc.createElement( "FONT" ) ); fontElem.setAttribute( "name", fontName ); format.appendChild( fontElem ); } if ( m_styleStack.hasAttributeNS( ooNS::fo, "font-size" ) ) { // 3.10.14 double pointSize = m_styleStack.fontSize(); - QDomElement fontSize( doc.createElement( "SIZE" ) ); - fontSize.setAttribute( "value", qRound(pointSize) ); // KWord uses toInt()! + TQDomElement fontSize( doc.createElement( "SIZE" ) ); + fontSize.setAttribute( "value", tqRound(pointSize) ); // KWord uses toInt()! format.appendChild( fontSize ); } if ( m_styleStack.hasAttributeNS( ooNS::fo, "font-weight" ) ) { // 3.10.24 - QDomElement weightElem( doc.createElement( "WEIGHT" ) ); - QString fontWeight = m_styleStack.attributeNS( ooNS::fo, "font-weight" ); + TQDomElement weightElem( doc.createElement( "WEIGHT" ) ); + TQString fontWeight = m_styleStack.attributeNS( ooNS::fo, "font-weight" ); int boldness = fontWeight.toInt(); if ( fontWeight == "bold" ) boldness = 75; @@ -1306,7 +1306,7 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i if ( m_styleStack.attributeNS( ooNS::fo, "font-style" ) == "italic" || m_styleStack.attributeNS( ooNS::fo, "font-style" ) == "oblique" ) // no difference in kotext { - QDomElement italic = doc.createElement( "ITALIC" ); + TQDomElement italic = doc.createElement( "ITALIC" ); italic.setAttribute( "value", 1 ); format.appendChild( italic ); } @@ -1315,8 +1315,8 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i && (m_styleStack.attributeNS( ooNS::fo, "score-spaces") == "false"); if( m_styleStack.hasAttributeNS( ooNS::style, "text-crossing-out" )) // 3.10.6 { - QString strikeOutType = m_styleStack.attributeNS( ooNS::style, "text-crossing-out" ); - QDomElement strikeOut = doc.createElement( "STRIKEOUT" ); + TQString strikeOutType = m_styleStack.attributeNS( ooNS::style, "text-crossing-out" ); + TQDomElement strikeOut = doc.createElement( "STRIKEOUT" ); if( strikeOutType =="double-line") { strikeOut.setAttribute("value", "double"); @@ -1340,10 +1340,10 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i } if( m_styleStack.hasAttributeNS( ooNS::style, "text-position")) // 3.10.7 { - QDomElement vertAlign = doc.createElement( "VERTALIGN" ); - QString text_position = m_styleStack.attributeNS( ooNS::style, "text-position"); - QString value; - QString relativetextsize; + TQDomElement vertAlign = doc.createElement( "VERTALIGN" ); + TQString text_position = m_styleStack.attributeNS( ooNS::style, "text-position"); + TQString value; + TQString relativetextsize; OoUtils::importTextPosition( text_position, value, relativetextsize ); vertAlign.setAttribute( "value", value ); if ( !relativetextsize.isEmpty() ) @@ -1352,15 +1352,15 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i } if ( m_styleStack.hasAttributeNS( ooNS::style, "text-underline" ) ) // 3.10.22 { - QString underline; - QString styleline; + TQString underline; + TQString styleline; OoUtils::importUnderline( m_styleStack.attributeNS( ooNS::style, "text-underline" ), underline, styleline ); - QDomElement underLineElem = doc.createElement( "UNDERLINE" ); + TQDomElement underLineElem = doc.createElement( "UNDERLINE" ); underLineElem.setAttribute( "value", underline ); underLineElem.setAttribute( "styleline", styleline ); - QString underLineColor = m_styleStack.attributeNS( ooNS::style, "text-underline-color" ); // 3.10.23 + TQString underLineColor = m_styleStack.attributeNS( ooNS::style, "text-underline-color" ); // 3.10.23 if ( !underLineColor.isEmpty() && underLineColor != "font-color" ) underLineElem.setAttribute("underlinecolor", underLineColor); if ( wordByWord ) @@ -1371,7 +1371,7 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i if ( m_styleStack.hasAttributeNS( ooNS::fo, "font-variant" ) // 3.10.1 || m_styleStack.hasAttributeNS( ooNS::fo, "text-transform" ) ) // 3.10.2 { - QDomElement fontAttrib( doc.createElement( "FONTATTRIBUTE" ) ); + TQDomElement fontAttrib( doc.createElement( "FONTATTRIBUTE" ) ); bool smallCaps = m_styleStack.attributeNS( ooNS::fo, "font-variant" ) == "small-caps"; if ( smallCaps ) { @@ -1387,8 +1387,8 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i if (m_styleStack.hasAttributeNS( ooNS::fo, "language")) // 3.10.17 { - QDomElement lang = doc.createElement("LANGUAGE"); - QString tmp = m_styleStack.attributeNS( ooNS::fo, "language"); + TQDomElement lang = doc.createElement("LANGUAGE"); + TQString tmp = m_styleStack.attributeNS( ooNS::fo, "language"); if (tmp=="en") lang.setAttribute("value", "en_US"); else @@ -1398,8 +1398,8 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i if (m_styleStack.hasAttributeNS( ooNS::style, "text-background-color")) // 3.10.28 { - QDomElement bgCol = doc.createElement("TEXTBACKGROUNDCOLOR"); - QColor tmp = m_styleStack.attributeNS( ooNS::style, "text-background-color"); + TQDomElement bgCol = doc.createElement("TEXTBACKGROUNDCOLOR"); + TQColor tmp = m_styleStack.attributeNS( ooNS::style, "text-background-color"); if (tmp != "transparent") { bgCol.setAttribute("red", tmp.red()); @@ -1411,12 +1411,12 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i if (m_styleStack.hasAttributeNS( ooNS::fo, "text-shadow")) // 3.10.21 { - QDomElement shadow = doc.createElement("SHADOW"); - QString css = m_styleStack.attributeNS( ooNS::fo, "text-shadow"); + TQDomElement shadow = doc.createElement("SHADOW"); + TQString css = m_styleStack.attributeNS( ooNS::fo, "text-shadow"); // Workaround for OOo-1.1 bug: they forgot to save the color. - QStringList tokens = QStringList::split(' ', css); + TQStringList tokens = TQStringList::split(' ', css); if ( !tokens.isEmpty() ) { - QColor col( tokens.first() ); + TQColor col( tokens.first() ); if ( !col.isValid() && tokens.count() > 1 ) { col.setNamedColor( tokens.last() ); } @@ -1436,7 +1436,7 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i style:font-family-generic, 3.10.10 - roman, swiss, modern -> map to a font? style:font-style-name, 3.10.11 - can be ignored, says DV, the other ways to specify a font are more precise style:font-pitch, 3.10.12 - fixed or variable -> map to a font? - style:font-charset, 3.10.14 - not necessary with Qt + style:font-charset, 3.10.14 - not necessary with TQt style:font-size-rel, 3.10.15 - TODO in StyleStack::fontSize() fo:letter-spacing, 3.10.16 - not implemented in kotext style:text-relief, 3.10.20 - not implemented in kotext @@ -1454,12 +1454,12 @@ void OoWriterImport::writeFormat( QDomDocument& doc, QDomElement& formats, int i formats.appendChild( format ); } -void OoWriterImport::writeLayout( QDomDocument& doc, QDomElement& layoutElement ) +void OoWriterImport::writeLayout( TQDomDocument& doc, TQDomElement& tqlayoutElement ) { - Q_ASSERT( layoutElement.ownerDocument() == doc ); + Q_ASSERT( tqlayoutElement.ownerDocument() == doc ); - // Always write out the alignment, it's required - QDomElement flowElement = doc.createElement("FLOW"); + // Always write out the tqalignment, it's required + TQDomElement flowElement = doc.createElement("FLOW"); /* This was only an intermediate OASIS decision. The final decision is: * fo:text-align can be "left", "right", "center", "justify", and @@ -1476,29 +1476,29 @@ void OoWriterImport::writeLayout( QDomDocument& doc, QDomElement& layoutElement else flowElement.setAttribute( "align", "auto" ); } - layoutElement.appendChild( flowElement ); + tqlayoutElement.appendChild( flowElement ); if ( m_styleStack.hasAttributeNS( ooNS::fo, "writing-mode" ) ) // http://web4.w3.org/TR/xsl/slice7.html#writing-mode { // LTR is lr-tb. RTL is rl-tb - QString writingMode = m_styleStack.attributeNS( ooNS::fo, "writing-mode" ); + TQString writingMode = m_styleStack.attributeNS( ooNS::fo, "writing-mode" ); flowElement.setAttribute( "dir", writingMode=="rl-tb" || writingMode=="rl" ? "R" : "L" ); } // Indentation (margins) - OoUtils::importIndents( layoutElement, m_styleStack ); + OoUtils::importIndents( tqlayoutElement, m_styleStack ); // Offset before and after paragraph - OoUtils::importTopBottomMargin( layoutElement, m_styleStack ); + OoUtils::importTopBottomMargin( tqlayoutElement, m_styleStack ); // Line spacing - OoUtils::importLineSpacing( layoutElement, m_styleStack ); + OoUtils::importLineSpacing( tqlayoutElement, m_styleStack ); // Tabulators - OoUtils::importTabulators( layoutElement, m_styleStack ); + OoUtils::importTabulators( tqlayoutElement, m_styleStack ); // Borders - OoUtils::importBorders( layoutElement, m_styleStack ); + OoUtils::importBorders( tqlayoutElement, m_styleStack ); // Page breaking. This isn't in OoUtils since it doesn't apply to KPresenter if( m_styleStack.hasAttributeNS( ooNS::fo, "break-before") || @@ -1507,7 +1507,7 @@ void OoWriterImport::writeLayout( QDomDocument& doc, QDomElement& layoutElement m_styleStack.hasAttributeNS( ooNS::style, "keep-with-next") || m_styleStack.hasAttributeNS( ooNS::fo, "keep-with-next") ) { - QDomElement pageBreak = doc.createElement( "PAGEBREAKING" ); + TQDomElement pageBreak = doc.createElement( "PAGEBREAKING" ); if ( m_styleStack.hasAttributeNS( ooNS::fo, "break-before") ) { // 3.11.24 bool breakBefore = m_styleStack.attributeNS( ooNS::fo, "break-before" ) != "auto"; // TODO in KWord: implement difference between "column" and "page" @@ -1525,10 +1525,10 @@ void OoWriterImport::writeLayout( QDomDocument& doc, QDomElement& layoutElement } if ( m_styleStack.hasAttributeNS( ooNS::fo, "keep-with-next" ) ) { // 3.11.31 (the doc said style:keep-with-next but DV said it's wrong) // OASIS spec says it's "auto"/"always", not a boolean. Not sure which one OO uses. - QString val = m_styleStack.attributeNS( ooNS::fo, "keep-with-next" ); + TQString val = m_styleStack.attributeNS( ooNS::fo, "keep-with-next" ); pageBreak.setAttribute("keepWithNext", ( val == "true" || val == "always" ) ? "true" : "false"); } - layoutElement.appendChild( pageBreak ); + tqlayoutElement.appendChild( pageBreak ); } // TODO in KWord: padding @@ -1563,23 +1563,23 @@ void OoWriterImport::writeLayout( QDomDocument& doc, QDomElement& layoutElement style:background-image line numbering punctuation wrap, 3.10.36 - vertical alignment - a bit like offsetfrombaseline (but not for subscript/superscript, in general) + vertical tqalignment - a bit like offsetfrombaseline (but not for subscript/superscript, in general) Michael said those are in fact parag properties: style:text-autospace, 3.10.32 - not implemented in kotext - style:line-break, 3.10.37 - apparently that's for some Asian languages + style:line-break, 3.10.37 - aptqparently that's for some Asian languages */ } -void OoWriterImport::importFrame( QDomElement& frameElementOut, const QDomElement& object, bool isText ) +void OoWriterImport::importFrame( TQDomElement& frameElementOut, const TQDomElement& object, bool isText ) { double width = 100; if ( object.hasAttributeNS( ooNS::svg, "width" ) ) { // fixed width // TODO handle percentage (of enclosing table/frame/page) - width = KoUnit::parseValue( object.attributeNS( ooNS::svg, "width", QString::null ) ); + width = KoUnit::parseValue( object.attributeNS( ooNS::svg, "width", TQString() ) ); } else if ( object.hasAttributeNS( ooNS::fo, "min-width" ) ) { // min-width is not supported in KWord. Let's use it as a fixed width. - width = KoUnit::parseValue( object.attributeNS( ooNS::fo, "min-width", QString::null ) ); + width = KoUnit::parseValue( object.attributeNS( ooNS::fo, "min-width", TQString() ) ); } else { kdWarning(30518) << "Error in text-box: neither width nor min-width specified!" << endl; } @@ -1587,9 +1587,9 @@ void OoWriterImport::importFrame( QDomElement& frameElementOut, const QDomElemen bool hasMinHeight = false; if ( object.hasAttributeNS( ooNS::svg, "height" ) ) { // fixed height // TODO handle percentage (of enclosing table/frame/page) - height = KoUnit::parseValue( object.attributeNS( ooNS::svg, "height", QString::null ) ); + height = KoUnit::parseValue( object.attributeNS( ooNS::svg, "height", TQString() ) ); } else if ( object.hasAttributeNS( ooNS::fo, "min-height" ) ) { - height = KoUnit::parseValue( object.attributeNS( ooNS::fo, "min-height", QString::null ) ); + height = KoUnit::parseValue( object.attributeNS( ooNS::fo, "min-height", TQString() ) ); hasMinHeight = true; } else { kdWarning(30518) << "Error in text-box: neither height nor min-height specified!" << endl; @@ -1607,8 +1607,8 @@ void OoWriterImport::importFrame( QDomElement& frameElementOut, const QDomElemen // TODO draw:auto-grow-height draw:auto-grow-width - hmm? I thought min-height meant auto-grow-height... - KoRect frameRect( KoUnit::parseValue( object.attributeNS( ooNS::svg, "x", QString::null ) ), - KoUnit::parseValue( object.attributeNS( ooNS::svg, "y", QString::null ) ), + KoRect frameRect( KoUnit::parseValue( object.attributeNS( ooNS::svg, "x", TQString() ) ), + KoUnit::parseValue( object.attributeNS( ooNS::svg, "y", TQString() ) ), width, height ); frameElementOut.setAttribute("left", frameRect.left() ); @@ -1617,8 +1617,8 @@ void OoWriterImport::importFrame( QDomElement& frameElementOut, const QDomElemen frameElementOut.setAttribute("bottom", frameRect.bottom() ); if ( hasMinHeight ) frameElementOut.setAttribute("min-height", height ); - frameElementOut.setAttribute( "z-index", object.attributeNS( ooNS::draw, "z-index", QString::null ) ); - QPair<int, QString> attribs = Conversion::importWrapping( m_styleStack.attributeNS( ooNS::style, "wrap" ) ); + frameElementOut.setAttribute( "z-index", object.attributeNS( ooNS::draw, "z-index", TQString() ) ); + TQPair<int, TQString> attribs = Conversion::importWrapping( m_styleStack.attributeNS( ooNS::style, "wrap" ) ); frameElementOut.setAttribute("runaround", attribs.first ); if ( !attribs.second.isEmpty() ) frameElementOut.setAttribute("runaroundSide", attribs.second ); @@ -1643,7 +1643,7 @@ void OoWriterImport::importFrame( QDomElement& frameElementOut, const QDomElemen importCommonFrameProperties( frameElementOut ); } -void OoWriterImport::importCommonFrameProperties( QDomElement& frameElementOut ) +void OoWriterImport::importCommonFrameProperties( TQDomElement& frameElementOut ) { // padding. fo:padding for 4 values or padding-left/right/top/bottom (3.11.29 p228) double paddingLeft = KoUnit::parseValue( m_styleStack.attributeNS( ooNS::fo, "padding", "left" ) ); @@ -1662,9 +1662,9 @@ void OoWriterImport::importCommonFrameProperties( QDomElement& frameElementOut ) // background color (3.11.25) bool transparent = false; - QColor bgColor; + TQColor bgColor; if ( m_styleStack.hasAttributeNS( ooNS::fo, "background-color" ) ) { - QString color = m_styleStack.attributeNS( ooNS::fo, "background-color" ); + TQString color = m_styleStack.attributeNS( ooNS::fo, "background-color" ); if ( color == "transparent" ) transparent = true; else @@ -1687,7 +1687,7 @@ void OoWriterImport::importCommonFrameProperties( QDomElement& frameElementOut ) { double width; int style; - QColor color; + TQColor color; if (OoUtils::parseBorder(m_styleStack.attributeNS( ooNS::fo, "border", "left"), &width, &style, &color)) { frameElementOut.setAttribute( "lWidth", width ); if ( color.isValid() ) { // should be always true, but who knows @@ -1728,23 +1728,23 @@ void OoWriterImport::importCommonFrameProperties( QDomElement& frameElementOut ) // TODO more refined border spec for double borders (3.11.28) } -QString OoWriterImport::appendTextBox(QDomDocument& doc, const QDomElement& object) +TQString OoWriterImport::appendTextBox(TQDomDocument& doc, const TQDomElement& object) { - const QString frameName ( object.attributeNS( ooNS::draw, "name", QString::null) ); // ### TODO: what if empty, i.e. non-unique + const TQString frameName ( object.attributeNS( ooNS::draw, "name", TQString()) ); // ### TODO: what if empty, i.e. non-unique kdDebug(30518) << "appendTextBox " << frameName << endl; m_styleStack.save(); fillStyleStack( object, ooNS::draw, "style-name" ); // get the style for the graphics element // Create KWord frameset - QDomElement framesetElement(doc.createElement("FRAMESET")); + TQDomElement framesetElement(doc.createElement("FRAMESET")); framesetElement.setAttribute("frameType",1); framesetElement.setAttribute("frameInfo",0); framesetElement.setAttribute("visible",1); framesetElement.setAttribute("name",frameName); - QDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); + TQDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); framesetsPluralElement.appendChild(framesetElement); - QDomElement frameElementOut(doc.createElement("FRAME")); + TQDomElement frameElementOut(doc.createElement("FRAME")); framesetElement.appendChild(frameElementOut); importFrame( frameElementOut, object, true /*text*/ ); // TODO editable @@ -1763,18 +1763,18 @@ QString OoWriterImport::appendTextBox(QDomDocument& doc, const QDomElement& obje } // OOo SPEC: 3.6.3 p149 -void OoWriterImport::importFootnote( QDomDocument& doc, const QDomElement& object, QDomElement& formats, uint pos, const QString& localName ) +void OoWriterImport::importFootnote( TQDomDocument& doc, const TQDomElement& object, TQDomElement& formats, uint pos, const TQString& localName ) { - const QString frameName( object.attributeNS( ooNS::text, "id", QString::null) ); - QDomElement citationElem = KoDom::namedItemNS( object, ooNS::text, (localName+"-citation").latin1() ).toElement(); + const TQString frameName( object.attributeNS( ooNS::text, "id", TQString()) ); + TQDomElement citationElem = KoDom::namedItemNS( object, ooNS::text, (localName+"-citation").latin1() ).toElement(); bool endnote = localName == "endnote"; - QString label = citationElem.attributeNS( ooNS::text, "label", QString::null ); + TQString label = citationElem.attributeNS( ooNS::text, "label", TQString() ); bool autoNumbered = label.isEmpty(); // The var - QDomElement footnoteElem = doc.createElement( "FOOTNOTE" ); + TQDomElement footnoteElem = doc.createElement( "FOOTNOTE" ); if ( autoNumbered ) footnoteElem.setAttribute( "value", 1 ); // KWord will renumber anyway else @@ -1786,38 +1786,38 @@ void OoWriterImport::importFootnote( QDomDocument& doc, const QDomElement& objec appendKWordVariable( doc, formats, citationElem, pos, "STRI", 11 /*KWord code for footnotes*/, footnoteElem ); // The frameset - QDomElement framesetElement( doc.createElement("FRAMESET") ); + TQDomElement framesetElement( doc.createElement("FRAMESET") ); framesetElement.setAttribute( "frameType", 1 /* text */ ); framesetElement.setAttribute( "frameInfo", 7 /* footnote/endnote */ ); framesetElement.setAttribute( "name" , frameName ); - QDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); + TQDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); framesetsPluralElement.appendChild(framesetElement); createInitialFrame( framesetElement, 29, 798, 567, 567+41, true, NoFollowup ); // TODO importCommonFrameProperties ? // The text inside the frameset - QDomElement bodyElem = KoDom::namedItemNS( object, ooNS::text, (localName+"-body").latin1() ).toElement(); + TQDomElement bodyElem = KoDom::namedItemNS( object, ooNS::text, (localName+"-body").latin1() ).toElement(); parseBodyOrSimilar( doc, bodyElem, framesetElement ); } -QString OoWriterImport::appendPicture(QDomDocument& doc, const QDomElement& object) +TQString OoWriterImport::appendPicture(TQDomDocument& doc, const TQDomElement& object) { - const QString frameName ( object.attributeNS( ooNS::draw, "name", QString::null) ); // ### TODO: what if empty, i.e. non-unique - const QString href ( object.attributeNS( ooNS::xlink, "href", QString::null) ); + const TQString frameName ( object.attributeNS( ooNS::draw, "name", TQString()) ); // ### TODO: what if empty, i.e. non-unique + const TQString href ( object.attributeNS( ooNS::xlink, "href", TQString()) ); kdDebug(30518) << "Picture: " << frameName << " " << href << " (in OoWriterImport::appendPicture)" << endl; KoPicture picture; if ( href[0]=='#' ) { - QString strExtension; - const int result=href.findRev("."); + TQString strExtension; + const int result=href.tqfindRev("."); if (result>=0) { strExtension=href.mid(result+1); // As we are using KoPicture, the extension should be without the dot. } - QString filename(href.mid(1)); - KoPictureKey key(filename, QDateTime::currentDateTime(Qt::UTC)); + TQString filename(href.mid(1)); + KoPictureKey key(filename, TQDateTime::tqcurrentDateTime(Qt::UTC)); picture.setKey(key); if (!m_zip) @@ -1835,12 +1835,12 @@ QString OoWriterImport::appendPicture(QDomDocument& doc, const QDomElement& obje return frameName; } const KZipFileEntry* f = static_cast<const KZipFileEntry *>(entry); - QIODevice* io=f->device(); + TQIODevice* io=f->device(); kdDebug(30518) << "Picture " << filename << " has size " << f->size() << endl; if (!io) { - kdWarning(30518) << "No QIODevice for picture " << frameName << " " << href << endl; + kdWarning(30518) << "No TQIODevice for picture " << frameName << " " << href << endl; return frameName; } if (!picture.load(io,strExtension)) @@ -1850,14 +1850,14 @@ QString OoWriterImport::appendPicture(QDomDocument& doc, const QDomElement& obje { KURL url; url.setPath(href); // ### TODO: is this really right? - picture.setKeyAndDownloadPicture(url, 0); // ### TODO: find a better parent if possible + picture.setKeyAndDownloadPicture(url, 0); // ### TODO: find a better tqparent if possible } kdDebug(30518) << "Picture ready! Key: " << picture.getKey().toString() << " Size:" << picture.getOriginalSize() << endl; - QString strStoreName; + TQString strStoreName; strStoreName="pictures/picture"; - strStoreName+=QString::number(++m_pictureNumber); + strStoreName+=TQString::number(++m_pictureNumber); strStoreName+='.'; strStoreName+=picture.getExtension(); @@ -1883,18 +1883,18 @@ QString OoWriterImport::appendPicture(QDomDocument& doc, const QDomElement& obje // Now that we have copied the image, we need to make some bookkeeping - QDomElement docElement( doc.documentElement() ); + TQDomElement docElement( doc.documentElement() ); - QDomElement framesetsPluralElement ( docElement.namedItem("FRAMESETS").toElement() ); + TQDomElement framesetsPluralElement ( docElement.namedItem("FRAMESETS").toElement() ); - QDomElement framesetElement=doc.createElement("FRAMESET"); + TQDomElement framesetElement=doc.createElement("FRAMESET"); framesetElement.setAttribute("frameType",2); framesetElement.setAttribute("frameInfo",0); framesetElement.setAttribute("visible",1); framesetElement.setAttribute("name",frameName); framesetsPluralElement.appendChild(framesetElement); - QDomElement frameElementOut=doc.createElement("FRAME"); + TQDomElement frameElementOut=doc.createElement("FRAME"); framesetElement.appendChild(frameElementOut); m_styleStack.save(); @@ -1902,16 +1902,16 @@ QString OoWriterImport::appendPicture(QDomDocument& doc, const QDomElement& obje importFrame( frameElementOut, object, false /*not text*/ ); m_styleStack.restore(); - QDomElement element=doc.createElement("PICTURE"); + TQDomElement element=doc.createElement("PICTURE"); element.setAttribute("keepAspectRatio","true"); framesetElement.setAttribute("frameType",2); // Picture framesetElement.appendChild(element); - QDomElement singleKey ( doc.createElement("KEY") ); + TQDomElement singleKey ( doc.createElement("KEY") ); picture.getKey().saveAttributes(singleKey); element.appendChild(singleKey); - QDomElement picturesPluralElement ( docElement.namedItem("PICTURES").toElement() ); + TQDomElement picturesPluralElement ( docElement.namedItem("PICTURES").toElement() ); if (picturesPluralElement.isNull()) { // We do not yet have any <PICTURES> element, so we must create it @@ -1919,41 +1919,41 @@ QString OoWriterImport::appendPicture(QDomDocument& doc, const QDomElement& obje docElement.appendChild(picturesPluralElement); } - QDomElement pluralKey ( doc.createElement("KEY") ); + TQDomElement pluralKey ( doc.createElement("KEY") ); picture.getKey().saveAttributes(pluralKey); pluralKey.setAttribute("name",strStoreName); picturesPluralElement.appendChild(pluralKey); return frameName; } -void OoWriterImport::anchorFrameset( QDomDocument& doc, QDomElement& formats, uint pos, const QString& frameSetName ) +void OoWriterImport::anchorFrameset( TQDomDocument& doc, TQDomElement& formats, uint pos, const TQString& frameSetName ) { - QDomElement formatElementOut=doc.createElement("FORMAT"); + TQDomElement formatElementOut=doc.createElement("FORMAT"); formatElementOut.setAttribute("id",6); // Floating frame formatElementOut.setAttribute("pos",pos); // Start position formatElementOut.setAttribute("len",1); // Start position formats.appendChild(formatElementOut); //Append to <FORMATS> - QDomElement anchor=doc.createElement("ANCHOR"); + TQDomElement anchor=doc.createElement("ANCHOR"); // No name attribute! anchor.setAttribute("type","frameset"); anchor.setAttribute("instance",frameSetName); formatElementOut.appendChild(anchor); } -void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, QDomElement& object, uint pos) -// Note: QDomElement& outputFormats replaces the parameter QDomElement& e in OoImpressImport::appendField +void OoWriterImport::appendField(TQDomDocument& doc, TQDomElement& outputFormats, TQDomElement& object, uint pos) +// Note: TQDomElement& outputFormats replaces the parameter TQDomElement& e in OoImpressImport::appendField // (otherwise it should be the same parameters.) { - const QString localName (object.localName()); + const TQString localName (object.localName()); //kdDebug(30518) << localName << endl; int subtype = -1; if ( localName.endsWith( "date" ) || localName.endsWith( "time" ) ) { - QString dataStyleName = object.attributeNS( ooNS::style, "data-style-name", QString::null ); - QString dateFormat = "locale"; - DataFormatsMap::const_iterator it = m_dateTimeFormats.find( dataStyleName ); + TQString dataStyleName = object.attributeNS( ooNS::style, "data-style-name", TQString() ); + TQString dateFormat = "locale"; + DataFormatsMap::const_iterator it = m_dateTimeFormats.tqfind( dataStyleName ); if ( it != m_dateTimeFormats.end() ) dateFormat = (*it); @@ -1961,20 +1961,20 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, { subtype = 1; // current (or fixed) date // Standard form of the date is in date-value. Example: 2004-01-21T10:57:05 - QDateTime dt(QDate::fromString(object.attributeNS( ooNS::text, "date-value", QString::null), Qt::ISODate)); + TQDateTime dt(TQDate::fromString(object.attributeNS( ooNS::text, "date-value", TQString()), Qt::ISODate)); - bool fixed = (object.hasAttributeNS( ooNS::text, "fixed") && object.attributeNS( ooNS::text, "fixed", QString::null)=="true"); + bool fixed = (object.hasAttributeNS( ooNS::text, "fixed") && object.attributeNS( ooNS::text, "fixed", TQString())=="true"); if (!dt.isValid()) { - dt = QDateTime::currentDateTime(); // OOo docs say so :) + dt = TQDateTime::tqcurrentDateTime(); // OOo docs say so :) fixed = false; } - const QDate date(dt.date()); - const QTime time(dt.time()); + const TQDate date(dt.date()); + const TQTime time(dt.time()); if ( fixed ) subtype = 0; - QDomElement dateElement ( doc.createElement("DATE") ); + TQDomElement dateElement ( doc.createElement("DATE") ); dateElement.setAttribute("fix", fixed ? 1 : 0); dateElement.setAttribute("subtype", subtype); dateElement.setAttribute("day", date.day()); @@ -1984,29 +1984,29 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, dateElement.setAttribute("minute", time.minute()); dateElement.setAttribute("second", time.second()); if (object.hasAttributeNS( ooNS::text, "date-adjust")) - dateElement.setAttribute("correct", object.attributeNS( ooNS::text, "date-adjust", QString::null)); + dateElement.setAttribute("correct", object.attributeNS( ooNS::text, "date-adjust", TQString())); appendKWordVariable(doc, outputFormats, object, pos, "DATE" + dateFormat, 0, dateElement); } else if (localName == "time") { - // Use QDateTime to work around a possible problem of QTime::FromString in Qt 3.2.2 - QDateTime dt(QDateTime::fromString(object.attributeNS( ooNS::text, "time-value", QString::null), Qt::ISODate)); + // Use TQDateTime to work around a possible problem of TQTime::FromString in TQt 3.2.2 + TQDateTime dt(TQDateTime::fromString(object.attributeNS( ooNS::text, "time-value", TQString()), Qt::ISODate)); - bool fixed = (object.hasAttributeNS( ooNS::text, "fixed") && object.attributeNS( ooNS::text, "fixed", QString::null)=="true"); + bool fixed = (object.hasAttributeNS( ooNS::text, "fixed") && object.attributeNS( ooNS::text, "fixed", TQString())=="true"); if (!dt.isValid()) { - dt = QDateTime::currentDateTime(); // OOo docs say so :) + dt = TQDateTime::tqcurrentDateTime(); // OOo docs say so :) fixed = false; } - const QTime time(dt.time()); - QDomElement timeElement (doc.createElement("TIME") ); + const TQTime time(dt.time()); + TQDomElement timeElement (doc.createElement("TIME") ); timeElement.setAttribute("fix", fixed ? 1 : 0); timeElement.setAttribute("hour", time.hour()); timeElement.setAttribute("minute", time.minute()); timeElement.setAttribute("second", time.second()); /*if (object.hasAttributeNS( ooNS::text, "time-adjust")) - timeElem.setAttribute("correct", object.attributeNS( ooNS::text, "time-adjust", QString::null));*/ // ### TODO + timeElem.setAttribute("correct", object.attributeNS( ooNS::text, "time-adjust", TQString()));*/ // ### TODO appendKWordVariable(doc, outputFormats, object, pos, "TIME" + dateFormat, 2, timeElement); } @@ -2025,10 +2025,10 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, subtype = 4; // We do NOT include the date value here. It will be retrieved from // meta.xml - QDomElement dateElement ( doc.createElement("DATE") ); + TQDomElement dateElement ( doc.createElement("DATE") ); dateElement.setAttribute("subtype", subtype); if (object.hasAttributeNS( ooNS::text, "date-adjust")) - dateElement.setAttribute("correct", object.attributeNS( ooNS::text, "date-adjust", QString::null)); + dateElement.setAttribute("correct", object.attributeNS( ooNS::text, "date-adjust", TQString())); appendKWordVariable(doc, outputFormats, object, pos, "DATE" + dateFormat, 0, dateElement); } }// end of date/time variables @@ -2038,7 +2038,7 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, if (object.hasAttributeNS( ooNS::text, "select-page")) { - const QString select = object.attributeNS( ooNS::text, "select-page", QString::null); + const TQString select = object.attributeNS( ooNS::text, "select-page", TQString()); if (select == "previous") subtype = 3; // VST_PGNUM_PREVIOUS @@ -2046,16 +2046,16 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, subtype = 4; // VST_PGNUM_NEXT } - QDomElement pgnumElement ( doc.createElement("PGNUM") ); + TQDomElement pgnumElement ( doc.createElement("PGNUM") ); pgnumElement.setAttribute("subtype", subtype); pgnumElement.setAttribute("value", object.text()); appendKWordVariable(doc, outputFormats, object, pos, "NUMBER", 4, pgnumElement); } else if (localName == "chapter") { - const QString display = object.attributeNS( ooNS::text, "display", QString::null ); + const TQString display = object.attributeNS( ooNS::text, "display", TQString() ); // display can be name, number, number-and-name, plain-number-and-name, plain-number - QDomElement pgnumElement ( doc.createElement("PGNUM") ); + TQDomElement pgnumElement ( doc.createElement("PGNUM") ); pgnumElement.setAttribute("subtype", 2); // VST_CURRENT_SECTION pgnumElement.setAttribute("value", object.text()); appendKWordVariable(doc, outputFormats, object, pos, "STRING", 4, pgnumElement); @@ -2066,7 +2066,7 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, if (object.hasAttributeNS( ooNS::text, "display")) { - const QString display = object.attributeNS( ooNS::text, "display", QString::null); + const TQString display = object.attributeNS( ooNS::text, "display", TQString()); if (display == "path") subtype = 1; // VST_DIRECTORYNAME @@ -2078,7 +2078,7 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, subtype = 5; // VST_PATHFILENAME } - QDomElement fieldElement ( doc.createElement("FIELD") ); + TQDomElement fieldElement ( doc.createElement("FIELD") ); fieldElement.setAttribute("subtype", subtype); fieldElement.setAttribute("value", object.text()); appendKWordVariable(doc, outputFormats, object, pos, "STRING", 8, fieldElement); @@ -2101,7 +2101,7 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, else if ( localName == "description" ) subtype = 11; // Abstract - QDomElement authorElem = doc.createElement("FIELD"); + TQDomElement authorElem = doc.createElement("FIELD"); authorElem.setAttribute("subtype", subtype); authorElem.setAttribute("value", object.text()); appendKWordVariable(doc, outputFormats, object, pos, "STRING", 8, authorElem); @@ -2109,7 +2109,7 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, else if ( localName.startsWith( "sender-" ) ) { int subtype = -1; - const QCString afterText( localName.latin1() + 5 ); + const TQCString afterText( localName.latin1() + 5 ); if ( afterText == "sender-company" ) subtype = 4; //VST_COMPANYNAME; else if ( afterText == "sender-firstname" ) @@ -2140,7 +2140,7 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, subtype = 3; // VST_EMAIL; if ( subtype != -1 ) { - QDomElement fieldElem = doc.createElement("FIELD"); + TQDomElement fieldElem = doc.createElement("FIELD"); fieldElem.setAttribute("subtype", subtype); fieldElem.setAttribute("value", object.text()); appendKWordVariable(doc, outputFormats, object, pos, "STRING", 8, fieldElem); @@ -2153,8 +2153,8 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, // - variable-set is related to variable-decls (defined in <body>); // its value can change in the middle of the document. // - user-defined is related to meta::user-defined in meta.xml - QDomElement customElem = doc.createElement( "CUSTOM" ); - customElem.setAttribute( "name", object.attributeNS( ooNS::text, "name", QString::null ) ); + TQDomElement customElem = doc.createElement( "CUSTOM" ); + customElem.setAttribute( "name", object.attributeNS( ooNS::text, "name", TQString() ) ); customElem.setAttribute( "value", object.text() ); appendKWordVariable(doc, outputFormats, object, pos, "STRING", 6, customElem); } @@ -2165,12 +2165,12 @@ void OoWriterImport::appendField(QDomDocument& doc, QDomElement& outputFormats, // TODO localName == "page-variable-get", "initial-creator" and many more } -void OoWriterImport::appendKWordVariable(QDomDocument& doc, QDomElement& formats, const QDomElement& object, uint pos, - const QString& key, int type, QDomElement& child) +void OoWriterImport::appendKWordVariable(TQDomDocument& doc, TQDomElement& formats, const TQDomElement& object, uint pos, + const TQString& key, int type, TQDomElement& child) { - QDomElement variableElement ( doc.createElement("VARIABLE") ); + TQDomElement variableElement ( doc.createElement("VARIABLE") ); - QDomElement typeElement ( doc.createElement("TYPE") ); + TQDomElement typeElement ( doc.createElement("TYPE") ); typeElement.setAttribute("key",key); typeElement.setAttribute("type",type); typeElement.setAttribute("text",object.text()); @@ -2178,7 +2178,7 @@ void OoWriterImport::appendKWordVariable(QDomDocument& doc, QDomElement& formats variableElement.appendChild(child); //Append to <VARIABLE> - QDomElement formatElement ( doc.createElement("FORMAT") ); + TQDomElement formatElement ( doc.createElement("FORMAT") ); formatElement.setAttribute("id",4); // Variable formatElement.setAttribute("pos",pos); // Start position formatElement.setAttribute("len",1); @@ -2188,23 +2188,23 @@ void OoWriterImport::appendKWordVariable(QDomDocument& doc, QDomElement& formats formats.appendChild(formatElement); } -void OoWriterImport::parseTable( QDomDocument &doc, const QDomElement& parent, QDomElement& currentFramesetElement ) +void OoWriterImport::parseTable( TQDomDocument &doc, const TQDomElement& tqparent, TQDomElement& currentFramesetElement ) { - QString tableName ( parent.attributeNS( ooNS::table, "name", QString::null) ); // TODO: what if empty (non-unique?) + TQString tableName ( tqparent.attributeNS( ooNS::table, "name", TQString()) ); // TODO: what if empty (non-unique?) kdDebug(30518) << "Found table " << tableName << endl; // In OOWriter a table is never inside a paragraph, in KWord it is always in a paragraph - QDomElement paragraphElementOut (doc.createElement("PARAGRAPH")); + TQDomElement paragraphElementOut (doc.createElement("PARAGRAPH")); currentFramesetElement.appendChild(paragraphElementOut); - QDomElement textElementOut(doc.createElement("TEXT")); + TQDomElement textElementOut(doc.createElement("TEXT")); textElementOut.appendChild(doc.createTextNode("#")); paragraphElementOut.appendChild(textElementOut); - QDomElement formatsPluralElementOut(doc.createElement("FORMATS")); + TQDomElement formatsPluralElementOut(doc.createElement("FORMATS")); paragraphElementOut.appendChild(formatsPluralElementOut); - QDomElement elementFormat(doc.createElement("FORMAT")); + TQDomElement elementFormat(doc.createElement("FORMAT")); elementFormat.setAttribute("id",6); elementFormat.setAttribute("pos",0); elementFormat.setAttribute("len",1); @@ -2212,38 +2212,38 @@ void OoWriterImport::parseTable( QDomDocument &doc, const QDomElement& parent, Q // ### FIXME: we have no <LAYOUT> element! - QDomElement elementAnchor(doc.createElement("ANCHOR")); + TQDomElement elementAnchor(doc.createElement("ANCHOR")); elementAnchor.setAttribute("type","frameset"); elementAnchor.setAttribute("instance",tableName); elementFormat.appendChild(elementAnchor); // Left position of the cell/column (similar to RTF's \cellx). The last one defined is the right position of the last cell/column - QMemArray<double> columnLefts(4); + TQMemArray<double> columnLefts(4); uint maxColumns=columnLefts.size() - 1; uint col=0; columnLefts[0]=0.0; // Initialize left of first cell - QDomElement elem; - forEachElement( elem, parent ) + TQDomElement elem; + forEachElement( elem, tqparent ) { if ( elem.localName() == "table-column" && elem.namespaceURI() == ooNS::table ) { uint repeat = elem.attributeNS( ooNS::table, "number-columns-repeated", "1").toUInt(); // Default 1 time if (!repeat) repeat=1; // At least one column defined! - const QString styleName ( elem.attributeNS( ooNS::table, "style-name", QString::null) ); + const TQString styleName ( elem.attributeNS( ooNS::table, "style-name", TQString()) ); kdDebug(30518) << "Column " << col << " style " << styleName << endl; - const QDomElement* style=m_styles.find(styleName); + const TQDomElement* style=m_styles.tqfind(styleName); double width=0.0; if (style) { - const QDomElement elemProps( KoDom::namedItemNS( *style, ooNS::style, "properties") ); + const TQDomElement elemProps( KoDom::namedItemNS( *style, ooNS::style, "properties") ); if (elemProps.isNull()) { kdWarning(30518) << "Could not find table column style properties!" << endl; } - const QString strWidth ( elemProps.attributeNS( ooNS::style, "column-width", QString::null) ); + const TQString strWidth ( elemProps.attributeNS( ooNS::style, "column-width", TQString()) ); kdDebug(30518) << "- raw style width " << strWidth << endl; width = KoUnit::parseValue( strWidth ); } @@ -2265,7 +2265,7 @@ void OoWriterImport::parseTable( QDomDocument &doc, const QDomElement& parent, Q { // We need more columns maxColumns+=4; - columnLefts.resize(maxColumns+1, QGArray::SpeedOptim); + columnLefts.resize(maxColumns+1, TQGArray::SpeedOptim); } columnLefts.at(col) = width + columnLefts.at(col-1); kdDebug(30518) << "Cell column " << col-1 << " left " << columnLefts.at(col-1) << " right " << columnLefts.at(col) << endl; @@ -2275,26 +2275,26 @@ void OoWriterImport::parseTable( QDomDocument &doc, const QDomElement& parent, Q uint row=0; uint column=0; - parseInsideOfTable(doc, parent, currentFramesetElement, tableName, columnLefts, row, column); + parseInsideOfTable(doc, tqparent, currentFramesetElement, tableName, columnLefts, row, column); } -void OoWriterImport::parseInsideOfTable( QDomDocument &doc, const QDomElement& parent, QDomElement& currentFramesetElement, - const QString& tableName, const QMemArray<double> & columnLefts, uint& row, uint& column ) +void OoWriterImport::parseInsideOfTable( TQDomDocument &doc, const TQDomElement& tqparent, TQDomElement& currentFramesetElement, + const TQString& tableName, const TQMemArray<double> & columnLefts, uint& row, uint& column ) { kdDebug(30518) << "parseInsideOfTable: columnLefts.size()=" << columnLefts.size() << endl; - QDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); + TQDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); if (framesetsPluralElement.isNull()) { kdError(30518) << "Cannot find KWord's <FRAMESETS>! Cannot process table!" << endl; return; } - QDomElement e; - forEachElement( e, parent ) + TQDomElement e; + forEachElement( e, tqparent ) { m_styleStack.save(); - const QString localName = e.localName(); - const QString ns = e.namespaceURI(); + const TQString localName = e.localName(); + const TQString ns = e.namespaceURI(); if ( ns != ooNS::table ) { kdWarning(30518) << "Skipping element " << e.tagName() << " (in OoWriterImport::parseInsideOfTable)" << endl; continue; @@ -2302,26 +2302,26 @@ void OoWriterImport::parseInsideOfTable( QDomDocument &doc, const QDomElement& p if ( localName == "table-cell" ) // OOo SPEC 4.8.1 p267 { - const QString frameName(i18n("Frameset name","Table %3, row %1, column %2") - .arg(row).arg(column).arg(tableName)); // The table name could have a % sequence, so use the table name as last! + const TQString frameName(i18n("Frameset name","Table %3, row %1, column %2") + .tqarg(row).tqarg(column).tqarg(tableName)); // The table name could have a % sequence, so use the table name as last! kdDebug(30518) << "Trying to create " << frameName << endl; // We need to create a frameset for the cell - QDomElement framesetElement(doc.createElement("FRAMESET")); + TQDomElement framesetElement(doc.createElement("FRAMESET")); framesetElement.setAttribute("frameType",1); framesetElement.setAttribute("frameInfo",0); framesetElement.setAttribute("visible",1); framesetElement.setAttribute("name",frameName); framesetElement.setAttribute("row",row); framesetElement.setAttribute("col",column); - int rowSpan = e.attributeNS( ooNS::table, "number-rows-spanned", QString::null ).toInt(); + int rowSpan = e.attributeNS( ooNS::table, "number-rows-spanned", TQString() ).toInt(); framesetElement.setAttribute("rows",rowSpan == 0 ? 1 : rowSpan); - int colSpan = e.attributeNS( ooNS::table, "number-columns-spanned", QString::null ).toInt(); + int colSpan = e.attributeNS( ooNS::table, "number-columns-spanned", TQString() ).toInt(); framesetElement.setAttribute("cols",colSpan == 0 ? 1 : colSpan); framesetElement.setAttribute("grpMgr",tableName); framesetsPluralElement.appendChild(framesetElement); - QDomElement frameElementOut(doc.createElement("FRAME")); + TQDomElement frameElementOut(doc.createElement("FRAME")); frameElementOut.setAttribute("left",columnLefts.at(column)); frameElementOut.setAttribute("right",columnLefts.at(column+1)); frameElementOut.setAttribute("top", 0); @@ -2368,22 +2368,22 @@ void OoWriterImport::parseInsideOfTable( QDomDocument &doc, const QDomElement& p } } -void OoWriterImport::appendBookmark( QDomDocument& doc, int paragId, int pos, const QString& name ) +void OoWriterImport::appendBookmark( TQDomDocument& doc, int paragId, int pos, const TQString& name ) { appendBookmark( doc, paragId, pos, paragId, pos, name ); } -void OoWriterImport::appendBookmark( QDomDocument& doc, int paragId, int pos, int endParagId, int endPos, const QString& name ) +void OoWriterImport::appendBookmark( TQDomDocument& doc, int paragId, int pos, int endParagId, int endPos, const TQString& name ) { Q_ASSERT( !m_currentFrameset.isNull() ); - const QString frameSetName = m_currentFrameset.attribute( "name" ); + const TQString frameSetName = m_currentFrameset.attribute( "name" ); Q_ASSERT( !frameSetName.isEmpty() ); - QDomElement bookmarks = doc.documentElement().namedItem( "BOOKMARKS" ).toElement(); + TQDomElement bookmarks = doc.documentElement().namedItem( "BOOKMARKS" ).toElement(); if ( bookmarks.isNull() ) { bookmarks = doc.createElement( "BOOKMARKS" ); doc.documentElement().appendChild( bookmarks ); } - QDomElement bkItem = doc.createElement( "BOOKMARKITEM" ); + TQDomElement bkItem = doc.createElement( "BOOKMARKITEM" ); bkItem.setAttribute( "name", name ); bkItem.setAttribute( "frameset", frameSetName ); bkItem.setAttribute( "startparag", paragId ); @@ -2394,13 +2394,13 @@ void OoWriterImport::appendBookmark( QDomDocument& doc, int paragId, int pos, in } // OOo SPEC: 3.6.1 p146 -void OoWriterImport::importFootnotesConfiguration( QDomDocument& doc, const QDomElement& elem, bool endnote ) +void OoWriterImport::importFootnotesConfiguration( TQDomDocument& doc, const TQDomElement& elem, bool endnote ) { - QDomElement docElement( doc.documentElement() ); + TQDomElement docElement( doc.documentElement() ); // can we really be called more than once? - QString elemName = endnote ? "ENDNOTESETTING" : "FOOTNOTESETTING"; + TQString elemName = endnote ? "ENDNOTESETTING" : "FOOTNOTESETTING"; Q_ASSERT( docElement.namedItem( elemName ).isNull() ); - QDomElement settings = doc.createElement( elemName ); + TQDomElement settings = doc.createElement( elemName ); docElement.appendChild( settings ); // BUG in OO (both 1.0.1 and 1.1). It saves it with an off-by-one (reported to xml@). @@ -2408,33 +2408,33 @@ void OoWriterImport::importFootnotesConfiguration( QDomDocument& doc, const QDom // let's ignore this for now. #if 0 if ( elem.hasAttributeNS( ooNS::text, "start-value" ) ) { - int startValue = elem.attributeNS( ooNS::text, "start-value", QString::null ).toInt(); + int startValue = elem.attributeNS( ooNS::text, "start-value", TQString() ).toInt(); settings.setAttribute( "start", startValue ); } #endif - settings.setAttribute( "type", Conversion::importCounterType( elem.attributeNS( ooNS::style, "num-format", QString::null ) ) ); - settings.setAttribute( "lefttext", elem.attributeNS( ooNS::style, "num-prefix", QString::null ) ); - settings.setAttribute( "righttext", elem.attributeNS( ooNS::style, "num-suffix", QString::null ) ); + settings.setAttribute( "type", Conversion::importCounterType( elem.attributeNS( ooNS::style, "num-format", TQString() ) ) ); + settings.setAttribute( "lefttext", elem.attributeNS( ooNS::style, "num-prefix", TQString() ) ); + settings.setAttribute( "righttext", elem.attributeNS( ooNS::style, "num-suffix", TQString() ) ); } -void OoWriterImport::appendTOC( QDomDocument& doc, const QDomElement& toc ) +void OoWriterImport::appendTOC( TQDomDocument& doc, const TQDomElement& toc ) { // table-of-content OOo SPEC 7.5 p452 //fillStyleStack( toc, ooNS::text, "style-name" ); that's the section style - //QDomElement tocSource = KoDom::namedItemNS( toc, ooNS::text, "table-of-content-source" ); + //TQDomElement tocSource = KoDom::namedItemNS( toc, ooNS::text, "table-of-content-source" ); // TODO parse templates and generate "Contents ..." styles from it - //for ( QDomNode n(tocSource.firstChild()); !text.isNull(); text = text.nextSibling() ) + //for ( TQDomNode n(tocSource.firstChild()); !text.isNull(); text = text.nextSibling() ) //{ //} - QDomElement tocIndexBody = KoDom::namedItemNS( toc, ooNS::text, "index-body" ); - QDomElement t; + TQDomElement tocIndexBody = KoDom::namedItemNS( toc, ooNS::text, "index-body" ); + TQDomElement t; forEachElement( t, tocIndexBody ) { m_styleStack.save(); - const QString localName = t.localName(); - QDomElement e; + const TQString localName = t.localName(); + TQDomElement e; bool isTextNS = e.namespaceURI() == ooNS::text; if ( isTextNS && localName == "index-title" ) { parseBodyOrSimilar( doc, t, m_currentFrameset ); // recurse again @@ -2454,10 +2454,10 @@ void OoWriterImport::appendTOC( QDomDocument& doc, const QDomElement& toc ) // TODO style:num-format, default number format for page styles, // used for page numbers (2.3.1) -void OoWriterImport::finishDocumentContent( QDomDocument& mainDocument ) +void OoWriterImport::finishDocumentContent( TQDomDocument& mainDocument ) { - QDomElement attributes = mainDocument.createElement( "ATTRIBUTES" ); - QDomElement docElement = mainDocument.documentElement(); + TQDomElement attributes = mainDocument.createElement( "ATTRIBUTES" ); + TQDomElement docElement = mainDocument.documentElement(); docElement.appendChild( attributes ); attributes.setAttribute( "hasTOC", m_hasTOC ? 1 : 0 ); attributes.setAttribute( "hasHeader", m_hasHeader ); @@ -2467,7 +2467,7 @@ void OoWriterImport::finishDocumentContent( QDomDocument& mainDocument ) // Done at the end: write the type of headers/footers, // depending on which kind of headers and footers we received. - QDomElement paperElement = docElement.namedItem("PAPER").toElement(); + TQDomElement paperElement = docElement.namedItem("PAPER").toElement(); Q_ASSERT ( !paperElement.isNull() ); // writePageLayout should have been called! if ( !paperElement.isNull() ) { @@ -2477,22 +2477,22 @@ void OoWriterImport::finishDocumentContent( QDomDocument& mainDocument ) } } -QString OoWriterImport::kWordStyleName( const QString& ooStyleName ) +TQString OoWriterImport::kWordStyleName( const TQString& ooStyleName ) { if ( ooStyleName.startsWith( "Contents " ) ) { - QString s( ooStyleName ); - return s.replace( 0, 9, QString("Contents Head ") ); // Awful hack for KWord's broken "update TOC" feature + TQString s( ooStyleName ); + return s.tqreplace( 0, 9, TQString("Contents Head ") ); // Awful hack for KWord's broken "update TOC" feature } else { return ooStyleName; } } // OOo SPEC: 2.3.3 p59 -void OoWriterImport::importHeaderFooter( QDomDocument& doc, const QDomElement& headerFooter, bool hasEvenOdd, QDomElement& style ) +void OoWriterImport::importHeaderFooter( TQDomDocument& doc, const TQDomElement& headerFooter, bool hasEvenOdd, TQDomElement& style ) { - const QString localName = headerFooter.localName(); - QDomElement framesetElement = doc.createElement("FRAMESET"); - QDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); + const TQString localName = headerFooter.localName(); + TQDomElement framesetElement = doc.createElement("FRAMESET"); + TQDomElement framesetsPluralElement (doc.documentElement().namedItem("FRAMESETS").toElement()); framesetElement.setAttribute( "frameType", 1 /* text */); framesetElement.setAttribute( "frameInfo", Conversion::headerTypeToFrameInfo( localName, hasEvenOdd ) ); framesetElement.setAttribute( "name", Conversion::headerTypeToFramesetName( localName, hasEvenOdd ) ); @@ -2503,7 +2503,7 @@ void OoWriterImport::importHeaderFooter( QDomDocument& doc, const QDomElement& h m_hasHeader = true; else m_hasFooter = true; - QDomElement frameElementOut = createInitialFrame( framesetElement, 29, 798, isHeader?0:567, isHeader?41:567+41, true, Copy ); + TQDomElement frameElementOut = createInitialFrame( framesetElement, 29, 798, isHeader?0:567, isHeader?41:567+41, true, Copy ); if ( !style.isNull() ) m_styleStack.push( style ); importCommonFrameProperties( frameElementOut ); diff --git a/filters/kword/oowriter/oowriterimport.h b/filters/kword/oowriter/oowriterimport.h index b3949d67..1b646c2e 100644 --- a/filters/kword/oowriter/oowriterimport.h +++ b/filters/kword/oowriter/oowriterimport.h @@ -23,8 +23,8 @@ #include <KoFilter.h> -#include <qdict.h> -#include <qdom.h> +#include <tqdict.h> +#include <tqdom.h> #include <KoStyleStack.h> #include <liststylestack.h> @@ -33,94 +33,95 @@ class KZip; class OoWriterImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - OoWriterImport( KoFilter * parent, const char * name, const QStringList & ); + OoWriterImport( KoFilter * tqparent, const char * name, const TQStringList & ); virtual ~OoWriterImport(); - virtual KoFilter::ConversionStatus convert( QCString const & from, QCString const & to ); + virtual KoFilter::ConversiontqStatus convert( TQCString const & from, TQCString const & to ); private: - void prepareDocument( QDomDocument& mainDocument, QDomElement& framesetsElem ); - void finishDocumentContent( QDomDocument& mainDocument ); - void writePageLayout( QDomDocument& mainDocument, const QString& masterPageName ); - void parseList( QDomDocument& doc, const QDomElement& list, QDomElement& currentFramesetElement ); - bool pushListLevelStyle( const QString& listStyleName, int level ); - bool pushListLevelStyle( const QString& listStyleName, QDomElement& fullListStyle, int level ); - void applyListStyle( QDomDocument& doc, QDomElement& layoutElement, const QDomElement& paragraph ); - void writeCounter( QDomDocument& doc, QDomElement& layoutElement, bool heading, int level, bool ordered ); - QDomElement parseParagraph( QDomDocument& doc, const QDomElement& paragraph ); - void parseSpanOrSimilar( QDomDocument& doc, const QDomElement& parent, QDomElement& kwordParagraph, QDomElement& kwordFormats, QString& paragraphText, uint& pos); - // Reads from m_styleStack, writes the text properties to parentElement - void writeFormat( QDomDocument& doc, QDomElement& parentElement, int id, int pos, int length ); - // Reads from m_styleStack, writes the paragraph properties to layoutElement - void writeLayout( QDomDocument& doc, QDomElement& layoutElement ); + void prepareDocument( TQDomDocument& mainDocument, TQDomElement& framesetsElem ); + void finishDocumentContent( TQDomDocument& mainDocument ); + void writePageLayout( TQDomDocument& mainDocument, const TQString& masterPageName ); + void parseList( TQDomDocument& doc, const TQDomElement& list, TQDomElement& currentFramesetElement ); + bool pushListLevelStyle( const TQString& listStyleName, int level ); + bool pushListLevelStyle( const TQString& listStyleName, TQDomElement& fullListStyle, int level ); + void applyListStyle( TQDomDocument& doc, TQDomElement& tqlayoutElement, const TQDomElement& paragraph ); + void writeCounter( TQDomDocument& doc, TQDomElement& tqlayoutElement, bool heading, int level, bool ordered ); + TQDomElement parseParagraph( TQDomDocument& doc, const TQDomElement& paragraph ); + void parseSpanOrSimilar( TQDomDocument& doc, const TQDomElement& tqparent, TQDomElement& kwordParagraph, TQDomElement& kwordFormats, TQString& paragraphText, uint& pos); + // Reads from m_styleStack, writes the text properties to tqparentElement + void writeFormat( TQDomDocument& doc, TQDomElement& tqparentElement, int id, int pos, int length ); + // Reads from m_styleStack, writes the paragraph properties to tqlayoutElement + void writeLayout( TQDomDocument& doc, TQDomElement& tqlayoutElement ); enum NewFrameBehavior { Reconnect=0, NoFollowup=1, Copy=2 }; - QDomElement createInitialFrame( QDomElement& parentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ); - void createStyles( QDomDocument &doc ); - void createDocumentInfo( QDomDocument &docinfo ); - void createDocumentContent( QDomDocument &doccontent, QDomElement& mainFramesetElement ); - void parseBodyOrSimilar( QDomDocument &doc, const QDomElement& parent, QDomElement& currentFramesetElement ); - KoFilter::ConversionStatus loadAndParse(const QString& filename, QDomDocument& doc); - KoFilter::ConversionStatus openFile(); - bool createStyleMap( const QDomDocument & styles, QDomDocument& doc ); - void insertStyles( const QDomElement& element, QDomDocument& doc ); - void importDateTimeStyle( const QDomElement& parent ); - void fillStyleStack( const QDomElement& object, const char* nsURI, const QString& attrName ); - void addStyles( const QDomElement* style ); - void importFootnotesConfiguration( QDomDocument& doc, const QDomElement& elem, bool endnote ); - void importFootnote( QDomDocument& doc, const QDomElement& object, QDomElement& formats, uint pos, const QString& tagName ); - QString appendPicture( QDomDocument& doc, const QDomElement& object ); - QString appendTextBox( QDomDocument& doc, const QDomElement& object ); - void appendTOC( QDomDocument& doc, const QDomElement& toc ); - void importFrame( QDomElement& frameElementOut, const QDomElement& object, bool isText ); - void importCommonFrameProperties( QDomElement& frameElementOut ); - void importHeaderFooter( QDomDocument& doc, const QDomElement& headerFooter, bool isHeader, QDomElement& style ); - void anchorFrameset( QDomDocument& doc, QDomElement& formats, uint pos, const QString& frameName ); - void appendField(QDomDocument& doc, QDomElement& outputFormats, QDomElement& object, uint pos); - void appendKWordVariable(QDomDocument& doc, QDomElement& formats, const QDomElement& object, uint pos, - const QString& key, int type, QDomElement& child); - void appendBookmark( QDomDocument& doc, int paragId, int pos, const QString& name ); - void appendBookmark( QDomDocument& doc, int paragId, int pos, int endParagId, int endPos, const QString& name ); - void parseTable( QDomDocument &doc, const QDomElement& parent, QDomElement& currentFramesetElement ); - void parseInsideOfTable( QDomDocument &doc, const QDomElement& parent, QDomElement& currentFramesetElement, - const QString& tableName, const QMemArray<double> & columnLefts, uint& row, uint& column ); - static QString kWordStyleName( const QString& ooStyleName ); - - QDomDocument m_content; - QDomDocument m_meta; - QDomDocument m_settings; - QDomDocument m_stylesDoc; - - QDict<QDomElement> m_styles; - QDict<QDomElement> m_masterPages; - QDict<QDomElement> m_listStyles; + TQDomElement createInitialFrame( TQDomElement& tqparentFramesetElem, double left, double right, double top, double bottom, bool autoExtend, NewFrameBehavior nfb ); + void createStyles( TQDomDocument &doc ); + void createDocumentInfo( TQDomDocument &docinfo ); + void createDocumentContent( TQDomDocument &doccontent, TQDomElement& mainFramesetElement ); + void parseBodyOrSimilar( TQDomDocument &doc, const TQDomElement& tqparent, TQDomElement& currentFramesetElement ); + KoFilter::ConversiontqStatus loadAndParse(const TQString& filename, TQDomDocument& doc); + KoFilter::ConversiontqStatus openFile(); + bool createStyleMap( const TQDomDocument & styles, TQDomDocument& doc ); + void insertStyles( const TQDomElement& element, TQDomDocument& doc ); + void importDateTimeStyle( const TQDomElement& tqparent ); + void fillStyleStack( const TQDomElement& object, const char* nsURI, const TQString& attrName ); + void addStyles( const TQDomElement* style ); + void importFootnotesConfiguration( TQDomDocument& doc, const TQDomElement& elem, bool endnote ); + void importFootnote( TQDomDocument& doc, const TQDomElement& object, TQDomElement& formats, uint pos, const TQString& tagName ); + TQString appendPicture( TQDomDocument& doc, const TQDomElement& object ); + TQString appendTextBox( TQDomDocument& doc, const TQDomElement& object ); + void appendTOC( TQDomDocument& doc, const TQDomElement& toc ); + void importFrame( TQDomElement& frameElementOut, const TQDomElement& object, bool isText ); + void importCommonFrameProperties( TQDomElement& frameElementOut ); + void importHeaderFooter( TQDomDocument& doc, const TQDomElement& headerFooter, bool isHeader, TQDomElement& style ); + void anchorFrameset( TQDomDocument& doc, TQDomElement& formats, uint pos, const TQString& frameName ); + void appendField(TQDomDocument& doc, TQDomElement& outputFormats, TQDomElement& object, uint pos); + void appendKWordVariable(TQDomDocument& doc, TQDomElement& formats, const TQDomElement& object, uint pos, + const TQString& key, int type, TQDomElement& child); + void appendBookmark( TQDomDocument& doc, int paragId, int pos, const TQString& name ); + void appendBookmark( TQDomDocument& doc, int paragId, int pos, int endParagId, int endPos, const TQString& name ); + void parseTable( TQDomDocument &doc, const TQDomElement& tqparent, TQDomElement& currentFramesetElement ); + void parseInsideOfTable( TQDomDocument &doc, const TQDomElement& tqparent, TQDomElement& currentFramesetElement, + const TQString& tableName, const TQMemArray<double> & columnLefts, uint& row, uint& column ); + static TQString kWordStyleName( const TQString& ooStyleName ); + + TQDomDocument m_content; + TQDomDocument m_meta; + TQDomDocument m_settings; + TQDomDocument m_stylesDoc; + + TQDict<TQDomElement> m_styles; + TQDict<TQDomElement> m_masterPages; + TQDict<TQDomElement> m_listStyles; KoStyleStack m_styleStack; - QDomElement m_defaultStyle; + TQDomElement m_defaultStyle; ListStyleStack m_listStyleStack; - QDomElement m_outlineStyle; + TQDomElement m_outlineStyle; bool m_insideOrderedList; bool m_nextItemIsListItem; // only the first elem inside list-item is numbered bool m_hasTOC; bool m_hasHeader; bool m_hasFooter; int m_restartNumbering; - QString m_currentListStyleName; - QString m_currentMasterPage; - QDomElement m_currentFrameset; // set by parseBodyOrSimilar + TQString m_currentListStyleName; + TQString m_currentMasterPage; + TQDomElement m_currentFrameset; // set by parseBodyOrSimilar struct BookmarkStart { - BookmarkStart() {} // for stupid QValueList - BookmarkStart( const QString&s, int par, int ind ) + BookmarkStart() {} // for stupid TQValueList + BookmarkStart( const TQString&s, int par, int ind ) : frameSetName( s ), paragId( par ), pos( ind ) {} - QString frameSetName; + TQString frameSetName; int paragId; int pos; }; - typedef QMap<QString, BookmarkStart> BookmarkStartsMap; + typedef TQMap<TQString, BookmarkStart> BookmarkStartsMap; BookmarkStartsMap m_bookmarkStarts; - typedef QMap<QString, QString> DataFormatsMap; + typedef TQMap<TQString, TQString> DataFormatsMap; DataFormatsMap m_dateTimeFormats; // maybe generalize to include number formats. uint m_pictureNumber; // Number of the picture (increment *before* use) diff --git a/filters/kword/palmdoc/palmdb.cpp b/filters/kword/palmdoc/palmdb.cpp index 0a1aac4a..65a83518 100644 --- a/filters/kword/palmdoc/palmdb.cpp +++ b/filters/kword/palmdoc/palmdb.cpp @@ -18,19 +18,19 @@ */ /* - The database layout for PalmDB files is described in + The database tqlayout for PalmDB files is described in http://www.palmos.com/dev/support/docs/protein_books/FileFormats/Intro.html */ #include "palmdb.h" -#include <qcstring.h> -#include <qdatastream.h> -#include <qdatetime.h> -#include <qfile.h> -#include <qmemarray.h> -#include <qptrlist.h> -#include <qstring.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqdatetime.h> +#include <tqfile.h> +#include <tqmemarray.h> +#include <tqptrlist.h> +#include <tqstring.h> PalmDB::PalmDB() { @@ -38,11 +38,11 @@ PalmDB::PalmDB() setName( "Unnamed" ); setAttributes( 0 ); setVersion( 0 ); - setCreationDate( QDateTime::currentDateTime() ); - setModificationDate( QDateTime::currentDateTime() ); - setLastBackupDate( QDateTime::currentDateTime() ); - setType( QString::null ); - setCreator( QString::null ); + setCreationDate( TQDateTime::tqcurrentDateTime() ); + setModificationDate( TQDateTime::tqcurrentDateTime() ); + setLastBackupDate( TQDateTime::tqcurrentDateTime() ); + setType( TQString() ); + setCreator( TQString() ); // crash if autodelete ? records.setAutoDelete( TRUE ); @@ -56,80 +56,80 @@ PalmDB::~PalmDB() bool PalmDB::load( const char* filename ) { // open input file - QFile in (filename); + TQFile in (filename); if (!in.open (IO_ReadOnly)) return FALSE; - QDataStream stream; + TQDataStream stream; stream.setDevice (&in); unsigned filesize = stream.device()->size(); if( filesize < 72 ) return FALSE; // always big-endian - stream.setByteOrder (QDataStream::BigEndian); + stream.setByteOrder (TQDataStream::BigEndian); // now start to read PDB header (72 bytes) // read and encode database name // The name field is 32 bytes long, and is NUL terminated. - // Use the length parameter of fromLatin1() anyway. - Q_UINT8 name[32]; + // Use the length parameter of tqfromLatin1() anyway. + TQ_UINT8 name[32]; for(int k = 0; k < 32; k++) stream >> name[k]; - m_name = QString::fromLatin1( (char*) name, 31 ); + m_name = TQString::tqfromLatin1( (char*) name, 31 ); // read database attribute - Q_UINT16 attr; + TQ_UINT16 attr; stream >> attr; m_attributes = attr; // read database version (app-specific) - Q_UINT16 ver; + TQ_UINT16 ver; stream >> ver; m_version = ver; // NOTE: PDB specifies date as number of seconds since 1 Jan 1904 - // QDateTime::setTime_t expects number of seconds since 1 Jan 1970 + // TQDateTime::setTime_t expects number of seconds since 1 Jan 1970 // so, we make adjustment with a constant offset of 2082844800 const int adjust = 2082844800; // read creation date - Q_UINT32 creation; + TQ_UINT32 creation; stream >> creation; m_creationDate.setTime_t( creation - adjust ); // read modification date - Q_UINT32 modification; + TQ_UINT32 modification; stream >> modification; m_modificationDate.setTime_t( modification - adjust ); // read last backup date - Q_UINT32 lastbackup; + TQ_UINT32 lastbackup; stream >> lastbackup; m_lastBackupDate.setTime_t( lastbackup - adjust ); // read modification number - Q_UINT32 modnum; + TQ_UINT32 modnum; stream >> modnum; // read app info id and sort info id - Q_UINT32 appid, sortid; + TQ_UINT32 appid, sortid; stream >> appid; stream >> sortid; // read and encode database type - Q_UINT8 dbt[4]; + TQ_UINT8 dbt[4]; stream >> dbt[0] >> dbt[1] >> dbt[2] >> dbt[3]; - m_type = QString::fromLatin1( (char*) dbt, 4 ); + m_type = TQString::tqfromLatin1( (char*) dbt, 4 ); // read and encode database creator - Q_UINT8 dbc[4]; + TQ_UINT8 dbc[4]; stream >> dbc[0] >> dbc[1] >> dbc[2] >> dbc[3]; - m_creator = QString::fromLatin1( (char*) dbc, 4 ); + m_creator = TQString::tqfromLatin1( (char*) dbc, 4 ); // read unique id seed - Q_UINT32 idseed; + TQ_UINT32 idseed; stream >> idseed; m_uniqueIDSeed = idseed; @@ -137,23 +137,23 @@ bool PalmDB::load( const char* filename ) // next record list // FIXME what to do with this ? - Q_UINT32 nextlist; + TQ_UINT32 nextlist; stream >> nextlist; // number of records - Q_UINT16 numrec; + TQ_UINT16 numrec; stream >> numrec; // read entries in record list // find out location and size of each record - QMemArray<unsigned> recpos( numrec ); - QMemArray<int> recsize( numrec ); + TQMemArray<unsigned> recpos( numrec ); + TQMemArray<int> recsize( numrec ); // FIXME any other better way to find record size ? for( int r = 0; r < numrec; r++ ) { - Q_UINT32 pos; - Q_UINT8 flag, dummy; + TQ_UINT32 pos; + TQ_UINT8 flag, dummy; stream >> pos >> flag >> dummy >> dummy >> dummy; recpos[r] = pos; recsize[r] = filesize - pos; if( r> 0 ) recsize[r-1] = pos - recpos[r-1]; // fixup @@ -178,15 +178,15 @@ bool PalmDB::load( const char* filename ) records.clear(); for( int r = 0; r < numrec; r++ ) { - QByteArray* data = new QByteArray; + TQByteArray* data = new TQByteArray; if( recpos[r] < filesize ) if( recsize[r] >= 0 ) { data->resize( recsize[r] ); - stream.device()->at( recpos[r] ); + stream.tqdevice()->at( recpos[r] ); for( int q = 0; q < recsize[r]; q++ ) - { Q_UINT8 c; stream >> c; data->at(q) = c; } + { TQ_UINT8 c; stream >> c; data->tqat(q) = c; } } records.append( data ); } @@ -200,15 +200,15 @@ bool PalmDB::load( const char* filename ) bool PalmDB::save( const char* filename ) { // open output file - QFile out( filename ); + TQFile out( filename ); if( !out.open( IO_WriteOnly ) ) return FALSE; - QDataStream stream; + TQDataStream stream; stream.setDevice( &out ); // always big-endian - stream.setByteOrder (QDataStream::BigEndian); + stream.setByteOrder (TQDataStream::BigEndian); // now write PDB header (72 bytes) @@ -217,85 +217,85 @@ bool PalmDB::save( const char* filename ) const char *dbname = m_name.latin1(); for( unsigned k=0; k<31; k++ ) { - Q_UINT8 c = (k<m_name.length()) ? dbname[k] : 0; + TQ_UINT8 c = (k<m_name.length()) ? dbname[k] : 0; stream << c; } { // NUL-terminate the database name - Q_UINT8 c = 0; + TQ_UINT8 c = 0; stream << c; } // write database attribute - Q_UINT16 attr = m_attributes; + TQ_UINT16 attr = m_attributes; stream << attr; // write database version (app-specific) - Q_UINT16 ver = m_version; + TQ_UINT16 ver = m_version; stream << ver; // reference date is 1 Jan 1904 // see also note in function load() above - QDateTime ref = QDate( 1904, 1, 1 ); + TQDateTime ref = TQDate( 1904, 1, 1 ); // write creation date - Q_UINT32 creation = -m_creationDate.secsTo( ref ); + TQ_UINT32 creation = -m_creationDate.secsTo( ref ); stream << creation; // write modification date - Q_UINT32 modification = -m_modificationDate.secsTo( ref ); + TQ_UINT32 modification = -m_modificationDate.secsTo( ref ); stream << modification; // write last backup date - Q_UINT32 lastbackup = -m_lastBackupDate.secsTo( ref ); + TQ_UINT32 lastbackup = -m_lastBackupDate.secsTo( ref ); stream << lastbackup; // write modification number - Q_UINT32 modnum = 0; + TQ_UINT32 modnum = 0; stream << modnum; // write app info id and sort info id - Q_UINT32 appid = 0, sortid = 0; + TQ_UINT32 appid = 0, sortid = 0; stream << appid; stream << sortid; // write and encode database type - Q_UINT8 dbt[4]; + TQ_UINT8 dbt[4]; const char *dbtype = m_type.latin1(); for( int p=0; p<4; p++ ) dbt[p]=dbtype[p]; stream << dbt[0] << dbt[1] << dbt[2] << dbt[3]; // write and encode database creator - Q_UINT8 dbc[4]; + TQ_UINT8 dbc[4]; const char *dbcreator = m_creator.latin1(); for( int p=0; p<4; p++ ) dbc[p]=dbcreator[p]; stream << dbc[0] << dbc[1] << dbc[2] << dbc[3]; // write unique id seed - Q_UINT32 idseed = 0; + TQ_UINT32 idseed = 0; stream << idseed; // now start to read PDB record list (variable-length) // next record list - Q_UINT32 nextlist = 0; + TQ_UINT32 nextlist = 0; stream << nextlist; // number of records - Q_UINT16 numrec = records.count(); + TQ_UINT16 numrec = records.count(); stream << numrec; // where is the first record ? // 78 is size of PDB header, 2 is filler before data - Q_UINT32 pos = 78 + 2; + TQ_UINT32 pos = 78 + 2; pos += records.count()*8; // write record list for( unsigned r = 0; r < records.count(); r++ ) { - Q_UINT8 flag = 0, dummy = 0; + TQ_UINT8 flag = 0, dummy = 0; stream << pos; stream << flag; stream << dummy << dummy << dummy; @@ -303,17 +303,17 @@ bool PalmDB::save( const char* filename ) } // write 2-byte dummy - Q_UINT16 filler = 0; + TQ_UINT16 filler = 0; stream << filler; // write all records for( unsigned r = 0; r < records.count(); r++ ) { - QByteArray *data = records.at( r ); + TQByteArray *data = records.at( r ); if( !data ) continue; for( unsigned j=0; j<data->count(); j++ ) { - Q_UINT8 c = data->at( j ); + TQ_UINT8 c = data->at( j ); stream << c; } } @@ -324,7 +324,7 @@ bool PalmDB::save( const char* filename ) return TRUE; } -void PalmDB::setType( const QString& t ) +void PalmDB::setType( const TQString& t ) { m_type = t; if( m_type.length() > 4 ) @@ -334,7 +334,7 @@ void PalmDB::setType( const QString& t ) } -void PalmDB::setCreator( const QString& c ) +void PalmDB::setCreator( const TQString& c ) { m_creator = c; if( m_creator.length() > 4 ) diff --git a/filters/kword/palmdoc/palmdb.h b/filters/kword/palmdoc/palmdb.h index c98255f0..709df734 100644 --- a/filters/kword/palmdoc/palmdb.h +++ b/filters/kword/palmdoc/palmdb.h @@ -20,10 +20,10 @@ #ifndef __PALMDB_H #define __PALMDB_H -#include <qcstring.h> -#include <qdatetime.h> -#include <qptrlist.h> -#include <qstring.h> +#include <tqcstring.h> +#include <tqdatetime.h> +#include <tqptrlist.h> +#include <tqstring.h> class PalmDB { @@ -35,8 +35,8 @@ class PalmDB virtual bool load( const char* filename ); virtual bool save( const char* filename ); - QString name(){ return m_name; } - void setName( const QString& n ){ m_name = n; } + TQString name(){ return m_name; } + void setName( const TQString& n ){ m_name = n; } int attributes(){ return m_attributes; } void setAttributes( int a ){ m_attributes = a; } @@ -44,35 +44,35 @@ class PalmDB int version(){ return m_version; } void setVersion( int v ){ m_version = v; } - QDateTime creationDate(){ return m_creationDate; } - void setCreationDate( QDateTime d ){ m_creationDate = d; } + TQDateTime creationDate(){ return m_creationDate; } + void setCreationDate( TQDateTime d ){ m_creationDate = d; } - QDateTime modificationDate(){ return m_modificationDate; } - void setModificationDate( QDateTime d ){ m_modificationDate = d; } + TQDateTime modificationDate(){ return m_modificationDate; } + void setModificationDate( TQDateTime d ){ m_modificationDate = d; } - QDateTime lastBackupDate(){ return m_lastBackupDate; } - void setLastBackupDate( QDateTime d ){ m_lastBackupDate = d; } + TQDateTime lastBackupDate(){ return m_lastBackupDate; } + void setLastBackupDate( TQDateTime d ){ m_lastBackupDate = d; } - QString type(){ return m_type; } - QString creator(){ return m_creator; } + TQString type(){ return m_type; } + TQString creator(){ return m_creator; } - void setType( const QString& t ); - void setCreator( const QString& c ); + void setType( const TQString& t ); + void setCreator( const TQString& c ); int uniqueIDSeed(){ return m_uniqueIDSeed; } void setUniqueIDSeed( int i ){ m_uniqueIDSeed= i; } - QPtrList<QByteArray> records; + TQPtrList<TQByteArray> records; private: - QString m_name; + TQString m_name; int m_attributes, m_version; - QDateTime m_creationDate; - QDateTime m_modificationDate; - QDateTime m_lastBackupDate; - QString m_type; - QString m_creator; + TQDateTime m_creationDate; + TQDateTime m_modificationDate; + TQDateTime m_lastBackupDate; + TQString m_type; + TQString m_creator; int m_uniqueIDSeed; }; diff --git a/filters/kword/palmdoc/palmdoc.cpp b/filters/kword/palmdoc/palmdoc.cpp index 2f5bfd76..791fa356 100644 --- a/filters/kword/palmdoc/palmdoc.cpp +++ b/filters/kword/palmdoc/palmdoc.cpp @@ -19,15 +19,15 @@ #include "palmdoc.h" -#include <qcstring.h> -#include <qdatetime.h> -#include <qptrlist.h> -#include <qstring.h> +#include <tqcstring.h> +#include <tqdatetime.h> +#include <tqptrlist.h> +#include <tqstring.h> PalmDoc::PalmDoc(): PalmDB() { m_result = PalmDoc::OK; - setText( QString::null ); + setText( TQString() ); } PalmDoc::~PalmDoc() @@ -70,7 +70,7 @@ bool PalmDoc::load( const char* filename ) // the very first record is DOC header // NOTE: this is not PDB header (which is handled in PalmDB) ! - QByteArray header( *records.at( 0 ) ); + TQByteArray header( *records.at( 0 ) ); // format of the DOC int format = (header[0]<<8) + header[1]; @@ -86,14 +86,14 @@ bool PalmDoc::load( const char* filename ) } // initialize - setText( QString::null ); + setText( TQString() ); // assemble the records - QByteArray rec; + TQByteArray rec; unsigned i = 0; for( unsigned r = 1; r < records.count(); r++ ) { - QByteArray *p = records.at( r ); + TQByteArray *p = records.at( r ); if( !p ) continue; rec.resize( rec.size() + p->size() ); for( unsigned s=0; s<p->size(); s++ ) @@ -106,7 +106,7 @@ bool PalmDoc::load( const char* filename ) // if the text is not compressed, simply append as string if( format == 1 ) - setText( QString::fromLatin1( rec.data(),rec.count() ) ); + setText( TQString::tqfromLatin1( rec.data(),rec.count() ) ); // done m_result = OK; @@ -120,19 +120,19 @@ bool PalmDoc::save( const char* filename ) setCreator( "REAd" ); // "touch" the database :-) - setModificationDate( QDateTime::currentDateTime() ); + setModificationDate( TQDateTime::tqcurrentDateTime() ); // Palm record size is always 4 KB unsigned recsize = 4096; // compress the text - QByteArray data = compress( text() ); + TQByteArray data = compress( text() ); // prepare the records records.clear(); for( unsigned i=0; i<data.count(); ) { - QByteArray* ptr = new QByteArray; + TQByteArray* ptr = new TQByteArray; unsigned rs = data.count() - i; if( rs > recsize ) rs = recsize; ptr->resize( rs ); @@ -142,7 +142,7 @@ bool PalmDoc::save( const char* filename ) } // prepare the header - QByteArray header( 16 ); + TQByteArray header( 16 ); int docsize = m_text.length(); header[0] = 0; header[1] = 2; // 1=plain, 2=compressed header[2] = header[3] = 0; // reserved word, set to 0 @@ -158,7 +158,7 @@ bool PalmDoc::save( const char* filename ) header[14] = header[15] = 0; // header should be the very first record - records.prepend( new QByteArray( header ) ); + records.prepend( new TQByteArray( header ) ); // write to file bool ok = PalmDB::save( filename ); @@ -174,9 +174,9 @@ bool PalmDoc::save( const char* filename ) } // TODO describe in brief about compression algorithm -QByteArray PalmDoc::compress( const QString& text ) +TQByteArray PalmDoc::compress( const TQString& text ) { - QByteArray result; + TQByteArray result; unsigned textlen = text.length(); const char *ctext = text.latin1(); unsigned int i, j; @@ -247,9 +247,9 @@ QByteArray PalmDoc::compress( const QString& text ) #define INRANGE(v,p,q) ((v)>=(p))&&((v)<=(q)) // TODO describe in brief about decompression algorithm -QString PalmDoc::uncompress( QByteArray rec ) +TQString PalmDoc::uncompress( TQByteArray rec ) { - QString result; + TQString result; for( unsigned i = 0; i < rec.size(); i++ ) { diff --git a/filters/kword/palmdoc/palmdoc.h b/filters/kword/palmdoc/palmdoc.h index 43a358e2..6a1203f2 100644 --- a/filters/kword/palmdoc/palmdoc.h +++ b/filters/kword/palmdoc/palmdoc.h @@ -21,7 +21,7 @@ #define __PALMDOC_H #include "palmdb.h" -#include <qstring.h> +#include <tqstring.h> class PalmDoc: public PalmDB { @@ -35,18 +35,18 @@ class PalmDoc: public PalmDB int result(){ return m_result; } - QString text(){ return m_text; } - void setText( const QString& t){ m_text = t; } + TQString text(){ return m_text; } + void setText( const TQString& t){ m_text = t; } enum { OK, ReadError, InvalidFormat, WriteError }; private: int m_result; - QString m_text; + TQString m_text; - QByteArray compress( const QString& text ); - QString uncompress( QByteArray rec ); + TQByteArray compress( const TQString& text ); + TQString uncompress( TQByteArray rec ); }; #endif diff --git a/filters/kword/palmdoc/palmdocexport.cc b/filters/kword/palmdoc/palmdocexport.cc index 1760a0be..5e18ff6f 100644 --- a/filters/kword/palmdoc/palmdocexport.cc +++ b/filters/kword/palmdoc/palmdocexport.cc @@ -23,9 +23,9 @@ #include <unistd.h> #endif -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -48,20 +48,20 @@ public: PalmDocWorker(void) { } virtual ~PalmDocWorker(void) { } public: - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); virtual bool doFullDocumentInfo(const KWEFDocumentInfo& docInfo); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); private: - QString title; - QString outfile; - QString text; + TQString title; + TQString outfile; + TQString text; }; -bool PalmDocWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool PalmDocWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { outfile = filenameOut; return TRUE; @@ -71,7 +71,7 @@ bool PalmDocWorker::doCloseFile(void) { if( title.isEmpty() ) { - QFileInfo info( outfile ); + TQFileInfo info( outfile ); title = info.baseName(); } @@ -85,7 +85,7 @@ bool PalmDocWorker::doCloseFile(void) bool PalmDocWorker::doOpenDocument(void) { - text = QString::null; + text = TQString(); return TRUE; } @@ -100,8 +100,8 @@ bool PalmDocWorker::doFullDocumentInfo( const KWEFDocumentInfo& docInfo ) return TRUE; } -bool PalmDocWorker::doFullParagraph(const QString& paraText, - const LayoutData& /*layout*/, const ValueListFormatData& /*paraFormatDataList*/) +bool PalmDocWorker::doFullParagraph(const TQString& paraText, + const LayoutData& /*tqlayout*/, const ValueListFormatData& /*paraFormatDataList*/) { kdDebug(30525) << "Entering ::doFullParagraph" << endl; text.append( paraText ); @@ -110,13 +110,13 @@ bool PalmDocWorker::doFullParagraph(const QString& paraText, return TRUE; } -PalmDocExport::PalmDocExport( KoFilter *, const char *, const QStringList& ): +PalmDocExport::PalmDocExport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } -KoFilter::ConversionStatus PalmDocExport::convert( const QCString& from, - const QCString& to ) +KoFilter::ConversiontqStatus PalmDocExport::convert( const TQCString& from, + const TQCString& to ) { // check for proper conversion if( to!= "application/vnd.palm" || from != "application/x-kword" ) @@ -125,7 +125,7 @@ KoFilter::ConversionStatus PalmDocExport::convert( const QCString& from, PalmDocWorker* worker = new PalmDocWorker(); KWEFKWordLeader* leader = new KWEFKWordLeader( worker ); - KoFilter::ConversionStatus result; + KoFilter::ConversiontqStatus result; result = leader->convert( m_chain, from, to ); delete worker; diff --git a/filters/kword/palmdoc/palmdocexport.h b/filters/kword/palmdoc/palmdocexport.h index 5d8559ef..f63bed73 100644 --- a/filters/kword/palmdoc/palmdocexport.h +++ b/filters/kword/palmdoc/palmdocexport.h @@ -26,15 +26,16 @@ class PalmDocExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - PalmDocExport(KoFilter *parent, const char *name, const QStringList&); + PalmDocExport(KoFilter *tqparent, const char *name, const TQStringList&); PalmDocExport(); virtual ~PalmDocExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __PALMDOCEXPORT_H diff --git a/filters/kword/palmdoc/palmdocimport.cc b/filters/kword/palmdoc/palmdocimport.cc index 3f0047cc..f659cad0 100644 --- a/filters/kword/palmdoc/palmdocimport.cc +++ b/filters/kword/palmdoc/palmdocimport.cc @@ -23,9 +23,9 @@ #include <unistd.h> #endif -#include <qfileinfo.h> -#include <qstringlist.h> -#include <qfont.h> +#include <tqfileinfo.h> +#include <tqstringlist.h> +#include <tqfont.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -41,19 +41,19 @@ typedef KGenericFactory<PalmDocImport, KoFilter> PalmDocImportFactory; K_EXPORT_COMPONENT_FACTORY( libpalmdocimport, PalmDocImportFactory( "kofficefilters" ) ) -PalmDocImport::PalmDocImport( KoFilter *, const char *, const QStringList& ): +PalmDocImport::PalmDocImport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } -KoFilter::ConversionStatus PalmDocImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus PalmDocImport::convert( const TQCString& from, const TQCString& to ) { // check for proper conversion if( to!= "application/x-kword" || from != "application/vnd.palm" ) return KoFilter::NotImplemented; PalmDoc doc; - QString inputFile( m_chain->inputFile() ); + TQString inputFile( m_chain->inputFile() ); doc.load( inputFile.latin1() ); if( doc.result() == PalmDoc::InvalidFormat ) @@ -61,32 +61,32 @@ KoFilter::ConversionStatus PalmDocImport::convert( const QCString& from, const Q if( doc.result() == PalmDoc::ReadError ) return KoFilter::FileNotFound; - QString root = processPlainDocument( doc.text() ); + TQString root = processPlainDocument( doc.text() ); // prepare storage KoStoreDevice *out=m_chain->storageFile( "root", KoStore::Write ); if( out ) { - QCString cstring = root.utf8(); + TQCString cstring = root.utf8(); cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); out->writeBlock( (const char*) cstring, cstring.length() ); } - QString docTitle = doc.name(); + TQString docTitle = doc.name(); if( docTitle.isEmpty() ) { - QFileInfo info( inputFile ); + TQFileInfo info( inputFile ); docTitle = info.baseName(); } - QString documentInfo = processDocumentInfo( docTitle ); + TQString documentInfo = processDocumentInfo( docTitle ); // store document info out = m_chain->storageFile( "documentinfo.xml", KoStore::Write ); if( out ) { - QCString cstring = documentInfo.utf8(); + TQCString cstring = documentInfo.utf8(); cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); out->writeBlock( (const char*) cstring, cstring.length() ); } @@ -94,50 +94,50 @@ KoFilter::ConversionStatus PalmDocImport::convert( const QCString& from, const Q return KoFilter::OK; } -QString PalmDocImport::processPlainParagraph( QString text ) +TQString PalmDocImport::processPlainParagraph( TQString text ) { - QString formats, layout, result; + TQString formats, tqlayout, result; // specify FORMAT (just empty element) formats.append ( " <FORMAT id=\"1\" pos=\"0\" len=\"" + - QString::number( text.length() )+ "\">\n" ); + TQString::number( text.length() )+ "\">\n" ); formats.append ( " </FORMAT>\n" ); - QFont font = KoGlobal::defaultFont(); - QString fontFamily = font.family(); + TQFont font = KoGlobal::defaultFont(); + TQString fontFamily = font.family(); double fontSize = font.pointSizeFloat(); // default LAYOUT - layout.append( "<LAYOUT>\n" ); - layout.append( " <NAME value=\"Standard\" />\n" ); - layout.append( " <FLOW align=\"left\" />\n" ); - layout.append( " <LINESPACING value=\"0\" />\n" ); - layout.append( " <LEFTBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <RIGHTBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <TOPBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <BOTTOMBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <INDENTS />\n" ); - layout.append( " <OFFSETS after=\"9\" />\n" ); - layout.append( " <PAGEBREAKING />\n" ); - layout.append( " <COUNTER />\n" ); - layout.append( " <FORMAT id=\"1\">\n" ); - layout.append( " <SIZE value=\"" + QString::number( fontSize ) + "\" />\n" ); - layout.append( " <WEIGHT value=\"50\" />\n" ); - layout.append( " <ITALIC value=\"0\" />\n" ); - layout.append( " <UNDERLINE value=\"0\" />\n" ); - layout.append( " <STRIKEOUT value=\"0\" />\n" ); - layout.append( " <CHARSET value=\"0\" />\n" ); - layout.append( " <VERTALIGN value=\"0\" />\n" ); - layout.append( " <FONT name=\"" + fontFamily + "\" />\n" ); - layout.append( " </FORMAT>\n" ); - layout.append( "</LAYOUT>\n" ); + tqlayout.append( "<LAYOUT>\n" ); + tqlayout.append( " <NAME value=\"Standard\" />\n" ); + tqlayout.append( " <FLOW align=\"left\" />\n" ); + tqlayout.append( " <LINESPACING value=\"0\" />\n" ); + tqlayout.append( " <LEFTBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <RIGHTBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <TOPBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <BOTTOMBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <INDENTS />\n" ); + tqlayout.append( " <OFFSETS after=\"9\" />\n" ); + tqlayout.append( " <PAGEBREAKING />\n" ); + tqlayout.append( " <COUNTER />\n" ); + tqlayout.append( " <FORMAT id=\"1\">\n" ); + tqlayout.append( " <SIZE value=\"" + TQString::number( fontSize ) + "\" />\n" ); + tqlayout.append( " <WEIGHT value=\"50\" />\n" ); + tqlayout.append( " <ITALIC value=\"0\" />\n" ); + tqlayout.append( " <UNDERLINE value=\"0\" />\n" ); + tqlayout.append( " <STRIKEOUT value=\"0\" />\n" ); + tqlayout.append( " <CHARSET value=\"0\" />\n" ); + tqlayout.append( " <VERTALIGN value=\"0\" />\n" ); + tqlayout.append( " <FONT name=\"" + fontFamily + "\" />\n" ); + tqlayout.append( " </FORMAT>\n" ); + tqlayout.append( "</LAYOUT>\n" ); // encode text for XML-ness - text.replace( '&', "&" ); - text.replace( '<', "<" ); - text.replace( '>', ">" ); - text.replace( '"', """ ); - text.replace( '\'', "'" ); + text.tqreplace( '&', "&" ); + text.tqreplace( '<', "<" ); + text.tqreplace( '>', ">" ); + text.tqreplace( '"', """ ); + text.tqreplace( '\'', "'" ); // construct the <PARAGRAPH> result.append( "<PARAGRAPH>\n" ); @@ -145,22 +145,22 @@ QString PalmDocImport::processPlainParagraph( QString text ) result.append( "<FORMATS>\n"); result.append( formats ); result.append( "</FORMATS>\n"); - result.append( layout ); + result.append( tqlayout ); result.append( "</PARAGRAPH>\n" ); return result; } -QString PalmDocImport::processPlainDocument( QString plaindoc ) +TQString PalmDocImport::processPlainDocument( TQString plaindoc ) { - QString prolog, content, epilog; - QStringList paragraphs; + TQString prolog, content, epilog; + TQStringList paragraphs; - paragraphs = QStringList::split( "\n\n", plaindoc, TRUE ); + paragraphs = TQStringList::split( "\n\n", plaindoc, TRUE ); for( unsigned int i = 0; i < paragraphs.count(); i++ ) { - QString text = paragraphs[i]; - text.replace( '\n', ' ' ); + TQString text = paragraphs[i]; + text.tqreplace( '\n', ' ' ); content.append( processPlainParagraph( text ) ); } @@ -184,9 +184,9 @@ QString PalmDocImport::processPlainDocument( QString plaindoc ) return prolog + content + epilog; } -QString PalmDocImport::processDocumentInfo( const QString &title ) +TQString PalmDocImport::processDocumentInfo( const TQString &title ) { - QString documentInfo; + TQString documentInfo; documentInfo = "<!DOCTYPE document-info>\n"; diff --git a/filters/kword/palmdoc/palmdocimport.h b/filters/kword/palmdoc/palmdocimport.h index 872e86a1..0f934933 100644 --- a/filters/kword/palmdoc/palmdocimport.h +++ b/filters/kword/palmdoc/palmdocimport.h @@ -20,7 +20,7 @@ #ifndef __PALMDOCIMPORT_H #define __PALMDOCIMPORT_H -#include <qstring.h> +#include <tqstring.h> #include <KoFilter.h> #include <KoStore.h> @@ -28,21 +28,22 @@ class PalmDocImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - PalmDocImport(KoFilter *parent, const char *name, const QStringList&); + PalmDocImport(KoFilter *tqparent, const char *name, const TQStringList&); PalmDocImport(); virtual ~PalmDocImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: - QString processPlainParagraph( QString text ); - QString processPlainDocument( QString plaindoc ); - QString processDocumentInfo( const QString &title ); + TQString processPlainParagraph( TQString text ); + TQString processPlainDocument( TQString plaindoc ); + TQString processDocumentInfo( const TQString &title ); }; #endif // __PALMDOCIMPORT_H diff --git a/filters/kword/pdf/DESIGN b/filters/kword/pdf/DESIGN index 0775afbf..1208b8db 100644 --- a/filters/kword/pdf/DESIGN +++ b/filters/kword/pdf/DESIGN @@ -9,7 +9,7 @@ PDFImport::convert | |- Dialog: ask for import options | - |- Document::paperSize/pageOrientation: extract paper size/orientation + |- Document::paperSize/pageQt::Orientation: extract paper size/orientation | |- for each page | | @@ -59,7 +59,7 @@ PDFImport::convert | | | | | |- associate links | | | - | | |- Page::initParagraph: compute tabs, indents and alignments + | | |- Page::initParagraph: compute tabs, indents and tqalignments | | | | | |- Page::fillParagrap: remove hyphen/eol, add tabs, add text | | | diff --git a/filters/kword/pdf/FilterDevice.cpp b/filters/kword/pdf/FilterDevice.cpp index f7a67d8e..0d840fc3 100644 --- a/filters/kword/pdf/FilterDevice.cpp +++ b/filters/kword/pdf/FilterDevice.cpp @@ -35,7 +35,7 @@ namespace PDFImport { Device::Device(Data &data) - : _data(data), _fillColor(Qt::white), _strokeColor(Qt::black) + : _data(data), _fillColor(TQt::white), _strokeColor(TQt::black) { _pages.setAutoDelete(true); } @@ -196,14 +196,14 @@ void Device::addImage() } // add image - QString name = QString("pictures/picture%1.png").arg(_data.imageIndex()); - QDomElement frameset = _data.pictureFrameset(_currentImage.rect); + TQString name = TQString("pictures/picture%1.png").tqarg(_data.imageIndex()); + TQDomElement frameset = _data.pictureFrameset(_currentImage.rect); current()->pictures.append(frameset); - QDomElement picture = _data.createElement("PICTURE"); + TQDomElement picture = _data.createElement("PICTURE"); picture.setAttribute("keepAspectRatio", "false"); frameset.appendChild(picture); - QDomElement key = _data.createElement("KEY"); + TQDomElement key = _data.createElement("KEY"); key.setAttribute("msec", 0); key.setAttribute("second", 0); key.setAttribute("minute", 0); @@ -227,7 +227,7 @@ void Device::addImage() _data.pictures().appendChild(key); KoStoreDevice *sd = _data.chain()->storageFile(name, KoStore::Write); - QImageIO io(sd, "PNG"); + TQImageIO io(sd, "PNG"); io.setImage(_currentImage.image); bool ok = io.write(); Q_ASSERT(ok); @@ -253,9 +253,9 @@ void Device::computeGeometry(GfxState *state, Image &image) uint Device::initImage(GfxState *state, int width, int height, bool withMask) { - // get image geometry + // get image tqgeometry Image image; - image.mask = withMask; + image.tqmask = withMask; computeGeometry(state, image); // check if new image @@ -263,28 +263,28 @@ uint Device::initImage(GfxState *state, int width, int height, // << " " << _currentImage.rect.left() // << " " << _currentImage.rect.right() // << " " << _currentImage.rect.bottom() -// << " " << _currentImage.mask << endl; +// << " " << _currentImage.tqmask << endl; // kdDebug(30516) << "new image " << width // << " " << image.rect.left() << " " << image.rect.right() // << " " << image.rect.top() -// << " " << image.mask << endl; +// << " " << image.tqmask << endl; if ( !_currentImage.image.isNull() && (_currentImage.image.width()!=width || !equal(image.rect.left(), _currentImage.rect.left()) || !equal(image.rect.right(), _currentImage.rect.right()) || !equal(image.rect.top(), _currentImage.rect.bottom()) - || image.mask!=_currentImage.mask) ) + || image.tqmask!=_currentImage.tqmask) ) addImage(); uint offset = (_currentImage.image.isNull() ? 0 : _currentImage.image.height()); - image.image = QImage(width, offset + height, 32); + image.image = TQImage(width, offset + height, 32); image.image.setAlphaBuffer(withMask); if ( !_currentImage.image.isNull() ) { // copy previous // kdDebug(30516) << "image continued..." << endl; for (int j=0; j<_currentImage.image.height(); j++) { - QRgb *pix = (QRgb *)_currentImage.image.scanLine(j); - QRgb *newPix = (QRgb *)image.image.scanLine(j); + TQRgb *pix = (TQRgb *)_currentImage.image.scanLine(j); + TQRgb *newPix = (TQRgb *)image.image.scanLine(j); for (int i=0; i<width; i++) newPix[i] = pix[i]; } _currentImage.image = image.image; @@ -295,14 +295,14 @@ uint Device::initImage(GfxState *state, int width, int height, void Device::drawImage(GfxState *state, Object *, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg) + int *tqmaskColors, GBool inlineImg) { kdDebug(30516) << "image kind=" << str->getKind() << " inline=" << inlineImg - << " maskColors=" << (maskColors!=0) << endl; + << " tqmaskColors=" << (tqmaskColors!=0) << endl; if ( !_data.options().importImages ) return; - uint offset = initImage(state, width, height, maskColors!=0); + uint offset = initImage(state, width, height, tqmaskColors!=0); // read pixels int nbComps = colorMap->getNumPixelComps(); @@ -311,20 +311,20 @@ void Device::drawImage(GfxState *state, Object *, Stream *str, istr->reset(); for (int j=0; j<height; j++) { Guchar *p = istr->getLine(); - QRgb *pix = (QRgb *)_currentImage.image.scanLine(offset + j); + TQRgb *pix = (TQRgb *)_currentImage.image.scanLine(offset + j); for (int i=0; i<width; i++) { GfxRGB rgb; colorMap->getRGB(p, &rgb); int alpha = 255; - if (maskColors) { + if (tqmaskColors) { for (int k=0; k<nbComps; k++) - if ( p[k]<maskColors[2*k] || p[k]>maskColors[2*k+1] ) { + if ( p[k]<tqmaskColors[2*k] || p[k]>tqmaskColors[2*k+1] ) { alpha = 0; break; } } - pix[i] = qRgba(qRound(rgb.r*255), qRound(rgb.g*255), - qRound(rgb.b*255), alpha); + pix[i] = tqRgba(tqRound(rgb.r*255), tqRound(rgb.g*255), + tqRound(rgb.b*255), alpha); p += nbComps; } } @@ -335,7 +335,7 @@ void Device::drawImageMask(GfxState *state, Object *, Stream *str, int width, int height, GBool invert, GBool inlineImg) { - kdDebug(30516) << "image mask ! kind=" << str->getKind() + kdDebug(30516) << "image tqmask ! kind=" << str->getKind() << "inline=" << inlineImg << endl; if ( !_data.options().importImages ) return; @@ -344,17 +344,17 @@ void Device::drawImageMask(GfxState *state, Object *, Stream *str, // read pixels GfxRGB rgb; state->getFillRGB(&rgb); - int red = qRound(rgb.r * 255); - int green = qRound(rgb.g * 255); - int blue = qRound(rgb.b * 255); + int red = tqRound(rgb.r * 255); + int green = tqRound(rgb.g * 255); + int blue = tqRound(rgb.b * 255); ImageStream *istr = new ImageStream(str, width, 1, 1); str->reset(); for (int j=0; j<height; j++) { Guchar *p = istr->getLine(); - QRgb *pix = (QRgb *)_currentImage.image.scanLine(offset + j); + TQRgb *pix = (TQRgb *)_currentImage.image.scanLine(offset + j); for (int i=0; i<width; i++) - pix[i] = qRgba(red, green, blue, 255 * p[i]); + pix[i] = tqRgba(red, green, blue, 255 * p[i]); } delete istr; @@ -394,8 +394,8 @@ void Device::stroke(GfxState */*state*/) // _currentImage.rect = path[i].boundingRect(); // _currentImage.rect.bottom+=1; // _currentImage.image = -// QImage(qRound(_currentImage.rect.width()), -// qRound(_currentImage.rect.height()), 32); +// TQImage(tqRound(_currentImage.rect.width()), +// tqRound(_currentImage.rect.height()), 32); // _currentImage.image.fill(_fillColor.pixel()); // addImage(); // } else if ( path[i].isVerticalSegment() ) { @@ -426,8 +426,8 @@ void Device::doFill(const DPathVector &path) if ( !_currentImage.image.isNull() ) addImage(); _currentImage.rect = path[i].boundingRect(); _currentImage.image = - QImage(qRound(_currentImage.rect.width()), - qRound(_currentImage.rect.height()), 32); + TQImage(tqRound(_currentImage.rect.width()), + tqRound(_currentImage.rect.height()), 32); _currentImage.image.fill(_fillColor.pixel()); addImage(); } diff --git a/filters/kword/pdf/FilterDevice.h b/filters/kword/pdf/FilterDevice.h index 0901f0e6..3318b4ac 100644 --- a/filters/kword/pdf/FilterDevice.h +++ b/filters/kword/pdf/FilterDevice.h @@ -20,7 +20,7 @@ #ifndef FILTERDEVICE_H #define FILTERDEVICE_H -#include <qimage.h> +#include <tqimage.h> class Object; class Stream; @@ -86,7 +86,7 @@ public: GBool inlineImg); virtual void drawImage(GfxState *, Object *ref, Stream *, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg); + int *tqmaskColors, GBool inlineImg); //----- path painting virtual void stroke(GfxState *state); @@ -96,7 +96,7 @@ public: private: class Image; static void computeGeometry(GfxState *, Image &); - uint initImage(GfxState *, int width, int height, bool mask); + uint initImage(GfxState *, int width, int height, bool tqmask); void addImage(); void clear(); static DPathVector convertPath(GfxState *); @@ -105,17 +105,17 @@ private: private: Data &_data; - QPtrList<Page> _pages; - QColor _fillColor, _strokeColor; + TQPtrList<Page> _pages; + TQColor _fillColor, _strokeColor; class Image { public: - QImage image; + TQImage image; DRect rect; - bool mask; + bool tqmask; }; Image _currentImage; - typedef QValueList<Image> ImageList; + typedef TQValueList<Image> ImageList; ImageList _images; }; diff --git a/filters/kword/pdf/FilterPage.cpp b/filters/kword/pdf/FilterPage.cpp index 6d1829aa..aefa2acc 100644 --- a/filters/kword/pdf/FilterPage.cpp +++ b/filters/kword/pdf/FilterPage.cpp @@ -82,10 +82,10 @@ void Page::addString(TextString *str) // if ( str->len==0 ) kdDebug(30516) << "empty string !" << endl; if (_lastStr) _lastStr->checkCombination(str); _lastStr = (str->len==0 ? 0 : static_cast<String *>(str)); -// QString s; -// for (int i=0; i<str->len; i++) s += QChar(str->text[i]); +// TQString s; +// for (int i=0; i<str->len; i++) s += TQChar(str->text[i]); // kdDebug(30516) << "string: " << s << " (" -// << (str->len>0 ? s[0].unicode() : 0) << ")" << endl; +// << (str->len>0 ? s[0].tqunicode() : 0) << ")" << endl; TextPage::addString(str); // kdDebug(30516) << " ...addString done" << endl; } @@ -125,7 +125,7 @@ bool Page::isLastParagraphLine(TextLine *line, const Paragraph &par) if ( line->next && line->next->blocks->next ) return true; TextBlock *b = block(line, -1); if ( b==0 || b->len==0 ) return false; // should not happen - QChar c = QChar(b->text[b->len-1]); + TQChar c = TQChar(b->text[b->len-1]); // last line char is not '.' or ':' if ( c!='.' && c!=':' ) return false; // if at line end and block aligned : same paragraph @@ -228,7 +228,7 @@ void Page::initParagraph(Paragraph &par) const const double pright = _rects[par.type].right(); const double pmean = (pleft + pright) / 2; - QValueList<TextLine *>::const_iterator it; + TQValueList<TextLine *>::const_iterator it; for (it = par.lines().begin(); it!=par.lines().end(); ++it) { // compute tabulations @@ -245,9 +245,9 @@ void Page::initParagraph(Paragraph &par) const if ( res==-1 ) { tab.pos = dx; if (tabRightAligned) { - tab.alignment = Tabulator::Right; + tab.tqalignment = Tabulator::Right; kdDebug(30516) << "tabulated text right aligned.." << endl; - } else tab.alignment = Tabulator::Left; + } else tab.tqalignment = Tabulator::Left; par.tabs.push_back(tab); } } @@ -262,14 +262,14 @@ void Page::initParagraph(Paragraph &par) const else par.leftIndent = kMin(par.leftIndent, left); } - // compute alignment + // compute tqalignment for (it = par.lines().begin(); it!=par.lines().end(); ++it) { double left = (*it)->blocks->xMin; double right = block(*it, -1)->xMax; double mean = (left + right) / 2; -// QString text; +// TQString text; // for (int i=0; i<kMin(4, (*it)->blocks->len); i++) -// text += QChar((*it)->blocks->text[i]); +// text += TQChar((*it)->blocks->text[i]); // kdDebug(30516) << text << " left=" << left // << " pleft=" << pleft + par.leftIndent // << " indent=" << par.leftIndent @@ -287,7 +287,7 @@ void Page::initParagraph(Paragraph &par) const } } - // finalize alignment + // finalize tqalignment if (rightAligned) par.align = (leftAligned ? AlignBlock : AlignRight); else if (centered) par.align = AlignCenter; } @@ -302,7 +302,7 @@ void Page::fillParagraph(Paragraph &par, double &offset) const // << " paroffset=" << par.offset << endl; if ( par.offset>0 ) offset += par.offset; - QValueList<TextLine *>::const_iterator it; + TQValueList<TextLine *>::const_iterator it; for (it = par.lines().begin(); it!=par.lines().end(); ++it) { // end of previous line (inside a paragraph) if ( !par.isFirst(*it) ) { @@ -312,17 +312,17 @@ void Page::fillParagraph(Paragraph &par, double &offset) const uint bi, pbi; int si = par.charFromEnd(0, bi); Q_ASSERT( si>=0 ); - QChar c = par.blocks[bi].text[si]; + TQChar c = par.blocks[bi].text[si]; int psi = par.charFromEnd(1, pbi); - QChar prev = (psi<0 ? QChar::null : par.blocks[pbi].text[psi]); - if ( !prev.isNull() && type(c.unicode())==Hyphen ) - kdDebug(30516) << "hyphen ? " << QString(prev) - << " type=" << type(prev.unicode()) + TQChar prev = (psi<0 ? TQChar::null : par.blocks[pbi].text[psi]); + if ( !prev.isNull() && type(c.tqunicode())==Hyphen ) + kdDebug(30516) << "hyphen ? " << TQString(prev) + << " type=" << type(prev.tqunicode()) << endl; TextString *next = ((*it)->next ? (*it)->next->blocks->strings : 0); - if ( !prev.isNull() && type(c.unicode())==Hyphen - && isLetter( type(prev.unicode()) ) + if ( !prev.isNull() && type(c.tqunicode())==Hyphen + && isLetter( type(prev.tqunicode()) ) && next && next->len>0 && isLetter( type(next->text[next->len-1]) ) ) { kdDebug(30516) << "found hyphen" << endl; @@ -370,7 +370,7 @@ void Page::fillParagraph(Paragraph &par, double &offset) const for (TextString *str = blk->strings; str; str = str->next) { Block b; for (uint k = 0; k<uint(str->len); k++) - b.text += QChar(str->text[k]); + b.text += TQChar(str->text[k]); if (str->spaceAfter) b.text += ' '; String *fstr = static_cast<String *>(str); b.font = fstr->font(); @@ -386,10 +386,10 @@ void Page::fillParagraph(Paragraph &par, double &offset) const } } -FontFamily Page::checkSpecial(QChar &c, const Font &font) const +FontFamily Page::checkSpecial(TQChar &c, const Font &font) const { Unicode res = 0; - switch ( PDFImport::checkSpecial(c.unicode(), res) ) { + switch ( PDFImport::checkSpecial(c.tqunicode(), res) ) { case Bullet: kdDebug(30516) << "found bullet" << endl; // #### FIXME : if list, use a COUNTER @@ -405,7 +405,7 @@ FontFamily Page::checkSpecial(QChar &c, const Font &font) const kdDebug(30516) << "found latex special" << endl; return Times; case SpecialSymbol: - kdDebug(30516) << "found symbol=" << c.unicode() << endl; + kdDebug(30516) << "found symbol=" << c.tqunicode() << endl; return Times; //return Symbol; default: @@ -417,20 +417,20 @@ FontFamily Page::checkSpecial(QChar &c, const Font &font) const void Page::checkSpecialChars(Paragraph &par) const { - QValueList<Block> blocks; + TQValueList<Block> blocks; for (uint k=0; k<par.blocks.size(); k++) { const Block &b = par.blocks[k]; - QString res; + TQString res; // kdDebug(30516) << "check \"" << b.text << "\"" << endl; for (uint l=0; l<b.text.length(); l++) { - QChar c = b.text[l]; + TQChar c = b.text[l]; FontFamily family = checkSpecial(c, b.font); if ( family==Nb_Family ) res += c; else { if ( !res.isEmpty() ) { blocks.push_back(b); blocks.back().text = res; - res = QString::null; + res = TQString(); } blocks.push_back(b); blocks.back().font.setFamily(family); @@ -447,7 +447,7 @@ void Page::checkSpecialChars(Paragraph &par) const void Page::coalesce(Paragraph &par) const { - QValueList<Block> blocks; + TQValueList<Block> blocks; blocks.push_back(par.blocks[0]); for (uint k=1; k<par.blocks.size(); k++) { const Block &b = par.blocks[k]; @@ -530,34 +530,34 @@ void Page::prepare() void Page::dump(const Paragraph &par) { - QValueVector<QDomElement> layouts; - QValueVector<QDomElement> formats; + TQValueVector<TQDomElement> tqlayouts; + TQValueVector<TQDomElement> formats; // tabulations for (uint k=0; k<par.tabs.size(); k++) { - QDomElement element = par.tabs[k].createElement(_data); - layouts.push_back(element); + TQDomElement element = par.tabs[k].createElement(_data); + tqlayouts.push_back(element); } // indents if ( !_data.options().smart || par.align!=AlignCenter ) { - QDomElement element = _data.createElement("INDENTS"); + TQDomElement element = _data.createElement("INDENTS"); element.setAttribute("left", par.leftIndent); double delta = par.firstIndent - par.leftIndent; if ( !equal(delta, 0) ) element.setAttribute("first", delta); - layouts.push_back(element); + tqlayouts.push_back(element); } // offset before if ( par.offset>0 ) { - QDomElement element = _data.createElement("OFFSETS"); + TQDomElement element = _data.createElement("OFFSETS"); element.setAttribute("before", par.offset); - layouts.push_back(element); + tqlayouts.push_back(element); } // flow if (_data.options().smart) { - QString flow; + TQString flow; // kdDebug(30516) << "flow=" << par.align << endl; switch (par.align) { case AlignLeft: break; @@ -566,28 +566,28 @@ void Page::dump(const Paragraph &par) case AlignBlock: flow = "justify"; break; } if ( !flow.isEmpty() ) { - QDomElement element = _data.createElement("FLOW"); - element.setAttribute("align", flow.utf8()); - layouts.push_back(element); + TQDomElement element = _data.createElement("FLOW"); + element.setAttribute("align", TQString(flow.utf8())); + tqlayouts.push_back(element); } } // text and formats - QString text; + TQString text; uint pos = 0; for (uint k=0; k<par.blocks.size(); k++) { const Block &b = par.blocks[k]; text += (b.link ? "#" : b.text); uint len = (b.link ? 1 : b.text.length()); - QDomElement element = _data.createElement("FORMAT"); - QDomDocument document = _data.document(); + TQDomElement element = _data.createElement("FORMAT"); + TQDomDocument document = _data.document(); bool r = b.font.format(document, element, pos, len); if (b.link) b.link->format(document, element, pos, b.text); if ( r || b.link ) formats.push_back(element); pos += len; } - _data.createParagraph(text, par.type, layouts, formats); + _data.createParagraph(text, par.type, tqlayouts, formats); } void Page::dump() diff --git a/filters/kword/pdf/FilterPage.h b/filters/kword/pdf/FilterPage.h index c56f78c7..234eb6e7 100644 --- a/filters/kword/pdf/FilterPage.h +++ b/filters/kword/pdf/FilterPage.h @@ -22,8 +22,8 @@ #include "TextOutputDev.h" -#include <qdatetime.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqptrlist.h> #include "fstring.h" @@ -39,7 +39,7 @@ class Page : public TextPage public: Page(Data &data); - QValueVector<DRect> &rects() { return _rects; } + TQValueVector<DRect> &rects() { return _rects; } bool hasHeader() const; bool hasFooter() const; @@ -56,10 +56,10 @@ public: void dump(); public: - QValueList<QDomElement> pictures; + TQValueList<TQDomElement> pictures; private: - FontFamily checkSpecial(QChar &, const Font &) const; + FontFamily checkSpecial(TQChar &, const Font &) const; static TextBlock *block(TextLine *, int index); static bool isLastParagraphLine(TextLine *, const Paragraph &); @@ -78,11 +78,11 @@ private: private: Data &_data; - QValueList<Paragraph> _pars; - QPtrList<Link> _links; + TQValueList<Paragraph> _pars; + TQPtrList<Link> _links; String *_lastStr; - QTime _time; // debug - QValueVector<DRect> _rects; + TQTime _time; // debug + TQValueVector<DRect> _rects; }; } // namespace diff --git a/filters/kword/pdf/data.cpp b/filters/kword/pdf/data.cpp index 57d07b36..90fdc731 100644 --- a/filters/kword/pdf/data.cpp +++ b/filters/kword/pdf/data.cpp @@ -37,7 +37,7 @@ Data::Data(KoFilterChain *chain, const DRect &pageRect, _textFramesets(Nb_ParagraphTypes), _pageRect(pageRect), _options(options) { - _document = QDomDocument("DOC"); + _document = TQDomDocument("DOC"); _document.appendChild( _document.createProcessingInstruction( "xml","version=\"1.0\" encoding=\"UTF-8\"")); @@ -48,7 +48,7 @@ Data::Data(KoFilterChain *chain, const DRect &pageRect, _mainElement.setAttribute("syntaxVersion", 2); _document.appendChild(_mainElement); - QDomElement element = _document.createElement("ATTRIBUTES"); + TQDomElement element = _document.createElement("ATTRIBUTES"); element.setAttribute("processing", 1); element.setAttribute("hasHeader", 0); element.setAttribute("hasFooter", 0); @@ -71,10 +71,10 @@ Data::Data(KoFilterChain *chain, const DRect &pageRect, _mainElement.appendChild(_framesets); // standard style - QDomElement styles = _document.createElement("STYLES"); + TQDomElement styles = _document.createElement("STYLES"); _mainElement.appendChild(styles); - QDomElement style = _document.createElement("STYLE"); + TQDomElement style = _document.createElement("STYLE"); styles.appendChild(style); element = _document.createElement("FORMAT"); @@ -99,25 +99,25 @@ Data::Data(KoFilterChain *chain, const DRect &pageRect, _mainElement.appendChild(_bookmarks); } -QDomElement Data::pictureFrameset(const DRect &r) +TQDomElement Data::pictureFrameset(const DRect &r) { - QDomElement frameset = createFrameset(Picture, QString::null); - QDomElement frame = createFrame(Picture, r, false); + TQDomElement frameset = createFrameset(Picture, TQString()); + TQDomElement frame = createFrame(Picture, r, false); frameset.appendChild(frame); return frameset; } -QDomElement Data::createFrameset(FramesetType type, const QString &n) +TQDomElement Data::createFrameset(FramesetType type, const TQString &n) { bool text = (type==Text); uint &index = (text ? _textIndex : _imageIndex); - QDomElement frameset = _document.createElement("FRAMESET"); + TQDomElement frameset = _document.createElement("FRAMESET"); frameset.setAttribute("frameType", (text ? 1 : 2)); - QString name = n; + TQString name = n; if ( name.isNull() ) name = (text ? i18n("Text Frameset %1") - : i18n("Picture %1")).arg(index); + : i18n("Picture %1")).tqarg(index); frameset.setAttribute("name", name); frameset.setAttribute("frameInfo", 0); @@ -127,14 +127,14 @@ QDomElement Data::createFrameset(FramesetType type, const QString &n) return frameset; } -QDomElement Data::createFrame(FramesetType type, const DRect &r, +TQDomElement Data::createFrame(FramesetType type, const DRect &r, bool forceMainFrameset) { bool text = (type==Text); bool mainFrameset = (text ? (forceMainFrameset ? true : _textIndex==1) : false); - QDomElement frame = _document.createElement("FRAME"); + TQDomElement frame = _document.createElement("FRAME"); if (text) frame.setAttribute("autoCreateNewFrame", 0); frame.setAttribute("newFrameBehavior", 1); frame.setAttribute("runaround", 0); @@ -147,26 +147,26 @@ QDomElement Data::createFrame(FramesetType type, const DRect &r, return frame; } -void Data::initPage(const QValueVector<DRect> &rects, - const QValueList<QDomElement> &pictures) +void Data::initPage(const TQValueVector<DRect> &rects, + const TQValueList<TQDomElement> &pictures) { for (uint i=0; i<Nb_ParagraphTypes; i++) { // kdDebug(30516) << "page #" << pageIndex << " rect #" << i // << ": " << rects[i].toString() << endl; if ( !rects[i].isValid() ) continue; - QString name = i18n(TEXT_FRAMESET_NAMES[i]).arg(pageIndex); + TQString name = i18n(TEXT_FRAMESET_NAMES[i]).tqarg(pageIndex); _textFramesets[i] = createFrameset(Text, name); _framesets.appendChild(_textFramesets[i]); - QDomElement frame = createFrame(Text, rects[i], true); + TQDomElement frame = createFrame(Text, rects[i], true); _textFramesets[i].appendChild(frame); } - QValueList<QDomElement>::const_iterator it; + TQValueList<TQDomElement>::const_iterator it; for (it = pictures.begin(); it!=pictures.end(); ++it) _framesets.appendChild(*it); // page bookmark - QDomElement element = createElement("BOOKMARKITEM"); + TQDomElement element = createElement("BOOKMARKITEM"); element.setAttribute("name", Link::pageLinkName(pageIndex)); element.setAttribute("cursorIndexStart", 0); // ? element.setAttribute("cursorIndexEnd", 0); // ? @@ -178,27 +178,27 @@ void Data::initPage(const QValueVector<DRect> &rects, _marginRect.unite(rects[Body]); } -void Data::createParagraph(const QString &text, ParagraphType type, - const QValueVector<QDomElement> &layouts, - const QValueVector<QDomElement> &formats) +void Data::createParagraph(const TQString &text, ParagraphType type, + const TQValueVector<TQDomElement> &tqlayouts, + const TQValueVector<TQDomElement> &formats) { - QDomElement paragraph = _document.createElement("PARAGRAPH"); + TQDomElement paragraph = _document.createElement("PARAGRAPH"); _textFramesets[type].appendChild(paragraph); - QDomElement textElement = _document.createElement("TEXT"); + TQDomElement textElement = _document.createElement("TEXT"); textElement.appendChild( _document.createTextNode(text) ); paragraph.appendChild(textElement); - QDomElement layout = _document.createElement("LAYOUT"); - paragraph.appendChild(layout); - QDomElement element = _document.createElement("NAME"); + TQDomElement tqlayout = _document.createElement("LAYOUT"); + paragraph.appendChild(tqlayout); + TQDomElement element = _document.createElement("NAME"); element.setAttribute("value", "Standard"); - layout.appendChild(element); - for (uint i=0; i<layouts.size(); i++) - layout.appendChild(layouts[i]); + tqlayout.appendChild(element); + for (uint i=0; i<tqlayouts.size(); i++) + tqlayout.appendChild(tqlayouts[i]); if ( formats.size() ) { - QDomElement format = _document.createElement("FORMATS"); + TQDomElement format = _document.createElement("FORMATS"); paragraph.appendChild(format); for (uint i=0; i<formats.size(); i++) format.appendChild(formats[i]); @@ -208,7 +208,7 @@ void Data::createParagraph(const QString &text, ParagraphType type, void Data::endDump() { if ( !_marginRect.isValid() ) _marginRect = _pageRect; - QDomElement element = _document.createElement("PAPERBORDERS"); + TQDomElement element = _document.createElement("PAPERBORDERS"); element.setAttribute("left", _marginRect.left() - _pageRect.left()); element.setAttribute("top", _marginRect.top() - _pageRect.top()); element.setAttribute("right", _pageRect.right() - _marginRect.right()); diff --git a/filters/kword/pdf/data.h b/filters/kword/pdf/data.h index 4ae8c71d..d7ac0ba9 100644 --- a/filters/kword/pdf/data.h +++ b/filters/kword/pdf/data.h @@ -22,8 +22,8 @@ #include <math.h> -#include <qdom.h> -#include <qvaluevector.h> +#include <tqdom.h> +#include <tqvaluevector.h> #include <KoPageLayout.h> @@ -42,25 +42,25 @@ public: Data(KoFilterChain *, const DRect &pageRect, KoPageLayout, const Options &); - QDomElement createElement(const QString &name) + TQDomElement createElement(const TQString &name) { return _document.createElement(name); } - void createParagraph(const QString &text, ParagraphType type, - const QValueVector<QDomElement> &layouts, - const QValueVector<QDomElement> &formats); + void createParagraph(const TQString &text, ParagraphType type, + const TQValueVector<TQDomElement> &tqlayouts, + const TQValueVector<TQDomElement> &formats); KoFilterChain *chain() const { return _chain; } const Options &options() const { return _options; } - QDomDocument document() const { return _document; } + TQDomDocument document() const { return _document; } const DRect &pageRect() const { return _pageRect; } uint imageIndex() const { return _imageIndex; } uint textIndex() const { return _textIndex; } - QDomElement bookmarks() const { return _bookmarks; } - QDomElement pictures() const { return _pictures; } + TQDomElement bookmarks() const { return _bookmarks; } + TQDomElement pictures() const { return _pictures; } - QDomElement pictureFrameset(const DRect &); + TQDomElement pictureFrameset(const DRect &); - void initPage(const QValueVector<DRect> &, - const QValueList<QDomElement> &pictures); + void initPage(const TQValueVector<DRect> &, + const TQValueList<TQDomElement> &pictures); void endDump(); public: @@ -68,16 +68,16 @@ public: private: enum FramesetType { Text, Picture }; - QDomElement createFrameset(FramesetType, const QString &name); - QDomElement createFrame(FramesetType, const DRect &, + TQDomElement createFrameset(FramesetType, const TQString &name); + TQDomElement createFrame(FramesetType, const DRect &, bool forceMainFrameset); private: KoFilterChain *_chain; - QDomDocument _document; + TQDomDocument _document; uint _imageIndex, _textIndex; - QDomElement _mainElement, _framesets, _pictures, _bookmarks, _paper; - QValueVector<QDomElement> _textFramesets; + TQDomElement _mainElement, _framesets, _pictures, _bookmarks, _paper; + TQValueVector<TQDomElement> _textFramesets; DRect _pageRect, _marginRect; const Options &_options; }; diff --git a/filters/kword/pdf/dialog.cpp b/filters/kword/pdf/dialog.cpp index 1d303025..29e0eabc 100644 --- a/filters/kword/pdf/dialog.cpp +++ b/filters/kword/pdf/dialog.cpp @@ -20,17 +20,17 @@ #include "dialog.h" #include "dialog.moc" -#include <qhbox.h> -#include <qvgroupbox.h> -#include <qregexp.h> -#include <qapplication.h> -#include <qgrid.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qwhatsthis.h> -#include <qcheckbox.h> +#include <tqhbox.h> +#include <tqvgroupbox.h> +#include <tqregexp.h> +#include <tqapplication.h> +#include <tqgrid.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqwhatsthis.h> +#include <tqcheckbox.h> #include <klocale.h> #include <kdebug.h> @@ -38,30 +38,30 @@ //----------------------------------------------------------------------------- -SelectionRange::SelectionRange(const QString &s) +SelectionRange::SelectionRange(const TQString &s) { // fill - QValueVector<QPair<uint, uint> > r; - QStringList list = QStringList::split(',', s); - QRegExp range("^([0-9]+)\\-([0-9]+)$"); - QRegExp one("^[0-9]+$"); - for (QStringList::iterator it = list.begin(); it!=list.end(); ++it) { + TQValueVector<TQPair<uint, uint> > r; + TQStringList list = TQStringList::split(',', s); + TQRegExp range("^([0-9]+)\\-([0-9]+)$"); + TQRegExp one("^[0-9]+$"); + for (TQStringList::iterator it = list.begin(); it!=list.end(); ++it) { if ( one.exactMatch(*it) ) { uint p = (*it).toUInt(); - r.push_back( qMakePair(p, p) ); + r.push_back( tqMakePair(p, p) ); } else if ( range.exactMatch(*it) ) { uint p1 = range.cap(1).toUInt(); uint p2 = range.cap(2).toUInt(); if ( p1>p2 ) continue; - r.push_back( qMakePair(p1, p2) ); + r.push_back( tqMakePair(p1, p2) ); } } // order - QPair<uint, uint> tmp; + TQPair<uint, uint> tmp; for (uint i=1; i<r.size(); i++) if ( r[i].first<r[i-1].first ) - qSwap(r[i-1], r[i]); + tqSwap(r[i-1], r[i]); // coalesce for (uint i=0; i<r.size(); i++) @@ -114,65 +114,65 @@ int SelectionRangeIterator::next() namespace PDFImport { -Dialog::Dialog(uint nbPages, bool isEncrypted, QWidget *widget) +Dialog::Dialog(uint nbPages, bool isEncrypted, TQWidget *widget) : KDialogBase(Plain, i18n("KWord's PDF Import Filter"), Ok|Cancel, Ok, widget, "pdf_import_dialog"), _nbPages(nbPages) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); - QVBoxLayout *top = new QVBoxLayout(plainPage(), KDialogBase::marginHint(), + TQVBoxLayout *top = new TQVBoxLayout(plainPage(), KDialogBase::marginHint(), KDialogBase::spacingHint()); // page selection - QVGroupBox *gbox = new QVGroupBox(i18n("Page Selection"), plainPage()); + TQVGroupBox *gbox = new TQVGroupBox(i18n("Page Selection"), plainPage()); gbox->setInsideSpacing(KDialogBase::spacingHint()); top->addWidget(gbox); - _group = new QButtonGroup; - _allButton = new QRadioButton(i18n("All (%1 pages)").arg(nbPages), gbox); + _group = new TQButtonGroup; + _allButton = new TQRadioButton(i18n("All (%1 pages)").tqarg(nbPages), gbox); _allButton->setChecked(true); _group->insert(_allButton); - QHBox *hbox = new QHBox(gbox); - _rangeButton = new QRadioButton(i18n("Range:"), hbox); + TQHBox *hbox = new TQHBox(gbox); + _rangeButton = new TQRadioButton(i18n("Range:"), hbox); _group->insert(_rangeButton); _range = new KLineEdit(hbox); _range->setFocus(); - connect(_range, SIGNAL(textChanged(const QString &)), - SLOT(rangeChanged(const QString &))); + connect(_range, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(rangeChanged(const TQString &))); // options - _images = new QCheckBox(i18n("Import images"), plainPage()); + _images = new TQCheckBox(i18n("Import images"), plainPage()); _images->setChecked(true); top->addWidget(_images); - _smart = new QCheckBox(i18n("\"Smart\" mode"), plainPage()); + _smart = new TQCheckBox(i18n("\"Smart\" mode"), plainPage()); _smart->setChecked(true); - QWhatsThis::add(_smart, + TQWhatsThis::add(_smart, i18n("Removes returns and hyphens at end of line. " - "Also tries to compute the paragraph alignment. " - "Note that the layout of some pages can " + "Also tries to compute the paragraph tqalignment. " + "Note that the tqlayout of some pages can " "get messed up.")); top->addWidget(_smart); // passwords - gbox = new QVGroupBox(i18n("Passwords"), plainPage()); + gbox = new TQVGroupBox(i18n("Passwords"), plainPage()); top->addWidget(gbox); - QGrid *grid = new QGrid(2, gbox); + TQGrid *grid = new TQGrid(2, gbox); grid->setSpacing(KDialogBase::spacingHint()); - (void)new QLabel(i18n("Owner:"), grid); + (void)new TQLabel(i18n("Owner:"), grid); _owner = new KLineEdit(grid); - _owner->setEchoMode(QLineEdit::Password); - (void)new QLabel(i18n("User:"), grid); + _owner->setEchoMode(TQLineEdit::Password); + (void)new TQLabel(i18n("User:"), grid); _user = new KLineEdit(grid); - _user->setEchoMode(QLineEdit::Password); + _user->setEchoMode(TQLineEdit::Password); grid->setEnabled(isEncrypted); } Dialog::~Dialog() { delete _group; - QApplication::setOverrideCursor(Qt::waitCursor); + TQApplication::setOverrideCursor(TQt::waitCursor); } -void Dialog::rangeChanged(const QString &) +void Dialog::rangeChanged(const TQString &) { _rangeButton->setChecked(true); } @@ -181,7 +181,7 @@ Options Dialog::options() const { Options o; o.range = SelectionRange( (_allButton->isChecked() ? - QString("1-%1").arg(_nbPages) : _range->text()) ); + TQString("1-%1").tqarg(_nbPages) : _range->text()) ); o.ownerPassword = _owner->text(); o.userPassword = _user->text(); o.importImages = _images->isChecked(); diff --git a/filters/kword/pdf/dialog.h b/filters/kword/pdf/dialog.h index 9139b390..128f9b18 100644 --- a/filters/kword/pdf/dialog.h +++ b/filters/kword/pdf/dialog.h @@ -20,14 +20,14 @@ #ifndef DIALOG_H #define DIALOG_H -#include <qvaluevector.h> -#include <qpair.h> +#include <tqvaluevector.h> +#include <tqpair.h> #include <kdialogbase.h> -class QButtonGroup; -class QRadioButton; -class QCheckBox; +class TQButtonGroup; +class TQRadioButton; +class TQCheckBox; class KLineEdit; @@ -36,12 +36,12 @@ class SelectionRange { public: SelectionRange() {} - SelectionRange(const QString &); + SelectionRange(const TQString &); uint nbPages() const; private: - QValueVector<QPair<uint, uint> > _ranges; + TQValueVector<TQPair<uint, uint> > _ranges; friend class SelectionRangeIterator; }; @@ -59,7 +59,7 @@ public: private: uint _index; int _current; - const QValueVector<QPair<uint, uint> > &_ranges; + const TQValueVector<TQPair<uint, uint> > &_ranges; }; //----------------------------------------------------------------------------- @@ -73,28 +73,29 @@ public: public: SelectionRange range; - QString ownerPassword, userPassword; + TQString ownerPassword, userPassword; bool importImages, smart; }; class Dialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - Dialog(uint nbPages, bool isEncrypted, QWidget *parent); + Dialog(uint nbPages, bool isEncrypted, TQWidget *tqparent); ~Dialog(); Options options() const; private slots: - void rangeChanged(const QString &); + void rangeChanged(const TQString &); private: uint _nbPages; - QRadioButton *_allButton, *_rangeButton; - QButtonGroup *_group; + TQRadioButton *_allButton, *_rangeButton; + TQButtonGroup *_group; KLineEdit *_range, *_owner, *_user; - QCheckBox *_images, *_smart; + TQCheckBox *_images, *_smart; }; } // namespace diff --git a/filters/kword/pdf/diffs/xpdf_security_integer_overflow_2.diff b/filters/kword/pdf/diffs/xpdf_security_integer_overflow_2.diff index e6464612..6257d287 100644 --- a/filters/kword/pdf/diffs/xpdf_security_integer_overflow_2.diff +++ b/filters/kword/pdf/diffs/xpdf_security_integer_overflow_2.diff @@ -104,14 +104,14 @@ diff -u -p -r1.3 -r1.3.2.1 +++ xpdf/Gfx.cc 22 Dec 2004 12:07:12 -0000 1.3.2.1 @@ -2379,7 +2379,9 @@ void Gfx::doImage(Object *ref, Stream *s haveMask = gFalse; - dict->lookup("Mask", &maskObj); - if (maskObj.isArray()) { -- for (i = 0; i < maskObj.arrayGetLength(); ++i) { + dict->lookup("Mask", &tqmaskObj); + if (tqmaskObj.isArray()) { +- for (i = 0; i < tqmaskObj.arrayGetLength(); ++i) { + for (i = 0; -+ i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps; ++ i < tqmaskObj.arrayGetLength() && i < 2*gfxColorMaxComps; + ++i) { - maskObj.arrayGet(i, &obj1); - maskColors[i] = obj1.getInt(); + tqmaskObj.arrayGet(i, &obj1); + tqmaskColors[i] = obj1.getInt(); obj1.free(); Index: xpdf/GfxState.cc =================================================================== diff --git a/filters/kword/pdf/fstring.cpp b/filters/kword/pdf/fstring.cpp index 86d94c20..88a79a94 100644 --- a/filters/kword/pdf/fstring.cpp +++ b/filters/kword/pdf/fstring.cpp @@ -29,14 +29,14 @@ namespace PDFImport { //----------------------------------------------------------------------------- -QDomElement Tabulator::createElement(Data &data) const +TQDomElement Tabulator::createElement(Data &data) const { - QDomElement element = data.createElement("TABULATOR"); - element.setAttribute("type", alignment); + TQDomElement element = data.createElement("TABULATOR"); + element.setAttribute("type", tqalignment); element.setAttribute("ptpos", pos); element.setAttribute("filling", filling); - if ( alignment==Character ) - element.setAttribute("alignchar", QString(alignmentChar)); + if ( tqalignment==Character ) + element.setAttribute("alignchar", TQString(tqalignmentChar)); return element; } @@ -57,7 +57,7 @@ Paragraph::Paragraph(TextLine *first, uint nbLines) } // compute rectangle - QValueList<TextLine *>::const_iterator it; + TQValueList<TextLine *>::const_iterator it; for (it = _lines.begin(); it!=_lines.end(); ++it) for (TextBlock *block = (*it)->blocks; block; block = block->next) { DRect br(block->xMin, block->xMax, block->yMin, block->yMax); @@ -112,12 +112,12 @@ void String::addChar(GfxState *state, double x, double y, { Unicode res[MaxLigatureLength]; uint nb = checkLigature(u, res); - QString sdebug; + TQString sdebug; if ( nb>1 ) sdebug = "found ligature "; double ddx = dx / nb; for (uint i=0; i<nb; i++) { TextString::addChar(state, x + ddx*i, y, ddx, dy, res[i]); - if ( nb>1 ) sdebug += QChar(res[i]); + if ( nb>1 ) sdebug += TQChar(res[i]); } if ( nb>1 ) kdDebug(30516) << sdebug << endl; else checkCombination(this); @@ -154,7 +154,7 @@ bool String::checkCombination(TextString *str) // #### above/below detection is not right !!! // bool above = more(accent.r.bottom, letter.r.top); // bool below = more(accent.r.top, letter.r.bottom); -// kdDebug(30516) << "found combi " << QString(QChar(res)) +// kdDebug(30516) << "found combi " << TQString(TQChar(res)) // << " accent: " << accent.r.toString() << endl; // kdDebug(30516) << "letter: " << letter.r.toString() // << endl; diff --git a/filters/kword/pdf/fstring.h b/filters/kword/pdf/fstring.h index f368bc33..f860b92f 100644 --- a/filters/kword/pdf/fstring.h +++ b/filters/kword/pdf/fstring.h @@ -22,7 +22,7 @@ #include "TextOutputDev.h" -#include <qvaluevector.h> +#include <tqvaluevector.h> #include "misc.h" @@ -39,15 +39,15 @@ public: enum Alignment { Left = 0, Center, Right, Character }; enum Filling { Blank = 0, Dots, Line, Dash, DashDot, DashDotDot }; - Tabulator() : alignment(Left) {} + Tabulator() : tqalignment(Left) {} - QDomElement createElement(Data &data) const; + TQDomElement createElement(Data &data) const; public: double pos; - Alignment alignment; + Alignment tqalignment; Filling filling; - QChar alignmentChar; + TQChar tqalignmentChar; }; inline bool operator <(const Tabulator &t1, const Tabulator &t2) @@ -62,7 +62,7 @@ public: public: Font font; const Link *link; - QString text; + TQString text; }; //----------------------------------------------------------------------------- @@ -77,7 +77,7 @@ public: const DRect &rect() const { return _rect; } bool hasOneLine() const { return _lines.count()==1; } - const QValueList<TextLine *> lines() const { return _lines; } + const TQValueList<TextLine *> lines() const { return _lines; } bool isFirst(const TextLine *line) const { return line==_lines.first();} bool isSecond(const TextLine* line) const { return (_lines.count()>1 && line==_lines.first()->next); } @@ -92,11 +92,11 @@ public: uint frameIndex; double firstIndent, leftIndent, offset; Align align; - QValueVector<Tabulator> tabs; - QValueList<Block> blocks; + TQValueVector<Tabulator> tabs; + TQValueList<Block> blocks; private: - QValueList<TextLine *> _lines; + TQValueList<TextLine *> _lines; DRect _rect; }; diff --git a/filters/kword/pdf/misc.cpp b/filters/kword/pdf/misc.cpp index e6ddaa3e..86eb81f6 100644 --- a/filters/kword/pdf/misc.cpp +++ b/filters/kword/pdf/misc.cpp @@ -20,8 +20,8 @@ #include "misc.h" #include <math.h> -#include <qfontmetrics.h> -#include <qfontdatabase.h> +#include <tqfontmetrics.h> +#include <tqfontdatabase.h> #include <kglobal.h> #include <kdebug.h> @@ -35,9 +35,9 @@ namespace PDFImport { -QColor toColor(GfxRGB &rgb) +TQColor toColor(GfxRGB &rgb) { - return QColor(qRound(rgb.r*255), qRound(rgb.g*255), qRound(rgb.b*255)); + return TQColor(tqRound(rgb.r*255), tqRound(rgb.g*255), tqRound(rgb.b*255)); } //----------------------------------------------------------------------------- @@ -67,11 +67,11 @@ void DRect::unite(const DRect &r) _bottom = kMax(_bottom, r._bottom); } -QString DRect::toString() const +TQString DRect::toString() const { if ( !isValid() ) return "invalid rect"; - return QString("left=%1 right=%2 top=%3 bottom=%4").arg(_left).arg(_right) - .arg(_top).arg(_bottom); + return TQString("left=%1 right=%2 top=%3 bottom=%4").tqarg(_left).tqarg(_right) + .tqarg(_top).tqarg(_bottom); } bool DPath::isRectangle() const @@ -98,7 +98,7 @@ DRect DPath::boundingRect() const //----------------------------------------------------------------------------- -QDict<Font::Data> *Font::_dict = 0; +TQDict<Font::Data> *Font::_dict = 0; const char *Font::FAMILY_DATA[Nb_Family] = { "Times", "Helvetica", "Courier", "Symbol" }; @@ -106,7 +106,7 @@ const char *Font::FAMILY_DATA[Nb_Family] = { void Font::init() { Q_ASSERT( _dict==0 ); - _dict = new QDict<Data>(100, false); // case insensitive + _dict = new TQDict<Data>(100, false); // case insensitive _dict->setAutoDelete(true); } @@ -117,7 +117,7 @@ void Font::cleanup() } Font::Font() - : _pointSize(12), _color(Qt::black) + : _pointSize(12), _color(TQt::black) { init("times-roman"); } @@ -125,7 +125,7 @@ Font::Font() Font::Font(const GfxState *state, double size) { if ( size<1 ) kdDebug(30516) << "very small font size=" << size << endl; - _pointSize = qRound(size); + _pointSize = tqRound(size); GfxRGB rgb; state->getFillRGB(&rgb); @@ -133,7 +133,7 @@ Font::Font(const GfxState *state, double size) GfxFont *font = state->getFont(); GString *gname = (font ? font->getName() : 0); - QString name = (gname ? gname->getCString() : 0); + TQString name = (gname ? gname->getCString() : 0); // kdDebug(30516) << "font: " << name << endl; name = name.section('+', 1, 1).lower(); if ( name.isEmpty() ) name = "##dummy"; // dummy name @@ -174,20 +174,20 @@ static const KnownData KNOWN_DATA[] = { { 0, Nb_Family, Regular, false } }; -void Font::init(const QString &n) +void Font::init(const TQString &n) { // check if font already parsed - _data = _dict->find(n); + _data = _dict->tqfind(n); if ( _data==0 ) { // kdDebug(30516) << "font " << n << endl; - QString name = n; - name.replace("oblique", "italic"); + TQString name = n; + name.tqreplace("oblique", "italic"); // check if known font _data = new Data; uint i = 0; while ( KNOWN_DATA[i].name!=0 ) { - if ( name.find(KNOWN_DATA[i].name)!=-1 ) { + if ( name.tqfind(KNOWN_DATA[i].name)!=-1 ) { // kdDebug(30516) << "found " << KNOWN_DATA[i].name // << " " << isBold(KNOWN_DATA[i].style) << endl; _data->family = FAMILY_DATA[KNOWN_DATA[i].family]; @@ -201,21 +201,21 @@ void Font::init(const QString &n) if ( _data->family.isEmpty() ) { // let's try harder // simple heuristic kdDebug(30516) << "unknown font : " << n << endl; - if ( name.find("times")!=-1 ) + if ( name.tqfind("times")!=-1 ) _data->family = FAMILY_DATA[Times]; - else if ( name.find("helvetica")!=-1 ) + else if ( name.tqfind("helvetica")!=-1 ) _data->family = FAMILY_DATA[Helvetica]; - else if ( name.find("courier")!=-1 ) + else if ( name.tqfind("courier")!=-1 ) _data->family = FAMILY_DATA[Courier]; - else if ( name.find("symbol")!=-1 ) + else if ( name.tqfind("symbol")!=-1 ) _data->family = FAMILY_DATA[Symbol]; - else { // with Qt - QFontDatabase fdb; - QStringList list = fdb.families(); + else { // with TQt + TQFontDatabase fdb; + TQStringList list = fdb.tqfamilies(); list = list.grep(name, false); if ( !list.isEmpty() ) { _data->family = list[0]; - kdDebug(30516) << "in Qt database as " << list[0] << endl; + kdDebug(30516) << "in TQt database as " << list[0] << endl; } else { kdDebug(30516) << "really unknown font !" << endl; @@ -223,8 +223,8 @@ void Font::init(const QString &n) } } - bool italic = ( name.find("italic")!=-1 ); - bool bold = ( name.find("bold")!=-1 ); + bool italic = ( name.tqfind("italic")!=-1 ); + bool bold = ( name.tqfind("bold")!=-1 ); _data->style = toStyle(bold, italic); _data->latex = false; } @@ -232,12 +232,12 @@ void Font::init(const QString &n) _dict->insert(name, _data); } - // check if QFont already created - if ( !_data->height.contains(_pointSize) ) { - QFont font(_data->family, _pointSize, - (isBold(_data->style) ? QFont::Bold : QFont::Normal), + // check if TQFont already created + if ( !_data->height.tqcontains(_pointSize) ) { + TQFont font(_data->family, _pointSize, + (isBold(_data->style) ? TQFont::Bold : TQFont::Normal), isItalic(_data->style)); - QFontMetrics fm(font); + TQFontMetrics fm(font); _data->height.insert(_pointSize, fm.height()); } } @@ -253,14 +253,14 @@ bool Font::operator ==(const Font &font) const return true; } -bool Font::format(QDomDocument &doc, QDomElement &f, +bool Font::format(TQDomDocument &doc, TQDomElement &f, uint pos, uint len, bool all) const { f.setAttribute("id", 1); if (!all) f.setAttribute("pos", pos); if (!all) f.setAttribute("len", len); - QDomElement element; + TQDomElement element; Font def; if ( all || _data->family!=def._data->family ) { @@ -281,7 +281,7 @@ bool Font::format(QDomDocument &doc, QDomElement &f, if ( all || isBold(_data->style)!=isBold(def._data->style) ) { element = doc.createElement("WEIGHT"); element.setAttribute("value", - (isBold(_data->style) ? QFont::Bold : QFont::Normal)); + (isBold(_data->style) ? TQFont::Bold : TQFont::Normal)); f.appendChild(element); } // if ( all || _underline!=def._underline ) { @@ -357,7 +357,7 @@ Link::Link(const DRect &rect, LinkAction &action, Catalog &catalog) delete dest; } - _href = QString("bkm://") + pageLinkName(page); + _href = TQString("bkm://") + pageLinkName(page); // kdDebug(30516) << "link to page " << page << endl; break; } @@ -405,15 +405,15 @@ Link::Link(const DRect &rect, LinkAction &action, Catalog &catalog) } } -void Link::format(QDomDocument &doc, QDomElement &f, uint pos, - const QString &text) const +void Link::format(TQDomDocument &doc, TQDomElement &f, uint pos, + const TQString &text) const { f.setAttribute("id", 4); f.setAttribute("pos", pos); f.setAttribute("len", 1); - QDomElement v = doc.createElement("VARIABLE"); - QDomElement element = doc.createElement("TYPE"); + TQDomElement v = doc.createElement("VARIABLE"); + TQDomElement element = doc.createElement("TYPE"); element.setAttribute("type", 9); element.setAttribute("key", "STRING"); element.setAttribute("text", text); @@ -426,9 +426,9 @@ void Link::format(QDomDocument &doc, QDomElement &f, uint pos, f.appendChild(v); } -QString Link::pageLinkName(uint i) +TQString Link::pageLinkName(uint i) { - return QString("page") + QString::number(i); + return TQString("page") + TQString::number(i); } } // namespace diff --git a/filters/kword/pdf/misc.h b/filters/kword/pdf/misc.h index e661be4d..5af22ed7 100644 --- a/filters/kword/pdf/misc.h +++ b/filters/kword/pdf/misc.h @@ -22,12 +22,12 @@ #include <math.h> -#include <qcolor.h> -#include <qdom.h> -#include <qsize.h> -#include <qvaluevector.h> -#include <qdict.h> -#include <qmap.h> +#include <tqcolor.h> +#include <tqdom.h> +#include <tqsize.h> +#include <tqvaluevector.h> +#include <tqdict.h> +#include <tqmap.h> class LinkAction; class Catalog; @@ -37,7 +37,7 @@ class GfxState; namespace PDFImport { -// FIX for Qt 3.0 +// FIX for TQt 3.0 // qvaluevector bug - qheapsort uses 'count' but qvaluevector has only 'size' template <class Container> inline void qHeapSort2( Container &c ) @@ -83,7 +83,7 @@ inline bool less(double d1, double d2, double percent = 0.01) { return ( (d1-d2)<delta ); } -QColor toColor(GfxRGB &); +TQColor toColor(GfxRGB &); //----------------------------------------------------------------------------- class DRect { @@ -110,7 +110,7 @@ public: bool operator ==(const DRect &) const; bool isInside(const DRect &, double percent = 0.01) const; void unite(const DRect &); - QString toString() const; + TQString toString() const; private: double _left, _right, _top, _bottom; @@ -120,7 +120,7 @@ struct DPoint { double x, y; }; -class DPath : public QValueVector<DPoint> +class DPath : public TQValueVector<DPoint> { public: DPath() {} @@ -136,7 +136,7 @@ public: DRect boundingRect() const; }; -typedef QValueVector<DPath> DPathVector; +typedef TQValueVector<DPath> DPathVector; //----------------------------------------------------------------------------- class Font @@ -146,10 +146,10 @@ public: Font(const GfxState *, double size); bool operator ==(const Font &) const; - bool format(QDomDocument &, QDomElement &format, uint pos, uint len, + bool format(TQDomDocument &, TQDomElement &format, uint pos, uint len, bool all = false) const; int height() const { return _data->height[_pointSize]; } - const QColor &color() const { return _color; } + const TQColor &color() const { return _color; } bool isLatex() const { return _data->latex; } void setFamily(FontFamily); @@ -158,22 +158,22 @@ public: static void cleanup(); private: - void init(const QString &name); + void init(const TQString &name); private: uint _pointSize; - QColor _color; + TQColor _color; class Data { public: - QString family; + TQString family; FontStyle style; bool latex; - QMap<int, int> height; + TQMap<int, int> height; }; Data *_data; - static QDict<Data> *_dict; + static TQDict<Data> *_dict; static const char *FAMILY_DATA[PDFImport::Nb_Family]; }; @@ -184,14 +184,14 @@ public: Link(const DRect &, LinkAction &, Catalog &); const DRect &rect() const { return _rect; } - void format(QDomDocument &, QDomElement &format, - uint pos, const QString &text) const; + void format(TQDomDocument &, TQDomElement &format, + uint pos, const TQString &text) const; - static QString pageLinkName(uint i); + static TQString pageLinkName(uint i); private: DRect _rect; - QString _href; + TQString _href; }; } // namespace diff --git a/filters/kword/pdf/pdfdocument.cpp b/filters/kword/pdf/pdfdocument.cpp index d78c0fb8..ffe27e1c 100644 --- a/filters/kword/pdf/pdfdocument.cpp +++ b/filters/kword/pdf/pdfdocument.cpp @@ -38,13 +38,13 @@ Document::Document() : _file(0), _object(0), _fileStream(0), _document(0), _device(0) {} -KoFilter::ConversionStatus -Document::init(const QString &name, const QString &ownerPassword, - const QString &userPassword) +KoFilter::ConversiontqStatus +Document::init(const TQString &name, const TQString &ownerPassword, + const TQString &userPassword) { clear(); - _file = new QFile(name); + _file = new TQFile(name); if( !_file->open(IO_ReadOnly) ) return KoFilter::FileNotFound; FILE *fd = fdopen(_file->handle(), "r"); @@ -87,9 +87,9 @@ void Document::clear() _imageIndex = 1; } -QString Document::info(const QCString &key) const +TQString Document::info(const TQCString &key) const { - QString res; + TQString res; Object info; _document->getDocInfo(&info); if ( info.isDict() ) { @@ -111,7 +111,7 @@ QString Document::info(const QCString &key) const i++; } else u = s->getChar(i) & 0xff; i++; - res += QChar(u); + res += TQChar(u); } tmp.free(); } diff --git a/filters/kword/pdf/pdfdocument.h b/filters/kword/pdf/pdfdocument.h index f283aff7..c54606f4 100644 --- a/filters/kword/pdf/pdfdocument.h +++ b/filters/kword/pdf/pdfdocument.h @@ -20,8 +20,8 @@ #ifndef PDFDOCUMENT_H #define PDFDOCUMENT_H -#include <qfile.h> -#include <qdom.h> +#include <tqfile.h> +#include <tqdom.h> #include <KoFilter.h> #include <KoPageLayout.h> @@ -43,11 +43,11 @@ class Document Document(); ~Document() { clear(); } - KoFilter::ConversionStatus init(const QString &name, - const QString &ownerPassword, const QString &userPassword); + KoFilter::ConversiontqStatus init(const TQString &name, + const TQString &ownerPassword, const TQString &userPassword); void clear(); - QString info(const QCString &key) const; + TQString info(const TQCString &key) const; uint nbPages() const; KoOrientation paperOrientation() const; DRect paperSize(KoFormat &format) const; @@ -59,7 +59,7 @@ class Document void dumpPage(uint i); private: - QFile *_file; + TQFile *_file; Object *_object; BaseStream *_fileStream; PDFDoc *_document; diff --git a/filters/kword/pdf/pdfimport.cpp b/filters/kword/pdf/pdfimport.cpp index 9441d734..bee3e39a 100644 --- a/filters/kword/pdf/pdfimport.cpp +++ b/filters/kword/pdf/pdfimport.cpp @@ -20,8 +20,8 @@ #include "pdfimport.h" #include "pdfimport.moc" -#include <qdom.h> -#include <qdatetime.h> // debug +#include <tqdom.h> +#include <tqdatetime.h> // debug #include <KoFilterChain.h> #include <kgenericfactory.h> @@ -52,26 +52,26 @@ class PdfImportFactory : KGenericFactory<PdfImport, KoFilter> K_EXPORT_COMPONENT_FACTORY(libpdfimport, PdfImportFactory()) //----------------------------------------------------------------------------- -PdfImport::PdfImport(KoFilter *, const char *, const QStringList&) +PdfImport::PdfImport(KoFilter *, const char *, const TQStringList&) {} -KoFilter::ConversionStatus PdfImport::convert(const QCString& from, - const QCString& to) +KoFilter::ConversiontqStatus PdfImport::convert(const TQCString& from, + const TQCString& to) { // check for proper conversion if ( to!="application/x-kword" || from!="application/pdf" ) return KoFilter::NotImplemented; // read file - KoFilter::ConversionStatus result - = _doc.init(m_chain->inputFile(), QString::null, QString::null); + KoFilter::ConversiontqStatus result + = _doc.init(m_chain->inputFile(), TQString(), TQString()); if ( result!=KoFilter::OK ) return result; // options dialog { Dialog dialog(_doc.nbPages(), _doc.isEncrypted(), 0); dialog.exec(); - if ( dialog.result()==QDialog::Rejected ) + if ( dialog.result()==TQDialog::Rejected ) return KoFilter::UserCancelled; _options = dialog.options(); } @@ -82,7 +82,7 @@ KoFilter::ConversionStatus PdfImport::convert(const QCString& from, pd.setMinimumDuration(0); pd.progressBar()->setTotalSteps( _options.range.nbPages()*2 ); pd.progressBar()->setValue(1); - qApp->processEvents(); + tqApp->processEvents(); // if passwords : reread file if ( !_options.ownerPassword.isEmpty() @@ -101,7 +101,7 @@ KoFilter::ConversionStatus PdfImport::convert(const QCString& from, _doc.initDevice(data); // treat pages - QTime time; + TQTime time; time.start(); SelectionRangeIterator it(_options.range); for (uint k=0; k<2; k++) { @@ -109,10 +109,10 @@ KoFilter::ConversionStatus PdfImport::convert(const QCString& from, data.pageIndex = 0; if ( !first ) _doc.init(); for (it.toFirst(); it.current()!=it.end(); it.next()) { - QString s = (first ? i18n("First pass: page #%1...") + TQString s = (first ? i18n("First pass: page #%1...") : i18n("Second pass: page #%1...")); - pd.setLabel( s.arg(it.current()) ); - qApp->processEvents(); + pd.setLabel( s.tqarg(it.current()) ); + tqApp->processEvents(); if (pd.wasCancelled()) return KoFilter::UserCancelled; kdDebug(30516) << "-- " << "pass #" << k << " treat page: " << it.current() @@ -133,7 +133,7 @@ KoFilter::ConversionStatus PdfImport::convert(const QCString& from, return KoFilter::StorageCreationError; } // kdDebug(30516) << data.document().toCString() << endl; - QCString cstr = data.document().toCString(); + TQCString cstr = data.document().toCString(); out->writeBlock(cstr, cstr.length()); out->close(); @@ -144,26 +144,26 @@ KoFilter::ConversionStatus PdfImport::convert(const QCString& from, void PdfImport::treatInfoDocument() { - QDomDocument infoDocument("document-info"); + TQDomDocument infoDocument("document-info"); infoDocument.appendChild( infoDocument.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"")); - QDomElement infoElement = infoDocument.createElement( "document-info" ); + TQDomElement infoElement = infoDocument.createElement( "document-info" ); infoDocument.appendChild(infoElement); - QDomElement aboutTag = infoDocument.createElement("about"); + TQDomElement aboutTag = infoDocument.createElement("about"); infoElement.appendChild(aboutTag); - QDomElement authorTag = infoDocument.createElement("author"); + TQDomElement authorTag = infoDocument.createElement("author"); infoElement.appendChild(authorTag); - QDomElement fullNameTag = infoDocument.createElement("full-name"); + TQDomElement fullNameTag = infoDocument.createElement("full-name"); authorTag.appendChild(fullNameTag); - QDomText authorText = infoDocument.createTextNode( _doc.info("Author") ); + TQDomText authorText = infoDocument.createTextNode( _doc.info("Author") ); fullNameTag.appendChild(authorText); - QDomElement titleTag = infoDocument.createElement("title"); + TQDomElement titleTag = infoDocument.createElement("title"); aboutTag.appendChild(titleTag); - QDomText titleText = infoDocument.createTextNode( _doc.info("Title") ); + TQDomText titleText = infoDocument.createTextNode( _doc.info("Title") ); titleTag.appendChild(titleText); // output @@ -172,7 +172,7 @@ void PdfImport::treatInfoDocument() if ( !out ) kdWarning(30516) << "unable to open doc info. continuing anyway\n"; else { - QCString cstr = infoDocument.toCString(); + TQCString cstr = infoDocument.toCString(); out->writeBlock(cstr, cstr.length()); out->close(); } diff --git a/filters/kword/pdf/pdfimport.h b/filters/kword/pdf/pdfimport.h index 22b34f67..66b68525 100644 --- a/filters/kword/pdf/pdfimport.h +++ b/filters/kword/pdf/pdfimport.h @@ -29,11 +29,12 @@ class PdfImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - PdfImport(KoFilter *parent, const char *name, const QStringList&); + PdfImport(KoFilter *tqparent, const char *name, const TQStringList&); - KoFilter::ConversionStatus - convert(const QCString& from, const QCString& to); + KoFilter::ConversiontqStatus + convert(const TQCString& from, const TQCString& to); private: void treatInfoDocument(); diff --git a/filters/kword/pdf/status.html b/filters/kword/pdf/status.html index 946c3df4..4e6c263c 100644 --- a/filters/kword/pdf/status.html +++ b/filters/kword/pdf/status.html @@ -50,7 +50,7 @@ <td><ul> <li>import text with formatting. <li>import links. - <li>import images (image masks cannot be handled correctly thought). + <li>import images (image tqmasks cannot be handled correctly thought). </ul></td> </tr> diff --git a/filters/kword/pdf/transform.cpp b/filters/kword/pdf/transform.cpp index 4f1badc3..dbf0cb46 100644 --- a/filters/kword/pdf/transform.cpp +++ b/filters/kword/pdf/transform.cpp @@ -193,7 +193,7 @@ CharType checkSpecial(Unicode u, Unicode &res) // special mapping switch (t) { case Unknown: - kdDebug(30516) << "unknown special " << QString(QChar(u)) + kdDebug(30516) << "unknown special " << TQString(TQChar(u)) << " (" << u << ")" << endl; break; case SuperScript: { diff --git a/filters/kword/pdf/transform.h b/filters/kword/pdf/transform.h index 6bfd8b5c..8f8ae7f1 100644 --- a/filters/kword/pdf/transform.h +++ b/filters/kword/pdf/transform.h @@ -20,7 +20,7 @@ #ifndef TRANSFORM_H #define TRANSFORM_H -#include <qpair.h> +#include <tqpair.h> #include "CharTypes.h" namespace PDFImport @@ -75,7 +75,7 @@ namespace PDFImport CharType checkSpecial(Unicode, Unicode &res); // detect some letter/accent combinations - // (latex layouts them separately) + // (latex tqlayouts them separately) Unicode checkCombi(Unicode letter, Unicode accent); } diff --git a/filters/kword/pdf/xpdf/goo/GHash.cc b/filters/kword/pdf/xpdf/goo/GHash.cc index d336f88e..b8f511e0 100644 --- a/filters/kword/pdf/xpdf/goo/GHash.cc +++ b/filters/kword/pdf/xpdf/goo/GHash.cc @@ -97,7 +97,7 @@ void *GHash::lookup(const GString *key) { GHashBucket *p; int h; - if (!(p = find(key, &h))) { + if (!(p = tqfind(key, &h))) { return NULL; } return p->val; @@ -107,7 +107,7 @@ void *GHash::lookup(const char *key) { GHashBucket *p; int h; - if (!(p = find(key, &h))) { + if (!(p = tqfind(key, &h))) { return NULL; } return p->val; @@ -119,7 +119,7 @@ void *GHash::remove(const GString *key) { void *val; int h; - if (!(p = find(key, &h))) { + if (!(p = tqfind(key, &h))) { return NULL; } q = &tab[h]; @@ -142,7 +142,7 @@ void *GHash::remove(const char *key) { void *val; int h; - if (!(p = find(key, &h))) { + if (!(p = tqfind(key, &h))) { return NULL; } q = &tab[h]; @@ -190,7 +190,7 @@ void GHash::killIter(GHashIter **iter) { *iter = NULL; } -GHashBucket *GHash::find(const GString *key, int *h) { +GHashBucket *GHash::tqfind(const GString *key, int *h) { GHashBucket *p; *h = hash(key); @@ -202,7 +202,7 @@ GHashBucket *GHash::find(const GString *key, int *h) { return NULL; } -GHashBucket *GHash::find(const char *key, int *h) { +GHashBucket *GHash::tqfind(const char *key, int *h) { GHashBucket *p; *h = hash(key); diff --git a/filters/kword/pdf/xpdf/goo/GHash.h b/filters/kword/pdf/xpdf/goo/GHash.h index 79d9a7ea..426428c1 100644 --- a/filters/kword/pdf/xpdf/goo/GHash.h +++ b/filters/kword/pdf/xpdf/goo/GHash.h @@ -37,8 +37,8 @@ public: private: - GHashBucket *find(const GString *key, int *h); - GHashBucket *find(const char *key, int *h); + GHashBucket *tqfind(const GString *key, int *h); + GHashBucket *tqfind(const char *key, int *h); int hash(const GString *key); int hash(const char *key); diff --git a/filters/kword/pdf/xpdf/xpdf/CMap.cc b/filters/kword/pdf/xpdf/xpdf/CMap.cc index b0002183..21f0af22 100644 --- a/filters/kword/pdf/xpdf/xpdf/CMap.cc +++ b/filters/kword/pdf/xpdf/xpdf/CMap.cc @@ -61,7 +61,7 @@ CMap *CMap::parse(CMapCache *cache, GString *collectionA, return new CMap(collectionA->copy(), cMapNameA->copy(), 1); } - error(-1, "Couldn't find '%s' CMap file for '%s' collection", + error(-1, "Couldn't tqfind '%s' CMap file for '%s' collection", cMapNameA->getCString(), collectionA->getCString()); return NULL; } diff --git a/filters/kword/pdf/xpdf/xpdf/CMap.h b/filters/kword/pdf/xpdf/xpdf/CMap.h index ce926baf..5ece2635 100644 --- a/filters/kword/pdf/xpdf/xpdf/CMap.h +++ b/filters/kword/pdf/xpdf/xpdf/CMap.h @@ -45,7 +45,7 @@ public: GBool match(GString *collectionA, GString *cMapNameA); // Return the CID corresponding to the character code starting at - // <s>, which contains <len> bytes. Sets *<nUsed> to the number of + // <s>, which tqcontains <len> bytes. Sets *<nUsed> to the number of // bytes used by the char code. CID getCID(char *s, int len, int *nUsed); diff --git a/filters/kword/pdf/xpdf/xpdf/Catalog.cc b/filters/kword/pdf/xpdf/xpdf/Catalog.cc index 8f7e6b04..4a68d3b3 100644 --- a/filters/kword/pdf/xpdf/xpdf/Catalog.cc +++ b/filters/kword/pdf/xpdf/xpdf/Catalog.cc @@ -25,7 +25,7 @@ #include "Catalog.h" // This define is used to limit the depth of recursive readPageTree calls -// This is needed because the page tree nodes can reference their parents +// This is needed because the page tree nodes can reference their tqparents // leaving us in an infinite loop // Most sane pdf documents don't have a call depth higher than 10 #define MAX_CALL_DEPTH 1000 diff --git a/filters/kword/pdf/xpdf/xpdf/Dict.cc b/filters/kword/pdf/xpdf/xpdf/Dict.cc index 351c23a0..048ce80a 100644 --- a/filters/kword/pdf/xpdf/xpdf/Dict.cc +++ b/filters/kword/pdf/xpdf/xpdf/Dict.cc @@ -50,7 +50,7 @@ void Dict::add(char *key, Object *val) { ++length; } -inline DictEntry *Dict::find(const char *key) { +inline DictEntry *Dict::tqfind(const char *key) { int i; for (i = 0; i < length; ++i) { @@ -63,19 +63,19 @@ inline DictEntry *Dict::find(const char *key) { GBool Dict::is(const char *type) { DictEntry *e; - return (e = find("Type")) && e->val.isName(type); + return (e = tqfind("Type")) && e->val.isName(type); } Object *Dict::lookup(const char *key, Object *obj) { DictEntry *e; - return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull(); + return (e = tqfind(key)) ? e->val.fetch(xref, obj) : obj->initNull(); } Object *Dict::lookupNF(const char *key, Object *obj) { DictEntry *e; - return (e = find(key)) ? e->val.copy(obj) : obj->initNull(); + return (e = tqfind(key)) ? e->val.copy(obj) : obj->initNull(); } char *Dict::getKey(int i) { diff --git a/filters/kword/pdf/xpdf/xpdf/Dict.h b/filters/kword/pdf/xpdf/xpdf/Dict.h index 4bc4408e..cc66161e 100644 --- a/filters/kword/pdf/xpdf/xpdf/Dict.h +++ b/filters/kword/pdf/xpdf/xpdf/Dict.h @@ -71,7 +71,7 @@ private: int length; // number of entries in dictionary int ref; // reference count - DictEntry *find(const char *key); + DictEntry *tqfind(const char *key); }; #endif diff --git a/filters/kword/pdf/xpdf/xpdf/FTFont.cc b/filters/kword/pdf/xpdf/xpdf/FTFont.cc index 8de09e0e..ebbbff40 100644 --- a/filters/kword/pdf/xpdf/xpdf/FTFont.cc +++ b/filters/kword/pdf/xpdf/xpdf/FTFont.cc @@ -50,7 +50,7 @@ FTFontEngine::~FTFontEngine() { FTFontFile::FTFontFile(FTFontEngine *engineA, char *fontFileName, char **fontEnc, GBool pdfFontHasEncoding) { char *name; - int unicodeCmap, macRomanCmap, msSymbolCmap; + int tqunicodeCmap, macRomanCmap, msSymbolCmap; int i, j; ok = gFalse; @@ -89,11 +89,11 @@ FTFontFile::FTFontFile(FTFontEngine *engineA, char *fontFileName, // and use (0xf000 + char code). // 3. If none of these rules apply, use the first cmap and hope for // the best (this shouldn't happen). - unicodeCmap = macRomanCmap = msSymbolCmap = 0xffff; + tqunicodeCmap = macRomanCmap = msSymbolCmap = 0xffff; for (i = 0; i < face->num_charmaps; ++i) { if (face->charmaps[i]->platform_id == 3 && face->charmaps[i]->encoding_id == 1) { - unicodeCmap = i; + tqunicodeCmap = i; } else if (face->charmaps[i]->platform_id == 1 && face->charmaps[i]->encoding_id == 0) { macRomanCmap = i; @@ -106,8 +106,8 @@ FTFontFile::FTFontFile(FTFontEngine *engineA, char *fontFileName, mode = ftFontModeCharCode; charMapOffset = 0; if (pdfFontHasEncoding) { - if (unicodeCmap != 0xffff) { - i = unicodeCmap; + if (tqunicodeCmap != 0xffff) { + i = tqunicodeCmap; mode = ftFontModeUnicode; } else if (macRomanCmap != 0xffff) { i = macRomanCmap; diff --git a/filters/kword/pdf/xpdf/xpdf/FontFile.cc b/filters/kword/pdf/xpdf/xpdf/FontFile.cc index ccb880bf..28396338 100644 --- a/filters/kword/pdf/xpdf/xpdf/FontFile.cc +++ b/filters/kword/pdf/xpdf/xpdf/FontFile.cc @@ -1111,7 +1111,7 @@ void Type1CFontFile::convertToType0(const char *psName, (*outputFunc)(outputStream, "cleartomark\n", 12); } - // write the Type 0 parent font + // write the Type 0 tqparent font (*outputFunc)(outputStream, "16 dict begin\n", 14); (*outputFunc)(outputStream, "/FontName /", 11); (*outputFunc)(outputStream, psName, strlen(psName)); @@ -1572,7 +1572,7 @@ void Type1CFontFile::cvtGlyph(const Guchar *s, int n) { } i += 2; nOps = 0; - } else if (s[i] == 19) { // hintmask + } else if (s[i] == 19) { // hinttqmask // ignored if (first) { cvtGlyphWidth(nOps == 1); @@ -1580,14 +1580,14 @@ void Type1CFontFile::cvtGlyph(const Guchar *s, int n) { } if (nOps > 0) { if (nOps & 1) { - error(-1, "Wrong number of args (%d) to Type 2 hintmask/vstemhm", + error(-1, "Wrong number of args (%d) to Type 2 hinttqmask/vstemhm", nOps); } nHints += nOps / 2; } i += 1 + ((nHints + 7) >> 3); nOps = 0; - } else if (s[i] == 20) { // cntrmask + } else if (s[i] == 20) { // cntrtqmask // ignored if (first) { cvtGlyphWidth(nOps == 1); @@ -1595,7 +1595,7 @@ void Type1CFontFile::cvtGlyph(const Guchar *s, int n) { } if (nOps > 0) { if (nOps & 1) { - error(-1, "Wrong number of args (%d) to Type 2 cntrmask/vstemhm", + error(-1, "Wrong number of args (%d) to Type 2 cntrtqmask/vstemhm", nOps); } nHints += nOps / 2; @@ -3063,7 +3063,7 @@ void TrueTypeFontFile::convertToType0(const char *name, const Gushort *cidMap, "FontName currentdict end definefont pop\n", 40); } - // write the Type 0 parent font + // write the Type 0 tqparent font (*outputFunc)(outputStream, "16 dict begin\n", 14); (*outputFunc)(outputStream, "/FontName /", 11); (*outputFunc)(outputStream, name, strlen(name)); @@ -3206,7 +3206,7 @@ void TrueTypeFontFile::cvtCharStrings(const char **encodingA, GBool pdfFontHasEncoding, FontFileOutputFunc outputFunc, void *outputStream) { - int unicodeCmap, macRomanCmap, msSymbolCmap; + int tqunicodeCmap, macRomanCmap, msSymbolCmap; int nCmaps, cmapPlatform, cmapEncoding, cmapFmt, cmapOffset; T42FontIndexMode mode; const char *name; @@ -3239,13 +3239,13 @@ void TrueTypeFontFile::cvtCharStrings(const char **encodingA, // 3. If none of these rules apply, use the first cmap and hope for // the best (this shouldn't happen). nCmaps = getUShort(pos+2); - unicodeCmap = macRomanCmap = msSymbolCmap = -1; + tqunicodeCmap = macRomanCmap = msSymbolCmap = -1; cmapOffset = 0; for (i = 0; i < nCmaps; ++i) { cmapPlatform = getUShort(pos + 4 + 8*i); cmapEncoding = getUShort(pos + 4 + 8*i + 2); if (cmapPlatform == 3 && cmapEncoding == 1) { - unicodeCmap = i; + tqunicodeCmap = i; } else if (cmapPlatform == 1 && cmapEncoding == 0) { macRomanCmap = i; } else if (cmapPlatform == 3 && cmapEncoding == 0) { @@ -3255,8 +3255,8 @@ void TrueTypeFontFile::cvtCharStrings(const char **encodingA, i = 0; mode = t42FontModeCharCode; if (pdfFontHasEncoding) { - if (unicodeCmap >= 0) { - i = unicodeCmap; + if (tqunicodeCmap >= 0) { + i = tqunicodeCmap; mode = t42FontModeUnicode; } else if (macRomanCmap >= 0) { i = macRomanCmap; diff --git a/filters/kword/pdf/xpdf/xpdf/Gfx.cc b/filters/kword/pdf/xpdf/xpdf/Gfx.cc index 7948d78a..d357ba94 100644 --- a/filters/kword/pdf/xpdf/xpdf/Gfx.cc +++ b/filters/kword/pdf/xpdf/xpdf/Gfx.cc @@ -2259,13 +2259,13 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { Dict *dict; int width, height; int bits; - GBool mask; + GBool tqmask; GBool invert; GfxColorSpace *colorSpace; GfxImageColorMap *colorMap; - Object maskObj; + Object tqmaskObj; GBool haveMask; - int maskColors[2*gfxColorMaxComps]; + int tqmaskColors[2*gfxColorMaxComps]; Object obj1, obj2; int i; @@ -2292,15 +2292,15 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { height = obj1.getInt(); obj1.free(); - // image or mask? + // image or tqmask? dict->lookup("ImageMask", &obj1); if (obj1.isNull()) { obj1.free(); dict->lookup("IM", &obj1); } - mask = gFalse; + tqmask = gFalse; if (obj1.isBool()) - mask = obj1.getBool(); + tqmask = obj1.getBool(); else if (!obj1.isNull()) goto err2; obj1.free(); @@ -2316,10 +2316,10 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { bits = obj1.getInt(); obj1.free(); - // display a mask - if (mask) { + // display a tqmask + if (tqmask) { - // check for inverted mask + // check for inverted tqmask if (bits != 1) goto err1; invert = gFalse; @@ -2375,15 +2375,15 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { goto err1; } - // get the mask + // get the tqmask haveMask = gFalse; - dict->lookup("Mask", &maskObj); - if (maskObj.isArray()) { + dict->lookup("Mask", &tqmaskObj); + if (tqmaskObj.isArray()) { for (i = 0; - i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps; + i < tqmaskObj.arrayGetLength() && i < 2*gfxColorMaxComps; ++i) { - maskObj.arrayGet(i, &obj1); - maskColors[i] = obj1.getInt(); + tqmaskObj.arrayGet(i, &obj1); + tqmaskColors[i] = obj1.getInt(); obj1.free(); } haveMask = gTrue; @@ -2391,10 +2391,10 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { // draw it out->drawImage(state, ref, str, width, height, colorMap, - haveMask ? maskColors : (int *)NULL, inlineImg); + haveMask ? tqmaskColors : (int *)NULL, inlineImg); delete colorMap; - maskObj.free(); + tqmaskObj.free(); } if ((i = width * height) > 1000) { diff --git a/filters/kword/pdf/xpdf/xpdf/GfxFont.cc b/filters/kword/pdf/xpdf/xpdf/GfxFont.cc index 1ed21174..7886ae69 100644 --- a/filters/kword/pdf/xpdf/xpdf/GfxFont.cc +++ b/filters/kword/pdf/xpdf/xpdf/GfxFont.cc @@ -738,7 +738,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GString *nameA, } else { // this is technically an error -- the Widths entry is required // for all but the Base-14 fonts -- but certain PDF generators - // apparently don't include widths for Arial and TimesNewRoman + // aptqparently don't include widths for Arial and TimesNewRoman if (isFixedWidth()) { i = 0; } else if (isSerif()) { diff --git a/filters/kword/pdf/xpdf/xpdf/GlobalParams.cc b/filters/kword/pdf/xpdf/xpdf/GlobalParams.cc index 8a7b36de..d25970de 100644 --- a/filters/kword/pdf/xpdf/xpdf/GlobalParams.cc +++ b/filters/kword/pdf/xpdf/xpdf/GlobalParams.cc @@ -139,7 +139,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) { nameToUnicode = new NameToCharCode(); cidToUnicodes = new GHash(gTrue); residentUnicodeMaps = new GHash(); - unicodeMaps = new GHash(gTrue); + tqunicodeMaps = new GHash(gTrue); cMapDirs = new GHash(gTrue); toUnicodeDirs = new GList(); displayFonts = new GHash(); @@ -195,7 +195,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) { errQuiet = gFalse; cidToUnicodeCache = new CIDToUnicodeCache(); - unicodeMapCache = new UnicodeMapCache(); + tqunicodeMapCache = new UnicodeMapCache(); cMapCache = new CMapCache(); // set up the initial nameToUnicode table @@ -318,7 +318,7 @@ void GlobalParams::parseFile(GString *fileName, FILE *f) { parseNameToUnicode(tokens, fileName, line); } else if (!cmd->cmp("cidToUnicode")) { parseCIDToUnicode(tokens, fileName, line); - } else if (!cmd->cmp("unicodeMap")) { + } else if (!cmd->cmp("tqunicodeMap")) { parseUnicodeMap(tokens, fileName, line); } else if (!cmd->cmp("cMapDir")) { parseCMapDir(tokens, fileName, line); @@ -465,16 +465,16 @@ void GlobalParams::parseUnicodeMap(GList *tokens, GString *fileName, GString *encodingName, *name, *old; if (tokens->getLength() != 3) { - error(-1, "Bad 'unicodeMap' config file command (%s:%d)", + error(-1, "Bad 'tqunicodeMap' config file command (%s:%d)", fileName->getCString(), line); return; } encodingName = (GString *)tokens->get(1); name = (GString *)tokens->get(2); - if ((old = (GString *)unicodeMaps->remove(encodingName))) { + if ((old = (GString *)tqunicodeMaps->remove(encodingName))) { delete old; } - unicodeMaps->add(encodingName->copy(), name->copy()); + tqunicodeMaps->add(encodingName->copy(), name->copy()); } void GlobalParams::parseCMapDir(GList *tokens, GString *fileName, int line) { @@ -765,7 +765,7 @@ GlobalParams::~GlobalParams() { delete nameToUnicode; deleteGHash(cidToUnicodes, GString); deleteGHash(residentUnicodeMaps, UnicodeMap); - deleteGHash(unicodeMaps, GString); + deleteGHash(tqunicodeMaps, GString); deleteGList(toUnicodeDirs, GString); deleteGHash(displayFonts, DisplayFontParam); deleteGHash(displayCIDFonts, DisplayFontParam); @@ -793,7 +793,7 @@ GlobalParams::~GlobalParams() { delete cMapDirs; delete cidToUnicodeCache; - delete unicodeMapCache; + delete tqunicodeMapCache; delete cMapCache; } @@ -825,7 +825,7 @@ UnicodeMap *GlobalParams::getResidentUnicodeMap(const GString *encodingName) { FILE *GlobalParams::getUnicodeMapFile(const GString *encodingName) { GString *fileName; - if (!(fileName = (GString *)unicodeMaps->lookup(encodingName))) { + if (!(fileName = (GString *)tqunicodeMaps->lookup(encodingName))) { return NULL; } return fopen(fileName->getCString(), "r"); @@ -959,7 +959,7 @@ UnicodeMap *GlobalParams::getUnicodeMap(GString *encodingName) { map->incRefCnt(); return map; } - return unicodeMapCache->getUnicodeMap(encodingName); + return tqunicodeMapCache->getUnicodeMap(encodingName); } CMap *GlobalParams::getCMap(GString *collection, GString *cMapName) { diff --git a/filters/kword/pdf/xpdf/xpdf/GlobalParams.h b/filters/kword/pdf/xpdf/xpdf/GlobalParams.h index 86114a15..1f3e4c53 100644 --- a/filters/kword/pdf/xpdf/xpdf/GlobalParams.h +++ b/filters/kword/pdf/xpdf/xpdf/GlobalParams.h @@ -237,7 +237,7 @@ private: // [GString] GHash *residentUnicodeMaps; // mappings from Unicode to char codes, // indexed by encoding name [UnicodeMap] - GHash *unicodeMaps; // files for mappings from Unicode to char + GHash *tqunicodeMaps; // files for mappings from Unicode to char // codes, indexed by encoding name [GString] GHash *cMapDirs; // list of CMap dirs, indexed by collection // name [GList[GString]] @@ -263,7 +263,7 @@ private: GBool psEmbedCIDTrueType; // embed CID TrueType fonts? GBool psOPI; // generate PostScript OPI comments? GBool psASCIIHex; // use ASCIIHex instead of ASCII85? - GString *textEncoding; // encoding (unicodeMap) to use for text + GString *textEncoding; // encoding (tqunicodeMap) to use for text // output EndOfLineKind textEOL; // type of EOL marker to use for text // output @@ -280,7 +280,7 @@ private: GBool errQuiet; // suppress error messages? CIDToUnicodeCache *cidToUnicodeCache; - UnicodeMapCache *unicodeMapCache; + UnicodeMapCache *tqunicodeMapCache; CMapCache *cMapCache; }; diff --git a/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.cc b/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.cc index 1a6d87e1..43bfc793 100644 --- a/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.cc +++ b/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.cc @@ -96,7 +96,7 @@ void ImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg) { + int *tqmaskColors, GBool inlineImg) { FILE *f; ImageStream *imgStr; Guchar *p; diff --git a/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.h b/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.h index c3eb36e0..4f317150 100644 --- a/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.h +++ b/filters/kword/pdf/xpdf/xpdf/ImageOutputDev.h @@ -62,7 +62,7 @@ public: GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg); + int *tqmaskColors, GBool inlineImg); private: diff --git a/filters/kword/pdf/xpdf/xpdf/JBIG2Stream.cc b/filters/kword/pdf/xpdf/xpdf/JBIG2Stream.cc index 6312caca..c5d5450b 100644 --- a/filters/kword/pdf/xpdf/xpdf/JBIG2Stream.cc +++ b/filters/kword/pdf/xpdf/xpdf/JBIG2Stream.cc @@ -682,11 +682,11 @@ GBool JBIG2HuffmanDecoder::decodeInt(int *x, JBIG2HuffmanTable *table) { } Guint JBIG2HuffmanDecoder::readBits(Guint n) { - Guint x, mask, nLeft; + Guint x, tqmask, nLeft; - mask = (n == 32) ? 0xffffffff : ((1 << n) - 1); + tqmask = (n == 32) ? 0xffffffff : ((1 << n) - 1); if (bufLen >= n) { - x = (buf >> (bufLen - n)) & mask; + x = (buf >> (bufLen - n)) & tqmask; bufLen -= n; } else { x = buf & ((1 << bufLen) - 1); @@ -1101,7 +1101,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, for (yy = y0; yy < y1; ++yy) { - // one byte per line -- need to mask both left and right side + // one byte per line -- need to tqmask both left and right side if (oneByte) { if (x >= 0) { destPtr = data + (y + yy) * line + (x >> 3); @@ -1121,7 +1121,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, case 3: // xnor dest ^= ((src1 ^ 0xff) >> s1) & m2; break; - case 4: // replace + case 4: // tqreplace dest = (dest & ~m3) | ((src1 >> s1) & m3); break; } @@ -1144,14 +1144,14 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, case 3: // xnor dest ^= (src1 ^ 0xff) & m2; break; - case 4: // replace + case 4: // tqreplace dest = (src1 & m2) | (dest & m1); break; } *destPtr = dest; } - // multiple bytes per line -- need to mask left side of left-most + // multiple bytes per line -- need to tqmask left side of left-most // byte and right side of right-most byte } else { @@ -1174,7 +1174,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, case 3: // xnor dest ^= (src1 ^ 0xff) >> s1; break; - case 4: // replace + case 4: // tqreplace dest = (dest & (0xff << s2)) | (src1 >> s1); break; } @@ -1206,7 +1206,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, case 3: // xnor dest ^= src ^ 0xff; break; - case 4: // replace + case 4: // tqreplace dest = src; break; } @@ -1231,7 +1231,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, case 3: // xnor dest ^= (src ^ 0xff) & m2; break; - case 4: // replace + case 4: // tqreplace dest = (src & m2) | (dest & m1); break; } diff --git a/filters/kword/pdf/xpdf/xpdf/Link.cc b/filters/kword/pdf/xpdf/xpdf/Link.cc index 345e7296..b660c035 100644 --- a/filters/kword/pdf/xpdf/xpdf/Link.cc +++ b/filters/kword/pdf/xpdf/xpdf/Link.cc @@ -713,7 +713,7 @@ Links::~Links() { gfree(links); } -LinkAction *Links::find(double x, double y) { +LinkAction *Links::tqfind(double x, double y) { int i; for (i = numLinks - 1; i >= 0; --i) { diff --git a/filters/kword/pdf/xpdf/xpdf/Link.h b/filters/kword/pdf/xpdf/xpdf/Link.h index 17eab2c7..65161876 100644 --- a/filters/kword/pdf/xpdf/xpdf/Link.h +++ b/filters/kword/pdf/xpdf/xpdf/Link.h @@ -357,7 +357,7 @@ public: // If point <x>,<y> is in a link, return the associated action; // else return NULL. - LinkAction *find(double x, double y); + LinkAction *tqfind(double x, double y); // Return true if <x>,<y> is in a link. GBool onLink(double x, double y); diff --git a/filters/kword/pdf/xpdf/xpdf/OutputDev.cc b/filters/kword/pdf/xpdf/xpdf/OutputDev.cc index 34ec5683..fbef8c17 100644 --- a/filters/kword/pdf/xpdf/xpdf/OutputDev.cc +++ b/filters/kword/pdf/xpdf/xpdf/OutputDev.cc @@ -81,7 +81,7 @@ void OutputDev::drawImageMask(GfxState */*state*/, Object */*ref*/, void OutputDev::drawImage(GfxState */*state*/, Object */*ref*/, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int */*maskColors*/, GBool inlineImg) { + int */*tqmaskColors*/, GBool inlineImg) { int i, j; if (inlineImg) { diff --git a/filters/kword/pdf/xpdf/xpdf/OutputDev.h b/filters/kword/pdf/xpdf/xpdf/OutputDev.h index a7e1f0ab..0e29c40c 100644 --- a/filters/kword/pdf/xpdf/xpdf/OutputDev.h +++ b/filters/kword/pdf/xpdf/xpdf/OutputDev.h @@ -135,7 +135,7 @@ public: GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg); + int *tqmaskColors, GBool inlineImg); #ifdef OPI_SUPPORT //----- OPI functions diff --git a/filters/kword/pdf/xpdf/xpdf/PBMOutputDev.cc b/filters/kword/pdf/xpdf/xpdf/PBMOutputDev.cc index 34432991..453b0862 100644 --- a/filters/kword/pdf/xpdf/xpdf/PBMOutputDev.cc +++ b/filters/kword/pdf/xpdf/xpdf/PBMOutputDev.cc @@ -72,7 +72,7 @@ void PBMOutputDev::killPBMOutputDev(PBMOutputDev *out) { delete out; - // these have to be done *after* the XOutputDev (parent of the + // these have to be done *after* the XOutputDev (tqparent of the // PBMOutputDev) is deleted, since XOutputDev::~XOutputDev() needs // them XFreePixmap(displayA, pixmapA); diff --git a/filters/kword/pdf/xpdf/xpdf/PDFDoc.h b/filters/kword/pdf/xpdf/xpdf/PDFDoc.h index ff6e359c..64c6cd2a 100644 --- a/filters/kword/pdf/xpdf/xpdf/PDFDoc.h +++ b/filters/kword/pdf/xpdf/xpdf/PDFDoc.h @@ -103,7 +103,7 @@ public: // If point <x>,<y> is in a link, return the associated action; // else return NULL. - LinkAction *findLink(double x, double y) { return links->find(x, y); } + LinkAction *findLink(double x, double y) { return links->tqfind(x, y); } // Return true if <x>,<y> is in a link. GBool onLink(double x, double y) { return links->onLink(x, y); } diff --git a/filters/kword/pdf/xpdf/xpdf/PSOutputDev.cc b/filters/kword/pdf/xpdf/xpdf/PSOutputDev.cc index c400338e..700c4829 100644 --- a/filters/kword/pdf/xpdf/xpdf/PSOutputDev.cc +++ b/filters/kword/pdf/xpdf/xpdf/PSOutputDev.cc @@ -315,7 +315,7 @@ static char *prolog[] = { "} def", "/pdfImM1 {", " /pdfImBuf1 4 index 7 add 8 idiv string def", - " { currentfile pdfImBuf1 readhexstring pop } imagemask", + " { currentfile pdfImBuf1 readhexstring pop } imagetqmask", "} def", "% Level 2 image operators", "/pdfImBuf 100 string def", @@ -340,7 +340,7 @@ static char *prolog[] = { " (%-EOD-) eq { exit } if } loop", "} def", "/pdfImM {", - " fCol imagemask", + " fCol imagetqmask", " { currentfile pdfImBuf readline", " not { pop exit } if", " (%-EOD-) eq { exit } if } loop", @@ -862,7 +862,7 @@ void PSOutputDev::setupFonts(Dict *resDict) { fontDict.free(); } -void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) { +void PSOutputDev::setupFont(GfxFont *font, Dict *tqparentResDict) { Ref fontFileID; GString *name; PSFontParam *fontParam; @@ -960,7 +960,7 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) { sprintf(type3Name, "T3_%d_%d", font->getID()->num, font->getID()->gen); psName = type3Name; - setupType3Font(font, psName, parentResDict); + setupType3Font(font, psName, tqparentResDict); // do 8-bit font substitution } else if (!font->isCIDFont()) { @@ -1477,7 +1477,7 @@ void PSOutputDev::setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, } void PSOutputDev::setupType3Font(GfxFont *font, char *psName, - Dict *parentResDict) { + Dict *tqparentResDict) { Dict *resDict; Dict *charProcs; Object charProc; @@ -1491,7 +1491,7 @@ void PSOutputDev::setupType3Font(GfxFont *font, char *psName, if ((resDict = ((Gfx8BitFont *)font)->getResources())) { setupResources(resDict); } else { - resDict = parentResDict; + resDict = tqparentResDict; } // beginning comment @@ -1701,7 +1701,7 @@ void PSOutputDev::startPage(int pageNum, GfxState *state) { height = y2 - y1; if (width > height && width > paperWidth) { landscape = gTrue; - writePSFmt("%%%%PageOrientation: %s\n", + writePSFmt("%%%%PageQt::Orientation: %s\n", state->getCTM()[0] ? "Landscape" : "Portrait"); writePS("pdfStartPage\n"); writePS("90 rotate\n"); @@ -1712,7 +1712,7 @@ void PSOutputDev::startPage(int pageNum, GfxState *state) { height = t; } else { landscape = gFalse; - writePSFmt("%%%%PageOrientation: %s\n", + writePSFmt("%%%%PageQt::Orientation: %s\n", state->getCTM()[0] ? "Portrait" : "Landscape"); writePS("pdfStartPage\n"); tx = -x1; @@ -2217,7 +2217,7 @@ void PSOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, void PSOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg) { + int *tqmaskColors, GBool inlineImg) { int len; len = height * ((width * colorMap->getNumPixelComps() * @@ -2287,7 +2287,7 @@ void PSOutputDev::doImageL1(GfxImageColorMap *colorMap, } delete imgStr; - // imagemask + // imagetqmask } else { str->reset(); i = 0; @@ -2478,7 +2478,7 @@ void PSOutputDev::doImageL2(Object *ref, GfxImageColorMap *colorMap, writePS(" /DataSource { 2 copy get exch 1 add exch }\n"); // end of image dictionary - writePSFmt(">>\n%s\n", colorMap ? "image" : "imagemask"); + writePSFmt(">>\n%s\n", colorMap ? "image" : "imagetqmask"); // get rid of the array and index writePS("pop pop\n"); diff --git a/filters/kword/pdf/xpdf/xpdf/PSOutputDev.h b/filters/kword/pdf/xpdf/xpdf/PSOutputDev.h index fbfc3a5c..245ff0b4 100644 --- a/filters/kword/pdf/xpdf/xpdf/PSOutputDev.h +++ b/filters/kword/pdf/xpdf/xpdf/PSOutputDev.h @@ -131,7 +131,7 @@ public: GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg); + int *tqmaskColors, GBool inlineImg); #if OPI_SUPPORT //----- OPI functions @@ -155,7 +155,7 @@ private: int firstPage, int lastPage, PSOutMode modeA); void setupResources(Dict *resDict); void setupFonts(Dict *resDict); - void setupFont(GfxFont *font, Dict *parentResDict); + void setupFont(GfxFont *font, Dict *tqparentResDict); void setupEmbeddedType1Font(Ref *id, char *psName); void setupExternalType1Font(GString *fileName, char *psName); void setupEmbeddedType1CFont(GfxFont *font, Ref *id, char *psName); @@ -163,7 +163,7 @@ private: void setupExternalTrueTypeFont(GfxFont *font, char *psName); void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, char *psName); void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, char *psName); - void setupType3Font(GfxFont *font, char *psName, Dict *parentResDict); + void setupType3Font(GfxFont *font, char *psName, Dict *tqparentResDict); void setupImages(Dict *resDict); void setupImage(Ref id, Stream *str); void addProcessColor(double c, double m, double y, double k); diff --git a/filters/kword/pdf/xpdf/xpdf/TTFont.cc b/filters/kword/pdf/xpdf/xpdf/TTFont.cc index 6107fd43..6077f3c0 100644 --- a/filters/kword/pdf/xpdf/xpdf/TTFont.cc +++ b/filters/kword/pdf/xpdf/xpdf/TTFont.cc @@ -48,7 +48,7 @@ TTFontEngine::~TTFontEngine() { TTFontFile::TTFontFile(TTFontEngine *engineA, char *fontFileName, char **fontEnc, GBool pdfFontHasEncoding) { TT_Face_Properties props; - TT_UShort unicodeCmap, macRomanCmap, msSymbolCmap; + TT_UShort tqunicodeCmap, macRomanCmap, msSymbolCmap; TT_UShort platform, encoding, i; int j; @@ -77,11 +77,11 @@ TTFontFile::TTFontFile(TTFontEngine *engineA, char *fontFileName, // and use (0xf000 + char code). // 3. If none of these rules apply, use the first cmap and hope for // the best (this shouldn't happen). - unicodeCmap = macRomanCmap = msSymbolCmap = 0xffff; + tqunicodeCmap = macRomanCmap = msSymbolCmap = 0xffff; for (i = 0; i < props.num_CharMaps; ++i) { if (!TT_Get_CharMap_ID(face, i, &platform, &encoding)) { if (platform == 3 && encoding == 1) { - unicodeCmap = i; + tqunicodeCmap = i; } else if (platform == 1 && encoding == 0) { macRomanCmap = i; } else if (platform == 3 && encoding == 0) { @@ -93,8 +93,8 @@ TTFontFile::TTFontFile(TTFontEngine *engineA, char *fontFileName, mode = ttFontModeCharCode; charMapOffset = 0; if (pdfFontHasEncoding) { - if (unicodeCmap != 0xffff) { - i = unicodeCmap; + if (tqunicodeCmap != 0xffff) { + i = tqunicodeCmap; mode = ttFontModeUnicode; } else if (macRomanCmap != 0xffff) { i = macRomanCmap; diff --git a/filters/kword/pdf/xpdf/xpdf/UnicodeMap.cc b/filters/kword/pdf/xpdf/xpdf/UnicodeMap.cc index fe1185d7..d197e5cf 100644 --- a/filters/kword/pdf/xpdf/xpdf/UnicodeMap.cc +++ b/filters/kword/pdf/xpdf/xpdf/UnicodeMap.cc @@ -46,7 +46,7 @@ UnicodeMap *UnicodeMap::parse(GString *encodingNameA) { char *tok1, *tok2, *tok3; if (!(f = globalParams->getUnicodeMapFile(encodingNameA))) { - error(-1, "Couldn't find unicodeMap file for the '%s' encoding", + error(-1, "Couldn't find tqunicodeMap file for the '%s' encoding", encodingNameA->getCString()); return NULL; } @@ -93,11 +93,11 @@ UnicodeMap *UnicodeMap::parse(GString *encodingNameA) { eMap->nBytes = nBytes; ++map->eMapsLen; } else { - error(-1, "Bad line (%d) in unicodeMap file for the '%s' encoding", + error(-1, "Bad line (%d) in tqunicodeMap file for the '%s' encoding", line, encodingNameA->getCString()); } } else { - error(-1, "Bad line (%d) in unicodeMap file for the '%s' encoding", + error(-1, "Bad line (%d) in tqunicodeMap file for the '%s' encoding", line, encodingNameA->getCString()); } ++line; @@ -110,8 +110,8 @@ UnicodeMap *UnicodeMap::parse(GString *encodingNameA) { UnicodeMap::UnicodeMap(GString *encodingNameA) { encodingName = encodingNameA; - unicodeOut = gFalse; - kind = unicodeMapUser; + tqunicodeOut = gFalse; + kind = tqunicodeMapUser; ranges = NULL; len = 0; eMaps = NULL; @@ -119,11 +119,11 @@ UnicodeMap::UnicodeMap(GString *encodingNameA) { refCnt = 1; } -UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA, +UnicodeMap::UnicodeMap(const char *encodingNameA, GBool tqunicodeOutA, UnicodeMapRange *rangesA, int lenA) { encodingName = new GString(encodingNameA); - unicodeOut = unicodeOutA; - kind = unicodeMapResident; + tqunicodeOut = tqunicodeOutA; + kind = tqunicodeMapResident; ranges = rangesA; len = lenA; eMaps = NULL; @@ -131,11 +131,11 @@ UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA, refCnt = 1; } -UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA, +UnicodeMap::UnicodeMap(const char *encodingNameA, GBool tqunicodeOutA, UnicodeMapFunc funcA) { encodingName = new GString(encodingNameA); - unicodeOut = unicodeOutA; - kind = unicodeMapFunc; + tqunicodeOut = tqunicodeOutA; + kind = tqunicodeMapFunc; func = funcA; eMaps = NULL; eMapsLen = 0; @@ -144,7 +144,7 @@ UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA, UnicodeMap::~UnicodeMap() { delete encodingName; - if (kind == unicodeMapUser && ranges) { + if (kind == tqunicodeMapUser && ranges) { gfree(ranges); } if (eMaps) { @@ -170,7 +170,7 @@ int UnicodeMap::mapUnicode(Unicode u, char *buf, int bufSize) { int a, b, m, n, i, j; Guint code; - if (kind == unicodeMapFunc) { + if (kind == tqunicodeMapFunc) { return (*func)(u, buf, bufSize); } @@ -219,7 +219,7 @@ int UnicodeMap::mapUnicode(Unicode u, char *buf, int bufSize) { UnicodeMapCache::UnicodeMapCache() { int i; - for (i = 0; i < unicodeMapCacheSize; ++i) { + for (i = 0; i < tqunicodeMapCacheSize; ++i) { cache[i] = NULL; } } @@ -227,7 +227,7 @@ UnicodeMapCache::UnicodeMapCache() { UnicodeMapCache::~UnicodeMapCache() { int i; - for (i = 0; i < unicodeMapCacheSize; ++i) { + for (i = 0; i < tqunicodeMapCacheSize; ++i) { if (cache[i]) { cache[i]->decRefCnt(); } @@ -242,7 +242,7 @@ UnicodeMap *UnicodeMapCache::getUnicodeMap(GString *encodingName) { cache[0]->incRefCnt(); return cache[0]; } - for (i = 1; i < unicodeMapCacheSize; ++i) { + for (i = 1; i < tqunicodeMapCacheSize; ++i) { if (cache[i] && cache[i]->match(encodingName)) { map = cache[i]; for (j = i; j >= 1; --j) { @@ -254,10 +254,10 @@ UnicodeMap *UnicodeMapCache::getUnicodeMap(GString *encodingName) { } } if ((map = UnicodeMap::parse(encodingName))) { - if (cache[unicodeMapCacheSize - 1]) { - cache[unicodeMapCacheSize - 1]->decRefCnt(); + if (cache[tqunicodeMapCacheSize - 1]) { + cache[tqunicodeMapCacheSize - 1]->decRefCnt(); } - for (j = unicodeMapCacheSize - 1; j >= 1; --j) { + for (j = tqunicodeMapCacheSize - 1; j >= 1; --j) { cache[j] = cache[j - 1]; } cache[0] = map; diff --git a/filters/kword/pdf/xpdf/xpdf/UnicodeMap.h b/filters/kword/pdf/xpdf/xpdf/UnicodeMap.h index 189f3154..35506aab 100644 --- a/filters/kword/pdf/xpdf/xpdf/UnicodeMap.h +++ b/filters/kword/pdf/xpdf/xpdf/UnicodeMap.h @@ -25,9 +25,9 @@ class GString; //------------------------------------------------------------------------ enum UnicodeMapKind { - unicodeMapUser, // read from a file - unicodeMapResident, // static list of ranges - unicodeMapFunc // function pointer + tqunicodeMapUser, // read from a file + tqunicodeMapResident, // static list of ranges + tqunicodeMapFunc // function pointer }; typedef int (*UnicodeMapFunc)(Unicode u, char *buf, int bufSize); @@ -49,12 +49,12 @@ public: static UnicodeMap *parse(GString *encodingNameA); // Create a resident UnicodeMap. - UnicodeMap(const char *encodingNameA, GBool unicodeOutA, + UnicodeMap(const char *encodingNameA, GBool tqunicodeOutA, UnicodeMapRange *rangesA, int lenA); // Create a resident UnicodeMap that uses a function instead of a // list of ranges. - UnicodeMap(const char *encodingNameA, GBool unicodeOutA, + UnicodeMap(const char *encodingNameA, GBool tqunicodeOutA, UnicodeMapFunc funcA); ~UnicodeMap(); @@ -64,7 +64,7 @@ public: GString *getEncodingName() { return encodingName; } - GBool isUnicode() { return unicodeOut; } + GBool isUnicode() { return tqunicodeOut; } // Return true if this UnicodeMap matches the specified // <encodingNameA>. @@ -82,7 +82,7 @@ private: GString *encodingName; UnicodeMapKind kind; - GBool unicodeOut; + GBool tqunicodeOut; union { UnicodeMapRange *ranges; // (user, resident) UnicodeMapFunc func; // (func) @@ -95,7 +95,7 @@ private: //------------------------------------------------------------------------ -#define unicodeMapCacheSize 4 +#define tqunicodeMapCacheSize 4 class UnicodeMapCache { public: @@ -110,7 +110,7 @@ public: private: - UnicodeMap *cache[unicodeMapCacheSize]; + UnicodeMap *cache[tqunicodeMapCacheSize]; }; #endif diff --git a/filters/kword/pdf/xpdf/xpdf/XOutputDev.cc b/filters/kword/pdf/xpdf/xpdf/XOutputDev.cc index 3c58f565..f172ac41 100644 --- a/filters/kword/pdf/xpdf/xpdf/XOutputDev.cc +++ b/filters/kword/pdf/xpdf/xpdf/XOutputDev.cc @@ -1627,7 +1627,7 @@ XOutputDev::XOutputDev(Display *displayA, int screenNumA, XVisualInfo visualTempl; XVisualInfo *visualList; int nVisuals; - Gulong mask; + Gulong tqmask; XColor xcolor; XColor *xcolors; int r, g, b, n, m; @@ -1662,18 +1662,18 @@ XOutputDev::XOutputDev(Display *displayA, int screenNumA, depth = visualList->depth; if (visualList->c_class == TrueColor) { trueColor = gTrue; - for (mask = visualList->red_mask, rShift = 0; - mask && !(mask & 1); - mask >>= 1, ++rShift) ; - rMul = (int)mask; - for (mask = visualList->green_mask, gShift = 0; - mask && !(mask & 1); - mask >>= 1, ++gShift) ; - gMul = (int)mask; - for (mask = visualList->blue_mask, bShift = 0; - mask && !(mask & 1); - mask >>= 1, ++bShift) ; - bMul = (int)mask; + for (tqmask = visualList->red_tqmask, rShift = 0; + tqmask && !(tqmask & 1); + tqmask >>= 1, ++rShift) ; + rMul = (int)tqmask; + for (tqmask = visualList->green_tqmask, gShift = 0; + tqmask && !(tqmask & 1); + tqmask >>= 1, ++gShift) ; + gMul = (int)tqmask; + for (tqmask = visualList->blue_tqmask, bShift = 0; + tqmask && !(tqmask & 1); + tqmask >>= 1, ++bShift) ; + bMul = (int)tqmask; } else { trueColor = gFalse; } @@ -3162,7 +3162,7 @@ void XOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, XGetSubImage(display, pixmap, cx0, cy0, cw, ch, (1 << depth) - 1, ZPixmap, image, cx1, cy1); - // get mask color + // get tqmask color state->getFillRGB(&rgb); if (reverseVideo) { rgb.r = 1 - rgb.r; @@ -3294,7 +3294,7 @@ void XOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, void XOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg) { + int *tqmaskColors, GBool inlineImg) { ImageStream *imgStr; XImage *image; int nComps, nVals, nBits; @@ -3464,7 +3464,7 @@ void XOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, // allocate pixel buffer pixBuf = (GfxRGB *)gmalloc((yp + 1) * width * sizeof(GfxRGB)); - if (maskColors) { + if (tqmaskColors) { alphaBuf = (Guchar *)gmalloc((yp + 1) * width * sizeof(Guchar)); } else { alphaBuf = NULL; @@ -3475,11 +3475,11 @@ void XOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, image->data = (char *)gmalloc(bh * image->bytes_per_line); // if the transform is anything other than a 0/90/180/270 degree - // rotation/flip, or if there is color key masking, read the + // rotation/flip, or if there is color key tqmasking, read the // backgound pixmap to fill in the corners if (!((ulx == llx && uly == ury) || (uly == lly && ulx == urx)) || - maskColors) { + tqmaskColors) { XGetSubImage(display, pixmap, cx0, cy0, cw, ch, (1 << depth) - 1, ZPixmap, image, cx1, cy1); } @@ -3540,8 +3540,8 @@ void XOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, if (q) { *q = 1; for (k = 0; k < nComps; ++k) { - if (p2[k] < maskColors[2*k] || - p2[k] > maskColors[2*k]) { + if (p2[k] < tqmaskColors[2*k] || + p2[k] > tqmaskColors[2*k]) { *q = 0; break; } @@ -3657,7 +3657,7 @@ void XOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, // free memory delete imgStr; gfree(pixBuf); - if (maskColors) { + if (tqmaskColors) { gfree(alphaBuf); } gfree(image->data); diff --git a/filters/kword/pdf/xpdf/xpdf/XOutputDev.h b/filters/kword/pdf/xpdf/xpdf/XOutputDev.h index e4974f31..0d97af89 100644 --- a/filters/kword/pdf/xpdf/xpdf/XOutputDev.h +++ b/filters/kword/pdf/xpdf/xpdf/XOutputDev.h @@ -569,7 +569,7 @@ public: GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg); + int *tqmaskColors, GBool inlineImg); //----- Type 3 font operators virtual void type3D0(GfxState *state, double wx, double wy); diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFApp.cc b/filters/kword/pdf/xpdf/xpdf/XPDFApp.cc index e456310b..d0bda665 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFApp.cc +++ b/filters/kword/pdf/xpdf/xpdf/XPDFApp.cc @@ -54,8 +54,8 @@ static XrmOptionDescRec xOpts[] = { {"-fg", "*Foreground", XrmoptionSepArg, NULL}, {"-background", "*Background", XrmoptionSepArg, NULL}, {"-bg", "*Background", XrmoptionSepArg, NULL}, - {"-geometry", ".geometry", XrmoptionSepArg, NULL}, - {"-g", ".geometry", XrmoptionSepArg, NULL}, + {"-tqgeometry", ".tqgeometry", XrmoptionSepArg, NULL}, + {"-g", ".tqgeometry", XrmoptionSepArg, NULL}, {"-font", "*.fontList", XrmoptionSepArg, NULL}, {"-fn", "*.fontList", XrmoptionSepArg, NULL}, {"-title", ".title", XrmoptionSepArg, NULL}, @@ -69,7 +69,7 @@ static XrmOptionDescRec xOpts[] = { #define nXOpts (sizeof(xOpts) / sizeof(XrmOptionDescRec)) struct XPDFAppResources { - String geometry; + String tqgeometry; String title; Bool installCmap; int rgbCubeSize; @@ -85,7 +85,7 @@ static Bool defReverseVideo = False; static Bool defViKeys = False; static XtResource xResources[] = { - { "geometry", "Geometry", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, geometry), XtRString, (XtPointer)NULL }, + { "geometry", "Geometry", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, tqgeometry), XtRString, (XtPointer)NULL }, { "title", "Title", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, title), XtRString, (XtPointer)NULL }, { "installCmap", "InstallCmap", XtRBool, sizeof(Bool), XtOffsetOf(XPDFAppResources, installCmap), XtRBool, (XtPointer)&defInstallCmap }, { "rgbCubeSize", "RgbCubeSize", XtRInt, sizeof(int), XtOffsetOf(XPDFAppResources, rgbCubeSize), XtRInt, (XtPointer)&defRGBCubeSize }, @@ -156,7 +156,7 @@ void XPDFApp::getResources() { XtGetApplicationResources(appShell, &resources, xResources, nXResources, NULL, 0); - geometry = resources.geometry ? new GString(resources.geometry) + tqgeometry = resources.tqgeometry ? new GString(resources.tqgeometry) : (GString *)NULL; title = resources.title ? new GString(resources.title) : (GString *)NULL; installCmap = (GBool)resources.installCmap; @@ -180,8 +180,8 @@ void XPDFApp::getResources() { XPDFApp::~XPDFApp() { deleteGList(viewers, XPDFViewer); - if (geometry) { - delete geometry; + if (tqgeometry) { + delete tqgeometry; } if (title) { delete title; diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFApp.h b/filters/kword/pdf/xpdf/xpdf/XPDFApp.h index 4875456e..46aa28dc 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFApp.h +++ b/filters/kword/pdf/xpdf/xpdf/XPDFApp.h @@ -58,7 +58,7 @@ public: void remoteQuit(); //----- resource/option values - GString *getGeometry() { return geometry; } + GString *getGeometry() { return tqgeometry; } GString *getTitle() { return title; } GBool getInstallCmap() { return installCmap; } int getRGBCubeSize() { return rgbCubeSize; } @@ -90,7 +90,7 @@ private: Widget remoteWin; //----- resource/option values - GString *geometry; + GString *tqgeometry; GString *title; GBool installCmap; int rgbCubeSize; diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFCore.cc b/filters/kword/pdf/xpdf/xpdf/XPDFCore.cc index 8376ce97..a7897358 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFCore.cc +++ b/filters/kword/pdf/xpdf/xpdf/XPDFCore.cc @@ -106,16 +106,16 @@ XPDFCore *XPDFCore::currentSelectionOwner = NULL; // XPDFCore //------------------------------------------------------------------------ -XPDFCore::XPDFCore(Widget shellA, Widget parentWidgetA, +XPDFCore::XPDFCore(Widget shellA, Widget tqparentWidgetA, Gulong paperColorA, GBool fullScreenA, GBool reverseVideo, GBool installCmap, int rgbCubeSize) { GString *initialZoom; int i; shell = shellA; - parentWidget = parentWidgetA; - display = XtDisplay(parentWidget); - screenNum = XScreenNumberOfScreen(XtScreen(parentWidget)); + tqparentWidget = tqparentWidgetA; + display = XtDisplay(tqparentWidget); + screenNum = XScreenNumberOfScreen(XtScreen(tqparentWidget)); paperColor = paperColorA; fullScreen = fullScreenA; @@ -302,7 +302,7 @@ int XPDFCore::loadFile(GString *fileName, GString *ownerPassword, // save the modification time modTime = getModTime(doc->getFileName()->getCString()); - // update the parent window + // update the tqparent window if (updateCbk) { (*updateCbk)(updateCbkData, doc->getFileName(), -1, doc->getNumPages(), NULL); @@ -495,7 +495,7 @@ void XPDFCore::displayPage(int pageA, int zoomA, int rotateA, historyFLen = 0; } - // update the parent window + // update the tqparent window if (updateCbk) { (*updateCbk)(updateCbkData, NULL, page, -1, ""); } @@ -1231,10 +1231,10 @@ void XPDFCore::runCommand(GString *cmdFmt, GString *arg) { //------------------------------------------------------------------------ -// find +// tqfind //------------------------------------------------------------------------ -void XPDFCore::find(char *s) { +void XPDFCore::tqfind(char *s) { Unicode *u; TextOutputDev *textOut; int xMin, yMin, xMax, yMax; @@ -1364,7 +1364,7 @@ void XPDFCore::initWindow() { n = 0; XtSetArg(args[n], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ++n; XtSetArg(args[n], XmNvisualPolicy, XmVARIABLE); ++n; - scrolledWin = XmCreateScrolledWindow(parentWidget, "scroll", args, n); + scrolledWin = XmCreateScrolledWindow(tqparentWidget, "scroll", args, n); XtManageChild(scrolledWin); n = 0; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); ++n; diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFCore.h b/filters/kword/pdf/xpdf/xpdf/XPDFCore.h index 348486f0..25c26f6b 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFCore.h +++ b/filters/kword/pdf/xpdf/xpdf/XPDFCore.h @@ -84,8 +84,8 @@ typedef GString *(*XPDFReqPasswordCbk)(void *data, GBool again); class XPDFCore { public: - // Create viewer core inside <parentWidgetA>. - XPDFCore(Widget shellA, Widget parentWidgetA, + // Create viewer core inside <tqparentWidgetA>. + XPDFCore(Widget shellA, Widget tqparentWidgetA, Gulong paperColorA, GBool fullScreenA, GBool reverseVideo, GBool installCmap, int rgbCubeSize); @@ -142,9 +142,9 @@ public: void doAction(LinkAction *action); - //----- find + //----- tqfind - void find(char *s); + void tqfind(char *s); //----- simple modal dialogs @@ -229,7 +229,7 @@ private: Visual *visual; Colormap colormap; Widget shell; // top-level shell containing the widget - Widget parentWidget; // parent widget (not created by XPDFCore) + Widget tqparentWidget; // tqparent widget (not created by XPDFCore) Widget scrolledWin; Widget hScrollBar; Widget vScrollBar; diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFTree.cc b/filters/kword/pdf/xpdf/xpdf/XPDFTree.cc index 46e5466c..1ead3a27 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFTree.cc +++ b/filters/kword/pdf/xpdf/xpdf/XPDFTree.cc @@ -16,7 +16,7 @@ struct _XPDFTreeEntry { Widget widget; - XPDFTreeEntry *children; + XPDFTreeEntry *tqchildren; XPDFTreeEntry *next; }; @@ -41,7 +41,7 @@ static void setValuesAlmost(Widget oldWidget, Widget newWidget, static XtGeometryResult queryGeometry(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply); -static XtGeometryResult geometryManager(Widget widget, +static XtGeometryResult tqgeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply); static void changeManaged(Widget widget); @@ -56,8 +56,8 @@ static void insertChildOnList(XPDFTreeEntry *e, XPDFTreeEntry **listHead); static void deleteChildFromList(XPDFTreeEntry *e, XPDFTreeEntry **listHead); static void createGC(Widget widget); static void destroyGC(Widget widget); -static void layout(Widget widget, Widget instigator); -static int layoutSubtree(XPDFTreeWidget w, Widget instigator, +static void tqlayout(Widget widget, Widget instigator); +static int tqlayoutSubtree(XPDFTreeWidget w, Widget instigator, XPDFTreeEntry *e, Position x, Position y, Boolean visible); static void calcSize(Widget widget, Widget instigator, @@ -66,7 +66,7 @@ static void calcSize(Widget widget, Widget instigator, static void calcSubtreeSize(XPDFTreeWidget w, Widget instigator, XPDFTreeEntry *e, Dimension *width, Dimension *height); -static Boolean needRelayout(Widget oldWidget, Widget newWidget); +static Boolean needRetqlayout(Widget oldWidget, Widget newWidget); static void click(Widget widget, XEvent *event, String *params, Cardinal *numParams); static Boolean findPosition(XPDFTreeWidget w, int x, int y, @@ -142,7 +142,7 @@ externaldef(xpdftreeclassrec) XPDFTreeClassRec xpdfTreeClassRec = { XtNumber(actions), // num_actions resources, // resources XtNumber(resources), // num_resources - NULLQUARK, // xrm_class + NULLTQUARK, // xrm_class TRUE, // compress_motion XtExposeCompressMaximal, // compress_exposure TRUE, // compress_enterleave @@ -158,12 +158,12 @@ externaldef(xpdftreeclassrec) XPDFTreeClassRec xpdfTreeClassRec = { XtVersion, // version NULL, // callback_private defaultTranslations, // tm_table - &queryGeometry, // query_geometry + &queryGeometry, // query_tqgeometry NULL, // display_accelerator NULL // extension }, { // Composite - &geometryManager, // geometry_manager + &tqgeometryManager, // tqgeometry_manager &changeManaged, // change_managed XtInheritInsertChild, // insert_child XtInheritDeleteChild, // delete_child @@ -189,15 +189,15 @@ externaldef(xpdftreeclassrec) XPDFTreeClassRec xpdfTreeClassRec = { #endif NULL, // syn_constraint_resources 0, // num_syn_constraint_res's - XmInheritParentProcess, // parent_process + XmInheritParentProcess, // tqparent_process NULL // extension }, { // XPDFTree &createGC, // createGC &destroyGC, // destroyGC - &layout, // layout + &tqlayout, // tqlayout &calcSize, // calcSize - &needRelayout, // needRelayout + &needRetqlayout, // needRetqlayout NULL // extension } }; @@ -218,14 +218,14 @@ static void classPartInitialize(WidgetClass widgetCls) { if (wc->treeClass.destroyGC == XPDFInheritDestroyGC) { wc->treeClass.destroyGC = sc->treeClass.destroyGC; } - if (wc->treeClass.layout == XPDFInheritLayout) { - wc->treeClass.layout = sc->treeClass.layout; + if (wc->treeClass.tqlayout == XPDFInheritLayout) { + wc->treeClass.tqlayout = sc->treeClass.tqlayout; } if (wc->treeClass.calcSize == XPDFInheritCalcSize) { wc->treeClass.calcSize = sc->treeClass.calcSize; } - if (wc->treeClass.needRelayout == XPDFInheritNeedRelayout) { - wc->treeClass.needRelayout = sc->treeClass.needRelayout; + if (wc->treeClass.needRetqlayout == XPDFInheritNeedRetqlayout) { + wc->treeClass.needRetqlayout = sc->treeClass.needRetqlayout; } } @@ -259,8 +259,8 @@ static void destroy(Widget widget) { } static void destroySubtree(XPDFTreeEntry *e) { - if (e->children) { - destroySubtree(e->children); + if (e->tqchildren) { + destroySubtree(e->tqchildren); } if (e->next) { destroySubtree(e->next); @@ -270,10 +270,10 @@ static void destroySubtree(XPDFTreeEntry *e) { static void resize(Widget widget) { XPDFTreeWidgetClass cls = (XPDFTreeWidgetClass)XtClass(widget); - if (cls->treeClass.layout) { - (*cls->treeClass.layout)(widget, NULL); + if (cls->treeClass.tqlayout) { + (*cls->treeClass.tqlayout)(widget, NULL); } else { - layout(widget, NULL); + tqlayout(widget, NULL); } } @@ -301,11 +301,11 @@ static void redisplaySubtree(XPDFTreeWidget w, XPDFTreeEntry *e, c = XPDFTreeCPart(e->widget); x = e->widget->core.x; y = e->widget->core.y + e->widget->core.height / 2; - if (e->children) { + if (e->tqchildren) { if (c->entryExpanded) { drawExpandedIcon(w, x - 8, y); y2 = y; // make gcc happy - for (child = e->children; child; child = child->next) { + for (child = e->tqchildren; child; child = child->next) { y2 = child->widget->core.y + child->widget->core.height / 2; XDrawLine(XtDisplay((Widget)w), XtWindow((Widget)w), w->tree.dottedGC, x - 8, y2, x + 6, y2); @@ -346,16 +346,16 @@ static Boolean setValues(Widget oldWidget, Widget requestWidget, XPDFTreeWidget ow = (XPDFTreeWidget)oldWidget; XPDFTreeWidget nw = (XPDFTreeWidget)newWidget; XPDFTreeWidgetClass cls = (XPDFTreeWidgetClass)XtClass(nw); - Boolean relayout, redisp; + Boolean retqlayout, redisp; - // check to see if layout-affecting resources have changed - if (cls->treeClass.needRelayout) { - relayout = (*cls->treeClass.needRelayout)((Widget)ow, (Widget)nw); + // check to see if tqlayout-affecting resources have changed + if (cls->treeClass.needRetqlayout) { + retqlayout = (*cls->treeClass.needRetqlayout)((Widget)ow, (Widget)nw); } else { - relayout = needRelayout((Widget)ow, (Widget)nw); + retqlayout = needRetqlayout((Widget)ow, (Widget)nw); } redisp = False; - if (relayout) { + if (retqlayout) { // calculate a new ideal size (reset the widget size first so // calcSize will compute a new one) @@ -372,14 +372,14 @@ static Boolean setValues(Widget oldWidget, Widget requestWidget, calcSize((Widget)nw, NULL, &nw->core.width, &nw->core.height); } - // if resources have changed but size hasn't, layout manually + // if resources have changed but size hasn't, tqlayout manually // (because Xt just looks at the size) if (nw->core.width == ow->core.width && nw->core.height == ow->core.height) { - if (cls->treeClass.layout) { - (*cls->treeClass.layout)((Widget)nw, NULL); + if (cls->treeClass.tqlayout) { + (*cls->treeClass.tqlayout)((Widget)nw, NULL); } else { - layout((Widget)nw, NULL); + tqlayout((Widget)nw, NULL); } redisp = True; } @@ -393,13 +393,13 @@ static void setValuesAlmost(Widget oldWidget, Widget newWidget, XtWidgetGeometry *reply) { XPDFTreeWidgetClass cls = (XPDFTreeWidgetClass)XtClass(newWidget); - // our parent rejected a geometry request, so accept the compromise - // and relayout + // our tqparent rejected a tqgeometry request, so accept the compromise + // and retqlayout if (!reply->request_mode) { - if (cls->treeClass.layout) { - (*cls->treeClass.layout)(newWidget, NULL); + if (cls->treeClass.tqlayout) { + (*cls->treeClass.tqlayout)(newWidget, NULL); } else { - layout(newWidget, NULL); + tqlayout(newWidget, NULL); } } *request = *reply; @@ -440,13 +440,13 @@ static XtGeometryResult queryGeometry(Widget widget, #endif } -static XtGeometryResult geometryManager(Widget widget, +static XtGeometryResult tqgeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply) { XPDFTreeWidget w = (XPDFTreeWidget)XtParent(widget); XPDFTreeWidgetClass cls = (XPDFTreeWidgetClass)XtClass(w); Dimension curWidth, curHeight, curBW; - XtWidgetGeometry parentReq; + XtWidgetGeometry tqparentReq; XtGeometryResult result; // deny any requests for a new position @@ -454,7 +454,7 @@ static XtGeometryResult geometryManager(Widget widget, return XtGeometryNo; } - // save the current geometry + // save the current tqgeometry curWidth = w->core.width; curHeight = w->core.height; curBW = w->core.border_width; @@ -471,35 +471,35 @@ static XtGeometryResult geometryManager(Widget widget, } // calculate the new ideal size - parentReq.width = 0; - parentReq.height = 0; + tqparentReq.width = 0; + tqparentReq.height = 0; if (cls->treeClass.calcSize) { (*cls->treeClass.calcSize)((Widget)w, widget, - &parentReq.width, &reply->height); + &tqparentReq.width, &reply->height); } else { - calcSize((Widget)w, widget, &parentReq.width, &reply->height); + calcSize((Widget)w, widget, &tqparentReq.width, &reply->height); } - // send geometry request to our parent - parentReq.request_mode = CWWidth | CWHeight; + // send tqgeometry request to our tqparent + tqparentReq.request_mode = CWWidth | CWHeight; if (request->request_mode & XtCWQueryOnly) { - parentReq.request_mode |= XtCWQueryOnly; + tqparentReq.request_mode |= XtCWQueryOnly; } - result = XtMakeGeometryRequest((Widget)w, &parentReq, NULL); + result = XtMakeGeometryRequest((Widget)w, &tqparentReq, NULL); if (result == XtGeometryAlmost) { result = XtGeometryNo; } if (result == XtGeometryNo || (request->request_mode & XtCWQueryOnly)) { - // restore the original geometry + // restore the original tqgeometry w->core.width = curWidth; w->core.height = curHeight; w->core.border_width = curBW; } else { - if (cls->treeClass.layout) { - (*cls->treeClass.layout)((Widget)w, widget); + if (cls->treeClass.tqlayout) { + (*cls->treeClass.tqlayout)((Widget)w, widget); } else { - layout((Widget)w, widget); + tqlayout((Widget)w, widget); } } @@ -524,16 +524,16 @@ static void changeManaged(Widget widget) { calcSize(widget, NULL, &width, &height); } - // make resize request to parent -- keep asking until we get a yes + // make resize request to tqparent -- keep asking until we get a yes // or no while (XtMakeResizeRequest(widget, width, height, &width, &height) == XtGeometryAlmost) ; - // relayout - if (cls->treeClass.layout) { - (*cls->treeClass.layout)(widget, NULL); + // retqlayout + if (cls->treeClass.tqlayout) { + (*cls->treeClass.tqlayout)(widget, NULL); } else { - layout(widget, NULL); + tqlayout(widget, NULL); } #if XmVERSION > 1 @@ -552,10 +552,10 @@ static void initConstraint(Widget requestWidget, Widget newWidget, c = XPDFTreeCPart(newWidget); c->e = (XPDFTreeEntry *)gmalloc(sizeof(XPDFTreeEntry)); c->e->widget = newWidget; - c->e->children = NULL; + c->e->tqchildren = NULL; c->e->next = NULL; if (c->entryParent) { - insertChildOnList(c->e, &XPDFTreeCPart(c->entryParent)->e->children); + insertChildOnList(c->e, &XPDFTreeCPart(c->entryParent)->e->tqchildren); } else { insertChildOnList(c->e, &w->tree.root); } @@ -573,11 +573,11 @@ static void deleteSubtree(Widget widget) { if (!c->e) { return; } - while (c->e->children) { - deleteSubtree(c->e->children->widget); + while (c->e->tqchildren) { + deleteSubtree(c->e->tqchildren->widget); } if (c->entryParent) { - deleteChildFromList(c->e, &XPDFTreeCPart(c->entryParent)->e->children); + deleteChildFromList(c->e, &XPDFTreeCPart(c->entryParent)->e->tqchildren); } else { deleteChildFromList(c->e, &w->tree.root); } @@ -591,7 +591,7 @@ static Boolean constraintSetValues(Widget oldWidget, Widget requestWidget, XPDFTreeWidget w = (XPDFTreeWidget)XtParent(newWidget); XPDFTreeWidgetClass cls = (XPDFTreeWidgetClass)XtClass((Widget)w); XPDFTreeConstraint oc, nc; - Boolean relayout; + Boolean retqlayout; Dimension width, height; if (!XtIsManaged(newWidget)) { @@ -599,25 +599,25 @@ static Boolean constraintSetValues(Widget oldWidget, Widget requestWidget, } oc = XPDFTreeCPart(oldWidget); nc = XPDFTreeCPart(newWidget); - relayout = False; + retqlayout = False; if (nc->entryParent != oc->entryParent || nc->entryPosition != oc->entryPosition) { if (oc->entryParent) { - deleteChildFromList(oc->e, &XPDFTreeCPart(oc->entryParent)->e->children); + deleteChildFromList(oc->e, &XPDFTreeCPart(oc->entryParent)->e->tqchildren); } else { deleteChildFromList(oc->e, &w->tree.root); } if (nc->entryParent) { - insertChildOnList(nc->e, &XPDFTreeCPart(nc->entryParent)->e->children); + insertChildOnList(nc->e, &XPDFTreeCPart(nc->entryParent)->e->tqchildren); } else { insertChildOnList(nc->e, &w->tree.root); } - relayout = True; + retqlayout = True; } else if (nc->entryExpanded != oc->entryExpanded) { - relayout = True; + retqlayout = True; } - if (relayout) { + if (retqlayout) { // calculate a new ideal size (reset the widget size first so // calcSize will compute a new one) @@ -629,20 +629,20 @@ static Boolean constraintSetValues(Widget oldWidget, Widget requestWidget, calcSize((Widget)w, NULL, &width, &height); } - // make resize request to parent -- keep asking until we get a yes + // make resize request to tqparent -- keep asking until we get a yes // or no while (XtMakeResizeRequest((Widget)w, width, height, &width, &height) == XtGeometryAlmost) ; - // relayout the widget - if (cls->treeClass.layout) { - (*cls->treeClass.layout)((Widget)w, NULL); + // retqlayout the widget + if (cls->treeClass.tqlayout) { + (*cls->treeClass.tqlayout)((Widget)w, NULL); } else { - layout((Widget)w, NULL); + tqlayout((Widget)w, NULL); } } - return relayout; + return retqlayout; } static void insertChildOnList(XPDFTreeEntry *e, XPDFTreeEntry **listHead) { @@ -701,7 +701,7 @@ static void destroyGC(Widget widget) { XtReleaseGC(widget, w->tree.dottedGC); } -static void layout(Widget widget, Widget instigator) { +static void tqlayout(Widget widget, Widget instigator) { XPDFTreeWidget w = (XPDFTreeWidget)widget; XPDFTreeEntry *e; Position x, y; @@ -709,11 +709,11 @@ static void layout(Widget widget, Widget instigator) { x = w->tree.marginWidth + xpdfTreeIndent; y = w->tree.marginHeight; for (e = w->tree.root; e; e = e->next) { - y = layoutSubtree(w, instigator, e, x, y, True); + y = tqlayoutSubtree(w, instigator, e, x, y, True); } } -static int layoutSubtree(XPDFTreeWidget w, Widget instigator, +static int tqlayoutSubtree(XPDFTreeWidget w, Widget instigator, XPDFTreeEntry *e, Position x, Position y, Boolean visible) { Widget ew; @@ -745,10 +745,10 @@ static int layoutSubtree(XPDFTreeWidget w, Widget instigator, } } - // place this entry's children + // place this entry's tqchildren x += xpdfTreeIndent; - for (child = e->children; child; child = child->next) { - y = layoutSubtree(w, instigator, child, x, y, + for (child = e->tqchildren; child; child = child->next) { + y = tqlayoutSubtree(w, instigator, child, x, y, visible && (!c || c->entryExpanded)); } @@ -820,9 +820,9 @@ static void calcSubtreeSize(XPDFTreeWidget w, Widget instigator, h1 = 0; } - // if this entry is expanded, get size of all of its children + // if this entry is expanded, get size of all of its tqchildren if (c->entryExpanded) { - for (child = e->children; child; child = child->next) { + for (child = e->tqchildren; child; child = child->next) { calcSubtreeSize(w, instigator, child, &w2, &h2); w2 += xpdfTreeIndent; if (w2 > w1) { @@ -836,7 +836,7 @@ static void calcSubtreeSize(XPDFTreeWidget w, Widget instigator, *height = h1; } -static Boolean needRelayout(Widget oldWidget, Widget newWidget) { +static Boolean needRetqlayout(Widget oldWidget, Widget newWidget) { XPDFTreeWidget ow = (XPDFTreeWidget)oldWidget; XPDFTreeWidget nw = (XPDFTreeWidget)newWidget; @@ -907,13 +907,13 @@ static Boolean findPositionInSubtree(XPDFTreeWidget w, int x, int y, return True; } else if (x >= child->core.x - 16 && x < child->core.x - 4 && y >= y1 - 6 && y < y1 + 6 && - (*e)->children) { + (*e)->tqchildren) { *onExpandIcon = True; return True; } c = XPDFTreeCPart(child); if (!c || c->entryExpanded) { - for (e2 = (*e)->children; e2; e2 = e2->next) { + for (e2 = (*e)->tqchildren; e2; e2 = e2->next) { *e = e2; if (findPositionInSubtree(w, x, y, e, onExpandIcon)) { return True; @@ -923,7 +923,7 @@ static Boolean findPositionInSubtree(XPDFTreeWidget w, int x, int y, return False; } -Widget XPDFCreateTree(Widget parent, char *name, +Widget XPDFCreateTree(Widget tqparent, char *name, ArgList argList, Cardinal numArgs) { - return XtCreateWidget(name, xpdfTreeWidgetClass, parent, argList, numArgs); + return XtCreateWidget(name, xpdfTreeWidgetClass, tqparent, argList, numArgs); } diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFTree.h b/filters/kword/pdf/xpdf/xpdf/XPDFTree.h index d569f498..93e3fb77 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFTree.h +++ b/filters/kword/pdf/xpdf/xpdf/XPDFTree.h @@ -35,7 +35,7 @@ typedef struct { Widget selectedItem; } XPDFTreeSelectCallbackStruct; -extern Widget XPDFCreateTree(Widget parent, char *name, +extern Widget XPDFCreateTree(Widget tqparent, char *name, ArgList argList, Cardinal argCount); } // extern "C" diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFTreeP.h b/filters/kword/pdf/xpdf/xpdf/XPDFTreeP.h index 16ab137a..fecc2572 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFTreeP.h +++ b/filters/kword/pdf/xpdf/xpdf/XPDFTreeP.h @@ -16,20 +16,20 @@ typedef void (*XPDFLayoutProc)(Widget widget, Widget instigator); typedef void (*XPDFCalcSizeProc)(Widget widget, Widget instigator, Dimension *totalWidth, Dimension *totalHeight); -typedef Boolean (*XPDFNeedRelayoutProc)(Widget oldWidget, Widget newWidget); +typedef Boolean (*XPDFNeedRetqlayoutProc)(Widget oldWidget, Widget newWidget); #define XPDFInheritCreateGC ((XtWidgetProc)_XtInherit) #define XPDFInheritDestroyGC ((XtWidgetProc)_XtInherit) #define XPDFInheritLayout ((XPDFLayoutProc)_XtInherit) #define XPDFInheritCalcSize ((XPDFCalcSizeProc)_XtInherit) -#define XPDFInheritNeedRelayout ((XPDFNeedRelayoutProc)_XtInherit) +#define XPDFInheritNeedRetqlayout ((XPDFNeedRetqlayoutProc)_XtInherit) typedef struct { XtWidgetProc createGC; XtWidgetProc destroyGC; - XPDFLayoutProc layout; + XPDFLayoutProc tqlayout; XPDFCalcSizeProc calcSize; - XPDFNeedRelayoutProc needRelayout; + XPDFNeedRetqlayoutProc needRetqlayout; XtPointer extension; } XPDFTreeClassPart; diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFViewer.cc b/filters/kword/pdf/xpdf/xpdf/XPDFViewer.cc index a8c8f8f0..cf2ea6d0 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFViewer.cc +++ b/filters/kword/pdf/xpdf/xpdf/XPDFViewer.cc @@ -501,9 +501,9 @@ void XPDFViewer::initWindow() { XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING); ++n; if (app->getFullScreen()) { XtSetArg(args[n], XmNmwmDecorations, 0); ++n; - XtSetArg(args[n], XmNgeometry, "+0+0"); ++n; + XtSetArg(args[n], XmNtqgeometry, "+0+0"); ++n; } else if (app->getGeometry()) { - XtSetArg(args[n], XmNgeometry, app->getGeometry()->getCString()); ++n; + XtSetArg(args[n], XmNtqgeometry, app->getGeometry()->getCString()); ++n; } win = XtCreatePopupShell("win", topLevelShellWidgetClass, app->getAppShell(), args, n); @@ -633,7 +633,7 @@ void XPDFViewer::initWindow() { XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); ++n; s = XmStringCreateLocalized(" of 00000"); XtSetArg(args[n], XmNlabelString, s); ++n; - XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); ++n; + XtSetArg(args[n], XmNtqalignment, XmALIGNMENT_BEGINNING); ++n; XtSetArg(args[n], XmNrecomputeSize, False); ++n; pageCountLabel = XmCreateLabel(toolBar, "pageCountLabel", args, n); XmStringFree(s); @@ -690,7 +690,7 @@ void XPDFViewer::initWindow() { zoomMenu = XmCreateOptionMenu(toolBar, "zoomMenu", args, n); XtManageChild(zoomMenu); - // find/print/about buttons + // tqfind/print/about buttons n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); ++n; XtSetArg(args[n], XmNleftWidget, zoomMenu); ++n; @@ -698,7 +698,7 @@ void XPDFViewer::initWindow() { XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); ++n; XtSetArg(args[n], XmNmarginWidth, 6); ++n; XtSetArg(args[n], XmNlabelString, emptyString); ++n; - findBtn = XmCreatePushButton(toolBar, "find", args, n); + findBtn = XmCreatePushButton(toolBar, "tqfind", args, n); XtManageChild(findBtn); XtAddCallback(findBtn, XmNactivateCallback, &findCbk, (XtPointer)this); @@ -751,7 +751,7 @@ void XPDFViewer::initWindow() { s = XmStringCreateLocalized(""); XtSetArg(args[n], XmNlabelString, s); ++n; XtSetArg(args[n], XmNrecomputeSize, True); ++n; - XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); ++n; + XtSetArg(args[n], XmNtqalignment, XmALIGNMENT_BEGINNING); ++n; linkLabel = XmCreateLabel(toolBar, "linkLabel", args, n); XmStringFree(s); XtManageChild(linkLabel); @@ -1484,7 +1484,7 @@ void XPDFViewer::setupOutline() { XtManageChildren(outlineLabels, outlineLabelsLength); } -void XPDFViewer::setupOutlineItems(GList *items, Widget parent, +void XPDFViewer::setupOutlineItems(GList *items, Widget tqparent, UnicodeMap *uMap) { OutlineItem *item; GList *kids; @@ -1504,8 +1504,8 @@ void XPDFViewer::setupOutlineItems(GList *items, Widget parent, } n = 0; XtSetArg(args[n], XPDFNentryPosition, i); ++n; - if (parent) { - XtSetArg(args[n], XPDFNentryParent, parent); ++n; + if (tqparent) { + XtSetArg(args[n], XPDFNentryParent, tqparent); ++n; } XtSetArg(args[n], XPDFNentryExpanded, item->isOpen()); ++n; s = XmStringCreateLocalized(title->getCString()); @@ -1741,7 +1741,7 @@ void XPDFViewer::openOkCbk(Widget widget, XtPointer ptr, } //------------------------------------------------------------------------ -// GUI code: "find" dialog +// GUI code: "tqfind" dialog //------------------------------------------------------------------------ void XPDFViewer::initFindDialog() { @@ -1780,7 +1780,7 @@ void XPDFViewer::initFindDialog() { findText = XmCreateTextField(row1, "text", args, n); XtManageChild(findText); - //----- "find" and "close" buttons + //----- "tqfind" and "close" buttons n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); ++n; XtSetArg(args[n], XmNtopWidget, row1); ++n; @@ -1816,7 +1816,7 @@ void XPDFViewer::findFindCbk(Widget widget, XtPointer ptr, XtPointer callData) { XPDFViewer *viewer = (XPDFViewer *)ptr; - viewer->core->find(XmTextFieldGetString(viewer->findText)); + viewer->core->tqfind(XmTextFieldGetString(viewer->findText)); } void XPDFViewer::findCloseCbk(Widget widget, XtPointer ptr, diff --git a/filters/kword/pdf/xpdf/xpdf/XPDFViewer.h b/filters/kword/pdf/xpdf/xpdf/XPDFViewer.h index 77875c41..df606395 100644 --- a/filters/kword/pdf/xpdf/xpdf/XPDFViewer.h +++ b/filters/kword/pdf/xpdf/xpdf/XPDFViewer.h @@ -124,7 +124,7 @@ private: //----- GUI code: outline #ifndef DISABLE_OUTLINE void setupOutline(); - void setupOutlineItems(GList *items, Widget parent, UnicodeMap *uMap); + void setupOutlineItems(GList *items, Widget tqparent, UnicodeMap *uMap); static void outlineSelectCbk(Widget widget, XtPointer ptr, XtPointer callData); #endif @@ -139,7 +139,7 @@ private: static void openOkCbk(Widget widget, XtPointer ptr, XtPointer callData); - //----- GUI code: "find" dialog + //----- GUI code: "tqfind" dialog void initFindDialog(); static void findFindCbk(Widget widget, XtPointer ptr, XtPointer callData); diff --git a/filters/kword/pdf/xpdf/xpdf/xpdf.cc b/filters/kword/pdf/xpdf/xpdf/xpdf.cc index ef47fb6e..d4103df2 100644 --- a/filters/kword/pdf/xpdf/xpdf/xpdf.cc +++ b/filters/kword/pdf/xpdf/xpdf/xpdf.cc @@ -44,9 +44,9 @@ static GBool printHelp = gFalse; static ArgDesc argDesc[] = { {"-g", argStringDummy, NULL, 0, - "initial window geometry"}, - {"-geometry", argStringDummy, NULL, 0, - "initial window geometry"}, + "initial window tqgeometry"}, + {"-tqgeometry", argStringDummy, NULL, 0, + "initial window tqgeometry"}, {"-title", argStringDummy, NULL, 0, "window title"}, {"-cmap", argFlagDummy, NULL, 0, diff --git a/filters/kword/rtf/export/ExportFilter.cc b/filters/kword/rtf/export/ExportFilter.cc index a2fb8827..da43d2a4 100644 --- a/filters/kword/rtf/export/ExportFilter.cc +++ b/filters/kword/rtf/export/ExportFilter.cc @@ -20,17 +20,17 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qfontinfo.h> -#include <qfontdatabase.h> -#include <qpicture.h> -#include <qimage.h> -#include <qregexp.h> -#include <qcolor.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqfontinfo.h> +#include <tqfontdatabase.h> +#include <tqpicture.h> +#include <tqimage.h> +#include <tqregexp.h> +#include <tqcolor.h> +#include <tqdatetime.h> #include <klocale.h> #include <kglobal.h> @@ -52,9 +52,9 @@ // map KWord field name to RTF field name // e.g authorName -> AUTHOR -static QString mapFieldName( const QString& kwordField ) +static TQString mapFieldName( const TQString& kwordField ) { - QString rtfField; + TQString rtfField; if( kwordField == "fileName" ) rtfField = "FILENAME"; else if( kwordField == "authorName" ) rtfField = "AUTHOR"; @@ -71,26 +71,26 @@ RTFWorker::RTFWorker(): { } -static QString WritePositiveKeyword(const QString& keyword, const int value) +static TQString WritePositiveKeyword(const TQString& keyword, const int value) { - QString str; + TQString str; str += keyword; if (value>0) // The value of the keyword cannot be negative - str += QString::number( value ); + str += TQString::number( value ); else str += '0'; return str; } -QString RTFWorker::writeRow(const QString& textCellHeader, const QString& rowText, const FrameData& frame) +TQString RTFWorker::writeRow(const TQString& textCellHeader, const TQString& rowText, const FrameData& frame) { - QString row; + TQString row; row += "\\trowd\\trgaph60\\trql"; // start new row - row += WritePositiveKeyword("\\trrh", qRound(PT_TO_TWIP(frame.minHeight))); - row += WritePositiveKeyword("\\trleft", qRound(PT_TO_TWIP(frame.left) - m_paperMarginLeft)); + row += WritePositiveKeyword("\\trrh", tqRound(PT_TO_TWIP(frame.minHeight))); + row += WritePositiveKeyword("\\trleft", tqRound(PT_TO_TWIP(frame.left) - m_paperMarginLeft)); //row += "\\trautofit0"; // ### VERIFY row += textCellHeader; row += " "; // End of keyword @@ -99,15 +99,15 @@ QString RTFWorker::writeRow(const QString& textCellHeader, const QString& rowTex return row; } -QString RTFWorker::writeBorder(const char whichBorder, const int borderWidth, const QColor& color) +TQString RTFWorker::writeBorder(const char whichBorder, const int borderWidth, const TQColor& color) { - QString str; + TQString str; if (borderWidth > 0) { str += "\\clbrdr"; // Define border str += whichBorder; // t=top, l=left, b=bottom, r=right str += "\\brdrs\\brdrw"; // Single border; thickness - str += QString::number(borderWidth); + str += TQString::number(borderWidth); if (color.isValid()) { str += lookupColor("\\brdrcf",color); @@ -116,24 +116,24 @@ QString RTFWorker::writeBorder(const char whichBorder, const int borderWidth, co return str; } -QString RTFWorker::makeTable(const FrameAnchor& anchor) +TQString RTFWorker::makeTable(const FrameAnchor& anchor) { - QString textBody; // Text to be returned + TQString textBody; // Text to be returned textBody += m_prefix; - m_prefix = QString::null; - QString rowText; + m_prefix = TQString(); + TQString rowText; int rowCurrent = 0; bool firstCellInRow = true; FrameData firstFrameData; int debugCellCurrent = 0; //DEBUG int debugRowCurrent = 0; //DEBUG - QString textCellHeader; // <celldef> + TQString textCellHeader; // <celldef> const bool oldInTable = m_inTable; m_inTable = true; - QValueList<TableCell>::ConstIterator itCell; + TQValueList<TableCell>::ConstIterator itCell; for (itCell=anchor.table.cellList.begin(); itCell!=anchor.table.cellList.end(); itCell++) { @@ -144,8 +144,8 @@ QString RTFWorker::makeTable(const FrameAnchor& anchor) textBody += writeRow( textCellHeader, rowText, firstFrameData); textBody += "\\row"; textBody += m_eol; - rowText = QString::null; - textCellHeader = QString::null; + rowText = TQString(); + textCellHeader = TQString(); firstCellInRow=true; debugRowCurrent ++; // DEBUG debugCellCurrent = 0; //DEBUG @@ -161,20 +161,20 @@ QString RTFWorker::makeTable(const FrameAnchor& anchor) kdDebug(30515) << "Cell: " << debugRowCurrent << "," << debugCellCurrent << " left: " << frame.left << " right: " << frame.right << " top: " << frame.top << " bottom " << frame.bottom << endl; - textCellHeader += writeBorder('t',qRound(PT_TO_TWIP(frame.tWidth)),frame.tColor); - textCellHeader += writeBorder('l',qRound(PT_TO_TWIP(frame.lWidth)),frame.lColor); - textCellHeader += writeBorder('b',qRound(PT_TO_TWIP(frame.bWidth)),frame.bColor); - textCellHeader += writeBorder('r',qRound(PT_TO_TWIP(frame.rWidth)),frame.rColor); - textCellHeader += WritePositiveKeyword("\\cellx",qRound(PT_TO_TWIP(frame.right) - m_paperMarginRight)); //right border of cell - - QString endOfParagraph; - QValueList<ParaData> *paraList = (*itCell).paraList; - QValueList<ParaData>::ConstIterator it; - QValueList<ParaData>::ConstIterator end(paraList->end()); + textCellHeader += writeBorder('t',tqRound(PT_TO_TWIP(frame.tWidth)),frame.tColor); + textCellHeader += writeBorder('l',tqRound(PT_TO_TWIP(frame.lWidth)),frame.lColor); + textCellHeader += writeBorder('b',tqRound(PT_TO_TWIP(frame.bWidth)),frame.bColor); + textCellHeader += writeBorder('r',tqRound(PT_TO_TWIP(frame.rWidth)),frame.rColor); + textCellHeader += WritePositiveKeyword("\\cellx",tqRound(PT_TO_TWIP(frame.right) - m_paperMarginRight)); //right border of cell + + TQString endOfParagraph; + TQValueList<ParaData> *paraList = (*itCell).paraList; + TQValueList<ParaData>::ConstIterator it; + TQValueList<ParaData>::ConstIterator end(paraList->end()); for (it=paraList->begin();it!=end;++it) { rowText += endOfParagraph; - rowText += ProcessParagraphData( (*it).text,(*it).layout,(*it).formattingList); + rowText += ProcessParagraphData( (*it).text,(*it).tqlayout,(*it).formattingList); rowText += m_eol; endOfParagraph = "\\par"; // The problem is that the last paragraph ends with \cell not with \par } @@ -190,20 +190,20 @@ QString RTFWorker::makeTable(const FrameAnchor& anchor) return textBody; } -QString RTFWorker::makeImage(const FrameAnchor& anchor) +TQString RTFWorker::makeImage(const FrameAnchor& anchor) { - QString textBody; // Text to be returned + TQString textBody; // Text to be returned - QString strImageName(anchor.picture.koStoreName); - QString strExt; - QByteArray image; + TQString strImageName(anchor.picture.koStoreName); + TQString strExt; + TQByteArray image; kdDebug(30515) << "RTFWorker::makeImage" << endl << anchor.picture.koStoreName << endl; - const int pos=strImageName.findRev('.'); + const int pos=strImageName.tqfindRev('.'); if(pos!=-1) strExt = strImageName.mid(pos+1).lower(); - QString strTag; + TQString strTag; if (strExt=="png") strTag="\\pngblip"; #if 0 @@ -224,17 +224,17 @@ QString RTFWorker::makeImage(const FrameAnchor& anchor) if( !loadAndConvertToImage(anchor.picture.koStoreName,strExt,"PNG",image) ) { kdWarning(30515) << "Unable to convert " << anchor.picture.koStoreName << endl; - return QString::null; + return TQString(); } } - // ### TODO: SVG, QPicture + // ### TODO: SVG, TQPicture // load the image, this isn't necessary for converted image if( !image.size() ) if (!loadSubFile(anchor.picture.koStoreName,image)) { kdWarning(30515) << "Unable to load picture " << anchor.picture.koStoreName << endl; - return QString::null; + return TQString(); } @@ -249,7 +249,7 @@ QString RTFWorker::makeImage(const FrameAnchor& anchor) { // special treatment for WMF with metaheader // d7cdc69a is metaheader magic id - Q_UINT8* data = (Q_UINT8*) image.data(); + TQ_UINT8* data = (TQ_UINT8*) image.data(); if( ( data[0] == 0xd7 ) && ( data[1] == 0xcd ) && ( data[2] == 0xc6 ) && ( data[3] == 0x9a ) && ( image.size() > 22 ) ) @@ -264,18 +264,18 @@ QString RTFWorker::makeImage(const FrameAnchor& anchor) // throw away WMF metaheader (22 bytes) for( uint i=0; i<image.size()-22; i++) - image.at(i) = image.at(i+22); // As we use uint, we need at() ( [] uses int only .) + image.tqat(i) = image.tqat(i+22); // As we use uint, we need at() ( [] uses int only .) image.resize( image.size()-22 ); } } else { // It must be an image - QImage img( image ); + TQImage img( image ); if( img.isNull() ) { kdWarning(30515) << "Unable to load picture as image " << anchor.picture.koStoreName << endl; - return QString::null; + return TQString(); } // check resolution, assume 2835 dpm (72 dpi) if not available int resx = img.dotsPerMeterX(); @@ -300,17 +300,17 @@ QString RTFWorker::makeImage(const FrameAnchor& anchor) int pich = (int)(100 * TWIP_TO_MM(origHeight)); textBody += "\\picscalex"; - textBody += QString::number(scaleX, 10); + textBody += TQString::number(scaleX, 10); textBody += "\\picscaley"; - textBody += QString::number(scaleY, 10); + textBody += TQString::number(scaleY, 10); textBody += "\\picw"; - textBody += QString::number(picw,10); + textBody += TQString::number(picw,10); textBody += "\\pich"; - textBody += QString::number(pich,10); + textBody += TQString::number(pich,10); textBody += "\\picwgoal"; - textBody += QString::number(origWidth, 10); + textBody += TQString::number(origWidth, 10); textBody += "\\pichgoal"; - textBody += QString::number(origHeight, 10); + textBody += TQString::number(origHeight, 10); textBody+=" "; const char hex[] = "0123456789abcdef"; @@ -329,10 +329,10 @@ QString RTFWorker::makeImage(const FrameAnchor& anchor) return textBody; } -QString RTFWorker::formatTextParagraph(const QString& strText, +TQString RTFWorker::formatTextParagraph(const TQString& strText, const FormatData& formatOrigin, const FormatData& format) { - QString str; + TQString str; if (!format.text.missing) { @@ -340,14 +340,14 @@ QString RTFWorker::formatTextParagraph(const QString& strText, str+=openSpan(formatOrigin,format); } - QString strEscaped = escapeRtfText(strText); + TQString strEscaped = escapeRtfText(strText); // Replace line feeds by forced line breaks int pos; - QString strBr("\\line "); - while ((pos=strEscaped.find(QChar(10)))>-1) + TQString strBr("\\line "); + while ((pos=strEscaped.tqfind(TQChar(10)))>-1) { - strEscaped.replace(pos,1,strBr); + strEscaped.tqreplace(pos,1,strBr); } str+=strEscaped; @@ -361,12 +361,12 @@ QString RTFWorker::formatTextParagraph(const QString& strText, return str; } -QString RTFWorker::ProcessParagraphData ( const QString ¶Text, - const LayoutData& layout, const ValueListFormatData ¶FormatDataList) +TQString RTFWorker::ProcessParagraphData ( const TQString ¶Text, + const LayoutData& tqlayout, const ValueListFormatData ¶FormatDataList) { - QString str; - QString content; - QString markup; + TQString str; + TQString content; + TQString markup; // open paragraph markup += "\\pard"; markup += "\\plain"; @@ -374,40 +374,40 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, markup += "\\intbl"; //lists - if (layout.counter.style) + if (tqlayout.counter.style) { markup += "{\\pntext\\pard\\plain"; - if( layout.formatData.text.fontSize >= 0) + if( tqlayout.formatData.text.fontSize >= 0) { markup += "\\fs"; - markup += QString::number((2 * layout.formatData.text.fontSize)); - markup += lookupFont("\\f",layout.formatData.text.fontName); + markup += TQString::number((2 * tqlayout.formatData.text.fontSize)); + markup += lookupFont("\\f",tqlayout.formatData.text.fontName); } markup += " "; - markup += layout.counter.text; + markup += tqlayout.counter.text; markup += "\\tab}{\\*\\pn"; - if (layout.counter.style > 5) + if (tqlayout.counter.style > 5) { markup += "\\pnlvlblt "; markup += "{\\pntxtb "; - if (!layout.counter.lefttext.isEmpty() && layout.counter.lefttext != "{" && layout.counter.lefttext != "}") + if (!tqlayout.counter.lefttext.isEmpty() && tqlayout.counter.lefttext != "{" && tqlayout.counter.lefttext != "}") { - markup += layout.counter.lefttext; + markup += tqlayout.counter.lefttext; } - switch (layout.counter.style) + switch (tqlayout.counter.style) { case 6: { //custom bullets (one char) //TODO: use correct character/sign for bullet - markup += layout.counter.customCharacter; + markup += tqlayout.counter.customCharacter; break; } case 7: { //custom bullets (complex) - markup += layout.counter.text; + markup += tqlayout.counter.text; break; } case 8: @@ -435,7 +435,7 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, { //disc bullets //TODO: use correct character/sign for bullet - markup += layout.counter.text; + markup += tqlayout.counter.text; break; } default: @@ -445,23 +445,23 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, } else { - if (layout.counter.numbering!=0) + if (tqlayout.counter.numbering!=0) { markup += "\\pnlvl"; - markup += QString::number(layout.counter.depth + 1); + markup += TQString::number(tqlayout.counter.depth + 1); markup += "\\pnprev1"; } - else if (layout.counter.style==1) + else if (tqlayout.counter.style==1) { markup += "\\pnlvlbody"; } else { markup += "\\pnlvl"; - markup += QString::number(11 - layout.counter.style); + markup += TQString::number(11 - tqlayout.counter.style); } - switch (layout.counter.style) + switch (tqlayout.counter.style) { case 1: { @@ -492,18 +492,18 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, markup += "\\pndec"; } markup += "{\\pntxtb "; - markup += layout.counter.lefttext; + markup += tqlayout.counter.lefttext; markup += " }"; } markup += "{\\pntxta "; - markup += layout.counter.righttext; + markup += tqlayout.counter.righttext; markup += " }"; // ### FIXME: that is too late! And why at every list paragraph? (See bug #88241) - if (layout.counter.start!=0) + if (tqlayout.counter.start!=0) { markup += "\\pnstart"; - markup += QString::number(layout.counter.start); + markup += TQString::number(tqlayout.counter.start); } else { @@ -511,15 +511,15 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, } markup += "\\pnindent0\\pnhang"; - if( layout.formatData.text.fontSize > 0 ) + if( tqlayout.formatData.text.fontSize > 0 ) { markup += "\\pnfs"; - markup += QString::number((2 * layout.formatData.text.fontSize)); + markup += TQString::number((2 * tqlayout.formatData.text.fontSize)); } - if( !layout.formatData.text.fontName.isEmpty() ) + if( !tqlayout.formatData.text.fontName.isEmpty() ) { - markup += lookupFont("\\pnf", layout.formatData.text.fontName); + markup += lookupFont("\\pnf", tqlayout.formatData.text.fontName); } markup += "}"; @@ -527,20 +527,20 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, LayoutData styleLayout; - markup += lookupStyle(layout.styleName, styleLayout); - markup += layoutToRtf(styleLayout,layout,true); + markup += lookupStyle(tqlayout.styleName, styleLayout); + markup += tqlayoutToRtf(styleLayout,tqlayout,true); - if ( 1==layout.formatData.text.verticalAlignment ) + if ( 1==tqlayout.formatData.text.verticalAlignment ) { markup += "\\sub"; //Subscript } - else if ( 2==layout.formatData.text.verticalAlignment ) + else if ( 2==tqlayout.formatData.text.verticalAlignment ) { markup += "\\super"; //Superscript } - if (layout.pageBreakBefore) + if (tqlayout.pageBreakBefore) content += "\\page "; @@ -552,9 +552,9 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, ValueListFormatData::ConstIterator paraFormatDataIt; - QString partialText; + TQString partialText; - FormatData formatRef = layout.formatData; + FormatData formatRef = tqlayout.formatData; for ( paraFormatDataIt = paraFormatDataList.begin (); paraFormatDataIt != paraFormatDataList.end (); @@ -578,7 +578,7 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, content += "DATE "; else content += "TIME "; - QString key((*paraFormatDataIt).variable.m_key.mid(4)); + TQString key((*paraFormatDataIt).variable.m_key.mid(4)); kdDebug(30515) << "Time format: " << key << endl; if (key.startsWith("locale")) { @@ -609,47 +609,47 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, // KLocale's key differ from KWord // Date - key.replace( "%Y", "yyyy" ); // Year 4 digits - key.replace( "%y", "yy" ); // Year 2 digits - key.replace( "%n", "M" ); // Month 1 digit - key.replace( "%m", "MM" ); // Month 2 digits - key.replace( "%e", "d" ); // Day 1 digit - key.replace( "%d", "dd" ); // Day 2 digits - key.replace( "%b", "MMM" ); // Month 3 letters - key.replace( "%B", "MMMM" ); // Month all letters - key.replace( "%a", "ddd" ); // Day 3 letters - key.replace( "%A", "dddd" ); // Day all letters + key.tqreplace( "%Y", "yyyy" ); // Year 4 digits + key.tqreplace( "%y", "yy" ); // Year 2 digits + key.tqreplace( "%n", "M" ); // Month 1 digit + key.tqreplace( "%m", "MM" ); // Month 2 digits + key.tqreplace( "%e", "d" ); // Day 1 digit + key.tqreplace( "%d", "dd" ); // Day 2 digits + key.tqreplace( "%b", "MMM" ); // Month 3 letters + key.tqreplace( "%B", "MMMM" ); // Month all letters + key.tqreplace( "%a", "ddd" ); // Day 3 letters + key.tqreplace( "%A", "dddd" ); // Day all letters // 12h - key.replace( "%p", "am/pm" ); // AM/PM (KLocale knows it only lower case) - key.replace( "%I", "hh" ); // 12 hour 2 digits - key.replace( "%l", "h" ); // 12 hour 1 digits + key.tqreplace( "%p", "am/pm" ); // AM/PM (KLocale knows it only lower case) + key.tqreplace( "%I", "hh" ); // 12 hour 2 digits + key.tqreplace( "%l", "h" ); // 12 hour 1 digits // 24h - key.replace( "%H", "HH" ); // 24 hour 2 digits - key.replace( "%k", "H" ); // 24 hour 1 digit + key.tqreplace( "%H", "HH" ); // 24 hour 2 digits + key.tqreplace( "%k", "H" ); // 24 hour 1 digit // Other times - key.replace( "%M", "mm" ); // minute 2 digits (KLocale knows it with 2 digits) - key.replace( "%S", "ss" ); // second 2 digits (KLocale knows it with 2 digits) + key.tqreplace( "%M", "mm" ); // minute 2 digits (KLocale knows it with 2 digits) + key.tqreplace( "%S", "ss" ); // second 2 digits (KLocale knows it with 2 digits) kdDebug(30515) << "Locale date in RTF format: " << key << endl; } else if (!key.isEmpty()) { - const QRegExp regexp("AP",false); // Not case-sensitive + const TQRegExp regexp("AP",false); // Not case-sensitive if (regexp.search(key)!=-1) { // 12h - key.replace("ap","am/pm"); - key.replace("AP","AM/PM"); + key.tqreplace("ap","am/pm"); + key.tqreplace("AP","AM/PM"); } else { //24h - key.replace('h','H'); // MS Word uses H for 24hour times + key.tqreplace('h','H'); // MS Word uses H for 24hour times } // MS Word do not know possesive months - key.replace("PPP","MMM"); - key.replace("PPPP","MMMM"); - key.replace("zzz","000"); // replace microseconds by 000 + key.tqreplace("PPP","MMM"); + key.tqreplace("PPPP","MMMM"); + key.tqreplace("zzz","000"); // replace microseconds by 000 kdDebug(30515) << "New format: " << key << endl; content += "\\@ \""; content += key; @@ -661,7 +661,7 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, } else if (4==(*paraFormatDataIt).variable.m_type) { - QString strFieldType; + TQString strFieldType; if ((*paraFormatDataIt).variable.isPageNumber()) { content += "{\\field{\\*\\fldinst PAGE \\* MERGEFORMAT }{\\fldrslt "; @@ -683,9 +683,9 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, else if (8==(*paraFormatDataIt).variable.m_type) { // Field - QString name = escapeRtfText((*paraFormatDataIt).variable.getFieldName()); - QString value = escapeRtfText((*paraFormatDataIt).variable.getFieldValue()); - QString rtfField = mapFieldName(name); + TQString name = escapeRtfText((*paraFormatDataIt).variable.getFieldName()); + TQString value = escapeRtfText((*paraFormatDataIt).variable.getFieldValue()); + TQString rtfField = mapFieldName(name); if( rtfField.isEmpty() ) // Couldn't map field name, just write out the value @@ -710,25 +710,25 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, content += "}"; content += "{\\fldrslt "; content += "{\\ul"; // underline, ### TODO: use style Hyperlink - content += lookupColor("\\cf",QColor(0,0,255));// blue + content += lookupColor("\\cf",TQColor(0,0,255));// blue content += escapeRtfText((*paraFormatDataIt).variable.getLinkName()); content += "}}}"; } else if (11==(*paraFormatDataIt).variable.m_type) { // Footnote - QString value = (*paraFormatDataIt).variable.getFootnoteValue(); + TQString value = (*paraFormatDataIt).variable.getFootnoteValue(); bool automatic = (*paraFormatDataIt).variable.getFootnoteAuto(); - QValueList<ParaData> *paraList = (*paraFormatDataIt).variable.getFootnotePara(); + TQValueList<ParaData> *paraList = (*paraFormatDataIt).variable.getFootnotePara(); if( paraList ) { - QString fstr; - QValueList<ParaData>::ConstIterator it; - QValueList<ParaData>::ConstIterator end(paraList->end()); - const QString prefixSaved = m_prefix; - m_prefix = QString::null; + TQString fstr; + TQValueList<ParaData>::ConstIterator it; + TQValueList<ParaData>::ConstIterator end(paraList->end()); + const TQString prefixSaved = m_prefix; + m_prefix = TQString(); for (it=paraList->begin();it!=end;++it) - fstr += ProcessParagraphData( (*it).text, (*it).layout,(*it).formattingList); + fstr += ProcessParagraphData( (*it).text, (*it).tqlayout,(*it).formattingList); m_prefix = prefixSaved; content += "{\\super "; content += automatic ? "\\chftn " : value; @@ -762,7 +762,7 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, str += content; str += "}"; str += m_eol; - content = QString::null; + content = TQString(); if (!m_inTable) { m_prefix = "\\par"; @@ -779,7 +779,7 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, } } - if (layout.pageBreakAfter) + if (tqlayout.pageBreakAfter) content += "\\page"; if (!content.isEmpty()) @@ -806,11 +806,11 @@ QString RTFWorker::ProcessParagraphData ( const QString ¶Text, return str; } -bool RTFWorker::doFullParagraph(const QString& paraText, - const LayoutData& layout, const ValueListFormatData& paraFormatDataList) +bool RTFWorker::doFullParagraph(const TQString& paraText, + const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { kdDebug(30515) << "Entering RTFWorker::doFullParagraph" << endl << paraText << endl; - QString par = ProcessParagraphData( paraText, layout, paraFormatDataList); + TQString par = ProcessParagraphData( paraText, tqlayout, paraFormatDataList); m_textBody += par; kdDebug(30515) << "Quiting RTFWorker::doFullParagraph" << endl; return true; @@ -818,8 +818,8 @@ bool RTFWorker::doFullParagraph(const QString& paraText, bool RTFWorker::doHeader(const HeaderData& header) { - QString str; - QString content; + TQString str; + TQString content; if( header.page == HeaderData::PAGE_ODD ) str = "\\facingp{\\headerr"; else if( header.page == HeaderData::PAGE_EVEN ) @@ -833,10 +833,10 @@ bool RTFWorker::doHeader(const HeaderData& header) str += " {"; - QValueList<ParaData>::ConstIterator it; - QValueList<ParaData>::ConstIterator end(header.para.end()); + TQValueList<ParaData>::ConstIterator it; + TQValueList<ParaData>::ConstIterator end(header.para.end()); for (it=header.para.begin();it!=end;++it) - content += ProcessParagraphData( (*it).text,(*it).layout,(*it).formattingList); + content += ProcessParagraphData( (*it).text,(*it).tqlayout,(*it).formattingList); if (content!="\\par\\pard\\plain") { @@ -847,14 +847,14 @@ bool RTFWorker::doHeader(const HeaderData& header) m_textBody += str; } - m_prefix=QString::null; + m_prefix=TQString(); return true; } bool RTFWorker::doFooter(const FooterData& footer) { - QString str; - QString content; + TQString str; + TQString content; if( footer.page == FooterData::PAGE_ODD ) str = "\\facingp{\\footerr"; else if( footer.page == FooterData::PAGE_EVEN ) @@ -868,10 +868,10 @@ bool RTFWorker::doFooter(const FooterData& footer) str += " {"; - QValueList<ParaData>::ConstIterator it; - QValueList<ParaData>::ConstIterator end(footer.para.end()); + TQValueList<ParaData>::ConstIterator it; + TQValueList<ParaData>::ConstIterator end(footer.para.end()); for (it=footer.para.begin();it!=end;++it) - content += ProcessParagraphData( (*it).text,(*it).layout,(*it).formattingList); + content += ProcessParagraphData( (*it).text,(*it).tqlayout,(*it).formattingList); if (content!="\\par\\pard\\plain") { @@ -882,13 +882,13 @@ bool RTFWorker::doFooter(const FooterData& footer) m_textBody += str; } - m_prefix=QString::null; + m_prefix=TQString(); return true; } -bool RTFWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool RTFWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { - m_ioDevice=new QFile(filenameOut); + m_ioDevice=TQT_TQIODEVICE(new TQFile(filenameOut)); if (!m_ioDevice) { @@ -902,10 +902,10 @@ bool RTFWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) return false; } - m_streamOut=new QTextStream(m_ioDevice); + m_streamOut=new TQTextStream(m_ioDevice); // ### TODO: should "CP 1252" be used directly? (But RTFWorker::escapeRtfText is beased on ISO-8859-1 only.) - m_streamOut->setEncoding(QTextStream::Latin1); // We are declaring the RTF document as CP 1252, so use ISO-8859-1 + m_streamOut->setEncoding(TQTextStream::Latin1); // We are declaring the RTF document as CP 1252, so use ISO-8859-1 m_fileName=filenameOut; @@ -932,11 +932,11 @@ bool RTFWorker::doOpenDocument(void) // Default color table m_colorList - << QColor(0,0,0) << QColor(0,0,255) << QColor(0,255,255) - << QColor(0,255,0) << QColor(255,0,255) << QColor(255,0,0) - << QColor(255,255,0) << QColor(255,255,255) << QColor(0,0,128) - << QColor(0,128,128) << QColor(0,128,0) << QColor(128,0,128) - << QColor(128,0,0) << QColor(128,128,0) << QColor(128,128,128); + << TQColor(0,0,0) << TQColor(0,0,255) << TQColor(0,255,255) + << TQColor(0,255,0) << TQColor(255,0,255) << TQColor(255,0,0) + << TQColor(255,255,0) << TQColor(255,255,255) << TQColor(0,0,128) + << TQColor(0,128,128) << TQColor(0,128,0) << TQColor(128,0,128) + << TQColor(128,0,0) << TQColor(128,128,0) << TQColor(128,128,128); return true; } @@ -946,17 +946,17 @@ void RTFWorker::writeFontData(void) kdDebug(30515) << "Fonts:" << m_fontList << endl; *m_streamOut << "{\\fonttbl"; uint count; - QFontDatabase fontDatabase; - QStringList::ConstIterator it; + TQFontDatabase fontDatabase; + TQStringList::ConstIterator it; for (count=0, it=m_fontList.begin(); it!=m_fontList.end(); count++, it++) { - const QString strLower( (*it).lower() ); + const TQString strLower( (*it).lower() ); *m_streamOut << "{\\f" << count; - if ( (strLower.find("symbol")>-1) || (strLower.find("dingbat")>-1) ) + if ( (strLower.tqfind("symbol")>-1) || (strLower.tqfind("dingbat")>-1) ) *m_streamOut << "\\ftech"; - else if ( (strLower.find("script")>-1) ) + else if ( (strLower.tqfind("script")>-1) ) *m_streamOut << "\\fscript"; #if 1 @@ -967,28 +967,28 @@ void RTFWorker::writeFontData(void) } #else else - // QFontInfo:styleHint() does not guess anything, it just returns what is in the QFont. Nothing put in, nothing gets out. + // TQFontInfo:tqstyleHint() does not guess anything, it just returns what is in the TQFont. Nothing put in, nothing gets out. { - QFontInfo info(*it); - switch (info.styleHint()) + TQFontInfo info(*it); + switch (info.tqstyleHint()) { - case QFont::SansSerif: + case TQFont::SansSerif: default: { *m_streamOut << "\\fswiss"; break; } - case QFont::Serif: + case TQFont::Serif: { *m_streamOut << "\\froman"; break; } - case QFont::Courier: + case TQFont::Courier: { *m_streamOut << "\\fmodern"; break; } - case QFont::OldEnglish: + case TQFont::OldEnglish: { *m_streamOut << "\\fdecor"; break; @@ -996,7 +996,7 @@ void RTFWorker::writeFontData(void) } } #endif - // ### TODO: \fcharset would be mandatory but Qt3 does not give us the font charset. :-( + // ### TODO: \fcharset would be mandatory but TQt3 does not give us the font charset. :-( *m_streamOut << "\\fprq" << ( fontDatabase.isFixedPitch( *it ) ? 1 : 2 ) << " "; // font definition *m_streamOut << escapeRtfText( *it ); *m_streamOut << ";}" << m_eol; // end font table entry @@ -1008,7 +1008,7 @@ void RTFWorker::writeColorData(void) { *m_streamOut << "{\\colortbl;"; uint count; - QValueList<QColor>::ConstIterator it; + TQValueList<TQColor>::ConstIterator it; for (count=0, it=m_colorList.begin(); it!=m_colorList.end(); count++, it++) @@ -1026,7 +1026,7 @@ void RTFWorker::writeStyleData(void) *m_streamOut << "{\\stylesheet" << m_eol; uint count; - QValueList<LayoutData>::ConstIterator it; + TQValueList<LayoutData>::ConstIterator it; for (count=0, it=m_styleList.begin(); it!=m_styleList.end(); count++, it++) @@ -1035,12 +1035,12 @@ void RTFWorker::writeStyleData(void) if (count>0) // \s0 is not written out *m_streamOut << "\\s" << count; - *m_streamOut << layoutToRtf((*it),(*it),true); + *m_streamOut << tqlayoutToRtf((*it),(*it),true); // \snext must be the last keyword before the style name // Find the number of the following style uint counter=0; // counts position in style table starting at 0 - QValueList < LayoutData > ::ConstIterator it2; + TQValueList < LayoutData > ::ConstIterator it2; for( it2 = m_styleList.begin(); it2 != m_styleList.end(); counter++, ++it2 ) { if ( (*it2).styleName == (*it).styleFollowing ) @@ -1129,7 +1129,7 @@ bool RTFWorker::doFullDocumentInfo(const KWEFDocumentInfo& docInfo) } // Now add who we are in a \comment - QString revision("$Revision: 549975 $"); + TQString revision("$Revision: 549975 $"); m_textDocInfo += "{\\comment "; m_textDocInfo += "Generated by KWord's RTF Export Filter"; m_textDocInfo += revision.mid(10).remove('$'); // has a leading and a trailing space. @@ -1155,9 +1155,9 @@ bool RTFWorker::doCloseTextFrameSet(void) return true; } -QString RTFWorker::openSpan(const FormatData& formatOrigin, const FormatData& format) +TQString RTFWorker::openSpan(const FormatData& formatOrigin, const FormatData& format) { - QString result; + TQString result; result += "{"; result += textFormatToRtf(formatOrigin.text,format.text,false); @@ -1175,31 +1175,31 @@ QString RTFWorker::openSpan(const FormatData& formatOrigin, const FormatData& fo return result; } -QString RTFWorker::closeSpan(const FormatData& , const FormatData& ) +TQString RTFWorker::closeSpan(const FormatData& , const FormatData& ) { - QString result; + TQString result; result += "}"; return result; } -// The following function encodes the kword unicode characters into +// The following function encodes the kword tqunicode characters into // RTF seven bit ASCII. This affects any 8 bit characters. // They are encoded either with \' or with \u -QString RTFWorker::escapeRtfText ( const QString& text ) const +TQString RTFWorker::escapeRtfText ( const TQString& text ) const { // initialize strings - QString escapedText; + TQString escapedText; const uint length = text.length(); for ( uint i = 0; i < length; i++ ) { - QChar QCh ( text.at( i ) ); // get out one unicode char from the string - const ushort ch = QCh.unicode(); // take unicode value of the char + TQChar TQCh ( text.at( i ) ); // get out one tqunicode char from the string + const ushort ch = TQCh.tqunicode(); // take tqunicode value of the char - if ( QCh == '\\' ) escapedText += "\\\\"; // back-slash - else if ( QCh == '{' ) escapedText += "\\{"; - else if ( QCh == '}' ) escapedText += "\\}"; + if ( TQCh == '\\' ) escapedText += "\\\\"; // back-slash + else if ( TQCh == '{' ) escapedText += "\\{"; + else if ( TQCh == '}' ) escapedText += "\\}"; else if ( ch >= 32 && ch <= 127) // ASCII character - escapedText += QCh; + escapedText += TQCh; else if ( ch == 0x0009 ) escapedText += "\\tab "; // tabulator else if ( ch == 0x00a0 ) escapedText += "\\~"; // Non-breaking space else if ( ch == 0x00ad ) escapedText += "\\-"; // Soft hyphen @@ -1222,20 +1222,20 @@ QString RTFWorker::escapeRtfText ( const QString& text ) const else if ( ch >= 160 && ch < 256) // check for characters common between ISO-8859-1 and CP1252 { // NOTE: 128 to 159 in CP1252 are somewhere else in UTF-8 and do not exist in ISO-8859-1 (### TODO?) escapedText += "\\\'"; // escape upper page character to 7 bit - escapedText += QString::number ( ch, 16 ); + escapedText += TQString::number ( ch, 16 ); } else if ( ch >= 256) // check for a higher code non-ASCII character { - // encode this as decimal unicode with a replacement character. + // encode this as decimal tqunicode with a replacement character. escapedText += "\\u"; - escapedText += QString::number ( ch, 10 ); + escapedText += TQString::number ( ch, 10 ); // We decompose the character. If it works, the first character is whitout any accent. // (Of course this only works with Latin letters.) - // WARNING: QChar::decomposition is not re-entrant in Qt 3.x - QChar replacement ( QCh.decomposition().at(0) ); - kdDebug(30515) << "Proposed replacement character: " << QString(replacement) << endl; + // WARNING: TQChar::decomposition is not re-entrant in TQt 3.x + TQChar replacement ( TQCh.decomposition().at(0) ); + kdDebug(30515) << "Proposed replacement character: " << TQString(replacement) << endl; - if (replacement.isNull() || replacement<=' ' || replacement>=char(127) + if (replacement.isNull() || (int)replacement<=' ' || (int)replacement>=char(127) || replacement=='{' || replacement=='}' || replacement=='\\') replacement='?'; // Not a normal ASCII character, so default to show a ? sign @@ -1243,7 +1243,7 @@ QString RTFWorker::escapeRtfText ( const QString& text ) const } else - escapedText += QCh ; + escapedText += TQCh ; } @@ -1270,41 +1270,41 @@ bool RTFWorker::doFullPaperBorders (const double top, const double left, return true; } -bool RTFWorker::doFullDefineStyle(LayoutData& layout) +bool RTFWorker::doFullDefineStyle(LayoutData& tqlayout) { //Register the new style in the style list - m_styleList << layout; + m_styleList << tqlayout; // Now we must register a few things (with help of the lookup methods.) - lookupFont("\\f", layout.formatData.text.fontName); - lookupColor(QString::null, layout.formatData.text.fgColor); - lookupColor(QString::null, layout.formatData.text.bgColor); + lookupFont("\\f", tqlayout.formatData.text.fontName); + lookupColor(TQString(), tqlayout.formatData.text.fgColor); + lookupColor(TQString(), tqlayout.formatData.text.bgColor); return true; } -static QString writeDate(const QString keyword, const QDateTime& now) +static TQString writeDate(const TQString keyword, const TQDateTime& now) { - QString str; + TQString str; if (now.isValid()) { kdDebug(30515) << "Date " << keyword << " " << now.toString() << endl; str += '{'; str += keyword; - const QDate nowDate(now.date()); + const TQDate nowDate(now.date()); str += "\\yr"; - str += QString::number(nowDate.year()); + str += TQString::number(nowDate.year()); str += "\\mo"; - str += QString::number(nowDate.month()); + str += TQString::number(nowDate.month()); str += "\\dy"; - str += QString::number(nowDate.day()); - const QTime nowTime(now.time()); + str += TQString::number(nowDate.day()); + const TQTime nowTime(now.time()); str += "\\hr"; - str += QString::number(nowTime.hour()); + str += TQString::number(nowTime.hour()); str += "\\min"; - str += QString::number(nowTime.minute()); + str += TQString::number(nowTime.minute()); str += "\\sec"; - str += QString::number(nowTime.second()); + str += TQString::number(nowTime.second()); str += '}'; } else @@ -1323,14 +1323,14 @@ bool RTFWorker::doVariableSettings(const VariableSettingsData& vs) return true; } -QString RTFWorker::textFormatToRtf(const TextFormatting& formatOrigin, +TQString RTFWorker::textFormatToRtf(const TextFormatting& formatOrigin, const TextFormatting& formatData, const bool force) { // TODO: rename variable formatData - QString strElement; // TODO: rename this variable + TQString strElement; // TODO: rename this variable // Font name - const QString fontName(formatData.fontName); + const TQString fontName(formatData.fontName); if (!fontName.isEmpty() && (force || (formatOrigin.fontName!=formatData.fontName))) { @@ -1343,7 +1343,7 @@ QString RTFWorker::textFormatToRtf(const TextFormatting& formatOrigin, if (size>0) { strElement+="\\fs"; - strElement+=QString::number(2*size,10); + strElement+=TQString::number(2*size,10); } } @@ -1398,10 +1398,10 @@ QString RTFWorker::textFormatToRtf(const TextFormatting& formatOrigin, { if ( formatData.underline ) { - QString underlineValue = formatData.underlineValue; - QString underlineStyle = formatData.underlineStyle; + TQString underlineValue = formatData.underlineValue; + TQString underlineStyle = formatData.underlineStyle; bool underlineWord = formatData.underlineWord; - QString ul ( "\\ul" ); // fall-back: simple underline + TQString ul ( "\\ul" ); // fall-back: simple underline if( underlineStyle.isEmpty() ) underlineStyle = "solid"; if( underlineValue == "1" ) underlineValue = "single"; @@ -1458,122 +1458,122 @@ QString RTFWorker::textFormatToRtf(const TextFormatting& formatOrigin, return strElement; } -QString RTFWorker::layoutToRtf(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force) +TQString RTFWorker::tqlayoutToRtf(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force) { - QString strLayout; + TQString strLayout; - if (force || (layoutOrigin.alignment!=layout.alignment)) + if (force || (tqlayoutOrigin.tqalignment!=tqlayout.tqalignment)) { - if (layout.alignment=="left") + if (tqlayout.tqalignment=="left") strLayout += "\\ql"; - else if (layout.alignment== "right") + else if (tqlayout.tqalignment== "right") strLayout += "\\qr"; - else if (layout.alignment=="center") + else if (tqlayout.tqalignment=="center") strLayout += "\\qc"; - else if (layout.alignment=="justify") + else if (tqlayout.tqalignment=="justify") strLayout += "\\qj"; - else if ( layout.alignment=="auto") + else if ( tqlayout.tqalignment=="auto") { // ### TODO: what for BIDI? //strLayout += "\\ql"; } else { - kdWarning(30515) << "Unknown alignment: " << layout.alignment << endl; + kdWarning(30515) << "Unknown tqalignment: " << tqlayout.tqalignment << endl; } } - if ((layout.indentLeft>=0.0) - && (force || (layoutOrigin.indentLeft!=layout.indentLeft))) + if ((tqlayout.indentLeft>=0.0) + && (force || (tqlayoutOrigin.indentLeft!=tqlayout.indentLeft))) { strLayout += "\\li"; - strLayout += QString::number(int(layout.indentLeft)*20, 10); + strLayout += TQString::number(int(tqlayout.indentLeft)*20, 10); } - if ((layout.indentRight>=0.0) - && (force || (layoutOrigin.indentRight!=layout.indentRight))) + if ((tqlayout.indentRight>=0.0) + && (force || (tqlayoutOrigin.indentRight!=tqlayout.indentRight))) { strLayout += "\\ri"; - strLayout += QString::number(int(layout.indentRight)*20, 10); + strLayout += TQString::number(int(tqlayout.indentRight)*20, 10); } - if (force || (layoutOrigin.indentFirst!=layout.indentFirst)) + if (force || (tqlayoutOrigin.indentFirst!=tqlayout.indentFirst)) { strLayout += "\\fi"; - strLayout += QString::number(int(layout.indentFirst)*20, 10); + strLayout += TQString::number(int(tqlayout.indentFirst)*20, 10); } - if ((layout.marginBottom>=0.0) - && (force || (layoutOrigin.marginBottom!=layout.marginBottom))) + if ((tqlayout.marginBottom>=0.0) + && (force || (tqlayoutOrigin.marginBottom!=tqlayout.marginBottom))) { strLayout += "\\sa"; - strLayout += QString::number(int(layout.marginBottom)*20 ,10); + strLayout += TQString::number(int(tqlayout.marginBottom)*20 ,10); } - if ((layout.marginTop>=0.0) - && (force || (layoutOrigin.marginTop!=layout.marginTop))) + if ((tqlayout.marginTop>=0.0) + && (force || (tqlayoutOrigin.marginTop!=tqlayout.marginTop))) { strLayout += "\\sb"; - strLayout += QString::number(int(layout.marginTop)*20, 10); + strLayout += TQString::number(int(tqlayout.marginTop)*20, 10); } - if (force || (layoutOrigin.keepLinesTogether!=layout.keepLinesTogether)) + if (force || (tqlayoutOrigin.keepLinesTogether!=tqlayout.keepLinesTogether)) { - if(layout.keepLinesTogether) strLayout += "\\keep"; + if(tqlayout.keepLinesTogether) strLayout += "\\keep"; } - // Note: there seems to be too many problems of using a page break in a layout + // Note: there seems to be too many problems of using a page break in a tqlayout // - KWord's RTF import filter makes the page break immediately (also in styles) // - AbiWord's RTF import does not like \*\pgbrk // ### TODO: decide if we really remove this code #if 0 - if (force || (layoutOrigin.pageBreakBefore!=layout.pageBreakBefore)) + if (force || (tqlayoutOrigin.pageBreakBefore!=tqlayout.pageBreakBefore)) { - if(layout.pageBreakBefore) strLayout += "\\pagebb"; + if(tqlayout.pageBreakBefore) strLayout += "\\pagebb"; } // Note: RTF doesn't specify "page break after" // \*\pgbrk0 is used after OpenOffice.org Writer - if (force || (layoutOrigin.pageBreakAfter!=layout.pageBreakAfter)) + if (force || (tqlayoutOrigin.pageBreakAfter!=tqlayout.pageBreakAfter)) { - if(layout.pageBreakAfter) strLayout += "\\*\\pgbrk0"; + if(tqlayout.pageBreakAfter) strLayout += "\\*\\pgbrk0"; } #endif if (force - || ( layoutOrigin.lineSpacingType != layout.lineSpacingType ) - || ( layoutOrigin.lineSpacing != layout.lineSpacing ) ) + || ( tqlayoutOrigin.lineSpacingType != tqlayout.lineSpacingType ) + || ( tqlayoutOrigin.lineSpacing != tqlayout.lineSpacing ) ) { - if ( layout.lineSpacingType==LayoutData::LS_SINGLE ) + if ( tqlayout.lineSpacingType==LayoutData::LS_SINGLE ) ;// do nothing, single linespace is default in RTF - else if ( layout.lineSpacingType==LayoutData::LS_ONEANDHALF ) + else if ( tqlayout.lineSpacingType==LayoutData::LS_ONEANDHALF ) strLayout += "\\sl360\\slmult1"; // one-and-half linespace - else if ( layout.lineSpacingType==LayoutData::LS_DOUBLE ) + else if ( tqlayout.lineSpacingType==LayoutData::LS_DOUBLE ) strLayout += "\\sl480\\slmult1"; // double linespace - else if ( layout.lineSpacingType==LayoutData::LS_ATLEAST ) - strLayout += QString("\\sl%1\\slmult0").arg(int(layout.lineSpacing)*20); + else if ( tqlayout.lineSpacingType==LayoutData::LS_ATLEAST ) + strLayout += TQString("\\sl%1\\slmult0").tqarg(int(tqlayout.lineSpacing)*20); - else if ( layout.lineSpacingType==LayoutData::LS_MULTIPLE ) - strLayout += QString("\\sl%1\\slmult1").arg( int(layout.lineSpacing)*240 ); + else if ( tqlayout.lineSpacingType==LayoutData::LS_MULTIPLE ) + strLayout += TQString("\\sl%1\\slmult1").tqarg( int(tqlayout.lineSpacing)*240 ); - else if ( layout.lineSpacingType==LayoutData::LS_CUSTOM ) + else if ( tqlayout.lineSpacingType==LayoutData::LS_CUSTOM ) // "Custom" in KWord is like "Exactly" in MS Word - strLayout += QString("\\sl-%1\\slmult0").arg(int(layout.lineSpacing)*20); + strLayout += TQString("\\sl-%1\\slmult0").tqarg(int(tqlayout.lineSpacing)*20); else - kdWarning(30515) << "Unsupported lineSpacingType: " << layout.lineSpacingType << " (Ignoring!)" << endl; + kdWarning(30515) << "Unsupported lineSpacingType: " << tqlayout.lineSpacingType << " (Ignoring!)" << endl; } - if (!layout.tabulatorList.isEmpty() - && (force || (layoutOrigin.tabulatorList!=layout.tabulatorList) )) + if (!tqlayout.tabulatorList.isEmpty() + && (force || (tqlayoutOrigin.tabulatorList!=tqlayout.tabulatorList) )) { TabulatorList::ConstIterator it; - for (it=layout.tabulatorList.begin();it!=layout.tabulatorList.end();++it) + for (it=tqlayout.tabulatorList.begin();it!=tqlayout.tabulatorList.end();++it) { switch ((*it).m_type) { @@ -1598,7 +1598,7 @@ QString RTFWorker::layoutToRtf(const LayoutData& layoutOrigin, // must be the last strLayout += "\\tx"; - strLayout += QString::number(int((*it).m_ptpos)*20, 10); + strLayout += TQString::number(int((*it).m_ptpos)*20, 10); } } @@ -1606,7 +1606,7 @@ QString RTFWorker::layoutToRtf(const LayoutData& layoutOrigin, // shadow support // note shadow in KWord is more full-feature/sophisticated than RTF // here we just treat KWord's shadow as simple \shad mark-up - if( layout.shadowDistance > 0 ) + if( tqlayout.shadowDistance > 0 ) { strLayout += "\\shad"; } @@ -1614,21 +1614,21 @@ QString RTFWorker::layoutToRtf(const LayoutData& layoutOrigin, // TODO: borders // This must remain last, as it adds a terminating space. - strLayout+=textFormatToRtf(layoutOrigin.formatData.text, - layout.formatData.text,force); + strLayout+=textFormatToRtf(tqlayoutOrigin.formatData.text, + tqlayout.formatData.text,force); return strLayout; } -QString RTFWorker::lookupFont(const QString& markup, const QString& fontName) +TQString RTFWorker::lookupFont(const TQString& markup, const TQString& fontName) { if (fontName.isEmpty()) - return QString::null; + return TQString(); - // First we have to remove Qt-typical foundry names, as some RTF readers are confused by them. - QString cookedFontName(fontName); - QRegExp regexp("\\s*\\[\\S*\\]"); // Some white space, opening square bracket, some non-white-space, ending square bracket + // First we have to remove TQt-typical foundry names, as some RTF readers are confused by them. + TQString cookedFontName(fontName); + TQRegExp regexp("\\s*\\[\\S*\\]"); // Some white space, opening square bracket, some non-white-space, ending square bracket cookedFontName.remove(regexp); // But we cannot have an empty name font if (cookedFontName.isEmpty()) @@ -1637,15 +1637,15 @@ QString RTFWorker::lookupFont(const QString& markup, const QString& fontName) kdDebug(30515) << "RTFWorker::lookupFont " << fontName << " cooked: " << cookedFontName << endl; uint counter=0; // counts position in font table (starts at 0) - QString strFont(markup); // markup for font selection - QStringList::ConstIterator it; + TQString strFont(markup); // markup for font selection + TQStringList::ConstIterator it; // search font table for this font for( it = m_fontList.begin(); it != m_fontList.end(); counter++, ++it ) { if((*it) == cookedFontName) // check for match { - strFont += QString::number(counter); + strFont += TQString::number(counter); kdDebug(30515) << strFont << endl; return strFont; } @@ -1654,64 +1654,64 @@ QString RTFWorker::lookupFont(const QString& markup, const QString& fontName) kdDebug(30515) << "New font: " << cookedFontName << " count: " << counter << endl; m_fontList << cookedFontName; - strFont += QString::number(counter); + strFont += TQString::number(counter); return strFont; } -QString RTFWorker::lookupColor(const QString& markup, const QColor& color) +TQString RTFWorker::lookupColor(const TQString& markup, const TQColor& color) { if (!color.isValid()) - return QString::null; + return TQString(); uint counter=1; // counts position in color table starting at 1 - QString strColor(markup); // Holds RTF markup for the color + TQString strColor(markup); // Holds RTF markup for the color - QValueList < QColor > ::ConstIterator it; + TQValueList < TQColor > ::ConstIterator it; // search color table for this color for( it = m_colorList.begin(); it != m_colorList.end(); counter++, ++it ) { if ( (*it) == color ) { - strColor += QString::number(counter); + strColor += TQString::number(counter); return strColor; } } - kdDebug(30515) << "New color: " << color.name() << " count: " << counter << endl; + kdDebug(30515) << "New color: " << TQString(color.name()) << " count: " << counter << endl; m_colorList << color; - strColor += QString::number(counter); + strColor += TQString::number(counter); return strColor; } -QString RTFWorker::lookupStyle(const QString& styleName, LayoutData& returnLayout) +TQString RTFWorker::lookupStyle(const TQString& styleName, LayoutData& returnLayout) { if (styleName.isEmpty()) - return QString::null; + return TQString(); uint counter=0; // counts position in style table starting at 0 - QString strMarkup("\\s"); // Holds RTF markup for the style + TQString strMarkup("\\s"); // Holds RTF markup for the style - QValueList < LayoutData > ::ConstIterator it; - QValueList < LayoutData > ::ConstIterator end(m_styleList.end()); + TQValueList < LayoutData > ::ConstIterator it; + TQValueList < LayoutData > ::ConstIterator end(m_styleList.end()); // search color table for this color for( it = m_styleList.begin(); it != end; counter++, ++it ) { if ( (*it).styleName == styleName ) { - strMarkup += QString::number(counter); + strMarkup += TQString::number(counter); returnLayout=(*it); return strMarkup; } } kdDebug(30515) << "New style: " << styleName << " count: " << counter << endl; - LayoutData layout; - m_styleList << layout; - returnLayout=layout; + LayoutData tqlayout; + m_styleList << tqlayout; + returnLayout=tqlayout; - strMarkup += QString::number(counter); + strMarkup += TQString::number(counter); return strMarkup; } diff --git a/filters/kword/rtf/export/ExportFilter.h b/filters/kword/rtf/export/ExportFilter.h index a35dd1b7..77567980 100644 --- a/filters/kword/rtf/export/ExportFilter.h +++ b/filters/kword/rtf/export/ExportFilter.h @@ -21,9 +21,9 @@ #ifndef EXPORTFILTERFULLPOWER_H #define EXPORTFILTERFULLPOWER_H -#include <qvaluestack.h> -#include <qvaluelist.h> -#include <qstringlist.h> +#include <tqvaluestack.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> #include <KWEFBaseWorker.h> @@ -40,11 +40,11 @@ public: RTFWorker(void); virtual ~RTFWorker(void) { delete m_streamOut; delete m_ioDevice; } public: - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); ///< Close file in normal conditions virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); virtual bool doFullDocumentInfo(const KWEFDocumentInfo& docInfo); virtual bool doOpenTextFrameSet(void); @@ -53,57 +53,57 @@ public: const double width, const double height, const int orientation); virtual bool doFullPaperBorders (const double top, const double left, const double bottom, const double right); - virtual bool doFullDefineStyle(LayoutData& layout); + virtual bool doFullDefineStyle(LayoutData& tqlayout); virtual bool doHeader(const HeaderData& header); virtual bool doFooter(const FooterData& footer); virtual bool doVariableSettings(const VariableSettingsData& vs); private: - QString openSpan(const FormatData& formatOrigin, const FormatData& format); - QString closeSpan(const FormatData& formatOrigin, const FormatData& format); + TQString openSpan(const FormatData& formatOrigin, const FormatData& format); + TQString closeSpan(const FormatData& formatOrigin, const FormatData& format); /** * Encodes the @p text into * RTF seven bit ASCII. This affects any 8 bit characters. * They are encoded either with \\' or with \\u * @return the escaped string */ - QString escapeRtfText ( const QString& text ) const; - QString ProcessParagraphData ( const QString ¶Text, - const LayoutData& layout, const ValueListFormatData ¶FormatDataList); - QString formatTextParagraph(const QString& strText, + TQString escapeRtfText ( const TQString& text ) const; + TQString ProcessParagraphData ( const TQString ¶Text, + const LayoutData& tqlayout, const ValueListFormatData ¶FormatDataList); + TQString formatTextParagraph(const TQString& strText, const FormatData& formatOrigin, const FormatData& format); - QString makeTable(const FrameAnchor& anchor); - bool convertUnknownPicture(const QString& strName, const QString& extension, QByteArray& image); - QString makeImage(const FrameAnchor& anchor); + TQString makeTable(const FrameAnchor& anchor); + bool convertUnknownPicture(const TQString& strName, const TQString& extension, TQByteArray& image); + TQString makeImage(const FrameAnchor& anchor); void writeFontData(void); void writeColorData(void); void writeStyleData(void); - QString textFormatToRtf(const TextFormatting& formatOrigin, + TQString textFormatToRtf(const TextFormatting& formatOrigin, const TextFormatting& formatData, const bool force); - QString layoutToRtf(const LayoutData& layoutOrigin, - const LayoutData& layout, const bool force); - QString lookupFont(const QString& markup, const QString& fontName); - QString lookupColor(const QString& markup, const QColor& color); - QString lookupStyle(const QString& styleName, LayoutData& returnLayout); - QString writeRow(const QString& textCellHeader, const QString& rowText, const FrameData& frame); - QString writeBorder(const char whichBorder, const int borderWidth, const QColor& color); + TQString tqlayoutToRtf(const LayoutData& tqlayoutOrigin, + const LayoutData& tqlayout, const bool force); + TQString lookupFont(const TQString& markup, const TQString& fontName); + TQString lookupColor(const TQString& markup, const TQColor& color); + TQString lookupStyle(const TQString& styleName, LayoutData& returnLayout); + TQString writeRow(const TQString& textCellHeader, const TQString& rowText, const FrameData& frame); + TQString writeBorder(const char whichBorder, const int borderWidth, const TQColor& color); protected: - QIODevice* m_ioDevice; - QTextStream* m_streamOut; - QString m_eol; - QString m_textDocInfo; - QString m_textPage; - QString m_textBody; - QString m_fileName; ///< Name of the output file - QValueStack<ListInfo> m_listStack; ///< Stack for list information - QStringList m_fontList; - QValueList<QColor> m_colorList; - QValueList<LayoutData> m_styleList; + TQIODevice* m_ioDevice; + TQTextStream* m_streamOut; + TQString m_eol; + TQString m_textDocInfo; + TQString m_textPage; + TQString m_textBody; + TQString m_fileName; ///< Name of the output file + TQValueStack<ListInfo> m_listStack; ///< Stack for list information + TQStringList m_fontList; + TQValueList<TQColor> m_colorList; + TQValueList<LayoutData> m_styleList; bool m_inTable; bool m_paperOrientation; double m_paperWidth, m_paperHeight; double m_paperMarginTop, m_paperMarginLeft, m_paperMarginBottom, m_paperMarginRight; - QString m_prefix; + TQString m_prefix; int m_startPageNumber; }; diff --git a/filters/kword/rtf/export/rtfexport.cc b/filters/kword/rtf/export/rtfexport.cc index 87d6d9d3..15ff976b 100644 --- a/filters/kword/rtf/export/rtfexport.cc +++ b/filters/kword/rtf/export/rtfexport.cc @@ -53,11 +53,11 @@ K_EXPORT_COMPONENT_FACTORY( librtfexport, RTFExportFactory( "kofficefilters" ) ) // RTFExport // -RTFExport::RTFExport(KoFilter *, const char *, const QStringList &) : +RTFExport::RTFExport(KoFilter *, const char *, const TQStringList &) : KoFilter() { } -KoFilter::ConversionStatus RTFExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus RTFExport::convert( const TQCString& from, const TQCString& to ) { if ((from != "application/x-kword") || (to != "text/rtf" && to != "application/msword" )) { @@ -77,7 +77,7 @@ KoFilter::ConversionStatus RTFExport::convert( const QCString& from, const QCStr return KoFilter::StupidError; } - KoFilter::ConversionStatus result=leader->convert(m_chain, from,to ); + KoFilter::ConversiontqStatus result=leader->convert(m_chain, from,to ); delete leader; delete worker; diff --git a/filters/kword/rtf/export/rtfexport.h b/filters/kword/rtf/export/rtfexport.h index 8e446113..e5276f1a 100644 --- a/filters/kword/rtf/export/rtfexport.h +++ b/filters/kword/rtf/export/rtfexport.h @@ -21,10 +21,10 @@ #ifndef RTFEXPORT_H #define RTFEXPORT_H -#include <qstring.h> -#include <qtextstream.h> -#include <qfile.h> -#include <qobject.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqfile.h> +#include <tqobject.h> #include <KoFilter.h> #include <KoStore.h> @@ -33,12 +33,13 @@ class RTFExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - RTFExport(KoFilter *parent, const char *name, const QStringList &); + RTFExport(KoFilter *tqparent, const char *name, const TQStringList &); virtual ~RTFExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // RTFEXPORT_H diff --git a/filters/kword/rtf/import/rtfimport.cpp b/filters/kword/rtf/import/rtfimport.cpp index 7418494d..bb17d532 100644 --- a/filters/kword/rtf/import/rtfimport.cpp +++ b/filters/kword/rtf/import/rtfimport.cpp @@ -1,4 +1,4 @@ -// kate: space-indent on; indent-width 4; replace-tabs off; +// kate: space-indent on; indent-width 4; tqreplace-tabs off; /* This file is part of the KDE project Copyright (C) 2001 Ewald Snel <ewald@rambo.its.tudelft.nl> @@ -14,18 +14,18 @@ // ### FIXME: copyright holders/date #include <kdebug.h> -#include <qfontinfo.h> +#include <tqfontinfo.h> #include <stddef.h> #include <string.h> #include <KoFilterChain.h> #include <kgenericfactory.h> -#include <qcstring.h> -#include <qstringlist.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qregexp.h> -#include <qvaluelist.h> +#include <tqcstring.h> +#include <tqstringlist.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqvaluelist.h> #include <kurl.h> #include <kmessagebox.h> @@ -98,7 +98,7 @@ static RTFProperty propertyTable[] = MEMBER( 0L, "b", setToggleProperty, state.format.bold, 0 ), // \bin is handled in the tokenizer MEMBER( "@colortbl", "blue", setNumericProperty, blue, 0 ), - MEMBER( 0L, "box", setEnumProperty, state.layout.border, 0 ), + MEMBER( 0L, "box", setEnumProperty, state.tqlayout.border, 0 ), PROP( 0L, "brdrb", selectLayoutBorder, 0L, 3 ), PROP( 0L, "brdrcf", setBorderColor, 0L, 0 ), PROP( 0L, "brdrdash", setBorderStyle, 0L, RTFBorder::Dashes ), @@ -146,29 +146,29 @@ static RTFProperty propertyTable[] = PROP( 0L, "expndtw", ignoreKeyword, 0L, 0 ), // Expansion/compression of character inter-space not supported MEMBER( 0L, "f", setNumericProperty, state.format.font, 0 ), MEMBER( "@rtf", "facingp", setFlagProperty, facingPages, true ), - PROP( 0L, "fcharset", setCharset, 0L, 0 ), // Not needed with Qt - PROP( "@fonttbl", "fdecor", setFontStyleHint, 0L, QFont::Decorative ), - MEMBER( 0L, "fi", setNumericProperty, state.layout.firstIndent, 0 ), - PROP( "@fonttbl", "fmodern", setFontStyleHint, 0L, QFont::TypeWriter ), - PROP( "@fonttbl", "fnil", setFontStyleHint, 0L, QFont::AnyStyle ), + PROP( 0L, "fcharset", setCharset, 0L, 0 ), // Not needed with TQt + PROP( "@fonttbl", "fdecor", setFontStyleHint, 0L, TQFont::Decorative ), + MEMBER( 0L, "fi", setNumericProperty, state.tqlayout.firstIndent, 0 ), + PROP( "@fonttbl", "fmodern", setFontStyleHint, 0L, TQFont::TypeWriter ), + PROP( "@fonttbl", "fnil", setFontStyleHint, 0L, TQFont::AnyStyle ), MEMBER( 0L, "footery", setNumericProperty, state.section.footerMargin, 0 ), PROP( 0L, "formshade", ignoreKeyword, 0L, 0 ), // Not supported, KWord has no form support MEMBER( "@fonttbl", "fprq", setNumericProperty, font.fixedPitch, 0 ), - PROP( "@fonttbl", "froman", setFontStyleHint, 0L, QFont::Serif ), + PROP( "@fonttbl", "froman", setFontStyleHint, 0L, TQFont::Serif ), MEMBER( 0L, "fs", setNumericProperty, state.format.fontSize, 0 ), - PROP( "@fonttbl", "fscript", setFontStyleHint, 0L, QFont::AnyStyle ), - PROP( "@fonttbl", "fswiss", setFontStyleHint, 0L, QFont::SansSerif ), - PROP( "@fonttbl", "ftech", setFontStyleHint, 0L, QFont::AnyStyle ), + PROP( "@fonttbl", "fscript", setFontStyleHint, 0L, TQFont::AnyStyle ), + PROP( "@fonttbl", "fswiss", setFontStyleHint, 0L, TQFont::SansSerif ), + PROP( "@fonttbl", "ftech", setFontStyleHint, 0L, TQFont::AnyStyle ), MEMBER( "@colortbl", "green", setNumericProperty, green, 0 ), MEMBER( 0L, "headery", setNumericProperty, state.section.headerMargin, 0 ), MEMBER( 0L, "i", setToggleProperty, state.format.italic, 0 ), - MEMBER( 0L, "intbl", setFlagProperty, state.layout.inTable, true ), + MEMBER( 0L, "intbl", setFlagProperty, state.tqlayout.inTable, true ), PROP( "@pict", "jpegblip", setPictureType, 0L, RTFPicture::JPEG ), - MEMBER( 0L, "keep", setFlagProperty, state.layout.keep, true ), - MEMBER( 0L, "keepn", setFlagProperty, state.layout.keepNext, true ), + MEMBER( 0L, "keep", setFlagProperty, state.tqlayout.keep, true ), + MEMBER( 0L, "keepn", setFlagProperty, state.tqlayout.keepNext, true ), MEMBER( "@rtf", "landscape", setFlagProperty, landscape, true ), PROP( 0L, "ldblquote", insertSymbol, 0L, 0x201c ), - MEMBER( 0L, "li", setNumericProperty, state.layout.leftIndent, 0 ), + MEMBER( 0L, "li", setNumericProperty, state.tqlayout.leftIndent, 0 ), PROP( 0L, "line", insertSymbol, 0L, 0x000a ), PROP( 0L, "lquote", insertSymbol, 0L, 0x2018 ), PROP( 0L, "ltrmark", insertSymbol, 0L, 0x200e ), @@ -180,14 +180,14 @@ static RTFProperty propertyTable[] = MEMBER( "@rtf", "margt", setNumericProperty, topMargin, 0 ), MEMBER( 0L, "nosupersub", setEnumProperty, state.format.vertAlign, RTFFormat::Normal ), PROP( "Text", "page", insertPageBreak, 0L, 0 ), - MEMBER( 0L, "pagebb", setFlagProperty, state.layout.pageBB, true ), + MEMBER( 0L, "pagebb", setFlagProperty, state.tqlayout.pageBB, true ), MEMBER( "@rtf", "paperh", setNumericProperty, paperHeight, 0 ), MEMBER( "@rtf", "paperw", setNumericProperty, paperWidth, 0 ), PROP( "Text", "par", insertParagraph, 0L, 0 ), PROP( 0L, "pard", setParagraphDefaults, 0L, 0 ), PROP( 0L, "pc", setPcCodepage, 0L, 0 ), PROP( 0L, "pca", setPcaCodepage, 0L, 0 ), - MEMBER( 0L, "pgbrk", setToggleProperty, state.layout.pageBA, true ), + MEMBER( 0L, "pgbrk", setToggleProperty, state.tqlayout.pageBA, true ), MEMBER( "@pict", "piccropb", setNumericProperty, picture.cropBottom, 0 ), MEMBER( "@pict", "piccropl", setNumericProperty, picture.cropLeft, 0 ), MEMBER( "@pict", "piccropr", setNumericProperty, picture.cropRight, 0 ), @@ -202,25 +202,25 @@ static RTFProperty propertyTable[] = PROP( 0L, "plain", setPlainFormatting, 0L, 0 ), PROP( "@pict", "pmmetafile", setPictureType, 0L, RTFPicture::WMF ), PROP( "@pict", "pngblip", setPictureType, 0L, RTFPicture::PNG ), - MEMBER( 0L, "qc", setEnumProperty, state.layout.alignment, RTFLayout::Centered ), - MEMBER( 0L, "qj", setEnumProperty, state.layout.alignment, RTFLayout::Justified ), - MEMBER( 0L, "ql", setEnumProperty, state.layout.alignment, RTFLayout::Left ), + MEMBER( 0L, "qc", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Centered ), + MEMBER( 0L, "qj", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Justified ), + MEMBER( 0L, "ql", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Left ), PROP( 0L, "qmspace", insertSymbol, 0L, 0x2004 ), - MEMBER( 0L, "qr", setEnumProperty, state.layout.alignment, RTFLayout::Right ), + MEMBER( 0L, "qr", setEnumProperty, state.tqlayout.tqalignment, RTFLayout::Right ), PROP( 0L, "rdblquote", insertSymbol, 0L, 0x201d ), MEMBER( "@colortbl", "red", setNumericProperty, red, 0 ), - MEMBER( 0L, "ri", setNumericProperty, state.layout.rightIndent, 0 ), + MEMBER( 0L, "ri", setNumericProperty, state.tqlayout.rightIndent, 0 ), PROP( "Text", "row", insertTableRow, 0L, 0 ), PROP( 0L, "rquote", insertSymbol, 0L, 0x2019 ), PROP( 0L, "rtlmark", insertSymbol, 0L, 0x200f ), - MEMBER( 0L, "s", setNumericProperty, state.layout.style, 0 ), - MEMBER( 0L, "sa", setNumericProperty, state.layout.spaceAfter, 0 ), - MEMBER( 0L, "sb", setNumericProperty, state.layout.spaceBefore, 0 ), + MEMBER( 0L, "s", setNumericProperty, state.tqlayout.style, 0 ), + MEMBER( 0L, "sa", setNumericProperty, state.tqlayout.spaceAfter, 0 ), + MEMBER( 0L, "sb", setNumericProperty, state.tqlayout.spaceBefore, 0 ), MEMBER( 0L, "scaps", setToggleProperty, state.format.smallCaps, 0 ), PROP( "Text", "sect", insertPageBreak, 0L, 0 ), PROP( 0L, "sectd", setSectionDefaults, 0L, 0 ), - MEMBER( 0L, "sl", setNumericProperty, state.layout.spaceBetween, 0 ), - MEMBER( 0L, "slmult", setToggleProperty, state.layout.spaceBetweenMultiple, 0 ), + MEMBER( 0L, "sl", setNumericProperty, state.tqlayout.spaceBetween, 0 ), + MEMBER( 0L, "slmult", setToggleProperty, state.tqlayout.spaceBetweenMultiple, 0 ), MEMBER( "@stylesheet", "snext", setNumericProperty, style.next, 0 ), MEMBER( 0L, "strike", setToggleProperty, state.format.strike, 0 ), MEMBER( 0L, "striked", setToggleProperty, state.format.striked, 0 ), @@ -228,18 +228,18 @@ static RTFProperty propertyTable[] = MEMBER( 0L, "super", setEnumProperty, state.format.vertAlign, RTFFormat::SuperScript ), PROP( 0L, "tab", insertSymbol, 0L, 0x0009 ), MEMBER( 0L, "titlepg", setFlagProperty, state.section.titlePage, true ), - MEMBER( 0L, "tldot", setEnumProperty, state.layout.tab.leader, RTFTab::Dots ), - MEMBER( 0L, "tlhyph", setEnumProperty, state.layout.tab.leader, RTFTab::Hyphens ), - MEMBER( 0L, "tlth", setEnumProperty, state.layout.tab.leader, RTFTab::ThickLine ), - MEMBER( 0L, "tlul", setEnumProperty, state.layout.tab.leader, RTFTab::Underline ), - MEMBER( 0L, "tqc", setEnumProperty, state.layout.tab.type, RTFTab::Centered ), - MEMBER( 0L, "tqdec", setEnumProperty, state.layout.tab.type, RTFTab::Decimal ), - MEMBER( 0L, "tqr", setEnumProperty, state.layout.tab.type, RTFTab::FlushRight ), + MEMBER( 0L, "tldot", setEnumProperty, state.tqlayout.tab.leader, RTFTab::Dots ), + MEMBER( 0L, "tlhyph", setEnumProperty, state.tqlayout.tab.leader, RTFTab::Hyphens ), + MEMBER( 0L, "tlth", setEnumProperty, state.tqlayout.tab.leader, RTFTab::ThickLine ), + MEMBER( 0L, "tlul", setEnumProperty, state.tqlayout.tab.leader, RTFTab::Underline ), + MEMBER( 0L, "tqc", setEnumProperty, state.tqlayout.tab.type, RTFTab::Centered ), + MEMBER( 0L, "tqdec", setEnumProperty, state.tqlayout.tab.type, RTFTab::Decimal ), + MEMBER( 0L, "tqr", setEnumProperty, state.tqlayout.tab.type, RTFTab::FlushRight ), MEMBER( 0L, "trleft", setNumericProperty, state.tableRow.left, 0 ), MEMBER( 0L, "trowd", setTableRowDefaults, state.tableRow, 0 ), - MEMBER( 0L, "trqc", setEnumProperty, state.tableRow.alignment, RTFLayout::Centered ), - MEMBER( 0L, "trql", setEnumProperty, state.tableRow.alignment, RTFLayout::Left ), - MEMBER( 0L, "trqr", setEnumProperty, state.tableRow.alignment, RTFLayout::Right ), + MEMBER( 0L, "trqc", setEnumProperty, state.tableRow.tqalignment, RTFLayout::Centered ), + MEMBER( 0L, "trql", setEnumProperty, state.tableRow.tqalignment, RTFLayout::Left ), + MEMBER( 0L, "trqr", setEnumProperty, state.tableRow.tqalignment, RTFLayout::Right ), MEMBER( 0L, "trrh", setNumericProperty, state.tableRow.height, 0 ), PROP( 0L, "tx", insertTabDef, 0L, 0 ), MEMBER( 0L, "u", insertUnicodeSymbol, state.format.uc, 0 ), @@ -287,7 +287,7 @@ static const char *alignN[4] = { "left", "right", "justify", "center" }; static const char *boolN[2] = { "false", "true" }; static const char *borderN[4] = { "LEFTBORDER", "RIGHTBORDER", "TOPBORDER", "BOTTOMBORDER" }; -RTFImport::RTFImport( KoFilter *, const char *, const QStringList& ) +RTFImport::RTFImport( KoFilter *, const char *, const TQStringList& ) : KoFilter(), properties(181), destinationProperties(29), textCodec(0), utf8TextCodec(0) { for (uint i=0; i < sizeof(propertyTable) / sizeof(propertyTable[0]); i++) @@ -299,7 +299,7 @@ RTFImport::RTFImport( KoFilter *, const char *, const QStringList& ) destinationProperties.insert( destinationPropertyTable[i].name, &destinationPropertyTable[i] ); } // DEBUG START - // Check the hash size (see QDict doc) + // Check the hash size (see TQDict doc) kdDebug(30515) << properties.count() << " normal and " << destinationProperties.count() << " destination keywords loaded" << endl; if (properties.size() < properties.count()) kdWarning(30515) << "Hash size of properties too small: " << properties.size() << ". It should be at least " << properties.count() << " and be a prime number"<< endl; @@ -309,13 +309,13 @@ RTFImport::RTFImport( KoFilter *, const char *, const QStringList& ) fnnum=0; } -KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus RTFImport::convert( const TQCString& from, const TQCString& to ) { // This filter only supports RTF to KWord conversion if ((from != "text/rtf") || (to != "application/x-kword")) return KoFilter::NotImplemented; - QTime debugTime; + TQTime debugTime; debugTime.start(); // Are we in batch mode, i.e. non-interactive @@ -325,7 +325,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr // Open input file inFileName = m_chain->inputFile(); - QFile in( inFileName ); + TQFile in( inFileName ); if (!in.open( IO_ReadOnly )) { @@ -384,7 +384,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr if ( !m_batch ) { force = ( KMessageBox::warningYesNo( 0L, - i18n("The RTF (Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").arg( token.value ), + i18n("The RTF (Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").tqarg( token.value ), i18n("KWord's RTF Import Filter") ) == KMessageBox::Yes ); } if ( !force ) @@ -403,7 +403,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr if ( !m_batch ) { force = ( KMessageBox::warningYesNo( 0L, - i18n("The PWD (PocketWord's Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").arg( token.value ), + i18n("The PWD (PocketWord's Rich Text Format) document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").tqarg( token.value ), i18n("KWord's RTF Import Filter") ) == KMessageBox::Yes ); } if ( !force ) @@ -422,7 +422,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr if ( !m_batch ) { force = ( KMessageBox::warningYesNo( 0L, - i18n("The URTF (\"Unicode Rich Text Format\") document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").arg( token.value ), + i18n("The URTF (\"Unicode Rich Text Format\") document has an unexpected version number: %1. Continuing might result in an erroneous conversion. Do you want to continue?").tqarg( token.value ), i18n("KWord's RTF Import Filter") ) == KMessageBox::Yes ); } if ( !force ) @@ -439,7 +439,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr if ( !m_batch ) { KMessageBox::error( 0L, - i18n("The RTF document cannot be loaded, as it has an unexpected first keyword: \\%1.").arg( token.text ), + i18n("The RTF document cannot be loaded, as it has an unexpected first keyword: \\%1.").tqarg( token.text ), i18n("KWord's RTF Import Filter"), 0 ); } return KoFilter::WrongFormat; @@ -487,12 +487,12 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr state.format.uc=1; state.ignoreGroup = false; - utf8TextCodec=QTextCodec::codecForName("UTF-8"); - kdDebug(30515) << "UTF-8 asked, given: " << (utf8TextCodec?utf8TextCodec->name():QString("-none-")) << endl; + utf8TextCodec=TQTextCodec::codecForName("UTF-8"); + kdDebug(30515) << "UTF-8 asked, given: " << (utf8TextCodec?TQString(utf8TextCodec->name()):TQString("-none-")) << endl; // There is no default encoding in RTF, it must be always declared. (But beware of buggy files!) - textCodec=QTextCodec::codecForName("CP 1252"); // Or IBM 437 ? - kdDebug(30515) << "CP 1252 asked, given: " << (textCodec?textCodec->name():QString("-none-")) << endl; + textCodec=TQTextCodec::codecForName("CP 1252"); // Or IBM 437 ? + kdDebug(30515) << "CP 1252 asked, given: " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; // Parse RTF document while (true) @@ -536,7 +536,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr destination = destinationStack.pop(); } } - // ### TODO: why can this not be simplified to use QValueList::isEmpty() + // ### TODO: why can this not be simplified to use TQValueList::isEmpty() if (stateStack.count() <= 1) { // End-of-document, keep formatting properties @@ -700,7 +700,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr int num=1; for(RTFTextState* i=footnotes.first();i;i=footnotes.next()) { - QCString str; + TQCString str; str.setNum(num); str.prepend("Footnote "); num++; @@ -722,16 +722,16 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr kwFormat.len = 0; // Process all styles in the style sheet - const QValueList<RTFStyle>::ConstIterator endStyleSheet=styleSheet.end(); - for (QValueList<RTFStyle>::ConstIterator it=styleSheet.begin();it!=endStyleSheet;++it) + const TQValueList<RTFStyle>::ConstIterator endStyleSheet=styleSheet.end(); + for (TQValueList<RTFStyle>::ConstIterator it=styleSheet.begin();it!=endStyleSheet;++it) { mainDoc.addNode( "STYLE" ); kwFormat.fmt = (*it).format; // Search for 'following' style - for (QValueList<RTFStyle>::ConstIterator it2=styleSheet.begin();it2!=endStyleSheet;++it2) + for (TQValueList<RTFStyle>::ConstIterator it2=styleSheet.begin();it2!=endStyleSheet;++it2) { - if ((*it2).layout.style == (*it).next) + if ((*it2).tqlayout.style == (*it).next) { mainDoc.addNode( "FOLLOWING" ); mainDoc.setAttribute( "name", CheckAndEscapeXmlText( (*it2).name )); @@ -739,7 +739,7 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr break; } } - addLayout( mainDoc, (*it).name, (*it).layout, false ); + addLayout( mainDoc, (*it).name, (*it).tqlayout, false ); addFormat( mainDoc, kwFormat, 0L ); mainDoc.closeNode( "STYLE" ); } @@ -791,9 +791,9 @@ KoFilter::ConversionStatus RTFImport::convert( const QCString& from, const QCStr kdDebug(30515) << "RTF FILTER TIME: " << debugTime.elapsed() << endl; - for (QMap<QString,int>::ConstIterator it=debugUnknownKeywords.begin(); + for (TQMap<TQString,int>::ConstIterator it=debugUnknownKeywords.begin(); it!=debugUnknownKeywords.end();it++) - kdDebug(30515) << "Unknown keyword: " << QString( "%1" ).arg( it.data(), 4 ) << " * " << it.key() << endl; + kdDebug(30515) << "Unknown keyword: " << TQString( "%1" ).tqarg( it.data(), 4 ) << " * " << it.key() << endl; return KoFilter::OK; } @@ -804,55 +804,55 @@ void RTFImport::ignoreKeyword( RTFProperty * ) void RTFImport::setCodepage( RTFProperty * ) { - QTextCodec* oldCodec = textCodec; - QCString cp; + TQTextCodec* oldCodec = textCodec; + TQCString cp; if ( token.value == 10000 ) { - cp = "Apple Roman"; // ### TODO: how to support the other ones (Qt does not know them!) + cp = "Apple Roman"; // ### TODO: how to support the other ones (TQt does not know them!) } else { cp.setNum( token.value ); cp.prepend("CP"); } - textCodec=QTextCodec::codecForName(cp); - kdDebug(30515) << "\\ansicpg: codepage: " << token.value << "asked: "<< cp << " given: " << (textCodec?textCodec->name():QString("-none-")) << endl; + textCodec=TQTextCodec::codecForName(cp); + kdDebug(30515) << "\\ansicpg: codepage: " << token.value << "asked: "<< cp << " given: " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; if ( ! textCodec ) textCodec = oldCodec; } void RTFImport::setMacCodepage( RTFProperty * ) { - QTextCodec* oldCodec = textCodec; - textCodec=QTextCodec::codecForName("Apple Roman"); - kdDebug(30515) << "\\mac " << (textCodec?textCodec->name():QString("-none-")) << endl; + TQTextCodec* oldCodec = textCodec; + textCodec=TQTextCodec::codecForName("Apple Roman"); + kdDebug(30515) << "\\mac " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; if ( ! textCodec ) textCodec = oldCodec; } void RTFImport::setAnsiCodepage( RTFProperty * ) { - QTextCodec* oldCodec = textCodec; - textCodec=QTextCodec::codecForName("CP1252"); - kdDebug(30515) << "\\ansi " << (textCodec?textCodec->name():QString("-none-")) << endl; + TQTextCodec* oldCodec = textCodec; + textCodec=TQTextCodec::codecForName("CP1252"); + kdDebug(30515) << "\\ansi " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; if ( ! textCodec ) textCodec = oldCodec; } void RTFImport::setPcaCodepage( RTFProperty * ) { - QTextCodec* oldCodec = textCodec; - textCodec=QTextCodec::codecForName("IBM 850"); // Qt writes the name with a space - kdDebug(30515) << "\\pca " << (textCodec?textCodec->name():QString("-none-")) << endl; + TQTextCodec* oldCodec = textCodec; + textCodec=TQTextCodec::codecForName("IBM 850"); // TQt writes the name with a space + kdDebug(30515) << "\\pca " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; if ( ! textCodec ) textCodec = oldCodec; } void RTFImport::setPcCodepage( RTFProperty * ) { - QTextCodec* oldCodec = textCodec; - textCodec=QTextCodec::codecForName("IBM 850"); // This is an approximation - kdDebug(30515) << "\\pc (approximation) " << (textCodec?textCodec->name():QString("-none-")) << endl; + TQTextCodec* oldCodec = textCodec; + textCodec=TQTextCodec::codecForName("IBM 850"); // This is an approximation + kdDebug(30515) << "\\pc (approximation) " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; if ( ! textCodec ) textCodec = oldCodec; } @@ -869,7 +869,7 @@ void RTFImport::setFlagProperty( RTFProperty *property ) void RTFImport::setCharset( RTFProperty *property ) { - QCString cp; + TQCString cp; switch(token.value) { case 0: cp = "CP1252"; break; // ANSI_CHARSET case 1: cp = "CP1252"; break; // DEFAULT_CHARSET @@ -877,7 +877,7 @@ void RTFImport::setCharset( RTFProperty *property ) case 77: cp = "Apple Roman"; break; // MAC_CHARSET case 128: cp = "Shift-JIS"; break; // SHIFTJIS_CHARSET "CP932" case 129: cp = "eucKR"; break; // HANGUL_CHARSET "CP949" - case 130: cp = "CP1361"; break; // JOHAB_CHARSET doesn't really seem to be supported by Qt :-( + case 130: cp = "CP1361"; break; // JOHAB_CHARSET doesn't really seem to be supported by TQt :-( case 134: cp = "GB2312"; break; // GB2312_CHARSET "CP936" case 136: cp = "Big5-HKSCS"; break; // CHINESEBIG5_CHARSET "CP950" case 161: cp = "CP1253"; break; // GREEK_CHARSET @@ -892,9 +892,9 @@ void RTFImport::setCharset( RTFProperty *property ) case 255: cp = "CP850"; break; // OEM_CHARSET "IBM 850" default: return; } - QTextCodec* oldCodec = textCodec; - textCodec=QTextCodec::codecForName(cp); - kdDebug(30515) << "\\fcharset: charset: " << token.value << " codepage: "<< cp << " given: " << (textCodec?textCodec->name():QString("-none-")) << endl; + TQTextCodec* oldCodec = textCodec; + textCodec=TQTextCodec::codecForName(cp); + kdDebug(30515) << "\\fcharset: charset: " << token.value << " codepage: "<< cp << " given: " << (textCodec?TQString(textCodec->name()):TQString("-none-")) << endl; if ( ! textCodec ) textCodec = oldCodec; } @@ -911,7 +911,7 @@ void RTFImport::setEnumProperty( RTFProperty *property ) void RTFImport::setFontStyleHint( RTFProperty* property ) { - font.styleHint = QFont::StyleHint( property->value ); + font.tqstyleHint = TQFont::StyleHint( property->value ); } void RTFImport::setPictureType( RTFProperty* property ) @@ -933,15 +933,15 @@ void RTFImport::setUnderlineProperty( RTFProperty* property ) void RTFImport::setBorderStyle( RTFProperty *property ) { - if (state.layout.border) + if (state.tqlayout.border) { - state.layout.border->style = static_cast <RTFBorder::BorderStyle> ( property->value ); + state.tqlayout.border->style = static_cast <RTFBorder::BorderStyle> ( property->value ); } else { for (uint i=0; i < 4; i++) { - state.layout.borders[i].style = static_cast <RTFBorder::BorderStyle> ( property->value ); + state.tqlayout.borders[i].style = static_cast <RTFBorder::BorderStyle> ( property->value ); } } } @@ -949,30 +949,30 @@ void RTFImport::setBorderStyle( RTFProperty *property ) void RTFImport::setBorderProperty( RTFProperty *property ) { //kdDebug() << "setBorderProperty: " << endl; - if (state.layout.border) + if (state.tqlayout.border) { - state.layout.border->width = token.value; + state.tqlayout.border->width = token.value; } else { for (uint i=0; i < 4; i++) { - state.layout.borders[i].width = token.value; + state.tqlayout.borders[i].width = token.value; } } } void RTFImport::setBorderColor( RTFProperty * ) { - if (state.layout.border) + if (state.tqlayout.border) { - state.layout.border->color = token.value; + state.tqlayout.border->color = token.value; } else { for (uint i=0; i < 4; i++) { - state.layout.borders[i].color = token.value; + state.tqlayout.borders[i].color = token.value; } } } @@ -1008,34 +1008,34 @@ void RTFImport::setPlainFormatting( RTFProperty * ) void RTFImport::setParagraphDefaults( RTFProperty * ) { - RTFLayout &layout = state.layout; + RTFLayout &tqlayout = state.tqlayout; - layout.tablist.clear(); - layout.tab.type = RTFTab::Left; - layout.tab.leader = RTFTab::None; + tqlayout.tablist.clear(); + tqlayout.tab.type = RTFTab::Left; + tqlayout.tab.leader = RTFTab::None; for (uint i=0; i < 4; i++) { - RTFBorder &border = layout.borders[i]; + RTFBorder &border = tqlayout.borders[i]; border.color = -1; border.width = 0; border.style = RTFBorder::None; } - layout.firstIndent = 0; - layout.leftIndent = 0; - layout.rightIndent = 0; - layout.spaceBefore = 0; - layout.spaceAfter = 0; - layout.spaceBetween = 0; - layout.spaceBetweenMultiple = false; - layout.style = 0; - layout.alignment = RTFLayout::Left; - layout.border = 0L; - layout.inTable = false; - layout.keep = false; - layout.keepNext = false; - layout.pageBB = false; - layout.pageBA = false; + tqlayout.firstIndent = 0; + tqlayout.leftIndent = 0; + tqlayout.rightIndent = 0; + tqlayout.spaceBefore = 0; + tqlayout.spaceAfter = 0; + tqlayout.spaceBetween = 0; + tqlayout.spaceBetweenMultiple = false; + tqlayout.style = 0; + tqlayout.tqalignment = RTFLayout::Left; + tqlayout.border = 0L; + tqlayout.inTable = false; + tqlayout.keep = false; + tqlayout.keepNext = false; + tqlayout.pageBB = false; + tqlayout.pageBA = false; } void RTFImport::setSectionDefaults( RTFProperty * ) @@ -1054,7 +1054,7 @@ void RTFImport::setTableRowDefaults( RTFProperty * ) tableRow.height = 0; tableRow.left = 0; - tableRow.alignment = RTFLayout::Left; + tableRow.tqalignment = RTFLayout::Left; tableRow.cells.clear(); tableCell.bgcolor = -1; @@ -1069,17 +1069,17 @@ void RTFImport::setTableRowDefaults( RTFProperty * ) void RTFImport::selectLayoutBorder( RTFProperty * property ) { - state.layout.border = & state.layout.borders [ property->value ]; + state.tqlayout.border = & state.tqlayout.borders [ property->value ]; } void RTFImport::selectLayoutBorderFromCell( RTFProperty * property ) { - state.layout.border = & state.tableCell.borders [ property->value ]; + state.tqlayout.border = & state.tableCell.borders [ property->value ]; } void RTFImport::insertParagraph( RTFProperty * ) { - if (state.layout.inTable) + if (state.tqlayout.inTable) { if (textState->table == 0) { @@ -1110,10 +1110,10 @@ void RTFImport::insertPageBreak( RTFProperty * ) void RTFImport::insertTableCell( RTFProperty * ) { //{{ - bool b = state.layout.inTable; - state.layout.inTable = true; + bool b = state.tqlayout.inTable; + state.tqlayout.inTable = true; insertParagraph(); - state.layout.inTable = b; + state.tqlayout.inTable = b; //}} textState->frameSets << textState->cell.toString(); textState->cell.clear( 3 ); @@ -1130,14 +1130,14 @@ void RTFImport::insertTableRow( RTFProperty * ) { char buf[64]; sprintf( buf, "Table %d", textState->table ); - RTFLayout::Alignment align = row.alignment; + RTFLayout::Alignment align = row.tqalignment; // Store the current state on the stack stateStack.push( state ); resetState(); - state.layout.alignment = align; // table alignment + state.tqlayout.tqalignment = align; // table tqalignment - // Add anchor for new table (default layout) + // Add anchor for new table (default tqlayout) addAnchor( buf ); addParagraph( textState->node, false ); @@ -1202,9 +1202,9 @@ void RTFImport::insertCellDef( RTFProperty * ) void RTFImport::insertTabDef( RTFProperty * ) { - RTFTab tab = state.layout.tab; + RTFTab tab = state.tqlayout.tab; tab.position = token.value; - state.layout.tablist.push( tab ); + state.tqlayout.tablist.push( tab ); tab.type = RTFTab::Left; tab.leader = RTFTab::None; } @@ -1235,12 +1235,12 @@ void RTFImport::insertUTF8( int ch ) *text++ = ch; *text++ = 0; - QTextCodec* oldCodec=textCodec; + TQTextCodec* oldCodec=textCodec; if (utf8TextCodec) textCodec=utf8TextCodec; else - kdError(30515) << "No UTF-8 QTextCodec available" << endl; + kdError(30515) << "No UTF-8 TQTextCodec available" << endl; (this->*destination.destproc)(0L); @@ -1297,7 +1297,7 @@ void RTFImport::insertUnicodeSymbol( RTFProperty * ) } else if (token.type == RTFTokenizer::PlainText) { - const uint len = qstrlen( token.text ); + const uint len = tqstrlen( token.text ); if ( len < i ) i -= len; else @@ -1320,8 +1320,8 @@ void RTFImport::parseFontTable( RTFProperty * ) { if (token.type == RTFTokenizer::OpenGroup) { - font.name = QString::null; - font.styleHint = QFont::AnyStyle; + font.name = TQString(); + font.tqstyleHint = TQFont::AnyStyle; font.fixedPitch = 0; } else if (token.type == RTFTokenizer::PlainText) @@ -1341,20 +1341,20 @@ void RTFImport::parseFontTable( RTFProperty * ) // Add font to font table *strchr( token.text, ';' ) = 0; // ### TODO: is this allowed with multi-byte Asian characters? font.name += textCodec->toUnicode( token.text ); - // Use Qt to look up the closest matching installed font - QFont qFont( font.name ); + // Use TQt to look up the closest matching installed font + TQFont qFont( font.name ); qFont.setFixedPitch( (font.fixedPitch == 1) ); - qFont.setStyleHint( font.styleHint ); + qFont.setStyleHint( font.tqstyleHint ); for(;!qFont.exactMatch();) { - int space=font.name.findRev(' ', font.name.length()); + int space=font.name.tqfindRev(' ', font.name.length()); if(space==-1) break; font.name.truncate(space); qFont.setFamily( font.name ); } - const QFontInfo info( qFont ); - const QString newFontName ( info.family() ); + const TQFontInfo info( qFont ); + const TQString newFontName ( info.family() ); kdDebug(30515) << "Font " << state.format.font << " asked: " << font.name << " given: " << newFontName << endl; if ( newFontName.isEmpty() ) @@ -1362,7 +1362,7 @@ void RTFImport::parseFontTable( RTFProperty * ) else fontTable.insert( state.format.font, newFontName ); font.name.truncate( 0 ); - font.styleHint = QFont::AnyStyle; + font.tqstyleHint = TQFont::AnyStyle; font.fixedPitch = 0; } } @@ -1386,8 +1386,8 @@ void RTFImport::parseStyleSheet( RTFProperty * ) *strchr( token.text, ';' ) = 0; // ### TODO: is this allowed with multi-byte Asian characters? style.name += textCodec->toUnicode( token.text ); style.format = state.format; - style.layout = state.layout; - style.next = (style.next == -1) ? style.layout.style : style.next; + style.tqlayout = state.tqlayout; + style.next = (style.next == -1) ? style.tqlayout.style : style.next; styleSheet << style; style.name.truncate( 0 ); style.next = -1; @@ -1409,7 +1409,7 @@ void RTFImport::parseColorTable( RTFProperty * ) // Search for semicolon(s) while ((token.text = strchr( token.text, ';' ))) { - colorTable << QColor( red, green, blue ); + colorTable << TQColor( red, green, blue ); red = green = blue = 0; ++token.text; } @@ -1420,11 +1420,11 @@ void RTFImport::parseBlipUid( RTFProperty * ) { if (token.type == RTFTokenizer::OpenGroup) { - picture.identifier = QString::null; + picture.identifier = TQString(); } else if (token.type == RTFTokenizer::PlainText) { - picture.identifier += QString::fromUtf8( token.text ); + picture.identifier += TQString::fromUtf8( token.text ); } else if (token.type == RTFTokenizer::CloseGroup) { @@ -1452,7 +1452,7 @@ void RTFImport::parsePicture( RTFProperty * ) picture.cropBottom = 0; picture.nibble = 0; picture.bits.truncate( 0 ); - picture.identifier = QString::null; + picture.identifier = TQString(); } else if (token.type == RTFTokenizer::PlainText) { @@ -1460,7 +1460,7 @@ void RTFImport::parsePicture( RTFProperty * ) { *(--token.text) = picture.nibble; } - uint n = qstrlen( token.text ) >> 1; + uint n = tqstrlen( token.text ) >> 1; picture.bits.resize( picture.bits.size() + n ); char *src = token.text; char *dst = (picture.bits.data() + picture.bits.size() - n); @@ -1506,15 +1506,15 @@ void RTFImport::parsePicture( RTFProperty * ) break; } const int id = ++pictureNumber; - QString pictName("pictures/picture"); - pictName += QString::number(id); + TQString pictName("pictures/picture"); + pictName += TQString::number(id); pictName += ext; - QCString frameName; + TQCString frameName; frameName.setNum(id); frameName.prepend("Picture "); - QString idStr; + TQString idStr; if (picture.identifier.isEmpty()) { idStr = pictName; @@ -1538,8 +1538,8 @@ void RTFImport::parsePicture( RTFProperty * ) // Add anchor to rich text destination addAnchor( frameName ); - // It is safe, as we call currentDateTime only once for each picture - const QDateTime dt(QDateTime::currentDateTime()); + // It is safe, as we call tqcurrentDateTime only once for each picture + const TQDateTime dt(TQDateTime::tqcurrentDateTime()); // Add pixmap or clipart (key) pictures.addKey( dt, idStr, pictName ); @@ -1556,11 +1556,11 @@ void RTFImport::parsePicture( RTFProperty * ) frameSets.addKey( dt, idStr ); frameSets.closeNode( "PICTURE" ); frameSets.closeNode( "FRAMESET" ); - picture.identifier = QString::null; + picture.identifier = TQString(); } } -void RTFImport::addImportedPicture( const QString& rawFileName ) +void RTFImport::addImportedPicture( const TQString& rawFileName ) { kdDebug(30515) << "Import field: reading " << rawFileName << endl; @@ -1570,12 +1570,12 @@ void RTFImport::addImportedPicture( const QString& rawFileName ) return; } - QString slashPath( rawFileName ); - slashPath.replace('\\','/'); // Replace directory separators. + TQString slashPath( rawFileName ); + slashPath.tqreplace('\\','/'); // Replace directory separators. // ### TODO: what with MS-DOS absolute paths? (Will only work for KOffice on Win32) - QFileInfo info; + TQFileInfo info; info.setFile( inFileName ); - QDir dir( info.dirPath() ); + TQDir dir( info.dirPath() ); KURL url; url.setPath(dir.filePath( rawFileName )); @@ -1583,7 +1583,7 @@ void RTFImport::addImportedPicture( const QString& rawFileName ) kdDebug(30515) << "Path: " << url.prettyURL() << endl; KoPicture pic; - pic.setKeyAndDownloadPicture(url, 0); // ### TODO: find a better parent if possible + pic.setKeyAndDownloadPicture(url, 0); // ### TODO: find a better tqparent if possible if (pic.isNull()) { kdError(30515) << "Import field: file is empty: " << rawFileName << endl; @@ -1592,12 +1592,12 @@ void RTFImport::addImportedPicture( const QString& rawFileName ) const uint id = ++pictureNumber; - QString pictName("pictures/picture"); - pictName += QString::number(id); + TQString pictName("pictures/picture"); + pictName += TQString::number(id); pictName += '.'; pictName += pic.getExtension(); - QCString frameName; + TQCString frameName; frameName.setNum(id); frameName.prepend("Picture "); @@ -1614,14 +1614,14 @@ void RTFImport::addImportedPicture( const QString& rawFileName ) // Add anchor to rich text destination addAnchor( frameName ); - // It is safe, as we call currentDateTime only once for each picture - const QDateTime dt( pic.getKey().lastModified() ); + // It is safe, as we call tqcurrentDateTime only once for each picture + const TQDateTime dt( pic.getKey().lastModified() ); // Add picture key pictures.addKey( dt, rawFileName, pictName ); // Add picture frameset - const QSize size ( pic.getOriginalSize() * 20 ); // We need twips for addFrame + const TQSize size ( pic.getOriginalSize() * 20 ); // We need twips for addFrame frameSets.addFrameSet( frameName, 2, 0 ); frameSets.addFrame( 0, 0, size.width(), size.height(), 0, 1, 0 ); frameSets.closeNode( "FRAME" ); @@ -1644,13 +1644,13 @@ void RTFImport::insertPageNumber( RTFProperty * ) void RTFImport::insertDateTime( RTFProperty *property ) { kdDebug(30515) << "insertDateTime: " << property->value << endl; - addDateTime( QString::null, bool(property->value), state.format ); + addDateTime( TQString(), bool(property->value), state.format ); } -void RTFImport::addDateTime( const QString& format, const bool isDate, RTFFormat& fmt ) +void RTFImport::addDateTime( const TQString& format, const bool isDate, RTFFormat& fmt ) { bool asDate=isDate; // Should the variable be a date variable? - QString kwordFormat(format); + TQString kwordFormat(format); if (format.isEmpty()) { if (isDate) @@ -1662,7 +1662,7 @@ void RTFImport::addDateTime( const QString& format, const bool isDate, RTFFormat { // It is a time with a specified format, so check if it is really a time // (as in KWord 1.3, a date can have a time format but a time cannot have a date format - const QRegExp regexp ("[yMd]"); // any date format character? + const TQRegExp regexp ("[yMd]"); // any date format character? asDate = (regexp.search(format)>-1); // if yes, then it is a date } DomNode node; @@ -1708,11 +1708,11 @@ void RTFImport::parseField( RTFProperty * ) if (!fldinst.isEmpty()) { DomNode node; - QStringList list ( QStringList::split( ' ', fldinst, false ) ); + TQStringList list ( TQStringList::split( ' ', fldinst, false ) ); kdDebug(30515) << "Field: " << list << endl; uint i; - QString fieldName ( list[0].upper() ); + TQString fieldName ( list[0].upper() ); fieldName.remove('\\'); // Remove \, especialy leading ones in OOWriter RTF files node.clear(7); @@ -1749,7 +1749,7 @@ void RTFImport::parseField( RTFProperty * ) } else if (fieldTable[i].type == 9) { - QString hrefName = QString::null; + TQString hrefName = TQString(); // Use ConstIterator for (uint i=1; i < list.count(); i++) @@ -1768,7 +1768,7 @@ void RTFImport::parseField( RTFProperty * ) } } node.addNode( "LINK" ); - node.setAttribute( "linkName", fldrslt ); + node.setAttribute( "linkName", !fldrslt.isNull() ); node.setAttribute( "hrefName", hrefName ); node.closeNode( "LINK" ); addVariable( node, 9, "STRING", &fldfmt); @@ -1790,21 +1790,21 @@ void RTFImport::parseField( RTFProperty * ) } else if (fieldName == "TIME" || fieldName == "DATE") { - QString strFldinst( QString::fromUtf8(fldinst) ); - QRegExp regexp("\\\\@\\s*\"(.+)\""); // \@ "Text" + TQString strFldinst( TQString::fromUtf8(fldinst) ); + TQRegExp regexp("\\\\@\\s*\"(.+)\""); // \@ "Text" if (regexp.search(strFldinst)==-1) { // Not found? Perhaps it is not in quotes (even if it is rare) kdWarning(30515) << "Date/time field format not in quotes!" << endl; strFldinst += ' '; // Add a space at the end to simplify the regular expression - regexp = QRegExp("\\\\@(\\S+)\\s+"); // \@some_text_up_to_a_space + regexp = TQRegExp("\\\\@(\\S+)\\s+"); // \@some_text_up_to_a_space regexp.search(strFldinst); } - QString format(regexp.cap(1)); + TQString format(regexp.cap(1)); kdDebug(30515) << "Date/time field format: " << format << endl; - format.replace("am/pm", "ap"); - format.replace("a/p", "ap"); // Approximation - format.replace("AM/PM", "AP"); - format.replace("A/P", "AP"); // Approximation + format.tqreplace("am/pm", "ap"); + format.tqreplace("a/p", "ap"); // Approximation + format.tqreplace("AM/PM", "AP"); + format.tqreplace("A/P", "AP"); // Approximation format.remove("'"); // KWord 1.3 cannot protect text in date/time addDateTime( format, (fieldName == "DATE"), fldfmt ); } @@ -1865,7 +1865,7 @@ void RTFImport::parseFldrslt( RTFProperty * ) } } -void RTFImport::addVariable (const DomNode& spec, int type, const QString& key, const RTFFormat* fmt) +void RTFImport::addVariable (const DomNode& spec, int type, const TQString& key, const RTFFormat* fmt) { DomNode node; @@ -1899,7 +1899,7 @@ void RTFImport::parseFootNote( RTFProperty * property) fnnum++; destination.target = newTextState; - QCString str; + TQCString str; str.setNum(fnnum); str.prepend("Footnote "); @@ -1909,7 +1909,7 @@ void RTFImport::parseFootNote( RTFProperty * property) node.addNode("FOOTNOTE"); node.setAttribute("numberingtype", "auto"); node.setAttribute("notetype", "footnote"); - node.setAttribute("frameset", str); + node.setAttribute("frameset", !str.isNull()); node.setAttribute("value", fnnum); node.closeNode("FOOTNOTE"); addVariable(node, 11, "STRING"); @@ -1942,7 +1942,7 @@ void RTFImport::parseRichText( RTFProperty * ) // Ignore hidden text if (!state.format.hidden) { - const int len = (token.text[0] < 0) ? 1 : qstrlen( token.text ); + const int len = (token.text[0] < 0) ? 1 : tqstrlen( token.text ); // Check and store format changes if ( textState->formats.isEmpty() || @@ -1954,7 +1954,7 @@ void RTFImport::parseRichText( RTFProperty * ) kwFormat.pos = textState->length; kwFormat.len = len; textState->formats << kwFormat; - kwFormat.xmldata = QString::null; + kwFormat.xmldata = TQString(); } else { @@ -2055,7 +2055,7 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma int vertAlign0 = ~vertAlign; int fontSize0 = ~fontSize; - // Adjust vertical alignment and font size if (\dn, \up) are used + // Adjust vertical tqalignment and font size if (\dn, \up) are used if (format.fmt.vertAlign == RTFFormat::Normal && format.fmt.baseline) { if (format.fmt.baseline < 0) @@ -2096,7 +2096,7 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma { node.addNode( "COLOR" ); node.addColor( ((uint)format.fmt.color >= colorTable.count()) - ? (QColor &)Qt::black : colorTable[format.fmt.color] ); + ? (TQColor &)TQt::black : colorTable[format.fmt.color] ); node.closeNode( "COLOR" ); } if ((uint)format.fmt.bgcolor < colorTable.count() && @@ -2110,7 +2110,7 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma { node.addNode( "FONT" ); - if (fontTable.contains( format.fmt.font )) + if (fontTable.tqcontains( format.fmt.font )) { node.setAttribute( "name", fontTable[format.fmt.font] ); } @@ -2137,7 +2137,7 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma if (!baseFormat || format.fmt.underline != baseFormat->underline ) { node.addNode( "UNDERLINE" ); - QCString st,styleline,wordbyword("0"); + TQCString st,styleline,wordbyword("0"); st.setNum(format.fmt.underline); int underlinecolor = format.fmt.underlinecolor; @@ -2205,10 +2205,10 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma break; } } // end of switch - node.setAttribute( "value", st ); - node.setAttribute( "wordbyword", wordbyword ); + node.setAttribute( "value", !st.isNull() ); + node.setAttribute( "wordbyword", !wordbyword.isNull() ); if ( !styleline.isEmpty() ) - node.setAttribute( "styleline", styleline ); + node.setAttribute( "styleline", !styleline.isNull() ); if ( underlinecolor >= 0 && uint(underlinecolor) < colorTable.count() ) { node.setAttribute( "underlinecolor", colorTable[underlinecolor].name() ); @@ -2219,11 +2219,11 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma if (!baseFormat || format.fmt.strike != baseFormat->strike || format.fmt.striked != baseFormat->striked) { node.addNode( "STRIKEOUT" ); - QCString st; + TQCString st; st.setNum(format.fmt.strike); if(format.fmt.striked) st="double"; - node.setAttribute( "value", st ); + node.setAttribute( "value", !st.isNull() ); node.closeNode( "STRIKEOUT" ); } if (vertAlign != vertAlign0) @@ -2235,20 +2235,20 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma if (!baseFormat || format.fmt.caps != baseFormat->caps || format.fmt.smallCaps != baseFormat->smallCaps) { node.addNode( "FONTATTRIBUTE" ); - QCString fontattr; + TQCString fontattr; if ( format.fmt.caps ) fontattr="uppercase"; else if ( format.fmt.smallCaps ) fontattr="smallcaps"; else fontattr="none"; - node.setAttribute( "value", fontattr ); + node.setAttribute( "value", !fontattr.isNull() ); node.closeNode( "FONTATTRIBUTE" ); } if (!baseFormat) { node.addNode( "CHARSET" ); - node.setAttribute( "value", (int)QFont::Unicode ); + node.setAttribute( "value", (int)TQFont::Unicode ); node.closeNode( "CHARSET" ); } } @@ -2261,40 +2261,40 @@ void RTFImport::addFormat( DomNode &node, const KWFormat& format, const RTFForma node.closeNode( "FORMAT" ); } -void RTFImport::addLayout( DomNode &node, const QString &name, const RTFLayout &layout, bool frameBreak ) +void RTFImport::addLayout( DomNode &node, const TQString &name, const RTFLayout &tqlayout, bool frameBreak ) { - // Style name and alignment + // Style name and tqalignment node.addNode( "NAME" ); node.setAttribute( "value", CheckAndEscapeXmlText(name) ); node.closeNode( "NAME" ); node.addNode( "FLOW" ); - node.setAttribute( "align", alignN[layout.alignment] ); + node.setAttribute( "align", alignN[tqlayout.tqalignment] ); node.closeNode( "FLOW" ); // Indents - if (layout.firstIndent || layout.leftIndent || layout.rightIndent) + if (tqlayout.firstIndent || tqlayout.leftIndent || tqlayout.rightIndent) { node.addNode( "INDENTS" ); - if (layout.firstIndent) - node.setAttribute( "first", .05*layout.firstIndent ); - if (layout.leftIndent) - node.setAttribute( "left", .05*layout.leftIndent ); - if (layout.rightIndent) - node.setAttribute( "right", .05*layout.rightIndent ); + if (tqlayout.firstIndent) + node.setAttribute( "first", .05*tqlayout.firstIndent ); + if (tqlayout.leftIndent) + node.setAttribute( "left", .05*tqlayout.leftIndent ); + if (tqlayout.rightIndent) + node.setAttribute( "right", .05*tqlayout.rightIndent ); node.closeNode( "INDENTS" ); } // Offets - if (layout.spaceBefore || layout.spaceAfter) + if (tqlayout.spaceBefore || tqlayout.spaceAfter) { node.addNode( "OFFSETS" ); - if (layout.spaceBefore) - node.setAttribute( "before", .05*layout.spaceBefore ); - if (layout.spaceAfter) - node.setAttribute( "after", .05*layout.spaceAfter ); + if (tqlayout.spaceBefore) + node.setAttribute( "before", .05*tqlayout.spaceBefore ); + if (tqlayout.spaceAfter) + node.setAttribute( "after", .05*tqlayout.spaceAfter ); node.closeNode( "OFFSETS" ); } @@ -2302,12 +2302,12 @@ void RTFImport::addLayout( DomNode &node, const QString &name, const RTFLayout & // Linespacing - QString lineSpacingType; - QString lineSpacingValue; - if ( layout.spaceBetweenMultiple ) + TQString lineSpacingType; + TQString lineSpacingValue; + if ( tqlayout.spaceBetweenMultiple ) { // Note: 240 is a sort of magic value for one line (Once upon a time, it meant 12pt for a single line) - switch (layout.spaceBetween ) + switch (tqlayout.spaceBetween ) { case 240: { @@ -2326,10 +2326,10 @@ void RTFImport::addLayout( DomNode &node, const QString &name, const RTFLayout & } default: { - if ( layout.spaceBetween > 0 ) + if ( tqlayout.spaceBetween > 0 ) { lineSpacingType = "multiple"; - lineSpacingValue.setNum( layout.spaceBetween / 240.0 ); + lineSpacingValue.setNum( tqlayout.spaceBetween / 240.0 ); } break; } @@ -2337,16 +2337,16 @@ void RTFImport::addLayout( DomNode &node, const QString &name, const RTFLayout & } else { - if (layout.spaceBetween > 0) + if (tqlayout.spaceBetween > 0) { lineSpacingType = "atleast"; - lineSpacingValue.setNum( 0.05*layout.spaceBetween ); + lineSpacingValue.setNum( 0.05*tqlayout.spaceBetween ); } - if (layout.spaceBetween < 0) + if (tqlayout.spaceBetween < 0) { // negative linespace means "exact" lineSpacingType = "fixed" ; - lineSpacingValue.setNum( -0.05*layout.spaceBetween ); + lineSpacingValue.setNum( -0.05*tqlayout.spaceBetween ); } } @@ -2359,26 +2359,26 @@ void RTFImport::addLayout( DomNode &node, const QString &name, const RTFLayout & node.closeNode( "LINESPACING" ); } - if (layout.keep || layout.pageBB || layout.pageBA || frameBreak || layout.keepNext) + if (tqlayout.keep || tqlayout.pageBB || tqlayout.pageBA || frameBreak || tqlayout.keepNext) { node.addNode( "PAGEBREAKING" ); - node.setAttribute( "linesTogether", boolN[layout.keep] ); - node.setAttribute( "hardFrameBreak", boolN[layout.pageBB] ); - node.setAttribute( "hardFrameBreakAfter", boolN[layout.pageBA || frameBreak] ); - node.setAttribute( "keepWithNext", boolN[layout.keepNext] ); + node.setAttribute( "linesTogether", boolN[tqlayout.keep] ); + node.setAttribute( "hardFrameBreak", boolN[tqlayout.pageBB] ); + node.setAttribute( "hardFrameBreakAfter", boolN[tqlayout.pageBA || frameBreak] ); + node.setAttribute( "keepWithNext", boolN[tqlayout.keepNext] ); node.closeNode( "PAGEBREAKING" ); } // Paragraph borders for (uint i=0; i < 4; i++) { - const RTFBorder &border = layout.borders[i]; + const RTFBorder &border = tqlayout.borders[i]; if (border.style != RTFBorder::None || border.width > 0) { node.addNode( borderN[i] ); node.addColor( ((uint)border.color >= colorTable.count()) - ? (QColor &)Qt::black : colorTable[border.color] ); + ? (TQColor &)TQt::black : colorTable[border.color] ); node.setAttribute( "style", (int)border.style & 0xf ); node.setAttribute( "width", (border.width < 20) ? 1 : border.width /20 ); node.closeNode( borderN[i] ); @@ -2386,21 +2386,21 @@ void RTFImport::addLayout( DomNode &node, const QString &name, const RTFLayout & } // Add automatic tab stop for hanging indent - if (layout.firstIndent < 0 && layout.leftIndent > 0) + if (tqlayout.firstIndent < 0 && tqlayout.leftIndent > 0) { node.addNode( "TABULATOR" ); node.setAttribute( "type", 0 ); - node.setAttribute( "ptpos", .05*layout.leftIndent ); + node.setAttribute( "ptpos", .05*tqlayout.leftIndent ); node.closeNode( "TABULATOR" ); } // Tabulators - if (!layout.tablist.isEmpty()) + if (!tqlayout.tablist.isEmpty()) { // ### TODO: use ConstIterator - for (uint i=0; i < layout.tablist.count(); i++) + for (uint i=0; i < tqlayout.tablist.count(); i++) { - const RTFTab &tab = layout.tablist[i]; + const RTFTab &tab = tqlayout.tablist[i]; int l = (int)tab.leader; node.addNode( "TABULATOR" ); node.setAttribute( "type", tab.type ); @@ -2420,14 +2420,14 @@ void RTFImport::addParagraph( DomNode &node, bool frameBreak ) node.closeNode( "TEXT" ); // Search for style in style sheet - QString name; + TQString name; const RTFFormat* format = &state.format; - const int styleNum = state.layout.style; + const int styleNum = state.tqlayout.style; - const QValueList<RTFStyle>::ConstIterator endStyleSheet = styleSheet.end(); - for ( QValueList<RTFStyle>::ConstIterator it=styleSheet.begin(); it!=endStyleSheet; ++it ) + const TQValueList<RTFStyle>::ConstIterator endStyleSheet = styleSheet.end(); + for ( TQValueList<RTFStyle>::ConstIterator it=styleSheet.begin(); it!=endStyleSheet; ++it ) { - if ( (*it).layout.style == styleNum ) + if ( (*it).tqlayout.style == styleNum ) { if ( textState->length > 0 ) { @@ -2451,7 +2451,7 @@ void RTFImport::addParagraph( DomNode &node, bool frameBreak ) // Insert character formatting bool hasFormats = false; - for ( QValueList<KWFormat>::ConstIterator it = textState->formats.begin(); it != textState->formats.end(); ++it ) + for ( TQValueList<KWFormat>::ConstIterator it = textState->formats.begin(); it != textState->formats.end(); ++it ) { if ( (*it).id != 1 || (*it).fmt != *format ) { @@ -2468,9 +2468,9 @@ void RTFImport::addParagraph( DomNode &node, bool frameBreak ) node.closeNode( "FORMATS" ); } - // Write out layout and format + // Write out tqlayout and format node.addNode( "LAYOUT" ); - addLayout( node, name, state.layout, frameBreak ); + addLayout( node, name, state.tqlayout, frameBreak ); addFormat( node, kwFormat, 0L ); node.closeNode( "LAYOUT" ); node.closeNode( "PARAGRAPH" ); @@ -2484,8 +2484,8 @@ void RTFImport::addParagraph( DomNode &node, bool frameBreak ) void RTFImport::finishTable() { kdDebug(30515) << "Starting TFImport::finishTable..." << endl; - QCString emptyArray; - QValueList<int> cellx; + TQCString emptyArray; + TQValueList<int> cellx; int left = 0, right = 0; insertTableRow(); @@ -2524,10 +2524,10 @@ void RTFImport::finishTable() // ### TODO: use ConstIterator for (uint k=0; k < row.cells.count(); k++) { - if (!cellx.contains( row.cells[k].x )) + if (!cellx.tqcontains( row.cells[k].x )) cellx << row.cells[k].x; } - if (!cellx.contains( row.left )) + if (!cellx.tqcontains( row.left )) { cellx << row.left; } @@ -2562,7 +2562,7 @@ void RTFImport::finishTable() { char buf[64]; int x2 = row.cells[k].x; - int col = cellx.findIndex( x1 ); + int col = cellx.tqfindIndex( x1 ); sprintf( buf, "Table %d Cell %d,%d", textState->table, i, col ); frameSets.addFrameSet( buf, 1, 0 ); @@ -2571,7 +2571,7 @@ void RTFImport::finishTable() frameSets.setAttribute( "row", (int)i ); frameSets.setAttribute( "col", col ); frameSets.setAttribute( "rows", 1 ); - frameSets.setAttribute( "cols", cellx.findIndex( x2 ) - col ); + frameSets.setAttribute( "cols", cellx.tqfindIndex( x2 ) - col ); frameSets.addFrame( x1, y1, x2, y2, (row.height < 0) ? 2 : 0, 1, 0 ); @@ -2583,8 +2583,8 @@ void RTFImport::finishTable() if (border.style != RTFBorder::None || border.width > 0) { const char *id = "lrtb"; - QColor &c = ((uint)border.color >= colorTable.count()) - ? (QColor &)Qt::black : colorTable[border.color]; + TQColor &c = ((uint)border.color >= colorTable.count()) + ? (TQColor &)TQt::black : colorTable[border.color]; frameSets.addBorder( (int)id[i], c, (int)border.style & 0x0f, .05*(!border.width ? 10 : border.width) ); } @@ -2593,7 +2593,7 @@ void RTFImport::finishTable() // Frame background color if ((uint)row.cells[k].bgcolor < colorTable.count()) { - QColor &color = colorTable[row.cells[k].bgcolor]; + TQColor &color = colorTable[row.cells[k].bgcolor]; frameSets.setAttribute( "bkRed", color.red() ); frameSets.setAttribute( "bkGreen", color.green() ); frameSets.setAttribute( "bkBlue", color.blue() ); @@ -2615,8 +2615,8 @@ void RTFImport::writeOutPart( const char *name, const DomNode& node ) KoStoreDevice* dev = m_chain->storageFile( name, KoStore::Write ); if ( dev ) { - QTextStream stream( dev ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( dev ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << node.toString(); } else diff --git a/filters/kword/rtf/import/rtfimport.h b/filters/kword/rtf/import/rtfimport.h index 538a4c23..fd39b435 100644 --- a/filters/kword/rtf/import/rtfimport.h +++ b/filters/kword/rtf/import/rtfimport.h @@ -16,19 +16,19 @@ #define __RTFIMPORT_H__ #include <KoFilter.h> -#include <qasciidict.h> -#include <qcolor.h> -#include <qcstring.h> -#include <qfile.h> -#include <qfont.h> -#include <qmap.h> -#include <qstring.h> -#include <qvaluelist.h> -#include <qvaluestack.h> -#include <qtextcodec.h> +#include <tqasciidict.h> +#include <tqcolor.h> +#include <tqcstring.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqvaluestack.h> +#include <tqtextcodec.h> #include "rtfimport_dom.h" #include "rtfimport_tokenizer.h" -#include <qptrlist.h> +#include <tqptrlist.h> class DomNode; @@ -92,8 +92,8 @@ struct RTFTab /// Font table entry struct RTFFont { - QString name; - QFont::StyleHint styleHint; + TQString name; + TQFont::StyleHint tqstyleHint; int fixedPitch; int number; }; @@ -103,7 +103,7 @@ struct RTFPicture { enum PictureType { BMP, WMF, MacPict, EMF, PNG, JPEG }; - QByteArray bits; + TQByteArray bits; PictureType type; int width, height; int cropLeft, cropTop, cropRight, cropBottom; @@ -112,7 +112,7 @@ struct RTFPicture int nibble; bool scaled; /// \\blipuid - QString identifier; + TQString identifier; }; /// Paragraph-formatting properties @@ -120,11 +120,11 @@ struct RTFLayout { enum Alignment { Left, Right, Justified, Centered }; - QValueStack<RTFTab> tablist; + TQValueStack<RTFTab> tablist; RTFTab tab; RTFBorder borders[4]; RTFBorder *border; - Alignment alignment; + Alignment tqalignment; int style; int firstIndent, leftIndent, rightIndent; int spaceBefore, spaceAfter; @@ -171,9 +171,9 @@ inline bool operator != ( const RTFFormat& f1, const RTFFormat& f2 ) /// Style sheet entry struct RTFStyle { - QString name; + TQString name; RTFFormat format; - RTFLayout layout; + RTFLayout tqlayout; int next; }; @@ -196,9 +196,9 @@ struct RTFTableCell /// Table-formatting properties struct RTFTableRow { - QValueList<RTFTableCell> cells; - QStringList frameSets; - RTFLayout::Alignment alignment; + TQValueList<RTFTableCell> cells; + TQStringList frameSets; + RTFLayout::Alignment tqalignment; int height; int left; }; @@ -207,7 +207,7 @@ struct RTFTableRow struct KWFormat { RTFFormat fmt; - QString xmldata; + TQString xmldata; uint id, pos, len; }; @@ -220,9 +220,9 @@ struct RTFTextState DomNode cell; /// plain text (for paragraph or table cell) DomNode text; - QValueList<KWFormat> formats; - QStringList frameSets; - QValueList<RTFTableRow> rows; + TQValueList<KWFormat> formats; + TQStringList frameSets; + TQValueList<RTFTableRow> rows; uint table, length; }; @@ -232,7 +232,7 @@ struct RTFGroupState RTFTableRow tableRow; RTFTableCell tableCell; RTFFormat format; - RTFLayout layout; + RTFLayout tqlayout; RTFSectionLayout section; /// '}' will close the current destination bool brace0; @@ -244,9 +244,10 @@ struct RTFGroupState class RTFImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - RTFImport( KoFilter *parent, const char *name, const QStringList& ); + RTFImport( KoFilter *tqparent, const char *name, const TQStringList& ); /** * Convert document from RTF to KWord format. @@ -254,7 +255,7 @@ public: * @param to the mimetype for KWord * @return true if the document was successfully converted */ - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); /** * Skip the keyword, as we do not need to do anything with it @@ -281,7 +282,7 @@ public: void setPcaCodepage( RTFProperty * ); /** * Set document codepage to IBM 435. - * @note As Qt does not support IBM 435, this is currently approximated as IBM 850 + * @note As TQt does not support IBM 435, this is currently approximated as IBM 850 */ void setPcCodepage( RTFProperty * ); /** @@ -407,7 +408,7 @@ public: void insertSymbol( RTFProperty *property ); /// Insert special character (hexadecimal escape value). void insertHexSymbol( RTFProperty * ); - /// Insert unicode character (keyword \\u). + /// Insert tqunicode character (keyword \\u). void insertUnicodeSymbol( RTFProperty * ); /** * Insert a date or time field @@ -488,27 +489,27 @@ public: */ void addFormat( DomNode &node, const KWFormat& format, const RTFFormat* baseFormat ); /** - * Add layout information to document node. + * Add tqlayout information to document node. * @param node the document node (destination) * @param name the name of the current style - * @param layout the paragraph layout information + * @param tqlayout the paragraph tqlayout information * @param frameBreak paragraph is always the last in a frame if true */ - void addLayout( DomNode &node, const QString &name, const RTFLayout &layout, bool frameBreak ); + void addLayout( DomNode &node, const TQString &name, const RTFLayout &tqlayout, bool frameBreak ); /** * Add paragraph information to document node. * @param node the document node (destination) * @param frameBreak paragraph is always the last in a frame if true */ void addParagraph( DomNode &node, bool frameBreak ); - void addVariable(const DomNode& spec, int type, const QString& key, const RTFFormat* fmt=0); - void addImportedPicture( const QString& rawFileName ); + void addVariable(const DomNode& spec, int type, const TQString& key, const RTFFormat* fmt=0); + void addImportedPicture( const TQString& rawFileName ); /** * Add a date/time field and split it for KWord * @param format format of the date/time * @param isDate is it a date field? (For the default format, if needed) */ - void addDateTime( const QString& format, const bool isDate, RTFFormat& fmt ); + void addDateTime( const TQString& format, const bool isDate, RTFFormat& fmt ); /** * Finish table and recalculate cell borders. */ @@ -526,7 +527,7 @@ public: DomNode pictures; DomNode author, company, title, doccomm; RTFTextState bodyText; - QPtrList<RTFTextState> footnotes; ///< list of footnotes + TQPtrList<RTFTextState> footnotes; ///< list of footnotes int fnnum; ///< number of last footnote RTFTextState firstPageHeader, oddPagesHeader, evenPagesHeader; RTFTextState firstPageFooter, oddPagesFooter, evenPagesFooter; @@ -535,11 +536,11 @@ public: * @note this is mainly to avoid dangling or NULL pointers */ RTFTextState m_dummyTextState; - QMap<int,QString> fontTable; - QValueList<RTFStyle> styleSheet; - QValueList<QColor> colorTable; - QValueStack<RTFGroupState> stateStack; - QValueStack<RTFDestination> destinationStack; + TQMap<int,TQString> fontTable; + TQValueList<RTFStyle> styleSheet; + TQValueList<TQColor> colorTable; + TQValueStack<RTFGroupState> stateStack; + TQValueStack<RTFDestination> destinationStack; RTFGroupState state; RTFDestination destination; RTFTextState *textState; @@ -548,8 +549,8 @@ public: RTFPicture picture; RTFTableCell emptyCell; KWFormat kwFormat; - QAsciiDict<RTFProperty> properties; - QAsciiDict<RTFProperty> destinationProperties; + TQAsciiDict<RTFProperty> properties; + TQAsciiDict<RTFProperty> destinationProperties; uint table; uint pictureNumber; ///< Picture number; increase *before* use! @@ -561,14 +562,14 @@ public: bool landscape, facingPages; // Field support - QCString fldinst, fldrslt; + TQCString fldinst, fldrslt; RTFFormat fldfmt; int flddst; ///< support for recursive fields - QString inFileName; ///< File name of the source file. + TQString inFileName; ///< File name of the source file. protected: - QTextCodec* textCodec; ///< currently used QTextCodec by the RTF file - QTextCodec* utf8TextCodec; ///< QTextCodec for UTF-8 (used in \u) - QMap<QString,int> debugUnknownKeywords; + TQTextCodec* textCodec; ///< currently used TQTextCodec by the RTF file + TQTextCodec* utf8TextCodec; ///< TQTextCodec for UTF-8 (used in \u) + TQMap<TQString,int> debugUnknownKeywords; bool m_batch; ///< Should the filter system be in batch mode (i.e. non-interactive) }; diff --git a/filters/kword/rtf/import/rtfimport_dom.cpp b/filters/kword/rtf/import/rtfimport_dom.cpp index 48ee8606..9794e088 100644 --- a/filters/kword/rtf/import/rtfimport_dom.cpp +++ b/filters/kword/rtf/import/rtfimport_dom.cpp @@ -11,9 +11,9 @@ #include <stdio.h> -#include <qdatetime.h> -#include <qtextcodec.h> -#include <qcolor.h> +#include <tqdatetime.h> +#include <tqtextcodec.h> +#include <tqcolor.h> #include <kdebug.h> @@ -22,22 +22,22 @@ /** * Escape the special XML characters and be careful to catch any unallowed control character */ -QString CheckAndEscapeXmlText(const QString& strText) +TQString CheckAndEscapeXmlText(const TQString& strText) { - QString strReturn(strText); - QChar ch; + TQString strReturn(strText); + TQChar ch; for (uint i=0; i<strReturn.length(); i++) { ch = strReturn[i]; - const int test = ch.unicode(); + const int test = ch.tqunicode(); // The i+= is for the additional characters - if (test == 38) { strReturn.replace(i, 1, "&"); i+=4; } // & - else if (test == 60) { strReturn.replace(i, 1, "<"); i+=3; } // < - else if (test == 62) { strReturn.replace(i, 1, ">"); i+=3; } // > - else if (test == 34) { strReturn.replace(i, 1, """); i+=5; } // " - else if (test == 39) { strReturn.replace(i, 1, "'"); i+=5; } // ' + if (test == 38) { strReturn.tqreplace(i, 1, "&"); i+=4; } // & + else if (test == 60) { strReturn.tqreplace(i, 1, "<"); i+=3; } // < + else if (test == 62) { strReturn.tqreplace(i, 1, ">"); i+=3; } // > + else if (test == 34) { strReturn.tqreplace(i, 1, """); i+=5; } // " + else if (test == 39) { strReturn.tqreplace(i, 1, "'"); i+=5; } // ' else if (test >= 32) continue; // Normal character (from space on) else if ((test == 9) || (test == 10) || (test == 13) ) continue; // Allowed control characters: TAB, LF, CR else @@ -47,7 +47,7 @@ QString CheckAndEscapeXmlText(const QString& strText) // - could be not supported encoding. // In any case, we must replace this character. kdDebug(30515) << "Control character in XML stream: " << test << endl; - strReturn.replace(i, 1, '?'); // Replacement character + strReturn.tqreplace(i, 1, '?'); // Replacement character } } @@ -81,7 +81,7 @@ DomNode::DomNode( const char *doctype ) */ void DomNode::clear( int level ) { - str = QString::null; + str = TQString(); documentLevel = level; hasChildren = true; hasAttributes = false; @@ -104,13 +104,13 @@ void DomNode::addNode( const char *name ) * Adds a text node. * @param text the text to write into the document node */ -void DomNode::addTextNode( const char *text, QTextCodec* codec ) +void DomNode::addTextNode( const char *text, TQTextCodec* codec ) { closeTag( false ); if (!codec) { - kdError(30515) << "No QTextCodec available!" << endl; + kdError(30515) << "No TQTextCodec available!" << endl; return; } @@ -121,7 +121,7 @@ void DomNode::addTextNode( const char *text, QTextCodec* codec ) /** * Add border to existing frameset (see KWord DTD). */ -void DomNode::addBorder( int id, const QColor &color, int style, double width ) +void DomNode::addBorder( int id, const TQColor &color, int style, double width ) { char attr[16]; sprintf( attr, "%cRed", id ); @@ -140,7 +140,7 @@ void DomNode::addBorder( int id, const QColor &color, int style, double width ) * Add color attributes to document node. * @param color the color */ -void DomNode::addColor( const QColor &color ) +void DomNode::addColor( const TQColor &color ) { setAttribute( "red", color.red() ); setAttribute( "green", color.green() ); @@ -164,10 +164,10 @@ void DomNode::addRect( int left, int top, int right, int bottom ) * @param filename the filename of the image * @param name the relative path to the image in the store (optional) */ -void DomNode::addKey( const QDateTime& dt, const QString& filename, const QString& name ) +void DomNode::addKey( const TQDateTime& dt, const TQString& filename, const TQString& name ) { - const QDate date ( dt.date() ); - const QTime time ( dt.time() ); + const TQDate date ( dt.date() ); + const TQTime time ( dt.time() ); addNode( "KEY" ); setAttribute( "filename", CheckAndEscapeXmlText(filename) ); @@ -218,7 +218,7 @@ void DomNode::addFrame( int left, int top, int right, int bottom, /** * Sets a new attribute to a string value. */ -void DomNode::setAttribute( const QString& attribute, const QString& value ) +void DomNode::setAttribute( const TQString& attribute, const TQString& value ) { str += ' '; str += attribute; @@ -304,7 +304,7 @@ void DomNode::closeTag( bool nl ) */ void DomNode::appendNode( const DomNode &child ) { - const QString childStr ( child.toString() ); + const TQString childStr ( child.toString() ); closeTag( (childStr.length() >= 2 && (childStr[0] == '<' || childStr[1] == '<')) ); str += childStr; } @@ -312,14 +312,14 @@ void DomNode::appendNode( const DomNode &child ) /** * Appends XML text to node */ -void DomNode::append( const QString& _str) +void DomNode::append( const TQString& _str) { str += _str; } -void DomNode::append( const QCString& cstr) +void DomNode::append( const TQCString& cstr) { - str += QString::fromUtf8(cstr); + str += TQString::fromUtf8(cstr); } void DomNode::append( const char ch) @@ -338,7 +338,7 @@ bool DomNode::isEmpty( void ) const /** * Returns the data of the document node. */ -QString DomNode::toString( void ) const +TQString DomNode::toString( void ) const { return str; } diff --git a/filters/kword/rtf/import/rtfimport_dom.h b/filters/kword/rtf/import/rtfimport_dom.h index d5d85a40..f6717174 100644 --- a/filters/kword/rtf/import/rtfimport_dom.h +++ b/filters/kword/rtf/import/rtfimport_dom.h @@ -12,16 +12,16 @@ #ifndef __RTFIMPORT_DOM_H__ #define __RTFIMPORT_DOM_H__ -#include <qstring.h> +#include <tqstring.h> -class QColor; -class QDateTime; -class QTextCodec; +class TQColor; +class TQDateTime; +class TQTextCodec; /** * Escape the special XML characters and be careful to catch any unallowed control character */ -QString CheckAndEscapeXmlText(const QString& strText); +TQString CheckAndEscapeXmlText(const TQString& strText); class DomNode { @@ -46,16 +46,16 @@ public: * Adds a text node. * @param text the text to write into the document node */ - void addTextNode( const char *text, QTextCodec* codec ); + void addTextNode( const char *text, TQTextCodec* codec ); /** * Add border to existing frameset (see KWord DTD). */ - void addBorder( int id, const QColor &color, int style, double width ); + void addBorder( int id, const TQColor &color, int style, double width ); /** * Add color attributes to document node. * @param color the color */ - void addColor( const QColor &color ); + void addColor( const TQColor &color ); /** * Add rectangle attributes to document node. */ @@ -66,7 +66,7 @@ public: * @param filename the filename of the image * @param name the relative path to the image in the store (optional) */ - void addKey( const QDateTime& dt, const QString& filename, const QString& name = QString::null ); + void addKey( const TQDateTime& dt, const TQString& filename, const TQString& name = TQString() ); /** * Add frameset to document (see KWord DTD). */ @@ -80,7 +80,7 @@ public: /** * Sets a new attribute to a string value. */ - void setAttribute( const QString& attribute, const QString& value ); + void setAttribute( const TQString& attribute, const TQString& value ); /** * Sets a new attribute to an integer value. */ @@ -107,8 +107,8 @@ public: /** * Appends XML text to node */ - void append( const QCString& cstr); - void append( const QString& _str); + void append( const TQCString& cstr); + void append( const TQString& _str); void append( const char ch); /** * Returns true if node is empty. @@ -117,10 +117,10 @@ public: /** * Returns the data of the document node. */ - QString toString() const; + TQString toString() const; private: - QString str; + TQString str; int documentLevel; bool hasChildren; bool hasAttributes; diff --git a/filters/kword/rtf/import/rtfimport_tokenizer.cpp b/filters/kword/rtf/import/rtfimport_tokenizer.cpp index 3e255c47..b9a0a567 100644 --- a/filters/kword/rtf/import/rtfimport_tokenizer.cpp +++ b/filters/kword/rtf/import/rtfimport_tokenizer.cpp @@ -26,7 +26,7 @@ RTFTokenizer::RTFTokenizer() * Open tokenizer from file. * @param in the input file */ -void RTFTokenizer::open( QFile *in ) +void RTFTokenizer::open( TQFile *in ) { fileBufferPtr = 0L; fileBufferEnd = 0L; diff --git a/filters/kword/rtf/import/rtfimport_tokenizer.h b/filters/kword/rtf/import/rtfimport_tokenizer.h index 424a26b2..f32a2bc8 100644 --- a/filters/kword/rtf/import/rtfimport_tokenizer.h +++ b/filters/kword/rtf/import/rtfimport_tokenizer.h @@ -12,8 +12,8 @@ #ifndef __RTFIMPORT_TOKENIZER_H__ #define __RTFIMPORT_TOKENIZER_H__ -#include <qcstring.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqfile.h> /// This class represents the tokenizer and the token @@ -28,7 +28,7 @@ public: * Open tokenizer from file. * @param in the input file */ - void open( QFile *in ); + void open( TQFile *in ); /** * Reads the next token. */ @@ -46,15 +46,15 @@ public: public: /// Binary data (of \\bin keyword) - QByteArray binaryData; + TQByteArray binaryData; // tokenizer (private) data private: int nextChar(); - QFile *infile; - QByteArray fileBuffer; - QCString tokenText; + TQFile *infile; + TQByteArray fileBuffer; + TQCString tokenText; uchar *fileBufferPtr; uchar *fileBufferEnd; }; diff --git a/filters/kword/rtf/status.html b/filters/kword/rtf/status.html index 73204a6b..27239e52 100644 --- a/filters/kword/rtf/status.html +++ b/filters/kword/rtf/status.html @@ -52,14 +52,14 @@ - Document information (author, title, comments, company).<br> - Page size and margins.<br> - Headers and footers (with margins).<br> - - Tables (including non-rectangular), horizontal alignment.<br> + - Tables (including non-rectangular), horizontal tqalignment.<br> - Table cell background color and borders (style, color, width).<br> - Embedded pictures (JPEG/PNG/BMP) and clipart (EMF/WMF).<br> - Word 97-2000 picture support.<br> - Style sheet.<br> - Character formatting (size, color, bold, italic, underline, strikeout, subscript, superscript...).<br> - - Font mapping (using QFont/QFontInfo).<br> - - Paragraph layout (horizontal alignment, indents, space before/after, frame break).<br> + - Font mapping (using TQFont/TQFontInfo).<br> + - Paragraph tqlayout (horizontal tqalignment, indents, space before/after, frame break).<br> - Paragraph borders (style, color, width).<br> - Tabulators, automatic tabulator for hanging indent.<br> - Unicode and codepages support.<br> @@ -76,16 +76,16 @@ - Fix line spacing.<br> - Columns.<br> - Improve list handling.<br> - - Shaps, especially picture that are in shapes<br> + - Shaps, especially picture that are in tqshapes<br> </td> </tr> <tr BGCOLOR="#CCCCFF"> <td VALIGN=TOP><b><font size="+1">History</font></b></td> <td> - 15 July 2001: First useful version (rewritten for QDom).<br> + 15 July 2001: First useful version (rewritten for TQDom).<br> 18 July 2001: Fixed function <code>finishTable()</code> (some tables crashed KWord).<br> - 23 July 2001: Added table alignment, background color and cell borders.<br> + 23 July 2001: Added table tqalignment, background color and cell borders.<br> 31 August 2001: Faster version, uses read buffers and optimized XML output.<br> 2 October 2001: Clipart import fixed (requires libwmf).<br> 23 July 2002: Added field and hyperlink support, fixed embedded pictures.<br> diff --git a/filters/kword/starwriter/pole.cpp b/filters/kword/starwriter/pole.cpp index 9323cdbc..96b3e82c 100644 --- a/filters/kword/starwriter/pole.cpp +++ b/filters/kword/starwriter/pole.cpp @@ -31,12 +31,12 @@ namespace POLE class Entry { public: - Entry* parent; + Entry* tqparent; std::string name; unsigned long size; unsigned start; bool dir; - std::vector<Entry*> children; + std::vector<Entry*> tqchildren; Entry(); ~Entry(); private: @@ -153,7 +153,7 @@ class StorageIO unsigned long loadSmallBlock( unsigned long block, unsigned char* buffer, unsigned long maxlen ); /// construct directory tree - Entry* buildTree( Entry* parent, int index, const unsigned char* dirent ); + Entry* buildTree( Entry* tqparent, int index, const unsigned char* dirent ); std::string fullName( Entry* e ); @@ -257,9 +257,9 @@ Entry::Entry() Entry::~Entry() { - for( unsigned i=0; i<children.size(); i++ ) + for( unsigned i=0; i<tqchildren.size(); i++ ) { - Entry* entry = children[ i ]; + Entry* entry = tqchildren[ i ]; delete entry; } } @@ -619,7 +619,7 @@ unsigned long StorageIO::loadSmallBlock( unsigned long block, } // recursive function to construct directory tree -Entry* StorageIO::buildTree( Entry* parent, int index, const unsigned char* dirent ) +Entry* StorageIO::buildTree( Entry* tqparent, int index, const unsigned char* dirent ) { Entry* entry = (Entry*) 0L; @@ -656,12 +656,12 @@ Entry* StorageIO::buildTree( Entry* parent, int index, const unsigned char* dire entry->size = readU32( dirent + 0x78+p ); // append as another child - entry->parent = parent; - if( parent ) parent->children.push_back( entry ); + entry->tqparent = tqparent; + if( tqparent ) tqparent->tqchildren.push_back( entry ); // check previous int prev = readU32( dirent + 0x44+p ); - if( prev >= 0 ) buildTree( parent, prev, dirent ); + if( prev >= 0 ) buildTree( tqparent, prev, dirent ); // traverse to sub int dir = readU32( dirent + 0x4C+p ); @@ -670,7 +670,7 @@ Entry* StorageIO::buildTree( Entry* parent, int index, const unsigned char* dire // check next int next = readU32( dirent + 0x48+p ); - if( next >= 0 ) buildTree( parent, next, dirent ); + if( next >= 0 ) buildTree( tqparent, next, dirent ); return entry; } @@ -681,11 +681,11 @@ std::string StorageIO::fullName( Entry* e ) std::string result; - while( e->parent ) + while( e->tqparent ) { result.insert( 0, e->name ); result.insert( 0, "/" ); - e = e->parent; + e = e->tqparent; } // don't use specified root name (like "Root Entry") @@ -725,9 +725,9 @@ Entry* StorageIO::entry( const std::string& name ) std::string entryname = *it; Entry *child = (Entry*) 0L; if( entry->dir ) - for( unsigned j=0; j < entry->children.size(); j++ ) - if( entry->children[j]->name == entryname ) - child = entry->children[j]; + for( unsigned j=0; j < entry->tqchildren.size(); j++ ) + if( entry->tqchildren[j]->name == entryname ) + child = entry->tqchildren[j]; if( !child ) return (Entry*) 0L; entry = child; } @@ -750,7 +750,7 @@ StreamIO::StreamIO( StorageIO* _io, Entry* _entry ): updateCache(); } -// FIXME tell parent we're gone +// FIXME tell tqparent we're gone StreamIO::~StreamIO() { delete[] cache_data; @@ -912,10 +912,10 @@ std::list<std::string> Storage::listDirectory() // sentinel: do nothing if not a directory if( !io->current_dir->dir ) return entries; - // find all children belongs to this directory - for( unsigned i = 0; i<io->current_dir->children.size(); i++ ) + // find all tqchildren belongs to this directory + for( unsigned i = 0; i<io->current_dir->tqchildren.size(); i++ ) { - Entry* e = io->current_dir->children[i]; + Entry* e = io->current_dir->tqchildren[i]; if( e ) entries.push_back( e->name ); } @@ -930,9 +930,9 @@ bool Storage::enterDirectory( const std::string& directory ) if( !io->current_dir ) return false; // look for the specified sub-dir - for( unsigned i = 0; i<io->current_dir->children.size(); i++ ) + for( unsigned i = 0; i<io->current_dir->tqchildren.size(); i++ ) { - Entry* e = io->current_dir->children[i]; + Entry* e = io->current_dir->tqchildren[i]; if( e ) if( e->name == directory ) if ( e->dir ) { @@ -951,9 +951,9 @@ void Storage::leaveDirectory() if( !io ) return; if( !io->current_dir ) return; - Entry* parent = io->current_dir->parent; - if( parent ) if( parent->dir ) - io->current_dir = parent; + Entry* tqparent = io->current_dir->tqparent; + if( tqparent ) if( tqparent->dir ) + io->current_dir = tqparent; } // note: without trailing "/" @@ -993,7 +993,7 @@ Stream::Stream( StreamIO* _io ): { } -// FIXME tell parent we're gone +// FIXME tell tqparent we're gone Stream::~Stream() { delete io; diff --git a/filters/kword/starwriter/starwriterimport.cc b/filters/kword/starwriter/starwriterimport.cc index b43415c0..a9bd80d3 100644 --- a/filters/kword/starwriter/starwriterimport.cc +++ b/filters/kword/starwriter/starwriterimport.cc @@ -21,9 +21,9 @@ #include <starwriterimport.h> -#include <qdatastream.h> -#include <qiodevice.h> -#include <qstring.h> +#include <tqdatastream.h> +#include <tqiodevice.h> +#include <tqstring.h> #include <KoFilterChain.h> #include <kgenericfactory.h> @@ -34,20 +34,20 @@ typedef KGenericFactory<StarWriterImport, KoFilter> StarWriterImportFactory; K_EXPORT_COMPONENT_FACTORY(libstarwriterimport, StarWriterImportFactory("kofficefilters")) // Get unsigned 24-bits integer at given offset -static inline Q_UINT32 readU24(QByteArray array, Q_UINT32 p) +static inline TQ_UINT32 readU24(TQByteArray array, TQ_UINT32 p) { - Q_UINT8* ptr = (Q_UINT8*) array.data(); - return (Q_UINT32) (ptr[p] + (ptr[p+1] << 8) + (ptr[p+2] << 16)); + TQ_UINT8* ptr = (TQ_UINT8*) array.data(); + return (TQ_UINT32) (ptr[p] + (ptr[p+1] << 8) + (ptr[p+2] << 16)); } // Get unsigned 16-bits integer at given offset -static inline Q_UINT16 readU16(QByteArray array, Q_UINT32 p) +static inline TQ_UINT16 readU16(TQByteArray array, TQ_UINT32 p) { - Q_UINT8* ptr = (Q_UINT8*) array.data(); - return (Q_UINT16) (ptr[p] + (ptr[p+1] << 8)); + TQ_UINT8* ptr = (TQ_UINT8*) array.data(); + return (TQ_UINT16) (ptr[p] + (ptr[p+1] << 8)); } -StarWriterImport::StarWriterImport(KoFilter *, const char *, const QStringList&) : KoFilter() +StarWriterImport::StarWriterImport(KoFilter *, const char *, const TQStringList&) : KoFilter() { hasHeader = false; hasFooter = false; @@ -58,7 +58,7 @@ StarWriterImport::~StarWriterImport() { } -KoFilter::ConversionStatus StarWriterImport::convert(const QCString& from, const QCString& to) +KoFilter::ConversiontqStatus StarWriterImport::convert(const TQCString& from, const TQCString& to) { // Check for proper conversion // When 4.x is supported, use also: || (from != "application/x-starwriter") @@ -99,7 +99,7 @@ KoFilter::ConversionStatus StarWriterImport::convert(const QCString& from, const // Prepare storage device and return KoStoreDevice *out = m_chain->storageFile("maindoc.xml", KoStore::Write); if (out) { - QCString cstring = maindoc.utf8(); + TQCString cstring = maindoc.utf8(); cstring.prepend("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); out->writeBlock((const char*) cstring, cstring.length()); } @@ -129,7 +129,7 @@ bool StarWriterImport::checkDocumentVersion() if (StarWriterDocument[0x05] != 'R') return false; // Password-protection is not supported for the moment - Q_UINT16 flags = readU16(StarWriterDocument, 0x0A); + TQ_UINT16 flags = readU16(StarWriterDocument, 0x0A); if (flags & 0x0008) return false; return true; @@ -138,7 +138,7 @@ bool StarWriterImport::checkDocumentVersion() bool StarWriterImport::addKWordHeader() { // Proper prolog and epilog - QString prolog; + TQString prolog; prolog = "<!DOCTYPE DOC>\n"; prolog.append("<DOC mime=\"application/x-kword\" syntaxVersion=\"2\" editor=\"KWord\">\n"); prolog.append("<PAPER width=\"595\" height=\"841\" format=\"1\" fType=\"0\" orientation=\"0\" hType=\"0\" columns=\"1\">\n"); @@ -183,8 +183,8 @@ bool StarWriterImport::addBody() { // Find the starting point, by: // 1. skipping the header - Q_UINT32 len = StarWriterDocument[0x07]; - Q_UINT32 p = len; + TQ_UINT32 len = StarWriterDocument[0x07]; + TQ_UINT32 p = len; // 2. skipping 8 more bytes p += 0x08; @@ -199,8 +199,8 @@ bool StarWriterImport::addBody() // Select nodes and pass them to parseNodes() len = readU24(StarWriterDocument, p+1); - QByteArray data(len); - for (Q_UINT32 k=0; k<len; k++) + TQByteArray data(len); + for (TQ_UINT32 k=0; k<len; k++) data[k] = StarWriterDocument[p+k]; bool retval = parseNodes(data); @@ -212,11 +212,11 @@ bool StarWriterImport::addBody() return retval; } -QString StarWriterImport::convertToKWordString(QByteArray s) +TQString StarWriterImport::convertToKWordString(TQByteArray s) { - QString result; + TQString result; - for (Q_UINT32 i = 0x00; i < s.size(); i++) + for (TQ_UINT32 i = 0x00; i < s.size(); i++) if (s[i] == '&') result += "&"; else if (s[i] == '<') result += "<"; else if (s[i] == '>') result += ">"; @@ -225,15 +225,15 @@ QString StarWriterImport::convertToKWordString(QByteArray s) else if (s[i] == 0x09) result += "\t"; // FIXME: more to add here // (manual breaks, soft-hyphens, non-breaking spaces, variables) - else result += QChar(s[i]); + else result += TQChar(s[i]); return result; } -bool StarWriterImport::parseNodes(QByteArray n) +bool StarWriterImport::parseNodes(TQByteArray n) { - QByteArray s; - Q_UINT32 len, p; + TQByteArray s; + TQ_UINT32 len, p; // Loop p = 0x09; // is this a fixed value? is it the same for headers/footers? @@ -243,7 +243,7 @@ bool StarWriterImport::parseNodes(QByteArray n) len = readU24(n, p+1); s.resize(len); - for (Q_UINT32 k = 0x00; k < len; k++) + for (TQ_UINT32 k = 0x00; k < len; k++) s[k] = n[p+k]; switch (c) { @@ -267,20 +267,20 @@ bool StarWriterImport::parseNodes(QByteArray n) return true; } -bool StarWriterImport::parseText(QByteArray n) +bool StarWriterImport::parseText(TQByteArray n) { - QByteArray s; - Q_UINT16 len; - Q_UINT32 p; - QString text; - // Q_UINT16 attributeStart, attributeEnd, formatPos, formatLen; - // QString pAttributes, cAttributes, tempCAttributes; - // QStringList cAttributesList; + TQByteArray s; + TQ_UINT16 len; + TQ_UINT32 p; + TQString text; + // TQ_UINT16 attributeStart, attributeEnd, formatPos, formatLen; + // TQString pAttributes, cAttributes, tempCAttributes; + // TQStringList cAttributesList; // Retrieve the paragraph (text-only) len = readU16(n, 0x09); s.resize(len); - for (Q_UINT16 k = 0x00; k < len; k++) + for (TQ_UINT16 k = 0x00; k < len; k++) s[k] = n[0x0B+k]; /* @@ -333,19 +333,19 @@ bool StarWriterImport::parseText(QByteArray n) return true; } -bool StarWriterImport::parseTable(QByteArray n) +bool StarWriterImport::parseTable(TQByteArray n) { /* - QByteArray s; - Q_UINT32 len, len2; - Q_UINT16 len3; - Q_UINT32 p, p2; - QString text; - QString tableCell, tableText, tableName; - Q_UINT8 row, column; + TQByteArray s; + TQ_UINT32 len, len2; + TQ_UINT16 len3; + TQ_UINT32 p, p2; + TQString text; + TQString tableCell, tableText, tableName; + TQ_UINT8 row, column; // Set table name - tableName = QString("Table %1").arg(tablesNumber); + tableName = TQString("Table %1").tqarg(tablesNumber); tablesNumber++; // Skip useless sections and retrieve the right point @@ -376,13 +376,13 @@ bool StarWriterImport::parseTable(QByteArray n) // Get cell text/value len3 = readU16(n, p+0x09); s.resize(len3); - for (Q_UINT16 k = 0x00; k < len3; k++) + for (TQ_UINT16 k = 0x00; k < len3; k++) s[k] = n[p+0x0B+k]; text = convertToKWordString(s); // FIXME: check this stuff - QString frameName = QString("%1 Cell %2,%3").arg(tableName).arg(row).arg(column); - tableText.append(QString(" <FRAMESET name=\"%1\" frameType=\"1\" frameInfo=\"0\" removable=\"0\" visible=\"1\" grpMgr=\"%2\" row=\"%3\" col=\"%4\" rows=\"1\" cols=\"1\" protectSize=\"0\">\n").arg(frameName).arg(tableName).arg(row).arg(column)); + TQString frameName = TQString("%1 Cell %2,%3").tqarg(tableName).tqarg(row).tqarg(column); + tableText.append(TQString(" <FRAMESET name=\"%1\" frameType=\"1\" frameInfo=\"0\" removable=\"0\" visible=\"1\" grpMgr=\"%2\" row=\"%3\" col=\"%4\" rows=\"1\" cols=\"1\" protectSize=\"0\">\n").tqarg(frameName).tqarg(tableName).tqarg(row).tqarg(column)); tableText.append(" <FRAME runaround=\"1\" copy=\"0\" newFrameBehavior=\"1\" runaroundSide=\"biggest\" autoCreateNewFrame=\"0\" bleftpt=\"2.8\" brightpt=\"2.8\" btoppt=\"2.8\" bbottompt=\"2.8\" runaroundGap=\"2.8\" />\n"); tableText.append(" <PARAGRAPH>\n"); tableText.append(" <TEXT xml:space=\"preserve\">" + text + "</TEXT>\n"); @@ -408,7 +408,7 @@ bool StarWriterImport::parseTable(QByteArray n) bodyStuff.append(" <TEXT xml:space=\"preserve\">#</TEXT>\n"); bodyStuff.append(" <FORMATS>\n"); bodyStuff.append(" <FORMAT id=\"6\" pos=\"0\" len=\"1\">\n"); - bodyStuff.append(QString(" <ANCHOR type=\"frameset\" instance=\"%1\" />\n").arg(tableName)); + bodyStuff.append(TQString(" <ANCHOR type=\"frameset\" instance=\"%1\" />\n").tqarg(tableName)); bodyStuff.append(" </FORMAT>\n"); bodyStuff.append(" </FORMATS>\n"); bodyStuff.append(" </PARAGRAPH>\n"); @@ -417,7 +417,7 @@ bool StarWriterImport::parseTable(QByteArray n) return true; } -bool StarWriterImport::parseGraphics(QByteArray n) +bool StarWriterImport::parseGraphics(TQByteArray n) { return true; } diff --git a/filters/kword/starwriter/starwriterimport.h b/filters/kword/starwriter/starwriterimport.h index 8bc036ce..acb91a02 100644 --- a/filters/kword/starwriter/starwriterimport.h +++ b/filters/kword/starwriter/starwriterimport.h @@ -23,26 +23,27 @@ #define __STARWRITERIMPORT_H #include <KoFilter.h> -#include <qstring.h> -#include <qcstring.h> +#include <tqstring.h> +#include <tqcstring.h> class StarWriterImport: public KoFilter { Q_OBJECT + TQ_OBJECT public: - StarWriterImport(KoFilter *parent, const char *name, const QStringList&); + StarWriterImport(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~StarWriterImport(); - KoFilter::ConversionStatus convert(const QCString& from, const QCString& to); + KoFilter::ConversiontqStatus convert(const TQCString& from, const TQCString& to); private: // most important OLE streams - QByteArray SwPageStyleSheets; - QByteArray StarWriterDocument; + TQByteArray SwPageStyleSheets; + TQByteArray StarWriterDocument; // supplementary variables - Q_UINT8 tablesNumber; - QString bodyStuff, tablesStuff, picturesStuff; + TQ_UINT8 tablesNumber; + TQString bodyStuff, tablesStuff, picturesStuff; // needed for ATTRIBUTES bool hasHeader; @@ -58,16 +59,16 @@ private: bool addHeaders(); bool addFooters(); bool addBody(); - QString convertToKWordString(QByteArray s); + TQString convertToKWordString(TQByteArray s); // Node routines - bool parseNodes(QByteArray n); - bool parseText(QByteArray n); - bool parseTable(QByteArray n); - bool parseGraphics(QByteArray n); + bool parseNodes(TQByteArray n); + bool parseText(TQByteArray n); + bool parseTable(TQByteArray n); + bool parseGraphics(TQByteArray n); // finished KWord document - QString maindoc; + TQString maindoc; }; #endif diff --git a/filters/kword/starwriter/status.html b/filters/kword/starwriter/status.html index c6656c9c..6919c589 100644 --- a/filters/kword/starwriter/status.html +++ b/filters/kword/starwriter/status.html @@ -3,11 +3,11 @@ <HTML> <HEAD> <TITLE>StarWriter 5.x filter for KWord</TITLE> - <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> + <META HTTP-ETQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="GENERATOR" CONTENT="Quanta Plus"> </HEAD> <BODY> - <H2 align="center">Status of the</H2> + <H2 align="center">tqStatus of the</H2> <H1 align="center">StarWriter 5.x filter for KWord</H1> <P>Author: <A HREF="mailto:info@marcozanon.com">Marco Zanon</A> diff --git a/filters/kword/wml/wmlexport.cc b/filters/kword/wml/wmlexport.cc index 31a44468..92908c57 100644 --- a/filters/kword/wml/wmlexport.cc +++ b/filters/kword/wml/wmlexport.cc @@ -23,10 +23,10 @@ #include <unistd.h> #endif -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -47,19 +47,19 @@ class WMLWorker : public KWEFBaseWorker public: WMLWorker(void) { } virtual ~WMLWorker(void) { } - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); private: - QString filename; - QString result; + TQString filename; + TQString result; bool m_bold, m_italic, m_underline; }; -bool WMLWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool WMLWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { filename = filenameOut; return TRUE; @@ -67,11 +67,11 @@ bool WMLWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) bool WMLWorker::doCloseFile(void) { - QFile out( filename ); + TQFile out( filename ); if( !out.open( IO_WriteOnly ) ) return FALSE; - QTextStream stream; - stream.setDevice( &out ); + TQTextStream stream; + stream.setDevice( TQT_TQIODEVICE(&out) ); stream << result; return TRUE; } @@ -96,11 +96,11 @@ bool WMLWorker::doCloseDocument(void) return TRUE; } -bool WMLWorker::doFullParagraph(const QString& paraText, - const LayoutData& layout, const ValueListFormatData& paraFormatDataList) +bool WMLWorker::doFullParagraph(const TQString& paraText, + const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { - QString wmlText; - QString text = paraText; + TQString wmlText; + TQString text = paraText; ValueListFormatData::ConstIterator it; for( it = paraFormatDataList.begin(); it!=paraFormatDataList.end(); ++it ) @@ -110,7 +110,7 @@ bool WMLWorker::doFullParagraph(const QString& paraText, // only if the format is for text (id==1) if( formatData.id == 1 ) { - QString partialText; + TQString partialText; partialText = text.mid( formatData.pos, formatData.len ); // escape the text @@ -131,7 +131,7 @@ bool WMLWorker::doFullParagraph(const QString& paraText, } // sentinel check - QString align = layout.alignment.lower(); + TQString align = tqlayout.tqalignment.lower(); if( ( align!="left" ) && ( align!="right" ) && ( align!="center" ) ) align = "left"; @@ -140,13 +140,13 @@ bool WMLWorker::doFullParagraph(const QString& paraText, return TRUE; } -WMLExport::WMLExport( KoFilter *, const char *, const QStringList& ): +WMLExport::WMLExport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } -KoFilter::ConversionStatus WMLExport::convert( const QCString& from, - const QCString& to ) +KoFilter::ConversiontqStatus WMLExport::convert( const TQCString& from, + const TQCString& to ) { // check for proper conversion if( to!= "text/vnd.wap.wml" || from != "application/x-kword" ) @@ -155,7 +155,7 @@ KoFilter::ConversionStatus WMLExport::convert( const QCString& from, WMLWorker* worker = new WMLWorker(); KWEFKWordLeader* leader = new KWEFKWordLeader( worker ); - KoFilter::ConversionStatus result; + KoFilter::ConversiontqStatus result; result = leader->convert( m_chain, from, to ); delete worker; diff --git a/filters/kword/wml/wmlexport.h b/filters/kword/wml/wmlexport.h index 4ac7bf8e..0fbd4f45 100644 --- a/filters/kword/wml/wmlexport.h +++ b/filters/kword/wml/wmlexport.h @@ -26,15 +26,16 @@ class WMLExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - WMLExport(KoFilter *parent, const char *name, const QStringList&); + WMLExport(KoFilter *tqparent, const char *name, const TQStringList&); WMLExport(); virtual ~WMLExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __WMLEXPORT_H diff --git a/filters/kword/wml/wmlimport.cc b/filters/kword/wml/wmlimport.cc index 7ea2eabd..a9b5edc7 100644 --- a/filters/kword/wml/wmlimport.cc +++ b/filters/kword/wml/wmlimport.cc @@ -23,9 +23,9 @@ #include <unistd.h> #endif -#include <qfileinfo.h> -#include <qvaluelist.h> -#include <qfont.h> +#include <tqfileinfo.h> +#include <tqvaluelist.h> +#include <tqfont.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -38,7 +38,7 @@ typedef KGenericFactory<WMLImport, KoFilter> WMLImportFactory; K_EXPORT_COMPONENT_FACTORY( libwmlimport, WMLImportFactory( "kofficefilters" ) ) -WMLImport::WMLImport( KoFilter *, const char *, const QStringList& ): +WMLImport::WMLImport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } @@ -47,16 +47,16 @@ WMLImport::WMLImport( KoFilter *, const char *, const QStringList& ): class WMLConverter: public WMLParser { public: - QString root; - QString documentInfo; + TQString root; + TQString documentInfo; WMLConverter(); virtual void parse( const char* filename ); - virtual bool doOpenCard( QString, QString ); + virtual bool doOpenCard( TQString, TQString ); virtual bool doCloseCard(); - virtual bool doParagraph( QString text, WMLFormatList formatList, - WMLLayout layout ); + virtual bool doParagraph( TQString text, WMLFormatList formatList, + WMLLayout tqlayout ); private: - QString m_title; + TQString m_title; }; WMLConverter::WMLConverter() @@ -64,23 +64,23 @@ WMLConverter::WMLConverter() root = ""; } -static QString WMLFormatAsXML( WMLFormat format ) +static TQString WMLFormatAsXML( WMLFormat format ) { - QString result; + TQString result; if( format.href.isEmpty() ) { - QFont font = KoGlobal::defaultFont(); - QString fontFamily = font.family(); - QString fontSize = QString::number( + TQFont font = KoGlobal::defaultFont(); + TQString fontFamily = font.family(); + TQString fontSize = TQString::number( format.fontsize == WMLFormat::Big ? font.pointSizeFloat()+3 : format.fontsize == WMLFormat::Small ? font.pointSizeFloat()-3 : font.pointSizeFloat() ); - QString boldness = format.bold ? "75" : "50"; - QString italic = format.italic ? "1" : "0"; - QString underline = format.underline ? "1" : "0"; + TQString boldness = format.bold ? "75" : "50"; + TQString italic = format.italic ? "1" : "0"; + TQString underline = format.underline ? "1" : "0"; - result = "<FORMAT id=\"1\" pos=\"" + QString::number(format.pos) + - "\" len=\"" + QString::number(format.len) + "\">\n"; + result = "<FORMAT id=\"1\" pos=\"" + TQString::number(format.pos) + + "\" len=\"" + TQString::number(format.len) + "\">\n"; result.append( " <FONT name=\"" + fontFamily + "\" />\n" ); result.append( " <SIZE value=\"" + fontSize + "\" />\n" ); result.append( " <WEIGHT value=\"" + boldness + "\" />\n" ); @@ -91,8 +91,8 @@ static QString WMLFormatAsXML( WMLFormat format ) else { // hyperlink - result.append( "<FORMAT id=\"4\" pos=\"" + QString::number(format.pos) + - "\" len=\"" + QString::number(format.len) + "\">\n"); + result.append( "<FORMAT id=\"4\" pos=\"" + TQString::number(format.pos) + + "\" len=\"" + TQString::number(format.len) + "\">\n"); result.append( "<VARIABLE>\n" ); result.append( " <TYPE key=\"STRING\" type=\"9\" text=\"" + format.link + "\" />\n" ); result.append( " <LINK linkName=\"" + format.link + "\" hrefName=\"" + @@ -105,17 +105,17 @@ static QString WMLFormatAsXML( WMLFormat format ) return result; } -static QString WMLLayoutAsXML( WMLLayout layout ) +static TQString WMLLayoutAsXML( WMLLayout tqlayout ) { - QString result; + TQString result; - QString align = "left"; - if( layout.align == WMLLayout::Center ) align = "center"; - if( layout.align == WMLLayout::Right ) align = "right"; + TQString align = "left"; + if( tqlayout.align == WMLLayout::Center ) align = "center"; + if( tqlayout.align == WMLLayout::Right ) align = "right"; - QFont font = KoGlobal::defaultFont(); - QString fontFamily = font.family(); - QString fontSize = QString::number( font.pointSizeFloat() ); + TQFont font = KoGlobal::defaultFont(); + TQString fontFamily = font.family(); + TQString fontSize = TQString::number( font.pointSizeFloat() ); result.append( "<LAYOUT>\n" ); result.append( " <NAME value=\"Standard\" />\n" ); @@ -145,7 +145,7 @@ static QString WMLLayoutAsXML( WMLLayout layout ) } // use the first card title (or id) as document title -bool WMLConverter::doOpenCard( QString id, QString title ) +bool WMLConverter::doOpenCard( TQString id, TQString title ) { if( m_title.isEmpty() ) m_title = ( !title.isEmpty() ) ? title : id; @@ -160,16 +160,16 @@ bool WMLConverter::doCloseCard() return doParagraph( " ", WMLFormatList(), WMLLayout() ); } -bool WMLConverter::doParagraph( QString atext, WMLFormatList formatList, - WMLLayout layout ) +bool WMLConverter::doParagraph( TQString atext, WMLFormatList formatList, + WMLLayout tqlayout ) { - QString text, formats; + TQString text, formats; // encode the text for XML-ness text = atext; - text.replace( '&', "&" ); - text.replace( '<', "<" ); - text.replace( '>', ">" ); + text.tqreplace( '&', "&" ); + text.tqreplace( '<', "<" ); + text.tqreplace( '>', ">" ); // formats, taken from formatList WMLFormatList::iterator it; @@ -183,7 +183,7 @@ bool WMLConverter::doParagraph( QString atext, WMLFormatList formatList, root.append( "<PARAGRAPH>\n" ); root.append( "<TEXT>" + text + "</TEXT>\n" ); root.append( "<FORMATS>" + formats + "</FORMATS>\n" ); - root.append( WMLLayoutAsXML( layout) ); + root.append( WMLLayoutAsXML( tqlayout) ); root.append( "</PARAGRAPH>\n" ); return TRUE; @@ -193,7 +193,7 @@ void WMLConverter::parse( const char* filename ) { WMLParser::parse( filename ); - QString prolog; + TQString prolog; prolog += "<!DOCTYPE DOC>\n"; prolog += "<DOC mime=\"application/x-kword\" syntaxVersion=\"2\" editor=\"KWord\" >\n"; prolog += "<PAPER width=\"595\" spHeadBody=\"9\" format=\"1\" height=\"841\" fType=\"0\" orientation=\"0\" hType=\"0\" columnspacing=\"2\" spFootBody=\"9\" columns=\"1\" >\n"; @@ -204,7 +204,7 @@ void WMLConverter::parse( const char* filename ) prolog += "<FRAMESET frameType=\"1\" frameInfo=\"0\" name=\"Text Frameset 1\" visible=\"1\" >\n"; prolog += "<FRAME runaround=\"1\" copy=\"0\" right=\"567\" newFrameBehavior=\"0\" left=\"28\" bottom=\"799\" runaroundGap=\"2\" top=\"42\" />\n"; - QString epilog; + TQString epilog; epilog = "</FRAMESET>\n"; epilog += "</FRAMESETS>\n"; epilog += "</DOC>\n"; @@ -231,7 +231,7 @@ void WMLConverter::parse( const char* filename ) } -KoFilter::ConversionStatus WMLImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus WMLImport::convert( const TQCString& from, const TQCString& to ) { // check for proper conversion if( to!= "application/x-kword" || from != "text/vnd.wap.wml" ) @@ -246,7 +246,7 @@ KoFilter::ConversionStatus WMLImport::convert( const QCString& from, const QCStr if( filter.root.isEmpty() ) return KoFilter::StupidError; - QString root = filter.root; + TQString root = filter.root; // prepare storage KoStoreDevice* out=m_chain->storageFile( "root", KoStore::Write ); @@ -254,19 +254,19 @@ KoFilter::ConversionStatus WMLImport::convert( const QCString& from, const QCStr // store output document if( out ) { - QCString cstring = root.utf8(); + TQCString cstring = root.utf8(); cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); out->writeBlock( (const char*) cstring, cstring.length() ); } - QString documentInfo = filter.documentInfo; + TQString documentInfo = filter.documentInfo; // store document info out = m_chain->storageFile( "documentinfo.xml", KoStore::Write ); if ( out ) { - QCString cstring = documentInfo.utf8(); + TQCString cstring = documentInfo.utf8(); cstring.prepend( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ); out->writeBlock( (const char*) cstring, cstring.length() ); diff --git a/filters/kword/wml/wmlimport.h b/filters/kword/wml/wmlimport.h index 87184ca7..903cb9e0 100644 --- a/filters/kword/wml/wmlimport.h +++ b/filters/kword/wml/wmlimport.h @@ -20,7 +20,7 @@ #ifndef __WMLIMPORT_H #define __WMLIMPORT_H -#include <qstring.h> +#include <tqstring.h> #include <KoFilter.h> #include <KoStore.h> @@ -28,15 +28,16 @@ class WMLImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - WMLImport(KoFilter *parent, const char *name, const QStringList&); + WMLImport(KoFilter *tqparent, const char *name, const TQStringList&); WMLImport(); virtual ~WMLImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __WMLIMPORT_H diff --git a/filters/kword/wml/wmlparser.cpp b/filters/kword/wml/wmlparser.cpp index a37dbeb4..ecbb235c 100644 --- a/filters/kword/wml/wmlparser.cpp +++ b/filters/kword/wml/wmlparser.cpp @@ -17,10 +17,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qstring.h> -#include <qxml.h> -#include <qfile.h> -#include <qvaluestack.h> +#include <tqstring.h> +#include <tqxml.h> +#include <tqfile.h> +#include <tqvaluestack.h> #include <wmlparser.h> @@ -63,31 +63,31 @@ void WMLParseState::assign( const WMLParseState& state ) } // ContentHandler for use with the reader -class WMLHandler: public QXmlDefaultHandler +class WMLHandler: public TQXmlDefaultHandler { public: WMLHandler( WMLParser *parser ){ m_parser = parser; } bool startDocument(); - bool startElement( const QString&, const QString&, const QString& , - const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString& ch ); + bool startElement( const TQString&, const TQString&, const TQString& , + const TQXmlAttributes& ); + bool endElement( const TQString&, const TQString&, const TQString& ); + bool characters( const TQString& ch ); private: WMLParser *m_parser; bool m_inBlock; - QString m_text; + TQString m_text; bool m_inLink; - QString m_link; - QString m_href; + TQString m_link; + TQString m_href; WMLParseState m_state; - QValueStack<WMLParseState> m_stateStack; + TQValueStack<WMLParseState> m_stateStack; bool flushParagraph(); void pushState(); @@ -105,11 +105,11 @@ bool WMLHandler::startDocument() return true; } -bool WMLHandler::startElement( const QString&, const QString&, - const QString& qName, - const QXmlAttributes& attr ) +bool WMLHandler::startElement( const TQString&, const TQString&, + const TQString& qName, + const TQXmlAttributes& attr ) { - QString tag = qName.lower(); + TQString tag = qName.lower(); if( tag == "wml" ) return m_parser->doOpenDocument(); @@ -117,8 +117,8 @@ bool WMLHandler::startElement( const QString&, const QString&, if( tag == "card" ) { m_state = WMLParseState(); - QString card_id = attr.value("id"); - QString card_title = attr.value("title"); + TQString card_id = attr.value("id"); + TQString card_title = attr.value("title"); return m_parser->doOpenCard( card_id, card_title ); } @@ -132,7 +132,7 @@ bool WMLHandler::startElement( const QString&, const QString&, (m_state.currentFormat.fontsize != WMLFormat::Normal) ) m_state.formatList.append( m_state.currentFormat ); - QString align = attr.value("align").lower(); + TQString align = attr.value("align").lower(); if( align == "right" ) m_state.currentLayout.align = WMLLayout::Right; if( align == "center" ) @@ -183,7 +183,7 @@ bool WMLHandler::startElement( const QString&, const QString&, if( tag == "a" ) { - QString href = attr.value("href"); + TQString href = attr.value("href"); if( !href.isEmpty() ) { m_inBlock = false; @@ -225,10 +225,10 @@ bool WMLHandler::startElement( const QString&, const QString&, return TRUE; } -bool WMLHandler::endElement( const QString&, const QString&, - const QString& qName ) +bool WMLHandler::endElement( const TQString&, const TQString&, + const TQString& qName ) { - QString tag = qName.lower(); + TQString tag = qName.lower(); if( tag == "wml" ) return m_parser->doCloseDocument(); @@ -318,7 +318,7 @@ bool WMLHandler::endElement( const QString&, const QString&, return TRUE; } -bool WMLHandler::characters( const QString& ch ) +bool WMLHandler::characters( const TQString& ch ) { if( m_inBlock ) m_text.append( ch ); @@ -403,7 +403,7 @@ WMLFormat& WMLFormat::operator=( const WMLFormat& f ) return *this; } -// paragraph layout info +// paragraph tqlayout info WMLLayout::WMLLayout() { align = Left; @@ -428,9 +428,9 @@ WMLLayout& WMLLayout::operator=( const WMLLayout& l ) // The basic WML parser void WMLParser::parse( const char* filename ) { - QFile f( filename ); - QXmlInputSource source( &f ); - QXmlSimpleReader reader; + TQFile f( filename ); + TQXmlInputSource source( TQT_TQIODEVICE(&f) ); + TQXmlSimpleReader reader; WMLHandler handler( this ); reader.setContentHandler( &handler ); reader.parse( source ); @@ -446,7 +446,7 @@ bool WMLParser::doCloseDocument() return TRUE; } -bool WMLParser::doOpenCard( QString, QString ) +bool WMLParser::doOpenCard( TQString, TQString ) { return TRUE; } @@ -456,7 +456,7 @@ bool WMLParser::doCloseCard() return TRUE; } -bool WMLParser::doParagraph( QString, WMLFormatList, WMLLayout ) +bool WMLParser::doParagraph( TQString, WMLFormatList, WMLLayout ) { return TRUE; } diff --git a/filters/kword/wml/wmlparser.h b/filters/kword/wml/wmlparser.h index 504b184e..575652f8 100644 --- a/filters/kword/wml/wmlparser.h +++ b/filters/kword/wml/wmlparser.h @@ -20,8 +20,8 @@ #ifndef __WMLPARSER_H #define __WMLPARSER_H -#include <qvaluelist.h> -#include <qstring.h> +#include <tqvaluelist.h> +#include <tqstring.h> class WMLFormat { @@ -29,7 +29,7 @@ class WMLFormat int pos, len; bool bold, italic, underline; enum { Normal, Big, Small } fontsize; - QString link, href; + TQString link, href; WMLFormat(); WMLFormat( const WMLFormat& ); WMLFormat& operator= ( const WMLFormat& ); @@ -46,7 +46,7 @@ class WMLLayout void assign( const WMLLayout& ); }; -typedef QValueList<WMLFormat> WMLFormatList; +typedef TQValueList<WMLFormat> WMLFormatList; class WMLParser { @@ -57,9 +57,9 @@ class WMLParser virtual bool doOpenDocument(); virtual bool doCloseDocument(); - virtual bool doOpenCard( QString id, QString title ); + virtual bool doOpenCard( TQString id, TQString title ); virtual bool doCloseCard(); - virtual bool doParagraph( QString, WMLFormatList, WMLLayout ); + virtual bool doParagraph( TQString, WMLFormatList, WMLLayout ); virtual bool doBeginTable(); virtual bool doTableCell( unsigned row, unsigned col ); virtual bool doEndTable(); diff --git a/filters/kword/wordperfect/export/wp5.cc b/filters/kword/wordperfect/export/wp5.cc index c304447b..bffdecf1 100644 --- a/filters/kword/wordperfect/export/wp5.cc +++ b/filters/kword/wordperfect/export/wp5.cc @@ -23,10 +23,10 @@ #include <unistd.h> #endif -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> #include <KWEFBaseWorker.h> #include <KWEFKWordLeader.h> @@ -34,7 +34,7 @@ #include <wp5.h> -bool WPFiveWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool WPFiveWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { filename = filenameOut; outfile.setName( filename ); @@ -42,14 +42,14 @@ bool WPFiveWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) return false; output.setDevice( &outfile ); - output.setByteOrder (QDataStream::LittleEndian); + output.setByteOrder (TQDataStream::LittleEndian); return true; } bool WPFiveWorker::doCloseFile(void) { // asssume we're at the end of the file - Q_UINT32 total_filesize = outfile.at(); + TQ_UINT32 total_filesize = outfile.at(); // close the file first outfile.close(); @@ -58,7 +58,7 @@ bool WPFiveWorker::doCloseFile(void) if( !outfile.open( IO_ReadWrite ) ) return false; output.setDevice( &outfile ); - output.setByteOrder (QDataStream::LittleEndian); + output.setByteOrder (TQDataStream::LittleEndian); // now it's time to fix-up some header fields @@ -80,52 +80,52 @@ bool WPFiveWorker::doOpenDocument(void) // note that some fields are still "dummy" // magic id: -1, "WPC" - Q_UINT8 magic[] = { 0xff, 0x57, 0x50, 0x43 }; + TQ_UINT8 magic[] = { 0xff, 0x57, 0x50, 0x43 }; for( int i=0; i<4; i++ ) output << magic[i]; // pointer to document area (dummy, will be fixed later) - Q_UINT8 docptr[] = { 0x0E, 0x02, 0x00, 0x00 } ; + TQ_UINT8 docptr[] = { 0x0E, 0x02, 0x00, 0x00 } ; for( int i=0; i<4; i++ ) output << docptr[i]; // write product type ( 1 = WordPerfect ) - Q_UINT8 product_type = 1; + TQ_UINT8 product_type = 1; output << product_type; // write file type ( 10 = WordPerfect document ) - Q_UINT8 file_type = 10; + TQ_UINT8 file_type = 10; output << file_type; // write version ( 1 = WordPerfect 5.x ) - Q_UINT16 version = 0x0100; + TQ_UINT16 version = 0x0100; output << version; // write encryption flag ( 0 = not encrypted ) - Q_UINT16 encrypt = 0; + TQ_UINT16 encrypt = 0; output << encrypt; // offset to index header (always 0x200?) - Q_UINT16 index_header_ptr = 0x200; + TQ_UINT16 index_header_ptr = 0x200; output << index_header_ptr; // beginning of extended file header (always 5) - Q_UINT32 extheader = 5; + TQ_UINT32 extheader = 5; output << extheader; // filesize (dummy, will be fixed later) - Q_UINT32 filesize = 0; + TQ_UINT32 filesize = 0; output << filesize; // filler 488 bytes - Q_UINT8 dummy = 0; + TQ_UINT8 dummy = 0; for( int i=0; i<488; i++ ) output << dummy; // index header (specified 0 index!) - Q_UINT8 index_header[] = { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + TQ_UINT8 index_header[] = { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for( int i=0; i<14; i++ ) output << index_header[i]; // document area starts, mark it for the header fields - document_area_ptr = output.device()->at(); + document_area_ptr = output.tqdevice()->at(); return true; } @@ -137,13 +137,13 @@ bool WPFiveWorker::doCloseDocument(void) // quick-and-dirty escape function for WP 5.x chars // TODO fix it ! -static QCString WPFiveEscape( const QString& text ) +static TQCString WPFiveEscape( const TQString& text ) { - QCString result; + TQCString result; for( unsigned int i=0; i < text.length(); i++ ) { - int c = text[i].unicode(); + int c = text[i].tqunicode(); if( c < 32 ) result += '.'; else if ( c == 32 ) result += 0x20 ; // hard space else if ( c < 128 ) result += text[i].latin1(); @@ -154,8 +154,8 @@ static QCString WPFiveEscape( const QString& text ) } -bool WPFiveWorker::doFullParagraph(const QString& paraText, - const LayoutData& /*layout*/, const ValueListFormatData& paraFormatDataList) +bool WPFiveWorker::doFullParagraph(const TQString& paraText, + const LayoutData& /*tqlayout*/, const ValueListFormatData& paraFormatDataList) { ValueListFormatData::ConstIterator it; for( it = paraFormatDataList.begin(); it!=paraFormatDataList.end(); ++it ) @@ -166,7 +166,7 @@ bool WPFiveWorker::doFullParagraph(const QString& paraText, if( formatData.id == 1 ) { - Q_UINT8 attr = 0; //invalid + TQ_UINT8 attr = 0; //invalid if( formatData.text.weight >= 75 ) attr = 12; // bold if( formatData.text.italic ) attr = 8; if( formatData.text.underline ) @@ -184,30 +184,30 @@ bool WPFiveWorker::doFullParagraph(const QString& paraText, // write some prefix-code (such as Bold On) and possibly appropriate suffix-code (Bold Off) // attribute on - if( attr > 0 ) output << (Q_UINT8)0xc3 << attr << (Q_UINT8)0xc3; + if( attr > 0 ) output << (TQ_UINT8)0xc3 << attr << (TQ_UINT8)0xc3; // set font color - QColor fgColor = formatData.text.fgColor; + TQColor fgColor = formatData.text.fgColor; if( fgColor.isValid() ) { - Q_UINT8 wp_color[] = { 0xd1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0xd1 }; - wp_color[7] = (Q_UINT8) fgColor.red(); - wp_color[8] = (Q_UINT8) fgColor.green(); - wp_color[9] = (Q_UINT8) fgColor.blue(); + TQ_UINT8 wp_color[] = { 0xd1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0xd1 }; + wp_color[7] = (TQ_UINT8) fgColor.red(); + wp_color[8] = (TQ_UINT8) fgColor.green(); + wp_color[9] = (TQ_UINT8) fgColor.blue(); output.writeRawBytes( (const char*)wp_color, 14 ); } // the text itself, "escape" it first - QCString out = WPFiveEscape( paraText.mid( formatData.pos, formatData.len ) ); + TQCString out = WPFiveEscape( paraText.mid( formatData.pos, formatData.len ) ); output.writeRawBytes( (const char*)out, out.length() ); // attribute off - if( attr > 0 ) output << (Q_UINT8)0xc4 << attr << (Q_UINT8)0xc4; + if( attr > 0 ) output << (TQ_UINT8)0xc4 << attr << (TQ_UINT8)0xc4; } } // write hard-return - output << (Q_UINT8) 0x0a; + output << (TQ_UINT8) 0x0a; return true; } diff --git a/filters/kword/wordperfect/export/wp5.h b/filters/kword/wordperfect/export/wp5.h index bc197e72..0791459b 100644 --- a/filters/kword/wordperfect/export/wp5.h +++ b/filters/kword/wordperfect/export/wp5.h @@ -23,26 +23,26 @@ #include <KWEFStructures.h> #include <KWEFBaseWorker.h> -class QString; -class QFile; -class QDataStream; +class TQString; +class TQFile; +class TQDataStream; class WPFiveWorker : public KWEFBaseWorker { public: WPFiveWorker(void) { } virtual ~WPFiveWorker(void) { } - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); private: - QString filename; - QFile outfile; - QDataStream output; - Q_UINT32 document_area_ptr; + TQString filename; + TQFile outfile; + TQDataStream output; + TQ_UINT32 document_area_ptr; }; #endif //__WP5_H diff --git a/filters/kword/wordperfect/export/wp6.cc b/filters/kword/wordperfect/export/wp6.cc index 62291244..21c59606 100644 --- a/filters/kword/wordperfect/export/wp6.cc +++ b/filters/kword/wordperfect/export/wp6.cc @@ -23,11 +23,11 @@ #include <unistd.h> #endif -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> -#include <qvaluevector.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> +#include <tqvaluevector.h> #include <KWEFBaseWorker.h> #include <KWEFKWordLeader.h> @@ -35,7 +35,7 @@ #include <wp6.h> -bool WPSixWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) +bool WPSixWorker::doOpenFile(const TQString& filenameOut, const TQString& /*to*/) { filename = filenameOut; outfile.setName( filename ); @@ -43,14 +43,14 @@ bool WPSixWorker::doOpenFile(const QString& filenameOut, const QString& /*to*/) return false; output.setDevice( &outfile ); - output.setByteOrder (QDataStream::LittleEndian); + output.setByteOrder (TQDataStream::LittleEndian); return true; } bool WPSixWorker::doCloseFile(void) { // asssume we're at the end of the file - Q_UINT32 total_filesize = outfile.at(); + TQ_UINT32 total_filesize = outfile.at(); // close the file first outfile.close(); @@ -80,52 +80,52 @@ bool WPSixWorker::doOpenDocument(void) // note that some fields are still "dummy" // magic id: -1, "WPC" - Q_UINT8 magic[] = { 0xff, 0x57, 0x50, 0x43 }; + TQ_UINT8 magic[] = { 0xff, 0x57, 0x50, 0x43 }; for( int i=0; i<4; i++ ) output << magic[i]; // pointer to document area (dummy, will be fixed later) - Q_UINT8 docptr[] = { 0x0E, 0x02, 0x00, 0x00 } ; + TQ_UINT8 docptr[] = { 0x0E, 0x02, 0x00, 0x00 } ; for( int i=0; i<4; i++ ) output << docptr[i]; // write product type ( 1 = WordPerfect ) - Q_UINT8 product_type = 1; + TQ_UINT8 product_type = 1; output << product_type; // write file type ( 10 = WordPerfect document ) - Q_UINT8 file_type = 10; + TQ_UINT8 file_type = 10; output << file_type; // write version (TODO explain) - Q_UINT16 version = 0x0202; + TQ_UINT16 version = 0x0202; output << version; // write encryption flag ( 0 = not encrypted ) - Q_UINT16 encrypt = 0; + TQ_UINT16 encrypt = 0; output << encrypt; // offset to index header (always 0x200?) - Q_UINT16 index_header_ptr = 0x200; + TQ_UINT16 index_header_ptr = 0x200; output << index_header_ptr; // beginning of extended file header (always 5) - Q_UINT32 extheader = 5; + TQ_UINT32 extheader = 5; output << extheader; // filesize (dummy, will be fixed later) - Q_UINT32 filesize = 0; + TQ_UINT32 filesize = 0; output << filesize; // filler 488 bytes - Q_UINT8 dummy = 0; + TQ_UINT8 dummy = 0; for( int i=0; i<488; i++ ) output << dummy; // index header (specified 0 index!) - Q_UINT8 index_header[] = { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + TQ_UINT8 index_header[] = { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for( int i=0; i<14; i++ ) output << index_header[i]; // document area starts, mark it for the header fields - document_area_ptr = output.device()->at(); + document_area_ptr = output.tqdevice()->at(); return true; } @@ -138,13 +138,13 @@ bool WPSixWorker::doCloseDocument(void) // this helper functions "escape" plain Unicode string to WP-compliance string // what it does: converting spaces and tabs to hard-spaces and hard-tabs // TODO handle Unicode characters using WP charsets -static QCString WPSixEscape( const QString& text ) +static TQCString WPSixEscape( const TQString& text ) { - QCString result; + TQCString result; for( unsigned int i=0; i < text.length(); i++ ) { - int c = text[i].unicode(); + int c = text[i].tqunicode(); if( c < 32 ) result += '.'; else if ( c == 32 ) result += 0x80 ; // hard space else if ( c < 128 ) result += text[i].latin1(); @@ -154,15 +154,15 @@ static QCString WPSixEscape( const QString& text ) return result; } -bool WPSixWorker::doFullParagraph(const QString& paraText, - const LayoutData& layout, const ValueListFormatData& paraFormatDataList) +bool WPSixWorker::doFullParagraph(const TQString& paraText, + const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList) { - // handle paragraph alignment/justification (default to left) + // handle paragraph tqalignment/justification (default to left) unsigned char wp_align[] = { 0xd3, 5, 12, 0, 0, 1, 0, 0, 2, 12, 0, 0xd3 }; - if( layout.alignment == "left" ) wp_align[7] = 0; - if( layout.alignment == "justify" ) wp_align[7] = 1; - if( layout.alignment == "center" ) wp_align[7] = 2; - if( layout.alignment == "right" ) wp_align[7] = 3; + if( tqlayout.tqalignment == "left" ) wp_align[7] = 0; + if( tqlayout.tqalignment == "justify" ) wp_align[7] = 1; + if( tqlayout.tqalignment == "center" ) wp_align[7] = 2; + if( tqlayout.tqalignment == "right" ) wp_align[7] = 3; output.writeRawBytes( (const char*)wp_align, 12 ); ValueListFormatData::ConstIterator it; @@ -174,7 +174,7 @@ bool WPSixWorker::doFullParagraph(const QString& paraText, if( formatData.id == 1 ) { - Q_UINT8 attr = 0; //invalid + TQ_UINT8 attr = 0; //invalid if( formatData.text.weight >= 75 ) attr = 12; // bold if( formatData.text.italic ) attr = 8; if( formatData.text.underline ) @@ -188,53 +188,53 @@ bool WPSixWorker::doFullParagraph(const QString& paraText, if( formatData.text.verticalAlignment == 2 ) attr = 5; //superscript if( formatData.text.strikeout ) attr = 13; - QColor fgColor = formatData.text.fgColor; - QColor bgColor = formatData.text.bgColor; + TQColor fgColor = formatData.text.fgColor; + TQColor bgColor = formatData.text.bgColor; // due to the file format, before writing the text we must // write some refix-code (such as Bold On) and possibly appropriate suffix-code (Bold Off) // attribute on - if( attr > 0 ) output << (Q_UINT8)0xf2 << attr << (Q_UINT8)0xf2; + if( attr > 0 ) output << (TQ_UINT8)0xf2 << attr << (TQ_UINT8)0xf2; // set font color if( fgColor.isValid() ) { - Q_UINT8 wp_color[] = { 0xd4, 0x18, 16, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0xd4 }; - wp_color[7] = (Q_UINT8) fgColor.red(); - wp_color[8] = (Q_UINT8) fgColor.green(); - wp_color[9] = (Q_UINT8) fgColor.blue(); + TQ_UINT8 wp_color[] = { 0xd4, 0x18, 16, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0xd4 }; + wp_color[7] = (TQ_UINT8) fgColor.red(); + wp_color[8] = (TQ_UINT8) fgColor.green(); + wp_color[9] = (TQ_UINT8) fgColor.blue(); output.writeRawBytes( (const char*)wp_color, 16 ); } // highlight on (background color) if( bgColor.isValid() ) { - output << (Q_UINT8) 0xfb; - output << (Q_UINT8)bgColor.red() << (Q_UINT8)bgColor.green() << (Q_UINT8)bgColor.blue(); - output << (Q_UINT8) 100 << (Q_UINT8) 0xfb; + output << (TQ_UINT8) 0xfb; + output << (TQ_UINT8)bgColor.red() << (TQ_UINT8)bgColor.green() << (TQ_UINT8)bgColor.blue(); + output << (TQ_UINT8) 100 << (TQ_UINT8) 0xfb; } // the text itself, "escape" it first - QCString out = WPSixEscape( paraText.mid( formatData.pos, formatData.len ) ); + TQCString out = WPSixEscape( paraText.mid( formatData.pos, formatData.len ) ); output.writeRawBytes( (const char*)out, out.length() ); // attribute off - if( attr > 0 ) output << (Q_UINT8)0xf3 << attr << (Q_UINT8)0xf3; + if( attr > 0 ) output << (TQ_UINT8)0xf3 << attr << (TQ_UINT8)0xf3; // highlight off if( bgColor.isValid() ) { - output << (Q_UINT8) 0xfc; - output << (Q_UINT8)bgColor.red() << (Q_UINT8)bgColor.green() << (Q_UINT8)bgColor.blue(); - output << (Q_UINT8) 100 << (Q_UINT8) 0xfc; + output << (TQ_UINT8) 0xfc; + output << (TQ_UINT8)bgColor.red() << (TQ_UINT8)bgColor.green() << (TQ_UINT8)bgColor.blue(); + output << (TQ_UINT8) 100 << (TQ_UINT8) 0xfc; } } } // write hard-return - output << (Q_UINT8) 0xcc; + output << (TQ_UINT8) 0xcc; return true; } diff --git a/filters/kword/wordperfect/export/wp6.h b/filters/kword/wordperfect/export/wp6.h index 042cf614..73397338 100644 --- a/filters/kword/wordperfect/export/wp6.h +++ b/filters/kword/wordperfect/export/wp6.h @@ -23,26 +23,26 @@ #include <KWEFStructures.h> #include <KWEFBaseWorker.h> -class QString; -class QFile; -class QDataStream; +class TQString; +class TQFile; +class TQDataStream; class WPSixWorker : public KWEFBaseWorker { public: WPSixWorker(void) { } virtual ~WPSixWorker(void) { } - virtual bool doOpenFile(const QString& filenameOut, const QString& to); + virtual bool doOpenFile(const TQString& filenameOut, const TQString& to); virtual bool doCloseFile(void); virtual bool doOpenDocument(void); virtual bool doCloseDocument(void); - virtual bool doFullParagraph(const QString& paraText, const LayoutData& layout, + virtual bool doFullParagraph(const TQString& paraText, const LayoutData& tqlayout, const ValueListFormatData& paraFormatDataList); private: - QString filename; - QFile outfile; - QDataStream output; - Q_UINT32 document_area_ptr; + TQString filename; + TQFile outfile; + TQDataStream output; + TQ_UINT32 document_area_ptr; }; #endif //__WP6_H diff --git a/filters/kword/wordperfect/export/wpexport.cc b/filters/kword/wordperfect/export/wpexport.cc index 80467006..43a688c3 100644 --- a/filters/kword/wordperfect/export/wpexport.cc +++ b/filters/kword/wordperfect/export/wpexport.cc @@ -23,10 +23,10 @@ #include <unistd.h> #endif -#include <qtextcodec.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqtextcodec.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> #include <kdebug.h> #include <KoFilterChain.h> @@ -42,14 +42,14 @@ typedef KGenericFactory<WPExport, KoFilter> WPExportFactory; K_EXPORT_COMPONENT_FACTORY( libwpexport, WPExportFactory( "kofficefilters" ) ) -WPExport::WPExport( KoFilter *, const char *, const QStringList& ): +WPExport::WPExport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } -KoFilter::ConversionStatus -WPExport::convert( const QCString& from, - const QCString& to ) +KoFilter::ConversiontqStatus +WPExport::convert( const TQCString& from, + const TQCString& to ) { // check for proper conversion if( to!= "application/wordperfect" || from != "application/x-kword" ) @@ -59,8 +59,8 @@ WPExport::convert( const QCString& from, // "WP" is for WP 5.x, "WPD" or else is for WP 6/7 // e.g /home/ariya/test.wp is a WP 5 document // TODO ask user with a dialog box - QString outfile = m_chain->outputFile(); - QString extension = QFileInfo( outfile ).extension().lower(); + TQString outfile = m_chain->outputFile(); + TQString extension = TQFileInfo( outfile ).extension().lower(); int version = ( extension == "wp" ) ? 5 : 6 ; KWEFBaseWorker* worker; @@ -69,7 +69,7 @@ WPExport::convert( const QCString& from, KWEFKWordLeader* leader = new KWEFKWordLeader( worker ); - KoFilter::ConversionStatus result; + KoFilter::ConversiontqStatus result; result = leader->convert( m_chain, from, to ); delete worker; diff --git a/filters/kword/wordperfect/export/wpexport.h b/filters/kword/wordperfect/export/wpexport.h index 1329740c..4c819ba4 100644 --- a/filters/kword/wordperfect/export/wpexport.h +++ b/filters/kword/wordperfect/export/wpexport.h @@ -26,15 +26,16 @@ class WPExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - WPExport(KoFilter *parent, const char *name, const QStringList&); + WPExport(KoFilter *tqparent, const char *name, const TQStringList&); WPExport(); virtual ~WPExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __WPEXPORT_H diff --git a/filters/kword/wordperfect/import/PageSpan.cxx b/filters/kword/wordperfect/import/PageSpan.cxx index db92cfd7..c56fbe54 100644 --- a/filters/kword/wordperfect/import/PageSpan.cxx +++ b/filters/kword/wordperfect/import/PageSpan.cxx @@ -33,12 +33,12 @@ PageSpan::PageSpan(const WPXPropertyList &xPropList) : #if 0 -const int iSpan, const float fFormLength, const float fFormWidth, const WPXFormOrientation fFormOrientation, +const int iSpan, const float fFormLength, const float fFormWidth, const WPXFormQt::Orientation fFormQt::Orientation, const float fLeftMargin, const float fRightMargin, const float fTopMargin, const float fBottomMargin): miSpan(iSpan), mfFormLength(fFormLength), mfFormWidth(fFormWidth), - mfFormOrientation(fFormOrientation), + mfFormQt::Orientation(fFormQt::Orientation), mfMarginLeft(fLeftMargin), mfMarginRight(fRightMargin), mfMarginTop(fTopMargin), diff --git a/filters/kword/wordperfect/import/PageSpan.hxx b/filters/kword/wordperfect/import/PageSpan.hxx index f068b3b2..61ac0193 100644 --- a/filters/kword/wordperfect/import/PageSpan.hxx +++ b/filters/kword/wordperfect/import/PageSpan.hxx @@ -44,7 +44,7 @@ public: #if 0 float getFormLength() { return mfFormLength; } float getFormWidth() { return mfFormWidth; } - WPXFormOrientation getFormOrientation() { return mfFormOrientation; } + WPXFormQt::Orientation getFormQt::Orientation() { return mfFormQt::Orientation; } #endif float getMarginLeft() const; float getMarginRight() const; diff --git a/filters/kword/wordperfect/import/TextRunStyle.cxx b/filters/kword/wordperfect/import/TextRunStyle.cxx index 702dddb5..2860df9a 100644 --- a/filters/kword/wordperfect/import/TextRunStyle.cxx +++ b/filters/kword/wordperfect/import/TextRunStyle.cxx @@ -58,7 +58,7 @@ void ParagraphStyle::write(DocumentHandler &xHandler) const WPXPropertyList propList; propList.insert("style:name", msName.cstr()); propList.insert("style:family", "paragraph"); - propList.insert("style:parent-style-name", (*mpPropList)["style:parent-style-name"]->getStr()); + propList.insert("style:tqparent-style-name", (*mpPropList)["style:tqparent-style-name"]->getStr()); if ((*mpPropList)["style:master-page-name"]) propList.insert("style:master-page-name", (*mpPropList)["style:master-page-name"]->getStr()); xHandler.startElement("style:style", propList); diff --git a/filters/kword/wordperfect/import/WordPerfectCollector.cxx b/filters/kword/wordperfect/import/WordPerfectCollector.cxx index 7c630feb..ad732702 100644 --- a/filters/kword/wordperfect/import/WordPerfectCollector.cxx +++ b/filters/kword/wordperfect/import/WordPerfectCollector.cxx @@ -172,7 +172,7 @@ void WordPerfectCollector::_writeDefaultStyles(DocumentHandler &xHandler) TagOpenElement textBodyStyleOpenElement("style:style"); textBodyStyleOpenElement.addAttribute("style:name", "Text Body"); textBodyStyleOpenElement.addAttribute("style:family", "paragraph"); - textBodyStyleOpenElement.addAttribute("style:parent-style-name", "Standard"); + textBodyStyleOpenElement.addAttribute("style:tqparent-style-name", "Standard"); textBodyStyleOpenElement.addAttribute("style:class", "text"); textBodyStyleOpenElement.write(xHandler); TagCloseElement textBodyStyleCloseElement("style:style"); @@ -181,7 +181,7 @@ void WordPerfectCollector::_writeDefaultStyles(DocumentHandler &xHandler) TagOpenElement tableContentsStyleOpenElement("style:style"); tableContentsStyleOpenElement.addAttribute("style:name", "Table Contents"); tableContentsStyleOpenElement.addAttribute("style:family", "paragraph"); - tableContentsStyleOpenElement.addAttribute("style:parent-style-name", "Text Body"); + tableContentsStyleOpenElement.addAttribute("style:tqparent-style-name", "Text Body"); tableContentsStyleOpenElement.addAttribute("style:class", "extra"); tableContentsStyleOpenElement.write(xHandler); TagCloseElement tableContentsStyleCloseElement("style:style"); @@ -190,7 +190,7 @@ void WordPerfectCollector::_writeDefaultStyles(DocumentHandler &xHandler) TagOpenElement tableHeadingStyleOpenElement("style:style"); tableHeadingStyleOpenElement.addAttribute("style:name", "Table Heading"); tableHeadingStyleOpenElement.addAttribute("style:family", "paragraph"); - tableHeadingStyleOpenElement.addAttribute("style:parent-style-name", "Table Contents"); + tableHeadingStyleOpenElement.addAttribute("style:tqparent-style-name", "Table Contents"); tableHeadingStyleOpenElement.addAttribute("style:class", "extra"); tableHeadingStyleOpenElement.write(xHandler); TagCloseElement tableHeadingStyleCloseElement("style:style"); @@ -474,10 +474,10 @@ void WordPerfectCollector::openParagraph(const WPXPropertyList &propList, const { // we don't have to go through the fuss of determining if the paragraph style is // unique in this case, because if we are the first document element, then we - // are singular. Neither do we have to determine what our parent style is-- we can't + // are singular. Neither do we have to determine what our tqparent style is-- we can't // be inside a table in this case (the table would be the first document element //in that case) - pPersistPropList->insert("style:parent-style-name", "Standard"); + pPersistPropList->insert("style:tqparent-style-name", "Standard"); WPXString sName; sName.sprintf("FS"); @@ -492,12 +492,12 @@ void WordPerfectCollector::openParagraph(const WPXPropertyList &propList, const if (mWriterDocumentState.mbTableCellOpened) { if (mWriterDocumentState.mbHeaderRow) - pPersistPropList->insert("style:parent-style-name", "Table Heading"); + pPersistPropList->insert("style:tqparent-style-name", "Table Heading"); else - pPersistPropList->insert("style:parent-style-name", "Table Contents"); + pPersistPropList->insert("style:tqparent-style-name", "Table Contents"); } else - pPersistPropList->insert("style:parent-style-name", "Standard"); + pPersistPropList->insert("style:tqparent-style-name", "Standard"); WPXString sKey = getParagraphStyleKey(*pPersistPropList, tabStops); @@ -707,7 +707,7 @@ void WordPerfectCollector::openListElement(const WPXPropertyList &propList, cons WPXPropertyList *pPersistPropList = new WPXPropertyList(propList); pPersistPropList->insert("style:list-style-name", mpCurrentListStyle->getName()); - pPersistPropList->insert("style:parent-style-name", "Standard"); + pPersistPropList->insert("style:tqparent-style-name", "Standard"); WPXString sKey = getParagraphStyleKey(*pPersistPropList, tabStops); diff --git a/filters/kword/wordperfect/import/kwordfilter.cpp b/filters/kword/wordperfect/import/kwordfilter.cpp index 5e91e28c..56e91b33 100644 --- a/filters/kword/wordperfect/import/kwordfilter.cpp +++ b/filters/kword/wordperfect/import/kwordfilter.cpp @@ -21,10 +21,10 @@ #include "kwordfilter.h" #include "parser.h" -#include <qfileinfo.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qregexp.h> +#include <tqfileinfo.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqregexp.h> using namespace WP; @@ -44,10 +44,10 @@ class KWordFormat int red, green, blue; int bgred, bggreen, bgblue; double fontsize; - QString fontface; + TQString fontface; KWordFormat(); - QString asXML(); + TQString asXML(); }; KWordFormat::KWordFormat() @@ -61,9 +61,9 @@ KWordFormat::KWordFormat() fontface = ""; } -QString KWordFormat::asXML() +TQString KWordFormat::asXML() { - QString result; + TQString result; if( bold ) result.append( " <WEIGHT value=\"75\" />\n" ); if( italic ) result.append( " <ITALIC value=\"1\" />\n" ); @@ -77,22 +77,22 @@ QString KWordFormat::asXML() result.append( "<FONT name=\"" + fontface + "\" />\n" ); if( fontsize > 0.0 ) - result.append( " <SIZE value=\"" + QString::number(fontsize) + "\" />\n" ); + result.append( " <SIZE value=\"" + TQString::number(fontsize) + "\" />\n" ); if( color ) - result.append( " <COLOR red=\"" + QString::number(red) + - "\" green=\"" + QString::number(green) + - "\" blue=\"" + QString::number(blue) + "\" />\n" ); + result.append( " <COLOR red=\"" + TQString::number(red) + + "\" green=\"" + TQString::number(green) + + "\" blue=\"" + TQString::number(blue) + "\" />\n" ); if( highlight ) - result.append( " <TEXTBACKGROUNDCOLOR red=\"" + QString::number(bgred) + - "\" green=\"" + QString::number(bggreen) + - "\" blue=\"" + QString::number(bgblue) + "\" />\n" ); + result.append( " <TEXTBACKGROUNDCOLOR red=\"" + TQString::number(bgred) + + "\" green=\"" + TQString::number(bggreen) + + "\" blue=\"" + TQString::number(bgblue) + "\" />\n" ); return result; } -static QString mapAlign( Token::Align align ) +static TQString mapAlign( Token::Align align ) { switch( align ) { @@ -107,9 +107,9 @@ static QString mapAlign( Token::Align align ) // NOTE: KWord value for linespace: 72=one, 144=double, .. // Special case: "0" is normal, "oneandhalf" is 108, "double" is 144. -static QString mapLinespace( double linespace ) +static TQString mapLinespace( double linespace ) { - return QString::number( linespace ); + return TQString::number( linespace ); } KWordFilter::KWordFilter ():Parser () @@ -117,7 +117,7 @@ KWordFilter::KWordFilter ():Parser () } bool -KWordFilter::parse (const QString & filename) +KWordFilter::parse (const TQString & filename) { int frameLeftMargin = 36, frameRightMargin = 36; // quick hack @@ -127,9 +127,9 @@ KWordFilter::parse (const QString & filename) // this will force very last text and formatting to be flushed as well tokens.append( new Token( Token::HardReturn ) ); - QString text; - QString layout; - QString formats; + TQString text; + TQString tqlayout; + TQString formats; int LeftMargin = 0; int TopMargin = 36; int RightMargin = 0; @@ -144,13 +144,13 @@ KWordFilter::parse (const QString & filename) KWordFormat flag; int format_pos; - QString fmt; + TQString fmt; // FIXME replace with doc initial code or default style format_pos = 0; fmt = flag.asXML(); - for (QPtrListIterator < Token > it (tokens); it; ++it) + for (TQPtrListIterator < Token > it (tokens); it; ++it) { unsigned int ucode; int attr; @@ -231,8 +231,8 @@ KWordFilter::parse (const QString & filename) // process previous fmt first len = text.length() - format_pos; - formats.append ( "<FORMAT id=\"1\" pos=\"" + QString::number( format_pos ) + - "\" len=\"" + QString::number( len )+ "\">\n" ); + formats.append ( "<FORMAT id=\"1\" pos=\"" + TQString::number( format_pos ) + + "\" len=\"" + TQString::number( len )+ "\">\n" ); formats.append( fmt ); formats.append ( "</FORMAT>\n" ); @@ -248,45 +248,45 @@ KWordFilter::parse (const QString & filename) // last formatting not flushed // SEE ABOVE len = text.length() - format_pos; - formats.append ( " <FORMAT id=\"1\" pos=\"" + QString::number( format_pos ) + - "\" len=\"" + QString::number( len )+ "\">\n" ); + formats.append ( " <FORMAT id=\"1\" pos=\"" + TQString::number( format_pos ) + + "\" len=\"" + TQString::number( len )+ "\">\n" ); formats.append( " " + fmt ); formats.append ( " </FORMAT>\n" ); - layout = ""; - layout.append( "<LAYOUT>\n" ); - layout.append( " <NAME value=\"Standard\" />\n" ); - layout.append( " <FLOW align=\"" + mapAlign( align ) + "\" />\n" ); - layout.append( " <LINESPACING value=\"" + mapLinespace( linespace) + "\" />\n" ); - layout.append( " <LEFTBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <RIGHTBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <TOPBORDER width=\"0\" style=\"0\" />\n" ); - layout.append( " <BOTTOMBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout = ""; + tqlayout.append( "<LAYOUT>\n" ); + tqlayout.append( " <NAME value=\"Standard\" />\n" ); + tqlayout.append( " <FLOW align=\"" + mapAlign( align ) + "\" />\n" ); + tqlayout.append( " <LINESPACING value=\"" + mapLinespace( linespace) + "\" />\n" ); + tqlayout.append( " <LEFTBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <RIGHTBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <TOPBORDER width=\"0\" style=\"0\" />\n" ); + tqlayout.append( " <BOTTOMBORDER width=\"0\" style=\"0\" />\n" ); lm = LeftMargin + LeftMarginAdjust - frameLeftMargin; rm = RightMargin + RightMarginAdjust - frameRightMargin; - layout.append( " <INDENTS left=\"" + QString::number( QMAX( 0, lm ) ) + "\"" + - " right=\"" + QString::number( QMAX( 0 , rm ) ) + "\"" + + tqlayout.append( " <INDENTS left=\"" + TQString::number( TQMAX( 0, lm ) ) + "\"" + + " right=\"" + TQString::number( TQMAX( 0 , rm ) ) + "\"" + " first=\"0\" />\n" ); - layout.append( " <OFFSETS />\n" ); - layout.append( " <PAGEBREAKING />\n" ); - layout.append( " <COUNTER />\n" ); - layout.append( " <FORMAT id=\"1\">\n" ); - layout.append( " <WEIGHT value=\"50\" />\n" ); - layout.append( " <ITALIC value=\"0\" />\n" ); - layout.append( " <UNDERLINE value=\"0\" />\n" ); - layout.append( " <STRIKEOUT value=\"0\" />\n" ); - layout.append( " <CHARSET value=\"0\" />\n" ); - layout.append( " <VERTALIGN value=\"0\" />\n" ); - layout.append( " </FORMAT>\n" ); - layout.append( "</LAYOUT>\n" ); + tqlayout.append( " <OFFSETS />\n" ); + tqlayout.append( " <PAGEBREAKING />\n" ); + tqlayout.append( " <COUNTER />\n" ); + tqlayout.append( " <FORMAT id=\"1\">\n" ); + tqlayout.append( " <WEIGHT value=\"50\" />\n" ); + tqlayout.append( " <ITALIC value=\"0\" />\n" ); + tqlayout.append( " <UNDERLINE value=\"0\" />\n" ); + tqlayout.append( " <STRIKEOUT value=\"0\" />\n" ); + tqlayout.append( " <CHARSET value=\"0\" />\n" ); + tqlayout.append( " <VERTALIGN value=\"0\" />\n" ); + tqlayout.append( " </FORMAT>\n" ); + tqlayout.append( "</LAYOUT>\n" ); // encode text for XML-ness - // FIXME could be faster without QRegExp - text.replace( QRegExp("&"), "&" ); - text.replace( QRegExp("<"), "<" ); - text.replace( QRegExp(">"), ">" ); - text.replace( QRegExp("\""), """ ); - text.replace( QRegExp("'"), "'" ); + // FIXME could be faster without TQRegExp + text.tqreplace( TQRegExp("&"), "&" ); + text.tqreplace( TQRegExp("<"), "<" ); + text.tqreplace( TQRegExp(">"), ">" ); + text.tqreplace( TQRegExp("\""), """ ); + text.tqreplace( TQRegExp("'"), "'" ); // construct the <PARAGRAPH> root.append( "<PARAGRAPH>\n" ); @@ -294,7 +294,7 @@ KWordFilter::parse (const QString & filename) root.append( "<FORMATS>\n"); root.append( formats ); root.append( "</FORMATS>\n"); - root.append( layout ); + root.append( tqlayout ); root.append( "</PARAGRAPH>\n" ); // for the next paragraph @@ -346,7 +346,7 @@ KWordFilter::parse (const QString & filename) case Token::ExtChar: ucode = Parser::ExtCharToUnicode (t->charset (), t->charcode ()); if (ucode == 0) ucode = 32; - text.append( QChar (ucode) ); + text.append( TQChar (ucode) ); break; case Token::TabHardFlushRight: @@ -361,7 +361,7 @@ KWordFilter::parse (const QString & filename) } - QString content = root; + TQString content = root; root = "<!DOCTYPE DOC>\n"; root.append( "<DOC mime=\"application/x-kword\" syntaxVersion=\"2\" editor=\"KWord\">\n"); @@ -371,10 +371,10 @@ KWordFilter::parse (const QString & filename) // paper definition root.append( "<PAPER width=\"595\" height=\"841\" format=\"1\" fType=\"0\" orientation=\"0\" hType=\"0\" columns=\"1\">\n" ); - root.append( " <PAPERBORDERS left=\"" + QString::number(frameLeftMargin) + - "\" right=\"" + QString::number(frameRightMargin) + - "\" top=\"" + QString::number(TopMargin) + - "\" bottom=\"" + QString::number(BottomMargin) + "\" />\n" ); + root.append( " <PAPERBORDERS left=\"" + TQString::number(frameLeftMargin) + + "\" right=\"" + TQString::number(frameRightMargin) + + "\" top=\"" + TQString::number(TopMargin) + + "\" bottom=\"" + TQString::number(BottomMargin) + "\" />\n" ); root.append( "</PAPER>\n" ); root.append( "<ATTRIBUTES standardpage=\"1\" hasFooter=\"0\" hasHeader=\"0\" processing=\"0\" />\n" ); @@ -393,7 +393,7 @@ KWordFilter::parse (const QString & filename) // e.g /home/ariya/test/resume.wpd will have 'resume' as the title if( docTitle.isEmpty() ) { - QFileInfo info( filename ); + TQFileInfo info( filename ); docTitle = info.baseName(); } diff --git a/filters/kword/wordperfect/import/kwordfilter.h b/filters/kword/wordperfect/import/kwordfilter.h index d930d917..33e0d717 100644 --- a/filters/kword/wordperfect/import/kwordfilter.h +++ b/filters/kword/wordperfect/import/kwordfilter.h @@ -30,11 +30,11 @@ class KWordFilter: public Parser public: - QString root; - QString documentInfo; + TQString root; + TQString documentInfo; KWordFilter(); - bool parse( const QString& filename ); + bool parse( const TQString& filename ); }; diff --git a/filters/kword/wordperfect/import/parser.cpp b/filters/kword/wordperfect/import/parser.cpp index bbf5404d..7b87e5a6 100644 --- a/filters/kword/wordperfect/import/parser.cpp +++ b/filters/kword/wordperfect/import/parser.cpp @@ -19,11 +19,11 @@ #include "parser.h" -#include <qmemarray.h> -#include <qdatastream.h> -#include <qfile.h> -#include <qptrlist.h> -#include <qstring.h> +#include <tqmemarray.h> +#include <tqdatastream.h> +#include <tqfile.h> +#include <tqptrlist.h> +#include <tqstring.h> using namespace WP; @@ -96,7 +96,7 @@ Parser::Parser () } bool -Parser::parse (const QString & filename) +Parser::parse (const TQString & filename) { // initialize tokens.clear(); @@ -104,17 +104,17 @@ Parser::parse (const QString & filename) docTitle = docAuthor = docAbstract = ""; // open input file and assign the stream - QDataStream stream; - QFile in (filename); + TQDataStream stream; + TQFile in (filename); if (!in.open (IO_ReadOnly)) return FALSE; stream.setDevice (&in); // must be little-endian - stream.setByteOrder (QDataStream::LittleEndian); + stream.setByteOrder (TQDataStream::LittleEndian); // read 16-bytes document header - Q_UINT8 header[16]; + TQ_UINT8 header[16]; for (int k = 0; k < 16; k++) stream >> header[k]; @@ -163,11 +163,11 @@ Parser::parse (const QString & filename) } void -Parser::parsePacketWP5( const QString & filename ) +Parser::parsePacketWP5( const TQString & filename ) { // open input file and assign the stream - QDataStream stream; - QFile in (filename); + TQDataStream stream; + TQFile in (filename); if (!in.open (IO_ReadOnly)) return; stream.setDevice (&in); @@ -175,11 +175,11 @@ Parser::parsePacketWP5( const QString & filename ) unsigned filesize = stream.device()->size(); // must be little-endian - stream.setByteOrder (QDataStream::LittleEndian); + stream.setByteOrder (TQDataStream::LittleEndian); for( unsigned next_block=16; next_block>0; ) { - QMemArray<Q_UINT8> buf( 10 ); + TQMemArray<TQ_UINT8> buf( 10 ); stream.device()->at( next_block ); for( int c=0; c<10; c++ ) stream >> buf.at( c ); @@ -194,8 +194,8 @@ Parser::parsePacketWP5( const QString & filename ) for( unsigned v=0; v<count; v++ ) { - Q_UINT16 packet_type; - Q_UINT32 packet_size, packet_pos; + TQ_UINT16 packet_type; + TQ_UINT32 packet_size, packet_pos; stream >> packet_type; stream >> packet_size; stream >> packet_pos; @@ -215,7 +215,7 @@ Parser::parsePacketWP5( const QString & filename ) } // load all packets - for( QPtrListIterator<Packet> it(packets); it; ++it ) + for( TQPtrListIterator<Packet> it(packets); it; ++it ) { Packet* p = it.current(); stream.device()->at( p->pos ); @@ -227,7 +227,7 @@ Parser::parsePacketWP5( const QString & filename ) in.close(); // process all known packets - for( QPtrListIterator<Packet> i(packets); i; ++i ) + for( TQPtrListIterator<Packet> i(packets); i; ++i ) { Packet* p = i.current(); if( p->data.size()==0 ) continue; @@ -236,7 +236,7 @@ Parser::parsePacketWP5( const QString & filename ) if( p->type== 1 ) { unsigned c; - QString desc, desc_type, subject, author, typist, abstract; + TQString desc, desc_type, subject, author, typist, abstract; // handle difference between WP 5.0 and WP 5.1 unsigned limit = (p->data[p->data.size()-1]==0xff) ? 94 : 57; @@ -265,11 +265,11 @@ Parser::parsePacketWP5( const QString & filename ) } void -Parser::parsePacketWP6( const QString & filename ) +Parser::parsePacketWP6( const TQString & filename ) { // open input file and assign the stream - QDataStream stream; - QFile in (filename); + TQDataStream stream; + TQFile in (filename); if (!in.open (IO_ReadOnly)) return; stream.setDevice (&in); @@ -277,9 +277,9 @@ Parser::parsePacketWP6( const QString & filename ) unsigned filesize = stream.device()->size(); // must be little-endian - stream.setByteOrder (QDataStream::LittleEndian); + stream.setByteOrder (TQDataStream::LittleEndian); - Q_UINT16 flag, count; + TQ_UINT16 flag, count; stream.device()->at( 0x200 ); stream >> flag; // FIXME should be checked == 2 ? @@ -288,9 +288,9 @@ Parser::parsePacketWP6( const QString & filename ) stream.device()->at( 0x20e ); for( unsigned c=0; c<count; c++ ) { - Q_UINT8 packet_type, packet_flag; - Q_UINT16 count, hidcount; - Q_UINT32 packet_size, packet_pos; + TQ_UINT8 packet_type, packet_flag; + TQ_UINT16 count, hidcount; + TQ_UINT32 packet_size, packet_pos; stream >> packet_flag; stream >> packet_type; @@ -309,7 +309,7 @@ Parser::parsePacketWP6( const QString & filename ) } // load all packets - for( QPtrListIterator<Packet> it(packets); it; ++it ) + for( TQPtrListIterator<Packet> it(packets); it; ++it ) { Packet* p = it.current(); stream.device()->at( p->pos ); @@ -321,7 +321,7 @@ Parser::parsePacketWP6( const QString & filename ) in.close(); // process all known packets - for( QPtrListIterator<Packet> i(packets); i; ++i ) + for( TQPtrListIterator<Packet> i(packets); i; ++i ) { Packet* p = i.current(); if( p->data.size()==0 ) continue; @@ -333,7 +333,7 @@ Parser::parsePacketWP6( const QString & filename ) { unsigned size = p->data[j] + (p->data[j+1]<<8); unsigned tag = p->data[j+2] + (p->data[j+3]<<8); - QString str; + TQString str; for( unsigned k=0; k<size-8; k++) if(!((j+8+k)&1)) if( p->data[j+8+k]==0 ) break; @@ -354,11 +354,11 @@ Parser::parsePacketWP6( const QString & filename ) } void -Parser::parseDocWP5( const QString & filename, int start ) +Parser::parseDocWP5( const TQString & filename, int start ) { // open input file and assign the stream - QDataStream stream; - QFile in (filename); + TQDataStream stream; + TQFile in (filename); if (!in.open (IO_ReadOnly)) return; stream.setDevice (&in); @@ -368,18 +368,18 @@ Parser::parseDocWP5( const QString & filename, int start ) if ( start >= stream.device ()->size () ) return; // must be little-endian - stream.setByteOrder (QDataStream::LittleEndian); + stream.setByteOrder (TQDataStream::LittleEndian); // seek to start of document area stream.device ()->at (start); // main loop - QString text; + TQString text; while (!stream.atEnd ()) { // read one byte - Q_UINT8 code; + TQ_UINT8 code; stream >> code; // ASCII printable characters ? @@ -389,13 +389,13 @@ Parser::parseDocWP5( const QString & filename, int start ) { // either fixed-length or variable-length function - QMemArray < Q_UINT8 > data; - QMemArray < Q_UINT16 > pid; - Q_UINT8 subfunction = 0; + TQMemArray < TQ_UINT8 > data; + TQMemArray < TQ_UINT16 > pid; + TQ_UINT8 subfunction = 0; if ((code >= 0xC0) && (code <= 0xCF)) { - Q_UINT8 dummy; + TQ_UINT8 dummy; unsigned lentab[] = { 2, 7, 9, 1, 1, 3, 4, 5, 2, 3, 4, 4, 6, 8, 8, 10 }; unsigned length = lentab[code & 0x0F]; @@ -406,7 +406,7 @@ Parser::parseDocWP5( const QString & filename, int start ) } else if ((code >= 0xD0) && (code <= 0xFF)) { - Q_UINT16 length; + TQ_UINT16 length; stream >> subfunction; stream >> length; @@ -563,11 +563,11 @@ Parser::parseDocWP5( const QString & filename, int start ) } void -Parser::parseDocWP6 (const QString & filename, int start) +Parser::parseDocWP6 (const TQString & filename, int start) { // open input file and assign the stream - QDataStream stream; - QFile in (filename); + TQDataStream stream; + TQFile in (filename); if (!in.open (IO_ReadOnly)) return; stream.setDevice (&in); @@ -577,18 +577,18 @@ Parser::parseDocWP6 (const QString & filename, int start) if ( start >= stream.device ()->size () ) return; // must be little-endian - stream.setByteOrder (QDataStream::LittleEndian); + stream.setByteOrder (TQDataStream::LittleEndian); // seek to start of document area stream.device ()->at (start); // main loop - QString text; + TQString text; while (!stream.atEnd ()) { // read one byte - Q_UINT8 code; + TQ_UINT8 code; stream >> code; // ASCII printable characters ? @@ -617,13 +617,13 @@ Parser::parseDocWP6 (const QString & filename, int start) { // either fixed-length or variable-length function - QMemArray < Q_UINT8 > data; - QMemArray < Q_UINT16 > pid; - Q_UINT8 subfunction = 0; + TQMemArray < TQ_UINT8 > data; + TQMemArray < TQ_UINT16 > pid; + TQ_UINT8 subfunction = 0; if ((code >= 0xF0) && (code <= 0xFF)) { - Q_UINT8 dummy; + TQ_UINT8 dummy; unsigned lentab[] = { 2, 3, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 6, 6, 0 }; unsigned length = lentab[code & 0x0F]; @@ -634,8 +634,8 @@ Parser::parseDocWP6 (const QString & filename, int start) } else if ((code >= 0xD0) && (code <= 0xFF)) { - Q_UINT16 length; - Q_UINT8 flag = 0, numpid = 0; + TQ_UINT16 length; + TQ_UINT8 flag = 0, numpid = 0; stream >> subfunction; stream >> length; stream >> flag; @@ -650,15 +650,15 @@ Parser::parseDocWP6 (const QString & filename, int start) length = length - 1 - numpid * 2; } - Q_UINT16 nondel; + TQ_UINT16 nondel; stream >> nondel; data.resize (length); for (int c = 0; length && !stream.atEnd (); length--, c++) stream >> data[c]; - Q_UINT16 dummy_length; - Q_UINT8 dummy_code; + TQ_UINT16 dummy_length; + TQ_UINT8 dummy_code; stream >> dummy_length; // FIXME should be checked == length ? stream >> dummy_code; // FIXME should be checked == code ? @@ -825,7 +825,7 @@ Parser::parseDocWP6 (const QString & filename, int start) if( p->type==85 ) { // read the typeface (stored as WP word-string) - QString typeface; + TQString typeface; unsigned strlen = p->data[22]; for( unsigned i=24; strlen && (i<p->data.size()); i+=2, strlen-=2 ) if( p->data[i]) typeface.append( p->data[i] ); @@ -833,7 +833,7 @@ Parser::parseDocWP6 (const QString & filename, int start) typeface = typeface.stripWhiteSpace(); // hack: get rid of "Regular" as font name suffix - QString suffix = "Regular"; + TQString suffix = "Regular"; if( typeface.right( suffix.length() ) == suffix ) typeface = typeface.left( typeface.length() - suffix.length() ).stripWhiteSpace(); @@ -959,9 +959,9 @@ mapToTabType (int t) } void -Parser::handleTab (QMemArray < Q_UINT8 > data) +Parser::handleTab (TQMemArray < TQ_UINT8 > data) { - QPtrList < Token::Tab > tabs; + TQPtrList < Token::Tab > tabs; bool relative = data[0]; int adjust = data[1] + (data[2] << 8); int num = data[3]; @@ -1002,7 +1002,7 @@ Parser::handleTab (QMemArray < Q_UINT8 > data) } -// the following tables maps WP charset/charcode to unicode character +// the following tables maps WP charset/charcode to tqunicode character // WP multinational characters (charset 1) static unsigned multinational_map[] = { diff --git a/filters/kword/wordperfect/import/parser.h b/filters/kword/wordperfect/import/parser.h index 832a02f8..2a69ad27 100644 --- a/filters/kword/wordperfect/import/parser.h +++ b/filters/kword/wordperfect/import/parser.h @@ -21,9 +21,9 @@ #ifndef __WP_PARSER_H #define __WP_PARSER_H -#include <qptrlist.h> -#include <qmemarray.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqmemarray.h> +#include <tqstring.h> namespace WP { @@ -64,7 +64,7 @@ namespace WP { Left, Right, Center, Full, All }; enum TabType - { LeftTab, CenterTab, RightTab, DecimalTab, VerticalTab }; + { LeftTab, CenterTab, RightTab, DecimalTab,Qt::VerticalTab }; class Tab { @@ -82,7 +82,7 @@ namespace WP Token (Type type) { m_type = type; } - Token (const QString & text) { m_type = Text; m_text = text; } + Token (const TQString & text) { m_type = Text; m_text = text; } Token (Type type, Attr attr) { m_type = type; m_attr = attr; } @@ -105,9 +105,9 @@ namespace WP m_blue = blue; } - Token (Type type, QString fontface){ m_type = FontFace; m_fontface = fontface; } + Token (Type type, TQString fontface){ m_type = FontFace; m_fontface = fontface; } - Token (const QPtrList < Tab > &tabs) + Token (const TQPtrList < Tab > &tabs) { m_type = TabSet; m_tabs = tabs; @@ -117,7 +117,7 @@ namespace WP int value (){ return m_value; } - QString text (){ return m_text; } + TQString text (){ return m_text; } Attr attr (){ return m_attr; } @@ -127,23 +127,23 @@ namespace WP int green (){ return m_green; } int blue (){ return m_blue; } - QString fontface (){ return m_fontface; } + TQString fontface (){ return m_fontface; } int charset (){ return m_charset; } int charcode (){ return m_charcode; } - QPtrList < Tab > tabs (){ return m_tabs; } + TQPtrList < Tab > tabs (){ return m_tabs; } private: Type m_type; int m_value; - QString m_text; + TQString m_text; Attr m_attr; Align m_align; int m_red, m_green, m_blue; - QString m_fontface; + TQString m_fontface; int m_charset, m_charcode; - QPtrList < Tab > m_tabs; + TQPtrList < Tab > m_tabs; @@ -153,7 +153,7 @@ namespace WP { public: unsigned type, size, pos; - QMemArray<Q_UINT8> data; + TQMemArray<TQ_UINT8> data; }; /** @@ -173,15 +173,15 @@ namespace WP * @returns TRUE if parsing was successful, otherwise FALSE. * */ - bool parse (const QString & filename); + bool parse (const TQString & filename); // high byte is major version, 0=WP 5.x, 2=WP 6/7/8 int version; - QString docTitle, docAuthor, docAbstract; + TQString docTitle, docAuthor, docAbstract; - QPtrList<Token> tokens; - QPtrList<Packet> packets; + TQPtrList<Token> tokens; + TQPtrList<Packet> packets; /** * Maps WordPerfect extended character to its Unicode equivalent. Supported character @@ -196,13 +196,13 @@ namespace WP private: - void handleTab ( QMemArray <Q_UINT8> data ); + void handleTab ( TQMemArray <TQ_UINT8> data ); - void parsePacketWP5( const QString & filename ); - void parseDocWP5( const QString & filename, int start ); + void parsePacketWP5( const TQString & filename ); + void parseDocWP5( const TQString & filename, int start ); - void parsePacketWP6( const QString & filename ); - void parseDocWP6( const QString & filename, int start ); + void parsePacketWP6( const TQString & filename ); + void parseDocWP6( const TQString & filename, int start ); }; diff --git a/filters/kword/wordperfect/import/wpimport.cc b/filters/kword/wordperfect/import/wpimport.cc index 882bd890..5554f6e0 100644 --- a/filters/kword/wordperfect/import/wpimport.cc +++ b/filters/kword/wordperfect/import/wpimport.cc @@ -214,11 +214,11 @@ void KWordHandler::endDocument() -WPImport::WPImport( KoFilter *, const char *, const QStringList& ): KoFilter() +WPImport::WPImport( KoFilter *, const char *, const TQStringList& ): KoFilter() { } -KoFilter::ConversionStatus WPImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus WPImport::convert( const TQCString& from, const TQCString& to ) { // check for proper conversion if(to!= "application/vnd.sun.xml.writer" || from != "application/wordperfect" ) @@ -260,7 +260,7 @@ KoFilter::ConversionStatus WPImport::convert( const QCString& from, const QCStri KoStoreDevice* manifest = m_chain->storageFile( "META-INF/manifest.xml", KoStore::Write ); if ( manifest ) { - QCString manifeststring = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\ + TQCString manifeststring = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\ <!DOCTYPE manifest:manifest PUBLIC \"-//OpenOffice.org//DTD Manifest 1.0//EN\" \"Manifest.dtd\">\n\ <manifest:manifest xmlns:manifest=\"http://openoffice.org/2001/manifest\">\n\ <manifest:file-entry manifest:media-type=\"application/vnd.sun.xml.writer\" manifest:full-path=\"/\"/>\n\ @@ -273,7 +273,7 @@ KoFilter::ConversionStatus WPImport::convert( const QCString& from, const QCStri KoStoreDevice* styles = m_chain->storageFile( "styles.xml", KoStore::Write ); if ( styles ) { - QCString stylesstring = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\ + TQCString stylesstring = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\ <!DOCTYPE office:document-styles PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"office.dtd\">\ <office:document-styles xmlns:office=\"http://openoffice.org/2000/office\" xmlns:style=\"http://openoffice.org/2000/style\"\ xmlns:text=\"http://openoffice.org/2000/text\" xmlns:table=\"http://openoffice.org/2000/table\"\ @@ -291,14 +291,14 @@ KoFilter::ConversionStatus WPImport::convert( const QCString& from, const QCStri <style:default-style style:family=\"table-row\"/>\ <style:default-style style:family=\"table-column\"/>\ <style:style style:name=\"Standard\" style:family=\"paragraph\" style:class=\"text\"/>\ -<style:style style:name=\"Text body\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"text\"/>\ -<style:style style:name=\"List\" style:family=\"paragraph\" style:parent-style-name=\"Text body\" style:class=\"list\"/>\ -<style:style style:name=\"Header\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"extra\"/>\ -<style:style style:name=\"Footer\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"extra\"/>\ -<style:style style:name=\"Caption\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"extra\"/>\ -<style:style style:name=\"Footnote\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"extra\"/>\ -<style:style style:name=\"Endnote\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"extra\"/>\ -<style:style style:name=\"Index\" style:family=\"paragraph\" style:parent-style-name=\"Standard\" style:class=\"index\"/>\ +<style:style style:name=\"Text body\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"text\"/>\ +<style:style style:name=\"List\" style:family=\"paragraph\" style:tqparent-style-name=\"Text body\" style:class=\"list\"/>\ +<style:style style:name=\"Header\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"extra\"/>\ +<style:style style:name=\"Footer\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"extra\"/>\ +<style:style style:name=\"Caption\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"extra\"/>\ +<style:style style:name=\"Footnote\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"extra\"/>\ +<style:style style:name=\"Endnote\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"extra\"/>\ +<style:style style:name=\"Index\" style:family=\"paragraph\" style:tqparent-style-name=\"Standard\" style:class=\"index\"/>\ <style:style style:name=\"Footnote Symbol\" style:family=\"text\">\ <style:properties style:text-position=\"super 58%\"/>\ </style:style>\ diff --git a/filters/kword/wordperfect/import/wpimport.h b/filters/kword/wordperfect/import/wpimport.h index 0656fb35..862b7683 100644 --- a/filters/kword/wordperfect/import/wpimport.h +++ b/filters/kword/wordperfect/import/wpimport.h @@ -20,13 +20,13 @@ #ifndef __WPIMPORT_H #define __WPIMPORT_H -#include <qstring.h> -#include <qdatastream.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qcstring.h> -#include <qmemarray.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdatastream.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqcstring.h> +#include <tqmemarray.h> +#include <tqdom.h> #include <KoFilter.h> #include <KoStore.h> @@ -34,20 +34,21 @@ class WPImport : public KoFilter { Q_OBJECT + TQ_OBJECT protected: - QString m_output; + TQString m_output; public: - WPImport(KoFilter *parent, const char *name, const QStringList&); + WPImport(KoFilter *tqparent, const char *name, const TQStringList&); WPImport(); virtual ~WPImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; #endif // __WPIMPORT_H diff --git a/filters/kword/wordperfect/status_old.html b/filters/kword/wordperfect/status_old.html index 7d103e9d..1db3dc09 100644 --- a/filters/kword/wordperfect/status_old.html +++ b/filters/kword/wordperfect/status_old.html @@ -55,7 +55,7 @@ <li>font information: size, typeface, color</li> <li>WP extended character converted to Unicode</li> <li>character formatting: bold, italics, underline, double underline, strikeout, superscript, subscript</li> - <li>paragraph layout: linespacing, justification</li> + <li>paragraph tqlayout: linespacing, justification</li> <li>page settings: margins</li> <li>document summary: title, author, abstract</li> </ul> @@ -86,7 +86,7 @@ <dl> <dt>29 Aug 2001 <dd>first implementation, only for WP 5.x, can import - all text along with formatting, using QDom + all text along with formatting, using TQDom </dl> </td> </tr> |