summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-07-21 18:03:44 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-07-21 21:32:10 +0200
commit0587c88e23b4d3d1a0504cd4c6cf1d51fa9ff498 (patch)
tree4fe0c979d3885452f64d5e98526e37450c481939
parent826edb304b2c429be534d85fb8244be767ea67cf (diff)
Fix uses of char16_t*/wchar_t* stream inserters
...that are helpfully deleted in C++20, as now implemented at least by VS 2019 16.6.4 when using --with-latest-c++ Change-Id: Iaf80f793e73fc90768bb146c9cf3d300d6747c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99170 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--basic/source/runtime/methods.cxx7
-rw-r--r--extensions/source/ole/unoobjw.cxx2
-rw-r--r--include/comphelper/windowsdebugoutput.hxx3
-rw-r--r--tools/qa/cppunit/test_pathutils.cxx2
4 files changed, 8 insertions, 6 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 106bfe806d0b..89ba081348c2 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -367,9 +367,10 @@ extern "C" void invalidParameterHandler(
{
SAL_INFO(
"basic",
- "invalid parameter during _wgetdcwd; \"" << (expression ? o3tl::toU(expression) : u"???")
- << "\" (" << (function ? o3tl::toU(function) : u"???") << ") at "
- << (file ? o3tl::toU(file) : u"???") << ":" << line);
+ "invalid parameter during _wgetdcwd; \""
+ << (expression ? OUString(o3tl::toU(expression)) : OUString("???"))
+ << "\" (" << (function ? OUString(o3tl::toU(function)) : OUString("???")) << ") at "
+ << (file ? OUString(o3tl::toU(file)) : OUString("???")) << ":" << line);
}
}
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index b09f0cb19ce6..e878fddbb682 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -1162,7 +1162,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP InterfaceOleWrapper::GetIDsOfNames(REFIID /*ri
// Initialise returned rgdispid values.
rgdispid[i] = DISPID_UNKNOWN;
- SAL_INFO("extensions.olebridge", " " << o3tl::toU(rgszNames[i]));
+ SAL_INFO("extensions.olebridge", " " << OUString(o3tl::toU(rgszNames[i])));
}
HRESULT ret = DISP_E_UNKNOWNNAME;
diff --git a/include/comphelper/windowsdebugoutput.hxx b/include/comphelper/windowsdebugoutput.hxx
index 45a38d007bc3..a50fc2aa0c7e 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -487,7 +487,8 @@ inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, t
case VT_SAFEARRAY:
break; // FIXME
case VT_LPSTR:
- stream << rVariant.bstrVal;
+ stream << std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>().to_bytes(
+ rVariant.bstrVal);
break;
case VT_LPWSTR:
stream << std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>().to_bytes(
diff --git a/tools/qa/cppunit/test_pathutils.cxx b/tools/qa/cppunit/test_pathutils.cxx
index 1b0c57c08afd..c0a1ea5078d0 100644
--- a/tools/qa/cppunit/test_pathutils.cxx
+++ b/tools/qa/cppunit/test_pathutils.cxx
@@ -33,7 +33,7 @@ void buildPath(
wchar_t p[MAX_PATH];
wchar_t * e = tools::buildPath(
p, front, front + std::wcslen(front), back, std::wcslen(back));
- CPPUNIT_ASSERT_EQUAL(p + std::wcslen(path), e);
+ CPPUNIT_ASSERT_EQUAL(static_cast<void *>(p + std::wcslen(path)), static_cast<void *>(e));
CPPUNIT_ASSERT_EQUAL(0, std::wcscmp(path, p));
#else
(void) front;