Another container.

This commit is contained in:
2025-03-02 23:44:14 -05:00
parent 7c3f2c1535
commit df45103126
2 changed files with 12 additions and 12 deletions

View File

@ -239,8 +239,8 @@ void a_Html_load_images(void *v_html, DilloUrl *pattern)
*/
static bool Html_contains_form(DilloHtml *html, void *v_form)
{
for (int i = 0; i < html->forms->size(); i++) {
if (html->forms->get(i) == v_form) {
for (std::size_t i = 0; i < html->forms.size(); i++) {
if (html->forms.at(i) == v_form) {
return true;
}
}
@ -504,7 +504,7 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
visited_color = -1;
/* Init page-handling variables */
forms = new misc::SimpleVector <DilloHtmlForm*> (1);
forms.reserve(1);
inputs_outside_form = new misc::SimpleVector <DilloHtmlInput*> (1);
links.reserve(64);
images = new misc::SimpleVector <DilloHtmlImage*> (16);
@ -547,9 +547,9 @@ DilloHtml::~DilloHtml()
a_Url_free(cssUrls->get(i));
delete (cssUrls);
for (int i = 0; i < forms->size(); i++)
a_Html_form_delete (forms->get(i));
delete(forms);
for (std::size_t i = 0; i < forms.size(); i++)
a_Html_form_delete (forms.at(i));
forms.clear();
for (int i = 0; i < inputs_outside_form->size(); 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;
DilloHtmlForm *form = a_Html_form_new (this, method, action,
enc, charset, enabled);
int nf = forms->size ();
forms->increase ();
forms->set (nf, form);
int nf = forms.size ();
(void) nf;
forms.emplace_back (form);
_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 ()
{
return forms->get (forms->size() - 1);
return forms.back();
}
bool_t DilloHtml::unloadedImages()

View File

@ -213,7 +213,7 @@ public: //BUG: for now everything is public
/* -------------------------------------------------------------------*/
/* Variables required after parsing (for page functionality) */
/* -------------------------------------------------------------------*/
lout::misc::SimpleVector<DilloHtmlForm*> *forms;
std::vector< DilloHtmlForm * > forms;
lout::misc::SimpleVector<DilloHtmlInput*> *inputs_outside_form;
std::vector< std::unique_ptr< DilloUrl > > links;
lout::misc::SimpleVector<DilloHtmlImage*> *images;