From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- filters/kspread/gnumeric/gnumeric.xsd | 20 +- filters/kspread/gnumeric/gnumericexport.cc | 358 +++++++++++------------ filters/kspread/gnumeric/gnumericexport.h | 35 +-- filters/kspread/gnumeric/gnumericimport.cc | 440 ++++++++++++++--------------- filters/kspread/gnumeric/gnumericimport.h | 31 +- filters/kspread/gnumeric/status.html | 14 +- 6 files changed, 450 insertions(+), 448 deletions(-) (limited to 'filters/kspread/gnumeric') 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 @@ - - + + @@ -492,7 +492,7 @@ - + @@ -801,7 +801,7 @@ - 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 #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -46,7 +46,7 @@ using namespace KSpread; typedef KGenericFactory 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 ) { // // 45 // 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 :"<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( document ) ) // it's safer that way :) + if ( !::tqqt_cast( 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(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 &area = ksdoc->listArea(); // copying by value is slow! - QValueList::ConstIterator it = area.begin(); - QValueList::ConstIterator end = area.end(); + TQDomElement areaNames = gnumeric_doc.createElement("gmr:Names"); + const TQValueList &area = ksdoc->listArea(); // copying by value is slow! + TQValueList::ConstIterator it = area.begin(); + TQValueList::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( 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); */ /* */ /* - 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 // 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( "", "&[TAB]" ); - headerFooter = headerFooter.replace( "", "&[DATE]" ); - headerFooter = headerFooter.replace( "", "&[PAGE]" ); - headerFooter = headerFooter.replace( "", "&[PAGES]" ); - headerFooter = headerFooter.replace( "