diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-04 14:57:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-04 16:12:11 +0000 |
commit | 9ac98e6e3488e434bf4864ecfb13a121784f640b (patch) | |
tree | b3c9cbf52126fee5864be12e9109f7413e7a0878 /basic | |
parent | 6f995da5a652d993ab253b3363188cd18e289728 (diff) |
Finally switch MSVC to sal_Unicode = char16_t, too
There is lots of (Windows-only) code that relied on sal_Unicode being the same
as wchar_t, and the best change may be different in each case (and doing the
changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding
functions to sal/types.h, remove their uses one by one again, and finally drop
those functions again.
Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea
Reviewed-on: https://gerrit.libreoffice.org/36077
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/qa/cppunit/test_vba.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxdec.cxx | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx index 8e5a5ecc4f8d..5df8c0eb76f5 100644 --- a/basic/qa/cppunit/test_vba.cxx +++ b/basic/qa/cppunit/test_vba.cxx @@ -135,13 +135,13 @@ void VBATest::testMiscOLEStuff() const int nBufSize = 1024 * 4; sal_Unicode sBuf[nBufSize]; - SQLGetInstalledDriversW( sBuf, nBufSize, nullptr ); + SQLGetInstalledDriversW( SAL_W(sBuf), nBufSize, nullptr ); const sal_Unicode *pODBCDriverName = sBuf; bool bFound = false; - for (; wcslen( pODBCDriverName ) != 0; pODBCDriverName += wcslen( pODBCDriverName ) + 1 ) { - if( wcscmp( pODBCDriverName, L"Microsoft Excel Driver (*.xls)" ) == 0 || - wcscmp( pODBCDriverName, L"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)" ) == 0 ) { + for (; wcslen( SAL_W(pODBCDriverName) ) != 0; pODBCDriverName += wcslen( SAL_W(pODBCDriverName) ) + 1 ) { + if( wcscmp( SAL_W(pODBCDriverName), L"Microsoft Excel Driver (*.xls)" ) == 0 || + wcscmp( SAL_W(pODBCDriverName), L"Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)" ) == 0 ) { bFound = true; break; } diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 304e6c76b482..6344bdebaf6b 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -416,7 +416,7 @@ RTLFUNC(CurDir) wchar_t pBuffer[ _MAX_PATH ]; if ( _wgetdcwd( nCurDir, pBuffer, _MAX_PATH ) != nullptr ) { - rPar.Get(0)->PutString( OUString( pBuffer ) ); + rPar.Get(0)->PutString( OUString( SAL_U(pBuffer) ) ); } else { diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 59008e796923..a7421647bd1b 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -226,11 +226,11 @@ bool SbxDecimal::setString( OUString* pOUString ) pBuffer[i] = ','; i++; } - hResult = VarDecFromStr( pBuffer.get(), nLANGID, 0, &maDec ); + hResult = VarDecFromStr( SAL_W(pBuffer.get()), nLANGID, 0, &maDec ); } else { - hResult = VarDecFromStr( pOUString->getStr(), nLANGID, 0, &maDec ); + hResult = VarDecFromStr( SAL_W(pOUString->getStr()), nLANGID, 0, &maDec ); } bRet = ( hResult == S_OK ); return bRet; |