]> git.saurik.com Git - wxWidgets.git/commitdiff
partly successful (i.e. previously it didn't work at all and spewed Pango warnings...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Oct 2006 00:59:06 +0000 (00:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Oct 2006 00:59:06 +0000 (00:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/x11/dcclient.h
src/x11/dcclient.cpp

index 7fa64da87361edad1d96633fae7ef788aed879e1..0d9ffbcb6b05c42ed41976af2d59e50c52d45648 100644 (file)
@@ -32,7 +32,7 @@ class WXDLLIMPEXP_CORE wxClientDC;
 class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
 {
 public:
-    wxWindowDC();
+    wxWindowDC() { Init(); }
     wxWindowDC( wxWindow *win );
 
     virtual ~wxWindowDC();
@@ -118,6 +118,8 @@ protected:
         wxCoord *externalLeading = NULL,
         wxFont *theFont = NULL) const;
 
+    void Init();
+
     WXDisplay    *m_display;
     WXWindow      m_window;
     WXGC          m_penGC;
index c799f1fbedc596a1dd600302f35dd650323d42d5..d5832711b8b2e180aae0a8d00686ee65a6167906 100644 (file)
@@ -165,7 +165,7 @@ static void wxFreePoolGC( GC gc )
 
 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
 
-wxWindowDC::wxWindowDC()
+void wxWindowDC::Init()
 {
     m_display = (WXDisplay *) NULL;
     m_penGC = (WXGC *) NULL;
@@ -178,7 +178,7 @@ wxWindowDC::wxWindowDC()
     m_owner = (wxWindow *)NULL;
 
 #if wxUSE_UNICODE
-    m_context = (PangoContext *)NULL;
+    m_context = wxTheApp->GetPangoContext();
     m_fontdesc = (PangoFontDescription *)NULL;
 #endif
 }
@@ -187,15 +187,8 @@ wxWindowDC::wxWindowDC( wxWindow *window )
 {
     wxASSERT_MSG( window, wxT("DC needs a window") );
 
-    m_display = (WXDisplay *) NULL;
-    m_penGC = (WXGC *) NULL;
-    m_brushGC = (WXGC *) NULL;
-    m_textGC = (WXGC *) NULL;
-    m_bgGC = (WXGC *) NULL;
-    m_cmap = (WXColormap *) NULL;
-    m_owner = (wxWindow *)NULL;
-    m_isMemDC = false;
-    m_isScreenDC = false;
+    Init();
+
     m_font = window->GetFont();
 
     m_window = (WXWindow*) window->GetMainWindow();
@@ -212,7 +205,6 @@ wxWindowDC::wxWindowDC( wxWindow *window )
     m_display = (WXDisplay *) wxGlobalDisplay();
 
 #if wxUSE_UNICODE
-    m_context = wxTheApp->GetPangoContext();
     m_fontdesc = window->GetFont().GetNativeFontInfo()->description;
 #endif