diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-14 01:37:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-15 09:21:48 +0100 |
commit | 9124003eb1e398957a85c5c009ac5eddf5e6f28e (patch) | |
tree | d1348216600b18f3daa08224a4d4492b53337813 /sd | |
parent | a6825d680c7f49dd462a858cc8691757a6dd4cba (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')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 24 |
2 files changed, 14 insertions, 15 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index bae84f0f735b..0e4dab8fab85 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -102,6 +102,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/componentcontext.hxx> +#include <comphelper/string.hxx> using namespace ::com::sun::star; @@ -445,7 +446,7 @@ sal_Bool ImplSdPPTImport::Import() // first pass, searching for a SlideId for( nToken = 0; nToken < nTokenCount; nToken++ ) { - if ( aStringAry[ nToken ].IsNumericAscii() ) + if (comphelper::string::isAsciiDecimalString(aStringAry[nToken])) { sal_Int32 nNumber = aStringAry[ nToken ].ToInt32(); if ( nNumber & ~0xff ) @@ -483,7 +484,7 @@ sal_Bool ImplSdPPTImport::Import() { // third pass, searching for a slide number for ( nToken = 0; nToken < nTokenCount; nToken++ ) { - if ( aStringAry[ nToken ].IsNumericAscii() ) + if (comphelper::string::isAsciiDecimalString(aStringAry[nToken])) { sal_Int32 nNumber = aStringAry[ nToken ].ToInt32(); if ( ( nNumber & ~0xff ) == 0 ) 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 |