]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/graphics.cpp
Add persistence support for wxSplitterWindow.
[wxWidgets.git] / src / msw / graphics.cpp
index 0bc82261429a7cdab52ba449caaf42f27fd19495..88d5fb55941455a14ca6401a0cb02a9d90c8cd62 100644 (file)
@@ -2127,6 +2127,14 @@ WXHDC wxGCDC::AcquireHDC()
     if ( !gc )
         return NULL;
 
+#if wxUSE_CAIRO
+    // we can't get the HDC if it is not a GDI+ context
+    wxGraphicsRenderer* r1 = gc->GetRenderer();
+    wxGraphicsRenderer* r2 = wxGraphicsRenderer::GetCairoRenderer();
+    if (r1 == r2)
+        return NULL;
+#endif
+
     Graphics * const g = static_cast<Graphics *>(gc->GetNativeContext());
     return g ? g->GetHDC() : NULL;
 }
@@ -2139,6 +2147,14 @@ void wxGCDC::ReleaseHDC(WXHDC hdc)
     wxGraphicsContext * const gc = GetGraphicsContext();
     wxCHECK_RET( gc, "can't release HDC because there is no wxGraphicsContext" );
 
+#if wxUSE_CAIRO
+    // we can't get the HDC if it is not a GDI+ context
+    wxGraphicsRenderer* r1 = gc->GetRenderer();
+    wxGraphicsRenderer* r2 = wxGraphicsRenderer::GetCairoRenderer();
+    if (r1 == r2)
+        return;
+#endif
+
     Graphics * const g = static_cast<Graphics *>(gc->GetNativeContext());
     wxCHECK_RET( g, "can't release HDC because there is no Graphics" );