Loading src/html.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -1858,12 +1858,27 @@ void libhtmlpp::HtmlTable::setHeader(int count,...){ } void libhtmlpp::HtmlTable::deleteRow(size_t pos){ Row *drow=&(*this)[pos]; try{ if (pos >= _count) return; if (pos == 0) { _firstRow = std::move(_firstRow->_nextRow); _lastRow = (pos == (_count - 1)) ? nullptr : _firstRow.get(); } else { Row *prev = &(*this)[pos - 1]; prev->_nextRow=std::move(drow->_nextRow); if (prev->_nextRow) { prev->_nextRow = std::move(prev->_nextRow->_nextRow); if (prev->_nextRow.get() == nullptr) { _lastRow = prev; } } } --_count; }catch(...){} if (_count == 0) { _firstRow = nullptr; _lastRow = nullptr; } } libhtmlpp::HtmlTable::Column::Column(){ Loading Loading @@ -1963,7 +1978,7 @@ void libhtmlpp::HtmlTable::Row::delColumn(size_t pos){ } void libhtmlpp::HtmlTable::Row::clear(){ _firstColumn.get_deleter(); _firstColumn.reset(); _lastColumn = nullptr; _count = 0; } Loading
src/html.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -1858,12 +1858,27 @@ void libhtmlpp::HtmlTable::setHeader(int count,...){ } void libhtmlpp::HtmlTable::deleteRow(size_t pos){ Row *drow=&(*this)[pos]; try{ if (pos >= _count) return; if (pos == 0) { _firstRow = std::move(_firstRow->_nextRow); _lastRow = (pos == (_count - 1)) ? nullptr : _firstRow.get(); } else { Row *prev = &(*this)[pos - 1]; prev->_nextRow=std::move(drow->_nextRow); if (prev->_nextRow) { prev->_nextRow = std::move(prev->_nextRow->_nextRow); if (prev->_nextRow.get() == nullptr) { _lastRow = prev; } } } --_count; }catch(...){} if (_count == 0) { _firstRow = nullptr; _lastRow = nullptr; } } libhtmlpp::HtmlTable::Column::Column(){ Loading Loading @@ -1963,7 +1978,7 @@ void libhtmlpp::HtmlTable::Row::delColumn(size_t pos){ } void libhtmlpp::HtmlTable::Row::clear(){ _firstColumn.get_deleter(); _firstColumn.reset(); _lastColumn = nullptr; _count = 0; }