diff options
Diffstat (limited to 'kspread/kspread_cell.cc')
-rw-r--r-- | kspread/kspread_cell.cc | 1388 |
1 files changed, 694 insertions, 694 deletions
diff --git a/kspread/kspread_cell.cc b/kspread/kspread_cell.cc index 49e1d802..d71e0185 100644 --- a/kspread/kspread_cell.cc +++ b/kspread/kspread_cell.cc @@ -45,9 +45,9 @@ #include <float.h> #include <math.h> -#include <qapplication.h> -#include <qpopupmenu.h> -#include <qregexp.h> +#include <tqapplication.h> +#include <tqpopupmenu.h> +#include <tqregexp.h> #include "kspread_canvas.h" #include "kspread_condition.h" @@ -94,7 +94,7 @@ using namespace KSpread; namespace Cell_LNS { - QChar decimal_point = '\0'; + TQChar decimal_point = '\0'; } using namespace Cell_LNS; @@ -116,7 +116,7 @@ public: Extra() {} // Not empty when the cell holds a link - QString link; + TQString link; // Number of cells explicitly merged by the user in X and Y directions. int mergedXCells; @@ -140,7 +140,7 @@ public: // FIXME (comment): If the list consists of more than one obscuring // element, then is there an order between them that // is important? - QValueList<Cell*> obscuringCells; + TQValueList<Cell*> obscuringCells; // If non-NULL, contains a pointer to a condition or a validity test. Conditions *conditions; @@ -193,13 +193,13 @@ public: // // /Tomas // - QString strText; + TQString strText; // This is the text we want to display. Not necessarily the same // as strText, e.g. strText="1" and strOutText="1.00" Also holds // value that we got from calculation, formerly known as // strFormulaOut - QString strOutText; + TQString strOutText; // the Formula object for the cell KSpread::Formula *formula; @@ -223,7 +223,7 @@ public: Extra *extra(); Format *format; - Q_UINT32 flags; + TQ_UINT32 flags; private: // "Extra stuff", see explanation for Cell::Extra. @@ -277,7 +277,7 @@ Cell::Extra* Cell::Private::extra() cellExtra->extraWidth = 0.0; cellExtra->extraHeight = 0.0; cellExtra->nbLines = 0; -// cellExtra->highlight = QColor(0,0,0); +// cellExtra->highlight = TQColor(0,0,0); } return cellExtra; @@ -366,7 +366,7 @@ int Cell::column() const // Return the name of this cell, i.e. the string that the user would // use to reference it. Example: A1, BZ16 // -QString Cell::name() const +TQString Cell::name() const { return name( d->column, d->row ); } @@ -374,16 +374,16 @@ QString Cell::name() const // Return the name of any cell given by (col, row). // -QString Cell::name( int col, int row ) +TQString Cell::name( int col, int row ) { - return columnName( col ) + QString::number( row ); + return columnName( col ) + TQString::number( row ); } // Return the name of this cell, including the sheet name. // Example: sheet1!A5 // -QString Cell::fullName() const +TQString Cell::fullName() const { return fullName( sheet(), d->column, d->row ); } @@ -391,7 +391,7 @@ QString Cell::fullName() const // Return the full name of any cell given a sheet and (col, row). // -QString Cell::fullName( const Sheet* s, int col, int row ) +TQString Cell::fullName( const Sheet* s, int col, int row ) { return s->sheetName() + "!" + name( col, row ); } @@ -399,7 +399,7 @@ QString Cell::fullName( const Sheet* s, int col, int row ) // Return the symbolic name of the column of this cell. Examples: A, BB. // -QString Cell::columnName() const +TQString Cell::columnName() const { return columnName( d->column ); } @@ -411,21 +411,21 @@ KLocale* Cell::locale() const // Return the symbolic name of any column. // -QString Cell::columnName( uint column ) +TQString Cell::columnName( uint column ) { - QString str; + TQString str; unsigned digits = 1; unsigned offset = 0; column--; - if( column > 4058115285U ) return QString("@@@"); + if( column > 4058115285U ) return TQString("@@@"); for( unsigned limit = 26; column >= limit+offset; limit *= 26, digits++ ) offset += limit; for( unsigned c = column - offset; digits; --digits, c/=26 ) - str.prepend( QChar( 'A' + (c%26) ) ); + str.prepend( TQChar( 'A' + (c%26) ) ); return str; } @@ -445,7 +445,7 @@ bool Cell::isFormula() const // FIXME: These two functions are inconsistently named. It should be // either text() and outText() or strText() and strOutText(). // -QString Cell::text() const +TQString Cell::text() const { return d->strText; } @@ -455,7 +455,7 @@ QString Cell::text() const // square when shown. This could, for instance, be the calculated // result of a formula. // -QString Cell::strOutText() const +TQString Cell::strOutText() const { return d->strOutText; } @@ -486,7 +486,7 @@ void Cell::setValue( const Value& v ) clearAllErrors(); //If the value has not changed then we don't need to do anything - //(ie. no need to relayout, update dependant cells etc.), + //(ie. no need to retqlayout, update dependant cells etc.), //unless this cell contains a formula, in which case its dependancies might have changed //even though the value has not. For example, if this cell was previously empty (and its value is //therefore empty) and a new dependency upon an empty cell has been added. The new value would still @@ -513,7 +513,7 @@ void Cell::setValue( const Value& v ) format()->sheet()->setRegionPaintDirty(cellRect()); } -void Cell::setCellValue (const Value &v, FormatType fmtType, const QString &txt) +void Cell::setCellValue (const Value &v, FormatType fmtType, const TQString &txt) { if ( !txt.isNull() ) { @@ -617,7 +617,7 @@ void Cell::copyFormat( const Cell* cell ) if ( cell->format()->currencyInfo( c ) ) format()->setCurrency( c );*/ - QValueList<Conditional> conditionList = cell->conditionList(); + TQValueList<Conditional> conditionList = cell->conditionList(); if (d->hasExtra()) delete d->extra()->conditions; if ( cell->d->hasExtra() && cell->d->extra()->conditions ) @@ -644,7 +644,7 @@ void Cell::copyContent( const Cell* cell ) { // change all the references, e.g. from A1 to A3 if copying // from e.g. B2 to B4 - QString d = cell->encodeFormula(); + TQString d = cell->encodeFormula(); setCellText( cell->decodeFormula( d ) ); } else @@ -697,7 +697,7 @@ void Cell::mergeCells( int _col, int _row, int _x, int _y ) d->extra()->mergedYCells = 0; } - // Refresh the layout + // Refresh the tqlayout setFlag( Flag_LayoutDirty ); return; } @@ -717,7 +717,7 @@ void Cell::mergeCells( int _col, int _row, int _x, int _y ) } } - // Refresh the layout + // Refresh the tqlayout setFlag( Flag_LayoutDirty ); } @@ -768,8 +768,8 @@ void Cell::setLayoutDirtyFlag( bool format ) if (!d->hasExtra()) return; - QValueList<Cell*>::iterator it = d->extra()->obscuringCells.begin(); - QValueList<Cell*>::iterator end = d->extra()->obscuringCells.end(); + TQValueList<Cell*>::iterator it = d->extra()->obscuringCells.begin(); + TQValueList<Cell*>::iterator end = d->extra()->obscuringCells.end(); for ( ; it != end; ++it ) { (*it)->setLayoutDirtyFlag( format ); } @@ -797,22 +797,22 @@ bool Cell::needsPrinting() const // Background color or brush? if ( format()->hasProperty( Format::PBackgroundBrush ) ) { - const QBrush& brush=backGroundBrush(column(),row()); + const TQBrush& brush=backGroundBrush(column(),row()); //Only brushes that are visible (ie. they have a brush style and are not white) //need to be drawn - if ( (brush.style() != Qt::NoBrush) && - (brush.color() != Qt::white || brush.pixmap()) ) + if ( (brush.style() != TQt::NoBrush) && + (brush.color() != TQt::white || brush.pixmap()) ) return true; } if ( format()->hasProperty( Format::PBackgroundColor ) ) { kdDebug() << "needsPrinting: Has background colour" << endl; - QColor backgroundColor=bgColor(column(),row()); + TQColor backgroundColor=bgColor(column(),row()); //We don't need to print anything if the background is white - if (backgroundColor != Qt::white) + if (backgroundColor != TQt::white) return true; } @@ -844,8 +844,8 @@ bool Cell::isPartOfMerged() const if (!d->hasExtra()) return false; - QValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); - QValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); + TQValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); + TQValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); for ( ; it != end; ++it ) { Cell *cell = *it; @@ -884,8 +884,8 @@ Cell *Cell::ultimateObscuringCell() const return d->extra()->obscuringCells.first(); #if 0 - QValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); - QValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); + TQValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); + TQValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); for ( ; it != end; ++it ) { Cell *cell = *it; @@ -905,11 +905,11 @@ Cell *Cell::ultimateObscuringCell() const } -QValueList<Cell*> Cell::obscuringCells() const +TQValueList<Cell*> Cell::obscuringCells() const { if (!d->hasExtra()) { - QValueList<Cell*> empty; + TQValueList<Cell*> empty; return empty; } return d->extra()->obscuringCells; @@ -949,14 +949,14 @@ void Cell::unobscure( Cell * cell ) format()->sheet()->setRegionPaintDirty( cellRect() ); } -QString Cell::encodeFormula( bool _era, int _col, int _row ) const +TQString Cell::encodeFormula( bool _era, int _col, int _row ) const { if ( _col == -1 ) _col = d->column; if ( _row == -1 ) _row = d->row; - QString erg = ""; + TQString erg = ""; if(d->strText.isEmpty()) return d->strText; @@ -967,7 +967,7 @@ QString Cell::encodeFormula( bool _era, int _col, int _row ) const unsigned int pos = 0; const unsigned int length = d->strText.length(); - // All this can surely be made 10 times faster, but I just "ported" it to QString + // All this can surely be made 10 times faster, but I just "ported" it to TQString // without any attempt to optimize things -- this is really brittle (Werner) while ( pos < length ) { @@ -1003,7 +1003,7 @@ QString Cell::encodeFormula( bool _era, int _col, int _row ) const } else { - QString tmp = ""; + TQString tmp = ""; if ( d->strText[pos] == '$' ) { tmp = "$"; @@ -1012,7 +1012,7 @@ QString Cell::encodeFormula( bool _era, int _col, int _row ) const } if ( d->strText[pos].isLetter() ) { - QString buffer; + TQString buffer; unsigned int pos2 = 0; while ( pos < length && d->strText[pos].isLetter() ) { @@ -1049,20 +1049,20 @@ QString Cell::encodeFormula( bool _era, int _col, int _row ) const int col = 0; col = util_decodeColumnLabelText( buffer ); if ( fix1 ) - erg += QString( "$%1" ).arg( col ); + erg += TQString( "$%1" ).tqarg( col ); else if (_era) - erg += QChar(0xA7) + QString( "%1" ).arg( col ); + erg += TQChar(0xA7) + TQString( "%1" ).tqarg( col ); else - erg += QString( "#%1" ).arg( col - _col ); + erg += TQString( "#%1" ).tqarg( col - _col ); if ( fix2 ) - erg += QString( "$%1#").arg( row ); + erg += TQString( "$%1#").tqarg( row ); else if (_era) - erg += QChar(0xA7) + QString( "%1#" ).arg( row ); + erg += TQChar(0xA7) + TQString( "%1#" ).tqarg( row ); else - erg += QString( "#%1#" ).arg( row - _row ); + erg += TQString( "#%1#" ).tqarg( row - _row ); } } else @@ -1083,19 +1083,19 @@ QString Cell::encodeFormula( bool _era, int _col, int _row ) const return erg; } -QString Cell::decodeFormula( const QString &_text, int _col, int _row) const +TQString Cell::decodeFormula( const TQString &_text, int _col, int _row) const { if ( _col == -1 ) _col = d->column; if ( _row == -1 ) _row = d->row; - QString erg = ""; + TQString erg = ""; unsigned int pos = 0; const unsigned int length = _text.length(); if ( _text.isEmpty() ) - return QString(); + return TQString(); while ( pos < length ) { @@ -1115,17 +1115,17 @@ QString Cell::decodeFormula( const QString &_text, int _col, int _row) const if ( pos < length ) erg += _text[pos++]; } - else if ( _text[pos] == '#' || _text[pos] == '$' || _text[pos] == QChar(0xA7)) + else if ( _text[pos] == '#' || _text[pos] == '$' || _text[pos] == TQChar(0xA7)) { bool abs1 = false; bool abs2 = false; bool era1 = false; // if 1st is relative but encoded absolutely bool era2 = false; - QChar _t = _text[pos++]; + TQChar _t = _text[pos++]; if ( _t == '$' ) abs1 = true; - else if ( _t == QChar(0xA7) ) + else if ( _t == TQChar(0xA7) ) era1 = true; int col = 0; @@ -1140,7 +1140,7 @@ QString Cell::decodeFormula( const QString &_text, int _col, int _row) const _t = _text[pos++]; if ( _t == '$' ) abs2 = true; - else if ( _t == QChar(0xA7) ) + else if ( _t == TQChar(0xA7) ) era2 = true; int row = 0; @@ -1164,7 +1164,7 @@ QString Cell::decodeFormula( const QString &_text, int _col, int _row) const if ( abs2 ) erg += "$"; - erg += QString::number( row ); + erg += TQString::number( row ); } else erg += _text[pos++]; @@ -1204,7 +1204,7 @@ void Cell::freeAllObscuredCells() // Layout -// Recalculate the entire layout. This includes the following members: +// Recalculate the entire tqlayout. This includes the following members: // // d->textX, d->textY // d->textWidth, d->textHeight @@ -1218,15 +1218,15 @@ void Cell::freeAllObscuredCells() // d->strOutText // -void Cell::makeLayout( QPainter &_painter, int _col, int _row ) +void Cell::makeLayout( TQPainter &_painter, int _col, int _row ) { // Are _col and _row really needed ? // - // Yes they are: they are useful if this is the default layout, in + // Yes they are: they are useful if this is the default tqlayout, in // which case d->row and d->column are 0 and 0, but _col and _row // are the real coordinates of the cell. - // There is no need to remake the layout if it hasn't changed. + // There is no need to remake the tqlayout if it hasn't changed. if ( !testFlag( Flag_LayoutDirty ) ) return; @@ -1244,7 +1244,7 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) d->extra()->mergedXCells, d->extra()->mergedYCells ); // If the column for this cell is hidden or the row is too low, - // there is no use in remaking the layout. + // there is no use in remaking the tqlayout. ColumnFormat *cl1 = format()->sheet()->columnFormat( _col ); RowFormat *rl1 = format()->sheet()->rowFormat( _row ); if ( cl1->isHide() @@ -1259,7 +1259,7 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) // Empty text? Reset the outstring and, if this is the default // cell, return. if ( d->strOutText.isEmpty() ) { - d->strOutText = QString::null; + d->strOutText = TQString(); if ( isDefault() ) { clearFlag( Flag_LayoutDirty ); @@ -1309,7 +1309,7 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) d->extra()->extraHeight = height; } - QFontMetrics fm = _painter.fontMetrics(); + TQFontMetrics fm = _painter.fontMetrics(); d->fmAscent = fm.ascent(); // Check if we need to break the line into multiple lines and are @@ -1326,15 +1326,15 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) && format()->multiRow( _col, _row ) ) { // Copy of d->strOutText but without the newlines. -// QString o = d->strOutText.replace( QChar('\n'), " " ); +// TQString o = d->strOutText.tqreplace( TQChar('\n'), " " ); // don't remove the existing LF, these are intended line wraps (whishlist #9881) - QString o = d->strOutText; + TQString o = d->strOutText; // Break the line at appropriate places, i.e. spaces, if // necessary. This means to change the spaces where breaks occur // into newlines. - if ( o.find(' ') != -1 ) + if ( o.tqfind(' ') != -1 ) { d->strOutText = ""; @@ -1350,8 +1350,8 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) do { - breakpos = o.find( ' ', breakpos ); - int linefeed = o.find( '\n', pos1 ); + breakpos = o.tqfind( ' ', breakpos ); + int linefeed = o.tqfind( '\n', pos1 ); // kdDebug() << "start: " << start << "; breakpos: " << breakpos << "; pos1: " << pos1 << "; linefeed: " << linefeed << endl; @@ -1394,11 +1394,11 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) } breakpos++; - } while( o.find( ' ', breakpos ) != -1 ); + } while( o.tqfind( ' ', breakpos ) != -1 ); } else { - lines = o.contains('\n'); + lines = o.tqcontains('\n'); } d->textHeight *= lines; @@ -1409,12 +1409,12 @@ void Cell::makeLayout( QPainter &_painter, int _col, int _row ) // Calculate the maximum width, taking into account linebreaks, // and put it in d->textWidth. - QString t; + TQString t; int i; int pos = 0; d->textWidth = 0.0; do { - i = d->strOutText.find( "\n", pos ); + i = d->strOutText.tqfind( "\n", pos ); if ( i == -1 ) t = d->strOutText.mid( pos, d->strOutText.length() - pos ); @@ -1589,7 +1589,7 @@ void Cell::valueChanged () void Cell::setOutputText() { if ( isDefault() ) { - d->strOutText = QString::null; + d->strOutText = TQString(); if ( d->hasExtra() && d->extra()->conditions ) d->extra()->conditions->checkMatches(); @@ -1597,11 +1597,11 @@ void Cell::setOutputText() return; } - // If nothing has changed, we don't need to remake the text layout. + // If nothing has changed, we don't need to remake the text tqlayout. if ( !testFlag(Flag_TextFormatDirty) ) return; - // We don't want to remake the layout unnecessarily. + // We don't want to remake the tqlayout unnecessarily. clearFlag( Flag_TextFormatDirty ); // Display a formula if warranted. If not, display the value instead; @@ -1687,7 +1687,7 @@ void Cell::offsetAlign( int _col, int _row ) const double effTop = BORDER_SPACE + 0.5 * effTopBorderPen( _col, _row ).width(); const double effBottom = h - BORDER_SPACE - 0.5 * effBottomBorderPen( _col, _row ).width(); - // Calculate d->textY based on the vertical alignment and a few + // Calculate d->textY based on the vertical tqalignment and a few // other inputs. switch( ay ) { @@ -1846,7 +1846,7 @@ void Cell::offsetAlign( int _col, int _row ) a = Format::Left; } - // Calculate d->textX based on alignment and textwidth. + // Calculate d->textX based on tqalignment and textwidth. switch ( a ) { case Format::Left: d->textX = 0.5 * effLeftBorderPen( _col, _row ).width() + BORDER_SPACE; @@ -1868,10 +1868,10 @@ void Cell::offsetAlign( int _col, int _row ) // // Used in makeLayout() and calculateTextParameters(). // -void Cell::textSize( QPainter &_paint ) +void Cell::textSize( TQPainter &_paint ) { - QFontMetrics fm = _paint.fontMetrics(); - // Horizontal text ? + TQFontMetrics fm = _paint.fontMetrics(); + //Qt::Horizontal text ? int tmpAngle; int _row = row(); @@ -1919,7 +1919,7 @@ void Cell::textSize( QPainter &_paint ) // Set d->textWidth and d->textHeight to correct values according to // if the text is horizontal, vertical or rotated. if ( !tmpVerticalText && !tmpAngle ) { - // Horizontal text. + //Qt::Horizontal text. d->textWidth = format()->sheet()->doc()->unzoomItX( fm.width( d->strOutText ) ); int offsetFont = 0; @@ -1946,10 +1946,10 @@ void Cell::textSize( QPainter &_paint ) * cos ( tmpAngle * M_PI / 180 ) ) ); } else { - // Vertical text. + //Qt::Vertical text. int width = 0; for ( unsigned int i = 0; i < d->strOutText.length(); i++ ) - width = QMAX( width, fm.width( d->strOutText.at( i ) ) ); + width = TQMAX( width, fm.width( d->strOutText.at( i ) ) ); d->textWidth = format()->sheet()->doc()->unzoomItX( width ); d->textHeight = format()->sheet()->doc()->unzoomItY( ( fm.ascent() + fm.descent() ) @@ -1963,9 +1963,9 @@ void Cell::textSize( QPainter &_paint ) // Used in makeLayout() and calculateTextParameters(). // -void Cell::applyZoomedFont( QPainter &painter, int _col, int _row ) +void Cell::applyZoomedFont( TQPainter &painter, int _col, int _row ) { - QFont tmpFont( format()->textFont( _col, _row ) ); + TQFont tmpFont( format()->textFont( _col, _row ) ); // If there is a matching condition on this cell then set the // according style parameters. @@ -2020,7 +2020,7 @@ void Cell::applyZoomedFont( QPainter &painter, int _col, int _row ) //used in Sheet::adjustColumnHelper and Sheet::adjustRow -void Cell::calculateTextParameters( QPainter &_painter, +void Cell::calculateTextParameters( TQPainter &_painter, int _col, int _row ) { // Apply the correct font to _painter. @@ -2051,9 +2051,9 @@ bool Cell::makeFormula() if (format()->sheet()->doc()->getShowMessageError()) { - QString tmp(i18n("Error in cell %1\n\n")); - tmp = tmp.arg( fullName() ); - KMessageBox::error( (QWidget*)0L, tmp); + TQString tmp(i18n("Error in cell %1\n\n")); + tmp = tmp.tqarg( fullName() ); + KMessageBox::error( (TQWidget*)0L, tmp); } setFlag(Flag_ParseError); Value v; @@ -2133,14 +2133,14 @@ bool Cell::calc(bool delay) // coordinates. // -void Cell::paintCell( const KoRect &rect, QPainter & painter, +void Cell::paintCell( const KoRect &rect, TQPainter & painter, View *view, const KoPoint &coordinate, - const QPoint &cellRef, + const TQPoint &cellRef, int paintBorder, - QPen & rightPen, QPen & bottomPen, - QPen & leftPen, QPen & topPen, - QValueList<QPoint> &mergedCellsPainted, + TQPen & rightPen, TQPen & bottomPen, + TQPen & leftPen, TQPen & topPen, + TQValueList<TQPoint> &mergedCellsPainted, bool drawCursor ) { bool paintBorderRight = paintBorder & Border_Right; @@ -2177,7 +2177,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, Q_ASSERT(isDefault() || (((cellRef.x() == d->column) && (cellRef.y() == d->row)))); - Sheet::LayoutDirection sheetDir = format()->sheet()->layoutDirection(); + Sheet::LayoutDirection sheetDir = format()->sheet()->tqlayoutDirection(); double left = coordinate.x(); @@ -2193,7 +2193,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, double width = width0; double height = height0; - // Handle right-to-left layout. + // Handle right-to-left tqlayout. // In an RTL sheet the cells have to be painted at their opposite horizontal // location on the canvas, meaning that column A will be the rightmost column // on screen, column B will be to the left of it and so on. Here we change @@ -2243,24 +2243,24 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // itself really is selected. bool selected = false; if ( view != NULL ) { - selected = view->selectionInfo()->contains( cellRef ); + selected = view->selectionInfo()->tqcontains( cellRef ); // But the cell doesn't look selected if this is the marker cell. Cell *cell = format()->sheet()->cellAt( view->selectionInfo()->marker() ); - QPoint bottomRight( view->selectionInfo()->marker().x() + cell->extraXCells(), + TQPoint bottomRight( view->selectionInfo()->marker().x() + cell->extraXCells(), view->selectionInfo()->marker().y() + cell->extraYCells() ); - QRect markerArea( view->selectionInfo()->marker(), bottomRight ); - selected = selected && !( markerArea.contains( cellRef ) ); + TQRect markerArea( view->selectionInfo()->marker(), bottomRight ); + selected = selected && !( markerArea.tqcontains( cellRef ) ); // Don't draw any selection at all when printing. - if ( painter.device()->isExtDev() || !drawCursor ) + if ( painter.tqdevice()->isExtDev() || !drawCursor ) selected = false; } - // Need to make a new layout ? + // Need to make a new tqlayout ? // // FIXME: We have already used (at least) extraWidth/Height above, - // and now we are recalculating the layout. This has to be + // and now we are recalculating the tqlayout. This has to be // moved up above all uses. // // FIXME: This needs to be taken out eventually - it is done in @@ -2285,7 +2285,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // If there is a condition giving the background color for this cell // (and it matches), use that one, otherwise get the standard // background. - QColor backgroundColor; + TQColor backgroundColor; if ( d->hasExtra() && d->extra()->conditions && d->extra()->conditions->matchedStyle() && d->extra()->conditions->matchedStyle()->hasFeature( Style::SBackgroundColor, true ) ) @@ -2299,7 +2299,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // 2. Paint the default borders if we are on screen or if we are printing // and the checkbox to do this is checked. - if ( painter.device()->devType() != QInternal::Printer + if ( painter.tqdevice()->devType() != TQInternal::Printer || format()->sheet()->print()->printGrid()) paintDefaultBorders( painter, rect, cellRect, cellRef, paintBorderRight, paintBorderBottom, @@ -2336,7 +2336,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // If we print pages, then we disable clipping, otherwise borders are // cut in the middle at the page borders. - if ( painter.device()->isExtDev() ) + if ( painter.tqdevice()->isExtDev() ) painter.setClipping( false ); // Paint the borders if this cell is not part of another merged cell. @@ -2350,7 +2350,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, } // Turn clipping back on. - if ( painter.device()->isExtDev() ) + if ( painter.tqdevice()->isExtDev() ) painter.setClipping( true ); // 5. Paint diagonal lines and page borders. @@ -2364,12 +2364,12 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, if ( !isObscured() ) { // 6a. Paint possible comment indicator. - if ( !painter.device()->isExtDev() + if ( !painter.tqdevice()->isExtDev() || format()->sheet()->print()->printCommentIndicator() ) paintCommentIndicator( painter, cellRect, cellRef, backgroundColor ); // 6b. Paint possible formula indicator. - if ( !painter.device()->isExtDev() + if ( !painter.tqdevice()->isExtDev() || format()->sheet()->print()->printFormulaIndicator() ) paintFormulaIndicator( painter, cellRect, backgroundColor ); @@ -2389,7 +2389,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // b) something indicates that the text should not be painted // c) the sheet is protected and the cell is hidden. if ( !d->strOutText.isEmpty() - && ( !painter.device()->isExtDev() + && ( !painter.tqdevice()->isExtDev() || !format()->getDontprintText( cellRef.x(), cellRef.y() ) ) && !( format()->sheet()->isProtected() && format()->isHideAll( cellRef.x(), cellRef.y() ) ) ) @@ -2402,37 +2402,37 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // cells, then paint the obscuring cell(s). Otherwise don't do // anything so that we don't cause an infinite loop. if ( isObscured() && paintingObscured == 0 && - !( sheetDir == Sheet::RightToLeft && painter.device()->isExtDev() ) ) + !( sheetDir == Sheet::RightToLeft && painter.tqdevice()->isExtDev() ) ) { //kdDebug(36001) << "painting cells that obscure " << name() << endl; - // Store the obscuringCells list in a list of QPoint(column, row) + // Store the obscuringCells list in a list of TQPoint(column, row) // This avoids crashes during the iteration through // obscuringCells, when the cells may get non valid or the list // itself gets changed during a call of obscuringCell->paintCell // (this happens e.g. when there is an updateDepend) if (d->hasExtra()) { - QValueList<QPoint> listPoints; - QValueList<Cell*>::iterator it = d->extra()->obscuringCells.begin(); - QValueList<Cell*>::iterator end = d->extra()->obscuringCells.end(); + TQValueList<TQPoint> listPoints; + TQValueList<Cell*>::iterator it = d->extra()->obscuringCells.begin(); + TQValueList<Cell*>::iterator end = d->extra()->obscuringCells.end(); for ( ; it != end; ++it ) { Cell *obscuringCell = *it; - listPoints.append( QPoint( obscuringCell->column(), obscuringCell->row() ) ); + listPoints.append( TQPoint( obscuringCell->column(), obscuringCell->row() ) ); } - QValueList<QPoint>::iterator it1 = listPoints.begin(); - QValueList<QPoint>::iterator end1 = listPoints.end(); + TQValueList<TQPoint>::iterator it1 = listPoints.begin(); + TQValueList<TQPoint>::iterator end1 = listPoints.end(); for ( ; it1 != end1; ++it1 ) { - QPoint obscuringCellRef = *it1; + TQPoint obscuringCellRef = *it1; // Only paint those obscuring cells that haven't been already // painted yet. // // This optimization removes an O(n^4) behaviour where n is // the number of cells on one edge in a merged cell. - if ( mergedCellsPainted.contains( obscuringCellRef ) ) + if ( mergedCellsPainted.tqcontains( obscuringCellRef ) ) continue; Cell *obscuringCell = format()->sheet()->cellAt( obscuringCellRef.x(), @@ -2452,19 +2452,19 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // Get the effective pens for the borders. These are // determined by possible conditions on the cell with // associated styles. - QPen rp( obscuringCell->effRightBorderPen( obscuringCellRef.x(), + TQPen rp( obscuringCell->effRightBorderPen( obscuringCellRef.x(), obscuringCellRef.y() ) ); - QPen bp( obscuringCell->effBottomBorderPen( obscuringCellRef.x(), + TQPen bp( obscuringCell->effBottomBorderPen( obscuringCellRef.x(), obscuringCellRef.y() ) ); - QPen lp( obscuringCell->effLeftBorderPen( obscuringCellRef.x(), + TQPen lp( obscuringCell->effLeftBorderPen( obscuringCellRef.x(), obscuringCellRef.y() ) ); - QPen tp( obscuringCell->effTopBorderPen( obscuringCellRef.x(), + TQPen tp( obscuringCell->effTopBorderPen( obscuringCellRef.x(), obscuringCellRef.y() ) ); //kdDebug(36001) << " painting obscuring cell " // << obscuringCell->name() << endl; - // QPen highlightPen; + // TQPen highlightPen; //Note: Painting of highlight isn't quite right. If several // cells are merged, then the whole merged cell will be @@ -2497,9 +2497,9 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, * Modification for drawing the button */ if ( d->style == Cell::ST_Button ) { - QBrush fill( Qt::lightGray ); - QApplication::style().drawControl( QStyle::CE_PushButton, &_painter, this, - QRect( _tx + 1, _ty + 1, w2 - 1, h2 - 1 ), + TQBrush fill( TQt::lightGray ); + TQApplication::style().tqdrawControl( TQStyle::CE_PushButton, &_painter, this, + TQRect( _tx + 1, _ty + 1, w2 - 1, h2 - 1 ), defaultColorGroup ); //, selected, &fill ); } @@ -2507,7 +2507,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, * Modification for drawing the combo box */ else if ( d->style == Cell::ST_Select ) { - QApplication::style().drawComboButton( &_painter, _tx + 1, _ty + 1, + TQApplication::style().drawComboButton( &_painter, _tx + 1, _ty + 1, w2 - 1, h2 - 1, defaultColorGroup, selected ); } @@ -2515,27 +2515,27 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, #if 0 - void Cell::paintCellHighlight(QPainter& painter, + void Cell::paintCellHighlight(TQPainter& painter, const KoRect& cellRect, - const QPoint& cellRef, + const TQPoint& cellRef, const int highlightBorder, - const QPen& rightPen, - const QPen& bottomPen, - const QPen& leftPen, - const QPen& topPen + const TQPen& rightPen, + const TQPen& bottomPen, + const TQPen& leftPen, + const TQPen& topPen ) { //painter.drawLine(cellRect.left(),cellRect.top(),cellRect.right(),cellRect.bottom()); - //QPen pen(d->extra()->highlight); + //TQPen pen(d->extra()->highlight); //painter.setPen(highlightPen); - QBrush nullBrush; + TQBrush nullBrush; painter.setBrush(nullBrush); - QRect zoomedCellRect = sheet()->doc()->zoomRect( cellRect ); + TQRect zoomedCellRect = sheet()->doc()->zoomRect( cellRect ); //The highlight rect is just inside the main cell rect - //This saves the hassle of repainting nearby cells when the highlight is changed as the highlight areas + //This saves the hassle of tqrepainting nearby cells when the highlight is changed as the highlight areas //do not overlap zoomedCellRect.setLeft(zoomedCellRect.left()+1); //zoomedCellRect.setRight(zoomedCellRect.right()-1); @@ -2570,7 +2570,7 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, if (highlightBorder & Border_SizeGrip) { - QBrush brush(rightPen.color()); + TQBrush brush(rightPen.color()); painter.setBrush(brush); painter.setPen(rightPen); painter.drawRect(zoomedCellRect.right()-3,zoomedCellRect.bottom()-3,4,4); @@ -2583,17 +2583,17 @@ void Cell::paintCell( const KoRect &rect, QPainter & painter, // Paint all the cells that this cell obscures (helper function to paintCell). // -void Cell::paintObscuredCells(const KoRect& rect, QPainter& painter, +void Cell::paintObscuredCells(const KoRect& rect, TQPainter& painter, View* view, const KoRect &cellRect, - const QPoint &cellRef, + const TQPoint &cellRef, bool paintBorderRight, bool _paintBorderBottom, bool paintBorderLeft, bool _paintBorderTop, - QPen & rightPen, QPen & _bottomPen, - QPen & leftPen, QPen & _topPen, - QValueList<QPoint> &mergedCellsPainted) + TQPen & rightPen, TQPen & _bottomPen, + TQPen & leftPen, TQPen & _topPen, + TQValueList<TQPoint> &mergedCellsPainted) { // If there are no obscured cells, return. if ( !extraXCells() && !extraYCells() ) @@ -2614,8 +2614,8 @@ void Cell::paintObscuredCells(const KoRect& rect, QPainter& painter, uint column = cellRef.x() + x; uint row = cellRef.y() + y; - QPen topPen; - QPen bottomPen; + TQPen topPen; + TQPen bottomPen; bool paintBorderTop; bool paintBorderBottom; @@ -2642,7 +2642,7 @@ void Cell::paintObscuredCells(const KoRect& rect, QPainter& painter, cellUp->row() ); #if 0 - int penWidth = QMAX(1, sheet()->doc()->zoomItY( topPen.width() )); + int penWidth = TQMAX(1, sheet()->doc()->zoomItY( topPen.width() )); topPen.setWidth( penWidth ); #endif } @@ -2660,14 +2660,14 @@ void Cell::paintObscuredCells(const KoRect& rect, QPainter& painter, if (paintBorderBottom) paintBorder |= Cell::Border_Bottom; /*Cell::BorderSides highlightBorder = Border_None; - QPen highlightPen;*/ + TQPen highlightPen;*/ //kdDebug(36001) << "calling paintcell for obscured cell " // << cell->name() << endl; cell->paintCell( rect, painter, view, corner, - QPoint( cellRef.x() + x, cellRef.y() + y ), + TQPoint( cellRef.x() + x, cellRef.y() + y ), paintBorder, rightPen, bottomPen, leftPen, topPen, mergedCellsPainted); @@ -2682,12 +2682,12 @@ void Cell::paintObscuredCells(const KoRect& rect, QPainter& painter, // Paint the background of this cell. // -void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, - const QPoint &cellRef, bool selected, - QColor &backgroundColor ) +void Cell::paintBackground( TQPainter& painter, const KoRect &cellRect, + const TQPoint &cellRef, bool selected, + TQColor &backgroundColor ) { - QColorGroup defaultColorGroup = QApplication::palette().active(); - QRect zoomedCellRect = sheet()->doc()->zoomRect( cellRect ); + TQColorGroup defaultColorGroup = TQApplication::tqpalette().active(); + TQRect zoomedCellRect = sheet()->doc()->zoomRect( cellRect ); // If this is not the KS_rowMax and/or KS_colMax, then we reduce // width and/or height by one. This is due to the fact that the @@ -2705,7 +2705,7 @@ void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, { //If the cell's background color is too bright, use the default highlight color //Otherwise use a lighter version of the cell's background color. - QColor c; + TQColor c; int averageColor = (backgroundColor.red() + backgroundColor.green() + backgroundColor.blue()) / 3; @@ -2720,10 +2720,10 @@ void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, painter.setBackgroundColor( c ); } else { - QColor bg( backgroundColor ); + TQColor bg( backgroundColor ); // Handle printers separately. - if ( !painter.device()->isExtDev() ) { + if ( !painter.tqdevice()->isExtDev() ) { if ( bg.isValid() ) painter.setBackgroundColor( bg ); else @@ -2732,9 +2732,9 @@ void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, else { //bad hack but there is a qt bug //so I can print backgroundcolor - QBrush bb( bg ); + TQBrush bb( bg ); if ( !bg.isValid() ) - bb.setColor( Qt::white ); + bb.setColor( TQt::white ); painter.fillRect( zoomedCellRect, bb ); return; @@ -2742,11 +2742,11 @@ void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, } // Erase the background of the cell. - if ( !painter.device()->isExtDev() ) + if ( !painter.tqdevice()->isExtDev() ) painter.eraseRect( zoomedCellRect ); // Get a background brush - QBrush bb; + TQBrush bb; if ( d->hasExtra() && d->extra()->conditions && d->extra()->conditions->matchedStyle() @@ -2756,7 +2756,7 @@ void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, bb = backGroundBrush( cellRef.x(), cellRef.y() ); // Draw background pattern if necessary. - if ( bb.style() != Qt::NoBrush ) + if ( bb.style() != TQt::NoBrush ) painter.fillRect( zoomedCellRect, bb ); backgroundColor = painter.backgroundColor(); @@ -2765,13 +2765,13 @@ void Cell::paintBackground( QPainter& painter, const KoRect &cellRect, // Paint the standard light grey borders that are always visible. // -void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, +void Cell::paintDefaultBorders( TQPainter& painter, const KoRect &rect, const KoRect &cellRect, - const QPoint &cellRef, + const TQPoint &cellRef, bool paintBorderRight, bool /*paintBorderBottom*/, bool paintBorderLeft, bool paintBorderTop, - QPen const & rightPen, QPen const & /*bottomPen*/, - QPen const & leftPen, QPen const & topPen ) + TQPen const & rightPen, TQPen const & /*bottomPen*/, + TQPen const & leftPen, TQPen const & topPen ) { /* *** Notes about optimisation *** @@ -2783,15 +2783,15 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, I also couldn't work out under what conditions the variables dt / db would come out as anything other than 0 in the code for painting the various borders. The effTopBorderPen / effBottomBorderPen calls were taking up a lot of time according some profiling I did. If that code really is necessary, we need to find a more efficient way of getting the widths - than grabbing the whole QPen object and asking it. + than grabbing the whole TQPen object and asking it. --Robert Knight (robertknight@gmail.com) */ Doc* doc = sheet()->doc(); - Sheet::LayoutDirection sheetDir = format()->sheet()->layoutDirection(); - bool paintingToExternalDevice = painter.device()->isExtDev(); + Sheet::LayoutDirection sheetDir = format()->sheet()->tqlayoutDirection(); + bool paintingToExternalDevice = painter.tqdevice()->isExtDev(); // Each cell is responsible for drawing it's top and left portions // of the "default" grid. --Or not drawing it if it shouldn't be @@ -2803,23 +2803,23 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, bool paintBottom=false; bool paintRight=false; - paintLeft = ( paintBorderLeft && leftPen.style() == Qt::NoPen + paintLeft = ( paintBorderLeft && leftPen.style() == TQt::NoPen && sheet()->getShowGrid() && sheetDir==Sheet::LeftToRight ); - paintRight = ( paintBorderRight && rightPen.style() == Qt::NoPen + paintRight = ( paintBorderRight && rightPen.style() == TQt::NoPen && sheet()->getShowGrid() && sheetDir==Sheet::RightToLeft ); - paintTop = ( paintBorderTop && topPen.style() == Qt::NoPen + paintTop = ( paintBorderTop && topPen.style() == TQt::NoPen && sheet()->getShowGrid() ); // paintBottom = ( paintBorderBottom && sheet()->getShowGrid() -// && bottomPen.style() == Qt::NoPen ); +// && bottomPen.style() == TQt::NoPen ); //Set the single-pixel with pen for drawing the borders with. - painter.setPen( QPen( sheet()->doc()->gridColor(), 1, Qt::SolidLine ) ); + painter.setPen( TQPen( sheet()->doc()->gridColor(), 1, TQt::SolidLine ) ); // If there are extra cells, there might be more conditions. if (d->hasExtra()) { - QValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); - QValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); + TQValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); + TQValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); for ( ; it != end; ++it ) { Cell *cell = *it; @@ -2846,12 +2846,12 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, if ( cellRef.x() > 1 ) { Cell *cell_west = format()->sheet()->cellAt( cellRef.x() - 1, cellRef.y() ); - QPen t = cell_west->effTopBorderPen( cellRef.x() - 1, cellRef.y() ); - QPen b = cell_west->effBottomBorderPen( cellRef.x() - 1, cellRef.y() ); + TQPen t = cell_west->effTopBorderPen( cellRef.x() - 1, cellRef.y() ); + TQPen b = cell_west->effBottomBorderPen( cellRef.x() - 1, cellRef.y() ); - if ( t.style() != Qt::NoPen ) + if ( t.style() != TQt::NoPen ) dt = ( t.width() + 1 )/2; - if ( b.style() != Qt::NoPen ) + if ( b.style() != TQt::NoPen ) db = ( t.width() / 2); } #endif @@ -2860,15 +2860,15 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, // On paper, we always have full cells, on screen not. if ( paintingToExternalDevice ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( doc->zoomItX( QMAX( rect.left(), cellRect.right() ) ), - doc->zoomItY( QMAX( rect.top(), cellRect.y() + dt ) ), - doc->zoomItX( QMIN( rect.right(), cellRect.right() ) ), - doc->zoomItY( QMIN( rect.bottom(), cellRect.bottom() - db ) ) ); + painter.drawLine( doc->zoomItX( TQMAX( rect.left(), cellRect.right() ) ), + doc->zoomItY( TQMAX( rect.top(), cellRect.y() + dt ) ), + doc->zoomItX( TQMIN( rect.right(), cellRect.right() ) ), + doc->zoomItY( TQMIN( rect.bottom(), cellRect.bottom() - db ) ) ); else - painter.drawLine( doc->zoomItX( QMAX( rect.left(), cellRect.x() ) ), - doc->zoomItY( QMAX( rect.top(), cellRect.y() + dt ) ), - doc->zoomItX( QMIN( rect.right(), cellRect.x() ) ), - doc->zoomItY( QMIN( rect.bottom(), cellRect.bottom() - db ) ) ); + painter.drawLine( doc->zoomItX( TQMAX( rect.left(), cellRect.x() ) ), + doc->zoomItY( TQMAX( rect.top(), cellRect.y() + dt ) ), + doc->zoomItX( TQMIN( rect.right(), cellRect.x() ) ), + doc->zoomItY( TQMIN( rect.bottom(), cellRect.bottom() - db ) ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -2895,12 +2895,12 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, Cell *cell_north = format()->sheet()->cellAt( cellRef.x(), cellRef.y() - 1 ); - QPen l = cell_north->effLeftBorderPen( cellRef.x(), cellRef.y() - 1 ); - QPen r = cell_north->effRightBorderPen( cellRef.x(), cellRef.y() - 1 ); + TQPen l = cell_north->effLeftBorderPen( cellRef.x(), cellRef.y() - 1 ); + TQPen r = cell_north->effRightBorderPen( cellRef.x(), cellRef.y() - 1 ); - if ( l.style() != Qt::NoPen ) + if ( l.style() != TQt::NoPen ) dl = ( l.width() - 1 ) / 2 + 1; - if ( r.style() != Qt::NoPen ) + if ( r.style() != TQt::NoPen ) dr = r.width() / 2; } #endif @@ -2910,10 +2910,10 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. if ( paintingToExternalDevice ) { - painter.drawLine( doc->zoomItX( QMAX( rect.left(), cellRect.x() + dl ) ), - doc->zoomItY( QMAX( rect.top(), cellRect.y() ) ), - doc->zoomItX( QMIN( rect.right(), cellRect.right() - dr ) ), - doc->zoomItY( QMIN( rect.bottom(), cellRect.y() ) ) ); + painter.drawLine( doc->zoomItX( TQMAX( rect.left(), cellRect.x() + dl ) ), + doc->zoomItY( TQMAX( rect.top(), cellRect.y() ) ), + doc->zoomItX( TQMIN( rect.right(), cellRect.right() - dr ) ), + doc->zoomItY( TQMIN( rect.bottom(), cellRect.y() ) ) ); } else { painter.drawLine( doc->zoomItX( cellRect.x() + dl ), @@ -2934,31 +2934,31 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, Cell *cell_east = format()->sheet()->cellAt( cellRef.x() + 1, cellRef.y() ); - QPen t = cell_east->effTopBorderPen( cellRef.x() + 1, cellRef.y() ); - QPen b = cell_east->effBottomBorderPen( cellRef.x() + 1, cellRef.y() ); + TQPen t = cell_east->effTopBorderPen( cellRef.x() + 1, cellRef.y() ); + TQPen b = cell_east->effBottomBorderPen( cellRef.x() + 1, cellRef.y() ); - if ( t.style() != Qt::NoPen ) + if ( t.style() != TQt::NoPen ) dt = ( t.width() + 1 ) / 2; - if ( b.style() != Qt::NoPen ) + if ( b.style() != TQt::NoPen ) db = ( t.width() / 2); } #endif - //painter.setPen( QPen( sheet()->doc()->gridColor(), 1, Qt::SolidLine ) ); + //painter.setPen( TQPen( sheet()->doc()->gridColor(), 1, TQt::SolidLine ) ); // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( doc->zoomItX( QMAX( rect.left(), cellRect.x() ) ), - doc->zoomItY( QMAX( rect.top(), cellRect.y() + dt ) ), - doc->zoomItX( QMIN( rect.right(), cellRect.x() ) ), - doc->zoomItY( QMIN( rect.bottom(), cellRect.bottom() - db ) ) ); + painter.drawLine( doc->zoomItX( TQMAX( rect.left(), cellRect.x() ) ), + doc->zoomItY( TQMAX( rect.top(), cellRect.y() + dt ) ), + doc->zoomItX( TQMIN( rect.right(), cellRect.x() ) ), + doc->zoomItY( TQMIN( rect.bottom(), cellRect.bottom() - db ) ) ); else - painter.drawLine( doc->zoomItX( QMAX( rect.left(), cellRect.right() ) ), - doc->zoomItY( QMAX( rect.top(), cellRect.y() + dt ) ), - doc->zoomItX( QMIN( rect.right(), cellRect.right() ) ), - doc->zoomItY( QMIN( rect.bottom(), cellRect.bottom() - db ) ) ); + painter.drawLine( doc->zoomItX( TQMAX( rect.left(), cellRect.right() ) ), + doc->zoomItY( TQMAX( rect.top(), cellRect.y() + dt ) ), + doc->zoomItX( TQMIN( rect.right(), cellRect.right() ) ), + doc->zoomItY( TQMIN( rect.bottom(), cellRect.bottom() - db ) ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -2982,24 +2982,24 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, Cell *cell_south = format()->sheet()->cellAt( cellRef.x(), cellRef.y() + 1 ); - QPen l = cell_south->effLeftBorderPen( cellRef.x(), cellRef.y() + 1 ); - QPen r = cell_south->effRightBorderPen( cellRef.x(), cellRef.y() + 1 ); + TQPen l = cell_south->effLeftBorderPen( cellRef.x(), cellRef.y() + 1 ); + TQPen r = cell_south->effRightBorderPen( cellRef.x(), cellRef.y() + 1 ); - if ( l.style() != Qt::NoPen ) + if ( l.style() != TQt::NoPen ) dl = ( l.width() - 1 ) / 2 + 1; - if ( r.style() != Qt::NoPen ) + if ( r.style() != TQt::NoPen ) dr = r.width() / 2; } - painter.setPen( QPen( sheet()->doc()->gridColor(), 1, Qt::SolidLine ) ); + painter.setPen( TQPen( sheet()->doc()->gridColor(), 1, TQt::SolidLine ) ); // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { - painter.drawLine( doc->zoomItX( QMAX( rect.left(), cellRect.x() + dl ) ), - doc->zoomItY( QMAX( rect.top(), cellRect.bottom() ) ), - doc->zoomItX( QMIN( rect.right(), cellRect.right() - dr ) ), - doc->zoomItY( QMIN( rect.bottom(), cellRect.bottom() ) ) ); + if ( painter.tqdevice()->isExtDev() ) { + painter.drawLine( doc->zoomItX( TQMAX( rect.left(), cellRect.x() + dl ) ), + doc->zoomItY( TQMAX( rect.top(), cellRect.bottom() ) ), + doc->zoomItX( TQMIN( rect.right(), cellRect.right() - dr ) ), + doc->zoomItY( TQMIN( rect.bottom(), cellRect.bottom() ) ) ); } else { painter.drawLine( doc->zoomItX( cellRect.x() + dl ), @@ -3013,10 +3013,10 @@ void Cell::paintDefaultBorders( QPainter& painter, const KoRect &rect, // Paint a comment indicator if the cell has a comment. // -void Cell::paintCommentIndicator( QPainter& painter, +void Cell::paintCommentIndicator( TQPainter& painter, const KoRect &cellRect, - const QPoint &/*cellRef*/, - QColor &backgroundColor ) + const TQPoint &/*cellRef*/, + TQColor &backgroundColor ) { Doc * doc = sheet()->doc(); @@ -3026,20 +3026,20 @@ void Cell::paintCommentIndicator( QPainter& painter, && cellRect.width() > 10.0 && cellRect.height() > 10.0 && ( sheet()->print()->printCommentIndicator() - || ( !painter.device()->isExtDev() && sheet()->getShowCommentIndicator() ) ) ) { - QColor penColor = Qt::red; + || ( !painter.tqdevice()->isExtDev() && sheet()->getShowCommentIndicator() ) ) ) { + TQColor penColor = TQt::red; // If background has high red part, switch to blue. - if ( qRed( backgroundColor.rgb() ) > 127 && - qGreen( backgroundColor.rgb() ) < 80 && - qBlue( backgroundColor.rgb() ) < 80 ) + if ( tqRed( backgroundColor.rgb() ) > 127 && + tqGreen( backgroundColor.rgb() ) < 80 && + tqBlue( backgroundColor.rgb() ) < 80 ) { - penColor = Qt::blue; + penColor = TQt::blue; } // Get the triangle. - QPointArray point( 3 ); - if ( format()->sheet()->layoutDirection()==Sheet::RightToLeft ) { + TQPointArray point( 3 ); + if ( format()->sheet()->tqlayoutDirection()==Sheet::RightToLeft ) { point.setPoint( 0, doc->zoomItX( cellRect.x() + 6.0 ), doc->zoomItY( cellRect.y() ) ); point.setPoint( 1, doc->zoomItX( cellRect.x() ), @@ -3057,8 +3057,8 @@ void Cell::paintCommentIndicator( QPainter& painter, } // And draw it. - painter.setBrush( QBrush( penColor ) ); - painter.setPen( Qt::NoPen ); + painter.setBrush( TQBrush( penColor ) ); + painter.setPen( TQt::NoPen ); painter.drawPolygon( point ); } } @@ -3067,9 +3067,9 @@ void Cell::paintCommentIndicator( QPainter& painter, // Paint a small rectangle if this cell holds a formula. // -void Cell::paintFormulaIndicator( QPainter& painter, +void Cell::paintFormulaIndicator( TQPainter& painter, const KoRect &cellRect, - QColor &backgroundColor ) + TQColor &backgroundColor ) { if ( isFormula() && format()->sheet()->getShowFormulaIndicator() && @@ -3078,18 +3078,18 @@ void Cell::paintFormulaIndicator( QPainter& painter, { Doc* doc = sheet()->doc(); - QColor penColor = Qt::blue; + TQColor penColor = TQt::blue; // If background has high blue part, switch to red. - if ( qRed( backgroundColor.rgb() ) < 80 && - qGreen( backgroundColor.rgb() ) < 80 && - qBlue( backgroundColor.rgb() ) > 127 ) + if ( tqRed( backgroundColor.rgb() ) < 80 && + tqGreen( backgroundColor.rgb() ) < 80 && + tqBlue( backgroundColor.rgb() ) > 127 ) { - penColor = Qt::red; + penColor = TQt::red; } // Get the triangle... - QPointArray point( 3 ); - if ( format()->sheet()->layoutDirection()==Sheet::RightToLeft ) { + TQPointArray point( 3 ); + if ( format()->sheet()->tqlayoutDirection()==Sheet::RightToLeft ) { point.setPoint( 0, doc->zoomItX( cellRect.right() - 6.0 ), doc->zoomItY( cellRect.bottom() ) ); point.setPoint( 1, doc->zoomItX( cellRect.right() ), @@ -3107,8 +3107,8 @@ void Cell::paintFormulaIndicator( QPainter& painter, } // ...and draw it. - painter.setBrush( QBrush( penColor ) ); - painter.setPen( Qt::NoPen ); + painter.setBrush( TQBrush( penColor ) ); + painter.setPen( TQt::NoPen ); painter.drawPolygon( point ); } } @@ -3116,30 +3116,30 @@ void Cell::paintFormulaIndicator( QPainter& painter, // Paint an indicator that the text in the cell is cut. // -void Cell::paintMoreTextIndicator( QPainter& painter, +void Cell::paintMoreTextIndicator( TQPainter& painter, const KoRect &cellRect, - QColor &backgroundColor ) + TQColor &backgroundColor ) { // Show a red triangle when it's not possible to write all text in cell. // Don't print the red triangle if we're printing. if( testFlag( Flag_CellTooShortX ) && - !painter.device()->isExtDev() && + !painter.tqdevice()->isExtDev() && cellRect.height() > 4.0 && cellRect.width() > 4.0 ) { Doc* doc = sheet()->doc(); - QColor penColor = Qt::red; + TQColor penColor = TQt::red; // If background has high red part, switch to blue. - if ( qRed( backgroundColor.rgb() ) > 127 - && qGreen( backgroundColor.rgb() ) < 80 - && qBlue( backgroundColor.rgb() ) < 80 ) + if ( tqRed( backgroundColor.rgb() ) > 127 + && tqGreen( backgroundColor.rgb() ) < 80 + && tqBlue( backgroundColor.rgb() ) < 80 ) { - penColor = Qt::blue; + penColor = TQt::blue; } // Get the triangle... - QPointArray point( 3 ); + TQPointArray point( 3 ); if ( d->strOutText.isRightToLeft() ) { point.setPoint( 0, doc->zoomItX( cellRect.left() + 4.0 ), doc->zoomItY( cellRect.y() + cellRect.height() / 2.0 -4.0 ) ); @@ -3158,8 +3158,8 @@ void Cell::paintMoreTextIndicator( QPainter& painter, } // ...and paint it. - painter.setBrush( QBrush( penColor ) ); - painter.setPen( Qt::NoPen ); + painter.setBrush( TQBrush( penColor ) ); + painter.setPen( TQt::NoPen ); painter.drawPolygon( point ); } } @@ -3167,26 +3167,26 @@ void Cell::paintMoreTextIndicator( QPainter& painter, // Paint the real contents of a cell - the text. // -void Cell::paintText( QPainter& painter, +void Cell::paintText( TQPainter& painter, const KoRect &cellRect, - const QPoint &cellRef ) + const TQPoint &cellRef ) { Doc *doc = sheet()->doc(); ColumnFormat *colFormat = format()->sheet()->columnFormat( cellRef.x() ); - QColorGroup defaultColorGroup = QApplication::palette().active(); - QColor textColorPrint = effTextColor( cellRef.x(), cellRef.y() ); + TQColorGroup defaultColorGroup = TQApplication::tqpalette().active(); + TQColor textColorPrint = effTextColor( cellRef.x(), cellRef.y() ); // Resolve the text color if invalid (=default). if ( !textColorPrint.isValid() ) { - if ( painter.device()->isExtDev() ) - textColorPrint = Qt::black; + if ( painter.tqdevice()->isExtDev() ) + textColorPrint = TQt::black; else - textColorPrint = QApplication::palette().active().text(); + textColorPrint = TQApplication::tqpalette().active().text(); } - QPen tmpPen( textColorPrint ); + TQPen tmpPen( textColorPrint ); // Set the font according to the current zoom. applyZoomedFont( painter, cellRef.x(), cellRef.y() ); @@ -3203,14 +3203,14 @@ void Cell::paintText( QPainter& painter, double v = value().asFloat(); if ( format()->floatColor( cellRef.x(), cellRef.y()) == Format::NegRed && v < 0.0 ) - tmpPen.setColor( Qt::red ); + tmpPen.setColor( TQt::red ); } } // Check for blue color, for hyperlink. if ( !link().isEmpty() ) { - tmpPen.setColor( QApplication::palette().active().link() ); - QFont f = painter.font(); + tmpPen.setColor( TQApplication::tqpalette().active().link() ); + TQFont f = painter.font(); f.setUnderline( true ); painter.setFont( f ); } @@ -3234,7 +3234,7 @@ void Cell::paintText( QPainter& painter, if ( selected && ( cellRef.x() != marker.x() || cellRef.y() != marker.y() ) ) { - QPen p( tmpPen ); + TQPen p( tmpPen ); p.setColor( defaultColorGroup.highlightedText() ); painter.setPen( p ); } @@ -3244,7 +3244,7 @@ void Cell::paintText( QPainter& painter, #endif painter.setPen( tmpPen ); - QString tmpText = d->strOutText; + TQString tmpText = d->strOutText; double tmpHeight = d->textHeight; double tmpWidth = d->textWidth; @@ -3266,7 +3266,7 @@ void Cell::paintText( QPainter& painter, if ( format()->sheet()->getHideZero() && value().isNumber() && value().asFloat() == 0 ) { - d->strOutText = QString::null; + d->strOutText = TQString(); } // Clear extra cell if column or row is hidden @@ -3304,7 +3304,7 @@ void Cell::paintText( QPainter& painter, if ( a == Format::Right && !isEmpty() && testFlag( Flag_CellTooShortX ) ) offsetCellTooShort = format()->sheet()->doc()->unzoomItX( 4 ); - QFontMetrics fm2 = painter.fontMetrics(); + TQFontMetrics fm2 = painter.fontMetrics(); double offsetFont = 0.0; if ( format()->alignY( column(), row() ) == Format::Bottom @@ -3348,7 +3348,7 @@ void Cell::paintText( QPainter& painter, // - One line of text , horizontal // - Angled text // - Multiple rows of text , horizontal - // - Vertical text + // -Qt::Vertical text if ( !tmpMultiRow && !tmpVerticalText && !tmpAngle ) { // Case 1: The simple case, one line, no angle. @@ -3359,7 +3359,7 @@ void Cell::paintText( QPainter& painter, // Case 2: an angle. int angle = tmpAngle; - QFontMetrics fm = painter.fontMetrics(); + TQFontMetrics fm = painter.fontMetrics(); painter.rotate( angle ); double x; @@ -3383,13 +3383,13 @@ void Cell::paintText( QPainter& painter, else if ( tmpMultiRow && !tmpVerticalText ) { // Case 3: Multiple rows, but horizontal. - QString t; + TQString t; int i; int pos = 0; double dy = 0.0; - QFontMetrics fm = painter.fontMetrics(); + TQFontMetrics fm = painter.fontMetrics(); do { - i = d->strOutText.find( "\n", pos ); + i = d->strOutText.tqfind( "\n", pos ); if ( i == -1 ) t = d->strOutText.mid( pos, d->strOutText.length() - pos ); else { @@ -3424,13 +3424,13 @@ void Cell::paintText( QPainter& painter, } while ( i != -1 ); } else if ( tmpVerticalText && !d->strOutText.isEmpty() ) { - // Case 4: Vertical text. + // Case 4:Qt::Vertical text. - QString t; + TQString t; int i = 0; int len = 0; double dy = 0.0; - QFontMetrics fm = painter.fontMetrics(); + TQFontMetrics fm = painter.fontMetrics(); do { len = d->strOutText.length(); t = d->strOutText.at( i ); @@ -3459,14 +3459,14 @@ void Cell::paintText( QPainter& painter, // Paint page borders on the page. Only do this on the screen. // -void Cell::paintPageBorders( QPainter& painter, +void Cell::paintPageBorders( TQPainter& painter, const KoRect &cellRect, - const QPoint &cellRef, + const TQPoint &cellRef, bool paintBorderRight, bool paintBorderBottom ) { // Not screen? Return immediately. - if ( painter.device()->isExtDev() ) + if ( painter.tqdevice()->isExtDev() ) return; if ( ! format()->sheet()->isShowPageBorders() ) @@ -3474,7 +3474,7 @@ void Cell::paintPageBorders( QPainter& painter, SheetPrint* print = format()->sheet()->print(); - Sheet::LayoutDirection sheetDir = format()->sheet()->layoutDirection(); + Sheet::LayoutDirection sheetDir = format()->sheet()->tqlayoutDirection(); Doc* doc = sheet()->doc(); int zcellRect_left = doc->zoomItX (cellRect.left()); @@ -3538,13 +3538,13 @@ void Cell::paintPageBorders( QPainter& painter, // Paint the cell borders. // -void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, +void Cell::paintCellBorders( TQPainter& painter, const KoRect& rect, const KoRect &cellRect, - const QPoint &cellRef, + const TQPoint &cellRef, bool paintRight, bool paintBottom, bool paintLeft, bool paintTop, - QPen & _rightPen, QPen & _bottomPen, - QPen & _leftPen, QPen & _topPen ) + TQPen & _rightPen, TQPen & _bottomPen, + TQPen & _leftPen, TQPen & _topPen ) { //Sanity check: If we are not painting any of the borders then the function @@ -3554,7 +3554,7 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, Doc * doc = sheet()->doc(); - Sheet::LayoutDirection sheetDir = format()->sheet()->layoutDirection(); + Sheet::LayoutDirection sheetDir = format()->sheet()->tqlayoutDirection(); // compute zoomed rectangles // I don't use KoRect, because that ends up producing lots of warnings @@ -3580,8 +3580,8 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // paintBottom = paintBottom && ( d->extra()->extraYCells() == 0 ); if (d->hasExtra()) { - QValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); - QValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); + TQValueList<Cell*>::const_iterator it = d->extra()->obscuringCells.begin(); + TQValueList<Cell*>::const_iterator end = d->extra()->obscuringCells.end(); for ( ; it != end; ++it ) { Cell* cell = *it; @@ -3599,28 +3599,28 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // Must create copies of these since otherwise the zoomIt() // operation will be performed on them repeatedly. - QPen leftPen( _leftPen ); - QPen rightPen( _rightPen ); - QPen topPen( _topPen ); - QPen bottomPen( _bottomPen ); + TQPen leftPen( _leftPen ); + TQPen rightPen( _rightPen ); + TQPen topPen( _topPen ); + TQPen bottomPen( _bottomPen ); // Determine the pens that should be used for drawing // the borders. // - int left_penWidth = QMAX( 1, doc->zoomItX( leftPen.width() ) ); - int right_penWidth = QMAX( 1, doc->zoomItX( rightPen.width() ) ); - int top_penWidth = QMAX( 1, doc->zoomItY( topPen.width() ) ); - int bottom_penWidth = QMAX( 1, doc->zoomItY( bottomPen.width() ) ); + int left_penWidth = TQMAX( 1, doc->zoomItX( leftPen.width() ) ); + int right_penWidth = TQMAX( 1, doc->zoomItX( rightPen.width() ) ); + int top_penWidth = TQMAX( 1, doc->zoomItY( topPen.width() ) ); + int bottom_penWidth = TQMAX( 1, doc->zoomItY( bottomPen.width() ) ); leftPen.setWidth( left_penWidth ); rightPen.setWidth( right_penWidth ); topPen.setWidth( top_penWidth ); bottomPen.setWidth( bottom_penWidth ); - if ( paintLeft && leftPen.style() != Qt::NoPen ) { - int top = ( QMAX( 0, -1 + top_penWidth ) ) / 2 + - ( ( QMAX( 0, -1 + top_penWidth ) ) % 2 ); - int bottom = ( QMAX( 0, -1 + bottom_penWidth ) ) / 2 + 1; + if ( paintLeft && leftPen.style() != TQt::NoPen ) { + int top = ( TQMAX( 0, -1 + top_penWidth ) ) / 2 + + ( ( TQMAX( 0, -1 + top_penWidth ) ) % 2 ); + int bottom = ( TQMAX( 0, -1 + bottom_penWidth ) ) / 2 + 1; painter.setPen( leftPen ); @@ -3628,11 +3628,11 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { // FIXME: There is probably Cut&Paste bugs here as well as below. - // The QMIN/QMAX and left/right pairs don't really make sense. + // The TQMIN/TQMAX and left/right pairs don't really make sense. // - // UPDATE: In fact, most of these QMIN/QMAX combinations + // UPDATE: In fact, most of these TQMIN/TQMAX combinations // are TOTALLY BOGUS. For one thing, the idea // that we always have full cells on paper is wrong // since we can have embedded sheets in e.g. kword, @@ -3640,15 +3640,15 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // REVISE THIS WHOLE BORDER PAINTING SECTION! // if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( QMIN( zrect_right, zcellRect_right ), - QMAX( zrect_top, zcellRect_top - top ), - QMIN( zrect_right, zcellRect_right ), - QMIN( zrect_bottom, zcellRect_bottom + bottom ) ); + painter.drawLine( TQMIN( zrect_right, zcellRect_right ), + TQMAX( zrect_top, zcellRect_top - top ), + TQMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_bottom, zcellRect_bottom + bottom ) ); else - painter.drawLine( QMAX( zrect_left, zcellRect_left ), - QMAX( zrect_top, zcellRect_top - top ), - QMAX( zrect_left, zcellRect_left ), - QMIN( zrect_bottom, zcellRect_bottom + bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), + TQMAX( zrect_top, zcellRect_top - top ), + TQMAX( zrect_left, zcellRect_left ), + TQMIN( zrect_bottom, zcellRect_bottom + bottom ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -3664,10 +3664,10 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, } } - if ( paintRight && rightPen.style() != Qt::NoPen ) { - int top = ( QMAX( 0, -1 + top_penWidth ) ) / 2 + - ( ( QMAX( 0, -1 + top_penWidth ) ) % 2 ); - int bottom = ( QMAX( 0, -1 + bottom_penWidth ) ) / 2 + 1; + if ( paintRight && rightPen.style() != TQt::NoPen ) { + int top = ( TQMAX( 0, -1 + top_penWidth ) ) / 2 + + ( ( TQMAX( 0, -1 + top_penWidth ) ) % 2 ); + int bottom = ( TQMAX( 0, -1 + bottom_penWidth ) ) / 2 + 1; painter.setPen( rightPen ); @@ -3675,12 +3675,12 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( QMAX( zrect_left, zcellRect_left ), - QMAX( zrect_top, zcellRect_top - top ), - QMAX( zrect_left, zcellRect_left ), - QMIN( zrect_bottom, zcellRect_bottom + bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), + TQMAX( zrect_top, zcellRect_top - top ), + TQMAX( zrect_left, zcellRect_left ), + TQMIN( zrect_bottom, zcellRect_bottom + bottom ) ); else { // FIXME: This is the way all these things should look. // Make it so. @@ -3688,9 +3688,9 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // Only print the right border if it is visible. if ( zcellRect_right <= zrect_right + right_penWidth / 2) painter.drawLine( zcellRect_right, - QMAX( zrect_top, zcellRect_top - top ), + TQMAX( zrect_top, zcellRect_top - top ), zcellRect_right, - QMIN( zrect_bottom, zcellRect_bottom + bottom ) ); + TQMIN( zrect_bottom, zcellRect_bottom + bottom ) ); } } else { @@ -3707,7 +3707,7 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, } } - if ( paintTop && topPen.style() != Qt::NoPen ) { + if ( paintTop && topPen.style() != TQt::NoPen ) { painter.setPen( topPen ); //kdDebug(36001) << " painting top border of cell " << name() @@ -3716,11 +3716,11 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( zcellRect_top >= zrect_top + top_penWidth / 2) - painter.drawLine( QMAX( zrect_left, zcellRect_left ), + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), zcellRect_top, - QMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_right, zcellRect_right ), zcellRect_top ); } else { @@ -3729,7 +3729,7 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, } } - if ( paintBottom && bottomPen.style() != Qt::NoPen ) { + if ( paintBottom && bottomPen.style() != TQt::NoPen ) { painter.setPen( bottomPen ); //kdDebug(36001) << " painting bottom border of cell " << name() @@ -3738,11 +3738,11 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( zcellRect_bottom <= zrect_bottom + bottom_penWidth / 2) - painter.drawLine( QMAX( zrect_left, zcellRect_left ), + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), zcellRect_bottom, - QMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_right, zcellRect_right ), zcellRect_bottom ); } else { @@ -3762,9 +3762,9 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, #if 0 // Look at the cells on our corners. It may happen that we // just erased parts of their borders corner, so we might need - // to repaint these corners. + // to tqrepaint these corners. // - QPen vert_pen, horz_pen; + TQPen vert_pen, horz_pen; int vert_penWidth, horz_penWidth; // Some useful referenses. @@ -3793,10 +3793,10 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, vert_pen = cell_northwest->effRightBorderPen( cellRef.x() - 1, cellRef.y() - 1 ); - vert_penWidth = QMAX( 1, doc->zoomItX( vert_pen.width() ) ); + vert_penWidth = TQMAX( 1, doc->zoomItX( vert_pen.width() ) ); vert_pen.setWidth( vert_penWidth ); - if ( vert_pen.style() != Qt::NoPen ) { + if ( vert_pen.style() != TQt::NoPen ) { if ( cell_west->effTopBorderValue( cellRef.x() - 1, cellRef.y() ) >= cell_northwest->effBottomBorderValue( cellRef.x() - 1, cellRef.y() - 1 ) ) horz_pen = cell_west->effTopBorderPen( cellRef.x() - 1, cellRef.y() ); @@ -3804,23 +3804,23 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, horz_pen = cell_northwest->effBottomBorderPen( cellRef.x() - 1, cellRef.y() - 1 ); - horz_penWidth = QMAX( 1, doc->zoomItY( horz_pen.width() ) ); - int bottom = ( QMAX( 0, -1 + horz_penWidth ) ) / 2 + 1; + horz_penWidth = TQMAX( 1, doc->zoomItY( horz_pen.width() ) ); + int bottom = ( TQMAX( 0, -1 + horz_penWidth ) ) / 2 + 1; painter.setPen( vert_pen ); // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( QMAX( zrect_left, zcellRect_right ), - QMAX( zrect_top, zcellRect_top ), - QMIN( zrect_right, zcellRect_right ), - QMIN( zrect_bottom, zcellRect_top + bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_right ), + TQMAX( zrect_top, zcellRect_top ), + TQMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_bottom, zcellRect_top + bottom ) ); else - painter.drawLine( QMAX( zrect_left, zcellRect_left ), - QMAX( zrect_top, zcellRect_top ), - QMIN( zrect_right, zcellRect_left ), - QMIN( zrect_bottom, zcellRect_top + bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), + TQMAX( zrect_top, zcellRect_top ), + TQMIN( zrect_right, zcellRect_left ), + TQMIN( zrect_bottom, zcellRect_top + bottom ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -3842,9 +3842,9 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, cellRef.y() - 1 ); // vert_pen = effRightBorderPen( cellRef.x(), cellRef.y() - 1 ); - vert_penWidth = QMAX( 1, doc->zoomItX( vert_pen.width() ) ); + vert_penWidth = TQMAX( 1, doc->zoomItX( vert_pen.width() ) ); vert_pen.setWidth( vert_penWidth ); - if ( ( vert_pen.style() != Qt::NoPen ) && ( cellRef.x() < KS_colMax ) ) { + if ( ( vert_pen.style() != TQt::NoPen ) && ( cellRef.x() < KS_colMax ) ) { if ( cell_east->effTopBorderValue( cellRef.x() + 1, cellRef.y() ) >= cell_northeast->effBottomBorderValue( cellRef.x() + 1, cellRef.y() - 1 ) ) @@ -3854,23 +3854,23 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, cellRef.y() - 1 ); // horz_pen = effTopBorderPen( cellRef.x() + 1, cellRef.y() ); - horz_penWidth = QMAX( 1, doc->zoomItY( horz_pen.width() ) ); - int bottom = ( QMAX( 0, -1 + horz_penWidth ) ) / 2 + 1; + horz_penWidth = TQMAX( 1, doc->zoomItY( horz_pen.width() ) ); + int bottom = ( TQMAX( 0, -1 + horz_penWidth ) ) / 2 + 1; painter.setPen( vert_pen ); //If we are on paper printout, we limit the length of the lines //On paper, we always have full cells, on screen not - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( QMAX( zrect_left, zcellRect_left ), - QMAX( zrect_top, zcellRect_top ), - QMIN( zrect_right, zcellRect_left ), - QMIN( zrect_bottom, zcellRect_top + bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), + TQMAX( zrect_top, zcellRect_top ), + TQMIN( zrect_right, zcellRect_left ), + TQMIN( zrect_bottom, zcellRect_top + bottom ) ); else - painter.drawLine( QMAX( zrect_left, zcellRect_right ), - QMAX( zrect_top, zcellRect_top ), - QMIN( zrect_right, zcellRect_right ), - QMIN( zrect_bottom, zcellRect_top + bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_right ), + TQMAX( zrect_top, zcellRect_top ), + TQMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_bottom, zcellRect_top + bottom ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -3894,9 +3894,9 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, cellRef.y() + 1 ); // vert_pen = effLeftBorderPen( cellRef.x(), cellRef.y() + 1 ); - vert_penWidth = QMAX( 1, doc->zoomItY( vert_pen.width() ) ); + vert_penWidth = TQMAX( 1, doc->zoomItY( vert_pen.width() ) ); vert_pen.setWidth( vert_penWidth ); - if ( vert_pen.style() != Qt::NoPen ) { + if ( vert_pen.style() != TQt::NoPen ) { if ( cell_west->effBottomBorderValue( cellRef.x() - 1, cellRef.y() ) >= cell_southwest->effTopBorderValue( cellRef.x() - 1, cellRef.y() + 1 ) ) @@ -3907,23 +3907,23 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, cellRef.y() + 1 ); // horz_pen = effBottomBorderPen( cellRef.x() - 1, cellRef.y() ); - horz_penWidth = QMAX( 1, doc->zoomItX( horz_pen.width() ) ); - int bottom = ( QMAX( 0, -1 + horz_penWidth ) ) / 2; + horz_penWidth = TQMAX( 1, doc->zoomItX( horz_pen.width() ) ); + int bottom = ( TQMAX( 0, -1 + horz_penWidth ) ) / 2; painter.setPen( vert_pen ); // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( QMAX( zrect_left, zcellRect_right ), - QMAX( zrect_top, zcellRect_bottom - bottom ), - QMIN( zrect_right, zcellRect_right ), - QMIN( zrect_bottom, zcellRect_bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_right ), + TQMAX( zrect_top, zcellRect_bottom - bottom ), + TQMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_bottom, zcellRect_bottom ) ); else - painter.drawLine( QMAX( zrect_left, zcellRect_left ), - QMAX( zrect_top, zcellRect_bottom - bottom ), - QMIN( zrect_right, zcellRect_left ), - QMIN( zrect_bottom, zcellRect_bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), + TQMAX( zrect_top, zcellRect_bottom - bottom ), + TQMIN( zrect_right, zcellRect_left ), + TQMIN( zrect_bottom, zcellRect_bottom ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -3945,9 +3945,9 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, cellRef.y() + 1 ); // vert_pen = effRightBorderPen( cellRef.x(), cellRef.y() + 1 ); - vert_penWidth = QMAX( 1, doc->zoomItY( vert_pen.width() ) ); + vert_penWidth = TQMAX( 1, doc->zoomItY( vert_pen.width() ) ); vert_pen.setWidth( vert_penWidth ); - if ( ( vert_pen.style() != Qt::NoPen ) && ( cellRef.x() < KS_colMax ) ) { + if ( ( vert_pen.style() != TQt::NoPen ) && ( cellRef.x() < KS_colMax ) ) { if ( cell_east ->effBottomBorderValue( cellRef.x() + 1, cellRef.y() ) >= cell_southeast->effTopBorderValue( cellRef.x() + 1, cellRef.y() + 1 ) ) @@ -3959,23 +3959,23 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, ->effTopBorderPen( cellRef.x() + 1, cellRef.y() + 1 ); // horz_pen = effBottomBorderPen( cellRef.x() + 1, cellRef.y() ); - horz_penWidth = QMAX( 1, doc->zoomItX( horz_pen.width() ) ); - int bottom = ( QMAX( 0, -1 + horz_penWidth ) ) / 2; + horz_penWidth = TQMAX( 1, doc->zoomItX( horz_pen.width() ) ); + int bottom = ( TQMAX( 0, -1 + horz_penWidth ) ) / 2; painter.setPen( vert_pen ); // If we are on paper printout, we limit the length of the lines. // On paper, we always have full cells, on screen not. - if ( painter.device()->isExtDev() ) { + if ( painter.tqdevice()->isExtDev() ) { if ( sheetDir == Sheet::RightToLeft ) - painter.drawLine( QMAX( zrect_left, zcellRect_left ), - QMAX( zrect_top, zcellRect_bottom - bottom ), - QMIN( zrect_right, zcellRect_left ), - QMIN( zrect_bottom, zcellRect_bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_left ), + TQMAX( zrect_top, zcellRect_bottom - bottom ), + TQMIN( zrect_right, zcellRect_left ), + TQMIN( zrect_bottom, zcellRect_bottom ) ); else - painter.drawLine( QMAX( zrect_left, zcellRect_right ), - QMAX( zrect_top, zcellRect_bottom - bottom ), - QMIN( zrect_right, zcellRect_right ), - QMIN( zrect_bottom, zcellRect_bottom ) ); + painter.drawLine( TQMAX( zrect_left, zcellRect_right ), + TQMAX( zrect_top, zcellRect_bottom - bottom ), + TQMIN( zrect_right, zcellRect_right ), + TQMIN( zrect_bottom, zcellRect_bottom ) ); } else { if ( sheetDir == Sheet::RightToLeft ) @@ -3993,16 +3993,16 @@ void Cell::paintCellBorders( QPainter& painter, const KoRect& rect, // Paint diagonal lines through the cell. // -void Cell::paintCellDiagonalLines( QPainter& painter, +void Cell::paintCellDiagonalLines( TQPainter& painter, const KoRect &cellRect, - const QPoint &cellRef ) + const TQPoint &cellRef ) { if ( isPartOfMerged() ) return; Doc* doc = sheet()->doc(); - if ( effFallDiagonalPen( cellRef.x(), cellRef.y() ).style() != Qt::NoPen ) { + if ( effFallDiagonalPen( cellRef.x(), cellRef.y() ).style() != TQt::NoPen ) { painter.setPen( effFallDiagonalPen( cellRef.x(), cellRef.y() ) ); painter.drawLine( doc->zoomItX( cellRect.x() ), doc->zoomItY( cellRect.y() ), @@ -4010,7 +4010,7 @@ void Cell::paintCellDiagonalLines( QPainter& painter, doc->zoomItY( cellRect.bottom() ) ); } - if ( effGoUpDiagonalPen( cellRef.x(), cellRef.y() ).style() != Qt::NoPen ) { + if ( effGoUpDiagonalPen( cellRef.x(), cellRef.y() ).style() != TQt::NoPen ) { painter.setPen( effGoUpDiagonalPen( cellRef.x(), cellRef.y() ) ); painter.drawLine( doc->zoomItX( cellRect.x() ), doc->zoomItY( cellRect.bottom() ), @@ -4060,9 +4060,9 @@ int Cell::effAlignX() // Used in paintText(). // -QString Cell::textDisplaying( QPainter &_painter ) +TQString Cell::textDisplaying( TQPainter &_painter ) { - QFontMetrics fm = _painter.fontMetrics(); + TQFontMetrics fm = _painter.fontMetrics(); int a = format()->align( column(), row() ); bool isNumeric = value().isNumber(); @@ -4079,7 +4079,7 @@ QString Cell::textDisplaying( QPainter &_painter ) len += cl2->dblWidth() - 1.0; //-1.0 because the pixel in between 2 cells is shared between both cells } - QString tmp; + TQString tmp; double tmpIndent = 0.0; if ( !isEmpty() ) tmpIndent = format()->getIndent( column(), row() ); @@ -4105,8 +4105,8 @@ QString Cell::textDisplaying( QPainter &_painter ) //out of space to fit even the integer part of the number then display ######### //TODO Perhaps try to display integer part in standard form if there is not enough room for it? - if (!tmp.contains('.')) - d->strOutText=QString().fill('#',20); + if (!tmp.tqcontains('.')) + d->strOutText=TQString().fill('#',20); } // 4 equal length of red triangle +1 point. @@ -4115,7 +4115,7 @@ QString Cell::textDisplaying( QPainter &_painter ) { if ( format()->getAngle( column(), row() ) != 0 ) { - QString tmp2; + TQString tmp2; RowFormat *rl = format()->sheet()->rowFormat( row() ); if ( d->textHeight > rl->dblHeight() ) { @@ -4124,7 +4124,7 @@ QString Cell::textDisplaying( QPainter &_painter ) tmp2 = d->strOutText.left( j ); if ( format()->sheet()->doc()->unzoomItY( fm.width( tmp2 ) ) < rl->dblHeight() - 1.0 ) { - return d->strOutText.left( QMIN( tmp.length(), tmp2.length() ) ); + return d->strOutText.left( TQMIN( tmp.length(), tmp2.length() ) ); } } } @@ -4136,10 +4136,10 @@ QString Cell::textDisplaying( QPainter &_painter ) return tmp; } } - return QString( "" ); + return TQString( "" ); } else if ( format()->verticalText( column(), row() ) ) { - // Vertical text. + //Qt::Vertical text. RowFormat *rl = format()->sheet()->rowFormat( row() ); double tmpIndent = 0.0; @@ -4159,7 +4159,7 @@ QString Cell::textDisplaying( QPainter &_painter ) tmpIndent = format()->getIndent( column(), row() ); if ( ( d->textWidth + tmpIndent > len ) || d->textWidth == 0.0 ) - return QString( "" ); + return TQString( "" ); for ( int i = d->strOutText.length(); i != 0; i-- ) { if ( format()->sheet()->doc()->unzoomItY( fm.ascent() + fm.descent() ) * i @@ -4167,7 +4167,7 @@ QString Cell::textDisplaying( QPainter &_painter ) return d->strOutText.left( i ); } - return QString( "" ); + return TQString( "" ); } ColumnFormat *cl = format()->sheet()->columnFormat( column() ); @@ -4176,7 +4176,7 @@ QString Cell::textDisplaying( QPainter &_painter ) if ( d->hasExtra() && (d->extra()->extraWidth != 0.0) ) w = d->extra()->extraWidth; - QString tmp; + TQString tmp; for ( int i = d->strOutText.length(); i != 0; i-- ) { tmp = d->strOutText.left( i ); @@ -4185,7 +4185,7 @@ QString Cell::textDisplaying( QPainter &_painter ) return tmp; } - return QString::null; + return TQString(); } @@ -4248,7 +4248,7 @@ int Cell::height( int _row, const Canvas *_canvas ) const // /////////////////////////////////////////// -const QBrush& Cell::backGroundBrush( int _col, int _row ) const +const TQBrush& Cell::backGroundBrush( int _col, int _row ) const { if ( d->hasExtra() && (!d->extra()->obscuringCells.isEmpty()) ) { @@ -4259,7 +4259,7 @@ const QBrush& Cell::backGroundBrush( int _col, int _row ) const return format()->backGroundBrush( _col, _row ); } -const QColor& Cell::bgColor( int _col, int _row ) const +const TQColor& Cell::bgColor( int _col, int _row ) const { if ( d->hasExtra() && (!d->extra()->obscuringCells.isEmpty()) ) { @@ -4277,7 +4277,7 @@ const QColor& Cell::bgColor( int _col, int _row ) const // /////////////////////////////////////////// -void Cell::setLeftBorderPen( const QPen& p ) +void Cell::setLeftBorderPen( const TQPen& p ) { if ( column() == 1 ) { @@ -4290,7 +4290,7 @@ void Cell::setLeftBorderPen( const QPen& p ) format()->setLeftBorderPen( p ); } -void Cell::setTopBorderPen( const QPen& p ) +void Cell::setTopBorderPen( const TQPen& p ) { if ( row() == 1 ) { @@ -4302,7 +4302,7 @@ void Cell::setTopBorderPen( const QPen& p ) format()->setTopBorderPen( p ); } -void Cell::setRightBorderPen( const QPen& p ) +void Cell::setRightBorderPen( const TQPen& p ) { Cell* cell = 0L; if ( column() < KS_colMax ) @@ -4315,7 +4315,7 @@ void Cell::setRightBorderPen( const QPen& p ) format()->setRightBorderPen( p ); } -void Cell::setBottomBorderPen( const QPen& p ) +void Cell::setBottomBorderPen( const TQPen& p ) { Cell* cell = 0L; if ( row() < KS_rowMax ) @@ -4328,7 +4328,7 @@ void Cell::setBottomBorderPen( const QPen& p ) format()->setBottomBorderPen( p ); } -const QPen& Cell::rightBorderPen( int _col, int _row ) const +const TQPen& Cell::rightBorderPen( int _col, int _row ) const { if ( !format()->hasProperty( Format::PRightBorder ) && ( _col < KS_colMax ) ) { @@ -4340,7 +4340,7 @@ const QPen& Cell::rightBorderPen( int _col, int _row ) const return format()->rightBorderPen( _col, _row ); } -const QPen& Cell::leftBorderPen( int _col, int _row ) const +const TQPen& Cell::leftBorderPen( int _col, int _row ) const { if ( !format()->hasProperty( Format::PLeftBorder ) ) { @@ -4352,7 +4352,7 @@ const QPen& Cell::leftBorderPen( int _col, int _row ) const return format()->leftBorderPen( _col, _row ); } -const QPen& Cell::bottomBorderPen( int _col, int _row ) const +const TQPen& Cell::bottomBorderPen( int _col, int _row ) const { if ( !format()->hasProperty( Format::PBottomBorder ) && ( _row < KS_rowMax ) ) { @@ -4364,7 +4364,7 @@ const QPen& Cell::bottomBorderPen( int _col, int _row ) const return format()->bottomBorderPen( _col, _row ); } -const QPen& Cell::topBorderPen( int _col, int _row ) const +const TQPen& Cell::topBorderPen( int _col, int _row ) const { if ( !format()->hasProperty( Format::PTopBorder ) ) { @@ -4376,7 +4376,7 @@ const QPen& Cell::topBorderPen( int _col, int _row ) const return format()->topBorderPen( _col, _row ); } -const QColor & Cell::effTextColor( int col, int row ) const +const TQColor & Cell::effTextColor( int col, int row ) const { if ( d->hasExtra() && d->extra()->conditions && d->extra()->conditions->matchedStyle() @@ -4386,7 +4386,7 @@ const QColor & Cell::effTextColor( int col, int row ) const return format()->textColor( col, row ); } -const QPen& Cell::effLeftBorderPen( int col, int row ) const +const TQPen& Cell::effLeftBorderPen( int col, int row ) const { if ( isPartOfMerged() ) { @@ -4402,7 +4402,7 @@ const QPen& Cell::effLeftBorderPen( int col, int row ) const return leftBorderPen( col, row ); } -const QPen& Cell::effTopBorderPen( int col, int row ) const +const TQPen& Cell::effTopBorderPen( int col, int row ) const { if ( isPartOfMerged() ) { @@ -4418,7 +4418,7 @@ const QPen& Cell::effTopBorderPen( int col, int row ) const return topBorderPen( col, row ); } -const QPen& Cell::effRightBorderPen( int col, int row ) const +const TQPen& Cell::effRightBorderPen( int col, int row ) const { if ( isPartOfMerged() ) { @@ -4434,7 +4434,7 @@ const QPen& Cell::effRightBorderPen( int col, int row ) const return rightBorderPen( col, row ); } -const QPen& Cell::effBottomBorderPen( int col, int row ) const +const TQPen& Cell::effBottomBorderPen( int col, int row ) const { if ( isPartOfMerged() ) { @@ -4450,7 +4450,7 @@ const QPen& Cell::effBottomBorderPen( int col, int row ) const return bottomBorderPen( col, row ); } -const QPen & Cell::effGoUpDiagonalPen( int col, int row ) const +const TQPen & Cell::effGoUpDiagonalPen( int col, int row ) const { if ( d->hasExtra() && d->extra()->conditions && d->extra()->conditions->matchedStyle() @@ -4460,7 +4460,7 @@ const QPen & Cell::effGoUpDiagonalPen( int col, int row ) const return format()->goUpDiagonalPen( col, row ); } -const QPen & Cell::effFallDiagonalPen( int col, int row ) const +const TQPen & Cell::effFallDiagonalPen( int col, int row ) const { if ( d->hasExtra() && d->extra()->conditions && d->extra()->conditions->matchedStyle() @@ -4546,23 +4546,23 @@ void Cell::incPrecision() if ( tmpPreci == -1 ) { - int pos = d->strOutText.find(decimal_point); + int pos = d->strOutText.tqfind(decimal_point); if ( pos == -1 ) - pos = d->strOutText.find('.'); + pos = d->strOutText.tqfind('.'); if ( pos == -1 ) format()->setPrecision(1); else { int start = 0; - if ( d->strOutText.find('%') != -1 ) + if ( d->strOutText.tqfind('%') != -1 ) start = 2; - else if ( d->strOutText.find(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) ) + else if ( d->strOutText.tqfind(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) ) start = locale()->currencySymbol().length() + 1; - else if ( (start=d->strOutText.find('E')) != -1 ) + else if ( (start=d->strOutText.tqfind('E')) != -1 ) start = d->strOutText.length() - start; //kdDebug(36001) << "start=" << start << " pos=" << pos << " length=" << d->strOutText.length() << endl; - format()->setPrecision( QMAX( 0, (int)d->strOutText.length() - start - pos ) ); + format()->setPrecision( TQMAX( 0, (int)d->strOutText.length() - start - pos ) ); } } else if ( tmpPreci < 10 ) @@ -4582,13 +4582,13 @@ void Cell::decPrecision() // kdDebug(36001) << "decPrecision: tmpPreci = " << tmpPreci << endl; if ( format()->precision(column(),row()) == -1 ) { - int pos = d->strOutText.find( decimal_point ); + int pos = d->strOutText.tqfind( decimal_point ); int start = 0; - if ( d->strOutText.find('%') != -1 ) + if ( d->strOutText.tqfind('%') != -1 ) start = 2; - else if ( d->strOutText.find(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) ) + else if ( d->strOutText.tqfind(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) ) start = locale()->currencySymbol().length() + 1; - else if ( (start = d->strOutText.find('E')) != -1 ) + else if ( (start = d->strOutText.tqfind('E')) != -1 ) start = d->strOutText.length() - start; else start = 0; @@ -4618,9 +4618,9 @@ void Cell::setNumber( double number ) checkNumberFormat(); } -void Cell::setCellText( const QString& _text, bool asText ) +void Cell::setCellText( const TQString& _text, bool asText ) { - // QString ctext = _text; + // TQString ctext = _text; // (Tomas) is this trim necessary for anything ? // if( ctext.length() > 5000 ) @@ -4642,7 +4642,7 @@ void Cell::setCellText( const QString& _text, bool asText ) return; } - QString oldText = d->strText; + TQString oldText = d->strText; setDisplayText( _text ); if(!format()->sheet()->isLoading() && !testValidity() ) { @@ -4651,7 +4651,7 @@ void Cell::setCellText( const QString& _text, bool asText ) } } -void Cell::setDisplayText( const QString& _text ) +void Cell::setDisplayText( const TQString& _text ) { bool isLoading = format()->sheet()->isLoading(); @@ -4686,10 +4686,10 @@ void Cell::setDisplayText( const QString& _text ) } if ( !isLoading ) - format()->sheet()->doc()->emitEndOperation( QRect( d->column, d->row, 1, 1 ) ); + format()->sheet()->doc()->emitEndOperation( TQRect( d->column, d->row, 1, 1 ) ); } -void Cell::setLink( const QString& link ) +void Cell::setLink( const TQString& link ) { d->extra()->link = link; @@ -4697,14 +4697,14 @@ void Cell::setLink( const QString& link ) setCellText( link ); } -QString Cell::link() const +TQString Cell::link() const { - return d->hasExtra() ? d->extra()->link : QString::null; + return d->hasExtra() ? d->extra()->link : TQString(); } void Cell::update() { - /* those obscuring us need to redo their layout cause they can't obscure us + /* those obscuring us need to redo their tqlayout cause they can't obscure us now that we've got text. This includes cells obscuring cells that we are obscuring */ @@ -4780,7 +4780,7 @@ bool Cell::testValidity() const else if ( d->extra()->validity->m_restriction == Restriction::List ) { //test int value - if ( value().isString() && d->extra()->validity->listValidity.contains( value().asString() ) ) + if ( value().isString() && d->extra()->validity->listValidity.tqcontains( value().asString() ) ) valid = true; } else if(d->extra()->validity->m_restriction==Restriction::TextLength) @@ -4908,15 +4908,15 @@ bool Cell::testValidity() const switch (d->extra()->validity->m_action ) { case Action::Stop: - KMessageBox::error((QWidget*)0L, d->extra()->validity->message, + KMessageBox::error((TQWidget*)0L, d->extra()->validity->message, d->extra()->validity->title); break; case Action::Warning: - KMessageBox::warningYesNo((QWidget*)0L, d->extra()->validity->message, + KMessageBox::warningYesNo((TQWidget*)0L, d->extra()->validity->message, d->extra()->validity->title); break; case Action::Information: - KMessageBox::information((QWidget*)0L, d->extra()->validity->message, + KMessageBox::information((TQWidget*)0L, d->extra()->validity->message, d->extra()->validity->title); break; } @@ -5009,7 +5009,7 @@ bool Cell::updateChart(bool refresh) CellBinding *bind; for ( bind = format()->sheet()->firstCellBinding(); bind != 0L; bind = format()->sheet()->nextCellBinding() ) { - if ( bind->contains( d->column, d->row ) ) + if ( bind->tqcontains( d->column, d->row ) ) { if (!refresh) return true; @@ -5030,14 +5030,14 @@ double Cell::getDouble () //(Tomas) umm can't we simply call value().asFloat() ? if (isDate()) { - QDate date = value().asDate(); - QDate dummy (1900, 1, 1); + TQDate date = value().asDate(); + TQDate dummy (1900, 1, 1); return (dummy.daysTo (date) + 1); } if (isTime()) { - QTime time = value().asTime(); - QTime dummy; + TQTime time = value().asTime(); + TQTime dummy; return dummy.secsTo( time ); } if (value().isNumber()) @@ -5076,14 +5076,14 @@ void Cell::convertToMoney () void Cell::convertToTime () { //(Tomas) This is weird. And I mean *REALLY* weird. First, we - //generate a time (QTime), then we convert it to text, then + //generate a time (TQTime), then we convert it to text, then //we give the text to the cell and ask it to parse it. Weird... if (isDefault() || isEmpty()) return; setValue (getDouble ()); - QTime time = value().asDateTime().time(); + TQTime time = value().asDateTime().time(); int msec = (int) ( (value().asFloat() - (int) value().asFloat()) * 1000 ); time = time.addMSecs( msec ); setCellText( time.toString() ); @@ -5092,7 +5092,7 @@ void Cell::convertToTime () void Cell::convertToDate () { //(Tomas) This is weird. And I mean *REALLY* weird. First, we - //generate a date (QDate), then we convert it to text, then + //generate a date (TQDate), then we convert it to text, then //we give the text to the cell and ask it to parse it. Weird... if (isDefault() || isEmpty()) @@ -5101,7 +5101,7 @@ void Cell::convertToDate () setValue (getDouble ()); //TODO: why did we call setValue(), when we override it here? - QDate date(1900, 1, 1); + TQDate date(1900, 1, 1); date = date.addDays( (int) value().asFloat() - 1 ); date = value().asDateTime().date(); setCellText (locale()->formatDate (date, true)); @@ -5115,7 +5115,7 @@ void Cell::checkTextInput() d->value = Value::empty(); // Get the text from that cell - QString str = d->strText; + TQString str = d->strText; sheet()->doc()->parser()->parse (str, this); @@ -5128,7 +5128,7 @@ void Cell::checkTextInput() if (format()->sheet()->getFirstLetterUpper() && value().isString() && (!d->strText.isEmpty())) { - QString str = value().asString(); + TQString str = value().asString(); setValue( Value( str[0].upper() + str.right( str.length()-1 ) ) ); } } @@ -5148,18 +5148,18 @@ void Cell::checkNumberFormat() // Saving and loading -QDomElement Cell::save( QDomDocument& doc, +TQDomElement Cell::save( TQDomDocument& doc, int _x_offset, int _y_offset, bool force, bool copy, bool era ) { // Save the position of this cell - QDomElement cell = doc.createElement( "cell" ); + TQDomElement cell = doc.createElement( "cell" ); cell.setAttribute( "row", d->row - _y_offset ); cell.setAttribute( "column", d->column - _x_offset ); // // Save the formatting information // - QDomElement formatElement = format()->save( doc, d->column, d->row, force, copy ); + TQDomElement formatElement = format()->save( doc, d->column, d->row, force, copy ); if ( formatElement.hasChildNodes() || formatElement.attributes().length() ) // don't save empty tags cell.appendChild( formatElement ); @@ -5173,7 +5173,7 @@ QDomElement Cell::save( QDomDocument& doc, if ( d->hasExtra() && d->extra()->conditions ) { - QDomElement conditionElement = d->extra()->conditions->saveConditions( doc ); + TQDomElement conditionElement = d->extra()->conditions->saveConditions( doc ); if ( !conditionElement.isNull() ) cell.appendChild( conditionElement ); @@ -5181,9 +5181,9 @@ QDomElement Cell::save( QDomDocument& doc, if ( d->hasExtra() && (d->extra()->validity != 0) ) { - QDomElement validity = doc.createElement("validity"); + TQDomElement validity = doc.createElement("validity"); - QDomElement param=doc.createElement("param"); + TQDomElement param=doc.createElement("param"); param.setAttribute("cond",(int)d->extra()->validity->m_cond); param.setAttribute("action",(int)d->extra()->validity->m_action); param.setAttribute("allow",(int)d->extra()->validity->m_restriction); @@ -5195,34 +5195,34 @@ QDomElement Cell::save( QDomDocument& doc, if ( !d->extra()->validity->listValidity.isEmpty() ) param.setAttribute( "listvalidity", d->extra()->validity->listValidity.join( ";" ) ); validity.appendChild(param); - QDomElement title = doc.createElement( "title" ); + TQDomElement title = doc.createElement( "title" ); title.appendChild( doc.createTextNode( d->extra()->validity->title ) ); validity.appendChild( title ); - QDomElement message = doc.createElement( "message" ); + TQDomElement message = doc.createElement( "message" ); message.appendChild( doc.createCDATASection( d->extra()->validity->message ) ); validity.appendChild( message ); - QDomElement inputTitle = doc.createElement( "inputtitle" ); + TQDomElement inputTitle = doc.createElement( "inputtitle" ); inputTitle.appendChild( doc.createTextNode( d->extra()->validity->titleInfo ) ); validity.appendChild( inputTitle ); - QDomElement inputMessage = doc.createElement( "inputmessage" ); + TQDomElement inputMessage = doc.createElement( "inputmessage" ); inputMessage.appendChild( doc.createTextNode( d->extra()->validity->messageInfo ) ); validity.appendChild( inputMessage ); - QString tmp; + TQString tmp; if ( d->extra()->validity->timeMin.isValid() ) { - QDomElement timeMin = doc.createElement( "timemin" ); + TQDomElement timeMin = doc.createElement( "timemin" ); tmp=d->extra()->validity->timeMin.toString(); timeMin.appendChild( doc.createTextNode( tmp ) ); validity.appendChild( timeMin ); } if ( d->extra()->validity->timeMax.isValid() ) { - QDomElement timeMax = doc.createElement( "timemax" ); + TQDomElement timeMax = doc.createElement( "timemax" ); tmp=d->extra()->validity->timeMax.toString(); timeMax.appendChild( doc.createTextNode( tmp ) ); validity.appendChild( timeMax ); @@ -5230,17 +5230,17 @@ QDomElement Cell::save( QDomDocument& doc, if ( d->extra()->validity->dateMin.isValid() ) { - QDomElement dateMin = doc.createElement( "datemin" ); - QString tmp("%1/%2/%3"); - tmp = tmp.arg(d->extra()->validity->dateMin.year()).arg(d->extra()->validity->dateMin.month()).arg(d->extra()->validity->dateMin.day()); + TQDomElement dateMin = doc.createElement( "datemin" ); + TQString tmp("%1/%2/%3"); + tmp = tmp.tqarg(d->extra()->validity->dateMin.year()).tqarg(d->extra()->validity->dateMin.month()).tqarg(d->extra()->validity->dateMin.day()); dateMin.appendChild( doc.createTextNode( tmp ) ); validity.appendChild( dateMin ); } if ( d->extra()->validity->dateMax.isValid() ) { - QDomElement dateMax = doc.createElement( "datemax" ); - QString tmp("%1/%2/%3"); - tmp = tmp.arg(d->extra()->validity->dateMax.year()).arg(d->extra()->validity->dateMax.month()).arg(d->extra()->validity->dateMax.day()); + TQDomElement dateMax = doc.createElement( "datemax" ); + TQString tmp("%1/%2/%3"); + tmp = tmp.tqarg(d->extra()->validity->dateMax.year()).tqarg(d->extra()->validity->dateMax.month()).tqarg(d->extra()->validity->dateMax.day()); dateMax.appendChild( doc.createTextNode( tmp ) ); validity.appendChild( dateMax ); } @@ -5250,7 +5250,7 @@ QDomElement Cell::save( QDomDocument& doc, if ( format()->comment() ) { - QDomElement comment = doc.createElement( "comment" ); + TQDomElement comment = doc.createElement( "comment" ); comment.appendChild( doc.createCDATASection( *format()->comment() ) ); cell.appendChild( comment ); } @@ -5264,13 +5264,13 @@ QDomElement Cell::save( QDomDocument& doc, // are position independent. if ( isFormula() ) { - QDomElement text = doc.createElement( "text" ); + TQDomElement text = doc.createElement( "text" ); // if we are cutting to the clipboard, relative references need to be encoded absolutely text.appendChild( doc.createTextNode( encodeFormula( era ) ) ); cell.appendChild( text ); /* we still want to save the results of the formula */ - QDomElement formulaResult = doc.createElement( "result" ); + TQDomElement formulaResult = doc.createElement( "result" ); saveCellResult( doc, formulaResult, d->strOutText ); cell.appendChild( formulaResult ); @@ -5279,15 +5279,15 @@ QDomElement Cell::save( QDomDocument& doc, { // KSpread pre 1.4 saves link as rich text, marked with first char ' // Have to be saved in some CDATA section because of too many special charatcers. - QDomElement text = doc.createElement( "text" ); - QString qml = "!<a href=\"" + link() + "\">" + d->strText + "</a>"; + TQDomElement text = doc.createElement( "text" ); + TQString qml = "!<a href=\"" + link() + "\">" + d->strText + "</a>"; text.appendChild( doc.createCDATASection( qml ) ); cell.appendChild( text ); } else { // Save the cell contents (in a locale-independent way) - QDomElement text = doc.createElement( "text" ); + TQDomElement text = doc.createElement( "text" ); saveCellResult( doc, text, d->strText ); cell.appendChild( text ); } @@ -5296,23 +5296,23 @@ QDomElement Cell::save( QDomDocument& doc, // (the >2 is due to "row" and "column" attributes) return cell; else - return QDomElement(); + return TQDomElement(); } -bool Cell::saveCellResult( QDomDocument& doc, QDomElement& result, - QString str ) +bool Cell::saveCellResult( TQDomDocument& doc, TQDomElement& result, + TQString str ) { - QString dataType = "Other"; // fallback + TQString dataType = "Other"; // fallback if ( value().isNumber() ) { if ( isDate() ) { // serial number of date - QDate dd = value().asDateTime().date(); + TQDate dd = value().asDateTime().date(); dataType = "Date"; str = "%1/%2/%3"; - str = str.arg(dd.year()).arg(dd.month()).arg(dd.day()); + str = str.tqarg(dd.year()).tqarg(dd.month()).tqarg(dd.day()); } else if( isTime() ) { @@ -5325,9 +5325,9 @@ bool Cell::saveCellResult( QDomDocument& doc, QDomElement& result, // real number dataType = "Num"; if (value().isInteger()) - str = QString::number(value().asInteger()); + str = TQString::number(value().asInteger()); else - str = QString::number(value().asFloat(), 'g', DBL_DIG); + str = TQString::number(value().asFloat(), 'g', DBL_DIG); } } @@ -5357,8 +5357,8 @@ void Cell::saveOasisAnnotation( KoXmlWriter &xmlwriter ) { //<office:annotation draw:style-name="gr1" draw:text-style-name="P1" svg:width="2.899cm" svg:height="2.691cm" svg:x="2.858cm" svg:y="0.001cm" draw:caption-point-x="-2.858cm" draw:caption-point-y="-0.001cm"> xmlwriter.startElement( "office:annotation" ); - QStringList text = QStringList::split( "\n", *format()->comment() ); - for ( QStringList::Iterator it = text.begin(); it != text.end(); ++it ) { + TQStringList text = TQStringList::split( "\n", *format()->comment() ); + for ( TQStringList::Iterator it = text.begin(); it != text.end(); ++it ) { xmlwriter.startElement( "text:p" ); xmlwriter.addTextNode( *it ); xmlwriter.endElement(); @@ -5369,7 +5369,7 @@ void Cell::saveOasisAnnotation( KoXmlWriter &xmlwriter ) -QString Cell::saveOasisCellStyle( KoGenStyle ¤tCellStyle, KoGenStyles &mainStyles ) +TQString Cell::saveOasisCellStyle( KoGenStyle ¤tCellStyle, KoGenStyles &mainStyles ) { if ( d->hasExtra() && d->extra()->conditions ) { @@ -5391,7 +5391,7 @@ bool Cell::saveOasis( KoXmlWriter& xmlwriter, KoGenStyles &mainStyles, xmlwriter.startElement( "table:covered-table-cell" ); #if 0 //add font style - QFont font; + TQFont font; Value const value( cell->value() ); if ( !cell->isDefault() ) { @@ -5456,7 +5456,7 @@ bool Cell::saveOasis( KoXmlWriter& xmlwriter, KoGenStyles &mainStyles, << "repeated " << repeated << " time(s)" << endl; if ( repeated > 1 ) - xmlwriter.addAttribute( "table:number-columns-repeated", QString::number( repeated ) ); + xmlwriter.addAttribute( "table:number-columns-repeated", TQString::number( repeated ) ); } @@ -5468,7 +5468,7 @@ bool Cell::saveOasis( KoXmlWriter& xmlwriter, KoGenStyles &mainStyles, if ( isFormula() ) { //kdDebug() << "Formula found" << endl; - QString formula( convertFormulaToOasisFormat( text() ) ); + TQString formula( convertFormulaToOasisFormat( text() ) ); xmlwriter.addAttribute( "table:formula", formula ); } else if ( !link().isEmpty() ) @@ -5492,10 +5492,10 @@ bool Cell::saveOasis( KoXmlWriter& xmlwriter, KoGenStyles &mainStyles, int rowSpan = mergedYCells() + 1; if ( colSpan > 1 ) - xmlwriter.addAttribute( "table:number-columns-spanned", QString::number( colSpan ) ); + xmlwriter.addAttribute( "table:number-columns-spanned", TQString::number( colSpan ) ); if ( rowSpan > 1 ) - xmlwriter.addAttribute( "table:number-rows-spanned", QString::number( rowSpan ) ); + xmlwriter.addAttribute( "table:number-rows-spanned", TQString::number( rowSpan ) ); } if ( !isEmpty() && link().isEmpty() ) @@ -5527,16 +5527,16 @@ void Cell::saveOasisValue (KoXmlWriter &xmlWriter) { xmlWriter.addAttribute( "office:value-type", "float" ); if (value().isInteger()) - xmlWriter.addAttribute( "office:value", QString::number( value().asInteger() ) ); + xmlWriter.addAttribute( "office:value", TQString::number( value().asInteger() ) ); else - xmlWriter.addAttribute( "office:value", QString::number( value().asFloat(), 'g', DBL_DIG ) ); + xmlWriter.addAttribute( "office:value", TQString::number( value().asFloat(), 'g', DBL_DIG ) ); break; } case Value::fmt_Percent: { xmlWriter.addAttribute( "office:value-type", "percentage" ); xmlWriter.addAttribute( "office:value", - QString::number( value().asFloat() ) ); + TQString::number( value().asFloat() ) ); break; } case Value::fmt_Money: @@ -5546,7 +5546,7 @@ void Cell::saveOasisValue (KoXmlWriter &xmlWriter) if (format()->currencyInfo(currency)) xmlWriter.addAttribute( "office:currency", Currency::getCurrencyCode(currency.type) ); xmlWriter.addAttribute( "office:value", - QString::number( value().asFloat() ) ); + TQString::number( value().asFloat() ) ); break; } case Value::fmt_DateTime: break; //NOTHING HERE @@ -5573,10 +5573,10 @@ void Cell::saveOasisValue (KoXmlWriter &xmlWriter) }; } -QString Cell::convertFormulaToOasisFormat( const QString & formula ) const +TQString Cell::convertFormulaToOasisFormat( const TQString & formula ) const { - QString s; - QRegExp exp("(\\$?)([a-zA-Z]+)(\\$?)([0-9]+)"); + TQString s; + TQRegExp exp("(\\$?)([a-zA-Z]+)(\\$?)([0-9]+)"); int n = exp.search( formula, 0 ); kdDebug() << "Exp: " << formula << ", n: " << n << ", Length: " << formula.length() << ", Matched length: " << exp.matchedLength() << endl; @@ -5661,11 +5661,11 @@ QString Cell::convertFormulaToOasisFormat( const QString & formula ) const return s; } -void Cell::loadOasisConditional( QDomElement * style ) +void Cell::loadOasisConditional( TQDomElement * style ) { if ( style )//safe { - QDomElement e; + TQDomElement e; forEachElement( e, style->toElement() ) { if ( e.localName() == "map" && e.namespaceURI() == KoXmlNS::style ) @@ -5683,20 +5683,20 @@ void Cell::loadOasisConditional( QDomElement * style ) } } -bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisContext , Style* style ) +bool Cell::loadOasis( const TQDomElement& element , KoOasisLoadingContext& oasisContext , Style* style ) { kdDebug() << "*** Loading cell properties ***** at " << column() << "," << row () << endl; if ( element.hasAttributeNS( KoXmlNS::table, "style-name" ) ) { - kdDebug()<<" table:style-name: "<<element.attributeNS( KoXmlNS::table, "style-name", QString::null )<<endl; + kdDebug()<<" table:style-name: "<<element.attributeNS( KoXmlNS::table, "style-name", TQString() )<<endl; oasisContext.fillStyleStack( element, KoXmlNS::table, "styleName", "table-cell" ); - QString str = element.attributeNS( KoXmlNS::table, "style-name", QString::null ); - const QDomElement* cellStyle = oasisContext.oasisStyles().findStyle( str, "table-cell" ); + TQString str = element.attributeNS( KoXmlNS::table, "style-name", TQString() ); + const TQDomElement* cellStyle = oasisContext.oasisStyles().findStyle( str, "table-cell" ); if ( cellStyle ) - loadOasisConditional( const_cast<QDomElement *>( cellStyle ) ); + loadOasisConditional( const_cast<TQDomElement *>( cellStyle ) ); } if (style) @@ -5713,9 +5713,9 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC bool isFormula = false; if ( element.hasAttributeNS( KoXmlNS::table, "formula" ) ) { - kdDebug()<<" formula :"<<element.attributeNS( KoXmlNS::table, "formula", QString::null )<<endl; + kdDebug()<<" formula :"<<element.attributeNS( KoXmlNS::table, "formula", TQString() )<<endl; isFormula = true; - QString oasisFormula( element.attributeNS( KoXmlNS::table, "formula", QString::null ) ); + TQString oasisFormula( element.attributeNS( KoXmlNS::table, "formula", TQString() ) ); //necessary to remove it to load formula from oocalc2.0 (use namespace) if (oasisFormula.startsWith( "oooc:" ) ) oasisFormula= oasisFormula.mid( 5 ); @@ -5734,8 +5734,8 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC // if ( element.hasAttributeNS( KoXmlNS::table, "validation-name" ) ) { - kdDebug()<<" validation-name: "<<element.attributeNS( KoXmlNS::table, "validation-name", QString::null )<<endl; - loadOasisValidation( element.attributeNS( KoXmlNS::table, "validation-name", QString::null ) ); + kdDebug()<<" validation-name: "<<element.attributeNS( KoXmlNS::table, "validation-name", TQString() )<<endl; + loadOasisValidation( element.attributeNS( KoXmlNS::table, "validation-name", TQString() ) ); } // @@ -5743,11 +5743,11 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC // if( element.hasAttributeNS( KoXmlNS::office, "value-type" ) ) { - QString valuetype = element.attributeNS( KoXmlNS::office, "value-type", QString::null ); + TQString valuetype = element.attributeNS( KoXmlNS::office, "value-type", TQString() ); kdDebug()<<" value-type: " << valuetype << endl; if( valuetype == "boolean" ) { - QString val = element.attributeNS( KoXmlNS::office, "boolean-value", QString::null ).lower(); + TQString val = element.attributeNS( KoXmlNS::office, "boolean-value", TQString() ).lower(); if( ( val == "true" ) || ( val == "false" ) ) { bool value = val == "true"; @@ -5759,13 +5759,13 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC else if( valuetype == "float" ) { bool ok = false; - double value = element.attributeNS( KoXmlNS::office, "value", QString::null ).toDouble( &ok ); + double value = element.attributeNS( KoXmlNS::office, "value", TQString() ).toDouble( &ok ); if( ok ) setCellValue( value ); if ( !isFormula && d->strText.isEmpty()) { - QString str = locale()->formatNumber( value, 15 ); + TQString str = locale()->formatNumber( value, 15 ); setCellText( str ); } } @@ -5774,14 +5774,14 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC else if( valuetype == "currency" ) { bool ok = false; - double value = element.attributeNS( KoXmlNS::office, "value", QString::null ).toDouble( &ok ); + double value = element.attributeNS( KoXmlNS::office, "value", TQString() ).toDouble( &ok ); if( ok ) { setCellValue( value, Money_format ); if (element.hasAttributeNS( KoXmlNS::office, "currency" ) ) { - Currency currency(element.attributeNS( KoXmlNS::office, "currency", QString::null ) ); + Currency currency(element.attributeNS( KoXmlNS::office, "currency", TQString() ) ); format()->setCurrency( currency.getIndex(), currency.getDisplayCode() ); } } @@ -5789,7 +5789,7 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC else if( valuetype == "percentage" ) { bool ok = false; - double v = element.attributeNS( KoXmlNS::office, "value", QString::null ).toDouble( &ok ); + double v = element.attributeNS( KoXmlNS::office, "value", TQString() ).toDouble( &ok ); if( ok ) { Value value; @@ -5799,7 +5799,7 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC if ( !isFormula && d->strText.isEmpty()) { - QString str = locale()->formatNumber( v, 15 ); + TQString str = locale()->formatNumber( v, 15 ); setCellText( str ); } @@ -5808,22 +5808,22 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC } else if ( valuetype == "date" ) { - QString value = element.attributeNS( KoXmlNS::office, "value", QString::null ); + TQString value = element.attributeNS( KoXmlNS::office, "value", TQString() ); if ( value.isEmpty() ) - value = element.attributeNS( KoXmlNS::office, "date-value", QString::null ); + value = element.attributeNS( KoXmlNS::office, "date-value", TQString() ); kdDebug() << "Type: date, value: " << value << endl; // "1980-10-15" int year = 0, month = 0, day = 0; bool ok = false; - int p1 = value.find( '-' ); + int p1 = value.tqfind( '-' ); if ( p1 > 0 ) year = value.left( p1 ).toInt( &ok ); kdDebug() << "year: " << value.left( p1 ) << endl; - int p2 = value.find( '-', ++p1 ); + int p2 = value.tqfind( '-', ++p1 ); if ( ok ) month = value.mid( p1, p2 - p1 ).toInt( &ok ); @@ -5837,23 +5837,23 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC if ( ok ) { - setCellValue( QDate( year, month, day ) ); + setCellValue( TQDate( year, month, day ) ); if ( style ) format()->setFormatType (style->formatType()); - kdDebug() << "Set QDate: " << year << " - " << month << " - " << day << endl; + kdDebug() << "Set TQDate: " << year << " - " << month << " - " << day << endl; } } else if ( valuetype == "time" ) { - QString value = element.attributeNS( KoXmlNS::office, "value", QString::null ); + TQString value = element.attributeNS( KoXmlNS::office, "value", TQString() ); if ( value.isEmpty() ) - value = element.attributeNS( KoXmlNS::office, "time-value", QString::null ); + value = element.attributeNS( KoXmlNS::office, "time-value", TQString() ); kdDebug() << "Type: time: " << value << endl; // "PT15H10M12S" int hours = 0, minutes = 0, seconds = 0; int l = value.length(); - QString num; + TQString num; bool ok = false; for ( int i = 0; i < l; ++i ) { @@ -5883,18 +5883,18 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC { // Value kval( timeToNum( hours, minutes, seconds ) ); // cell->setValue( kval ); - setCellValue( QTime( hours % 24, minutes, seconds ) ); + setCellValue( TQTime( hours % 24, minutes, seconds ) ); if ( style ) format()->setFormatType (style->formatType()); } } else if( valuetype == "string" ) { - QString value = element.attributeNS( KoXmlNS::office, "value", QString::null ); + TQString value = element.attributeNS( KoXmlNS::office, "value", TQString() ); if ( value.isEmpty() && element.hasAttributeNS( KoXmlNS::office, "string-value" )) { //if there is not string-value entry don't overwrite value stored into <text:p> - value = element.attributeNS( KoXmlNS::office, "string-value", QString::null ); + value = element.attributeNS( KoXmlNS::office, "string-value", TQString() ); setCellValue( value ); } format()->setFormatType (Text_format); @@ -5911,13 +5911,13 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC if ( element.hasAttributeNS( KoXmlNS::table, "number-columns-spanned" ) ) { bool ok = false; - int span = element.attributeNS( KoXmlNS::table, "number-columns-spanned", QString::null ).toInt( &ok ); + int span = element.attributeNS( KoXmlNS::table, "number-columns-spanned", TQString() ).toInt( &ok ); if( ok ) colSpan = span; } if ( element.hasAttributeNS( KoXmlNS::table, "number-rows-spanned" ) ) { bool ok = false; - int span = element.attributeNS( KoXmlNS::table, "number-rows-spanned", QString::null ).toInt( &ok ); + int span = element.attributeNS( KoXmlNS::table, "number-rows-spanned", TQString() ).toInt( &ok ); if( ok ) rowSpan = span; } if ( colSpan > 1 || rowSpan > 1 ) @@ -5926,14 +5926,14 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC // // cell comment/annotation // - QDomElement annotationElement = KoDom::namedItemNS( element, KoXmlNS::office, "annotation" ); + TQDomElement annotationElement = KoDom::namedItemNS( element, KoXmlNS::office, "annotation" ); if ( !annotationElement.isNull() ) { - QString comment; - QDomNode node = annotationElement.firstChild(); + TQString comment; + TQDomNode node = annotationElement.firstChild(); while( !node.isNull() ) { - QDomElement commentElement = node.toElement(); + TQDomElement commentElement = node.toElement(); if( !commentElement.isNull() ) if( commentElement.localName() == "p" && commentElement.namespaceURI() == KoXmlNS::text ) { @@ -5948,7 +5948,7 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC format()->setComment( comment ); } - QDomElement frame = KoDom::namedItemNS( element, KoXmlNS::draw, "frame" ); + TQDomElement frame = KoDom::namedItemNS( element, KoXmlNS::draw, "frame" ); if ( !frame.isNull() ) loadOasisObjects( frame, oasisContext ); @@ -5958,15 +5958,15 @@ bool Cell::loadOasis( const QDomElement& element , KoOasisLoadingContext& oasisC return true; } -void Cell::loadOasisCellText( const QDomElement& parent ) +void Cell::loadOasisCellText( const TQDomElement& tqparent ) { //Search and load each paragraph of text. Each paragraph is separated by a line break - QDomElement textParagraphElement; - QString cellText; + TQDomElement textParagraphElement; + TQString cellText; bool multipleTextParagraphsFound=false; - forEachElement( textParagraphElement , parent ) + forEachElement( textParagraphElement , tqparent ) { if ( textParagraphElement.localName()=="p" && textParagraphElement.namespaceURI()== KoXmlNS::text ) @@ -5980,12 +5980,12 @@ void Cell::loadOasisCellText( const QDomElement& parent ) multipleTextParagraphsFound=true; } - QDomElement textA = KoDom::namedItemNS( textParagraphElement, KoXmlNS::text, "a" ); + TQDomElement textA = KoDom::namedItemNS( textParagraphElement, KoXmlNS::text, "a" ); if( !textA.isNull() ) { if ( textA.hasAttributeNS( KoXmlNS::xlink, "href" ) ) { - QString link = textA.attributeNS( KoXmlNS::xlink, "href", QString::null ); + TQString link = textA.attributeNS( KoXmlNS::xlink, "href", TQString() ); cellText = textA.text(); setCellText( cellText ); setValue( cellText ); @@ -6010,24 +6010,24 @@ void Cell::loadOasisCellText( const QDomElement& parent ) } } -void Cell::loadOasisObjects( const QDomElement &parent, KoOasisLoadingContext& oasisContext ) +void Cell::loadOasisObjects( const TQDomElement &tqparent, KoOasisLoadingContext& oasisContext ) { - for( QDomElement e = parent; !e.isNull(); e = e.nextSibling().toElement() ) + for( TQDomElement e = tqparent; !e.isNull(); e = e.nextSibling().toElement() ) { if ( e.localName() == "frame" && e.namespaceURI() == KoXmlNS::draw ) { EmbeddedObject *obj = 0; - QDomNode object = KoDom::namedItemNS( e, KoXmlNS::draw, "object" ); + TQDomNode object = KoDom::namedItemNS( e, KoXmlNS::draw, "object" ); if ( !object.isNull() ) { - if ( !object.toElement().attributeNS( KoXmlNS::draw, "notify-on-update-of-ranges", QString::null).isNull() ) + if ( !object.toElement().attributeNS( KoXmlNS::draw, "notify-on-update-of-ranges", TQString()).isNull() ) obj = new EmbeddedChart( sheet()->doc(), sheet() ); else obj = new EmbeddedKOfficeObject( sheet()->doc(), sheet() ); } else { - QDomNode image = KoDom::namedItemNS( e, KoXmlNS::draw, "image" ); + TQDomNode image = KoDom::namedItemNS( e, KoXmlNS::draw, "image" ); if ( !image.isNull() ) obj = new EmbeddedPictureObject( sheet(), sheet()->doc()->pictureCollection() ); else @@ -6039,7 +6039,7 @@ void Cell::loadOasisObjects( const QDomElement &parent, KoOasisLoadingContext& o obj->loadOasis( e, oasisContext ); sheet()->doc()->insertObject( obj ); - QString ref = e.attributeNS( KoXmlNS::table, "end-cell-address", QString::null ); + TQString ref = e.attributeNS( KoXmlNS::table, "end-cell-address", TQString() ); if ( ref.isNull() ) continue; @@ -6048,39 +6048,39 @@ void Cell::loadOasisObjects( const QDomElement &parent, KoOasisLoadingContext& o if ( !point.isValid() ) continue; - KoRect geometry = obj->geometry(); - geometry.setLeft( geometry.left() + sheet()->columnPos( d->column, 0 ) ); - geometry.setTop( geometry.top() + sheet()->rowPos( d->row, 0 ) ); + KoRect tqgeometry = obj->tqgeometry(); + tqgeometry.setLeft( tqgeometry.left() + sheet()->columnPos( d->column, 0 ) ); + tqgeometry.setTop( tqgeometry.top() + sheet()->rowPos( d->row, 0 ) ); - QString str = e.attributeNS( KoXmlNS::table, "end-x", QString::null ); + TQString str = e.attributeNS( KoXmlNS::table, "end-x", TQString() ); if ( !str.isNull() ) { uint end_x = (uint) KoUnit::parseValue( str ); - geometry.setRight( sheet()->columnPos( point.column(), 0) + end_x ); + tqgeometry.setRight( sheet()->columnPos( point.column(), 0) + end_x ); } - str = e.attributeNS( KoXmlNS::table, "end-y", QString::null ); + str = e.attributeNS( KoXmlNS::table, "end-y", TQString() ); if ( !str.isNull() ) { uint end_y = (uint) KoUnit::parseValue( str ); - geometry.setBottom( sheet()->rowPos( point.row(), 0) + end_y ); + tqgeometry.setBottom( sheet()->rowPos( point.row(), 0) + end_y ); } - obj->setGeometry( geometry ); + obj->setGeometry( tqgeometry ); } } } } -void Cell::loadOasisValidation( const QString& validationName ) +void Cell::loadOasisValidation( const TQString& validationName ) { - QDomElement element = sheet()->doc()->loadingInfo()->validation( validationName); + TQDomElement element = sheet()->doc()->loadingInfo()->validation( validationName); if (d->hasExtra()) delete d->extra()->validity; d->extra()->validity = new Validity; if ( element.hasAttributeNS( KoXmlNS::table, "condition" ) ) { - QString valExpression = element.attributeNS( KoXmlNS::table, "condition", QString::null ); + TQString valExpression = element.attributeNS( KoXmlNS::table, "condition", TQString() ); kdDebug()<<" element.attribute( table:condition ) "<<valExpression<<endl; //Condition ::= ExtendedTrueCondition | TrueFunction 'and' TrueCondition //TrueFunction ::= cell-content-is-whole-number() | cell-content-is-decimal-number() | cell-content-is-date() | cell-content-is-time() @@ -6095,7 +6095,7 @@ void Cell::loadOasisValidation( const QString& validationName ) //A NumberValue is a whole or decimal number. It must not contain comma separators for numbers of 1000 or greater. //ExtendedTrueCondition - if ( valExpression.contains( "cell-content-text-length()" ) ) + if ( valExpression.tqcontains( "cell-content-text-length()" ) ) { //"cell-content-text-length()>45" valExpression = valExpression.remove("oooc:cell-content-text-length()" ); @@ -6104,22 +6104,22 @@ void Cell::loadOasisValidation( const QString& validationName ) loadOasisValidationCondition( valExpression ); } - else if ( valExpression.contains( "cell-content-is-text()" ) ) + else if ( valExpression.tqcontains( "cell-content-is-text()" ) ) { d->extra()->validity->m_restriction = Restriction::Text; } //cell-content-text-length-is-between(Value, Value) | cell-content-text-length-is-not-between(Value, Value) | cell-content-is-in-list( StringList ) - else if ( valExpression.contains( "cell-content-text-length-is-between" ) ) + else if ( valExpression.tqcontains( "cell-content-text-length-is-between" ) ) { d->extra()->validity->m_restriction = Restriction::TextLength; d->extra()->validity->m_cond = Conditional::Between; valExpression = valExpression.remove( "oooc:cell-content-text-length-is-between(" ); kdDebug()<<" valExpression :"<<valExpression<<endl; valExpression = valExpression.remove( ")" ); - QStringList listVal = QStringList::split( ",", valExpression ); + TQStringList listVal = TQStringList::split( ",", valExpression ); loadOasisValidationValue( listVal ); } - else if ( valExpression.contains( "cell-content-text-length-is-not-between" ) ) + else if ( valExpression.tqcontains( "cell-content-text-length-is-not-between" ) ) { d->extra()->validity->m_restriction = Restriction::TextLength; d->extra()->validity->m_cond = Conditional::Different; @@ -6127,63 +6127,63 @@ void Cell::loadOasisValidation( const QString& validationName ) kdDebug()<<" valExpression :"<<valExpression<<endl; valExpression = valExpression.remove( ")" ); kdDebug()<<" valExpression :"<<valExpression<<endl; - QStringList listVal = QStringList::split( ",", valExpression ); + TQStringList listVal = TQStringList::split( ",", valExpression ); loadOasisValidationValue( listVal ); } - else if ( valExpression.contains( "cell-content-is-in-list(" ) ) + else if ( valExpression.tqcontains( "cell-content-is-in-list(" ) ) { d->extra()->validity->m_restriction = Restriction::List; valExpression = valExpression.remove( "oooc:cell-content-is-in-list(" ); kdDebug()<<" valExpression :"<<valExpression<<endl; valExpression = valExpression.remove( ")" ); - d->extra()->validity->listValidity = QStringList::split( ";", valExpression ); + d->extra()->validity->listValidity = TQStringList::split( ";", valExpression ); } //TrueFunction ::= cell-content-is-whole-number() | cell-content-is-decimal-number() | cell-content-is-date() | cell-content-is-time() else { - if (valExpression.contains( "cell-content-is-whole-number()" ) ) + if (valExpression.tqcontains( "cell-content-is-whole-number()" ) ) { d->extra()->validity->m_restriction = Restriction::Number; valExpression = valExpression.remove( "oooc:cell-content-is-whole-number() and " ); } - else if (valExpression.contains( "cell-content-is-decimal-number()" ) ) + else if (valExpression.tqcontains( "cell-content-is-decimal-number()" ) ) { d->extra()->validity->m_restriction = Restriction::Integer; valExpression = valExpression.remove( "oooc:cell-content-is-decimal-number() and " ); } - else if (valExpression.contains( "cell-content-is-date()" ) ) + else if (valExpression.tqcontains( "cell-content-is-date()" ) ) { d->extra()->validity->m_restriction = Restriction::Date; valExpression = valExpression.remove( "oooc:cell-content-is-date() and " ); } - else if (valExpression.contains( "cell-content-is-time()" ) ) + else if (valExpression.tqcontains( "cell-content-is-time()" ) ) { d->extra()->validity->m_restriction = Restriction::Time; valExpression = valExpression.remove( "oooc:cell-content-is-time() and " ); } kdDebug()<<"valExpression :"<<valExpression<<endl; - if ( valExpression.contains( "cell-content()" ) ) + if ( valExpression.tqcontains( "cell-content()" ) ) { valExpression = valExpression.remove( "cell-content()" ); loadOasisValidationCondition( valExpression ); } //GetFunction ::= cell-content-is-between(Value, Value) | cell-content-is-not-between(Value, Value) //for the moment we support just int/double value, not text/date/time :( - if ( valExpression.contains( "cell-content-is-between(" ) ) + if ( valExpression.tqcontains( "cell-content-is-between(" ) ) { valExpression = valExpression.remove( "cell-content-is-between(" ); valExpression = valExpression.remove( ")" ); - QStringList listVal = QStringList::split( "," , valExpression ); + TQStringList listVal = TQStringList::split( "," , valExpression ); loadOasisValidationValue( listVal ); d->extra()->validity->m_cond = Conditional::Between; } - if ( valExpression.contains( "cell-content-is-not-between(" ) ) + if ( valExpression.tqcontains( "cell-content-is-not-between(" ) ) { valExpression = valExpression.remove( "cell-content-is-not-between(" ); valExpression = valExpression.remove( ")" ); - QStringList listVal = QStringList::split( ",", valExpression ); + TQStringList listVal = TQStringList::split( ",", valExpression ); loadOasisValidationValue( listVal ); d->extra()->validity->m_cond = Conditional::Different; } @@ -6192,27 +6192,27 @@ void Cell::loadOasisValidation( const QString& validationName ) if ( element.hasAttributeNS( KoXmlNS::table, "allow-empty-cell" ) ) { kdDebug()<<" element.hasAttribute( table:allow-empty-cell ) :"<<element.hasAttributeNS( KoXmlNS::table, "allow-empty-cell" )<<endl; - d->extra()->validity->allowEmptyCell = ( ( element.attributeNS( KoXmlNS::table, "allow-empty-cell", QString::null )=="true" ) ? true : false ); + d->extra()->validity->allowEmptyCell = ( ( element.attributeNS( KoXmlNS::table, "allow-empty-cell", TQString() )=="true" ) ? true : false ); } if ( element.hasAttributeNS( KoXmlNS::table, "base-cell-address" ) ) { //todo what is it ? } - QDomElement help = KoDom::namedItemNS( element, KoXmlNS::table, "help-message" ); + TQDomElement help = KoDom::namedItemNS( element, KoXmlNS::table, "help-message" ); if ( !help.isNull() ) { if ( help.hasAttributeNS( KoXmlNS::table, "title" ) ) { - kdDebug()<<"help.attribute( table:title ) :"<<help.attributeNS( KoXmlNS::table, "title", QString::null )<<endl; - d->extra()->validity->titleInfo = help.attributeNS( KoXmlNS::table, "title", QString::null ); + kdDebug()<<"help.attribute( table:title ) :"<<help.attributeNS( KoXmlNS::table, "title", TQString() )<<endl; + d->extra()->validity->titleInfo = help.attributeNS( KoXmlNS::table, "title", TQString() ); } if ( help.hasAttributeNS( KoXmlNS::table, "display" ) ) { - kdDebug()<<"help.attribute( table:display ) :"<<help.attributeNS( KoXmlNS::table, "display", QString::null )<<endl; - d->extra()->validity->displayValidationInformation = ( ( help.attributeNS( KoXmlNS::table, "display", QString::null )=="true" ) ? true : false ); + kdDebug()<<"help.attribute( table:display ) :"<<help.attributeNS( KoXmlNS::table, "display", TQString() )<<endl; + d->extra()->validity->displayValidationInformation = ( ( help.attributeNS( KoXmlNS::table, "display", TQString() )=="true" ) ? true : false ); } - QDomElement attrText = KoDom::namedItemNS( help, KoXmlNS::text, "p" ); + TQDomElement attrText = KoDom::namedItemNS( help, KoXmlNS::text, "p" ); if ( !attrText.isNull() ) { kdDebug()<<"help text :"<<attrText.text()<<endl; @@ -6220,14 +6220,14 @@ void Cell::loadOasisValidation( const QString& validationName ) } } - QDomElement error = KoDom::namedItemNS( element, KoXmlNS::table, "error-message" ); + TQDomElement error = KoDom::namedItemNS( element, KoXmlNS::table, "error-message" ); if ( !error.isNull() ) { if ( error.hasAttributeNS( KoXmlNS::table, "title" ) ) - d->extra()->validity->title = error.attributeNS( KoXmlNS::table, "title", QString::null ); + d->extra()->validity->title = error.attributeNS( KoXmlNS::table, "title", TQString() ); if ( error.hasAttributeNS( KoXmlNS::table, "message-type" ) ) { - QString str = error.attributeNS( KoXmlNS::table, "message-type", QString::null ); + TQString str = error.attributeNS( KoXmlNS::table, "message-type", TQString() ); if ( str == "warning" ) d->extra()->validity->m_action = Action::Warning; else if ( str == "information" ) @@ -6240,30 +6240,30 @@ void Cell::loadOasisValidation( const QString& validationName ) if ( error.hasAttributeNS( KoXmlNS::table, "display" ) ) { - kdDebug()<<" display message :"<<error.attributeNS( KoXmlNS::table, "display", QString::null )<<endl; - d->extra()->validity->displayMessage = (error.attributeNS( KoXmlNS::table, "display", QString::null )=="true"); + kdDebug()<<" display message :"<<error.attributeNS( KoXmlNS::table, "display", TQString() )<<endl; + d->extra()->validity->displayMessage = (error.attributeNS( KoXmlNS::table, "display", TQString() )=="true"); } - QDomElement attrText = KoDom::namedItemNS( error, KoXmlNS::text, "p" ); + TQDomElement attrText = KoDom::namedItemNS( error, KoXmlNS::text, "p" ); if ( !attrText.isNull() ) d->extra()->validity->message = attrText.text(); } } -void Cell::loadOasisValidationValue( const QStringList &listVal ) +void Cell::loadOasisValidationValue( const TQStringList &listVal ) { bool ok = false; kdDebug()<<" listVal[0] :"<<listVal[0]<<" listVal[1] :"<<listVal[1]<<endl; if ( d->extra()->validity->m_restriction == Restriction::Date ) { - d->extra()->validity->dateMin = QDate::fromString( listVal[0] ); - d->extra()->validity->dateMax = QDate::fromString( listVal[1] ); + d->extra()->validity->dateMin = TQDate::fromString( listVal[0] ); + d->extra()->validity->dateMax = TQDate::fromString( listVal[1] ); } else if ( d->extra()->validity->m_restriction == Restriction::Time ) { - d->extra()->validity->timeMin = QTime::fromString( listVal[0] ); - d->extra()->validity->timeMax = QTime::fromString( listVal[1] ); + d->extra()->validity->timeMin = TQTime::fromString( listVal[0] ); + d->extra()->validity->timeMax = TQTime::fromString( listVal[1] ); } else { @@ -6295,36 +6295,36 @@ void Cell::loadOasisValidationValue( const QStringList &listVal ) } } -void Cell::loadOasisValidationCondition( QString &valExpression ) +void Cell::loadOasisValidationCondition( TQString &valExpression ) { - QString value; - if (valExpression.find( "<=" )==0 ) + TQString value; + if (valExpression.tqfind( "<=" )==0 ) { value = valExpression.remove( 0,2 ); d->extra()->validity->m_cond = Conditional::InferiorEqual; } - else if (valExpression.find( ">=" )==0 ) + else if (valExpression.tqfind( ">=" )==0 ) { value = valExpression.remove( 0,2 ); d->extra()->validity->m_cond = Conditional::SuperiorEqual; } - else if (valExpression.find( "!=" )==0 ) + else if (valExpression.tqfind( "!=" )==0 ) { //add Differentto attribute value = valExpression.remove( 0,2 ); d->extra()->validity->m_cond = Conditional::DifferentTo; } - else if ( valExpression.find( "<" )==0 ) + else if ( valExpression.tqfind( "<" )==0 ) { value = valExpression.remove( 0,1 ); d->extra()->validity->m_cond = Conditional::Inferior; } - else if(valExpression.find( ">" )==0 ) + else if(valExpression.tqfind( ">" )==0 ) { value = valExpression.remove( 0,1 ); d->extra()->validity->m_cond = Conditional::Superior; } - else if (valExpression.find( "=" )==0 ) + else if (valExpression.tqfind( "=" )==0 ) { value = valExpression.remove( 0,1 ); d->extra()->validity->m_cond = Conditional::Equal; @@ -6333,11 +6333,11 @@ void Cell::loadOasisValidationCondition( QString &valExpression ) kdDebug()<<" I don't know how to parse it :"<<valExpression<<endl; if ( d->extra()->validity->m_restriction == Restriction::Date ) { - d->extra()->validity->dateMin = QDate::fromString( value ); + d->extra()->validity->dateMin = TQDate::fromString( value ); } else if (d->extra()->validity->m_restriction == Restriction::Date ) { - d->extra()->validity->timeMin = QTime::fromString( value ); + d->extra()->validity->timeMin = TQTime::fromString( value ); } else { @@ -6358,7 +6358,7 @@ void Cell::loadOasisValidationCondition( QString &valExpression ) } -bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, +bool Cell::load( const TQDomElement & cell, int _xshift, int _yshift, Paste::Mode pm, Paste::Operation op, bool paste ) { bool ok; @@ -6387,7 +6387,7 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, // // Load formatting information. // - QDomElement f = cell.namedItem( "format" ).toElement(); + TQDomElement f = cell.namedItem( "format" ).toElement(); if ( !f.isNull() && ( (pm == Paste::Normal) || (pm == Paste::Format) || (pm == Paste::NoBorder) ) ) { @@ -6443,7 +6443,7 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, // // Load the condition section of a cell. // - QDomElement conditionsElement = cell.namedItem( "condition" ).toElement(); + TQDomElement conditionsElement = cell.namedItem( "condition" ).toElement(); if ( !conditionsElement.isNull()) { if (d->hasExtra()) @@ -6462,10 +6462,10 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, } } - QDomElement validity = cell.namedItem( "validity" ).toElement(); + TQDomElement validity = cell.namedItem( "validity" ).toElement(); if ( !validity.isNull()) { - QDomElement param = validity.namedItem( "param" ).toElement(); + TQDomElement param = validity.namedItem( "param" ).toElement(); if(!param.isNull()) { d->extra()->validity = new Validity; @@ -6513,46 +6513,46 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, } if ( param.hasAttribute("listvalidity") ) { - d->extra()->validity->listValidity=QStringList::split(";", param.attribute("listvalidity") ); + d->extra()->validity->listValidity=TQStringList::split(";", param.attribute("listvalidity") ); } } - QDomElement inputTitle = validity.namedItem( "inputtitle" ).toElement(); + TQDomElement inputTitle = validity.namedItem( "inputtitle" ).toElement(); if (!inputTitle.isNull()) { d->extra()->validity->titleInfo = inputTitle.text(); } - QDomElement inputMessage = validity.namedItem( "inputmessage" ).toElement(); + TQDomElement inputMessage = validity.namedItem( "inputmessage" ).toElement(); if (!inputMessage.isNull()) { d->extra()->validity->messageInfo = inputMessage.text(); } - QDomElement title = validity.namedItem( "title" ).toElement(); + TQDomElement title = validity.namedItem( "title" ).toElement(); if (!title.isNull()) { d->extra()->validity->title = title.text(); } - QDomElement message = validity.namedItem( "message" ).toElement(); + TQDomElement message = validity.namedItem( "message" ).toElement(); if (!message.isNull()) { d->extra()->validity->message = message.text(); } - QDomElement timeMin = validity.namedItem( "timemin" ).toElement(); + TQDomElement timeMin = validity.namedItem( "timemin" ).toElement(); if ( !timeMin.isNull() ) { d->extra()->validity->timeMin = toTime(timeMin); } - QDomElement timeMax = validity.namedItem( "timemax" ).toElement(); + TQDomElement timeMax = validity.namedItem( "timemax" ).toElement(); if ( !timeMax.isNull() ) { d->extra()->validity->timeMax = toTime(timeMax); } - QDomElement dateMin = validity.namedItem( "datemin" ).toElement(); + TQDomElement dateMin = validity.namedItem( "datemin" ).toElement(); if ( !dateMin.isNull() ) { d->extra()->validity->dateMin = toDate(dateMin); } - QDomElement dateMax = validity.namedItem( "datemax" ).toElement(); + TQDomElement dateMax = validity.namedItem( "datemax" ).toElement(); if ( !dateMax.isNull() ) { d->extra()->validity->dateMax = toDate(dateMax); @@ -6567,10 +6567,10 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, // // Load the comment // - QDomElement comment = cell.namedItem( "comment" ).toElement(); + TQDomElement comment = cell.namedItem( "comment" ).toElement(); if ( !comment.isNull() && ( pm == Paste::Normal || pm == Paste::Comment || pm == Paste::NoBorder )) { - QString t = comment.text(); + TQString t = comment.text(); //t = t.stripWhiteSpace(); format()->setComment( t ); } @@ -6581,7 +6581,7 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, // // TODO: make this suck less. We set data twice, in loadCellData, and // also here. Not good. - QDomElement text = cell.namedItem( "text" ).toElement(); + TQDomElement text = cell.namedItem( "text" ).toElement(); if ( !text.isNull() && ( pm == Paste::Normal || pm == Paste::Text || pm == Paste::NoBorder || pm == Paste::Result ) ) @@ -6592,8 +6592,8 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, if ( cell.hasAttribute( "dataType" ) ) // new docs text.setAttribute( "dataType", cell.attribute( "dataType" ) ); - QDomElement result = cell.namedItem( "result" ).toElement(); - QString txt = text.text(); + TQDomElement result = cell.namedItem( "result" ).toElement(); + TQString txt = text.text(); if ((pm == Paste::Result) && (txt[0] == '=')) // paste text of the element, if we want to paste result // and the source cell contains a formula @@ -6606,8 +6606,8 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, if ( !result.isNull() ) { - QString dataType; - QString t = result.text(); + TQString dataType; + TQString t = result.text(); if ( result.hasAttribute( "dataType" ) ) dataType = result.attribute( "dataType" ); @@ -6646,12 +6646,12 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, setValue ( dd ); else { - int pos = t.find( '/' ); + int pos = t.tqfind( '/' ); int year = t.mid( 0, pos ).toInt(); - int pos1 = t.find( '/', pos + 1 ); + int pos1 = t.tqfind( '/', pos + 1 ); int month = t.mid( pos + 1, ( ( pos1 - 1 ) - pos ) ).toInt(); int day = t.right( t.length() - pos1 - 1 ).toInt(); - QDate date( year, month, day ); + TQDate date( year, month, day ); if ( date.isValid() ) setValue( date ); else @@ -6670,12 +6670,12 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, int minutes = -1; int second = -1; int pos, pos1; - pos = t.find( ':' ); + pos = t.tqfind( ':' ); hours = t.mid( 0, pos ).toInt(); - pos1 = t.find( ':', pos + 1 ); + pos1 = t.tqfind( ':', pos + 1 ); minutes = t.mid( pos + 1, ( ( pos1 - 1 ) - pos ) ).toInt(); second = t.right( t.length() - pos1 - 1 ).toInt(); - QTime time( hours, minutes, second ); + TQTime time( hours, minutes, second ); if ( time.isValid() ) setValue( time ); else @@ -6695,11 +6695,11 @@ bool Cell::load( const QDomElement & cell, int _xshift, int _yshift, return true; } -bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) +bool Cell::loadCellData(const TQDomElement & text, Paste::Operation op ) { //TODO: use converter()->asString() to generate strText - QString t = text.text(); + TQString t = text.text(); t = t.stripWhiteSpace(); setFlag(Flag_LayoutDirty); @@ -6724,19 +6724,19 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) // extract the link and the correspoding text // This is a rather dirty hack, but enough for KSpread generated XML bool inside_tag = false; - QString qml_text; - QString tag; - QString qml_link; + TQString qml_text; + TQString tag; + TQString qml_link; for( unsigned i = 1; i < t.length(); i++ ) { - QChar ch = t[i]; + TQChar ch = t[i]; if( ch == '<' ) { if( !inside_tag ) { inside_tag = true; - tag = QString::null; + tag = TQString(); } } else if( ch == '>' ) @@ -6744,10 +6744,10 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) if( inside_tag ) { inside_tag = false; - if( tag.startsWith( "a href=\"", true ) ) - if( tag.endsWith( "\"" ) ) + if( tag.tqstartsWith( "a href=\"", true ) ) + if( tag.tqendsWith( "\"" ) ) qml_link = tag.mid( 8, tag.length()-9 ); - tag = QString::null; + tag = TQString(); } } else @@ -6767,7 +6767,7 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) else { bool newStyleLoading = true; - QString dataType; + TQString dataType; if ( text.hasAttribute( "dataType" ) ) // new docs { @@ -6776,9 +6776,9 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) else // old docs: do the ugly solution of calling checkTextInput to parse the text { // ...except for date/time - if (isDate() && ( t.contains('/') == 2 )) + if (isDate() && ( t.tqcontains('/') == 2 )) dataType = "Date"; - else if (isTime() && ( t.contains(':') == 2 ) ) + else if (isTime() && ( t.tqcontains(':') == 2 ) ) dataType = "Time"; else { @@ -6805,7 +6805,7 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) else if( dataType == "Num" ) { bool ok = false; - if (t.contains('.')) + if (t.tqcontains('.')) setValue ( Value( t.toDouble(&ok) ) ); // We save in non-localized format else setValue ( Value( t.toLong(&ok) ) ); @@ -6818,7 +6818,7 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) /* KLocale::formatNumber requires the precision we want to return. */ - int precision = t.length() - t.find('.') - 1; + int precision = t.length() - t.tqfind('.') - 1; if ( formatType() == Percentage_format ) { @@ -6842,12 +6842,12 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) // date ? else if( dataType == "Date" ) { - int pos = t.find('/'); + int pos = t.tqfind('/'); int year = t.mid(0,pos).toInt(); - int pos1 = t.find('/',pos+1); + int pos1 = t.tqfind('/',pos+1); int month = t.mid(pos+1,((pos1-1)-pos)).toInt(); int day = t.right(t.length()-pos1-1).toInt(); - setValue( QDate(year,month,day) ); + setValue( TQDate(year,month,day) ); if ( value().asDate().isValid() ) // Should always be the case for new docs d->strText = locale()->formatDate( value().asDate(), true ); else // This happens with old docs, when format is set wrongly to date @@ -6864,12 +6864,12 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) int minutes = -1; int second = -1; int pos, pos1; - pos = t.find(':'); + pos = t.tqfind(':'); hours = t.mid(0,pos).toInt(); - pos1 = t.find(':',pos+1); + pos1 = t.tqfind(':',pos+1); minutes = t.mid(pos+1,((pos1-1)-pos)).toInt(); second = t.right(t.length()-pos1-1).toInt(); - setValue( QTime(hours,minutes,second) ); + setValue( TQTime(hours,minutes,second) ); if ( value().asTime().isValid() ) // Should always be the case for new docs d->strText = locale()->formatTime( value().asTime(), true ); else // This happens with old docs, when format is set wrongly to time @@ -6904,49 +6904,49 @@ bool Cell::loadCellData(const QDomElement & text, Paste::Operation op ) return true; } -QTime Cell::toTime(const QDomElement &element) +TQTime Cell::toTime(const TQDomElement &element) { //TODO: can't we use tryParseTime (after modification) instead? - QString t = element.text(); + TQString t = element.text(); t = t.stripWhiteSpace(); int hours = -1; int minutes = -1; int second = -1; int pos, pos1; - pos = t.find(':'); + pos = t.tqfind(':'); hours = t.mid(0,pos).toInt(); - pos1 = t.find(':',pos+1); + pos1 = t.tqfind(':',pos+1); minutes = t.mid(pos+1,((pos1-1)-pos)).toInt(); second = t.right(t.length()-pos1-1).toInt(); - setValue( Value( QTime(hours,minutes,second)) ); + setValue( Value( TQTime(hours,minutes,second)) ); return value().asTime(); } -QDate Cell::toDate(const QDomElement &element) +TQDate Cell::toDate(const TQDomElement &element) { - QString t = element.text(); + TQString t = element.text(); int pos; int pos1; int year = -1; int month = -1; int day = -1; - pos = t.find('/'); + pos = t.tqfind('/'); year = t.mid(0,pos).toInt(); - pos1 = t.find('/',pos+1); + pos1 = t.tqfind('/',pos+1); month = t.mid(pos+1,((pos1-1)-pos)).toInt(); day = t.right(t.length()-pos1-1).toInt(); - setValue( Value( QDate(year,month,day) ) ); + setValue( Value( TQDate(year,month,day) ) ); return value().asDate(); } -QString Cell::pasteOperation( const QString &new_text, const QString &old_text, Paste::Operation op ) +TQString Cell::pasteOperation( const TQString &new_text, const TQString &old_text, Paste::Operation op ) { if ( op == Paste::OverWrite ) return new_text; - QString tmp_op; - QString tmp; - QString old; + TQString tmp_op; + TQString tmp; + TQString old; if( !new_text.isEmpty() && new_text[0] == '=' ) { @@ -6986,16 +6986,16 @@ QString Cell::pasteOperation( const QString &new_text, const QString &old_text, switch( op ) { case Paste::Add: - tmp_op = QString::number(old.toDouble()+tmp.toDouble()); + tmp_op = TQString::number(old.toDouble()+tmp.toDouble()); break; case Paste::Mul : - tmp_op = QString::number(old.toDouble()*tmp.toDouble()); + tmp_op = TQString::number(old.toDouble()*tmp.toDouble()); break; case Paste::Sub: - tmp_op = QString::number(old.toDouble()-tmp.toDouble()); + tmp_op = TQString::number(old.toDouble()-tmp.toDouble()); break; case Paste::Div: - tmp_op = QString::number(old.toDouble()/tmp.toDouble()); + tmp_op = TQString::number(old.toDouble()/tmp.toDouble()); break; default: Q_ASSERT( 0 ); @@ -7041,10 +7041,10 @@ QString Cell::pasteOperation( const QString &new_text, const QString &old_text, return tmp; } -QString Cell::testAnchor( int x, int y ) const +TQString Cell::testAnchor( int x, int y ) const { if( link().isEmpty() ) - return QString::null; + return TQString(); const Doc* doc = format()->sheet()->doc(); int x1 = doc->zoomItX( d->textX ); @@ -7056,7 +7056,7 @@ QString Cell::testAnchor( int x, int y ) const if( y > y1 ) if( y < y2 ) return link(); - return QString::null; + return TQString(); } void Cell::sheetDies() @@ -7219,24 +7219,24 @@ bool Cell::operator==( const Cell& other ) const return true; } -QRect Cell::cellRect() +TQRect Cell::cellRect() { Q_ASSERT(!isDefault()); - return QRect(QPoint(d->column, d->row), QPoint(d->column, d->row)); + return TQRect(TQPoint(d->column, d->row), TQPoint(d->column, d->row)); } -QValueList<Conditional> Cell::conditionList() const +TQValueList<Conditional> Cell::conditionList() const { if ( !d->hasExtra() || !d->extra()->conditions ) { - QValueList<Conditional> emptyList; + TQValueList<Conditional> emptyList; return emptyList; } return d->extra()->conditions->conditionList(); } -void Cell::setConditionList( const QValueList<Conditional> & newList ) +void Cell::setConditionList( const TQValueList<Conditional> & newList ) { if (d->hasExtra()) delete d->extra()->conditions; @@ -7264,7 +7264,7 @@ bool Cell::calcDirtyFlag() return isFormula() ? testFlag( Flag_CalcDirty ) : false; } -bool Cell::layoutDirtyFlag() const +bool Cell::tqlayoutDirtyFlag() const { return testFlag( Flag_LayoutDirty ); } @@ -7286,21 +7286,21 @@ bool Cell::doesMergeCells() const void Cell::clearFlag( CellFlags flag ) { - d->flags &= ~(Q_UINT32)flag; + d->flags &= ~(TQ_UINT32)flag; } void Cell::setFlag( CellFlags flag ) { - d->flags |= (Q_UINT32)flag; + d->flags |= (TQ_UINT32)flag; } bool Cell::testFlag( CellFlags flag ) const { - return ( d->flags & (Q_UINT32)flag ); + return ( d->flags & (TQ_UINT32)flag ); } -void Cell::checkForNamedAreas( QString & formula ) const +void Cell::checkForNamedAreas( TQString & formula ) const { KSPLoadingInfo* loadinginfo = sheet()->doc()->loadingInfo(); if(! loadinginfo) { @@ -7310,7 +7310,7 @@ void Cell::checkForNamedAreas( QString & formula ) const int l = formula.length(); int i = 0; - QString word; + TQString word; int start = 0; while ( i < l ) { @@ -7324,7 +7324,7 @@ void Cell::checkForNamedAreas( QString & formula ) const { if ( loadinginfo->findWordInAreaList(word) ) { - formula = formula.replace( start, word.length(), "'" + word + "'" ); + formula = formula.tqreplace( start, word.length(), "'" + word + "'" ); l = formula.length(); ++i; kdDebug() << "Formula: " << formula << ", L: " << l << ", i: " << i + 1 <<endl; @@ -7339,7 +7339,7 @@ void Cell::checkForNamedAreas( QString & formula ) const { if ( loadinginfo->findWordInAreaList(word) ) { - formula = formula.replace( start, word.length(), "'" + word + "'" ); + formula = formula.tqreplace( start, word.length(), "'" + word + "'" ); l = formula.length(); ++i; kdDebug() << "Formula: " << formula << ", L: " << l << ", i: " << i + 1 <<endl; |