From ec02ef0126bea75aeb69466a467871f43854aae1 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 25 Nov 2023 16:35:12 +0100 Subject: [PATCH] Gui: use MarkerBitmaps::getSupportedSizes to get available sizes --- src/Gui/ApplicationPy.cpp | 2 +- src/Gui/Inventor/MarkerBitmaps.cpp | 3 ++- src/Gui/Inventor/MarkerBitmaps.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 1b9c4cc54b..2add20a5d2 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -1462,7 +1462,7 @@ PyObject* Application::sGetMarkerIndex(PyObject * /*self*/, PyObject *args) marker_arg = (*markerStyle).second; //get the marker size - int sizeList[]={5, 7, 9}; + auto sizeList = Gui::Inventor::MarkerBitmaps::getSupportedSizes(marker_arg); if (std::find(std::begin(sizeList), std::end(sizeList), defSize) == std::end(sizeList)) defSize = 9; diff --git a/src/Gui/Inventor/MarkerBitmaps.cpp b/src/Gui/Inventor/MarkerBitmaps.cpp index 7de7c862ab..888a6eb7f4 100644 --- a/src/Gui/Inventor/MarkerBitmaps.cpp +++ b/src/Gui/Inventor/MarkerBitmaps.cpp @@ -1231,8 +1231,9 @@ std::list MarkerBitmaps::getSupportedSizes(const std::string& name) { std::list sizes; for (const auto & it : markerIndex) { - if (it.first.first == name) + if (it.first.first == name) { sizes.push_back(it.first.second); + } } return sizes; } diff --git a/src/Gui/Inventor/MarkerBitmaps.h b/src/Gui/Inventor/MarkerBitmaps.h index bfec66dab7..3345b7b23a 100644 --- a/src/Gui/Inventor/MarkerBitmaps.h +++ b/src/Gui/Inventor/MarkerBitmaps.h @@ -26,6 +26,7 @@ #include #include #include +#include namespace Gui { namespace Inventor { @@ -42,7 +43,7 @@ private: private: using Marker = std::pair; - static std::map markerIndex; + static std::map markerIndex; // NOLINT }; } // namespace Inventor