X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..50dee7e0ebbe05574116dce391596ddc55d644be:/src/common/paper.cpp diff --git a/src/common/paper.cpp b/src/common/paper.cpp index 58156a1bb4..e02dcdc39f 100644 --- a/src/common/paper.cpp +++ b/src/common/paper.cpp @@ -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; }