summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools/CommonTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/commontools/CommonTools.cxx')
-rw-r--r--connectivity/source/commontools/CommonTools.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 223129a71e92..596be7097d45 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -29,7 +29,7 @@
#include <osl/diagnose.h>
#include <rtl/character.hxx>
#include <rtl/process.h>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
using namespace ::comphelper;
static sal_Unicode rtl_ascii_toUpperCase( sal_Unicode ch )
@@ -120,10 +120,10 @@ namespace connectivity
{
Reference< XJavaVM > xVM = JavaVirtualMachine::create(_rxContext);
- Sequence<sal_Int8> processID(16);
- rtl_getGlobalProcessId( reinterpret_cast<sal_uInt8*>(processID.getArray()) );
- processID.realloc(17);
- processID[16] = 0;
+ Sequence<sal_Int8> processID(17); // 16 + 1
+ auto pprocessID = processID.getArray();
+ rtl_getGlobalProcessId( reinterpret_cast<sal_uInt8*>(pprocessID) );
+ pprocessID[16] = 0; // RETURN_VIRTUALMACHINE
Any uaJVM = xVM->getJavaVM( processID );
sal_Int64 nTemp;
@@ -165,15 +165,15 @@ namespace connectivity
namespace dbtools
{
-static bool isCharOk(sal_Unicode c,const OUString& _rSpecials)
+static bool isCharOk(sal_Unicode c, std::u16string_view _rSpecials)
{
return ( ((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90)) || ((c >= 48) && (c <= 57)) ||
- c == '_' || _rSpecials.indexOf(c) != -1);
+ c == '_' || _rSpecials.find(c) != std::u16string_view::npos);
}
-bool isValidSQLName(const OUString& rName,const OUString& _rSpecials)
+bool isValidSQLName(const OUString& rName, std::u16string_view _rSpecials)
{
// Test for correct naming (in SQL sense)
// This is important for table names for example
@@ -202,7 +202,7 @@ bool isValidSQLName(const OUString& rName,const OUString& _rSpecials)
}
// Creates a new name if necessary
-OUString convertName2SQLName(const OUString& rName,const OUString& _rSpecials)
+OUString convertName2SQLName(const OUString& rName, std::u16string_view _rSpecials)
{
if(isValidSQLName(rName,_rSpecials))
return rName;
@@ -221,10 +221,10 @@ OUString convertName2SQLName(const OUString& rName,const OUString& _rSpecials)
return aNewName.makeStringAndClear();
}
-OUString quoteName(const OUString& _rQuote, const OUString& _rName)
+OUString quoteName(std::u16string_view _rQuote, const OUString& _rName)
{
OUString sName = _rName;
- if( !_rQuote.isEmpty() && _rQuote.toChar() != ' ')
+ if( !_rQuote.empty() && _rQuote[0] != ' ')
sName = _rQuote + _rName + _rQuote;
return sName;
}