]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textmeasure.cpp
Add virtual ~wxAnyScrollHelperBase() to fix compiler warning.
[wxWidgets.git] / src / gtk / textmeasure.cpp
index 48bec42aa5cd017c0441b5639bd87d4ca662482e..407a62f36be1abefefc143e50bf695c321676878 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxTextMeasure implementation for wxGTK
 // Author:      Manuel Martin
 // Created:     2012-10-05
 // Purpose:     wxTextMeasure implementation for wxGTK
 // Author:      Manuel Martin
 // Created:     2012-10-05
-// RCS-ID:      $Id:
 // Copyright:   (c) 1997-2012 wxWidgets team
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 1997-2012 wxWidgets team
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -126,7 +125,7 @@ void wxTextMeasure::DoGetTextExtent(const wxString& string,
 
     // Set layout's text
     const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(string, GetFont());
 
     // 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"));
     {
         // hardly ideal, but what else can we do if conversion failed?
         wxLogLastError(wxT("GetTextExtent"));
@@ -165,8 +164,11 @@ void wxTextMeasure::DoGetTextExtent(const wxString& string,
 
 bool wxTextMeasure::DoGetPartialTextExtents(const wxString& text,
                                             wxArrayInt& widths,
 
 bool wxTextMeasure::DoGetPartialTextExtents(const wxString& text,
                                             wxArrayInt& widths,
-                                            double WXUNUSED(scaleX))
+                                            double scaleX)
 {
 {
+    if ( !m_layout )
+        return wxTextMeasureBase::DoGetPartialTextExtents(text, widths, scaleX);
+
     // Set layout's text
     const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(text, GetFont());
     if ( !dataUTF8 )
     // Set layout's text
     const wxCharBuffer dataUTF8 = wxGTK_CONV_FONT(text, GetFont());
     if ( !dataUTF8 )