diff options
Diffstat (limited to 'dbaccess/source/ui/control/SqlNameEdit.cxx')
-rw-r--r-- | dbaccess/source/ui/control/SqlNameEdit.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx index 89c0afc0bda1..9ac58cfda851 100644 --- a/dbaccess/source/ui/control/SqlNameEdit.cxx +++ b/dbaccess/source/ui/control/SqlNameEdit.cxx @@ -21,33 +21,33 @@ namespace dbaui { - static bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, const OUString& _sAllowedChars) + static bool isCharOk(sal_Unicode _cChar,bool _bFirstChar, std::u16string_view _sAllowedChars) { return ( (_cChar >= 'A' && _cChar <= 'Z') || _cChar == '_' || - _sAllowedChars.indexOf(_cChar) != -1 || + _sAllowedChars.find(_cChar) != std::u16string_view::npos || (!_bFirstChar && (_cChar >= '0' && _cChar <= '9')) || (_cChar >= 'a' && _cChar <= 'z') ); } - bool OSQLNameChecker::checkString(const OUString& _sToCheck, + bool OSQLNameChecker::checkString(std::u16string_view _sToCheck, OUString& _rsCorrected) { bool bCorrected = false; if ( m_bCheck ) { sal_Int32 nMatch = 0; - for (sal_Int32 i = nMatch; i < _sToCheck.getLength(); ++i) + for (size_t i = nMatch; i < _sToCheck.size(); ++i) { if ( !isCharOk( _sToCheck[i], i == 0, m_sAllowedChars ) ) { - _rsCorrected += _sToCheck.subView(nMatch, i - nMatch); + _rsCorrected += _sToCheck.substr(nMatch, i - nMatch); bCorrected = true; nMatch = i + 1; } } - _rsCorrected += _sToCheck.subView( nMatch ); + _rsCorrected += _sToCheck.substr( nMatch ); } return bCorrected; } |