[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/libs/main
From:       Thomas Zander <zander () kde ! org>
Date:       2009-05-29 14:13:38
Message-ID: 1243606418.284929.1941.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 974502 by zander:

Don't compare floats with ==

 M  +8 -8      KoPageLayout.h  


--- trunk/koffice/libs/main/KoPageLayout.h #974501:974502
@@ -56,14 +56,14 @@
     qreal bindingSide;
 
     bool operator==(const KoPageLayout& l) const {
-        return (width == l.width &&
-                height == l.height &&
-                left == l.left &&
-                right == l.right &&
-                top == l.top &&
-                bottom == l.bottom &&
-                pageEdge == l.pageEdge &&
-                bindingSide == l.bindingSide);
+        return (qFuzzyCompare(width,l.width) &&
+                qFuzzyCompare(height,l.height) &&
+                qFuzzyCompare(left,l.left) &&
+                qFuzzyCompare(right,l.right) &&
+                qFuzzyCompare(top,l.top) &&
+                qFuzzyCompare(bottom,l.bottom) &&
+                qFuzzyCompare(pageEdge,l.pageEdge) &&
+                qFuzzyCompare(bindingSide,l.bindingSide));
     }
     bool operator!=(const KoPageLayout& l) const {
         return !((*this) == l);

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic