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 --- lib/kofficecore/KoUnit.cpp | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'lib/kofficecore/KoUnit.cpp') diff --git a/lib/kofficecore/KoUnit.cpp b/lib/kofficecore/KoUnit.cpp index fc459c511..51c634992 100644 --- a/lib/kofficecore/KoUnit.cpp +++ b/lib/kofficecore/KoUnit.cpp @@ -26,12 +26,12 @@ #include #include -#include -#include +#include +#include -QStringList KoUnit::listOfUnitName() +TQStringList KoUnit::listOfUnitName() { - QStringList lst; + TQStringList lst; for ( uint i = 0 ; i <= KoUnit::U_LASTUNIT ; ++i ) { KoUnit::Unit unit = static_cast( i ); @@ -40,7 +40,7 @@ QStringList KoUnit::listOfUnitName() return lst; } -QString KoUnit::unitDescription( Unit _unit ) +TQString KoUnit::unitDescription( Unit _unit ) { switch ( _unit ) { @@ -112,7 +112,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 ) ); } @@ -140,12 +140,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( ' ' ); @@ -153,11 +153,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(); @@ -179,34 +179,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" ); } void KoUnit::saveOasis(KoXmlWriter* settingsWriter, Unit _unit) -- cgit v1.2.3