summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg/tpoption.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-14 01:37:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-15 09:21:48 +0100
commit9124003eb1e398957a85c5c009ac5eddf5e6f28e (patch)
treed1348216600b18f3daa08224a4d4492b53337813 /sd/source/ui/dlg/tpoption.cxx
parenta6825d680c7f49dd462a858cc8691757a6dd4cba (diff)
ByteString::IsNumericAscii->comphelper::string::isAsciiDecimalString
shrink ByteString api, remove need for intermediate OString/ByteString with random-ish encoding solely for check
Diffstat (limited to 'sd/source/ui/dlg/tpoption.cxx')
-rw-r--r--sd/source/ui/dlg/tpoption.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 1ed3d3d9b8c7..f0f2fd2b1953 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include <sfx2/module.hxx>
#include <sfx2/app.hxx>
@@ -758,28 +759,25 @@ sal_Bool SdTpOptionsMisc::SetScale( const String& aScale, sal_Int32& rX, sal_Int
if( aScale.GetTokenCount( TOKEN ) != 2 )
return( sal_False );
- ByteString aTmp( aScale.GetToken( 0, TOKEN ), RTL_TEXTENCODING_ASCII_US );
- if( !aTmp.IsNumericAscii() )
- return( sal_False );
+ rtl::OUString aTmp(aScale.GetToken( 0, TOKEN ));
+ if (!comphelper::string::isAsciiDecimalString(aTmp))
+ return sal_False;
- rX = (long) aTmp.ToInt32();
+ rX = (long) aTmp.toInt32();
if( rX == 0 )
return( sal_False );
- aTmp = ByteString( aScale.GetToken( 1, TOKEN ), RTL_TEXTENCODING_ASCII_US );
- if( !aTmp.IsNumericAscii() )
- return( sal_False );
+ aTmp = aScale.GetToken( 1, TOKEN );
+ if (!comphelper::string::isAsciiDecimalString(aTmp))
+ return sal_False;
- rY = (long) aTmp.ToInt32();
+ rY = (long) aTmp.toInt32();
if( rY == 0 )
- return( sal_False );
+ return sal_False;
- return( sal_True );
+ return sal_True;
}
-
-
-
void SdTpOptionsMisc::UpdateCompatibilityControls (void)
{
// Disable the compatibility controls by default. Enable them only when