Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-11083

Error in internal function QStringToBSTR( ) in Accessability module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.x
    • 4.5.2, 4.6.2
    • None
    • Windows 7 with VS 2010
    • b3eca5777543fb6fc97e025b03fe07ed9541c0a5

    Description

      I modified the funcion QStringToBSTR( ) from

      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;
      }
      

      to:

      static inline BSTR QStringToBSTR(const QString &str)
      {
          int wlen = str.length();
          if( wlen>0 )
          {
            BSTR bstrVal = SysAllocStringByteLen( (LPCSTR)str.unicode(), wlen*2 );
            return bstrVal;
          }
          return 0;
      }
      

      reason:

      The new VS 2010 has a new feature to create UI tests using MSAA.
      When the VS 2010 UIMap is pointed to a Qt control, this tool shows in "Text" field a /0 in end of text captured.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            smd Jan Arve
            juanper Juan José Pereira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes