From f9daf953d69a1f367a8c2d85cf587fe29eb4a45a Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 11 Sep 2005 18:37:52 +0000 Subject: [PATCH] Applied [ 1283696 ] wxDC::GetPartialTextExtents crashes on empty strings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index f843360fcf..ad20e6ec9b 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1674,6 +1674,8 @@ bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) con 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 -- 2.45.2