diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 08348d9882..74bd546d2e 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -3442,25 +3442,28 @@ void ViewProviderSketch::clearSelectPoints(void) selection.SelPointSet.clear(); } -bool ViewProviderSketch::isSelected(std::string &subNameSuffix) const +bool ViewProviderSketch::isSelected(const std::string &subNameSuffix) const { - subNameSuffix = editSubName + getSketchObject()->convertSubName(subNameSuffix); - return Gui::Selection().isSelected(editDocName.c_str(), editObjName.c_str(), subNameSuffix.c_str()); + std::string subNameSuffix_ = editSubName + getSketchObject()->convertSubName(subNameSuffix); + return Gui::Selection().isSelected(editDocName.c_str(), editObjName.c_str(), subNameSuffix_.c_str()); } void ViewProviderSketch::rmvSelection(const std::string &subNameSuffix) const { - Gui::Selection().rmvSelection(editDocName.c_str(), editObjName.c_str(), subNameSuffix.c_str()); + std::string subNameSuffix_ = editSubName + getSketchObject()->convertSubName(subNameSuffix); + Gui::Selection().rmvSelection(editDocName.c_str(), editObjName.c_str(), subNameSuffix_.c_str()); } bool ViewProviderSketch::addSelection(const std::string &subNameSuffix, float x, float y, float z) const { - return Gui::Selection().addSelection(editDocName.c_str(), editObjName.c_str(), (editSubName+subNameSuffix).c_str(), x , y, z); + std::string subNameSuffix_ = editSubName + getSketchObject()->convertSubName(subNameSuffix); + return Gui::Selection().addSelection(editDocName.c_str(), editObjName.c_str(), subNameSuffix_.c_str(), x , y, z); } bool ViewProviderSketch::addSelection2(const std::string &subNameSuffix, float x, float y, float z) const { - return Gui::Selection().addSelection2(editDocName.c_str(), editObjName.c_str(), (editSubName+subNameSuffix).c_str(), x , y, z); + std::string subNameSuffix_ = editSubName + getSketchObject()->convertSubName(subNameSuffix); + return Gui::Selection().addSelection2(editDocName.c_str(), editObjName.c_str(), subNameSuffix_.c_str(), x , y, z); } bool ViewProviderSketch::addSelectionElement(const char *element, int index) const diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index 5a7887d5b9..410091c508 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -636,7 +636,7 @@ private: void removeSelectPoint(int SelectPoint); void clearSelectPoints(void); - bool isSelected(std::string & ss) const; + bool isSelected(const std::string &ss) const; void rmvSelection(const std::string &subNameSuffix) const; bool addSelection(const std::string &subNameSuffix, float x = 0, float y = 0, float z = 0) const; bool addSelection2(const std::string &subNameSuffix, float x = 0, float y = 0, float z = 0) const;