From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: TQt4 port koffice This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kspread/tests/formula_tester.cc | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'kspread/tests/formula_tester.cc') diff --git a/kspread/tests/formula_tester.cc b/kspread/tests/formula_tester.cc index 3dad1caa..b7f9f227 100644 --- a/kspread/tests/formula_tester.cc +++ b/kspread/tests/formula_tester.cc @@ -37,9 +37,9 @@ FormulaParserTester::FormulaParserTester(): Tester() { } -QString FormulaParserTester::name() +TQString FormulaParserTester::name() { - return QString("Formula (Parser)"); + return TQString("Formula (Parser)"); } static char encodeTokenType( const Token& token ) @@ -59,9 +59,9 @@ static char encodeTokenType( const Token& token ) return result; } -static QString describeTokenCodes( const QString& tokenCodes ) +static TQString describeTokenCodes( const TQString& tokenCodes ) { - QString result; + TQString result; if( tokenCodes.isEmpty() ) result = "(invalid)"; @@ -86,24 +86,24 @@ static QString describeTokenCodes( const QString& tokenCodes ) } void FormulaParserTester::checkParse( const char *file, int line, const char* msg, - const QString& formula, const QString& tokenCodes ) + const TQString& formula, const TQString& tokenCodes ) { testCount++; Formula f; - QString expr = formula; + TQString expr = formula; expr.prepend( '=' ); f.setExpression( expr ); Tokens tokens = f.tokens(); - QString resultCodes; + TQString resultCodes; if( tokens.valid() ) for( unsigned i = 0; i < tokens.count(); i++ ) resultCodes.append( encodeTokenType( tokens[i] ) ); if( resultCodes != tokenCodes ) { - QString message = msg; + TQString message = msg; message.append( " Result: ").append( describeTokenCodes( resultCodes ) ); message.append( " Expected: ").append( describeTokenCodes( tokenCodes ) ); fail( file, line, message ); @@ -177,25 +177,25 @@ void FormulaParserTester::run() CHECK_PARSE( "SIN A1:A20", "xr" ); // invalid formulas, can't be parsed correctly - CHECK_PARSE( "+1.23E", QString::null ); + CHECK_PARSE( "+1.23E", TQString() ); } FormulaEvalTester::FormulaEvalTester(): Tester() { } -QString FormulaEvalTester::name() +TQString FormulaEvalTester::name() { - return QString("Formula (Eval)"); + return TQString("Formula (Eval)"); } void FormulaEvalTester::checkEval( const char *file, int line, const char* msg, - const QString& formula, const Value& expected ) + const TQString& formula, const Value& expected ) { testCount++; Formula f; - QString expr = formula; + TQString expr = formula; if ( expr[0] != '=' ) expr.prepend( '=' ); f.setExpression( expr ); @@ -203,8 +203,8 @@ void FormulaEvalTester::checkEval( const char *file, int line, const char* msg, if( !result.equal( expected ) ) { - QString message; - QTextStream ts( &message, IO_WriteOnly ); + TQString message; + TQTextStream ts( &message, IO_WriteOnly ); ts << msg; ts << " Result: " << result; ts << " Expected: " << expected; @@ -252,7 +252,7 @@ void FormulaEvalTester::run() CHECK_EVAL( "1.2--COS(0)", Value(2.2) ); CHECK_EVAL( "1.3---COS(0)", Value(0.3) ); - // no parentheses, checking operator precendences + // no tqparentheses, checking operator precendences CHECK_EVAL( "14+3*77", Value(245) ); CHECK_EVAL( "14-3*77", Value(-217) ); CHECK_EVAL( "26*4+81", Value(185) ); @@ -372,9 +372,9 @@ FormulaOasisConversionTester::FormulaOasisConversionTester(): Tester() { } -QString FormulaOasisConversionTester::name() +TQString FormulaOasisConversionTester::name() { - return QString("Formula (OpenDocument conversion)"); + return TQString("Formula (OpenDocument conversion)"); } void FormulaOasisConversionTester::run() @@ -410,7 +410,7 @@ void FormulaOasisConversionTester::run() } void FormulaOasisConversionTester::checkOasis( const char *file, int line, const char* /*msg*/, - const QString& localeFormula, const QString& oasisFormula ) + const TQString& localeFormula, const TQString& oasisFormula ) { testCount++; @@ -418,13 +418,13 @@ void FormulaOasisConversionTester::checkOasis( const char *file, int line, const locale.setDecimalSymbol(","); // KSpread -> OpenDocument - QString formula = localeFormula; + TQString formula = localeFormula; #if 0 Oasis::encodeFormula( formula, &locale ); if( formula != oasisFormula ) { - QString message = "[Locale->Oasis] "; + TQString message = "[Locale->Oasis] "; message.append( "\"" + localeFormula + "\"" ); message.append( " Result: ").append( formula ); message.append( " Expected: ").append( oasisFormula ); @@ -439,7 +439,7 @@ void FormulaOasisConversionTester::checkOasis( const char *file, int line, const if( formula != localeFormula ) { - QString message = "[Oasis->Locale] "; + TQString message = "[Oasis->Locale] "; message.append( "\"" + oasisFormula + "\"" ); message.append( " Result: ").append( formula ); message.append( " Expected: ").append( localeFormula ); -- cgit v1.2.1