Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Use standard sorting operator when sorting points on removal
Dmitry Kazakov79adf59cec32
diff --git a/libs/flake/KoPathPointData.h b/libs/flake/KoPathPointData.hindex 70c56f629b..7231c409ab 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:/// constructordiff --git a/libs/flake/commands/KoPathPointRemoveCommand.cpp b/libs/flake/commands/KoPathPointRemoveCommand.cppindex 10340d8571..9b67e88c9f 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);