summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2011-10-14 11:47:58 +0200
committerJan-Arve Saether <jan-arve.saether@nokia.com>2011-10-14 11:50:48 +0200
commitb3eca5777543fb6fc97e025b03fe07ed9541c0a5 (patch)
tree312b23509d2d0eeab2b504af252fa2d9bb7f3c3c /src
parenta5c4ecdeaeeaad4c64dc97a51ded97d8e0561b06 (diff)
Fix bug in QStringToBSTR.
Use the same implementation as found in ActiveQt, which Volker suggested. Task-number: QTBUG-11083
Diffstat (limited to 'src')
-rw-r--r--src/gui/accessible/qaccessible_win.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp
index c1bb54bcf2..f404535517 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());
}
/*