details:   /erp/devel/pi/rev/d9a05940ef9c
changeset: 12030:d9a05940ef9c
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri May 06 13:05:26 2011 +0200
summary:   Fixes issue 17036: An error box is shown when clicking New in Price 
List Schema lines

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
 |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (27 lines):

diff -r 654d5a441226 -r d9a05940ef9c 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
     Fri May 06 12:35:15 2011 +0200
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
     Fri May 06 13:05:26 2011 +0200
@@ -100,9 +100,9 @@
         // explicitly
         boolean doCount = false;
         int count = -1;
-        int startRow = queryService.getFirstResult();
-        int endRow = startRow + queryService.getMaxResults();
-        int computedMaxResults = queryService.getMaxResults();
+        int startRow = (startRowStr != null ? queryService.getFirstResult() : 
0);
+        int computedMaxResults = (queryService.getMaxResults() == null ? 
Integer.MAX_VALUE
+            : queryService.getMaxResults());
         if (startRowStr != null) {
           doCount = true;
         }
@@ -111,9 +111,8 @@
           // endRow is increased by 1
           // increase by 1 to see if there are more results.
           if (preventCountOperation) {
-            endRow++;
             // set count here, is corrected in specific cases later
-            count = endRow;
+            count = queryService.getMaxResults();
           }
         } else {
           // can't do count if there is no endrow...

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to