summaryrefslogtreecommitdiff
path: root/sc/source/ui/cctrl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-23 22:17:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-23 23:16:45 +0000
commit709c1f365b3bdd0d46ec4f1ddc244580a0dfa637 (patch)
tree63668e23e125bf3fd1921f906cc269ed6ece8f38 /sc/source/ui/cctrl
parent868bd3b778b6c7b970c67d1dacc469967f69e551 (diff)
remove various EraseLeadingAndTrailingChars
Diffstat (limited to 'sc/source/ui/cctrl')
-rw-r--r--sc/source/ui/cctrl/editfield.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx
index d52ccefea685..78597121de7d 100644
--- a/sc/source/ui/cctrl/editfield.cxx
+++ b/sc/source/ui/cctrl/editfield.cxx
@@ -33,6 +33,7 @@
#undef SC_DLLIMPLEMENTATION
#endif
#include "editfield.hxx"
+#include <comphelper/string.hxx>
#include <rtl/math.hxx>
#include <unotools/localedatawrapper.hxx>
#include "global.hxx"
@@ -62,15 +63,14 @@ ScDoubleField::ScDoubleField( Window* pParent, const ResId& rResId ) :
bool ScDoubleField::GetValue( double& rfValue ) const
{
- String aStr( GetText() );
- aStr.EraseLeadingAndTrailingChars( ' ' );
- bool bOk = aStr.Len() > 0;
+ rtl::OUString aStr(comphelper::string::strip(GetText(), ' '));
+ bool bOk = aStr.getLength() > 0;
if( bOk )
{
rtl_math_ConversionStatus eStatus;
sal_Int32 nEnd;
rfValue = rtl::math::stringToDouble( aStr, lclGetDecSep(), lclGetGroupSep(), &eStatus, &nEnd );
- bOk = (eStatus == rtl_math_ConversionStatus_Ok) && (nEnd == static_cast< sal_Int32 >( aStr.Len() ));
+ bOk = (eStatus == rtl_math_ConversionStatus_Ok) && (nEnd == aStr.getLength() );
}
return bOk;
}