diff --git a/src/Mod/TechDraw/App/DrawViewSymbol.cpp b/src/Mod/TechDraw/App/DrawViewSymbol.cpp index ad87ecc2d209..afec6bc3fcf6 100644 --- a/src/Mod/TechDraw/App/DrawViewSymbol.cpp +++ b/src/Mod/TechDraw/App/DrawViewSymbol.cpp @@ -65,6 +65,8 @@ void DrawViewSymbol::onChanged(const App::Property* prop) { if (prop == &Symbol) { if (!isRestoring()) { + //this pulls the initial values from svg into editabletexts + // should only happen first time?? extra loop onChanged->execute->onChanged std::vector eds; std::string svg = Symbol.getValue(); if (!svg.empty()) { @@ -89,34 +91,27 @@ App::DocumentObjectExecReturn *DrawViewSymbol::execute(void) std::string svg = Symbol.getValue(); const std::vector& editText = EditableTexts.getValues(); + //this pushes the editabletexts into the svg + std::string newsvg = svg; if (!editText.empty()) { - //TODO: has this ever been run? boost::regex e1 ("(.*?)"); string::const_iterator begin, end; begin = svg.begin(); end = svg.end(); boost::match_results what; std::size_t count = 0; - std::string newsvg; - newsvg.reserve(svg.size()); while (boost::regex_search(begin, end, what, e1)) { if (count < editText.size()) { - // change values of editable texts. Also strip the "freecad:editable" - // attribute so it isn't detected by the page - boost::regex e2 ("((.*?)()"); - std::back_insert_iterator out(newsvg); - boost::regex_replace(out, begin, what[0].second, e2, "$1$3>"+editText[count]+"$5"); + boost::regex e2 ("((.*?)()"); + newsvg = boost::regex_replace(newsvg, e2, "$1>" + editText[count] + "$3"); } count++; begin = what[0].second; } - // now copy the rest - newsvg.insert(newsvg.end(), begin, end); - svg = newsvg; } - //TODO: shouldn't there be a Symbol.setValue(svg) here??? -wf + Symbol.setValue(newsvg); return DrawView::execute(); } diff --git a/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/flatness_editable.svg b/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/flatness_editable.svg new file mode 100644 index 000000000000..9ad0d6644883 --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/flatness_editable.svg @@ -0,0 +1,110 @@ + + + + + Flatness + + + + + image/svg+xml + + Flatness + + + bavariaSHAPE + + + + + bavariaSHAPE + + + + + bavariaSHAPE + + + 15.10.2016 + Geometric dimensioning and tolerancing symbols +All symbols in this repository are licensed under CC-BY 3.0 + + + + + + + + + + + + + + + + + + + 0.000 + + + + diff --git a/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/reference_editable.svg b/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/reference_editable.svg new file mode 100644 index 000000000000..17fdf261179a --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/reference_editable.svg @@ -0,0 +1,99 @@ + + + + + Reference + + + + + image/svg+xml + + Angularity + + + bavariaSHAPE + + + + + bavariaSHAPE + + + + + bavariaSHAPE + + + 15.10.2016 + Geometric dimensioning and tolerancing symbols +All symbols in this repository are licensed under CC-BY 3.0 + + + + + + + + + + + + + + + + + + A + + + + + diff --git a/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/tolerance_editable.svg b/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/tolerance_editable.svg new file mode 100644 index 000000000000..f890bbe33893 --- /dev/null +++ b/src/Mod/TechDraw/Gui/Resources/ToleranceSymbols/tolerance_editable.svg @@ -0,0 +1,111 @@ + + + + + Frame 4 Symbol + + + + + + image/svg+xml + + Frame 4 Symbol + + + bavariaSHAPE + + + + + bavariaSHAPE + + + + + bavariaSHAPE + + + 15.10.2016 + Geometric dimensioning and tolerancing + + + + + + + 0.01 + + + +