From 560378aaca1784ba19806a0414a32b20c744de39 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 3 Jan 2011 04:12:51 +0000 Subject: Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1 NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- khtml/html/html_formimpl.cpp | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'khtml/html/html_formimpl.cpp') diff --git a/khtml/html/html_formimpl.cpp b/khtml/html/html_formimpl.cpp index a72df3743..6ace551ff 100644 --- a/khtml/html/html_formimpl.cpp +++ b/khtml/html/html_formimpl.cpp @@ -122,8 +122,8 @@ static TQCString encodeCString(const TQCString& e) // http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1 // safe characters like NS handles them for compatibility static const char *safe = "-._*"; - TQCString encoded(( e.length()+e.contains( '\n' ) )*3 - +e.contains('\r') * 3 + 1); + TQCString encoded(( e.length()+e.tqcontains( '\n' ) )*3 + +e.tqcontains('\r') * 3 + 1); int enclen = 0; bool crmissing = false; unsigned char oldc; @@ -193,7 +193,7 @@ inline static TQString escapeUnencodeable(const TQTextCodec* codec, const TQStri enc_string.append(c); else { TQString ampersandEscape; - ampersandEscape.sprintf("&#%u;", c.unicode()); + ampersandEscape.sprintf("&#%u;", c.tqunicode()); enc_string.append(ampersandEscape); } } @@ -216,7 +216,7 @@ TQByteArray HTMLFormElementImpl::formData(bool& ok) TQByteArray form_data(0); TQCString enc_string = ""; // used for non-multipart data - // find out the QTextcodec to use + // tqfind out the QTextcodec to use const TQString str = m_acceptcharset.string(); const TQChar space(' '); const unsigned int strLength = str.length(); @@ -231,7 +231,7 @@ TQByteArray HTMLFormElementImpl::formData(bool& ok) for ( ; it != itEnd; ++it ) { TQString enc = (*it); - if(enc.contains("UNKNOWN")) + if(enc.tqcontains("UNKNOWN")) { // use standard document encoding enc = "ISO 8859-1"; @@ -391,12 +391,12 @@ TQByteArray HTMLFormElementImpl::formData(bool& ok) void HTMLFormElementImpl::setEnctype( const DOMString& type ) { - if(type.string().find("multipart", 0, false) != -1 || type.string().find("form-data", 0, false) != -1) + if(type.string().tqfind("multipart", 0, false) != -1 || type.string().tqfind("form-data", 0, false) != -1) { m_enctype = "multipart/form-data"; m_multipart = true; m_post = true; - } else if (type.string().find("text", 0, false) != -1 || type.string().find("plain", 0, false) != -1) + } else if (type.string().tqfind("text", 0, false) != -1 || type.string().tqfind("plain", 0, false) != -1) { m_enctype = "text/plain"; m_multipart = false; @@ -457,7 +457,7 @@ void HTMLFormElementImpl::walletOpened(KWallet::Wallet *w) { if ((current->inputType() == HTMLInputElementImpl::PASSWORD || current->inputType() == HTMLInputElementImpl::TEXT) && !current->readOnly() && - map.contains(current->name().string())) { + map.tqcontains(current->name().string())) { getDocument()->setFocusNode(current); current->setValue(map[current->name().string()]); } @@ -888,7 +888,7 @@ HTMLFormElementImpl *HTMLGenericFormElementImpl::getForm() const p = p->parentNode(); } #ifdef FORMS_DEBUG - kdDebug( 6030 ) << "couldn't find form!" << endl; + kdDebug( 6030 ) << "couldn't tqfind form!" << endl; kdDebug( 6030 ) << kdBacktrace() << endl; #endif return 0; @@ -1316,10 +1316,10 @@ TQString HTMLInputElementImpl::state( ) { switch (m_type) { case PASSWORD: - return TQString::fromLatin1("."); // empty string, avoid restoring + return TQString::tqfromLatin1("."); // empty string, avoid restoring case CHECKBOX: case RADIO: - return TQString::fromLatin1(checked() ? "on" : "off"); + return TQString::tqfromLatin1(checked() ? "on" : "off"); case TEXT: if (autoComplete() && value() != getAttribute(ATTR_VALUE) && getDocument()->view()) getDocument()->view()->addFormCompletionItem(name().string(), value().string()); @@ -1334,7 +1334,7 @@ void HTMLInputElementImpl::restoreState(const TQString &state) switch (m_type) { case CHECKBOX: case RADIO: - setChecked((state == TQString::fromLatin1("on"))); + setChecked((state == TQString::tqfromLatin1("on"))); break; case FILE: m_value = DOMString(state.left(state.length()-1)); @@ -1560,12 +1560,12 @@ bool HTMLInputElementImpl::encoding(const TQTextCodec* codec, khtml::encodingLis if(m_clicked) { m_clicked = false; - TQString astr(nme.isEmpty() ? TQString::fromLatin1("x") : nme + ".x"); + TQString astr(nme.isEmpty() ? TQString::tqfromLatin1("x") : nme + ".x"); encoding += fixUpfromUnicode(codec, astr); astr.setNum(KMAX( clickX(), 0 )); encoding += fixUpfromUnicode(codec, astr); - astr = nme.isEmpty() ? TQString::fromLatin1("y") : nme + ".y"; + astr = nme.isEmpty() ? TQString::tqfromLatin1("y") : nme + ".y"; encoding += fixUpfromUnicode(codec, astr); astr.setNum(KMAX( clickY(), 0 ) ); encoding += fixUpfromUnicode(codec, astr); @@ -1612,7 +1612,7 @@ bool HTMLInputElementImpl::encoding(const TQTextCodec* codec, khtml::encodingLis KIO::UDSEntry filestat; // can't submit file in www-url-form encoded - TQWidget* const toplevel = static_cast(m_render)->widget()->topLevelWidget(); + TQWidget* const toplevel = static_cast(m_render)->widget()->tqtopLevelWidget(); if (multipart) { TQCString filearray( "" ); if ( KIO::NetAccess::stat(fileurl, filestat, toplevel)) { @@ -2162,7 +2162,7 @@ DOMString HTMLSelectElementImpl::value( ) const void HTMLSelectElementImpl::setValue(DOMStringImpl* value) { - // find the option with value() matching the given parameter + // tqfind the option with value() matching the given parameter // and make it the current selection. TQMemArray items = listItems(); for (unsigned i = 0; i < items.size(); i++) @@ -2192,7 +2192,7 @@ void HTMLSelectElementImpl::restoreState(const TQString &_state) recalcListItems(); TQString state = _state; - if(!state.isEmpty() && !state.contains('X') && !m_multiple && m_size <= 1) { + if(!state.isEmpty() && !state.tqcontains('X') && !m_multiple && m_size <= 1) { qWarning("should not happen in restoreState!"); state[0] = 'X'; } @@ -2217,9 +2217,9 @@ NodeImpl *HTMLSelectElementImpl::insertBefore ( NodeImpl *newChild, NodeImpl *re return result; } -void HTMLSelectElementImpl::replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ) +void HTMLSelectElementImpl::tqreplaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ) { - HTMLGenericFormElementImpl::replaceChild(newChild,oldChild, exceptioncode); + HTMLGenericFormElementImpl::tqreplaceChild(newChild,oldChild, exceptioncode); if( !exceptioncode ) setRecalcListItems(); } @@ -2374,7 +2374,7 @@ void HTMLSelectElementImpl::recalcListItems() const m_length = 0; while(current) { if (current->id() == ID_OPTGROUP && current->firstChild()) { - // ### what if optgroup contains just comments? don't want one of no options in it... + // ### what if optgroup tqcontains just comments? don't want one of no options in it... m_listItems.resize(m_listItems.size()+1); m_listItems[m_listItems.size()-1] = static_cast(current); current = current->firstChild(); @@ -2745,7 +2745,7 @@ void HTMLTextAreaElementImpl::attach() static TQString expandLF(const TQString& s) { // LF -> CRLF - unsigned crs = s.contains( '\n' ); + unsigned crs = s.tqcontains( '\n' ); if (crs == 0) return s; unsigned len = s.length(); @@ -2756,7 +2756,7 @@ static TQString expandLF(const TQString& s) for(unsigned pos = 0; pos < len; pos++) { TQChar c = s.at(pos); - switch(c.unicode()) + switch(c.tqunicode()) { case '\n': r[pos2++] = '\r'; @@ -2814,8 +2814,8 @@ DOMString HTMLTextAreaElementImpl::value() void HTMLTextAreaElementImpl::setValue(DOMString _value) { // \r\n -> \n, \r -> \n - TQString str = _value.string().replace( "\r\n", "\n" ); - m_value = str.replace( '\r', '\n' ); + TQString str = _value.string().tqreplace( "\r\n", "\n" ); + m_value = str.tqreplace( '\r', '\n' ); m_dirtyvalue = false; m_initialized = true; setChanged(true); @@ -2844,7 +2844,7 @@ DOMString HTMLTextAreaElementImpl::defaultValue() void HTMLTextAreaElementImpl::setDefaultValue(DOMString _defaultValue) { - // there may be comments - remove all the text nodes and replace them with one + // there may be comments - remove all the text nodes and tqreplace them with one TQPtrList toRemove; NodeImpl *n; for (n = firstChild(); n; n = n->nextSibling()) @@ -2953,7 +2953,7 @@ void HTMLIsIndexElementImpl::parseAttribute(AttributeImpl* attr) DOMString HTMLIsIndexElementImpl::prompt() const { // When IsIndex is parsed,
Prompt:
is created. - // So we have to look at the previous sibling to find the prompt text + // So we have to look at the previous sibling to tqfind the prompt text DOM::NodeImpl* const prev = previousSibling(); if ( prev && prev->nodeType() == DOM::Node::TEXT_NODE) return prev->nodeValue(); @@ -2963,7 +2963,7 @@ DOMString HTMLIsIndexElementImpl::prompt() const void HTMLIsIndexElementImpl::setPrompt(const DOMString& str) { // When IsIndex is parsed,
Prompt:
is created. - // So we have to look at the previous sibling to find the prompt text + // So we have to look at the previous sibling to tqfind the prompt text int exceptioncode = 0; DOM::NodeImpl* const prev = previousSibling(); if ( prev && prev->nodeType() == DOM::Node::TEXT_NODE) -- cgit v1.2.1