GUIFormSpecMenu: Fix legacy sorting using std::stable_sort
authorSmallJoker <mk939@ymail.com>
Sat, 14 Dec 2019 20:28:07 +0000 (21:28 +0100)
committerSmallJoker <mk939@ymail.com>
Sat, 14 Dec 2019 20:28:07 +0000 (21:28 +0100)
src/gui/guiFormSpecMenu.cpp

index ab20840f97c5da16fb69ef2c413e8947f5d58676..320608642f8917f92c73339a988613ca1a7d1423 100644 (file)
@@ -3031,7 +3031,7 @@ void GUIFormSpecMenu::legacySortElements(core::list<IGUIElement *>::Iterator fro
                elements.emplace_back(*it);
 
        // 2: Sort the container
-       std::sort(elements.begin(), elements.end(),
+       std::stable_sort(elements.begin(), elements.end(),
                        [this] (const IGUIElement *a, const IGUIElement *b) -> bool {
                const FieldSpec *spec_a = getSpecByID(a->getID());
                const FieldSpec *spec_b = getSpecByID(b->getID());