Loading src/html.cpp +7 −6 Changes for src/html.cpp: 7 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ namespace libhtmlpp { DocElements() { nextel = nullptr; prevel = nullptr; element.eltext = nullptr; terminator = false; spos = 0; epos = 0; Loading Loading @@ -203,7 +202,7 @@ libhtmlpp::HtmlElement* libhtmlpp::HtmlString::_buildTree(ssize_t& pos) { (HtmlElement**) &lastEl->element.elhtml); if(i+1 < _HTableSize){ if(_HTable[i][2]-_HTable[i+1][1]<1){ if(_HTable[i+1][1]-_HTable[i][2]<0){ lastEl->nextel = new DocElements; lastEl->nextel->prevel = lastEl; lastEl = lastEl->nextel; Loading @@ -222,7 +221,6 @@ libhtmlpp::HtmlElement* libhtmlpp::HtmlString::_buildTree(ssize_t& pos) { lasthel->_nextElement = curel->element.elhtml; lasthel->_nextElement->_prevElement = lasthel; lasthel = (HtmlElement*) lasthel->_nextElement; lasthel->_Type=HtmlEl; }else { firsthel=(HtmlElement*)curel->element.elhtml; lasthel = firsthel; Loading Loading @@ -427,9 +425,10 @@ libhtmlpp::HtmlElement::HtmlElement(const char *tagname){ } libhtmlpp::HtmlElement::~HtmlElement(){ if(_Type==HtmlEl){ delete _firstAttr; delete _childElement; delete _nextElement; } } libhtmlpp::HtmlPage::HtmlPage(){ Loading Loading @@ -535,7 +534,7 @@ void libhtmlpp::print(Element* el, HtmlElement* parent,std::string& output) { } if (el->_nextElement) { print((HtmlElement*)el->_nextElement,parent,output); print(el->_nextElement,parent,output); }else if(parent){ output.append("</"); output.append(parent->_TagName); Loading @@ -547,7 +546,7 @@ void libhtmlpp::print(Element* el, HtmlElement* parent,std::string& output) { output.append(((TextElement*)el)->_Text); if (el->_nextElement) { print((HtmlElement*)el->_nextElement,parent,output); print(el->_nextElement,parent,output); } }break; Loading Loading @@ -620,4 +619,6 @@ libhtmlpp::HtmlDivLayer::~HtmlDivLayer(){ libhtmlpp::TextElement::TextElement(){ _Type=TextEl; _nextElement=nullptr; _prevElement=nullptr; } src/html.h +4 −0 Changes for src/html.h: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ namespace libhtmlpp { Element* _nextElement; int _Type; virtual ~Element(){ delete _nextElement; }; friend class HtmlString; friend void print(Element* el, HtmlElement* parent,std::string &output); }; Loading Loading
src/html.cpp +7 −6 Changes for src/html.cpp: 7 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ namespace libhtmlpp { DocElements() { nextel = nullptr; prevel = nullptr; element.eltext = nullptr; terminator = false; spos = 0; epos = 0; Loading Loading @@ -203,7 +202,7 @@ libhtmlpp::HtmlElement* libhtmlpp::HtmlString::_buildTree(ssize_t& pos) { (HtmlElement**) &lastEl->element.elhtml); if(i+1 < _HTableSize){ if(_HTable[i][2]-_HTable[i+1][1]<1){ if(_HTable[i+1][1]-_HTable[i][2]<0){ lastEl->nextel = new DocElements; lastEl->nextel->prevel = lastEl; lastEl = lastEl->nextel; Loading @@ -222,7 +221,6 @@ libhtmlpp::HtmlElement* libhtmlpp::HtmlString::_buildTree(ssize_t& pos) { lasthel->_nextElement = curel->element.elhtml; lasthel->_nextElement->_prevElement = lasthel; lasthel = (HtmlElement*) lasthel->_nextElement; lasthel->_Type=HtmlEl; }else { firsthel=(HtmlElement*)curel->element.elhtml; lasthel = firsthel; Loading Loading @@ -427,9 +425,10 @@ libhtmlpp::HtmlElement::HtmlElement(const char *tagname){ } libhtmlpp::HtmlElement::~HtmlElement(){ if(_Type==HtmlEl){ delete _firstAttr; delete _childElement; delete _nextElement; } } libhtmlpp::HtmlPage::HtmlPage(){ Loading Loading @@ -535,7 +534,7 @@ void libhtmlpp::print(Element* el, HtmlElement* parent,std::string& output) { } if (el->_nextElement) { print((HtmlElement*)el->_nextElement,parent,output); print(el->_nextElement,parent,output); }else if(parent){ output.append("</"); output.append(parent->_TagName); Loading @@ -547,7 +546,7 @@ void libhtmlpp::print(Element* el, HtmlElement* parent,std::string& output) { output.append(((TextElement*)el)->_Text); if (el->_nextElement) { print((HtmlElement*)el->_nextElement,parent,output); print(el->_nextElement,parent,output); } }break; Loading Loading @@ -620,4 +619,6 @@ libhtmlpp::HtmlDivLayer::~HtmlDivLayer(){ libhtmlpp::TextElement::TextElement(){ _Type=TextEl; _nextElement=nullptr; _prevElement=nullptr; }
src/html.h +4 −0 Changes for src/html.h: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ namespace libhtmlpp { Element* _nextElement; int _Type; virtual ~Element(){ delete _nextElement; }; friend class HtmlString; friend void print(Element* el, HtmlElement* parent,std::string &output); }; Loading