]> git.saurik.com Git - wxWidgets.git/commitdiff
use utf8_str() in wxDFB
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 5 May 2007 18:55:59 +0000 (18:55 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 5 May 2007 18:55:59 +0000 (18:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dfb/private.h
src/dfb/dc.cpp

index 9a36a5ea5e4b4170910b8d36f4e8a529ae2a1ccc..6193cc975f3e9e162db673f863145f6464fcbc58 100644 (file)
 #include "wx/dfb/wrapdfb.h"
 #include <directfb_version.h>
 
-//-----------------------------------------------------------------------------
-// strings conversion
-//-----------------------------------------------------------------------------
-
-// convert string from wxString to UTF-8 encoded const char*
-#if wxUSE_UNICODE
-    #define wxSTR_TO_DFB(s)    (s).mb_str(wxConvUTF8)
-#else
-    #define wxSTR_TO_DFB(s)    wxConvUTF8.cWC2MB((s).wc_str(*wxConvUI))
-#endif
-
 //-----------------------------------------------------------------------------
 // misc helpers
 //-----------------------------------------------------------------------------
index 004c88c969c9debda24d1c888c1850fffb81728e..49aa202b638f27c2143afb7495215ed0ec05352f 100644 (file)
@@ -338,7 +338,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
     wxCHECK_RET( m_textForegroundColour.Ok(),
                  wxT("invalid foreground color") );
     SelectColour(m_textForegroundColour);
-    m_surface->DrawString(wxSTR_TO_DFB(text), -1, xx, yy, DSTF_LEFT | DSTF_TOP);
+    m_surface->DrawString(text.utf8_str(), -1, xx, yy, DSTF_LEFT | DSTF_TOP);
 
     // restore pen's colour, because other drawing functions expect the colour
     // to be set to the pen:
@@ -497,7 +497,7 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
     DFBRectangle rect;
     wxIDirectFBFontPtr f = GetCurrentFont();
 
-    if ( f->GetStringExtents(wxSTR_TO_DFB(string), -1, &rect, NULL) )
+    if ( f->GetStringExtents(string.utf8_str(), -1, &rect, NULL) )
     {
         // VS: YDEV is corrent, it should *not* be XDEV, because font's are
         //     only scaled according to m_scaleY