loleaflet/src/control/Control.MobileWizard.js |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 6197b259595b2c014e8a2c169cd5ebcceed8a40a
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Thu Feb 20 03:24:29 2020 +0000
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Thu Feb 20 05:03:16 2020 +0100

    mend removal of adjacent jsdialog wizard items by name.
    
    Change-Id: Id91a58cde7581d23aeb82a95f26a1c0e1352e411
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89067
    Tested-by: Michael Meeks <michael.me...@collabora.com>
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index de54a6d71..300f21773 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -399,7 +399,7 @@ L.Control.MobileWizard = L.Control.extend({
 
        _removeItems: function (data, items) {
                if (data.children) {
-                       for (var i = 0; i < data.children.length; i++) {
+                       for (var i = 0; i < data.children.length;) {
                                var childRemoved = false;
                                for (var j = 0; j < items.length; j++) {
                                        if (data.children[i].id === items[j]) {
@@ -408,10 +408,12 @@ L.Control.MobileWizard = L.Control.extend({
                                                break;
                                        }
                                }
-                               if (childRemoved && i > 0)
-                                       i = i - 1;
-                               if (data.children[i])
-                                       this._removeItems(data.children[i], 
items);
+                               if (!childRemoved)
+                               {
+                                       if (data.children[i])
+                                               
this._removeItems(data.children[i], items);
+                                       i++;
+                               }
                        }
                }
        },
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to