convert sw/inc/calc.hxx from String to OUString

Change-Id: Ifff5ef5243b54905cf6d03ea675f3a7f23c84c85
This commit is contained in:
Noel Grandin 2013-10-11 10:57:38 +02:00
parent 9eace9e083
commit f94b7f6507
2 changed files with 33 additions and 33 deletions

View file

@ -168,7 +168,7 @@ _CalcOp* FindOperator( const OUString& rSearch );
class SwCalc
{
SwHash* VarTable[ TBLSZ ];
String aVarName, sCurrSym;
OUString aVarName, sCurrSym;
OUString sCommand;
std::vector<const SwUserFieldType*> aRekurStk;
SwSbxValue nLastLeft;
@ -194,8 +194,8 @@ class SwCalc
sal_Bool ParseTime( sal_uInt16*, sal_uInt16*, sal_uInt16* );
String GetColumnName( const String& rName );
String GetDBName( const String& rName );
OUString GetColumnName( const OUString& rName );
OUString GetDBName( const OUString& rName );
// dont call this methods
SwCalc( const SwCalc& );
@ -205,14 +205,14 @@ public:
SwCalc( SwDoc& rD );
~SwCalc();
SwSbxValue Calculate( const String &rStr );
String GetStrResult( const SwSbxValue& rValue, sal_Bool bRound = sal_True );
String GetStrResult( double, sal_Bool bRound = sal_True );
SwSbxValue Calculate( const OUString &rStr );
OUString GetStrResult( const SwSbxValue& rValue, sal_Bool bRound = sal_True );
OUString GetStrResult( double, sal_Bool bRound = sal_True );
SwCalcExp* VarInsert( const String& r );
SwCalcExp* VarLook( const String &rStr, sal_uInt16 ins = 0 );
void VarChange( const String& rStr, const SwSbxValue& rValue );
void VarChange( const String& rStr, double );
SwCalcExp* VarInsert( const OUString& r );
SwCalcExp* VarLook( const OUString &rStr, sal_uInt16 ins = 0 );
void VarChange( const OUString& rStr, const SwSbxValue& rValue );
void VarChange( const OUString& rStr, double );
SwHash** GetVarTable() { return VarTable; }
bool Push(const SwUserFieldType* pUserFieldType);

View file

@ -372,12 +372,12 @@ SwCalc::~SwCalc()
delete pCharClass;
}
SwSbxValue SwCalc::Calculate( const String& rStr )
SwSbxValue SwCalc::Calculate( const OUString& rStr )
{
eError = CALC_NOERR;
SwSbxValue nResult;
if( !rStr.Len() )
if( rStr.isEmpty() )
return nResult;
nListPor = 0;
@ -405,7 +405,7 @@ SwSbxValue SwCalc::Calculate( const String& rStr )
Now this parameter is ignored.
@return ???
*/
String SwCalc::GetStrResult( const SwSbxValue& rVal, sal_Bool bRound )
OUString SwCalc::GetStrResult( const SwSbxValue& rVal, sal_Bool bRound )
{
if( !rVal.IsDouble() )
{
@ -414,7 +414,7 @@ String SwCalc::GetStrResult( const SwSbxValue& rVal, sal_Bool bRound )
return GetStrResult( rVal.GetDouble(), bRound );
}
String SwCalc::GetStrResult( double nValue, sal_Bool )
OUString SwCalc::GetStrResult( double nValue, sal_Bool )
{
if( nValue >= DBL_MAX )
switch( eError )
@ -430,7 +430,7 @@ String SwCalc::GetStrResult( double nValue, sal_Bool )
}
sal_uInt16 nDec = 15;
String aRetStr( ::rtl::math::doubleToUString(
OUString aRetStr( ::rtl::math::doubleToUString(
nValue,
rtl_math_StringFormat_Automatic,
nDec,
@ -439,13 +439,13 @@ String SwCalc::GetStrResult( double nValue, sal_Bool )
return aRetStr;
}
SwCalcExp* SwCalc::VarInsert( const String &rStr )
SwCalcExp* SwCalc::VarInsert( const OUString &rStr )
{
OUString aStr = pCharClass->lowercase( rStr );
return VarLook( aStr, 1 );
}
SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins )
{
aErrExpr.nValue.SetVoidValue(false);
@ -598,13 +598,13 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
return pNewExp;
}
void SwCalc::VarChange( const String& rStr, double nValue )
void SwCalc::VarChange( const OUString& rStr, double nValue )
{
SwSbxValue aVal( nValue );
VarChange( rStr, aVal );
}
void SwCalc::VarChange( const String& rStr, const SwSbxValue& rValue )
void SwCalc::VarChange( const OUString& rStr, const SwSbxValue& rValue )
{
OUString aStr = pCharClass->lowercase( rStr );
@ -774,9 +774,9 @@ SwCalcOper SwCalc::GetToken()
case '[':
if( aRes.EndPos < sCommand.getLength() )
{
aVarName.Erase();
aVarName = "";
sal_Int32 nFndPos = aRes.EndPos,
nSttPos = nFndPos;
nSttPos = nFndPos;
do {
if( -1 != ( nFndPos =
@ -1458,28 +1458,28 @@ SwSbxValue SwCalc::Expr()
}
}
String SwCalc::GetColumnName(const String& rName)
OUString SwCalc::GetColumnName(const OUString& rName)
{
xub_StrLen nPos = rName.Search(DB_DELIM);
if( STRING_NOTFOUND != nPos )
sal_Int32 nPos = rName.indexOf(DB_DELIM);
if( -1 != nPos )
{
nPos = rName.Search(DB_DELIM, nPos + 1);
nPos = rName.indexOf(DB_DELIM, nPos + 1);
if( STRING_NOTFOUND != nPos )
return rName.Copy(nPos + 1);
if( -1 != nPos )
return rName.copy(nPos + 1);
}
return rName;
}
String SwCalc::GetDBName(const String& rName)
OUString SwCalc::GetDBName(const OUString& rName)
{
xub_StrLen nPos = rName.Search(DB_DELIM);
if( STRING_NOTFOUND != nPos )
sal_Int32 nPos = rName.indexOf(DB_DELIM);
if( -1 != nPos )
{
nPos = rName.Search(DB_DELIM, nPos + 1);
nPos = rName.indexOf(DB_DELIM, nPos + 1);
if( STRING_NOTFOUND != nPos )
return rName.Copy( 0, nPos );
if( -1 != nPos )
return rName.copy( 0, nPos );
}
SwDBData aData = rDoc.GetDBData();
String sRet = aData.sDataSource;