]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/window.cpp
Fix for crash when opening empty node
[wxWidgets.git] / src / os2 / window.cpp
index 31fda2d2e40b607ff4230976a26258b7c4f08768..44fdde685bfa3403f14fae76a6e9e40086809300 100644 (file)
@@ -1673,7 +1673,6 @@ void wxWindowOS2::GetTextExtent( const wxString& rString,
     int         l;
     FONTMETRICS vFM; // metrics structure
     BOOL        bRc = FALSE;
-    char*       pStr;
     HPS         hPS;
 
     hPS = ::WinGetPS(GetHwnd());
@@ -1681,14 +1680,12 @@ void wxWindowOS2::GetTextExtent( const wxString& rString,
     l = rString.length();
     if (l > 0L)
     {
-        pStr = rString.char_str();
-
         //
         // In world coordinates.
         //
         bRc = ::GpiQueryTextBox( hPS,
                                  l,
-                                 pStr,
+                                 (char*) rString.wx_str(),
                                  TXTBOX_COUNT,// return maximum information
                                  avPoint      // array of coordinates points
                                 );