From bc641b66b9f721460688698bf3d7abdc1196ac22 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 30 Dec 2024 17:44:04 +0100 Subject: [PATCH] Gui: const correctness in ViewProviderPlane --- src/Gui/ViewProviderPlane.cpp | 8 ++++---- src/Gui/ViewProviderPlane.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Gui/ViewProviderPlane.cpp b/src/Gui/ViewProviderPlane.cpp index b11c95c68b..42864dbc00 100644 --- a/src/Gui/ViewProviderPlane.cpp +++ b/src/Gui/ViewProviderPlane.cpp @@ -152,7 +152,7 @@ void ViewProviderPlane::setLabelVisibility(bool val) labelSwitch->whichChild = val ? SO_SWITCH_ALL : SO_SWITCH_NONE; } -unsigned long ViewProviderPlane::getColor(std::string& role) +unsigned long ViewProviderPlane::getColor(const std::string& role) const { auto planesRoles = App::LocalCoordinateSystem::PlaneRoles; if (role == planesRoles[0]) { @@ -167,7 +167,7 @@ unsigned long ViewProviderPlane::getColor(std::string& role) return 0; } -std::string ViewProviderPlane::getLabelText(std::string& role) +std::string ViewProviderPlane::getLabelText(const std::string& role) const { std::string text; auto planesRoles = App::LocalCoordinateSystem::PlaneRoles; @@ -183,7 +183,7 @@ std::string ViewProviderPlane::getLabelText(std::string& role) return text; } -std::string ViewProviderPlane::getRole() +std::string ViewProviderPlane::getRole() const { // Note: Role property of App::Plane is not set yet when attaching. const char* name = pcObject->getNameInDocument(); @@ -199,4 +199,4 @@ std::string ViewProviderPlane::getRole() } return ""; -} \ No newline at end of file +} diff --git a/src/Gui/ViewProviderPlane.h b/src/Gui/ViewProviderPlane.h index eeb142a9ce..7246a9fe91 100644 --- a/src/Gui/ViewProviderPlane.h +++ b/src/Gui/ViewProviderPlane.h @@ -43,9 +43,9 @@ public: void attach (App::DocumentObject*) override; - unsigned long getColor(std::string& role); - std::string getRole(); - std::string getLabelText(std::string& role); + unsigned long getColor(const std::string& role) const; + std::string getRole() const; + std::string getLabelText(const std::string& role) const; void setLabelVisibility(bool val); private: