summaryrefslogtreecommitdiffstats
path: root/kspread/kspread_functions_engineering.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kspread/kspread_functions_engineering.cc')
-rw-r--r--kspread/kspread_functions_engineering.cc70
1 files changed, 35 insertions, 35 deletions
diff --git a/kspread/kspread_functions_engineering.cc b/kspread/kspread_functions_engineering.cc
index 8e2a47d9..8ae0bf2f 100644
--- a/kspread/kspread_functions_engineering.cc
+++ b/kspread/kspread_functions_engineering.cc
@@ -307,7 +307,7 @@ Value func_hex2oct (valVector args, ValueCalc *calc, FuncExtra *)
// example: "kPa" will return 1e3 and change unit into "Pa"
static double kspread_convert_prefix( TQMap<TQString,double> map, TQString& unit )
{
- if( map.tqcontains( unit ) )
+ if( map.contains( unit ) )
return 1.0;
// initialize prefix mapping if necessary
@@ -334,7 +334,7 @@ static double kspread_convert_prefix( TQMap<TQString,double> map, TQString& unit
// check for possible prefix
char prefix = unit[0].latin1();
- if( prefixMap.tqcontains( prefix ) )
+ if( prefixMap.contains( prefix ) )
{
unit.remove( 0, 1 );
return prefixMap[ prefix ];
@@ -372,8 +372,8 @@ static bool kspread_convert_mass( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( massMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !massMap.tqcontains( fromU ) ) return false;
- if( !massMap.tqcontains( toU ) ) return false;
+ if( !massMap.contains( fromU ) ) return false;
+ if( !massMap.contains( toU ) ) return false;
result = value * fromPrefix * massMap[toU] / (massMap[fromU] * toPrefix);
@@ -406,8 +406,8 @@ static bool kspread_convert_distance( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( distanceMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !distanceMap.tqcontains( fromU ) ) return false;
- if( !distanceMap.tqcontains( toU ) ) return false;
+ if( !distanceMap.contains( fromU ) ) return false;
+ if( !distanceMap.contains( toU ) ) return false;
result = value * fromPrefix * distanceMap[toU] / (distanceMap[fromU] * toPrefix);
@@ -435,8 +435,8 @@ static bool kspread_convert_pressure( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( pressureMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !pressureMap.tqcontains( fromU ) ) return false;
- if( !pressureMap.tqcontains( toU ) ) return false;
+ if( !pressureMap.contains( fromU ) ) return false;
+ if( !pressureMap.contains( toU ) ) return false;
result = value * fromPrefix * pressureMap[toU] / (pressureMap[fromU] * toPrefix);
@@ -462,8 +462,8 @@ static bool kspread_convert_force( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( forceMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !forceMap.tqcontains( fromU ) ) return false;
- if( !forceMap.tqcontains( toU ) ) return false;
+ if( !forceMap.contains( fromU ) ) return false;
+ if( !forceMap.contains( toU ) ) return false;
result = value * fromPrefix * forceMap[toU] / (forceMap[fromU] * toPrefix);
@@ -495,8 +495,8 @@ static bool kspread_convert_energy( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( energyMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !energyMap.tqcontains( fromU ) ) return false;
- if( !energyMap.tqcontains( toU ) ) return false;
+ if( !energyMap.contains( fromU ) ) return false;
+ if( !energyMap.contains( toU ) ) return false;
result = value * fromPrefix * energyMap[toU] / (energyMap[fromU] * toPrefix);
@@ -522,8 +522,8 @@ static bool kspread_convert_power( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( powerMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !powerMap.tqcontains( fromU ) ) return false;
- if( !powerMap.tqcontains( toU ) ) return false;
+ if( !powerMap.contains( fromU ) ) return false;
+ if( !powerMap.contains( toU ) ) return false;
result = value * fromPrefix * powerMap[toU] / (powerMap[fromU] * toPrefix);
@@ -548,8 +548,8 @@ static bool kspread_convert_magnetism( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( magnetismMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !magnetismMap.tqcontains( fromU ) ) return false;
- if( !magnetismMap.tqcontains( toU ) ) return false;
+ if( !magnetismMap.contains( fromU ) ) return false;
+ if( !magnetismMap.contains( toU ) ) return false;
result = value * fromPrefix * magnetismMap[toU] / (magnetismMap[fromU] * toPrefix);
@@ -570,10 +570,10 @@ static bool kspread_convert_temperature( const TQString& fromUnit,
tempFactorMap[ "K" ] = 1.0; tempOffsetMap[ "K" ] = -273.15;
}
- if( !tempFactorMap.tqcontains( fromUnit ) ) return false;
- if( !tempOffsetMap.tqcontains( fromUnit ) ) return false;
- if( !tempFactorMap.tqcontains( toUnit ) ) return false;
- if( !tempOffsetMap.tqcontains( toUnit ) ) return false;
+ if( !tempFactorMap.contains( fromUnit ) ) return false;
+ if( !tempOffsetMap.contains( fromUnit ) ) return false;
+ if( !tempFactorMap.contains( toUnit ) ) return false;
+ if( !tempOffsetMap.contains( toUnit ) ) return false;
result = ( value + tempOffsetMap[ fromUnit ] )* tempFactorMap[ fromUnit ];
result = ( result / tempFactorMap[ toUnit ] ) - tempOffsetMap[ toUnit ];
@@ -612,8 +612,8 @@ static bool kspread_convert_volume( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( volumeMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !volumeMap.tqcontains( fromU ) ) return false;
- if( !volumeMap.tqcontains( toU ) ) return false;
+ if( !volumeMap.contains( fromU ) ) return false;
+ if( !volumeMap.contains( toU ) ) return false;
result = value * fromPrefix * volumeMap[toU] / (volumeMap[fromU] * toPrefix);
@@ -644,8 +644,8 @@ static bool kspread_convert_area( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( areaMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !areaMap.tqcontains( fromU ) ) return false;
- if( !areaMap.tqcontains( toU ) ) return false;
+ if( !areaMap.contains( fromU ) ) return false;
+ if( !areaMap.contains( toU ) ) return false;
result = value * fromPrefix * areaMap[toU] / (areaMap[fromU] * toPrefix);
@@ -672,8 +672,8 @@ static bool kspread_convert_speed( const TQString& fromUnit,
double toPrefix = kspread_convert_prefix( speedMap, toU );
if( fromPrefix == 0.0 ) return false;
if( toPrefix == 0.0 ) return false;
- if( !speedMap.tqcontains( fromU ) ) return false;
- if( !speedMap.tqcontains( toU ) ) return false;
+ if( !speedMap.contains( fromU ) ) return false;
+ if( !speedMap.contains( toU ) ) return false;
result = value * fromPrefix * speedMap[toU] / (speedMap[fromU] * toPrefix);
@@ -751,7 +751,7 @@ Value func_complex (valVector args, ValueCalc *calc, FuncExtra *)
static double imag_complexe(TQString str, bool &ok)
{
TQString tmp=str;
-if(tmp.tqfind('i')==-1)
+if(tmp.find('i')==-1)
{ //not a complex
ok=true;
return 0;
@@ -766,12 +766,12 @@ else if( tmp.length()==2 )
{
//-i,+i,
int pos1;
- if((pos1=tmp.tqfind('+'))!=-1&& pos1==0)
+ if((pos1=tmp.find('+'))!=-1&& pos1==0)
{
ok=true;
return 1;
}
- else if( (pos1=tmp.tqfind('-'))!=-1 && pos1==0 )
+ else if( (pos1=tmp.find('-'))!=-1 && pos1==0 )
{
ok=true;
return -1;
@@ -790,12 +790,12 @@ else if( tmp.length()==2 )
else
{//12+12i
int pos1,pos2;
- if((pos1=tmp.tqfind('i'))!=-1)
+ if((pos1=tmp.find('i'))!=-1)
{
double val;
TQString tmpStr;
- if((pos2=tmp.tqfindRev('+'))!=-1 && pos2!=0)
+ if((pos2=tmp.findRev('+'))!=-1 && pos2!=0)
{
if((pos1-pos2)==1)
{
@@ -811,7 +811,7 @@ else
return val;
}
}
- else if( (pos2=tmp.tqfindRev('-'))!=-1&& pos2!=0)
+ else if( (pos2=tmp.findRev('-'))!=-1&& pos2!=0)
{
if((pos1-pos2)==1)
{
@@ -859,7 +859,7 @@ double val;
int pos1,pos2;
TQString tmp=str;
TQString tmpStr;
-if((pos1=tmp.tqfind('i'))==-1)
+if((pos1=tmp.find('i'))==-1)
{ //12.5
val=KGlobal::locale()->readNumber(tmp, &ok);
if(!ok)
@@ -868,7 +868,7 @@ if((pos1=tmp.tqfind('i'))==-1)
}
else
{ //15-xi
- if((pos2=tmp.tqfindRev('-'))!=-1 && pos2!=0)
+ if((pos2=tmp.findRev('-'))!=-1 && pos2!=0)
{
tmpStr=tmp.left(pos2);
val=KGlobal::locale()->readNumber(tmpStr, &ok);
@@ -876,7 +876,7 @@ else
val=0;
return val;
} //15+xi
- else if((pos2=tmp.tqfindRev('+'))!=-1)
+ else if((pos2=tmp.findRev('+'))!=-1)
{
tmpStr=tmp.left(pos2);
val=KGlobal::locale()->readNumber(tmpStr, &ok);