Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24507/src/gui

Modified Files:
        wxMApp.cpp 
Log Message:
fixed printing-related code to compile without WXWIN_COMPATIBILITY_2_4

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.300
retrieving revision 1.301
diff -b -u -2 -r1.300 -r1.301
--- wxMApp.cpp  24 Sep 2005 16:25:44 -0000      1.300
+++ wxMApp.cpp  27 Nov 2005 21:10:34 -0000      1.301
@@ -54,4 +54,8 @@
 #include <wx/generic/helpext.h>
 
+#if wxUSE_POSTSCRIPT
+   #include <wx/generic/prntdlgg.h>
+#endif // wxUSE_POSTSCRIPT
+
 #if defined(OS_WIN) || defined(__CYGWIN__)
    #define wxConnection    wxDDEConnection
@@ -1303,6 +1307,12 @@
    {
 #if wxUSE_POSTSCRIPT
-      m_profile->writeEntry(MP_PRINT_COMMAND, 
m_PrintData->GetPrinterCommand());
-      m_profile->writeEntry(MP_PRINT_OPTIONS, 
m_PrintData->GetPrinterOptions());
+      wxPrintNativeDataBase * const dataNative = m_PrintData->GetNativeData();
+      wxPostScriptPrintNativeData * const dataPS =
+         static_cast<wxPostScriptPrintNativeData *>(dataNative);
+
+      m_profile->writeEntry(MP_PRINT_COMMAND, dataPS->GetPrinterCommand());
+      m_profile->writeEntry(MP_PRINT_OPTIONS, dataPS->GetPrinterOptions());
+#endif // wxUSE_POSTSCRIPT
+
       m_profile->writeEntry(MP_PRINT_ORIENTATION, 
m_PrintData->GetOrientation());
       m_profile->writeEntry(MP_PRINT_MODE, m_PrintData->GetPrintMode());
@@ -1310,5 +1320,4 @@
       m_profile->writeEntry(MP_PRINT_FILE, m_PrintData->GetFilename());
       m_profile->writeEntry(MP_PRINT_COLOUR, m_PrintData->GetColour());
-#endif // wxUSE_POSTSCRIPT
 
       delete m_PrintData;
@@ -1318,5 +1327,4 @@
    if ( m_PageSetupData )
    {
-#if wxUSE_POSTSCRIPT
       m_profile->writeEntry(MP_PRINT_TOPMARGIN_X,
                             m_PageSetupData->GetMarginTopLeft().x);
@@ -1327,5 +1335,4 @@
       m_profile->writeEntry(MP_PRINT_BOTTOMMARGIN_Y,
                             m_PageSetupData->GetMarginBottomRight().y);
-#endif // wxUSE_POSTSCRIPT
 
       delete m_PageSetupData;
@@ -1340,8 +1347,10 @@
    if ( !m_PrintData )
    {
-#ifdef OS_WIN
-      wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
-#else // Unix
-      wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
+      m_PrintData = new wxPrintData;
+
+#if wxUSE_POSTSCRIPT
+      wxPrintNativeDataBase * const dataNative = m_PrintData->GetNativeData();
+      wxPostScriptPrintNativeData * const dataPS =
+         static_cast<wxPostScriptPrintNativeData *>(dataNative);
 
       // set AFM path
@@ -1352,24 +1361,11 @@
       bool found;
       String afmpath = pf.FindDirFile(_T("Cour.afm"), &found);
-      if(found)
-      {
-        //wxThePrintSetupData->SetAFMPath(afmpath);
-      }
-#endif // Win/Unix
-
-      m_PrintData = new wxPrintData;
-
-#ifndef OS_WIN
       if ( found )
       {
-         m_PrintData->SetFontMetricPath(afmpath);
+         dataPS->SetFontMetricPath(afmpath);
       }
-#endif // !OS_WIN
-
-#if wxUSE_POSTSCRIPT
-      //*m_PrintData = *wxThePrintSetupData;
 
-      m_PrintData->SetPrinterCommand(READ_APPCONFIG(MP_PRINT_COMMAND));
-      m_PrintData->SetPrinterOptions(READ_APPCONFIG(MP_PRINT_OPTIONS));
+      dataPS->SetPrinterCommand(READ_APPCONFIG(MP_PRINT_COMMAND));
+      dataPS->SetPrinterOptions(READ_APPCONFIG(MP_PRINT_OPTIONS));
       m_PrintData->SetOrientation(READ_APPCONFIG(MP_PRINT_ORIENTATION));
       
m_PrintData->SetPrintMode((wxPrintMode)(long)READ_APPCONFIG(MP_PRINT_MODE));



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to