From kde-commits Wed Mar 16 21:48:53 2005 From: Germain Garand Date: Wed, 16 Mar 2005 21:48:53 +0000 To: kde-commits Subject: kdelibs/khtml/html Message-Id: <20050316214853.3FDA417D06 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111100979224468 CVS commit by ggarand: implementation for HTMLElementImpl::setValue() (WC merge) M +8 -3 html_formimpl.cpp 1.429 --- kdelibs/khtml/html/html_formimpl.cpp #1.428:1.429 @@ -1947,9 +1947,14 @@ DOMString HTMLSelectElementImpl::value( } -void HTMLSelectElementImpl::setValue(DOMStringImpl* /*value*/) +void HTMLSelectElementImpl::setValue(DOMStringImpl* value) { - // ### find the option with value() matching the given parameter + // find the option with value() matching the given parameter // and make it the current selection. - kdWarning() << "Unimplemented HTMLSelectElementImpl::setValue called" << endl; + QMemArray items = listItems(); + for (unsigned i = 0; i < items.size(); i++) + if (items[i]->id() == ID_OPTION && static_cast(items[i])->value() == value) { + static_cast(items[i])->setSelected(true); + return; + } }