]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fix in FindPaperType() after latest change
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 May 2009 22:58:08 +0000 (22:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 20 May 2009 22:58:08 +0000 (22:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/paper.cpp

index 368d3a51c8f39ce8cce44c6015ac63e2a44821ef..b0865c9ebe572d9a733cee4b94bdaf50f0b90cdf 100644 (file)
@@ -250,12 +250,12 @@ wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(wxPaperSize id)
     // are likely to be taken into account first. This fixes problems with,
     // for example, Letter reverting to A4 in the page setup dialog because
     // it was wrongly translated to Note.
-    size_t i;
-    for (i = 0; i < GetCount(); i++)
+    const wxSize sz = GetSize(id);
+    for ( size_t i = 0; i < GetCount(); i++ )
     {
-        wxPrintPaperType* paperType = Item(i);
-        wxSize paperSize = paperType->GetSize() ;
-        if ( abs( paperSize.x - sz.x ) < 10 && abs( paperSize.y - sz.y ) < 10 )
+        wxPrintPaperType* const paperType = Item(i);
+        const wxSize paperSize = paperType->GetSize() ;
+        if ( abs(paperSize.x - sz.x) < 10 && abs(paperSize.y - sz.y) < 10 )
             return paperType;
     }