From 6faae0aa125f8c6bd60fc50b444ad22583a79c52 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 3 Apr 2020 14:29:57 +0200 Subject: [PATCH] + Fixed clear_marked_string() --- src/slic3r/GUI/Search.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index 9c3a79f3c2..e2e6f864e6 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -152,12 +152,11 @@ static void clear_marked_string(wxString& str) { // Check if the string has a several ColorMarkerStart in a row and replace them to only one, if any wxString delete_string = wxString::Format("%c%c", ImGui::ColorMarkerStart, ImGui::ColorMarkerStart); - if (str.Replace(delete_string, ImGui::ColorMarkerStart, true) != 0) { - // If there were several ColorMarkerStart in a row, it means there should be a several ColorMarkerStop in a row, - // replace them to only one - delete_string = wxString::Format("%c%c", ImGui::ColorMarkerEnd, ImGui::ColorMarkerEnd); - str.Replace(delete_string, ImGui::ColorMarkerEnd, true); - } + str.Replace(delete_string, ImGui::ColorMarkerStart, true); + // If there were several ColorMarkerStart in a row, it means there should be a several ColorMarkerStop in a row, + // replace them to only one + delete_string = wxString::Format("%c%c", ImGui::ColorMarkerEnd, ImGui::ColorMarkerEnd); + str.Replace(delete_string, ImGui::ColorMarkerEnd, true); // And we should to remove redundant ColorMarkers, if they are in "End, Start" sequence in a row delete_string = wxString::Format("%c%c", ImGui::ColorMarkerEnd, ImGui::ColorMarkerStart);