]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/paper.cpp
make string at least empty (instead of containing garbage) if malloc() failed
[wxWidgets.git] / src / common / paper.cpp
index faa4941dbb669375f833a43f4298b4e6c52adac0..e02dcdc39fbf5d3062952ce0ebf63755f513928b 100644 (file)
@@ -229,7 +229,8 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxSize& sz)
     while (node)
     {
         wxPrintPaperType* paperType = (wxPrintPaperType*) node->GetData();
-        if (paperType->GetSize() == sz)
+        wxSize paperSize = paperType->GetSize() ;
+        if ( abs( paperSize.x - sz.x ) < 10 && abs( paperSize.y - sz.y ) < 10 )
             return paperType;
         node = node->GetNext();
     }