Some string cleanup
This commit is contained in:
16
src/form.cc
16
src/form.cc
@ -168,7 +168,7 @@ public:
|
||||
class DilloHtmlOptbase
|
||||
{
|
||||
public:
|
||||
virtual ~DilloHtmlOptbase () {};
|
||||
virtual ~DilloHtmlOptbase ()= default;
|
||||
virtual bool isSelected() {return false;}
|
||||
virtual bool select() {return false;}
|
||||
virtual const char *getValue() {return NULL;}
|
||||
@ -179,11 +179,10 @@ public:
|
||||
|
||||
class DilloHtmlOptgroup : public DilloHtmlOptbase {
|
||||
private:
|
||||
char *label;
|
||||
std::string label;
|
||||
bool enabled;
|
||||
public:
|
||||
DilloHtmlOptgroup (char *label, bool enabled);
|
||||
virtual ~DilloHtmlOptgroup ();
|
||||
DilloHtmlOptgroup (const std::string &label, bool enabled);
|
||||
void addSelf (SelectionResource *res)
|
||||
{res->pushGroup(label, enabled);}
|
||||
};
|
||||
@ -813,7 +812,7 @@ void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize)
|
||||
label = "";
|
||||
}
|
||||
|
||||
auto opt= std::make_unique< DilloHtmlOptgroup >( dStrdup( label.value().c_str() ), enabled );
|
||||
auto opt= std::make_unique< DilloHtmlOptgroup >( label.value(), enabled );
|
||||
|
||||
input->select->addOpt( std::move( opt ) );
|
||||
}
|
||||
@ -1897,17 +1896,12 @@ void DilloHtmlSelect::appendValuesTo (std::vector< std::string > &values, Select
|
||||
}
|
||||
}
|
||||
|
||||
DilloHtmlOptgroup::DilloHtmlOptgroup (char *label, bool enabled)
|
||||
DilloHtmlOptgroup::DilloHtmlOptgroup (const std::string &label, bool enabled)
|
||||
{
|
||||
this->label = label;
|
||||
this->enabled = enabled;
|
||||
}
|
||||
|
||||
DilloHtmlOptgroup::~DilloHtmlOptgroup ()
|
||||
{
|
||||
dFree(label);
|
||||
}
|
||||
|
||||
/*
|
||||
* DilloHtmlOption
|
||||
*/
|
||||
|
Reference in New Issue
Block a user