Loading src/html.cpp +15 −15 Original line number Diff line number Diff line Loading @@ -534,10 +534,9 @@ void libhtmlpp::HtmlString::_parseTree(){ } void libhtmlpp::HtmlEncode(const char* input, std::string &output){ HtmlString *tmp=new HtmlString; HtmlEncode(input,tmp); output=tmp->c_str(); delete tmp; HtmlString tmp(output); HtmlEncode(input,&tmp); output=tmp.c_str(); } void libhtmlpp::HtmlEncode(const char* input, HtmlString* output){ Loading Loading @@ -799,27 +798,27 @@ int libhtmlpp::Element::getType() const{ libhtmlpp::Element::Element(){ _prevElement=nullptr; _nextElement=nullptr; _firstElement=nullptr; _Type=-1; } libhtmlpp::Element::Element(const libhtmlpp::Element& el){ _prevElement=nullptr; _nextElement=nullptr; _firstElement=nullptr; _Type=-1; _copy(this,&el); } libhtmlpp::Element::~Element(){ std::stack<Element*> el; for(Element *curel=this; curel; curel=curel->nextElement()){ if(curel->_prevElement) curel->_prevElement->_nextElement=nullptr; el.push(curel); if(this==_firstElement){ Element *curel=this; while(curel){ Element *next=curel->_nextElement; curel->_nextElement=nullptr; delete curel; curel=next; } while(!el.empty()){ delete el.top(); el.pop(); } }; Loading @@ -827,7 +826,8 @@ libhtmlpp::TextElement::TextElement() : Element(){ _Type=TextEl; } libhtmlpp::TextElement::TextElement(const TextElement &texel) : TextElement(){ libhtmlpp::TextElement::TextElement(const TextElement &texel) : Element(){ _Type=TextEl; _copy(this,&texel); } Loading src/html.h +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ namespace libhtmlpp { protected: Element* _prevElement; Element* _nextElement; Element* _firstElement; int _Type; friend class HtmlElement; Loading Loading
src/html.cpp +15 −15 Original line number Diff line number Diff line Loading @@ -534,10 +534,9 @@ void libhtmlpp::HtmlString::_parseTree(){ } void libhtmlpp::HtmlEncode(const char* input, std::string &output){ HtmlString *tmp=new HtmlString; HtmlEncode(input,tmp); output=tmp->c_str(); delete tmp; HtmlString tmp(output); HtmlEncode(input,&tmp); output=tmp.c_str(); } void libhtmlpp::HtmlEncode(const char* input, HtmlString* output){ Loading Loading @@ -799,27 +798,27 @@ int libhtmlpp::Element::getType() const{ libhtmlpp::Element::Element(){ _prevElement=nullptr; _nextElement=nullptr; _firstElement=nullptr; _Type=-1; } libhtmlpp::Element::Element(const libhtmlpp::Element& el){ _prevElement=nullptr; _nextElement=nullptr; _firstElement=nullptr; _Type=-1; _copy(this,&el); } libhtmlpp::Element::~Element(){ std::stack<Element*> el; for(Element *curel=this; curel; curel=curel->nextElement()){ if(curel->_prevElement) curel->_prevElement->_nextElement=nullptr; el.push(curel); if(this==_firstElement){ Element *curel=this; while(curel){ Element *next=curel->_nextElement; curel->_nextElement=nullptr; delete curel; curel=next; } while(!el.empty()){ delete el.top(); el.pop(); } }; Loading @@ -827,7 +826,8 @@ libhtmlpp::TextElement::TextElement() : Element(){ _Type=TextEl; } libhtmlpp::TextElement::TextElement(const TextElement &texel) : TextElement(){ libhtmlpp::TextElement::TextElement(const TextElement &texel) : Element(){ _Type=TextEl; _copy(this,&texel); } Loading
src/html.h +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ namespace libhtmlpp { protected: Element* _prevElement; Element* _nextElement; Element* _firstElement; int _Type; friend class HtmlElement; Loading