fix CID 1596595: Resource leaks, and CID 1596594: (CHECKED_RETURN)
[claws.git] / src / plugins / litehtml_viewer / litehtml / el_style.cpp
1 #include "html.h"
2 #include "el_style.h"
3 #include "document.h"
4
5
6 litehtml::el_style::el_style(const std::shared_ptr<litehtml::document>& doc) : litehtml::element(doc)
7 {
8
9 }
10
11 litehtml::el_style::~el_style()
12 {
13
14 }
15
16 void litehtml::el_style::parse_attributes()
17 {
18         tstring text;
19
20         for(auto& el : m_children)
21         {
22                 el->get_text(text);
23         }
24         get_document()->add_stylesheet( text.c_str(), 0, get_attr(_t("media")) );
25 }
26
27 bool litehtml::el_style::appendChild(const ptr &el)
28 {
29         m_children.push_back(el);
30         return true;
31 }
32
33 const litehtml::tchar_t* litehtml::el_style::get_tagName() const
34 {
35         return _t("style");
36 }