X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1cd86ff66828c91e4b3bc1296e1bcb67fae587c2..a4ea083bbdf710d3234dcbd2eafb5d0e078f8348:/src/common/textmeasurecmn.cpp diff --git a/src/common/textmeasurecmn.cpp b/src/common/textmeasurecmn.cpp index 6381059dd8..8d828d4b71 100644 --- a/src/common/textmeasurecmn.cpp +++ b/src/common/textmeasurecmn.cpp @@ -3,7 +3,6 @@ // Purpose: wxTextMeasureBase implementation // Author: Manuel Martin // Created: 2012-10-05 -// RCS-ID: $Id: // Copyright: (c) 1997-2012 wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -86,7 +85,9 @@ void wxTextMeasureBase::GetTextExtent(const wxString& string, if ( !height ) height = &unusedHeight; - if ( string.empty() ) + // Avoid even setting up the DC for measuring if we don't actually need to + // measure anything. + if ( string.empty() && !descent && !externalLeading ) { *width = *height = 0;