summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-02-15 12:15:48 +0200
committerTor Lillqvist <tml@collabora.com>2018-02-15 12:21:08 +0200
commit09cb65bb92318bf8edb467fcd7720f072306f379 (patch)
tree790b36a481d6e78d1b711fcc4d1471a8f5fbbd88 /include/comphelper
parent32d8a32dcf85e2cee589ee19bc72b4abf73f9681 (diff)
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
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/windowsdebugoutput.hxx10
1 files changed, 8 insertions, 2 deletions
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;
}