details:   https://code.openbravo.com/erp/devel/pi/rev/ece91fb55374
changeset: 17757:ece91fb55374
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Fri Aug 24 08:47:25 2012 +0200
summary:   fixes issue 21314: Sequence Number sorting not working

diffstat:

 src/org/openbravo/erpCommon/ad_actionButton/ActionButtonUtility.java |  20 
++++++----
 1 files changed, 12 insertions(+), 8 deletions(-)

diffs (35 lines):

diff -r 1ea48d91d141 -r ece91fb55374 
src/org/openbravo/erpCommon/ad_actionButton/ActionButtonUtility.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/ActionButtonUtility.java      
Thu Aug 23 11:42:29 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/ActionButtonUtility.java      
Fri Aug 24 08:47:25 2012 +0200
@@ -115,19 +115,23 @@
       }
 
       data = new SQLReturnObject[v.size()];
-      v.copyInto(data);
       if (log4j.isDebugEnabled())
         log4j.debug("DocAction - total combo elements: " + data.length);
-      for (int i = 0; i < data.length; i++) {
-        if (log4j.isDebugEnabled())
-          log4j.debug("DocAction - Element: " + i + " - ID: " + 
data[i].getField("ID"));
-        for (int j = 0; j < ld.length; j++) {
-          if (data[i].getField("ID").equals(ld[j].getField("ID"))) {
-            data[i].setData("NAME", ld[j].getField("NAME"));
-            data[i].setData("DESCRIPTION", ld[j].getField("DESCRIPTION"));
+      int ind1 = 0, ind2 = 0;
+      while (ind1 < ld.length && ind2 < v.size()) {
+        for (int j = 0; j < v.size(); j++) {
+          SQLReturnObject sqlro = (SQLReturnObject) v.get(j);
+          if (sqlro.getField("ID").equals(ld[ind1].getField("ID"))) {
+            if (log4j.isDebugEnabled())
+              log4j.debug("DocAction - Element: " + ind1 + " - ID: " + 
sqlro.getField("ID"));
+            data[ind2] = sqlro;
+            data[ind2].setData("NAME", ld[ind1].getField("NAME"));
+            data[ind2].setData("DESCRIPTION", 
ld[ind1].getField("DESCRIPTION"));
+            ind2++;
             break;
           }
         }
+        ind1++;
       }
     }
     return data;

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to