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/karbon/applixgraphics | |
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/karbon/applixgraphics')
-rw-r--r-- | filters/karbon/applixgraphics/applixgraphicimport.cc | 78 | ||||
-rw-r--r-- | filters/karbon/applixgraphics/applixgraphicimport.h | 7 |
2 files changed, 43 insertions, 42 deletions
diff --git a/filters/karbon/applixgraphics/applixgraphicimport.cc b/filters/karbon/applixgraphics/applixgraphicimport.cc index 2ee52685..8a433ec9 100644 --- a/filters/karbon/applixgraphics/applixgraphicimport.cc +++ b/filters/karbon/applixgraphics/applixgraphicimport.cc @@ -25,9 +25,9 @@ #endif #include <kdebug.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qmessagebox.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqmessagebox.h> #include <KoFilterChain.h> #include <kgenericfactory.h> #include <math.h> @@ -115,7 +115,7 @@ applixGraphicsRect::applixGraphicsRect() : applixGraphicsLine() * * * * ******************************************************************************/ -APPLIXGRAPHICImport::APPLIXGRAPHICImport (KoFilter *, const char *, const QStringList&) : +APPLIXGRAPHICImport::APPLIXGRAPHICImport (KoFilter *, const char *, const TQStringList&) : KoFilter () { @@ -133,7 +133,7 @@ APPLIXGRAPHICImport::APPLIXGRAPHICImport (KoFilter *, const char *, const QStrin * * * * ******************************************************************************/ -KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus APPLIXGRAPHICImport::convert( const TQCString& from, const TQCString& to ) { // Check MIME Types @@ -141,7 +141,7 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c return KoFilter::NotImplemented; // Open Inputfile - QFile in (m_chain->inputFile()); + TQFile in (m_chain->inputFile()); if (!in.open (IO_ReadOnly) ) { kdError(30502) << "Unable to open input file!" << endl; @@ -149,21 +149,21 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c return KoFilter::FileNotFound; } - QString str; + TQString str; // Create karbon header str += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; str += "<!DOCTYPE karbon>\n"; str += " <karbon mime=\"application/x-karbon\" version=\"2\" editor=\"APPLIXGRAPHICS import filter\">\n"; // str += " <head>\n"; -// str += " <layout width=\"210\" lmargin=\"0\" format=\"a4\" bmargin=\"0\" height=\"297\" rmargin=\"0\" tmargin=\"0\" orientation=\"portrait\"/>\n"; +// str += " <tqlayout width=\"210\" lmargin=\"0\" format=\"a4\" bmargin=\"0\" height=\"297\" rmargin=\"0\" tmargin=\"0\" orientation=\"portrait\"/>\n"; // str += " <grid dx=\"20\" dy=\"20\" align=\"0\">\n"; // str += " <helplines align=\"0\"/>\n"; // str += " </grid>\n"; // str += " </head>\n"; str += " <layer name=\"ag-layer\" visible=\"1\">\n"; - QTextStream stream(&in); + TQTextStream stream(&in); int step = in.size()/50; int value = 0; int i = 0; @@ -171,7 +171,7 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c int pos = 0; int vers[3] = { 0, 0, 0 }; int rueck; // Check scanf inputs - QString mystr; + TQString mystr; // Read Headline mystr = stream.readLine (); @@ -186,13 +186,13 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c kdDebug (s_area) << "Header not correkt - May be it is not an applixgraphics file" << endl; kdDebug (s_area) << "Headerline: " << mystr << endl; - QMessageBox::critical (0L, "Applixgraphics header problem", - QString ("The Applixgraphics header is not correct. " + TQMessageBox::critical (0L, "Applixgraphics header problem", + TQString ("The Applixgraphics header is not correct. " "May be it is not an applixgraphics 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()), "Comma"); - // 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 KoFilter::StupidError; } @@ -231,11 +231,11 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c //mystr.remove (0, 7); - //remove_pos = mystr.find ('('); + //remove_pos = mystr.tqfind ('('); //mystr.remove (0, remove_pos); //agLine.offX= mystr.toInt(); - //remove_pos = mystr.find (','); + //remove_pos = mystr.tqfind (','); //mystr.remove (0, remove_pos); //agLine.offY= mystr.toInt(); rueck = sscanf ((const char *) mystr.latin1(), "(%d,%d)", @@ -301,16 +301,16 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c str += " <polyline arrow1=\"0\" arrow2=\"0\" >\n"; // str += " <point x=\"" + agLine.ptX[0] + "\" y=\"" + agLine.ptY[0] + "\" />"; str += " <point x=\"" ; - str += QString::number ((agLine.ptX[0] + agLine.offX)/FAKTOR); + str += TQString::number ((agLine.ptX[0] + agLine.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((agLine.ptY[0] + agLine.offY)/FAKTOR); + str += TQString::number ((agLine.ptY[0] + agLine.offY)/FAKTOR); str += "\" />\n"; // str += " <point x=\"" + agLine.ptX[1] + "\" y=\"" + agLine.ptY[1] + "\" />"; str += " <point x=\""; - str += QString::number ((agLine.ptX[1] + agLine.offX)/FAKTOR); + str += TQString::number ((agLine.ptX[1] + agLine.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((agLine.ptY[1] + agLine.offY)/FAKTOR); + str += TQString::number ((agLine.ptY[1] + agLine.offY)/FAKTOR); str += "\" />\n"; str += " <gobject fillstyle=\"0\" linewidth=\"1\" strokecolor=\"#000000\" strokestyle=\"1\" >\n"; str += " <matrix dx=\"0\" dy=\"0\" m21=\"0\" m22=\"1\" m11=\"1\" m12=\"0\" />\n"; @@ -411,8 +411,8 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c b = agLine.ptY[2] / 2; for (int i=0; i<nsides; i++) { - x[i] = qRound (a * cos (wink*M_PI/180)); - y[i] = qRound (b * sin (wink*M_PI/180)); + x[i] = tqRound (a * cos (wink*M_PI/180)); + y[i] = tqRound (b * sin (wink*M_PI/180)); wink += (360/nsides); } @@ -421,9 +421,9 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c for (int i=0; i<nsides; i++) { str += " <point x=\"" ; - str += QString::number ((x[i] + agLine.offX)/FAKTOR); + str += TQString::number ((x[i] + agLine.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((y[i] + agLine.offY)/FAKTOR); + str += TQString::number ((y[i] + agLine.offY)/FAKTOR); str += "\" />\n"; } @@ -514,9 +514,9 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c // Werte in die Struktur einlagern str += " <text "; str += "x=\"" ; - str += QString::number (agText.offX); + str += TQString::number (agText.offX); str += "\" y=\"" ; - str += QString::number (agText.offY); + str += TQString::number (agText.offY); str += "\" >\n"; str += " <![CDATA[" + agText.str; str += "]]>\n"; @@ -672,38 +672,38 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c // Werte in die Struktur einlagern str += " <rectangle "; str += "x=\"" ; - str += QString::number ((agRect.offX)/FAKTOR); + str += TQString::number ((agRect.offX)/FAKTOR); str += "\" y=\""; - str += QString::number ((agRect.offY)/FAKTOR); + str += TQString::number ((agRect.offY)/FAKTOR); str += "\" width=\"" ; - str += QString::number ((agRect.ptX[2])/FAKTOR); + str += TQString::number ((agRect.ptX[2])/FAKTOR); str += "\" height=\""; - str += QString::number ((agRect.ptY[2])/FAKTOR); + str += TQString::number ((agRect.ptY[2])/FAKTOR); str += "\" >\n"; str += " <polyline arrow1=\"0\" arrow2=\"0\" >\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; str += "\" />\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.offY)/FAKTOR) ; str += "\" />\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.ptX[2] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; str += "\" />\n"; str += " <point x=\"" ; - str += QString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; + str += TQString::number ((agRect.ptX[0] + agRect.offX)/FAKTOR) ; str += "\" y=\"" ; - str += QString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; + str += TQString::number ((agRect.ptY[0] + agRect.ptY[2] + agRect.offY)/FAKTOR) ; str += "\" />\n"; @@ -818,7 +818,7 @@ KoFilter::ConversionStatus APPLIXGRAPHICImport::convert( const QCString& from, c return KoFilter::StorageCreationError; } - QCString cstring = str.utf8(); + TQCString cstring = str.utf8(); out->writeBlock ( (const char*)cstring, cstring.size() - 1 ); in.close (); diff --git a/filters/karbon/applixgraphics/applixgraphicimport.h b/filters/karbon/applixgraphics/applixgraphicimport.h index a65e26db..4b25471d 100644 --- a/filters/karbon/applixgraphics/applixgraphicimport.h +++ b/filters/karbon/applixgraphics/applixgraphicimport.h @@ -26,12 +26,13 @@ class APPLIXGRAPHICImport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - APPLIXGRAPHICImport (KoFilter *parent, const char *name, const QStringList&); + APPLIXGRAPHICImport (KoFilter *tqparent, const char *name, const TQStringList&); virtual ~APPLIXGRAPHICImport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); }; @@ -47,7 +48,7 @@ class applixGraphicsLine int thickNess; int ptX[5]; int ptY[5]; - QString str; + TQString str; applixGraphicsLine (); // Constructor }; |