Loading src/html.cpp +26 −23 Original line number Diff line number Diff line Loading @@ -606,7 +606,10 @@ libhtmlpp::HtmlElement & libhtmlpp::HtmlElement::operator=(const libhtmlpp::Elem } namespace libhtmlpp { void _copy(const libhtmlpp::Element* prev,libhtmlpp::Element *dest,const libhtmlpp::Element *src){ auto copy_r = [](const libhtmlpp::Element* prev,libhtmlpp::Element *dest,const libhtmlpp::Element *src){ if(src->getType()==libhtmlpp::HtmlEl && dest->getType()==libhtmlpp::HtmlEl){ libhtmlpp::HtmlElement *hdest=(libhtmlpp::HtmlElement*)dest; libhtmlpp::HtmlElement *hsrc=(libhtmlpp::HtmlElement*)src; Loading @@ -626,16 +629,16 @@ namespace libhtmlpp { } dest->_prevElement=(Element*)prev; }; const Element* next=src->nextElement(); copy_r(prev,dest,src); if(next){ if(next->getType()==HtmlEl) for(const Element* curel=src->nextElement(); curel; curel=curel->nextElement()){ if(curel->getType()==HtmlEl) dest->_nextElement= new HtmlElement(); else if(next->getType()==TextEl) else if(curel->getType()==TextEl) dest->_nextElement= new TextElement(); std::thread ct(_copy,src,dest->_nextElement,next); ct.join(); copy_r(src,dest->_nextElement,curel); } } }; Loading Loading
src/html.cpp +26 −23 Original line number Diff line number Diff line Loading @@ -606,7 +606,10 @@ libhtmlpp::HtmlElement & libhtmlpp::HtmlElement::operator=(const libhtmlpp::Elem } namespace libhtmlpp { void _copy(const libhtmlpp::Element* prev,libhtmlpp::Element *dest,const libhtmlpp::Element *src){ auto copy_r = [](const libhtmlpp::Element* prev,libhtmlpp::Element *dest,const libhtmlpp::Element *src){ if(src->getType()==libhtmlpp::HtmlEl && dest->getType()==libhtmlpp::HtmlEl){ libhtmlpp::HtmlElement *hdest=(libhtmlpp::HtmlElement*)dest; libhtmlpp::HtmlElement *hsrc=(libhtmlpp::HtmlElement*)src; Loading @@ -626,16 +629,16 @@ namespace libhtmlpp { } dest->_prevElement=(Element*)prev; }; const Element* next=src->nextElement(); copy_r(prev,dest,src); if(next){ if(next->getType()==HtmlEl) for(const Element* curel=src->nextElement(); curel; curel=curel->nextElement()){ if(curel->getType()==HtmlEl) dest->_nextElement= new HtmlElement(); else if(next->getType()==TextEl) else if(curel->getType()==TextEl) dest->_nextElement= new TextElement(); std::thread ct(_copy,src,dest->_nextElement,next); ct.join(); copy_r(src,dest->_nextElement,curel); } } }; Loading