]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/printfw.cpp
Don't create a bitmap with dimensions <= 0...
[wxWidgets.git] / wxPython / src / gtk / printfw.cpp
index ccb1ae22c222938a977e7f00302f78204e530829..8d1240b77cdf14507a6a7b21a915906a882076b5 100644 (file)
@@ -99,9 +99,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 // Since this one would be tough and ugly to do with the Macros...
 void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
     bool hadErr = FALSE;
 // Since this one would be tough and ugly to do with the Macros...
 void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
     bool hadErr = FALSE;
+    bool found;
 
 
-    bool doSave = wxPyRestoreThread();
-    if (m_myInst.findCallback("GetPageInfo")) {
+    wxPyTState* state = wxPyBeginBlockThreads();
+    if ((found = m_myInst.findCallback("GetPageInfo"))) {
         PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()"));
         if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
             PyObject* val;
         PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()"));
         if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
             PyObject* val;
@@ -131,10 +132,9 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
         }
         Py_DECREF(result);
     }
         }
         Py_DECREF(result);
     }
-    else
+    wxPyEndBlockThreads(state);
+    if (! found)
         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
-
-    wxPySaveThread(doSave);
 }
 
 void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
 }
 
 void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
@@ -5349,12 +5349,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_uint","_wxWindowID",0},
     { "_wxChar","_char",0},
     { "_char","_wxChar",0},
     { "_uint","_wxWindowID",0},
     { "_wxChar","_char",0},
     { "_char","_wxChar",0},
+    { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
     { "_EBool","_wxCoord",0},
     { "_EBool","_wxPrintQuality",0},
     { "_EBool","_signed_int",0},
     { "_EBool","_int",0},
     { "_EBool","_wxWindowID",0},
     { "_unsigned_long","_long",0},
     { "_EBool","_wxCoord",0},
     { "_EBool","_wxPrintQuality",0},
     { "_EBool","_signed_int",0},
     { "_EBool","_int",0},
     { "_EBool","_wxWindowID",0},
     { "_unsigned_long","_long",0},
+    { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
     { "_class_wxPanel","_class_wxPrintDialog",SwigwxPrintDialogTowxPanel},
     { "_class_wxPanel","_wxPrintDialog",SwigwxPrintDialogTowxPanel},
     { "_class_wxPanel","_class_wxPageSetupDialog",SwigwxPageSetupDialogTowxPanel},
     { "_class_wxPanel","_class_wxPrintDialog",SwigwxPrintDialogTowxPanel},
     { "_class_wxPanel","_wxPrintDialog",SwigwxPrintDialogTowxPanel},
     { "_class_wxPanel","_class_wxPageSetupDialog",SwigwxPageSetupDialogTowxPanel},