From b1d7de5ae0c53162b57ac20cfed04264f0f27b30 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 28 Mar 2004 19:44:50 +0000 Subject: [PATCH] fix for get best size when having empty labels git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/stattext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 8437b9d5d1..c6a6dd4e1a 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -66,8 +66,9 @@ wxSize wxStaticText::DoGetBestSize() const Point bounds ; SInt16 baseline ; wxMacCFStringHolder str(m_label , m_font.GetEncoding() ) ; - verify_noerr( GetThemeTextDimensions( str , m_font.MacGetThemeFontID() , kThemeStateActive , false , &bounds , &baseline ) ) ; - + verify_noerr( GetThemeTextDimensions( (m_label.Length() > 0 ? ((CFStringRef) str ) : CFSTR(" ") ) , m_font.MacGetThemeFontID() , kThemeStateActive , false , &bounds , &baseline ) ) ; + if ( m_label.Length() == 0 ) + bounds.h = 0 ; return wxSize(bounds.h, bounds.v); } -- 2.45.2