Allow retrieving the descent and external leading of empty strings.

This used to work before wxTextMeasure changes so make it work again instead
of optimizing the case of empty string away and not returning anything in the
descent and externalLeading output parameters in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-07-10 01:28:18 +00:00
parent 50d2908480
commit 0646084eb2
3 changed files with 30 additions and 2 deletions

View File

@@ -126,7 +126,7 @@ void wxTextMeasure::DoGetTextExtent(const wxString& string,
// Set layout's text
const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(string, GetFont());
if ( !dataUTF8 )
if ( !dataUTF8 && !string.empty() )
{
// hardly ideal, but what else can we do if conversion failed?
wxLogLastError(wxT("GetTextExtent"));