diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-10-23 23:04:35 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-03 20:24:27 -0500 |
commit | 8ce4050497566182a0d9620e85cb28b5b13df67d (patch) | |
tree | 7455d5f67d7dfb4c1ce2a4c1ab62e8c9b27688bf /basic | |
parent | basic: use OUString in DimAsNewRecoverItem (diff) | |
download | core-8ce4050497566182a0d9620e85cb28b5b13df67d.tar.gz core-8ce4050497566182a0d9620e85cb28b5b13df67d.zip |
simplify and use OUString for StepLOADNC
Change-Id: I92c86f672cc79506c2c7c56bb3402b4436f71c98
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/step1.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx index 9ca79d019ac0..b5dbc3310084 100644 --- a/basic/source/runtime/step1.cxx +++ b/basic/source/runtime/step1.cxx @@ -39,16 +39,12 @@ void SbiRuntime::StepLOADNC( sal_uInt32 nOp1 ) SbxVariable* p = new SbxVariable( SbxDOUBLE ); // #57844 use localized function - String aStr = pImg->GetString( static_cast<short>( nOp1 ) ); + OUString aStr = pImg->GetString( static_cast<short>( nOp1 ) ); // also allow , !!! - sal_uInt16 iComma = aStr.Search( ',' ); - if( iComma != STRING_NOTFOUND ) + sal_Int32 iComma = aStr.indexOf((sal_Unicode)','); + if( iComma >= 0 ) { - String aStr1 = aStr.Copy( 0, iComma ); - String aStr2 = aStr.Copy( iComma + 1 ); - aStr = aStr1; - aStr += '.'; - aStr += aStr2; + aStr = aStr.replaceAt(iComma, 1, OUString(".")); } double n = ::rtl::math::stringToDouble( aStr, '.', ',', NULL, NULL ); |