[graphics/krita] libs/flake: Use standard sorting operator when sorting points on removal

Dmitry Kazakov <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 79adf59cec32d34dac46ff2e424453dbeccfa00d by Dmitry Kazakov.
Committed on 27/07/2026 at 11:33.
Pushed by dkazakov into branch 'master'.

Use standard sorting operator when sorting points on removal

Otherwise the points of different shapes may be mixed together,
which is not good.

M  +2    -1    libs/flake/KoPathPointData.h
M  +1    -3    libs/flake/commands/KoPathPointRemoveCommand.cpp

https://invent.kde.org/graphics/krita/-/commit/79adf59cec32d34dac46ff2e424453dbeccfa00d

diff --git a/libs/flake/KoPathPointData.h b/libs/flake/KoPathPointData.h
index 70c56f629b7..7231c409ab6 100644
--- a/libs/flake/KoPathPointData.h
+++ b/libs/flake/KoPathPointData.h
@@ -14,7 +14,8 @@
 /**
  * @brief Describe a KoPathPoint by a KoPathShape and its indices
  */
-class KoPathPointData  : public boost::equality_comparable<KoPathPointData>
+class KoPathPointData : public boost::equality_comparable<KoPathPointData>,
+                        public boost::partially_ordered<KoPathPointData>
 {
 public:
     /// constructor
diff --git a/libs/flake/commands/KoPathPointRemoveCommand.cpp b/libs/flake/commands/KoPathPointRemoveCommand.cpp
index 10340d8571d..9b67e88c9ff 100644
--- a/libs/flake/commands/KoPathPointRemoveCommand.cpp
+++ b/libs/flake/commands/KoPathPointRemoveCommand.cpp
@@ -95,9 +95,7 @@ KUndo2Command *KoPathPointRemoveCommand::createCommand(
     }
 
     //Reverse sort the subpath list to account for shifting indices of the subpaths
-    std::sort(subpathToDelete.begin(), subpathToDelete.end(), [](KoPathPointData a, KoPathPointData b) {
-        return a.pointIndex > b.pointIndex;
-    });
+    std::sort(subpathToDelete.begin(), subpathToDelete.end(), std::greater<>{});
 
     Q_FOREACH (const KoPathPointData & pd, subpathToDelete) {
         new KoSubpathRemoveCommand(pd.pathShape, pd.pointIndex.first, cmd);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.