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/kspread/gnumeric | |
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/kspread/gnumeric')
-rw-r--r-- | filters/kspread/gnumeric/gnumeric.xsd | 20 | ||||
-rw-r--r-- | filters/kspread/gnumeric/gnumericexport.cc | 358 | ||||
-rw-r--r-- | filters/kspread/gnumeric/gnumericexport.h | 35 | ||||
-rw-r--r-- | filters/kspread/gnumeric/gnumericimport.cc | 440 | ||||
-rw-r--r-- | filters/kspread/gnumeric/gnumericimport.h | 31 | ||||
-rw-r--r-- | filters/kspread/gnumeric/status.html | 14 |
6 files changed, 450 insertions, 448 deletions
diff --git a/filters/kspread/gnumeric/gnumeric.xsd b/filters/kspread/gnumeric/gnumeric.xsd index 3ff04ff1..d9ab545b 100644 --- a/filters/kspread/gnumeric/gnumeric.xsd +++ b/filters/kspread/gnumeric/gnumeric.xsd @@ -427,8 +427,8 @@ </xsd:complexType> </xsd:element> </xsd:sequence> - <xsd:attribute name="HAlign" type="gmr:horizontal_alignment"/> - <xsd:attribute name="VAlign" type="gmr:vertical_alignment" /> + <xsd:attribute name="HAlign" type="gmr:horizontal_tqalignment"/> + <xsd:attribute name="VAlign" type="gmr:vertical_tqalignment" /> <xsd:attribute name="WrapText" type="xsd:boolean" /> <xsd:attribute name="ShrinkToFit" type="xsd:integer" /> <!-- should be bool, but some files have odd truth values --> <xsd:attribute name="Rotation" type="xsd:integer" use="optional"/> @@ -492,7 +492,7 @@ </xsd:restriction> </xsd:simpleType> - <xsd:simpleType name="horizontal_alignment"> + <xsd:simpleType name="horizontal_tqalignment"> <xsd:restriction base="xsd:integer"> <!-- this is a bit map as follows: 1 = GENERAL @@ -508,7 +508,7 @@ </xsd:restriction> </xsd:simpleType> - <xsd:simpleType name="vertical_alignment"> + <xsd:simpleType name="vertical_tqalignment"> <xsd:restriction base="xsd:integer"> <!-- this is a bit map as follows: 1 = TOP @@ -531,14 +531,14 @@ 4 = 25% 5 = 12.5% 6 = 6.25% - 7 = Horizontal Stripe - 8 = Vertical Stripe + 7 =Qt::Horizontal Stripe + 8 =Qt::Vertical Stripe 9 = Reverse Diagonal Stripe 10 = Diagonal Stripe 11 = Diagonal Crosshatch 12 = Thick Diagonal Crosshatch - 13 = Thin Horizontal Stripe - 14 = Thin Vertical Stripe + 13 = ThinQt::Horizontal Stripe + 14 = ThinQt::Vertical Stripe 15 = Thin Reverse Diagonal Stripe 16 = Thin Diagonal Stripe 17 = Thin Crosshatch @@ -644,7 +644,7 @@ <xsd:attribute name="FillColor" type="gmr:color" use="required"/> <xsd:attribute name="Type" type="gmr:objectfilled" use="required"/> <xsd:attribute name="Width" type="xsd:positiveInteger" use="required"/> - <!-- the arrow shape attributes are only used if the type is + <!-- the arrow tqshape attributes are only used if the type is arrow (type="gmr:2") --> <xsd:attribute name="ArrowShapeA" type="xsd:double" use="optional"/> @@ -801,7 +801,7 @@ <xsd:attribute name="ExprID" type="xsd:positiveInteger" use="optional"/> <!-- ValueType is not used if the cell contains an expression --> <xsd:attribute name="ValueType" type="gmr:cell_type" use="optional"/> - <!-- ValueFormat is apparently used only for cell-by-cell format + <!-- ValueFormat is aptqparently used only for cell-by-cell format overrides --> <xsd:attribute name="ValueFormat" type="xsd:string" use="optional"/> diff --git a/filters/kspread/gnumeric/gnumericexport.cc b/filters/kspread/gnumeric/gnumericexport.cc index 443353f4..beb78879 100644 --- a/filters/kspread/gnumeric/gnumericexport.cc +++ b/filters/kspread/gnumeric/gnumericexport.cc @@ -27,11 +27,11 @@ #include <kmessagebox.h> #include <kgenericfactory.h> #include <KoFilterChain.h> -#include <qapplication.h> -#include <qptrlist.h> -#include <qsortedlist.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqapplication.h> +#include <tqptrlist.h> +#include <tqsortedlist.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <kspread_map.h> #include <kspread_sheet.h> @@ -46,7 +46,7 @@ using namespace KSpread; typedef KGenericFactory<GNUMERICExport, KoFilter> GNUMERICExportFactory; K_EXPORT_COMPONENT_FACTORY( libgnumericexport, GNUMERICExportFactory( "kofficefilters" ) ) -GNUMERICExport::GNUMERICExport(KoFilter *, const char *, const QStringList&) : +GNUMERICExport::GNUMERICExport(KoFilter *, const char *, const TQStringList&) : KoFilter() { isLink = false; @@ -60,39 +60,39 @@ KoFilter() bool GNUMERICExport::hasBorder(Cell *cell, int currentcolumn, int currentrow) { if ( ( (cell->format()->leftBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->leftBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) || + (cell->format()->leftBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) || ( (cell->format()->rightBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->rightBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) || + (cell->format()->rightBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) || ( (cell->format()->topBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->topBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) || + (cell->format()->topBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) || ( (cell->format()->bottomBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->bottomBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) || + (cell->format()->bottomBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) || ( (cell->format()->fallDiagonalWidth(currentcolumn, currentrow) != 0) && - (cell->format()->fallDiagonalStyle(currentcolumn, currentrow) != Qt::NoPen ) ) || + (cell->format()->fallDiagonalStyle(currentcolumn, currentrow) != TQt::NoPen ) ) || ( (cell->format()->goUpDiagonalWidth(currentcolumn, currentrow) != 0) && - (cell->format()->goUpDiagonalStyle(currentcolumn, currentrow) != Qt::NoPen ) ) ) + (cell->format()->goUpDiagonalStyle(currentcolumn, currentrow) != TQt::NoPen ) ) ) return true; else return false; } -const QString GNUMERICExport::ColorToString(int red, int green, int blue) +const TQString GNUMERICExport::ColorToString(int red, int green, int blue) { - return QString::number(red,16)+":"+QString::number(green,16)+":"+QString::number(blue,16); + return TQString::number(red,16)+":"+TQString::number(green,16)+":"+TQString::number(blue,16); } -QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell, int currentcolumn, int currentrow) +TQDomElement GNUMERICExport::GetBorderStyle(TQDomDocument gnumeric_doc,Cell * cell, int currentcolumn, int currentrow) { - QDomElement border_style; - QDomElement border; + TQDomElement border_style; + TQDomElement border; int red, green, blue; - QColor color; + TQColor color; border_style = gnumeric_doc.createElement("gmr:StyleBorder"); if ( (cell->format()->leftBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->leftBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) + (cell->format()->leftBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) { border = gnumeric_doc.createElement("gmr:Left"); border.setAttribute("Style","1"); @@ -102,7 +102,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell green = color.green()<<8; blue = color.blue()<<8; - border.setAttribute("Color", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + border.setAttribute("Color", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); } else { @@ -113,7 +113,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell border_style.appendChild(border); if ( (cell->format()->rightBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->rightBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) + (cell->format()->rightBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) { border = gnumeric_doc.createElement("gmr:Right"); border.setAttribute("Style","1"); @@ -123,7 +123,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell green = color.green()<<8; blue = color.blue()<<8; - border.setAttribute("Color", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + border.setAttribute("Color", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); } else { @@ -134,7 +134,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell border_style.appendChild(border); if ( (cell->format()->topBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->topBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) + (cell->format()->topBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) { border = gnumeric_doc.createElement("gmr:Top"); border.setAttribute("Style","1"); @@ -144,7 +144,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell green = color.green()<<8; blue = color.blue()<<8; - border.setAttribute("Color", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + border.setAttribute("Color", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); } else { @@ -155,7 +155,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell border_style.appendChild(border); if ( (cell->format()->bottomBorderWidth(currentcolumn, currentrow) != 0) && - (cell->format()->bottomBorderStyle(currentcolumn, currentrow) != Qt::NoPen ) ) + (cell->format()->bottomBorderStyle(currentcolumn, currentrow) != TQt::NoPen ) ) { border = gnumeric_doc.createElement("gmr:Bottom"); border.setAttribute("Style","1"); @@ -165,7 +165,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell green = color.green()<<8; blue = color.blue()<<8; - border.setAttribute("Color", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + border.setAttribute("Color", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); } else { @@ -176,7 +176,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell border_style.appendChild(border); if ( (cell->format()->fallDiagonalWidth(currentcolumn, currentrow) != 0) && - (cell->format()->fallDiagonalStyle(currentcolumn, currentrow) != Qt::NoPen ) ) + (cell->format()->fallDiagonalStyle(currentcolumn, currentrow) != TQt::NoPen ) ) { border = gnumeric_doc.createElement("gmr:Diagonal"); border.setAttribute("Style","1"); @@ -186,7 +186,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell green = color.green()<<8; blue = color.blue()<<8; - border.setAttribute("Color", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + border.setAttribute("Color", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); } else { @@ -197,7 +197,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell border_style.appendChild(border); if ( (cell->format()->goUpDiagonalWidth(currentcolumn, currentrow) != 0) && - (cell->format()->goUpDiagonalStyle(currentcolumn, currentrow) != Qt::NoPen ) ) + (cell->format()->goUpDiagonalStyle(currentcolumn, currentrow) != TQt::NoPen ) ) { border = gnumeric_doc.createElement("gmr:Rev-Diagonal"); border.setAttribute("Style","1"); @@ -207,7 +207,7 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell green = color.green()<<8; blue = color.blue()<<8; - border.setAttribute("Color", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + border.setAttribute("Color", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); } else { @@ -220,13 +220,13 @@ QDomElement GNUMERICExport::GetBorderStyle(QDomDocument gnumeric_doc,Cell * cell return border_style; } -QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell ) +TQDomElement GNUMERICExport::GetValidity( TQDomDocument gnumeric_doc, Cell * cell ) { //<gmr:Validation Style="1" Type="1" Operator="7" AllowBlank="true" UseDropdown="false" Title="ghhg" Message="ghghhhjfhfghjfghj fg hjgf hj"> // <gmr:Expression0>45</gmr:Expression0> // </gmr:Validation> Validity *kspread_validity = cell->getValidity(); - QDomElement val = gnumeric_doc.createElement( "gmr:Validation" ); + TQDomElement val = gnumeric_doc.createElement( "gmr:Validation" ); val.setAttribute( "Title", kspread_validity->title ); val.setAttribute( "Message", kspread_validity->message ); val.setAttribute( "AllowBlank", kspread_validity->allowEmptyCell ? "true":"false" ); @@ -300,19 +300,19 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::InferiorEqual: case Conditional::Different: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number( kspread_validity->valMin ) ) ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number( kspread_validity->valMin ) ) ); val.appendChild( tmp ); } break; case Conditional::Between: case Conditional::DifferentTo: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMin ) ) ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMin ) ) ); val.appendChild( tmp ); tmp = gnumeric_doc.createElement( "gmr:Expression1" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMax ) ) ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMax ) ) ); val.appendChild( tmp ); } break; @@ -338,7 +338,7 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::InferiorEqual: case Conditional::Different: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); tmp.appendChild( gnumeric_doc.createTextNode( kspread_validity->timeMin.toString() ) ); val.appendChild( tmp ); } @@ -346,7 +346,7 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::Between: case Conditional::DifferentTo: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); tmp.appendChild( gnumeric_doc.createTextNode( kspread_validity->timeMin.toString() ) ); val.appendChild( tmp ); tmp = gnumeric_doc.createElement( "gmr:Expression1" ); @@ -371,7 +371,7 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::InferiorEqual: case Conditional::Different: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); tmp.appendChild( gnumeric_doc.createTextNode( kspread_validity->dateMin.toString() ) ); val.appendChild( tmp ); } @@ -379,7 +379,7 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::Between: case Conditional::DifferentTo: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); tmp.appendChild( gnumeric_doc.createTextNode( kspread_validity->dateMin.toString() ) ); val.appendChild( tmp ); tmp = gnumeric_doc.createElement( "gmr:Expression1" ); @@ -404,19 +404,19 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::InferiorEqual: case Conditional::Different: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMin ) ) ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMin ) ) ); val.appendChild( tmp ); } break; case Conditional::Between: case Conditional::DifferentTo: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMin ) ) ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMin ) ) ); val.appendChild( tmp ); tmp = gnumeric_doc.createElement( "gmr:Expression1" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMax ) ) ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMax ) ) ); val.appendChild( tmp ); } break; @@ -436,19 +436,19 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell case Conditional::InferiorEqual: case Conditional::Different: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMin ) ) ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMin ) ) ); val.appendChild( tmp ); } break; case Conditional::Between: case Conditional::DifferentTo: { - QDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMin ) ) ); + TQDomElement tmp = gnumeric_doc.createElement( "gmr:Expression0" ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMin ) ) ); val.appendChild( tmp ); tmp = gnumeric_doc.createElement( "gmr:Expression1" ); - tmp.appendChild( gnumeric_doc.createTextNode( QString::number(kspread_validity->valMax ) ) ); + tmp.appendChild( gnumeric_doc.createTextNode( TQString::number(kspread_validity->valMax ) ) ); val.appendChild( tmp ); } break; @@ -478,9 +478,9 @@ QDomElement GNUMERICExport::GetValidity( QDomDocument gnumeric_doc, Cell * cell return val; } -QDomElement GNUMERICExport::GetFontStyle( QDomDocument gnumeric_doc,Cell * cell, int currentcolumn, int currentrow) +TQDomElement GNUMERICExport::GetFontStyle( TQDomDocument gnumeric_doc,Cell * cell, int currentcolumn, int currentrow) { - QDomElement font_style; + TQDomElement font_style; kdDebug()<<" currentcolumn :"<<currentcolumn<<" currentrow :"<<currentrow<<endl; font_style = gnumeric_doc.createElement("gmr:Font"); font_style.appendChild(gnumeric_doc.createTextNode(cell->format()->textFontFamily(currentcolumn, currentrow))); @@ -503,19 +503,19 @@ QDomElement GNUMERICExport::GetFontStyle( QDomDocument gnumeric_doc,Cell * cell, } if (cell->format()->textFontSize(currentcolumn,currentrow)) { - font_style.setAttribute("Unit",QString::number(cell->format()->textFontSize(currentcolumn,currentrow))); + font_style.setAttribute("Unit",TQString::number(cell->format()->textFontSize(currentcolumn,currentrow))); } return font_style; } -QDomElement GNUMERICExport::GetLinkStyle(QDomDocument gnumeric_doc) +TQDomElement GNUMERICExport::GetLinkStyle(TQDomDocument gnumeric_doc) { - QDomElement link_style; + TQDomElement link_style; link_style = gnumeric_doc.createElement("gmr:HyperLink"); - QString path; + TQString path; path = linkUrl; @@ -538,93 +538,93 @@ QDomElement GNUMERICExport::GetLinkStyle(QDomDocument gnumeric_doc) return link_style; } -QDomElement GNUMERICExport::GetCellStyle(QDomDocument gnumeric_doc,Cell * cell, int currentcolumn, int currentrow) +TQDomElement GNUMERICExport::GetCellStyle(TQDomDocument gnumeric_doc,Cell * cell, int currentcolumn, int currentrow) { - QColorGroup defaultColorGroup = QApplication::palette().active(); + TQColorGroup defaultColorGroup = TQApplication::tqpalette().active(); - QDomElement cell_style; + TQDomElement cell_style; cell_style = gnumeric_doc.createElement("gmr:Style"); int red, green, blue; - QColor bgColor = cell->bgColor(currentcolumn, currentrow); + TQColor bgColor = cell->bgColor(currentcolumn, currentrow); red = bgColor.red()<<8; green = bgColor.green()<<8; blue = bgColor.blue()<<8; switch (cell->format()->backGroundBrushStyle(currentcolumn, currentrow)) { - case Qt::NoBrush: + case TQt::NoBrush: cell_style.setAttribute("Shade","0"); break; - case Qt::SolidPattern: + case TQt::SolidPattern: // 100% cell_style.setAttribute("Shade","1"); break; - case Qt::Dense1Pattern: + case TQt::Dense1Pattern: // 87.5% cell_style.setAttribute("Shade","25"); break; - case Qt::Dense2Pattern: + case TQt::Dense2Pattern: // 75% cell_style.setAttribute("Shade","2"); break; - case Qt::Dense3Pattern: + case TQt::Dense3Pattern: // 62.5% // Not supported by GNumeric // Fall back to 50% cell_style.setAttribute("Shade","3"); break; - case Qt::Dense4Pattern: + case TQt::Dense4Pattern: // 50% cell_style.setAttribute("Shade","3"); break; - case Qt::Dense5Pattern: + case TQt::Dense5Pattern: // 25% cell_style.setAttribute("Shade","4"); break; - case Qt::Dense6Pattern: + case TQt::Dense6Pattern: // 12.5% cell_style.setAttribute("Shade","5"); break; - case Qt::Dense7Pattern: + case TQt::Dense7Pattern: // 6.25% cell_style.setAttribute("Shade","6"); break; - case Qt::HorPattern: + case TQt::HorPattern: cell_style.setAttribute("Shade","13"); break; - case Qt::VerPattern: + case TQt::VerPattern: cell_style.setAttribute("Shade","14"); break; - case Qt::CrossPattern: + case TQt::CrossPattern: cell_style.setAttribute("Shade","17"); break; - case Qt::BDiagPattern: + case TQt::BDiagPattern: cell_style.setAttribute("Shade","16"); break; - case Qt::FDiagPattern: + case TQt::FDiagPattern: cell_style.setAttribute("Shade","15"); break; - case Qt::DiagCrossPattern: + case TQt::DiagCrossPattern: cell_style.setAttribute("Shade","18"); break; - case Qt::CustomPattern: + case TQt::CustomPattern: // Not supported by Gnumeric cell_style.setAttribute("Shade","0"); break; } - cell_style.setAttribute("Back",QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16) ); + cell_style.setAttribute("Back",TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16) ); - QColor textColor = cell->format()->textColor(currentcolumn, currentrow); + TQColor textColor = cell->format()->textColor(currentcolumn, currentrow); red = textColor.red()<<8; green = textColor.green()<<8; blue = textColor.blue()<<8; - cell_style.setAttribute("Fore",QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16) ); + cell_style.setAttribute("Fore",TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16) ); if (cell->format()->align(currentcolumn,currentrow) == Format::Undefined) { @@ -666,12 +666,12 @@ QDomElement GNUMERICExport::GetCellStyle(QDomDocument gnumeric_doc,Cell * cell, // I'm not sure about the rotation values. // I never got it to work in GNumeric. - cell_style.setAttribute("Rotation", QString::number(-1*cell->format()->getAngle(currentcolumn,currentrow))); + cell_style.setAttribute("Rotation", TQString::number(-1*cell->format()->getAngle(currentcolumn,currentrow))); // The indentation in GNumeric is an integer value. In KSpread, it's a double. // Save the double anyway, makes it even better when importing the document back in KSpread. // TODO verify if it's correct, in import we "* 10.0" - cell_style.setAttribute("Indent", QString::number(cell->format()->getIndent(currentcolumn,currentrow))); + cell_style.setAttribute("Indent", TQString::number(cell->format()->getIndent(currentcolumn,currentrow))); cell_style.setAttribute("Locked", !cell->format()->notProtected(currentcolumn,currentrow)); @@ -680,12 +680,12 @@ QDomElement GNUMERICExport::GetCellStyle(QDomDocument gnumeric_doc,Cell * cell, // Gnumeric hides everything or nothing. cell_style.setAttribute("Hidden", cell->format()->isHideAll(currentcolumn,currentrow)); - QColor patColor = cell->format()->backGroundBrushColor(currentcolumn, currentrow); + TQColor patColor = cell->format()->backGroundBrushColor(currentcolumn, currentrow); red = patColor.red()<<8; green = patColor.green()<<8; blue = patColor.blue()<<8; - cell_style.setAttribute("PatternColor", QString::number(red,16)+":"+QString::number(green,16) +":"+QString::number(blue,16)); + cell_style.setAttribute("PatternColor", TQString::number(red,16)+":"+TQString::number(green,16) +":"+TQString::number(blue,16)); if (isLink) cell_style.appendChild(GetLinkStyle(gnumeric_doc)); @@ -697,7 +697,7 @@ QDomElement GNUMERICExport::GetCellStyle(QDomDocument gnumeric_doc,Cell * cell, cell_style.appendChild( GetValidity( gnumeric_doc, cell ) ); } - QString stringFormat; + TQString stringFormat; Format::Currency c; Currency currency; @@ -722,11 +722,11 @@ QDomElement GNUMERICExport::GetCellStyle(QDomDocument gnumeric_doc,Cell * cell, stringFormat = "0.00"; else if (currency.getCurrencyCode(c.type) == "$") stringFormat = "$0.00"; - else if (currency.getCurrencyCode(c.type) == QString::fromUtf8("€")) + else if (currency.getCurrencyCode(c.type) == TQString::fromUtf8("€")) stringFormat = "[$€-2]0.00"; - else if (currency.getCurrencyCode(c.type) == QString::fromUtf8("£")) + else if (currency.getCurrencyCode(c.type) == TQString::fromUtf8("£")) stringFormat = "£0.00"; - else if (currency.getCurrencyCode(c.type) == QString::fromUtf8("¥")) + else if (currency.getCurrencyCode(c.type) == TQString::fromUtf8("¥")) stringFormat = "¥0.00"; else stringFormat="[$" + currency.getCurrencyCode(c.type) + "]0.00"; @@ -892,9 +892,9 @@ QDomElement GNUMERICExport::GetCellStyle(QDomDocument gnumeric_doc,Cell * cell, } -void GNUMERICExport::addAttributeItem(QDomDocument gnumeric_doc, QDomElement attributes, const QString& type, const QString& name, bool value) +void GNUMERICExport::addAttributeItem(TQDomDocument gnumeric_doc, TQDomElement attributes, const TQString& type, const TQString& name, bool value) { - QDomElement gmr_attribute, gmr_type, gmr_name, gmr_value; + TQDomElement gmr_attribute, gmr_type, gmr_name, gmr_value; gmr_attribute = gnumeric_doc.createElement("gmr:Attribute"); attributes.appendChild(gmr_attribute); @@ -907,7 +907,7 @@ void GNUMERICExport::addAttributeItem(QDomDocument gnumeric_doc, QDomElement att gmr_name.appendChild(gnumeric_doc.createTextNode(name)); gmr_attribute.appendChild(gmr_name); - QString txtValue; + TQString txtValue; if (value) txtValue = "true"; else @@ -918,11 +918,11 @@ void GNUMERICExport::addAttributeItem(QDomDocument gnumeric_doc, QDomElement att gmr_attribute.appendChild(gmr_value); } -void GNUMERICExport::addSummaryItem(QDomDocument gnumeric_doc, QDomElement summary, const QString& name, const QString& value) +void GNUMERICExport::addSummaryItem(TQDomDocument gnumeric_doc, TQDomElement summary, const TQString& name, const TQString& value) { if ( value.isEmpty() ) return; - QDomElement gmr_item, gmr_name, gmr_val_string; + TQDomElement gmr_item, gmr_name, gmr_val_string; gmr_item = gnumeric_doc.createElement("gmr:Item"); summary.appendChild(gmr_item); @@ -936,13 +936,13 @@ void GNUMERICExport::addSummaryItem(QDomDocument gnumeric_doc, QDomElement summa gmr_item.appendChild(gmr_val_string); } -// The reason why we use the KoDocument* approach and not the QDomDocument +// The reason why we use the KoDocument* approach and not the TQDomDocument // approach is because we don't want to export formulas but values ! -KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const QCString& to ) +KoFilter::ConversiontqStatus GNUMERICExport::convert( const TQCString& from, const TQCString& to ) { kdDebug(30521) << "Exporting GNUmeric" << endl; - QDomDocument gnumeric_doc=QDomDocument(); + TQDomDocument gnumeric_doc=TQDomDocument(); Sheet* table; KoDocument* document = m_chain->inputDocument(); @@ -950,7 +950,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const if (!document) return KoFilter::StupidError; - if ( !::qt_cast<const KSpread::Doc *>( document ) ) // it's safer that way :) + if ( !::tqqt_cast<const KSpread::Doc *>( document ) ) // it's safer that way :) { kdWarning(30521) << "document isn't a KSpread::Doc but a " << document->className() << endl; return KoFilter::NotImplemented; @@ -973,7 +973,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const gnumeric_doc.appendChild( gnumeric_doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) ); - QDomElement workbook = gnumeric_doc.createElement("gmr:Workbook"); + TQDomElement workbook = gnumeric_doc.createElement("gmr:Workbook"); workbook.setAttribute("xmlns:gmr","http://www.gnumeric.org/v10.dtd"); workbook.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"); workbook.setAttribute("xmlns:schemaLocation", "http://www.gnumeric.org/v8.xsd"); @@ -981,7 +981,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const /* End Made into a function */ - QDomElement sheets,sheet,tmp,cells,selections, cols,rows,styles,merged, margins, top, left, bottom, right, orientation, paper, header, footer, customSize, cellComment, objects, repeatColumns, repeatRows; + TQDomElement sheets,sheet,tmp,cells,selections, cols,rows,styles,merged, margins, top, left, bottom, right, orientation, paper, header, footer, customSize, cellComment, objects, repeatColumns, repeatRows; KoDocumentInfo *DocumentInfo = document->documentInfo(); KoDocumentInfoAbout *aboutPage = static_cast<KoDocumentInfoAbout *>(DocumentInfo->page( "about" )); @@ -991,7 +991,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const /* * Attributes */ - QDomElement attributes = gnumeric_doc.createElement("gmr:Attributes"); + TQDomElement attributes = gnumeric_doc.createElement("gmr:Attributes"); workbook.appendChild(attributes); addAttributeItem(gnumeric_doc, attributes, "4", "WorkbookView::show_horizontal_scrollbar", ksdoc->showHorizontalScrollBar()); @@ -1006,7 +1006,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const /* * Doccument summary */ - QDomElement summary = gnumeric_doc.createElement("gmr:Summary"); + TQDomElement summary = gnumeric_doc.createElement("gmr:Summary"); workbook.appendChild(summary); addSummaryItem(gnumeric_doc, summary, "title", aboutPage->title()); @@ -1020,12 +1020,12 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const /* * Sheet name index (necessary for the gnumeric xml_sax importer) */ - QDomElement sheetNameIndex = gnumeric_doc.createElement("gmr:SheetNameIndex"); + TQDomElement sheetNameIndex = gnumeric_doc.createElement("gmr:SheetNameIndex"); workbook.appendChild(sheetNameIndex); for (table = ksdoc->map()->firstSheet(); table != 0L; table =ksdoc->map()->nextSheet()) { - QDomElement sheetName = gnumeric_doc.createElement("gmr:SheetName"); + TQDomElement sheetName = gnumeric_doc.createElement("gmr:SheetName"); sheetName.appendChild(gnumeric_doc.createTextNode(table->tableName())); sheetNameIndex.appendChild(sheetName); } @@ -1049,17 +1049,17 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const */ if ( ksdoc->listArea().count()>0 ) { - QDomElement areaNames = gnumeric_doc.createElement("gmr:Names"); - const QValueList<Reference> &area = ksdoc->listArea(); // copying by value is slow! - QValueList<Reference>::ConstIterator it = area.begin(); - QValueList<Reference>::ConstIterator end = area.end(); + TQDomElement areaNames = gnumeric_doc.createElement("gmr:Names"); + const TQValueList<Reference> &area = ksdoc->listArea(); // copying by value is slow! + TQValueList<Reference>::ConstIterator it = area.begin(); + TQValueList<Reference>::ConstIterator end = area.end(); for ( ; it != end; ++it ) { - QDomElement areaName = gnumeric_doc.createElement("gmr:Name"); - QDomElement areaNameElement = gnumeric_doc.createElement("gmr:name"); + TQDomElement areaName = gnumeric_doc.createElement("gmr:Name"); + TQDomElement areaNameElement = gnumeric_doc.createElement("gmr:name"); areaNameElement.appendChild(gnumeric_doc.createTextNode(( *it ).ref_name) ); areaName.appendChild( areaNameElement ); - QDomElement areaNameValue = gnumeric_doc.createElement("gmr:value"); + TQDomElement areaNameValue = gnumeric_doc.createElement("gmr:value"); areaNameValue.appendChild(gnumeric_doc.createTextNode( convertRefToRange( ( *it ).sheet_name, ( *it ).rect ) ) ); areaName.appendChild( areaNameValue ); areaNames.appendChild( areaName ); @@ -1075,11 +1075,11 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const sheets = gnumeric_doc.createElement("gmr:Sheets"); workbook.appendChild(sheets); - QString str; + TQString str; View * view = static_cast<View*>( ksdoc->views().getFirst()); Canvas * canvas=0L; - QString activeTableName; + TQString activeTableName; if (view) { canvas = view->canvasWidget(); @@ -1123,19 +1123,19 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const sheet.appendChild(tmp); tmp = gnumeric_doc.createElement("gmr:MaxCol"); - tmp.appendChild(gnumeric_doc.createTextNode(QString::number(table->maxColumn()))); + tmp.appendChild(gnumeric_doc.createTextNode(TQString::number(table->maxColumn()))); sheet.appendChild(tmp); tmp = gnumeric_doc.createElement("gmr:MaxRow"); - tmp.appendChild(gnumeric_doc.createTextNode(QString::number(table->maxRow()))); + tmp.appendChild(gnumeric_doc.createTextNode(TQString::number(table->maxRow()))); sheet.appendChild(tmp); // Zoom value doesn't appear to be correct // KSpread 200% gives zoom() = 2.5, this in GNumeric = 250% tmp = gnumeric_doc.createElement("gmr:Zoom"); if (view) - tmp.appendChild(gnumeric_doc.createTextNode(QString::number(canvas->zoom()))); + tmp.appendChild(gnumeric_doc.createTextNode(TQString::number(canvas->zoom()))); else tmp.appendChild(gnumeric_doc.createTextNode("1.0")); sheet.appendChild(tmp); @@ -1168,7 +1168,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const sheet.appendChild(tmp); orientation = gnumeric_doc.createElement( "gmr:orientation" ); - QString orientString = table->print()->orientation() == PG_LANDSCAPE ? "landscape" : "portrait"; + TQString orientString = table->print()->orientation() == PG_LANDSCAPE ? "landscape" : "portrait"; orientation.appendChild( gnumeric_doc.createTextNode(orientString) ); tmp.appendChild( orientation ); @@ -1181,7 +1181,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const if ( _tmpRepeatColumnStart!=0 ) { repeatColumns = gnumeric_doc.createElement( "gmr:repeat_left" ); - QString value = Cell::columnName( _tmpRepeatColumnStart )+"1:"+Cell::columnName(_tmpRepeatColumnEnd )+"65536"; + TQString value = Cell::columnName( _tmpRepeatColumnStart )+"1:"+Cell::columnName(_tmpRepeatColumnEnd )+"65536"; repeatColumns.setAttribute( "value", value ); tmp.appendChild( repeatColumns ); } @@ -1190,7 +1190,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const if ( _tmpRepeatRowStart!=0 ) { repeatRows = gnumeric_doc.createElement( "gmr:repeat_top" ); - QString value = "A"+ QString::number(_tmpRepeatRowStart ) +":IV"+QString::number( _tmpRepeatRowEnd ); + TQString value = "A"+ TQString::number(_tmpRepeatRowStart ) +":IV"+TQString::number( _tmpRepeatRowEnd ); repeatRows.setAttribute( "value", value ); tmp.appendChild( repeatRows ); } @@ -1249,24 +1249,24 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const int step=iMaxRow > 50 ? iMaxRow/50 : 1; int i=1; - QString emptyLines; + TQString emptyLines; /* Save selection info. */ /* can't save selection anymore -- part of the view, not table */ /* - QDomElement selection = gnumeric_doc.createElement("gmr:Selection"); - QRect table_selection(table->selection()); + TQDomElement selection = gnumeric_doc.createElement("gmr:Selection"); + TQRect table_selection(table->selection()); selections.appendChild(selection); */ /* <gmr:Selection startCol="3" startRow="2" endCol="3" endRow="2"/>*/ /* - selection.setAttribute("startCol", QString::number(table_selection.left()-1)); - selection.setAttribute("startRow", QString::number(table_selection.top()-1)); + selection.setAttribute("startCol", TQString::number(table_selection.left()-1)); + selection.setAttribute("startRow", TQString::number(table_selection.top()-1)); - selection.setAttribute("endCol", QString::number(table_selection.right()-1)); - selection.setAttribute("endRow", QString::number(table_selection.bottom()-1)); + selection.setAttribute("endCol", TQString::number(table_selection.right()-1)); + selection.setAttribute("endRow", TQString::number(table_selection.bottom()-1)); */ /* End selection info. */ @@ -1275,11 +1275,11 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const ColumnFormat *cl=table->firstCol(); while (cl) { - QDomElement colinfo = gnumeric_doc.createElement("gmr:ColInfo"); + TQDomElement colinfo = gnumeric_doc.createElement("gmr:ColInfo"); cols.appendChild(colinfo); - colinfo.setAttribute("No", QString::number(cl->column()-1)); - colinfo.setAttribute("Hidden", QString::number(cl->isHide())); - colinfo.setAttribute("Unit", QString::number(cl->dblWidth())); + colinfo.setAttribute("No", TQString::number(cl->column()-1)); + colinfo.setAttribute("Hidden", TQString::number(cl->isHide())); + colinfo.setAttribute("Unit", TQString::number(cl->dblWidth())); cl=cl->next(); } @@ -1293,11 +1293,11 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const RowFormat *rl=table->firstRow(); while (rl) { - QDomElement rowinfo = gnumeric_doc.createElement("gmr:RowInfo"); + TQDomElement rowinfo = gnumeric_doc.createElement("gmr:RowInfo"); rows.appendChild(rowinfo); - rowinfo.setAttribute("No", QString::number(rl->row()-1)); - rowinfo.setAttribute("Hidden", QString::number(rl->isHide())); - rowinfo.setAttribute("Unit", QString::number(rl->dblHeight())); + rowinfo.setAttribute("No", TQString::number(rl->row()-1)); + rowinfo.setAttribute("Hidden", TQString::number(rl->isHide())); + rowinfo.setAttribute("Unit", TQString::number(rl->dblHeight())); rl=rl->next(); } @@ -1323,25 +1323,25 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const i=0; } - QString line; + TQString line; for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) { - QDomElement cell_contents; + TQDomElement cell_contents; Cell * cell = table->cellAt( currentcolumn, currentrow, false ); - QString text, style; - QDomDocument domLink; - QDomElement domRoot; - QDomNode domNode; - QDomNodeList childNodes; + TQString text, style; + TQDomDocument domLink; + TQDomElement domRoot; + TQDomNode domNode; + TQDomNodeList childNodes; if (!cell->isDefault() && !cell->isEmpty()) { if ( cell->isFormula() ) { - QString tmp = cell->text(); - if ( tmp.contains( "==" ) ) - tmp=tmp.replace( "==", "=" ); + TQString tmp = cell->text(); + if ( tmp.tqcontains( "==" ) ) + tmp=tmp.tqreplace( "==", "=" ); text = tmp; isLink = false; } @@ -1404,9 +1404,9 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const break; case Cell::Formula: isLink = false; - QString tmp = cell->text(); + TQString tmp = cell->text(); if ( tmp =="==" ) - tmp=replace( "==", "=" ); + tmp=tqreplace( "==", "=" ); /* cell->calc( TRUE ); // Incredible, cells are not calculated if the document was just opened text = cell->valueString(); */ text = tmp; break; @@ -1424,14 +1424,14 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const if (cell->doesMergeCells()) { // The cell is forced to occupy other cells - QDomElement merge = gnumeric_doc.createElement("gmr:Merge"); + TQDomElement merge = gnumeric_doc.createElement("gmr:Merge"); // Set up the range - QString fromCol, toCol, fromRow, toRow; + TQString fromCol, toCol, fromRow, toRow; fromCol = cell->columnName(currentcolumn); - fromRow = QString::number(currentrow); + fromRow = TQString::number(currentrow); toCol = cell->columnName(currentcolumn + cell->mergedXCells()); - toRow = QString::number(currentrow + cell->mergedYCells()); + toRow = TQString::number(currentrow + cell->mergedYCells()); merge.appendChild(gnumeric_doc.createTextNode(fromCol + fromRow + ":" + toCol + toRow)); mergedCells = true; @@ -1443,31 +1443,31 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const //<gmr:CellComment Author="" Text="cvbcvbxcvb cb xc vbxcv " ObjectBound="A1" ObjectOffset="0 0 0 0" ObjectAnchorType="17 16 17 16" Direction="17"/> cellComment = gnumeric_doc.createElement("gmr:CellComment"); cellComment.setAttribute( "Text", cell->format()->comment( currentcolumn, currentrow ) ); - QString sCell=QString( "%1%2" ).arg( Cell::columnName(currentcolumn ) ).arg( currentrow ); + TQString sCell=TQString( "%1%2" ).tqarg( Cell::columnName(currentcolumn ) ).tqarg( currentrow ); cellComment.setAttribute("ObjectBound", sCell ); objects.appendChild(cellComment); } - QDomElement gnumeric_cell = gnumeric_doc.createElement("gmr:Cell"); - QDomElement cell_style; + TQDomElement gnumeric_cell = gnumeric_doc.createElement("gmr:Cell"); + TQDomElement cell_style; - QDomElement style_region = gnumeric_doc.createElement("gmr:StyleRegion"); + TQDomElement style_region = gnumeric_doc.createElement("gmr:StyleRegion"); cells.appendChild(gnumeric_cell); - gnumeric_cell.setAttribute("Col", QString::number(currentcolumn-1)); - gnumeric_cell.setAttribute("Row", QString::number(currentrow-1)); + gnumeric_cell.setAttribute("Col", TQString::number(currentcolumn-1)); + gnumeric_cell.setAttribute("Row", TQString::number(currentrow-1)); /* Right now, we create a single region for each cell.. This is inefficient, * but the implementation is quicker.. Probably later we will have to * consolidate styles into style regions. */ - style_region.setAttribute("startCol", QString::number(currentcolumn-1)); - style_region.setAttribute("startRow", QString::number(currentrow-1)); - style_region.setAttribute("endCol", QString::number(currentcolumn-1)); - style_region.setAttribute("endRow", QString::number(currentrow-1)); + style_region.setAttribute("startCol", TQString::number(currentcolumn-1)); + style_region.setAttribute("startRow", TQString::number(currentrow-1)); + style_region.setAttribute("endCol", TQString::number(currentcolumn-1)); + style_region.setAttribute("endRow", TQString::number(currentrow-1)); cell_style = GetCellStyle(gnumeric_doc,cell,currentcolumn,currentrow); @@ -1488,7 +1488,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const if (mergedCells) sheet.appendChild(merged); } - QDomElement uidata = gnumeric_doc.createElement("gmr:UIData"); + TQDomElement uidata = gnumeric_doc.createElement("gmr:UIData"); uidata.setAttribute( "SelectedTab", indexActiveTable ); workbook.appendChild(uidata); @@ -1498,7 +1498,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const // Ok, now write to export file - QIODevice* out = KFilterDev::deviceForFile(m_chain->outputFile(),"application/x-gzip"); + TQIODevice* out = KFilterDev::deviceForFile(m_chain->outputFile(),"application/x-gzip"); if (!out) { @@ -1513,7 +1513,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const return KoFilter::FileNotFound; } - QTextStream streamOut(out); + TQTextStream streamOut(out); streamOut << str; @@ -1524,49 +1524,49 @@ KoFilter::ConversionStatus GNUMERICExport::convert( const QCString& from, const } -QString GNUMERICExport::convertRefToRange( const QString & table, const QRect & rect ) +TQString GNUMERICExport::convertRefToRange( const TQString & table, const TQRect & rect ) { - QPoint topLeft( rect.topLeft() ); - QPoint bottomRight( rect.bottomRight() ); + TQPoint topLeft( rect.topLeft() ); + TQPoint bottomRight( rect.bottomRight() ); if ( topLeft == bottomRight ) return convertRefToBase( table, rect ); - QString s; + TQString s; s += table; s += "!$"; s += Cell::columnName( topLeft.x() ); s += '$'; - s += QString::number( topLeft.y() ); + s += TQString::number( topLeft.y() ); s += ":$"; s += Cell::columnName( bottomRight.x() ); s += '$'; - s += QString::number( bottomRight.y() ); + s += TQString::number( bottomRight.y() ); return s; } -QString GNUMERICExport::convertRefToBase( const QString & table, const QRect & rect ) +TQString GNUMERICExport::convertRefToBase( const TQString & table, const TQRect & rect ) { - QPoint bottomRight( rect.bottomRight() ); + TQPoint bottomRight( rect.bottomRight() ); - QString s; + TQString s; s = table; s += "!$"; s += Cell::columnName( bottomRight.x() ); s += '$'; - s += QString::number( bottomRight.y() ); + s += TQString::number( bottomRight.y() ); return s; } -QString GNUMERICExport::convertVariable( QString headerFooter ) +TQString GNUMERICExport::convertVariable( TQString headerFooter ) { - headerFooter = headerFooter.replace( "<sheet>", "&[TAB]" ); - headerFooter = headerFooter.replace( "<date>", "&[DATE]" ); - headerFooter = headerFooter.replace( "<page>", "&[PAGE]" ); - headerFooter = headerFooter.replace( "<pages>", "&[PAGES]" ); - headerFooter = headerFooter.replace( "<time>", "&[TIME]" ); - headerFooter = headerFooter.replace( "<file>", "&[FILE]" ); + headerFooter = headerFooter.tqreplace( "<sheet>", "&[TAB]" ); + headerFooter = headerFooter.tqreplace( "<date>", "&[DATE]" ); + headerFooter = headerFooter.tqreplace( "<page>", "&[PAGE]" ); + headerFooter = headerFooter.tqreplace( "<pages>", "&[PAGES]" ); + headerFooter = headerFooter.tqreplace( "<time>", "&[TIME]" ); + headerFooter = headerFooter.tqreplace( "<file>", "&[FILE]" ); return headerFooter; } diff --git a/filters/kspread/gnumeric/gnumericexport.h b/filters/kspread/gnumeric/gnumericexport.h index a56c6482..8cd89e38 100644 --- a/filters/kspread/gnumeric/gnumericexport.h +++ b/filters/kspread/gnumeric/gnumericexport.h @@ -21,7 +21,7 @@ #define GNUMERICEXPORT_TEST_H #include <KoFilter.h> -#include <qdom.h> +#include <tqdom.h> namespace KSpread { @@ -31,30 +31,31 @@ namespace KSpread class GNUMERICExport : public KoFilter { Q_OBJECT + TQ_OBJECT public: - GNUMERICExport(KoFilter *parent, const char*name, const QStringList&); + GNUMERICExport(KoFilter *tqparent, const char*name, const TQStringList&); virtual ~GNUMERICExport() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); private: - QDomElement GetCellStyle(QDomDocument gnumeric_doc, KSpread::Cell* cell, int currentcolumn, int currentrow); - QDomElement GetBorderStyle(QDomDocument gnumeric_doc, KSpread::Cell* cell, int currentcolumn, int currentrow); - QDomElement GetFontStyle(QDomDocument gnumeric_doc, KSpread::Cell* cell, int currentcolumn, int currentrow); - QDomElement GetLinkStyle(QDomDocument gnumeric_doc ); - QDomElement GetValidity( QDomDocument gnumeric_doc, KSpread::Cell* cell ); - - void addAttributeItem(QDomDocument gnumeric_doc, QDomElement attributes, const QString& type, const QString& name, bool value); - void addSummaryItem(QDomDocument gnumeric_doc, QDomElement summary, const QString& name, const QString& value); + TQDomElement GetCellStyle(TQDomDocument gnumeric_doc, KSpread::Cell* cell, int currentcolumn, int currentrow); + TQDomElement GetBorderStyle(TQDomDocument gnumeric_doc, KSpread::Cell* cell, int currentcolumn, int currentrow); + TQDomElement GetFontStyle(TQDomDocument gnumeric_doc, KSpread::Cell* cell, int currentcolumn, int currentrow); + TQDomElement GetLinkStyle(TQDomDocument gnumeric_doc ); + TQDomElement GetValidity( TQDomDocument gnumeric_doc, KSpread::Cell* cell ); + + void addAttributeItem(TQDomDocument gnumeric_doc, TQDomElement attributes, const TQString& type, const TQString& name, bool value); + void addSummaryItem(TQDomDocument gnumeric_doc, TQDomElement summary, const TQString& name, const TQString& value); bool hasBorder(KSpread::Cell*cell, int currentcolumn, int currentrow); - const QString ColorToString(int red, int green, int blue); - QString convertVariable( QString headerFooter ); - QString convertRefToRange( const QString & table, const QRect & rect ); - QString convertRefToBase( const QString & table, const QRect & rect ); + const TQString ColorToString(int red, int green, int blue); + TQString convertVariable( TQString headerFooter ); + TQString convertRefToRange( const TQString & table, const TQRect & rect ); + TQString convertRefToBase( const TQString & table, const TQRect & rect ); bool isLink; - QString linkText; - QString linkUrl; + TQString linkText; + TQString linkUrl; bool isLinkBold; bool isLinkItalic; diff --git a/filters/kspread/gnumeric/gnumericimport.cc b/filters/kspread/gnumeric/gnumericimport.cc index 6e114f37..4374d14a 100644 --- a/filters/kspread/gnumeric/gnumericimport.cc +++ b/filters/kspread/gnumeric/gnumericimport.cc @@ -22,9 +22,9 @@ /* [email protected] */ /* additions: Norbert Andres [email protected] */ -#include <qdict.h> -#include <qfile.h> -#include <qstringlist.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqstringlist.h> #include <gnumericimport.h> #include <kmessagebox.h> @@ -110,8 +110,8 @@ static char const * cell_format_time [] = { namespace gnumeric_import_LNS { - QStringList list1; - QStringList list2; + TQStringList list1; + TQStringList list2; } using namespace gnumeric_import_LNS; @@ -125,7 +125,7 @@ void GNUMERICFilter::dateInit() uint GNUMERICFilter::GnumericDate::greg2jul( int y, int m, int d ) { - return QDate::gregorianToJulian( y, m, d ); + return TQDate::gregorianToJulian( y, m, d ); } void GNUMERICFilter::GnumericDate::jul2greg( double num, int & y, int & m, int & d ) @@ -138,15 +138,15 @@ void GNUMERICFilter::GnumericDate::jul2greg( double num, int & y, int & m, int & kdDebug(30521) << "***** Num: " << num << ", i: " << i << endl; - QDate::julianToGregorian( i + g_dateOrigin, y, m, d ); + TQDate::julianToGregorian( i + g_dateOrigin, y, m, d ); kdDebug(30521) << "y: " << y << ", m: " << m << ", d: " << d << endl; } -QTime GNUMERICFilter::GnumericDate::getTime( double num ) +TQTime GNUMERICFilter::GnumericDate::getTime( double num ) { // idea copied from gnumeric: src/datetime.c num += HALF_SEC; - int secs = qRound( (num - floor(num)) * SECS_PER_DAY ); + int secs = tqRound( (num - floor(num)) * SECS_PER_DAY ); kdDebug(30521) << "***** Num: " << num << ", secs " << secs << endl; @@ -156,7 +156,7 @@ QTime GNUMERICFilter::GnumericDate::getTime( double num ) secs -= h * 60; kdDebug(30521) << "****** h: " << h << ", m: " << m << ", secs: " << secs << endl; - const QTime time( h, m, ( secs < 0 || secs > 59 ? 0 : secs ) ); + const TQTime time( h, m, ( secs < 0 || secs > 59 ? 0 : secs ) ); return time; } @@ -164,20 +164,20 @@ QTime GNUMERICFilter::GnumericDate::getTime( double num ) typedef KGenericFactory<GNUMERICFilter, KoFilter> GNUMERICFilterFactory; K_EXPORT_COMPONENT_FACTORY( libgnumericimport, GNUMERICFilterFactory( "kofficefilters" ) ) -GNUMERICFilter::GNUMERICFilter( KoFilter *, const char *, const QStringList & ) +GNUMERICFilter::GNUMERICFilter( KoFilter *, const char *, const TQStringList & ) : KoFilter() { } -/* This converts GNUmeric's color string "0:0:0" to a QColor. */ -void convert_string_to_qcolor(QString color_string, QColor * color) +/* This converts GNUmeric's color string "0:0:0" to a TQColor. */ +void convert_string_to_qcolor(TQString color_string, TQColor * color) { int red, green, blue, first_col_pos, second_col_pos; bool number_ok; - first_col_pos = color_string.find(":", 0); - second_col_pos = color_string.find(":", first_col_pos + 1); + first_col_pos = color_string.tqfind(":", 0); + second_col_pos = color_string.tqfind(":", first_col_pos + 1); /* Fore="0:0:FF00" */ /* If GNUmeric kicks out some invalid colors, we could crash. */ @@ -192,34 +192,34 @@ void convert_string_to_qcolor(QString color_string, QColor * color) color->setRgb(red, green, blue); } -void areaNames( Doc * ksdoc, const QString &_name, QString _zone ) +void areaNames( Doc * ksdoc, const TQString &_name, TQString _zone ) { //Sheet2!$A$2:$D$8 - QString tableName; - int pos = _zone.find( '!' ); + TQString tableName; + int pos = _zone.tqfind( '!' ); if ( pos != -1 ) { tableName = _zone.left( pos ); _zone = _zone.right( _zone.length()-pos-1 ); - pos = _zone.find( ':' ); - QRect rect; + pos = _zone.tqfind( ':' ); + TQRect rect; if ( pos != -1 ) { - QString left = _zone.mid( 1, pos-1 ); - QString right = _zone.mid( pos+2, _zone.length()-pos-2 ); - int pos = left.find( '$' ); + TQString left = _zone.mid( 1, pos-1 ); + TQString right = _zone.mid( pos+2, _zone.length()-pos-2 ); + int pos = left.tqfind( '$' ); rect.setLeft( util_decodeColumnLabelText(left.left(pos ) ) ); rect.setTop( left.right( left.length()-pos-1 ).toInt() ); - pos = right.find( '$' ); + pos = right.tqfind( '$' ); rect.setRight( util_decodeColumnLabelText(right.left(pos ) ) ); rect.setBottom( right.right( right.length()-pos-1 ).toInt() ); } else { - QString left = _zone; - int pos = left.find( '$' ); + TQString left = _zone; + int pos = left.tqfind( '$' ); int leftPos = util_decodeColumnLabelText(left.left(pos ) ); rect.setLeft( leftPos ); rect.setRight( leftPos ); @@ -233,17 +233,17 @@ void areaNames( Doc * ksdoc, const QString &_name, QString _zone ) } -void set_document_area_names( Doc * ksdoc, QDomElement * docElem ) +void set_document_area_names( Doc * ksdoc, TQDomElement * docElem ) { - QDomNode areaNamesElement = docElem->namedItem( "gmr:Names" ); + TQDomNode areaNamesElement = docElem->namedItem( "gmr:Names" ); if ( areaNamesElement.isNull() ) return; - QDomNode areaNameItem = areaNamesElement.namedItem( "gmr:Name" ); + TQDomNode areaNameItem = areaNamesElement.namedItem( "gmr:Name" ); while ( !areaNameItem.isNull() ) { - QDomNode gmr_name = areaNameItem.namedItem("gmr:name"); - QDomNode gmr_value = areaNameItem.namedItem("gmr:value"); - QString name = gmr_name.toElement().text(); + TQDomNode gmr_name = areaNameItem.namedItem("gmr:name"); + TQDomNode gmr_value = areaNameItem.namedItem("gmr:value"); + TQString name = gmr_name.toElement().text(); areaNames( ksdoc, name, gmr_value.toElement().text() ); areaNameItem = areaNameItem.nextSibling(); } @@ -251,18 +251,18 @@ void set_document_area_names( Doc * ksdoc, QDomElement * docElem ) -void set_document_attributes( Doc * ksdoc, QDomElement * docElem) +void set_document_attributes( Doc * ksdoc, TQDomElement * docElem) { ksdoc->loadConfigFromFile(); - QDomNode attributes = docElem->namedItem("gmr:Attributes"); + TQDomNode attributes = docElem->namedItem("gmr:Attributes"); if ( attributes.isNull() ) return; - QDomNode attributeItem = attributes.namedItem("gmr:Attribute"); + TQDomNode attributeItem = attributes.namedItem("gmr:Attribute"); while( !attributeItem.isNull() ) { - QDomNode gmr_name = attributeItem.namedItem("gmr:name"); - QDomNode gmr_value = attributeItem.namedItem("gmr:value"); + TQDomNode gmr_name = attributeItem.namedItem("gmr:name"); + TQDomNode gmr_value = attributeItem.namedItem("gmr:value"); if (gmr_name.toElement().text() == "WorkbookView::show_horizontal_scrollbar") { ksdoc->setShowHorizontalScrollBar( gmr_value.toElement().text().lower()=="true"? true : false ); @@ -292,16 +292,16 @@ void set_document_attributes( Doc * ksdoc, QDomElement * docElem) /* This sets the documentation information from the information stored in the GNUmeric file. Particularly in the "gmr:Summary" subcategory. */ -void set_document_info(KoDocument * document, QDomElement * docElem) +void set_document_info(KoDocument * document, TQDomElement * docElem) { /* Summary Handling START */ - QDomNode summary = docElem->namedItem("gmr:Summary"); - QDomNode gmr_item = summary.namedItem("gmr:Item"); + TQDomNode summary = docElem->namedItem("gmr:Summary"); + TQDomNode gmr_item = summary.namedItem("gmr:Item"); while( !gmr_item.isNull() ) { - QDomNode gmr_name = gmr_item.namedItem("gmr:name"); - QDomNode gmr_value = gmr_item.namedItem("gmr:val-string"); + TQDomNode gmr_name = gmr_item.namedItem("gmr:name"); + TQDomNode gmr_value = gmr_item.namedItem("gmr:val-string"); KoDocumentInfo * DocumentInfo = document->documentInfo(); KoDocumentInfoAbout * aboutPage = static_cast<KoDocumentInfoAbout *>(DocumentInfo->page( "about" )); @@ -348,12 +348,12 @@ void set_document_info(KoDocument * document, QDomElement * docElem) } -void setColInfo(QDomNode * sheet, Sheet * table) +void setColInfo(TQDomNode * sheet, Sheet * table) { - QDomNode columns = sheet->namedItem("gmr:Cols"); - QDomNode columninfo = columns.namedItem("gmr:ColInfo"); + TQDomNode columns = sheet->namedItem("gmr:Cols"); + TQDomNode columninfo = columns.namedItem("gmr:ColInfo"); - QDomElement def = columns.toElement(); + TQDomElement def = columns.toElement(); if ( def.hasAttribute( "DefaultSizePts" ) ) { bool ok = false; @@ -367,7 +367,7 @@ void setColInfo(QDomNode * sheet, Sheet * table) while( !columninfo.isNull() ) { - QDomElement e = columninfo.toElement(); // try to convert the node to an element. + TQDomElement e = columninfo.toElement(); // try to convert the node to an element. int column_number; column_number = e.attribute("No").toInt()+1; @@ -390,15 +390,15 @@ void setColInfo(QDomNode * sheet, Sheet * table) } } -void setRowInfo(QDomNode *sheet, Sheet *table) +void setRowInfo(TQDomNode *sheet, Sheet *table) { - QDomNode rows = sheet->namedItem("gmr:Rows"); - QDomNode rowinfo = rows.namedItem("gmr:RowInfo"); + TQDomNode rows = sheet->namedItem("gmr:Rows"); + TQDomNode rowinfo = rows.namedItem("gmr:RowInfo"); double d; bool ok = false; - QDomElement def = rows.toElement(); + TQDomElement def = rows.toElement(); if ( def.hasAttribute( "DefaultSizePts" ) ) { d = def.attribute( "DefaultSizePts" ).toDouble( &ok ); @@ -411,7 +411,7 @@ void setRowInfo(QDomNode *sheet, Sheet *table) while( !rowinfo.isNull() ) { - QDomElement e = rowinfo.toElement(); // try to convert the node to an element. + TQDomElement e = rowinfo.toElement(); // try to convert the node to an element. int row_number; row_number = e.attribute("No").toInt() + 1; RowFormat *rl = new RowFormat(table, row_number); @@ -434,18 +434,18 @@ void setRowInfo(QDomNode *sheet, Sheet *table) } } -void setSelectionInfo( QDomNode * sheet, Sheet * /* table */ ) +void setSelectionInfo( TQDomNode * sheet, Sheet * /* table */ ) { - QDomNode selections = sheet->namedItem("gmr:Selections"); - QDomNode selection = selections.namedItem("gmr:Selection"); + TQDomNode selections = sheet->namedItem("gmr:Selections"); + TQDomNode selection = selections.namedItem("gmr:Selection"); /* Kspread does not support mutiple selections.. */ /* This code will set the selection to the last one GNUmeric's multiple selections. */ while( !selection.isNull() ) { - QDomElement e = selection.toElement(); // try to convert the node to an element. - QRect kspread_selection; + TQDomElement e = selection.toElement(); // try to convert the node to an element. + TQRect kspread_selection; kspread_selection.setLeft((e.attribute("startCol").toInt() + 1)); kspread_selection.setTop((e.attribute("startRow").toInt() + 1)); @@ -460,13 +460,13 @@ void setSelectionInfo( QDomNode * sheet, Sheet * /* table */ ) } -void setObjectInfo(QDomNode * sheet, Sheet * table) +void setObjectInfo(TQDomNode * sheet, Sheet * table) { - QDomNode gmr_objects = sheet->namedItem("gmr:Objects"); - QDomNode gmr_cellcomment = gmr_objects.namedItem("gmr:CellComment"); + TQDomNode gmr_objects = sheet->namedItem("gmr:Objects"); + TQDomNode gmr_cellcomment = gmr_objects.namedItem("gmr:CellComment"); while( !gmr_cellcomment.isNull() ) { - QDomElement e = gmr_cellcomment.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_cellcomment.toElement(); // try to convert the node to an element. if (e.hasAttribute("Text")) { if (e.hasAttribute("ObjectBound")) @@ -481,7 +481,7 @@ void setObjectInfo(QDomNode * sheet, Sheet * table) } } -void convertToPen( QPen & pen, int style ) +void convertToPen( TQPen & pen, int style ) { switch( style ) { @@ -549,17 +549,17 @@ void convertToPen( QPen & pen, int style ) } } -void GNUMERICFilter::ParseBorder( QDomElement & gmr_styleborder, Cell * kspread_cell ) +void GNUMERICFilter::ParseBorder( TQDomElement & gmr_styleborder, Cell * kspread_cell ) { - QDomNode gmr_diagonal = gmr_styleborder.namedItem("gmr:Diagonal"); - QDomNode gmr_rev_diagonal = gmr_styleborder.namedItem("gmr:Rev-Diagonal"); - QDomNode gmr_top = gmr_styleborder.namedItem("gmr:Top"); - QDomNode gmr_bottom = gmr_styleborder.namedItem("gmr:Bottom"); - QDomNode gmr_left = gmr_styleborder.namedItem("gmr:Left"); - QDomNode gmr_right = gmr_styleborder.namedItem("gmr:Right"); + TQDomNode gmr_diagonal = gmr_styleborder.namedItem("gmr:Diagonal"); + TQDomNode gmr_rev_diagonal = gmr_styleborder.namedItem("gmr:Rev-Diagonal"); + TQDomNode gmr_top = gmr_styleborder.namedItem("gmr:Top"); + TQDomNode gmr_bottom = gmr_styleborder.namedItem("gmr:Bottom"); + TQDomNode gmr_left = gmr_styleborder.namedItem("gmr:Left"); + TQDomNode gmr_right = gmr_styleborder.namedItem("gmr:Right"); // NoPen - no line at all. For example, - // QPainter::drawRect() fills but does not + // TQPainter::drawRect() fills but does not // draw any explicit boundary // line. SolidLine - a simple line. DashLine // - dashes, separated by a few @@ -569,54 +569,54 @@ void GNUMERICFilter::ParseBorder( QDomElement & gmr_styleborder, Cell * kspread_ if ( !gmr_left.isNull() ) { - QDomElement e = gmr_left.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_left.toElement(); // try to convert the node to an element. importBorder( e, Left, kspread_cell); } if ( !gmr_right.isNull() ) { - QDomElement e = gmr_right.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_right.toElement(); // try to convert the node to an element. importBorder( e, Right, kspread_cell); } if ( !gmr_top.isNull() ) { - QDomElement e = gmr_top.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_top.toElement(); // try to convert the node to an element. importBorder( e, Top, kspread_cell); } if ( !gmr_bottom.isNull() ) { - QDomElement e = gmr_bottom.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_bottom.toElement(); // try to convert the node to an element. importBorder( e, Bottom, kspread_cell); } if ( !gmr_diagonal.isNull() ) { - QDomElement e = gmr_diagonal.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_diagonal.toElement(); // try to convert the node to an element. importBorder( e, Diagonal, kspread_cell); } if ( !gmr_rev_diagonal.isNull() ) { - QDomElement e = gmr_rev_diagonal.toElement(); // try to convert the node to an element. + TQDomElement e = gmr_rev_diagonal.toElement(); // try to convert the node to an element. importBorder( e, Revdiagonal, kspread_cell); } - // QDomElement gmr_styleborder_element = gmr_styleborder.toElement(); + // TQDomElement gmr_styleborder_element = gmr_styleborder.toElement(); } -void GNUMERICFilter::importBorder( QDomElement border, borderStyle _style, Cell *cell) +void GNUMERICFilter::importBorder( TQDomElement border, borderStyle _style, Cell *cell) { if ( !border.isNull() ) { - QDomElement e = border.toElement(); // try to convert the node to an element. + TQDomElement e = border.toElement(); // try to convert the node to an element. if ( e.hasAttribute( "Style" ) ) { int style = e.attribute( "Style" ).toInt(); - QPen pen; + TQPen pen; convertToPen( pen, style ); if ( style > 0 ) @@ -645,8 +645,8 @@ void GNUMERICFilter::importBorder( QDomElement border, borderStyle _style, Cell } if ( e.hasAttribute( "Color" ) ) { - QColor color; - QString colorString = e.attribute( "Color" ); + TQColor color; + TQString colorString = e.attribute( "Color" ); convert_string_to_qcolor( colorString, &color ); { switch( _style ) @@ -678,8 +678,8 @@ void GNUMERICFilter::importBorder( QDomElement border, borderStyle _style, Cell } bool GNUMERICFilter::setType( Cell * kspread_cell, - QString const & formatString, - QString & cell_content ) + TQString const & formatString, + TQString & cell_content ) { int i = 0; for ( i = 0; cell_format_date[i] ; ++i ) @@ -688,7 +688,7 @@ bool GNUMERICFilter::setType( Cell * kspread_cell, if ( ( formatString == "d/m/yy" ) || ( formatString == cell_format_date[i] ) ) { kdDebug(30521) << " FormatString: Date: " << formatString << ", CellContent: " << cell_content << endl; - QDate date; + TQDate date; if ( !kspread_cell->isDate() ) { // convert cell_content to date @@ -744,7 +744,7 @@ bool GNUMERICFilter::setType( Cell * kspread_cell, /* 12, 13, 14, 15, 20, 21 */ } - kdDebug(30521) << "i: " << i << ", Type: " << type << ", Date: " << date.toString() << endl; + kdDebug(30521) << "i: " << i << ", Type: " << type << ", Date: " << TQString(date.toString()) << endl; kspread_cell->setValue( date ); kspread_cell->format()->setFormatType( type ); @@ -757,7 +757,7 @@ bool GNUMERICFilter::setType( Cell * kspread_cell, { if (formatString == cell_format_time[i]) { - QTime time; + TQTime time; if ( !kspread_cell->isTime() ) { @@ -799,9 +799,9 @@ bool GNUMERICFilter::setType( Cell * kspread_cell, return false; // no date or time } -QString GNUMERICFilter::convertVars( QString const & str, Sheet * table ) const +TQString GNUMERICFilter::convertVars( TQString const & str, Sheet * table ) const { - QString result( str ); + TQString result( str ); uint count = list1.count(); if ( count == 0 ) { @@ -814,24 +814,24 @@ QString GNUMERICFilter::convertVars( QString const & str, Sheet * table ) const for ( uint i = 0; i < count; ++i ) { - int n = result.find( list1[i] ); + int n = result.tqfind( list1[i] ); if ( n != -1 ) { kdDebug(30521) << "Found var: " << list1[i] << endl; if ( i == 0 ) - result = result.replace( list1[i], table->tableName() ); + result = result.tqreplace( list1[i], table->tableName() ); else - result = result.replace( list1[i], list2[i] ); + result = result.tqreplace( list1[i], list2[i] ); } } return result; } -double GNUMERICFilter::parseAttribute( const QDomElement &_element ) +double GNUMERICFilter::parseAttribute( const TQDomElement &_element ) { - QString unit = _element.attribute( "PrefUnit" ); + TQString unit = _element.attribute( "PrefUnit" ); bool ok; double value = _element.attribute("Points").toFloat( &ok ); if ( !ok ) @@ -848,7 +848,7 @@ double GNUMERICFilter::parseAttribute( const QDomElement &_element ) return value; } -void GNUMERICFilter::ParsePrintInfo( QDomNode const & printInfo, Sheet * table ) +void GNUMERICFilter::ParsePrintInfo( TQDomNode const & printInfo, Sheet * table ) { kdDebug(30521) << "Parsing print info " << endl; @@ -857,32 +857,32 @@ void GNUMERICFilter::ParsePrintInfo( QDomNode const & printInfo, Sheet * table ) float ftop = 2.0; float fbottom = 2.0; - QString paperSize("A4"); - QString orientation("Portrait"); - QString footLeft, footMiddle, footRight; - QString headLeft, headMiddle, headRight; // no we are zombies :-) + TQString paperSize("A4"); + TQString orientation("Portrait"); + TQString footLeft, footMiddle, footRight; + TQString headLeft, headMiddle, headRight; // no we are zombies :-) - QDomNode margins( printInfo.namedItem("gmr:Margins") ); + TQDomNode margins( printInfo.namedItem("gmr:Margins") ); if ( !margins.isNull() ) { - QDomElement top( margins.namedItem( "gmr:top" ).toElement() ); + TQDomElement top( margins.namedItem( "gmr:top" ).toElement() ); if ( !top.isNull() ) ftop = parseAttribute( top ); - QDomElement bottom( margins.namedItem( "gmr:bottom" ).toElement() ); + TQDomElement bottom( margins.namedItem( "gmr:bottom" ).toElement() ); if ( !bottom.isNull() ) fbottom= parseAttribute( bottom ); - QDomElement left( margins.namedItem( "gmr:left" ).toElement() ); + TQDomElement left( margins.namedItem( "gmr:left" ).toElement() ); if ( !left.isNull() ) fleft = parseAttribute( left ); - QDomElement right( margins.namedItem( "gmr:right" ).toElement() ); + TQDomElement right( margins.namedItem( "gmr:right" ).toElement() ); if ( !right.isNull() ) fright = parseAttribute( right ); } - QDomElement foot( printInfo.namedItem("gmr:Footer").toElement() ); + TQDomElement foot( printInfo.namedItem("gmr:Footer").toElement() ); if ( !foot.isNull() ) { kdDebug(30521) << "Parsing footer: " << foot.attribute("Left") << ", " << foot.attribute("Middle") << ", " @@ -895,7 +895,7 @@ void GNUMERICFilter::ParsePrintInfo( QDomNode const & printInfo, Sheet * table ) footRight = convertVars( foot.attribute("Right"), table ); } - QDomElement head( printInfo.namedItem("gmr:Header").toElement() ); + TQDomElement head( printInfo.namedItem("gmr:Header").toElement() ); if ( !head.isNull() ) { kdDebug(30521) << "Parsing header: " << head.attribute("Left") << ", " << head.attribute("Middle") << ", " << head.attribute("Right") << ", "<< endl; @@ -907,37 +907,37 @@ void GNUMERICFilter::ParsePrintInfo( QDomNode const & printInfo, Sheet * table ) headRight = convertVars( head.attribute("Right"), table ); } - QDomElement repeateColumn( printInfo.namedItem("gmr:repeat_top").toElement() ); + TQDomElement repeateColumn( printInfo.namedItem("gmr:repeat_top").toElement() ); if ( !repeateColumn.isNull() ) { - QString repeate = repeateColumn.attribute( "value" ); + TQString repeate = repeateColumn.attribute( "value" ); if ( !repeate.isEmpty() ) { Range range(repeate); //kdDebug()<<" repeate :"<<repeate<<"range. ::start row : "<<range.startRow ()<<" start col :"<<range.startCol ()<<" end row :"<<range.endRow ()<<" end col :"<<range.endCol ()<<endl; - table->print()->setPrintRepeatRows( qMakePair( range.startRow (),range.endRow ()) ); + table->print()->setPrintRepeatRows( tqMakePair( range.startRow (),range.endRow ()) ); } } - QDomElement repeateRow( printInfo.namedItem("gmr:repeat_left").toElement() ); + TQDomElement repeateRow( printInfo.namedItem("gmr:repeat_left").toElement() ); if ( !repeateRow.isNull() ) { - QString repeate = repeateRow.attribute( "value" ); + TQString repeate = repeateRow.attribute( "value" ); if ( !repeate.isEmpty() ) { //fix row too high - repeate = repeate.replace( "65536", "32500" ); + repeate = repeate.tqreplace( "65536", "32500" ); Range range(repeate); //kdDebug()<<" repeate :"<<repeate<<"range. ::start row : "<<range.startRow ()<<" start col :"<<range.startCol ()<<" end row :"<<range.endRow ()<<" end col :"<<range.endCol ()<<endl; - table->print()->setPrintRepeatColumns( qMakePair( range.startCol (),range.endCol ()) ); + table->print()->setPrintRepeatColumns( tqMakePair( range.startCol (),range.endCol ()) ); } } - QDomElement orient( printInfo.namedItem("gmr:orientation").toElement() ); + TQDomElement orient( printInfo.namedItem("gmr:orientation").toElement() ); if ( !orient.isNull() ) orientation = orient.text(); - QDomElement size( printInfo.namedItem("gmr:paper").toElement() ); + TQDomElement size( printInfo.namedItem("gmr:paper").toElement() ); if ( !size.isNull() ) paperSize = size.text(); @@ -948,7 +948,7 @@ void GNUMERICFilter::ParsePrintInfo( QDomNode const & printInfo, Sheet * table ) footLeft, footMiddle, footRight ); } -void GNUMERICFilter::ParseFormat(QString const & formatString, Cell * kspread_cell) +void GNUMERICFilter::ParseFormat(TQString const & formatString, Cell * kspread_cell) { int l = formatString.length(); int lastPos = 0; @@ -961,50 +961,50 @@ void GNUMERICFilter::ParseFormat(QString const & formatString, Cell * kspread_ce kspread_cell->format()->setCurrency( 1, "$" ); lastPos = 1; } - else if (formatString[0] == '�') + else if (formatString[0] == '�') { kspread_cell->format()->setFormatType(Money_format); - kspread_cell->format()->setCurrency( 1, "�" ); + kspread_cell->format()->setCurrency( 1, "�" ); lastPos = 1; } - else if (formatString[0] == '�') + else if (formatString[0] == '�') { kspread_cell->format()->setFormatType(Money_format); - kspread_cell->format()->setCurrency( 1, "�" ); + kspread_cell->format()->setCurrency( 1, "�" ); lastPos = 1; } - else if (formatString[0] == '�') + else if (formatString[0] == '�') { kspread_cell->format()->setFormatType(Money_format); - kspread_cell->format()->setCurrency( 1, "�" ); + kspread_cell->format()->setCurrency( 1, "�" ); lastPos = 1; } else if (l > 1) { if ((formatString[0] == '[') && (formatString[1] == '$')) { - int n = formatString.find(']'); + int n = formatString.tqfind(']'); if (n != -1) { - QString currency = formatString.mid(2, n - 2); + TQString currency = formatString.mid(2, n - 2); kspread_cell->format()->setFormatType(Money_format); kspread_cell->format()->setCurrency( 1, currency ); } lastPos = ++n; } - else if (formatString.find("E+0") != -1) + else if (formatString.tqfind("E+0") != -1) { kspread_cell->format()->setFormatType(Scientific_format); } else { // do pattern matching with gnumeric formats - QString content(kspread_cell->value().asString()); + TQString content(kspread_cell->value().asString()); if ( setType(kspread_cell, formatString, content) ) return; - if (formatString.find("?/?") != -1) + if (formatString.tqfind("?/?") != -1) { // TODO: fixme! kspread_cell->format()->setFormatType( fraction_three_digits ); @@ -1035,7 +1035,7 @@ void GNUMERICFilter::ParseFormat(QString const & formatString, Cell * kspread_ce while (formatString[lastPos] == ' ') ++lastPos; - int n = formatString.find( '.', lastPos ); + int n = formatString.tqfind( '.', lastPos ); if ( n != -1) { lastPos = n + 1; @@ -1051,12 +1051,12 @@ void GNUMERICFilter::ParseFormat(QString const & formatString, Cell * kspread_ce } bool red = false; - if (formatString.find("[RED]", lastPos) != -1) + if (formatString.tqfind("[RED]", lastPos) != -1) { red = true; kspread_cell->format()->setFloatColor( Format::NegRed ); } - if ( formatString.find('(', lastPos) != -1 ) + if ( formatString.tqfind('(', lastPos) != -1 ) { if ( red ) kspread_cell->format()->setFloatColor( Format::NegRedBrackets ); @@ -1065,13 +1065,13 @@ void GNUMERICFilter::ParseFormat(QString const & formatString, Cell * kspread_ce } } -void GNUMERICFilter::convertFormula( QString & formula ) const +void GNUMERICFilter::convertFormula( TQString & formula ) const { - int n = formula.find( '=', 1 ); + int n = formula.tqfind( '=', 1 ); // TODO: check if we do not screw something up here... if ( n != -1 ) - formula = formula.replace( n, 1, "==" ); + formula = formula.tqreplace( n, 1, "==" ); bool inQuote1 = false; bool inQuote2 = false; @@ -1083,30 +1083,30 @@ void GNUMERICFilter::convertFormula( QString & formula ) const else if ( formula[i] == '"' ) inQuote2 = !inQuote2; else if ( formula[i] == ',' && !inQuote1 && !inQuote2 ) - formula = formula.replace( i, 1, ";" ); + formula = formula.tqreplace( i, 1, ";" ); } } -void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) +void GNUMERICFilter::setStyleInfo(TQDomNode * sheet, Sheet * table) { kdDebug(30521) << "SetStyleInfo entered " << endl; int row, column; - QDomNode styles = sheet->namedItem( "gmr:Styles" ); + TQDomNode styles = sheet->namedItem( "gmr:Styles" ); if ( !styles.isNull() ) { // Get a style region within that sheet. - QDomNode style_region = styles.namedItem( "gmr:StyleRegion" ); + TQDomNode style_region = styles.namedItem( "gmr:StyleRegion" ); while ( !style_region.isNull() ) { - QDomElement e = style_region.toElement(); // try to convert the node to an element. + TQDomElement e = style_region.toElement(); // try to convert the node to an element. - QDomNode style = style_region.namedItem( "gmr:Style" ); - QDomNode font = style.namedItem( "gmr:Font" ); - QDomNode validation = style.namedItem( "gmr:Validation" ); - QDomNode gmr_styleborder = style.namedItem( "gmr:StyleBorder" ); - QDomNode hyperlink = style.namedItem( "gmr:HyperLink" ); + TQDomNode style = style_region.namedItem( "gmr:Style" ); + TQDomNode font = style.namedItem( "gmr:Font" ); + TQDomNode validation = style.namedItem( "gmr:Validation" ); + TQDomNode gmr_styleborder = style.namedItem( "gmr:StyleBorder" ); + TQDomNode hyperlink = style.namedItem( "gmr:HyperLink" ); int startCol = e.attribute( "startCol" ).toInt() + 1; int endCol = e.attribute( "endCol" ).toInt() + 1; int startRow = e.attribute( "startRow" ).toInt() + 1; @@ -1136,31 +1136,31 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) continue; } - QDomElement style_element = style.toElement(); // try to convert the node to an element. + TQDomElement style_element = style.toElement(); // try to convert the node to an element. kdDebug(30521) << "Style valid for kspread" << endl; kspread_cell = table->nonDefaultCell( column, row, false ); if (style_element.hasAttribute("Fore")) { - QString color_string = style_element.attribute("Fore"); - QColor color; + TQString color_string = style_element.attribute("Fore"); + TQColor color; convert_string_to_qcolor(color_string, &color); kspread_cell->format()->setTextColor(color); } if (style_element.hasAttribute("Back")) { - QString color_string = style_element.attribute("Back"); - QColor color; + TQString color_string = style_element.attribute("Back"); + TQColor color; convert_string_to_qcolor(color_string, &color); kspread_cell->format()->setBgColor(color); } if (style_element.hasAttribute("PatternColor")) { - QString color_string = style_element.attribute("PatternColor"); - QColor color; + TQString color_string = style_element.attribute("PatternColor"); + TQColor color; convert_string_to_qcolor(color_string, &color); kspread_cell->format()->setBackGroundBrushColor( color ); } @@ -1170,7 +1170,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) /* Pattern's taken from: gnumeric's pattern.c */ /* if "TODO" added: doesn't match exactly the gnumeric one */ - QString shade = style_element.attribute("Shade"); + TQString shade = style_element.attribute("Shade"); if (shade == "0") { // nothing to do @@ -1214,12 +1214,12 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) else if (shade == "7") { kspread_cell->format()->setBackGroundBrushStyle(Qt::HorPattern); - /* 7 Horizontal Stripe */ + /* 7Qt::Horizontal Stripe */ } else if (shade == "8") { kspread_cell->format()->setBackGroundBrushStyle(Qt::VerPattern); - /* 8 Vertical Stripe */ + /* 8Qt::Vertical Stripe */ } else if (shade == "9") { @@ -1243,7 +1243,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) } else if (shade == "13") { - /* 13 Thin Horizontal Stripe TODO: wrong: this is thick!*/ + /* 13 ThinQt::Horizontal Stripe TODO: wrong: this is thick!*/ kspread_cell->format()->setBackGroundBrushStyle(Qt::HorPattern); } else if (shade == "14") @@ -1313,7 +1313,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) if (style_element.hasAttribute("HAlign")) { - QString halign_string=style_element.attribute("HAlign"); + TQString halign_string=style_element.attribute("HAlign"); if (halign_string == "1") { @@ -1348,7 +1348,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) if (style_element.hasAttribute("VAlign")) { - QString valign_string=style_element.attribute("VAlign"); + TQString valign_string=style_element.attribute("VAlign"); if (valign_string == "1") { @@ -1371,7 +1371,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) if (style_element.hasAttribute("WrapText")) { - QString multiRow = style_element.attribute("WrapText"); + TQString multiRow = style_element.attribute("WrapText"); if ( multiRow == "1" ) kspread_cell->format()->setMultiRow( true ); @@ -1379,7 +1379,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) if (style_element.hasAttribute("Format")) { - QString formatString = style_element.attribute("Format"); + TQString formatString = style_element.attribute("Format"); kdDebug(30521) << "Format: " << formatString << endl; ParseFormat(formatString, kspread_cell); @@ -1388,12 +1388,12 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) if (!gmr_styleborder.isNull()) { - QDomElement style_element = gmr_styleborder.toElement(); // try to convert the node to an element. + TQDomElement style_element = gmr_styleborder.toElement(); // try to convert the node to an element. ParseBorder( style_element, kspread_cell ); } if ( !validation.isNull() ) { - QDomElement validation_element = validation.toElement(); + TQDomElement validation_element = validation.toElement(); if ( !validation_element.isNull() ) { kdDebug(30521)<<" Cell validation \n"; @@ -1432,8 +1432,8 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) break; } } - QDomNode expression0 = validation_element.namedItem( "gmr:Expression0" ); - QDomNode expression1 = validation_element.namedItem( "gmr:Expression1" ); + TQDomNode expression0 = validation_element.namedItem( "gmr:Expression0" ); + TQDomNode expression1 = validation_element.namedItem( "gmr:Expression1" ); //kdDebug()<<" expression0.isNull() "<<expression0.isNull()<<endl; //kdDebug()<<" expression1.isNull() "<<expression1.isNull()<<endl; if ( validation_element.hasAttribute( "Type" ) ) @@ -1574,46 +1574,46 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) case 0: kspread_validity->m_cond=Conditional::Between; if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); if ( !expression1.isNull() ) - kspread_validity->dateMax=QDate::fromString( expression1.toElement().text() ); + kspread_validity->dateMax=TQDate::fromString( expression1.toElement().text() ); break; case 1: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); if ( !expression1.isNull() ) - kspread_validity->dateMax=QDate::fromString( expression1.toElement().text() ); + kspread_validity->dateMax=TQDate::fromString( expression1.toElement().text() ); kspread_validity->m_cond=Conditional::DifferentTo; break; case 2: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::Equal; break; case 3: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::Different; break; case 4: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::Superior; break; case 5: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::Inferior; break; case 6: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::SuperiorEqual; break; case 7: if ( !expression0.isNull() ) - kspread_validity->dateMin=QDate::fromString( expression0.toElement().text() ); + kspread_validity->dateMin=TQDate::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::InferiorEqual; break; default: @@ -1632,20 +1632,20 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) case 0: kspread_validity->m_cond=Conditional::Between; if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); if ( !expression1.isNull() ) - kspread_validity->timeMax=QTime::fromString( expression1.toElement().text() ); + kspread_validity->timeMax=TQTime::fromString( expression1.toElement().text() ); break; case 1: if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); if ( !expression1.isNull() ) - kspread_validity->timeMax=QTime::fromString( expression1.toElement().text() ); + kspread_validity->timeMax=TQTime::fromString( expression1.toElement().text() ); kspread_validity->m_cond=Conditional::DifferentTo; break; case 2: if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::Equal; break; case 3: @@ -1653,22 +1653,22 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) break; case 4: if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::Superior; break; case 5: kspread_validity->m_cond=Conditional::Inferior; if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); break; case 6: kspread_validity->m_cond=Conditional::SuperiorEqual; if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); break; case 7: if ( !expression0.isNull() ) - kspread_validity->timeMin=QTime::fromString( expression0.toElement().text() ); + kspread_validity->timeMin=TQTime::fromString( expression0.toElement().text() ); kspread_validity->m_cond=Conditional::InferiorEqual; break; default: @@ -1746,7 +1746,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) } if (!font.isNull()) { - QDomElement font_element = font.toElement(); + TQDomElement font_element = font.toElement(); kspread_cell->format()->setTextFontFamily( font_element.text() ); @@ -1773,9 +1773,9 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) //<gmr:HyperLink type="GnmHLinkURL" target="www.kde.org"/> if ( hyperlink.toElement().hasAttribute( "type" ) ) { - QString linkType= hyperlink.toElement().attribute( "type" ); - QString target = hyperlink.toElement().attribute( "target" ); - QString tip = hyperlink.toElement().attribute( "tip" ); + TQString linkType= hyperlink.toElement().attribute( "type" ); + TQString target = hyperlink.toElement().attribute( "target" ); + TQString tip = hyperlink.toElement().attribute( "tip" ); if ( !tip.isEmpty() ) kspread_cell->setCellText( tip ); if ( linkType=="GnmHLinkURL" ) @@ -1822,7 +1822,7 @@ void GNUMERICFilter::setStyleInfo(QDomNode * sheet, Sheet * table) */ -KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const QCString & to ) +KoFilter::ConversiontqStatus GNUMERICFilter::convert( const TQCString & from, const TQCString & to ) { dateInit(); bool bSuccess=true; @@ -1835,7 +1835,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const kdDebug(30521) << "here we go... " << document->className() << endl; - if ( !::qt_cast<const KSpread::Doc *>( document ) ) // it's safer that way :) + if ( !::tqqt_cast<const KSpread::Doc *>( document ) ) // it's safer that way :) { kdWarning(30521) << "document isn't a KSpread::Doc but a " << document->className() << endl; return KoFilter::NotImplemented; @@ -1848,7 +1848,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const kdDebug(30521) << "...still here..." << endl; - // No need for a dynamic cast here, since we use Qt's moc magic + // No need for a dynamic cast here, since we use TQt's tqmoc magic Doc * ksdoc = ( Doc * ) document; if ( ksdoc->mimeType() != "application/x-kspread" ) @@ -1858,7 +1858,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const } - QIODevice* in = KFilterDev::deviceForFile(m_chain->inputFile(),"application/x-gzip"); + TQIODevice* in = KFilterDev::deviceForFile(m_chain->inputFile(),"application/x-gzip"); if ( !in ) { @@ -1873,8 +1873,8 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const return KoFilter::FileNotFound; } - QDomDocument doc; - QString errorMsg; + TQDomDocument doc; + TQString errorMsg; int errorLine, errorColumn; if ( !doc.setContent(in, &errorMsg, &errorLine, &errorColumn) ) { @@ -1894,8 +1894,8 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const int selectedTab = 0; Sheet * selTable = 0; - QDomElement docElem = doc.documentElement(); - QDomElement uiData = docElem.namedItem("gmr:UIData").toElement(); + TQDomElement docElem = doc.documentElement(); + TQDomElement uiData = docElem.namedItem("gmr:UIData").toElement(); if ( !uiData.isNull() ) { if ( uiData.hasAttribute( "SelectedTab" ) ) @@ -1908,14 +1908,14 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const } } } - QDomNode sheets = docElem.namedItem("gmr:Sheets"); + TQDomNode sheets = docElem.namedItem("gmr:Sheets"); if ( sheets.isNull() ) { //avoid crash with new file format. //TODO allow to load new file format return KoFilter::ParsingError; } - QDomNode sheet = sheets.namedItem("gmr:Sheet"); + TQDomNode sheet = sheets.namedItem("gmr:Sheet"); /* This sets the Document information. */ set_document_info( document, &docElem ); @@ -1930,7 +1930,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const // This is a mapping of exprID to expressions. - QDict<char> exprID_dict( 17, FALSE ); + TQDict<char> exprID_dict( 17, FALSE ); int num = 1; while (!sheet.isNull()) @@ -1941,17 +1941,17 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const if ( currentTab == selectedTab ) selTable = table; - QDomElement name = sheet.namedItem( "gmr:Name" ).toElement(); - QDomElement sheetElement = sheet.toElement(); + TQDomElement name = sheet.namedItem( "gmr:Name" ).toElement(); + TQDomElement sheetElement = sheet.toElement(); if ( !name.isNull() ) table->setSheetName( name.text(), false, false ); else - table->setSheetName( "Sheet" + QString::number( num ), false, false ); + table->setSheetName( "Sheet" + TQString::number( num ), false, false ); table->enableScrollBarUpdates( false ); //kdDebug()<<" sheetElement.hasAttribute( DisplayFormulas ) :"<<sheetElement.hasAttribute( "DisplayFormulas" )<<endl; - QString tmp; + TQString tmp; if ( sheetElement.hasAttribute( "DisplayFormulas" ) ) { tmp=sheetElement.attribute( "DisplayFormulas"); @@ -1985,17 +1985,17 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const setSelectionInfo(&sheet, table); /* handling print information */ - QDomNode printInfo = sheet.namedItem("gmr:PrintInformation"); + TQDomNode printInfo = sheet.namedItem("gmr:PrintInformation"); if ( !printInfo.isNull() ) ParsePrintInfo( printInfo, table ); kdDebug(30521) << "Reading in cells" << endl; /* CELL handling START */ - QDomNode cells = sheet.namedItem( "gmr:Cells" ); - QDomNode cell = cells.namedItem( "gmr:Cell" ); - QDomNode mergedCells = sheet.namedItem( "gmr:MergedRegions" ); - QDomNode mergedRegion = mergedCells.namedItem( "gmr:Merge" ); + TQDomNode cells = sheet.namedItem( "gmr:Cells" ); + TQDomNode cell = cells.namedItem( "gmr:Cell" ); + TQDomNode mergedCells = sheet.namedItem( "gmr:MergedRegions" ); + TQDomNode mergedRegion = mergedCells.namedItem( "gmr:Merge" ); if ( cell.isNull() ) { kdWarning(30521) << "No cells" << endl; @@ -2006,22 +2006,22 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const value += 2; emit sigProgress(value); - QDomElement e = cell.toElement(); // try to convert the node to an element. + TQDomElement e = cell.toElement(); // try to convert the node to an element. if ( !e.isNull() ) { // the node was really an element. kdDebug(30521) << "New Cell " << endl; - QDomNode content_node = cell.namedItem("gmr:Content"); + TQDomNode content_node = cell.namedItem("gmr:Content"); if (!content_node.isNull()) { - QDomElement content = content_node.toElement(); + TQDomElement content = content_node.toElement(); if( !content.isNull() ) { // the node was really an element. column = e.attribute( "Col" ).toInt() + 1; row = e.attribute( "Row" ).toInt() + 1; - QString cell_content( content.text() ); + TQString cell_content( content.text() ); //kdDebug()<<"cell_content :!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :"<<cell_content<<endl; if ( cell_content[0] == '=' ) convertFormula( cell_content ); @@ -2039,7 +2039,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const // <xsd:enumeration value="60"/> <!-- string --> // <xsd:enumeration value="70"/> <!-- cellrange --> // <xsd:enumeration value="80"/> <!-- array --> - QString valuetype = e.attribute( "ValueType" ); + TQString valuetype = e.attribute( "ValueType" ); if ( valuetype == "40" )//percentage { kspread_cell->format()->setFormatType( Percentage_format ); @@ -2054,7 +2054,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const if (e.hasAttribute( "ValueFormat" )) { - QString formatString = e.attribute( "ValueFormat" ); + TQString formatString = e.attribute( "ValueFormat" ); if ( !setType( kspread_cell, formatString, cell_content ) ) table->setText(row, column, cell_content, false); } @@ -2063,8 +2063,8 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const if (e.hasAttribute("ExprID")) { - // QString encoded_string(table->cellAt( column, row, false)->encodeFormula( row, column ).utf8()); - QString encoded_string(table->cellAt( column, row, false )->encodeFormula().latin1()); + // TQString encoded_string(table->cellAt( column, row, false)->encodeFormula( row, column ).utf8()); + TQString encoded_string(table->cellAt( column, row, false )->encodeFormula().latin1()); char * tmp_string = ( char * ) malloc( strlen( encoded_string.latin1() ) ); @@ -2075,7 +2075,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const exprID_dict.insert(e.attribute("ExprID"), tmp_string); kdDebug(30521) << exprID_dict[e.attribute("ExprID")] << endl; - kdDebug(30521) << exprID_dict[QString("1")] << endl; + kdDebug(30521) << exprID_dict[TQString("1")] << endl; kdDebug(30521) << e.attribute("ExprID") << endl; } @@ -2087,7 +2087,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const column = e.attribute( "Col" ).toInt() + 1; row = e.attribute( "Row" ).toInt() + 1; - QString cell_content( e.text() ); + TQString cell_content( e.text() ); //kdDebug()<<"cell_content :!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :"<<cell_content<<endl; if ( cell_content[0] == '=' ) convertFormula( cell_content ); @@ -2107,7 +2107,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const //<xsd:enumeration value="80"/> <!-- array --> //kspread_cell->setValue( date ); //kspread_cell->format()->setFormatType( type ); - QString valuetype = e.attribute( "ValueType" ); + TQString valuetype = e.attribute( "ValueType" ); if ( valuetype == "40" )//percentage { kspread_cell->format()->setFormatType( Percentage_format ); @@ -2123,7 +2123,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const if (e.hasAttribute( "ValueFormat" )) { - QString formatString = e.attribute( "ValueFormat" ); + TQString formatString = e.attribute( "ValueFormat" ); if ( !setType( kspread_cell, formatString, cell_content ) ) table->setText(row, column, cell_content, false); } @@ -2137,7 +2137,7 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const row = e.attribute("Row").toInt() + 1; char * expr; expr = exprID_dict[e.attribute("ExprID")]; - // expr = exprID_dict[QString("1")]; + // expr = exprID_dict[TQString("1")]; kdDebug(30521) << "FOO:" << column << row << endl; kdDebug(30521) << @@ -2161,8 +2161,8 @@ KoFilter::ConversionStatus GNUMERICFilter::convert( const QCString & from, const } while ( !mergedRegion.isNull() ) { - QDomElement e = mergedRegion.toElement(); // try to convert the node to an element. - QString cell_merge_area( e.text() ); + TQDomElement e = mergedRegion.toElement(); // try to convert the node to an element. + TQString cell_merge_area( e.text() ); Range range(cell_merge_area); //kdDebug()<<"text !!! :"<<cell_merge_area<< "range :start row : "<<range.startRow ()<<" start col :"<<range.startCol ()<<" end row :"<<range.endRow ()<<" end col :"<<range.endCol ()<<endl; Cell * cell = table->nonDefaultCell( range.startCol (), range.startRow () ); diff --git a/filters/kspread/gnumeric/gnumericimport.h b/filters/kspread/gnumeric/gnumericimport.h index fedd2368..f5a46d10 100644 --- a/filters/kspread/gnumeric/gnumericimport.h +++ b/filters/kspread/gnumeric/gnumericimport.h @@ -22,8 +22,8 @@ #include <KoFilter.h> -#include <qdatetime.h> -#include <qdom.h> +#include <tqdatetime.h> +#include <tqdom.h> namespace KSpread { @@ -34,33 +34,34 @@ class Sheet; class GNUMERICFilter : public KoFilter { Q_OBJECT + TQ_OBJECT public: - GNUMERICFilter(KoFilter *parent, const char *name, const QStringList&); + GNUMERICFilter(KoFilter *tqparent, const char *name, const TQStringList&); virtual ~GNUMERICFilter() {} - virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to ); + virtual KoFilter::ConversiontqStatus convert( const TQCString& from, const TQCString& to ); enum borderStyle { Left, Right, Top, Bottom, Diagonal, Revdiagonal}; private: - class GnumericDate : public QDate + class GnumericDate : public TQDate { public: static uint greg2jul( int y, int m, int d ); static void jul2greg( double num, int & y, int & m, int & d ); - static QTime getTime( double num ); + static TQTime getTime( double num ); }; void dateInit(); - QString convertVars( QString const & str, KSpread::Sheet * table ) const; - void ParsePrintInfo( QDomNode const & printInfo, KSpread::Sheet * table ); - void ParseFormat(QString const & formatString, KSpread::Cell* kspread_cell); - void setStyleInfo(QDomNode * sheet, KSpread::Sheet * table); - bool setType( KSpread::Cell* kspread_cell, QString const & formatString, QString & cell_content ); - void convertFormula( QString & formula ) const; - void importBorder( QDomElement border, borderStyle _style, KSpread::Cell*cell); - void ParseBorder( QDomElement & gmr_styleborder, KSpread::Cell* kspread_cell ); - double parseAttribute( const QDomElement &_element ); + TQString convertVars( TQString const & str, KSpread::Sheet * table ) const; + void ParsePrintInfo( TQDomNode const & printInfo, KSpread::Sheet * table ); + void ParseFormat(TQString const & formatString, KSpread::Cell* kspread_cell); + void setStyleInfo(TQDomNode * sheet, KSpread::Sheet * table); + bool setType( KSpread::Cell* kspread_cell, TQString const & formatString, TQString & cell_content ); + void convertFormula( TQString & formula ) const; + void importBorder( TQDomElement border, borderStyle _style, KSpread::Cell*cell); + void ParseBorder( TQDomElement & gmr_styleborder, KSpread::Cell* kspread_cell ); + double parseAttribute( const TQDomElement &_element ); }; #endif // GNUMERICFILTER_H diff --git a/filters/kspread/gnumeric/status.html b/filters/kspread/gnumeric/status.html index 3c92af2e..5089efa1 100644 --- a/filters/kspread/gnumeric/status.html +++ b/filters/kspread/gnumeric/status.html @@ -39,7 +39,7 @@ KOffice filters status: GNUmeric (GNOME spreadsheet)</h1></center> <tr BGCOLOR="#CCCCFF"> <td VALIGN=TOP><b><font size="+1">Features</font></b></td> -<td>Vertical & Horizontal Alignment, text wrapping, indention +<td>Vertical &Qt::Horizontal Alignment, text wrapping, indention <br>Background, Patter & Foreground color <br>Fonts: <br> @@ -61,7 +61,7 @@ Family <br>Page: size, orientation, borders, header and footer <br>Border: color, style, width for all 6 types <br>Background pattern: style, color -<br>Cell Size: Horizontal & Vertical +<br>Cell Size:Qt::Horizontal &Qt::Vertical <br>Hidden Columns <br>Default row heights and column widths <br>Area name @@ -81,7 +81,7 @@ Family <tr BGCOLOR="#EEEEFF"> <td VALIGN=TOP><b><font size="+1">Todo</font></b></td> -<td>Cell Size: Horizontal & Vertical (Export) (kspread doesn't +<td>Cell Size:Qt::Horizontal &Qt::Vertical (Export) (kspread doesn't support retriving the first "rowFormat" and colFormat".) <br> <br> @@ -128,7 +128,7 @@ support it.) <br>Jul 15, 2001 - Preliminary support for background patterns. <br>Aug 21, 2002 - text/number formats, border, patters, page/print info, comments <br>Aug 21, 2002 - font family, wrap text, number formating, precisions -<br>Sep 05, 2002 - bugfixes, default sizes, row and column layouts +<br>Sep 05, 2002 - bugfixes, default sizes, row and column tqlayouts <br>Sep 07, 2002 - bugfixes, preliminery date/time support <br>Feb 03, 2005 - export area name <br>Feb 06, 2005 - cells merged @@ -194,7 +194,7 @@ Faure</a> <a href="mailto:[email protected]">Werner Trobin</a></td> <tr BGCOLOR="#CCCCFF"> <td VALIGN=TOP><b><font size="+1">Features</font></b></td> -<td>Vertical & Horizontal Alignment +<td>Vertical &Qt::Horizontal Alignment <br>Background & Foreground color <br>Fonts: <br> @@ -208,10 +208,10 @@ Bold <br>Multiple Sheets (Tables) <br>Formulas!!! (ExprID) <br>Selections -<br>Cell Size: Horizontal & Vertical +<br>Cell Size:Qt::Horizontal &Qt::Vertical <br>Hidden columns/rows <br>Selected Tab -<br>Paper layout +<br>Paper tqlayout <br>area name <br>Cell comment <br>Text Rotation |