From aec8199bc38e2017915dbe26031bbcc221a65dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Skowro=C5=84ski?= Date: Thu, 25 Apr 2024 11:45:30 +0200 Subject: [PATCH] Fix for removeMarkups() --- src/Gui/3Dconnexion/navlib/NavlibCmds.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Gui/3Dconnexion/navlib/NavlibCmds.cpp b/src/Gui/3Dconnexion/navlib/NavlibCmds.cpp index be806947d1..75f84e7765 100644 --- a/src/Gui/3Dconnexion/navlib/NavlibCmds.cpp +++ b/src/Gui/3Dconnexion/navlib/NavlibCmds.cpp @@ -113,10 +113,11 @@ void NavlibInterface::removeMarkups(std::string& text) const if (markupEnd == text.cend()) return; - if (*std::prev(markupEnd) == 'p') - text.insert(std::next(markupEnd), 2, '\n'); - + const char enclosingChar = *std::prev(markupEnd); textBegin = text.erase(markupBegin, ++markupEnd); + + if(enclosingChar == 'p') + textBegin = text.insert(textBegin, 2, '\n'); } }