diff options
Diffstat (limited to 'kspread/kspread_cell.cc')
-rw-r--r-- | kspread/kspread_cell.cc | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kspread/kspread_cell.cc b/kspread/kspread_cell.cc index 0c5de5e6..fdcf38be 100644 --- a/kspread/kspread_cell.cc +++ b/kspread/kspread_cell.cc @@ -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 @@ -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 ); } @@ -1049,20 +1049,20 @@ TQString Cell::encodeFormula( bool _era, int _col, int _row ) const int col = 0; col = util_decodeColumnLabelText( buffer ); if ( fix1 ) - erg += TQString( "$%1" ).arg( col ); + erg += TQString( "$%1" ).tqarg( col ); else if (_era) - erg += TQChar(0xA7) + TQString( "%1" ).arg( col ); + erg += TQChar(0xA7) + TQString( "%1" ).tqarg( col ); else - erg += TQString( "#%1" ).arg( col - _col ); + erg += TQString( "#%1" ).tqarg( col - _col ); if ( fix2 ) - erg += TQString( "$%1#").arg( row ); + erg += TQString( "$%1#").tqarg( row ); else if (_era) - erg += TQChar(0xA7) + TQString( "%1#" ).arg( row ); + erg += TQChar(0xA7) + TQString( "%1#" ).tqarg( row ); else - erg += TQString( "#%1#" ).arg( row - _row ); + erg += TQString( "#%1#" ).tqarg( row - _row ); } } else @@ -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 @@ -1222,11 +1222,11 @@ 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( TQPainter &_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() @@ -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; @@ -2052,7 +2052,7 @@ bool Cell::makeFormula() if (format()->sheet()->doc()->getShowMessageError()) { TQString tmp(i18n("Error in cell %1\n\n")); - tmp = tmp.arg( fullName() ); + tmp = tmp.tqarg( fullName() ); KMessageBox::error( (TQWidget*)0L, tmp); } setFlag(Flag_ParseError); @@ -2193,7 +2193,7 @@ void Cell::paintCell( const KoRect &rect, TQPainter & 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 @@ -2253,14 +2253,14 @@ void Cell::paintCell( const KoRect &rect, TQPainter & painter, selected = selected && !( markerArea.contains( 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 @@ -2299,7 +2299,7 @@ void Cell::paintCell( const KoRect &rect, TQPainter & 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() != TQInternal::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, TQPainter & 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, TQPainter & 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, TQPainter & 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, TQPainter & 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,7 +2402,7 @@ void Cell::paintCell( const KoRect &rect, TQPainter & 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; @@ -2498,7 +2498,7 @@ void Cell::paintCell( const KoRect &rect, TQPainter & painter, */ if ( d->style == Cell::ST_Button ) { TQBrush fill( TQt::lightGray ); - TQApplication::style().drawControl( TQStyle::CE_PushButton, &_painter, this, + TQApplication::style().tqdrawControl( TQStyle::CE_PushButton, &_painter, this, TQRect( _tx + 1, _ty + 1, w2 - 1, h2 - 1 ), defaultColorGroup ); //, selected, &fill ); } @@ -2686,7 +2686,7 @@ void Cell::paintBackground( TQPainter& painter, const KoRect &cellRect, const TQPoint &cellRef, bool selected, TQColor &backgroundColor ) { - TQColorGroup defaultColorGroup = TQApplication::palette().active(); + 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 @@ -2723,7 +2723,7 @@ void Cell::paintBackground( TQPainter& painter, const KoRect &cellRect, TQColor bg( backgroundColor ); // Handle printers separately. - if ( !painter.device()->isExtDev() ) { + if ( !painter.tqdevice()->isExtDev() ) { if ( bg.isValid() ) painter.setBackgroundColor( bg ); else @@ -2742,7 +2742,7 @@ void Cell::paintBackground( TQPainter& 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 @@ -2791,7 +2791,7 @@ void Cell::paintDefaultBorders( TQPainter& painter, const KoRect &rect, Doc* doc = sheet()->doc(); Sheet::LayoutDirection sheetDir = format()->sheet()->layoutDirection(); - bool paintingToExternalDevice = painter.device()->isExtDev(); + 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 @@ -2948,7 +2948,7 @@ void Cell::paintDefaultBorders( TQPainter& 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( doc->zoomItX( TQMAX( rect.left(), cellRect.x() ) ), doc->zoomItY( TQMAX( rect.top(), cellRect.y() + dt ) ), @@ -2995,7 +2995,7 @@ void Cell::paintDefaultBorders( TQPainter& 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() ) { 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 ) ), @@ -3026,7 +3026,7 @@ void Cell::paintCommentIndicator( TQPainter& painter, && cellRect.width() > 10.0 && cellRect.height() > 10.0 && ( sheet()->print()->printCommentIndicator() - || ( !painter.device()->isExtDev() && sheet()->getShowCommentIndicator() ) ) ) { + || ( !painter.tqdevice()->isExtDev() && sheet()->getShowCommentIndicator() ) ) ) { TQColor penColor = TQt::red; // If background has high red part, switch to blue. @@ -3123,7 +3123,7 @@ void Cell::paintMoreTextIndicator( TQPainter& painter, // 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 ) { @@ -3175,15 +3175,15 @@ void Cell::paintText( TQPainter& painter, ColumnFormat *colFormat = format()->sheet()->columnFormat( cellRef.x() ); - TQColorGroup defaultColorGroup = TQApplication::palette().active(); + 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() ) + if ( painter.tqdevice()->isExtDev() ) textColorPrint = TQt::black; else - textColorPrint = TQApplication::palette().active().text(); + textColorPrint = TQApplication::tqpalette().active().text(); } TQPen tmpPen( textColorPrint ); @@ -3209,7 +3209,7 @@ void Cell::paintText( TQPainter& painter, // Check for blue color, for hyperlink. if ( !link().isEmpty() ) { - tmpPen.setColor( TQApplication::palette().active().link() ); + tmpPen.setColor( TQApplication::tqpalette().active().link() ); TQFont f = painter.font(); f.setUnderline( true ); painter.setFont( f ); @@ -3466,7 +3466,7 @@ void Cell::paintPageBorders( TQPainter& painter, bool paintBorderBottom ) { // Not screen? Return immediately. - if ( painter.device()->isExtDev() ) + if ( painter.tqdevice()->isExtDev() ) return; if ( ! format()->sheet()->isShowPageBorders() ) @@ -3628,7 +3628,7 @@ void Cell::paintCellBorders( TQPainter& 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 TQMIN/TQMAX and left/right pairs don't really make sense. // @@ -3675,7 +3675,7 @@ void Cell::paintCellBorders( TQPainter& 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( TQMAX( zrect_left, zcellRect_left ), TQMAX( zrect_top, zcellRect_top - top ), @@ -3716,7 +3716,7 @@ void Cell::paintCellBorders( TQPainter& 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( TQMAX( zrect_left, zcellRect_left ), zcellRect_top, @@ -3738,7 +3738,7 @@ void Cell::paintCellBorders( TQPainter& 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( TQMAX( zrect_left, zcellRect_left ), zcellRect_bottom, @@ -3762,7 +3762,7 @@ void Cell::paintCellBorders( TQPainter& 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. // TQPen vert_pen, horz_pen; int vert_penWidth, horz_penWidth; @@ -3810,7 +3810,7 @@ void Cell::paintCellBorders( TQPainter& painter, const KoRect& rect, 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( TQMAX( zrect_left, zcellRect_right ), TQMAX( zrect_top, zcellRect_top ), @@ -3860,7 +3860,7 @@ void Cell::paintCellBorders( TQPainter& painter, const KoRect& rect, 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( TQMAX( zrect_left, zcellRect_left ), TQMAX( zrect_top, zcellRect_top ), @@ -3913,7 +3913,7 @@ void Cell::paintCellBorders( TQPainter& painter, const KoRect& rect, 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( TQMAX( zrect_left, zcellRect_right ), TQMAX( zrect_top, zcellRect_bottom - bottom ), @@ -3965,7 +3965,7 @@ void Cell::paintCellBorders( TQPainter& painter, const KoRect& rect, 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( TQMAX( zrect_left, zcellRect_left ), TQMAX( zrect_top, zcellRect_bottom - bottom ), @@ -4704,7 +4704,7 @@ TQString Cell::link() const 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 */ @@ -5232,7 +5232,7 @@ TQDomElement Cell::save( TQDomDocument& doc, { TQDomElement dateMin = doc.createElement( "datemin" ); TQString tmp("%1/%2/%3"); - tmp = tmp.arg(d->extra()->validity->dateMin.year()).arg(d->extra()->validity->dateMin.month()).arg(d->extra()->validity->dateMin.day()); + 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 ); } @@ -5240,7 +5240,7 @@ TQDomElement Cell::save( TQDomDocument& doc, { TQDomElement dateMax = doc.createElement( "datemax" ); TQString tmp("%1/%2/%3"); - tmp = tmp.arg(d->extra()->validity->dateMax.year()).arg(d->extra()->validity->dateMax.month()).arg(d->extra()->validity->dateMax.day()); + 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 ); } @@ -5312,7 +5312,7 @@ bool Cell::saveCellResult( TQDomDocument& doc, TQDomElement& result, 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() ) { @@ -6048,25 +6048,25 @@ void Cell::loadOasisObjects( const TQDomElement &parent, KoOasisLoadingContext& 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 ) ); 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", 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 ); } } } @@ -6744,8 +6744,8 @@ bool Cell::loadCellData(const TQDomElement & 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 = TQString(); } |