]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcclient.cpp
fixed wxBitmap<->wxImage conversion to not exchange red and blue components
[wxWidgets.git] / src / motif / dcclient.cpp
index 2013cc7dbe6d0502d8f67e6ab3ddb09a42b44ef0..1a3ec55e8d7a8eb266ad6b0f45fbdf965d18f46a 100644 (file)
@@ -88,11 +88,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
 IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
 
-#ifndef IS_HATCH
-    // IS_HATCH exists for WXWIN_COMPATIBILITY_2_4 only
-    // but wxMotif needs it for its internals here
-    #define IS_HATCH(s)    ((s)>=wxFIRST_HATCH && (s)<=wxLAST_HATCH)
-#endif
+#define IS_HATCH(s)    ((s)>=wxFIRST_HATCH && (s)<=wxLAST_HATCH)
 
 // FIXME: left over after removal of wxDC::GetOptimization()
 #define GET_OPTIMIZATION false
@@ -1130,11 +1126,11 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
 #if wxMOTIF_NEW_FONT_HANDLING
             XmbDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), fset, (GC) m_gcBacking,
             XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
-                        wxConstCast(text.c_str(), char), slen);
+                        wxConstCast(text.mb_str(), char), slen);
 #else
             XDrawString((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(), (GC) m_gcBacking,
             XLOG2DEV_2 (x), YLOG2DEV_2 (y) + ascent,
-                        wxConstCast(text.c_str(), char), slen);
+                        wxConstCast(text.mb_str(), char), slen);
 #endif
     }
 
@@ -2223,7 +2219,7 @@ install:
         XPutImage(dest_display, dest, destgc, destimage, 0, 0, destx, desty, w, h);
         XDestroyImage(destimage);
 
-        if (more)
+        if (more && cache)
             *cache = image;
         else
             XDestroyImage(image);