]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/paper.cpp
Platform and compiler-specific checking for MSW and Mac now done
[wxWidgets.git] / src / common / paper.cpp
index d8775f2c624d143d0e67ef6f25fa43e90ab6cce2..e02dcdc39fbf5d3062952ce0ebf63755f513928b 100644 (file)
@@ -59,7 +59,7 @@ wxPrintPaperType::wxPrintPaperType()
 {
     m_paperId = wxPAPER_NONE;
     m_platformId = 0;
-    m_paperName = "";
+    m_paperName = wxT("");
     m_width = 0;
     m_height = 0;
 }
@@ -192,46 +192,47 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxString& name)
 {
     wxNode *node = Find(name);
     if (node)
-        return (wxPrintPaperType *)node->Data();
+        return (wxPrintPaperType *)node->GetData();
     else
         return (wxPrintPaperType *) NULL;
 }
 
 wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(wxPaperSize id)
 {
-    wxNode *node = First();
+    wxNode *node = GetFirst();
     while (node)
     {
-        wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data();
+        wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
         if (paperType->GetId() == id)
             return paperType;
-        node = node->Next();
+        node = node->GetNext();
     }
     return (wxPrintPaperType *) NULL;
 }
 
 wxPrintPaperType *wxPrintPaperDatabase::FindPaperTypeByPlatformId(int id)
 {
-    wxNode *node = First();
+    wxNode *node = GetFirst();
     while (node)
     {
-        wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data();
+        wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
         if (paperType->GetPlatformId() == id)
             return paperType;
-        node = node->Next();
+        node = node->GetNext();
     }
     return (wxPrintPaperType *) NULL;
 }
 
 wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxSize& sz)
 {
-    wxNode *node = First();
+    wxNode *node = GetFirst();
     while (node)
     {
-        wxPrintPaperType* paperType = (wxPrintPaperType*) node->Data();
-        if (paperType->GetSize() == sz)
+        wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
+        wxSize paperSize = paperType->GetSize() ;
+        if ( abs( paperSize.x - sz.x ) < 10 && abs( paperSize.y - sz.y ) < 10 )
             return paperType;
-        node = node->Next();
+        node = node->GetNext();
     }
     return (wxPrintPaperType *) NULL;
 }