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 /cui | |
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 'cui')
-rw-r--r-- | cui/source/options/optinet2.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index cb093d415442..4b80409e2f36 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -93,6 +93,7 @@ #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include "com/sun/star/task/XMasterPasswordHandling2.hpp" @@ -164,7 +165,7 @@ void SvxNoSpaceEdit::Modify() { XubString aValue = GetText(); - if ( !ByteString(::rtl::OUStringToOString(aValue,RTL_TEXTENCODING_UTF8)).IsNumericAscii() || (long)aValue.ToInt32() > USHRT_MAX ) + if ( !comphelper::string::isAsciiDecimalString(aValue) || (long)aValue.ToInt32() > USHRT_MAX ) // der H�chstwert einer Portnummer ist USHRT_MAX ErrorBox( this, CUI_RES( RID_SVXERR_OPT_PROXYPORTS ) ).Execute(); } @@ -628,7 +629,7 @@ IMPL_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit *, pEdit ) { XubString aValue = pEdit->GetText(); - if ( !ByteString(::rtl::OUStringToOString(aValue,RTL_TEXTENCODING_UTF8)).IsNumericAscii() || (long)aValue.ToInt32() > USHRT_MAX ) + if ( !comphelper::string::isAsciiDecimalString(aValue) || (long)aValue.ToInt32() > USHRT_MAX ) pEdit->SetText( '0' ); return 0; } |