diff --git a/src/Mod/TechDraw/App/DrawSVGTemplate.cpp b/src/Mod/TechDraw/App/DrawSVGTemplate.cpp index 2984697b0..8019dc43c 100644 --- a/src/Mod/TechDraw/App/DrawSVGTemplate.cpp +++ b/src/Mod/TechDraw/App/DrawSVGTemplate.cpp @@ -191,6 +191,7 @@ App::DocumentObjectExecReturn * DrawSVGTemplate::execute(void) inTemplate.close(); string outfragment(copyTemplate.str()); + std::string newfragment = outfragment; // update EditableText SVG clauses with Property values std::map subs = EditableTexts.getValues(); @@ -203,12 +204,12 @@ App::DocumentObjectExecReturn * DrawSVGTemplate::execute(void) boost::match_results what; // Find editable texts - while (boost::regex_search(begin, end, what, e1)) { + while (boost::regex_search(begin, end, what, e1)) { //search in outfragment // if we have a replacement value for the text we've found if (subs.count(what[1].str())) { // change it to specified value boost::regex e2 ("((.*?)()"); - outfragment = boost::regex_replace(outfragment, e2, "$1>" + subs[what[1].str()] + "$3"); + newfragment = boost::regex_replace(newfragment, e2, "$1>" + subs[what[1].str()] + "$3"); //replace in newfragment } begin = what[0].second; } @@ -218,7 +219,7 @@ App::DocumentObjectExecReturn * DrawSVGTemplate::execute(void) // restoring linebreaks and saving the file boost::regex e3 ("--endOfLine--"); string fmt = "\\n"; - outfragment = boost::regex_replace(outfragment, e3, fmt); + outfragment = boost::regex_replace(newfragment, e3, fmt); const QString qsOut = QString::fromStdString(outfragment); QDomDocument doc(QString::fromAscii("mydocument")); diff --git a/src/Mod/TechDraw/App/DrawViewSymbol.cpp b/src/Mod/TechDraw/App/DrawViewSymbol.cpp index 3273fe6cc..898c255d8 100644 --- a/src/Mod/TechDraw/App/DrawViewSymbol.cpp +++ b/src/Mod/TechDraw/App/DrawViewSymbol.cpp @@ -90,7 +90,8 @@ App::DocumentObjectExecReturn *DrawViewSymbol::execute(void) std::string svg = Symbol.getValue(); const std::vector& editText = EditableTexts.getValues(); - if (!editText.empty()) { + if (!editText.empty()) { + //TODO: has this ever been run? boost::regex e1 ("(.*?)"); string::const_iterator begin, end; begin = svg.begin();