[Libreoffice-commits] core.git: include/comphelper
Tor Lillqvist
tml at collabora.com
Thu Feb 15 10:23:25 UTC 2018
include/comphelper/windowsdebugoutput.hxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 09cb65bb92318bf8edb467fcd7720f072306f379
Author: Tor Lillqvist <tml at collabora.com>
Date: Thu Feb 15 12:15:48 2018 +0200
Make this work also outside LibreOffice code (for test programs)
If LIBO_INTERNAL_ONLY is not defined, just include <windows.h>
directly. Don't use OUStrings.
Change-Id: I9ddaab6029c5198538c47b623457f4ff2089e3f6
diff --git a/include/comphelper/windowsdebugoutput.hxx b/include/comphelper/windowsdebugoutput.hxx
index 5efda11e7271..53719899b0bc 100644
--- a/include/comphelper/windowsdebugoutput.hxx
+++ b/include/comphelper/windowsdebugoutput.hxx
@@ -15,10 +15,16 @@
#ifndef INCLUDED_COMPHELPER_WINDOWSDEBUGOUTPUT_HXX
#define INCLUDED_COMPHELPER_WINDOWSDEBUGOUTPUT_HXX
+#include <codecvt>
#include <ostream>
+#include <string>
+
+#ifdef LIBO_INTERNAL_ONLY
#include <prewin.h>
#include <postwin.h>
-#include <rtl/ustring.hxx>
+#else
+#include <windows.h>
+#endif
template <typename charT, typename traits>
inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream,
@@ -31,7 +37,7 @@ inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, t
// TODO: Maybe look up a descriptive name for the service or interface, from HKCR\CLSID or
// HKCR\Interface?
- stream << OUString(reinterpret_cast<sal_Unicode*>(pRiid));
+ stream << std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>().to_bytes(std::wstring(pRiid));
CoTaskMemFree(pRiid);
return stream;
}
More information about the Libreoffice-commits
mailing list