sc: replace IsAssciiDigit and IsAsciiAlpha with rtl equivalents
Change-Id: I81537e2c3c9b7f3828c080fcc1a7ebc98ef2fde9 Reviewed-on: https://gerrit.libreoffice.org/27748 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
069d71b725
commit
dadb28a2fb
@@ -461,16 +461,6 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
inline bool IsAsciiDigit( sal_Unicode c )
|
|
||||||
{
|
|
||||||
return 0x30 <= c && c <= 0x39;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool IsAsciiAlpha( sal_Unicode c )
|
|
||||||
{
|
|
||||||
return (0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a);
|
|
||||||
}
|
|
||||||
|
|
||||||
void lcl_GetColumnTypes(
|
void lcl_GetColumnTypes(
|
||||||
ScDocShell& rDocShell, const ScRange& rDataRange, bool bHasFieldNames,
|
ScDocShell& rDocShell, const ScRange& rDataRange, bool bHasFieldNames,
|
||||||
OUString* pColNames, sal_Int32* pColTypes, sal_Int32* pColLengths,
|
OUString* pColNames, sal_Int32* pColTypes, sal_Int32* pColLengths,
|
||||||
@@ -567,13 +557,13 @@ void lcl_GetColumnTypes(
|
|||||||
// "_DBASELOCK" is reserved (obsolete because first character is
|
// "_DBASELOCK" is reserved (obsolete because first character is
|
||||||
// not alphabetical).
|
// not alphabetical).
|
||||||
// No duplicated names.
|
// No duplicated names.
|
||||||
if ( !IsAsciiAlpha( aFieldName[0] ) )
|
if ( !rtl::isAsciiAlpha(aFieldName[0]) )
|
||||||
aFieldName = "N" + aFieldName;
|
aFieldName = "N" + aFieldName;
|
||||||
OUString aTmpStr;
|
OUString aTmpStr;
|
||||||
sal_Unicode c;
|
sal_Unicode c;
|
||||||
for ( const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ )
|
for ( const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ )
|
||||||
{
|
{
|
||||||
if ( IsAsciiAlpha( c ) || IsAsciiDigit( c ) || c == '_' )
|
if ( rtl::isAsciiAlpha(c) || rtl::isAsciiDigit(c) || c == '_' )
|
||||||
aTmpStr += OUString(c);
|
aTmpStr += OUString(c);
|
||||||
else
|
else
|
||||||
aTmpStr += "_";
|
aTmpStr += "_";
|
||||||
|
Reference in New Issue
Block a user