summaryrefslogtreecommitdiffstats
path: root/kspread/kspread_cell.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commitb6edfe41c9395f2e20784cbf0e630af6426950a3 (patch)
tree56ed9b871d4296e6c15949c24e16420be1b28697 /kspread/kspread_cell.cc
parentef39e8e4178a8f98cf5f154916ba0f03e4855206 (diff)
downloadkoffice-b6edfe41c9395f2e20784cbf0e630af6426950a3.tar.gz
koffice-b6edfe41c9395f2e20784cbf0e630af6426950a3.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspread/kspread_cell.cc')
-rw-r--r--kspread/kspread_cell.cc122
1 files changed, 61 insertions, 61 deletions
diff --git a/kspread/kspread_cell.cc b/kspread/kspread_cell.cc
index c3c520f8..a0ae2073 100644
--- a/kspread/kspread_cell.cc
+++ b/kspread/kspread_cell.cc
@@ -1326,7 +1326,7 @@ void Cell::makeLayout( TQPainter &_painter, int _col, int _row )
&& format()->multiRow( _col, _row ) )
{
// Copy of d->strOutText but without the newlines.
-// TQString o = d->strOutText.tqreplace( TQChar('\n'), " " );
+// TQString o = d->strOutText.replace( TQChar('\n'), " " );
// don't remove the existing LF, these are intended line wraps (whishlist #9881)
TQString o = d->strOutText;
@@ -1334,7 +1334,7 @@ void Cell::makeLayout( TQPainter &_painter, int _col, int _row )
// Break the line at appropriate places, i.e. spaces, if
// necessary. This means to change the spaces where breaks occur
// into newlines.
- if ( o.tqfind(' ') != -1 )
+ if ( o.find(' ') != -1 )
{
d->strOutText = "";
@@ -1350,8 +1350,8 @@ void Cell::makeLayout( TQPainter &_painter, int _col, int _row )
do {
- breakpos = o.tqfind( ' ', breakpos );
- int linefeed = o.tqfind( '\n', pos1 );
+ breakpos = o.find( ' ', breakpos );
+ int linefeed = o.find( '\n', pos1 );
// kdDebug() << "start: " << start << "; breakpos: " << breakpos << "; pos1: " << pos1 << "; linefeed: " << linefeed << endl;
@@ -1394,11 +1394,11 @@ void Cell::makeLayout( TQPainter &_painter, int _col, int _row )
}
breakpos++;
- } while( o.tqfind( ' ', breakpos ) != -1 );
+ } while( o.find( ' ', breakpos ) != -1 );
}
else
{
- lines = o.tqcontains('\n');
+ lines = o.contains('\n');
}
d->textHeight *= lines;
@@ -1414,7 +1414,7 @@ void Cell::makeLayout( TQPainter &_painter, int _col, int _row )
int pos = 0;
d->textWidth = 0.0;
do {
- i = d->strOutText.tqfind( "\n", pos );
+ i = d->strOutText.find( "\n", pos );
if ( i == -1 )
t = d->strOutText.mid( pos, d->strOutText.length() - pos );
@@ -2243,14 +2243,14 @@ void Cell::paintCell( const KoRect &rect, TQPainter & painter,
// itself really is selected.
bool selected = false;
if ( view != NULL ) {
- selected = view->selectionInfo()->tqcontains( cellRef );
+ selected = view->selectionInfo()->contains( cellRef );
// But the cell doesn't look selected if this is the marker cell.
Cell *cell = format()->sheet()->cellAt( view->selectionInfo()->marker() );
TQPoint bottomRight( view->selectionInfo()->marker().x() + cell->extraXCells(),
view->selectionInfo()->marker().y() + cell->extraYCells() );
TQRect markerArea( view->selectionInfo()->marker(), bottomRight );
- selected = selected && !( markerArea.tqcontains( cellRef ) );
+ selected = selected && !( markerArea.contains( cellRef ) );
// Don't draw any selection at all when printing.
if ( painter.tqdevice()->isExtDev() || !drawCursor )
@@ -2432,7 +2432,7 @@ void Cell::paintCell( const KoRect &rect, TQPainter & painter,
//
// This optimization removes an O(n^4) behaviour where n is
// the number of cells on one edge in a merged cell.
- if ( mergedCellsPainted.tqcontains( obscuringCellRef ) )
+ if ( mergedCellsPainted.contains( obscuringCellRef ) )
continue;
Cell *obscuringCell = format()->sheet()->cellAt( obscuringCellRef.x(),
@@ -3389,7 +3389,7 @@ void Cell::paintText( TQPainter& painter,
double dy = 0.0;
TQFontMetrics fm = painter.fontMetrics();
do {
- i = d->strOutText.tqfind( "\n", pos );
+ i = d->strOutText.find( "\n", pos );
if ( i == -1 )
t = d->strOutText.mid( pos, d->strOutText.length() - pos );
else {
@@ -4105,7 +4105,7 @@ TQString Cell::textDisplaying( TQPainter &_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.tqcontains('.'))
+ if (!tmp.contains('.'))
d->strOutText=TQString().fill('#',20);
}
@@ -4546,19 +4546,19 @@ void Cell::incPrecision()
if ( tmpPreci == -1 )
{
- int pos = d->strOutText.tqfind(decimal_point);
+ int pos = d->strOutText.find(decimal_point);
if ( pos == -1 )
- pos = d->strOutText.tqfind('.');
+ pos = d->strOutText.find('.');
if ( pos == -1 )
format()->setPrecision(1);
else
{
int start = 0;
- if ( d->strOutText.tqfind('%') != -1 )
+ if ( d->strOutText.find('%') != -1 )
start = 2;
- else if ( d->strOutText.tqfind(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) )
+ else if ( d->strOutText.find(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) )
start = locale()->currencySymbol().length() + 1;
- else if ( (start=d->strOutText.tqfind('E')) != -1 )
+ else if ( (start=d->strOutText.find('E')) != -1 )
start = d->strOutText.length() - start;
//kdDebug(36001) << "start=" << start << " pos=" << pos << " length=" << d->strOutText.length() << endl;
@@ -4582,13 +4582,13 @@ void Cell::decPrecision()
// kdDebug(36001) << "decPrecision: tmpPreci = " << tmpPreci << endl;
if ( format()->precision(column(),row()) == -1 )
{
- int pos = d->strOutText.tqfind( decimal_point );
+ int pos = d->strOutText.find( decimal_point );
int start = 0;
- if ( d->strOutText.tqfind('%') != -1 )
+ if ( d->strOutText.find('%') != -1 )
start = 2;
- else if ( d->strOutText.tqfind(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) )
+ else if ( d->strOutText.find(locale()->currencySymbol()) == ((int)(d->strOutText.length()-locale()->currencySymbol().length())) )
start = locale()->currencySymbol().length() + 1;
- else if ( (start = d->strOutText.tqfind('E')) != -1 )
+ else if ( (start = d->strOutText.find('E')) != -1 )
start = d->strOutText.length() - start;
else
start = 0;
@@ -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.tqcontains( value().asString() ) )
+ if ( value().isString() && d->extra()->validity->listValidity.contains( value().asString() ) )
valid = true;
}
else if(d->extra()->validity->m_restriction==Restriction::TextLength)
@@ -5009,7 +5009,7 @@ bool Cell::updateChart(bool refresh)
CellBinding *bind;
for ( bind = format()->sheet()->firstCellBinding(); bind != 0L; bind = format()->sheet()->nextCellBinding() )
{
- if ( bind->tqcontains( d->column, d->row ) )
+ if ( bind->contains( d->column, d->row ) )
{
if (!refresh)
return true;
@@ -5817,13 +5817,13 @@ bool Cell::loadOasis( const TQDomElement& element , KoOasisLoadingContext& oasis
int year = 0, month = 0, day = 0;
bool ok = false;
- int p1 = value.tqfind( '-' );
+ int p1 = value.find( '-' );
if ( p1 > 0 )
year = value.left( p1 ).toInt( &ok );
kdDebug() << "year: " << value.left( p1 ) << endl;
- int p2 = value.tqfind( '-', ++p1 );
+ int p2 = value.find( '-', ++p1 );
if ( ok )
month = value.mid( p1, p2 - p1 ).toInt( &ok );
@@ -6095,7 +6095,7 @@ void Cell::loadOasisValidation( const TQString& validationName )
//A NumberValue is a whole or decimal number. It must not contain comma separators for numbers of 1000 or greater.
//ExtendedTrueCondition
- if ( valExpression.tqcontains( "cell-content-text-length()" ) )
+ if ( valExpression.contains( "cell-content-text-length()" ) )
{
//"cell-content-text-length()>45"
valExpression = valExpression.remove("oooc:cell-content-text-length()" );
@@ -6104,12 +6104,12 @@ void Cell::loadOasisValidation( const TQString& validationName )
loadOasisValidationCondition( valExpression );
}
- else if ( valExpression.tqcontains( "cell-content-is-text()" ) )
+ else if ( valExpression.contains( "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.tqcontains( "cell-content-text-length-is-between" ) )
+ else if ( valExpression.contains( "cell-content-text-length-is-between" ) )
{
d->extra()->validity->m_restriction = Restriction::TextLength;
d->extra()->validity->m_cond = Conditional::Between;
@@ -6119,7 +6119,7 @@ void Cell::loadOasisValidation( const TQString& validationName )
TQStringList listVal = TQStringList::split( ",", valExpression );
loadOasisValidationValue( listVal );
}
- else if ( valExpression.tqcontains( "cell-content-text-length-is-not-between" ) )
+ else if ( valExpression.contains( "cell-content-text-length-is-not-between" ) )
{
d->extra()->validity->m_restriction = Restriction::TextLength;
d->extra()->validity->m_cond = Conditional::Different;
@@ -6130,7 +6130,7 @@ void Cell::loadOasisValidation( const TQString& validationName )
TQStringList listVal = TQStringList::split( ",", valExpression );
loadOasisValidationValue( listVal );
}
- else if ( valExpression.tqcontains( "cell-content-is-in-list(" ) )
+ else if ( valExpression.contains( "cell-content-is-in-list(" ) )
{
d->extra()->validity->m_restriction = Restriction::List;
valExpression = valExpression.remove( "oooc:cell-content-is-in-list(" );
@@ -6142,36 +6142,36 @@ void Cell::loadOasisValidation( const TQString& validationName )
//TrueFunction ::= cell-content-is-whole-number() | cell-content-is-decimal-number() | cell-content-is-date() | cell-content-is-time()
else
{
- if (valExpression.tqcontains( "cell-content-is-whole-number()" ) )
+ if (valExpression.contains( "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.tqcontains( "cell-content-is-decimal-number()" ) )
+ else if (valExpression.contains( "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.tqcontains( "cell-content-is-date()" ) )
+ else if (valExpression.contains( "cell-content-is-date()" ) )
{
d->extra()->validity->m_restriction = Restriction::Date;
valExpression = valExpression.remove( "oooc:cell-content-is-date() and " );
}
- else if (valExpression.tqcontains( "cell-content-is-time()" ) )
+ else if (valExpression.contains( "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.tqcontains( "cell-content()" ) )
+ if ( valExpression.contains( "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.tqcontains( "cell-content-is-between(" ) )
+ if ( valExpression.contains( "cell-content-is-between(" ) )
{
valExpression = valExpression.remove( "cell-content-is-between(" );
valExpression = valExpression.remove( ")" );
@@ -6179,7 +6179,7 @@ void Cell::loadOasisValidation( const TQString& validationName )
loadOasisValidationValue( listVal );
d->extra()->validity->m_cond = Conditional::Between;
}
- if ( valExpression.tqcontains( "cell-content-is-not-between(" ) )
+ if ( valExpression.contains( "cell-content-is-not-between(" ) )
{
valExpression = valExpression.remove( "cell-content-is-not-between(" );
valExpression = valExpression.remove( ")" );
@@ -6298,33 +6298,33 @@ void Cell::loadOasisValidationValue( const TQStringList &listVal )
void Cell::loadOasisValidationCondition( TQString &valExpression )
{
TQString value;
- if (valExpression.tqfind( "<=" )==0 )
+ if (valExpression.find( "<=" )==0 )
{
value = valExpression.remove( 0,2 );
d->extra()->validity->m_cond = Conditional::InferiorEqual;
}
- else if (valExpression.tqfind( ">=" )==0 )
+ else if (valExpression.find( ">=" )==0 )
{
value = valExpression.remove( 0,2 );
d->extra()->validity->m_cond = Conditional::SuperiorEqual;
}
- else if (valExpression.tqfind( "!=" )==0 )
+ else if (valExpression.find( "!=" )==0 )
{
//add Differentto attribute
value = valExpression.remove( 0,2 );
d->extra()->validity->m_cond = Conditional::DifferentTo;
}
- else if ( valExpression.tqfind( "<" )==0 )
+ else if ( valExpression.find( "<" )==0 )
{
value = valExpression.remove( 0,1 );
d->extra()->validity->m_cond = Conditional::Inferior;
}
- else if(valExpression.tqfind( ">" )==0 )
+ else if(valExpression.find( ">" )==0 )
{
value = valExpression.remove( 0,1 );
d->extra()->validity->m_cond = Conditional::Superior;
}
- else if (valExpression.tqfind( "=" )==0 )
+ else if (valExpression.find( "=" )==0 )
{
value = valExpression.remove( 0,1 );
d->extra()->validity->m_cond = Conditional::Equal;
@@ -6646,9 +6646,9 @@ bool Cell::load( const TQDomElement & cell, int _xshift, int _yshift,
setValue ( dd );
else
{
- int pos = t.tqfind( '/' );
+ int pos = t.find( '/' );
int year = t.mid( 0, pos ).toInt();
- int pos1 = t.tqfind( '/', pos + 1 );
+ int pos1 = t.find( '/', pos + 1 );
int month = t.mid( pos + 1, ( ( pos1 - 1 ) - pos ) ).toInt();
int day = t.right( t.length() - pos1 - 1 ).toInt();
TQDate date( year, month, day );
@@ -6670,9 +6670,9 @@ bool Cell::load( const TQDomElement & cell, int _xshift, int _yshift,
int minutes = -1;
int second = -1;
int pos, pos1;
- pos = t.tqfind( ':' );
+ pos = t.find( ':' );
hours = t.mid( 0, pos ).toInt();
- pos1 = t.tqfind( ':', pos + 1 );
+ pos1 = t.find( ':', pos + 1 );
minutes = t.mid( pos + 1, ( ( pos1 - 1 ) - pos ) ).toInt();
second = t.right( t.length() - pos1 - 1 ).toInt();
TQTime time( hours, minutes, second );
@@ -6776,9 +6776,9 @@ bool Cell::loadCellData(const TQDomElement & 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.tqcontains('/') == 2 ))
+ if (isDate() && ( t.contains('/') == 2 ))
dataType = "Date";
- else if (isTime() && ( t.tqcontains(':') == 2 ) )
+ else if (isTime() && ( t.contains(':') == 2 ) )
dataType = "Time";
else
{
@@ -6805,7 +6805,7 @@ bool Cell::loadCellData(const TQDomElement & text, Paste::Operation op )
else if( dataType == "Num" )
{
bool ok = false;
- if (t.tqcontains('.'))
+ if (t.contains('.'))
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 TQDomElement & text, Paste::Operation op )
/* KLocale::formatNumber requires the precision we want to return.
*/
- int precision = t.length() - t.tqfind('.') - 1;
+ int precision = t.length() - t.find('.') - 1;
if ( formatType() == Percentage_format )
{
@@ -6842,9 +6842,9 @@ bool Cell::loadCellData(const TQDomElement & text, Paste::Operation op )
// date ?
else if( dataType == "Date" )
{
- int pos = t.tqfind('/');
+ int pos = t.find('/');
int year = t.mid(0,pos).toInt();
- int pos1 = t.tqfind('/',pos+1);
+ int pos1 = t.find('/',pos+1);
int month = t.mid(pos+1,((pos1-1)-pos)).toInt();
int day = t.right(t.length()-pos1-1).toInt();
setValue( TQDate(year,month,day) );
@@ -6864,9 +6864,9 @@ bool Cell::loadCellData(const TQDomElement & text, Paste::Operation op )
int minutes = -1;
int second = -1;
int pos, pos1;
- pos = t.tqfind(':');
+ pos = t.find(':');
hours = t.mid(0,pos).toInt();
- pos1 = t.tqfind(':',pos+1);
+ pos1 = t.find(':',pos+1);
minutes = t.mid(pos+1,((pos1-1)-pos)).toInt();
second = t.right(t.length()-pos1-1).toInt();
setValue( TQTime(hours,minutes,second) );
@@ -6913,9 +6913,9 @@ TQTime Cell::toTime(const TQDomElement &element)
int minutes = -1;
int second = -1;
int pos, pos1;
- pos = t.tqfind(':');
+ pos = t.find(':');
hours = t.mid(0,pos).toInt();
- pos1 = t.tqfind(':',pos+1);
+ pos1 = t.find(':',pos+1);
minutes = t.mid(pos+1,((pos1-1)-pos)).toInt();
second = t.right(t.length()-pos1-1).toInt();
setValue( Value( TQTime(hours,minutes,second)) );
@@ -6930,9 +6930,9 @@ TQDate Cell::toDate(const TQDomElement &element)
int year = -1;
int month = -1;
int day = -1;
- pos = t.tqfind('/');
+ pos = t.find('/');
year = t.mid(0,pos).toInt();
- pos1 = t.tqfind('/',pos+1);
+ pos1 = t.find('/',pos+1);
month = t.mid(pos+1,((pos1-1)-pos)).toInt();
day = t.right(t.length()-pos1-1).toInt();
setValue( Value( TQDate(year,month,day) ) );
@@ -7324,7 +7324,7 @@ void Cell::checkForNamedAreas( TQString & formula ) const
{
if ( loadinginfo->findWordInAreaList(word) )
{
- formula = formula.tqreplace( start, word.length(), "'" + word + "'" );
+ formula = formula.replace( start, word.length(), "'" + word + "'" );
l = formula.length();
++i;
kdDebug() << "Formula: " << formula << ", L: " << l << ", i: " << i + 1 <<endl;
@@ -7339,7 +7339,7 @@ void Cell::checkForNamedAreas( TQString & formula ) const
{
if ( loadinginfo->findWordInAreaList(word) )
{
- formula = formula.tqreplace( start, word.length(), "'" + word + "'" );
+ formula = formula.replace( start, word.length(), "'" + word + "'" );
l = formula.length();
++i;
kdDebug() << "Formula: " << formula << ", L: " << l << ", i: " << i + 1 <<endl;