]> git.saurik.com Git - wxWidgets.git/commitdiff
Backward comp. fix.
authorRobert Roebling <robert@roebling.de>
Fri, 13 Sep 2002 22:02:14 +0000 (22:02 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 13 Sep 2002 22:02:14 +0000 (22:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dcpsg.cpp

index 5e61da75f681a5e5df1377bc3cd3f9c4c2d405fe..12d2545a27d569f6be682a593b92064d72aef781 100644 (file)
@@ -2340,6 +2340,51 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
     // GTK 2.0
 }
 
+#if WXWIN_COMPATIBILITY_2_2
+void wxInitializePrintSetupData(bool init)
+{
+    if (init)
+    {
+        // gets initialized in the constructor
+        wxThePrintSetupData = new wxPrintSetupData;
+    }
+    else
+    {
+        if (wxThePrintSetupData)
+            delete wxThePrintSetupData;
+            
+        wxThePrintSetupData = (wxPrintSetupData *) NULL;
+    }
+}
+
+// A module to allow initialization/cleanup of PostScript-related
+// things without calling these functions from app.cpp.
+
+class WXDLLEXPORT wxPostScriptModule: public wxModule
+{
+DECLARE_DYNAMIC_CLASS(wxPostScriptModule)
+public:
+    wxPostScriptModule() {}
+    bool OnInit();
+    void OnExit();
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxPostScriptModule, wxModule)
+
+bool wxPostScriptModule::OnInit()
+{
+    wxInitializePrintSetupData();
+
+    return TRUE;
+}
+
+void wxPostScriptModule::OnExit()
+{
+    wxInitializePrintSetupData(FALSE);
+}
+#endif
+  // WXWIN_COMPATIBILITY_2_2
+
 #endif
   // wxUSE_POSTSCRIPT