diff options
Diffstat (limited to 'kspread/kspread_value.cc')
-rw-r--r-- | kspread/kspread_value.cc | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kspread/kspread_value.cc b/kspread/kspread_value.cc index c8f739e6..898abd11 100644 --- a/kspread/kspread_value.cc +++ b/kspread/kspread_value.cc @@ -21,8 +21,8 @@ #include <kdebug.h> -#include <qstring.h> -#include <qtextstream.h> +#include <tqstring.h> +#include <tqtextstream.h> #include <float.h> #include <math.h> @@ -208,7 +208,7 @@ class KSpread::ValueData bool b; long i; double f; - QString* ps; + TQString* ps; ValueArray* pa; }; @@ -371,7 +371,7 @@ Value::Value( double f ) } // create a string value -Value::Value( const QString& s ) +Value::Value( const TQString& s ) { d = ValueData::null(); setValue( s ); @@ -381,25 +381,25 @@ Value::Value( const QString& s ) Value::Value (const char *s) { d = ValueData::null(); - setValue (QString (s)); + setValue (TQString (s)); } // create a floating-point value from date/time -Value::Value( const QDateTime& dt ) +Value::Value( const TQDateTime& dt ) { d = ValueData::null(); setValue( dt ); } // create a floating-point value from time -Value::Value( const QTime& dt ) +Value::Value( const TQTime& dt ) { d = ValueData::null(); setValue( dt ); } // create a floating-point value from date -Value::Value( const QDate& dt ) +Value::Value( const TQDate& dt ) { d = ValueData::null(); setValue( dt ); @@ -512,42 +512,42 @@ double Value::asFloat() const } // set the value as string -void Value::setValue( const QString& s ) +void Value::setValue( const TQString& s ) { detach(); d->type = String; - d->ps = new QString( s ); + d->ps = new TQString( s ); d->format = fmt_String; } // get the value as string -QString Value::asString() const +TQString Value::asString() const { - QString result; + TQString result; if( type() == Value::String ) if( d->ps ) - result = QString( *d->ps ); + result = TQString( *d->ps ); return result; } // set error message -void Value::setError( const QString& msg ) +void Value::setError( const TQString& msg ) { detach(); d->type = Error; - d->ps = new QString( msg ); + d->ps = new TQString( msg ); } // get error message -QString Value::errorMessage() const +TQString Value::errorMessage() const { - QString result; + TQString result; if( type() == Value::Error ) if( d->ps ) - result = QString( *d->ps ); + result = TQString( *d->ps ); return result; } @@ -555,11 +555,11 @@ QString Value::errorMessage() const // set the value as date/time // NOTE: date/time is stored as serial number // Day 61 means 1st of March, 1900 -void Value::setValue( const QDateTime& dt ) +void Value::setValue( const TQDateTime& dt ) { // reference is 31 Dec, 1899 midnight - QDate refDate( 1899, 12, 31 ); - QTime refTime( 0, 0 ); + TQDate refDate( 1899, 12, 31 ); + TQTime refTime( 0, 0 ); int i = refDate.daysTo( dt.date() ) + 1; i += refTime.secsTo( dt.time() ) / 86400; @@ -568,20 +568,20 @@ void Value::setValue( const QDateTime& dt ) d->format = fmt_DateTime; } -void Value::setValue( const QTime& time ) +void Value::setValue( const TQTime& time ) { // reference time is midnight - QTime refTime( 0, 0 ); + TQTime refTime( 0, 0 ); int i = refTime.msecsTo( time ) /* / 86400000 */; setValue( i ); d->format = fmt_Time; } -void Value::setValue( const QDate& date ) +void Value::setValue( const TQDate& date ) { // reference date is 31 Dec, 1899 - QDate refDate = QDate( 1899, 12, 31 ); + TQDate refDate = TQDate( 1899, 12, 31 ); int i = refDate.daysTo( date ) + 1; setValue( i ); @@ -589,15 +589,15 @@ void Value::setValue( const QDate& date ) } // get the value as date/time -QDateTime Value::asDateTime() const +TQDateTime Value::asDateTime() const { - return QDateTime( asDate(), asTime() ); + return TQDateTime( asDate(), asTime() ); } // get the value as date -QDate Value::asDate() const +TQDate Value::asDate() const { - QDate dt( 1899, 12, 30 ); + TQDate dt( 1899, 12, 30 ); int i = asInteger(); dt = dt.addDays( i ); @@ -606,9 +606,9 @@ QDate Value::asDate() const } // get the value as time -QTime Value::asTime() const +TQTime Value::asTime() const { - QTime dt; + TQTime dt; int i = asInteger(); dt = dt.addMSecs(i) /*( f * 86400 * 1000 )*/; @@ -734,9 +734,9 @@ void Value::detach() case Boolean: n->b = d->b; break; case Integer: n->i = d->i; break; case Float: n->f = d->f; break; - case String: n->ps = new QString( *d->ps ); break; + case String: n->ps = new TQString( *d->ps ); break; case Array: n->pa = new ValueArray; *n->pa = (*d->pa); break; - case Error: n->ps = new QString( *d->ps ); break; + case Error: n->ps = new TQString( *d->ps ); break; default: break; } @@ -924,7 +924,7 @@ bool Value::greater( const Value& v ) const return compare( v ) > 0; } -QTextStream& operator<<( QTextStream& ts, Value::Type type ) +TQTextStream& operator<<( TQTextStream& ts, Value::Type type ) { switch( type ) { @@ -940,7 +940,7 @@ QTextStream& operator<<( QTextStream& ts, Value::Type type ) return ts; } -QTextStream& operator<<( QTextStream& ts, Value value ) +TQTextStream& operator<<( TQTextStream& ts, Value value ) { ts << value.type(); switch( value.type() ) |