From c89a9d3d26c69efe39a75c8106308ae2e03aec94 Mon Sep 17 00:00:00 2001 From: Andrea Iacovitti Date: Sat, 20 Dec 2014 12:36:52 +0100 Subject: [PATCH] Unneeded DOMString->QString conversion and check. --- khtml/html/html_formimpl.cpp | 7 ++----- khtml/rendering/render_form.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/khtml/html/html_formimpl.cpp b/khtml/html/html_formimpl.cpp index 7f813c6ebd..abf2075fbb 100644 --- a/khtml/html/html_formimpl.cpp +++ b/khtml/html/html_formimpl.cpp @@ -2518,10 +2518,7 @@ bool HTMLSelectElementImpl::encoding(const QTextCodec* codec, khtml::encodingLis (items[0]->id() == ID_OPTION && !items[0]->disabled()) ) { HTMLOptionElementImpl* const option = static_cast(items[0]); encoded_values += enc_name; - if (option->value().isNull()) - encoded_values += fixUpfromUnicode(codec, option->text().string()); - else - encoded_values += fixUpfromUnicode(codec, option->value().string()); + encoded_values += fixUpfromUnicode(codec, option->value().string()); successful = true; } @@ -2801,7 +2798,7 @@ DOMString HTMLOptionElementImpl::value() const if ( !m_value.isNull() ) return m_value; // Use the text if the value wasn't set. - return text().string(); + return text(); } void HTMLOptionElementImpl::setValue(DOMStringImpl* value) diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp index f6e667b1e0..3a09009b74 100644 --- a/khtml/rendering/render_form.cpp +++ b/khtml/rendering/render_form.cpp @@ -1856,7 +1856,7 @@ void RenderSelect::updateFromElement() // Prefer label if set DOMString label = optElem->getAttribute(ATTR_LABEL); if (!label.isEmpty()) - domText = label.string(); + domText = label; domText = domText.implementation()->collapseWhiteSpace(false, false); QString text; -- GitLab