diff options
Diffstat (limited to 'kexi/3rdparty/kolibs/koUnit.cc')
-rw-r--r-- | kexi/3rdparty/kolibs/koUnit.cc | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kexi/3rdparty/kolibs/koUnit.cc b/kexi/3rdparty/kolibs/koUnit.cc index 6c19a29f..bd10e26e 100644 --- a/kexi/3rdparty/kolibs/koUnit.cc +++ b/kexi/3rdparty/kolibs/koUnit.cc @@ -28,12 +28,12 @@ #include <kglobal.h> #include <kdebug.h> -#include <qregexp.h> -#include <qdom.h> +#include <tqregexp.h> +#include <tqdom.h> -QStringList KoUnit::listOfUnitName() +TQStringList KoUnit::listOfUnitName() { - QStringList lst; + TQStringList lst; for ( uint i = 0 ; i <= KoUnit::U_LASTUNIT ; ++i ) { KoUnit::Unit unit = static_cast<KoUnit::Unit>( i ); @@ -42,7 +42,7 @@ QStringList KoUnit::listOfUnitName() return lst; } -QString KoUnit::unitDescription( Unit _unit ) +TQString KoUnit::unitDescription( Unit _unit ) { switch ( _unit ) { @@ -114,7 +114,7 @@ double KoUnit::ptToUnit( const double ptValue, const Unit unit ) } } -QString KoUnit::toUserStringValue( double ptValue, Unit unit ) +TQString KoUnit::toUserStringValue( double ptValue, Unit unit ) { return KGlobal::locale()->formatNumber( toUserValue( ptValue, unit ) ); } @@ -142,12 +142,12 @@ double KoUnit::fromUserValue( double value, Unit unit ) } } -double KoUnit::fromUserValue( const QString& value, Unit unit, bool* ok ) +double KoUnit::fromUserValue( const TQString& value, Unit unit, bool* ok ) { return fromUserValue( KGlobal::locale()->readNumber( value, ok ), unit ); } -double KoUnit::parseValue( QString value, double defaultVal ) +double KoUnit::parseValue( TQString value, double defaultVal ) { value.simplifyWhiteSpace(); value.remove( ' ' ); @@ -155,11 +155,11 @@ double KoUnit::parseValue( QString value, double defaultVal ) if( value.isEmpty() ) return defaultVal; - int index = value.find( QRegExp( "[a-z]+$" ) ); + int index = value.tqfind( TQRegExp( "[a-z]+$" ) ); if ( index == -1 ) return value.toDouble(); - QString unit = value.mid( index ); + TQString unit = value.mid( index ); value.truncate ( index ); double val = value.toDouble(); @@ -181,34 +181,34 @@ double KoUnit::parseValue( QString value, double defaultVal ) return defaultVal; } -KoUnit::Unit KoUnit::unit( const QString &_unitName, bool* ok ) +KoUnit::Unit KoUnit::unit( const TQString &_unitName, bool* ok ) { if ( ok ) *ok = true; - if ( _unitName == QString::fromLatin1( "mm" ) ) return U_MM; - if ( _unitName == QString::fromLatin1( "cm" ) ) return U_CM; - if ( _unitName == QString::fromLatin1( "dm" ) ) return U_DM; - if ( _unitName == QString::fromLatin1( "in" ) - || _unitName == QString::fromLatin1("inch") /*compat*/ ) return U_INCH; - if ( _unitName == QString::fromLatin1( "pi" ) ) return U_PI; - if ( _unitName == QString::fromLatin1( "dd" ) ) return U_DD; - if ( _unitName == QString::fromLatin1( "cc" ) ) return U_CC; - if ( _unitName == QString::fromLatin1( "pt" ) ) return U_PT; + if ( _unitName == TQString::tqfromLatin1( "mm" ) ) return U_MM; + if ( _unitName == TQString::tqfromLatin1( "cm" ) ) return U_CM; + if ( _unitName == TQString::tqfromLatin1( "dm" ) ) return U_DM; + if ( _unitName == TQString::tqfromLatin1( "in" ) + || _unitName == TQString::tqfromLatin1("inch") /*compat*/ ) return U_INCH; + if ( _unitName == TQString::tqfromLatin1( "pi" ) ) return U_PI; + if ( _unitName == TQString::tqfromLatin1( "dd" ) ) return U_DD; + if ( _unitName == TQString::tqfromLatin1( "cc" ) ) return U_CC; + if ( _unitName == TQString::tqfromLatin1( "pt" ) ) return U_PT; if ( ok ) *ok = false; return U_PT; } -QString KoUnit::unitName( Unit _unit ) +TQString KoUnit::unitName( Unit _unit ) { - if ( _unit == U_MM ) return QString::fromLatin1( "mm" ); - if ( _unit == U_CM ) return QString::fromLatin1( "cm" ); - if ( _unit == U_DM ) return QString::fromLatin1( "dm" ); - if ( _unit == U_INCH ) return QString::fromLatin1( "in" ); - if ( _unit == U_PI ) return QString::fromLatin1( "pi" ); - if ( _unit == U_DD ) return QString::fromLatin1( "dd" ); - if ( _unit == U_CC ) return QString::fromLatin1( "cc" ); - return QString::fromLatin1( "pt" ); + if ( _unit == U_MM ) return TQString::tqfromLatin1( "mm" ); + if ( _unit == U_CM ) return TQString::tqfromLatin1( "cm" ); + if ( _unit == U_DM ) return TQString::tqfromLatin1( "dm" ); + if ( _unit == U_INCH ) return TQString::tqfromLatin1( "in" ); + if ( _unit == U_PI ) return TQString::tqfromLatin1( "pi" ); + if ( _unit == U_DD ) return TQString::tqfromLatin1( "dd" ); + if ( _unit == U_CC ) return TQString::tqfromLatin1( "cc" ); + return TQString::tqfromLatin1( "pt" ); } #ifndef SIMPLE_KOLIBS |