You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/03/19 17:15:23 UTC

svn commit: r1579277 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java

Author: jleroux
Date: Wed Mar 19 16:15:22 2014
New Revision: 1579277

URL: http://svn.apache.org/r1579277
Log:
A patch from Antoine Vittecoq for "Form widget/ FTL pagination, Last does not take to last page" https://issues.apache.org/jira/browse/OFBIZ-5575

This issue in pagination can be tested in https://localhost:8443/partymgr/control/findparty (FTL) & https://localhost:8443/webtools/control/FindUtilCache?VIEW_SIZE_1=2&VIEW_INDEX_1=0 (XML Form).

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java?rev=1579277&r1=1579276&r2=1579277&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java Wed Mar 19 16:15:22 2014
@@ -790,7 +790,7 @@ public class UtilMisc {
     }
 
     public static int getViewLastIndex(int listSize, int viewSize) {
-        return (int)Math.ceil(listSize / viewSize) - 1;
+        return (int)Math.ceil(listSize / (float) viewSize) - 1;
     }
     
 }