From bc945f27c9418c1860ee098526ceb207dceed558 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 22 Mar 2016 22:35:44 -0400 Subject: [PATCH] Remove duplicate function This was already defined in text.hpp, so I replaced it with that version. --- src/gui/dialogs/formula_debugger.cpp | 35 ++++++---------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/src/gui/dialogs/formula_debugger.cpp b/src/gui/dialogs/formula_debugger.cpp index f35b85628178..2c38eb525c42 100644 --- a/src/gui/dialogs/formula_debugger.cpp +++ b/src/gui/dialogs/formula_debugger.cpp @@ -26,27 +26,6 @@ #include -namespace { - -std::string pango_escape(std::string str) { - for(size_t i = str.size(); i > 0; i--) { - if(str[i-1] == '<') { - str.replace(i-1, 1, "<"); - } else if(str[i-1] == '>') { - str.replace(i-1, 1, ">"); - } else if(str[i-1] == '&') { - str.replace(i-1, 1, "&"); - } else if(str[i-1] == '"') { - str.replace(i-1, 1, """); - } else if(str[i-1] == '\'') { - str.replace(i-1, 1, "'"); - } - } - return str; -} - -} - namespace gui2 { @@ -101,8 +80,8 @@ void tformula_debugger::pre_show(twindow& window) stack_text << indent; } stack_text << "#" << i.counter() - << ": \"" << pango_escape(i.name()) - << "\": (" << pango_escape(i.str()) << ") " << std::endl; + << ": \"" << font::escape_text(i.name()) + << "\": (" << font::escape_text(i.str()) << ") " << std::endl; ++c; } @@ -122,14 +101,14 @@ void tformula_debugger::pre_show(twindow& window) } if(!i.evaluated()) { execution_text << "#" << i.counter() - << ": \"" << pango_escape(i.name()) - << "\": (" << pango_escape(i.str()) << ") " << std::endl; + << ": \"" << font::escape_text(i.name()) + << "\": (" << font::escape_text(i.str()) << ") " << std::endl; } else { execution_text << "#" << i.counter() - << ": \"" << pango_escape(i.name()) - << "\": (" << pango_escape(i.str()) << ") = " + << ": \"" << font::escape_text(i.name()) + << "\": (" << font::escape_text(i.str()) << ") = " << "" - << pango_escape(i.value().to_debug_string(NULL, false)) + << font::escape_text(i.value().to_debug_string(NULL, false)) << "" << std::endl; } }