]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied [ 1283696 ] wxDC::GetPartialTextExtents crashes on empty strings
authorJulian Smart <julian@anthemion.co.uk>
Sun, 11 Sep 2005 18:37:52 +0000 (18:37 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 11 Sep 2005 18:37:52 +0000 (18:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dc.cpp

index f843360fcf5c3e630954d0b9ab5a02680a7203c4..ad20e6ec9b681b51dd19f3f0ce604003d03fde39 100644 (file)
@@ -1674,6 +1674,8 @@ bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) con
 
     widths.Empty();
     widths.Add(0, stlen);  // fill the array with zeros
 
     widths.Empty();
     widths.Add(0, stlen);  // fill the array with zeros
+    if (stlen == 0)
+        return true;
 
     if (!::GetTextExtentExPoint(GetHdc(),
                                 text.c_str(),           // string to check
 
     if (!::GetTextExtentExPoint(GetHdc(),
                                 text.c_str(),           // string to check