Another container.
This commit is contained in:
22
src/html.cc
22
src/html.cc
@ -239,8 +239,8 @@ void a_Html_load_images(void *v_html, DilloUrl *pattern)
|
|||||||
*/
|
*/
|
||||||
static bool Html_contains_form(DilloHtml *html, void *v_form)
|
static bool Html_contains_form(DilloHtml *html, void *v_form)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < html->forms->size(); i++) {
|
for (std::size_t i = 0; i < html->forms.size(); i++) {
|
||||||
if (html->forms->get(i) == v_form) {
|
if (html->forms.at(i) == v_form) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,7 +504,7 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
|
|||||||
visited_color = -1;
|
visited_color = -1;
|
||||||
|
|
||||||
/* Init page-handling variables */
|
/* Init page-handling variables */
|
||||||
forms = new misc::SimpleVector <DilloHtmlForm*> (1);
|
forms.reserve(1);
|
||||||
inputs_outside_form = new misc::SimpleVector <DilloHtmlInput*> (1);
|
inputs_outside_form = new misc::SimpleVector <DilloHtmlInput*> (1);
|
||||||
links.reserve(64);
|
links.reserve(64);
|
||||||
images = new misc::SimpleVector <DilloHtmlImage*> (16);
|
images = new misc::SimpleVector <DilloHtmlImage*> (16);
|
||||||
@ -547,9 +547,9 @@ DilloHtml::~DilloHtml()
|
|||||||
a_Url_free(cssUrls->get(i));
|
a_Url_free(cssUrls->get(i));
|
||||||
delete (cssUrls);
|
delete (cssUrls);
|
||||||
|
|
||||||
for (int i = 0; i < forms->size(); i++)
|
for (std::size_t i = 0; i < forms.size(); i++)
|
||||||
a_Html_form_delete (forms->get(i));
|
a_Html_form_delete (forms.at(i));
|
||||||
delete(forms);
|
forms.clear();
|
||||||
|
|
||||||
for (int i = 0; i < inputs_outside_form->size(); i++)
|
for (int i = 0; i < inputs_outside_form->size(); i++)
|
||||||
a_Html_input_delete(inputs_outside_form->get(i));
|
a_Html_input_delete(inputs_outside_form->get(i));
|
||||||
@ -673,11 +673,11 @@ int DilloHtml::formNew(DilloHtmlMethod method, const DilloUrl *action,
|
|||||||
bool enabled = bw->NumPendingStyleSheets == 0;
|
bool enabled = bw->NumPendingStyleSheets == 0;
|
||||||
DilloHtmlForm *form = a_Html_form_new (this, method, action,
|
DilloHtmlForm *form = a_Html_form_new (this, method, action,
|
||||||
enc, charset, enabled);
|
enc, charset, enabled);
|
||||||
int nf = forms->size ();
|
int nf = forms.size ();
|
||||||
forms->increase ();
|
(void) nf;
|
||||||
forms->set (nf, form);
|
forms.emplace_back (form);
|
||||||
_MSG("Html formNew: action=%s nform=%d\n", action, nf);
|
_MSG("Html formNew: action=%s nform=%d\n", action, nf);
|
||||||
return forms->size();
|
return forms.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -685,7 +685,7 @@ int DilloHtml::formNew(DilloHtmlMethod method, const DilloUrl *action,
|
|||||||
*/
|
*/
|
||||||
DilloHtmlForm *DilloHtml::getCurrentForm ()
|
DilloHtmlForm *DilloHtml::getCurrentForm ()
|
||||||
{
|
{
|
||||||
return forms->get (forms->size() - 1);
|
return forms.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t DilloHtml::unloadedImages()
|
bool_t DilloHtml::unloadedImages()
|
||||||
|
|||||||
@ -213,7 +213,7 @@ public: //BUG: for now everything is public
|
|||||||
/* -------------------------------------------------------------------*/
|
/* -------------------------------------------------------------------*/
|
||||||
/* Variables required after parsing (for page functionality) */
|
/* Variables required after parsing (for page functionality) */
|
||||||
/* -------------------------------------------------------------------*/
|
/* -------------------------------------------------------------------*/
|
||||||
lout::misc::SimpleVector<DilloHtmlForm*> *forms;
|
std::vector< DilloHtmlForm * > forms;
|
||||||
lout::misc::SimpleVector<DilloHtmlInput*> *inputs_outside_form;
|
lout::misc::SimpleVector<DilloHtmlInput*> *inputs_outside_form;
|
||||||
std::vector< std::unique_ptr< DilloUrl > > links;
|
std::vector< std::unique_ptr< DilloUrl > > links;
|
||||||
lout::misc::SimpleVector<DilloHtmlImage*> *images;
|
lout::misc::SimpleVector<DilloHtmlImage*> *images;
|
||||||
|
|||||||
Reference in New Issue
Block a user