From b3eca5777543fb6fc97e025b03fe07ed9541c0a5 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Fri, 14 Oct 2011 11:47:58 +0200 Subject: Fix bug in QStringToBSTR. Use the same implementation as found in ActiveQt, which Volker suggested. Task-number: QTBUG-11083 --- src/gui/accessible/qaccessible_win.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp index c1bb54b..f404535 100644 --- a/src/gui/accessible/qaccessible_win.cpp +++ b/src/gui/accessible/qaccessible_win.cpp @@ -691,14 +691,7 @@ private: static inline BSTR QStringToBSTR(const QString &str) { - BSTR bstrVal; - - int wlen = str.length()+1; - bstrVal = SysAllocStringByteLen(0, wlen*2); - memcpy(bstrVal, str.unicode(), sizeof(QChar)*(wlen)); - bstrVal[wlen] = 0; - - return bstrVal; + return SysAllocStringLen((OLECHAR*)str.unicode(), str.length()); } /* -- cgit v0.12