Commit 95a6ad2d authored by jan.koester's avatar jan.koester
Browse files

added new copy method

parent fe3f6b0b
Loading
Loading
Loading
Loading
+9 −0
Changes for src/html.cpp: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -561,6 +561,15 @@ void libhtmlpp::HtmlElement::appendChild(libhtmlpp::Element* el){
    }
}


libhtmlpp::HtmlElement & libhtmlpp::HtmlElement::operator=(const libhtmlpp::Element hel){
    delete _firstAttr;
    delete _childElement;
    delete _nextElement;
    _copy(nullptr,this,&hel);
    return *this;
}

libhtmlpp::HtmlElement & libhtmlpp::HtmlElement::operator=(const libhtmlpp::Element& hel){
    delete _firstAttr;
    delete _childElement;
+1 −0
Changes for src/html.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ namespace libhtmlpp {
        HtmlElement(const HtmlElement &hel);
        ~HtmlElement();

        HtmlElement& operator=(const Element  hel);
        HtmlElement& operator=(const Element &hel);
        HtmlElement& operator=(const Element *hel);

+1 −1
Changes for test/htmlcopytest.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
class HtmlCopy{
public:
    HtmlCopy(libhtmlpp::Element *index){
        index2=*index;
        index2=index;
        libhtmlpp::HtmlElement  el("span");
        el.setAttribute("id","txt3");
        libhtmlpp::HtmlElement *body=index2.getElementbyTag("body");