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/xml/dom2_eventsimpl.cpp | 40 ++++++++++++++--------------- khtml/xml/dom2_rangeimpl.cpp | 4 +-- khtml/xml/dom_docimpl.cpp | 60 +++++++++++++++++++++---------------------- khtml/xml/dom_docimpl.h | 8 +++--- khtml/xml/dom_elementimpl.cpp | 40 ++++++++++++++--------------- khtml/xml/dom_elementimpl.h | 4 +-- khtml/xml/dom_nodeimpl.cpp | 24 ++++++++--------- khtml/xml/dom_nodeimpl.h | 36 +++++++++++++------------- khtml/xml/dom_restyler.cpp | 6 ++--- khtml/xml/dom_stringimpl.cpp | 22 ++++++++-------- khtml/xml/dom_stringimpl.h | 4 +-- khtml/xml/dom_textimpl.cpp | 8 +++--- khtml/xml/dom_textimpl.h | 6 ++--- khtml/xml/xml_tokenizer.cpp | 18 ++++++------- khtml/xml/xml_tokenizer.h | 4 +-- 15 files changed, 142 insertions(+), 142 deletions(-) (limited to 'khtml/xml') diff --git a/khtml/xml/dom2_eventsimpl.cpp b/khtml/xml/dom2_eventsimpl.cpp index bcc2fca3a..25e595baa 100644 --- a/khtml/xml/dom2_eventsimpl.cpp +++ b/khtml/xml/dom2_eventsimpl.cpp @@ -48,7 +48,7 @@ EventImpl::EventImpl() m_currentTarget = 0; m_eventPhase = 0; m_target = 0; - m_createTime = TQDateTime::currentDateTime(); + m_createTime = TQDateTime::tqcurrentDateTime(); m_defaultHandled = false; } @@ -67,7 +67,7 @@ EventImpl::EventImpl(EventId _id, bool canBubbleArg, bool cancelableArg) m_currentTarget = 0; m_eventPhase = 0; m_target = 0; - m_createTime = TQDateTime::currentDateTime(); + m_createTime = TQDateTime::tqcurrentDateTime(); m_defaultHandled = false; } @@ -499,14 +499,14 @@ public: } L toLeft(R r) { - TQMapIterator i( m_rToL.find(r) ); + TQMapIterator i( m_rToL.tqfind(r) ); if (i != m_rToL.end()) return *i; return L(); } R toRight(L l) { - TQMapIterator i = m_lToR.find(l); + TQMapIterator i = m_lToR.tqfind(l); if (i != m_lToR.end()) return *i; return R(); @@ -590,10 +590,10 @@ KeyEventBaseImpl::KeyEventBaseImpl(EventId id, bool canBubbleArg, bool cancelabl m_keyVal = key->ascii(); m_virtKeyVal = virtKeyToQtKey()->toLeft(key->key()); - // m_keyVal should contain the unicode value + // m_keyVal should contain the tqunicode value // of the pressed key if available. if (m_virtKeyVal == DOM_VK_UNDEFINED && !key->text().isEmpty()) - m_keyVal = key->text().unicode()[0]; + m_keyVal = key->text().tqunicode()[0]; // key->state returns enum ButtonState, which is ShiftButton, ControlButton and AltButton or'ed together. m_modifier = key->state(); @@ -739,18 +739,18 @@ DOMString KeyboardEventImpl::keyIdentifier() const { if (unsigned special = virtKeyVal()) if (const char* id = keyIdentifiersToVirtKeys()->toLeft(special)) - return TQString::fromLatin1(id); + return TQString::tqfromLatin1(id); - if (unsigned unicode = keyVal()) - return TQString(TQChar(unicode)); + if (unsigned tqunicode = keyVal()) + return TQString(TQChar(tqunicode)); return "Unidentified"; } bool KeyboardEventImpl::getModifierState (const DOMString& keyIdentifierArg) const { - unsigned mask = keyModifiersToCode()->toRight(keyIdentifierArg.string().latin1()); - return m_modifier & mask; + unsigned tqmask = keyModifiersToCode()->toRight(keyIdentifierArg.string().latin1()); + return m_modifier & tqmask; } bool KeyboardEventImpl::isKeyboardEvent() const @@ -773,9 +773,9 @@ void KeyboardEventImpl::initKeyboardEvent(const DOMString &typeArg, //Figure out the code information from the key identifier. if (keyIdentifierArg.length() == 1) { - //Likely to be normal unicode id, unless it's one of the few + //Likely to be normal tqunicode id, unless it's one of the few //special values. - unsigned short code = keyIdentifierArg.unicode()[0]; + unsigned short code = keyIdentifierArg.tqunicode()[0]; if (code > 0x20 && code != 0x7F) keyVal = code; } @@ -790,8 +790,8 @@ void KeyboardEventImpl::initKeyboardEvent(const DOMString &typeArg, unsigned modifiers = 0; for (TQStringList::Iterator i = mods.begin(); i != mods.end(); ++i) - if (unsigned mask = keyModifiersToCode()->toRight((*i).latin1())) - modifiers |= mask; + if (unsigned tqmask = keyModifiersToCode()->toRight((*i).latin1())) + modifiers |= tqmask; initKeyBaseEvent(typeArg, canBubbleArg, cancelableArg, viewArg, keyVal, virtKeyVal, modifiers); @@ -819,7 +819,7 @@ int KeyboardEventImpl::keyCode() const if (m_virtKeyVal != DOM_VK_UNDEFINED) return m_virtKeyVal; else - return TQChar((unsigned short)m_keyVal).upper().unicode(); + return TQChar((unsigned short)m_keyVal).upper().tqunicode(); } int KeyboardEventImpl::charCode() const @@ -856,14 +856,14 @@ void TextEventImpl::initTextEvent(const DOMString &typeArg, //See whether we can get a key out of this. unsigned keyCode = 0; if (text.length() == 1) - keyCode = text.unicode()[0].unicode(); + keyCode = text.tqunicode()[0].tqunicode(); initKeyBaseEvent(typeArg, canBubbleArg, cancelableArg, viewArg, keyCode, 0, 0); } int TextEventImpl::keyCode() const { - //Mozilla returns 0 here unless this is a non-unicode key. + //Mozilla returns 0 here unless this is a non-tqunicode key. //IE stuffs everything here, and so we try to match it.. if (m_keyVal) return m_keyVal; @@ -872,8 +872,8 @@ int TextEventImpl::keyCode() const int TextEventImpl::charCode() const { - //On text events, in Mozilla charCode is 0 for non-unicode keys, - //and the unicode key otherwise... IE doesn't support this. + //On text events, in Mozilla charCode is 0 for non-tqunicode keys, + //and the tqunicode key otherwise... IE doesn't support this. if (m_virtKeyVal) return 0; return m_keyVal; diff --git a/khtml/xml/dom2_rangeimpl.cpp b/khtml/xml/dom2_rangeimpl.cpp index b160ce23f..0670c10dd 100644 --- a/khtml/xml/dom2_rangeimpl.cpp +++ b/khtml/xml/dom2_rangeimpl.cpp @@ -833,14 +833,14 @@ DOMString RangeImpl::toString( int &exceptioncode ) * psuedo code: * * if start container is not text: - * count through the children to find where we start (m_startOffset children) + * count through the children to tqfind where we start (m_startOffset children) * * loop from the start position: * if the current node is text, add the text to our variable 'text', truncating/removing if at the end/start. * * if the node has children, step to the first child. * if the node has no children but does have siblings, step to the next sibling - * until we find a sibling, go to next the parent but: + * until we tqfind a sibling, go to next the parent but: * make sure this sibling isn't past the end of where we are supposed to go. (position > endOffset and the parent is the endContainer) * */ diff --git a/khtml/xml/dom_docimpl.cpp b/khtml/xml/dom_docimpl.cpp index 36570d69a..6faeff108 100644 --- a/khtml/xml/dom_docimpl.cpp +++ b/khtml/xml/dom_docimpl.cpp @@ -128,7 +128,7 @@ DocumentTypeImpl *DOMImplementationImpl::createDocumentType( const DOMString &qu return 0; } - // INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character. + // INVALID_CHARACTER_ERR: Raised if the specified qualified name tqcontains an illegal character. if (!Element::khtmlValidQualifiedName(qualifiedName)) { exceptioncode = DOMException::INVALID_CHARACTER_ERR; return 0; @@ -232,7 +232,7 @@ void ElementMappingCache::add(const TQString& id, ElementImpl* nd) { if (id.isEmpty()) return; - ItemInfo* info = m_dict.find(id); + ItemInfo* info = m_dict.tqfind(id); if (info) { info->ref++; @@ -251,7 +251,7 @@ void ElementMappingCache::set(const TQString& id, ElementImpl* nd) { if (id.isEmpty()) return; - ItemInfo* info = m_dict.find(id); + ItemInfo* info = m_dict.tqfind(id); info->nd = nd; } @@ -259,7 +259,7 @@ void ElementMappingCache::remove(const TQString& id, ElementImpl* nd) { if (id.isEmpty()) return; - ItemInfo* info = m_dict.find(id); + ItemInfo* info = m_dict.tqfind(id); info->ref--; if (info->ref == 0) { @@ -273,16 +273,16 @@ void ElementMappingCache::remove(const TQString& id, ElementImpl* nd) } } -bool ElementMappingCache::contains(const TQString& id) +bool ElementMappingCache::tqcontains(const TQString& id) { if (id.isEmpty()) return false; - return m_dict.find(id); + return m_dict.tqfind(id); } ElementMappingCache::ItemInfo* ElementMappingCache::get(const TQString& id) { if (id.isEmpty()) return 0; - return m_dict.find(id); + return m_dict.tqfind(id); } static KStaticDeleter< TQPtrList > s_changedDocumentsDeleter; @@ -337,7 +337,7 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v) m_namespaceMap = new IdNameMapping(1); TQString xhtml(XHTML_NAMESPACE); m_namespaceMap->names.insert(emptyNamespace, new DOMStringImpl("")); - m_namespaceMap->names.insert(xhtmlNamespace, new DOMStringImpl(xhtml.unicode(), xhtml.length())); + m_namespaceMap->names.insert(xhtmlNamespace, new DOMStringImpl(xhtml.tqunicode(), xhtml.length())); m_namespaceMap->names[emptyNamespace]->ref(); m_namespaceMap->names[xhtmlNamespace]->ref(); m_namespaceMap->count+=2; @@ -1165,7 +1165,7 @@ void DocumentImpl::recalcStyle( StyleChange change ) //kdDebug( 6020 ) << "TIME: recalcStyle() dt=" << qt.elapsed() << endl; if (changed() && m_view) - m_view->layout(); + m_view->tqlayout(); bail_out: setChanged( false ); @@ -1219,9 +1219,9 @@ void DocumentImpl::updateLayout() updateRendering(); - // Only do a layout if changes have occurred that make it necessary. + // Only do a tqlayout if changes have occurred that make it necessary. if (m_view && renderer() && renderer()->needsLayout()) - m_view->layout(); + m_view->tqlayout(); m_ignorePendingStylesheets = oldIgnore; } @@ -1387,7 +1387,7 @@ void DocumentImpl::write( const TQString &text ) if (m_view) m_view->part()->resetFromScript(); m_tokenizer->setAutoClose(); - write(TQString::fromLatin1("")); + write(TQString::tqfromLatin1("")); } m_tokenizer->write(text, false); } @@ -1461,7 +1461,7 @@ NodeImpl *DocumentImpl::nextFocusNode(NodeImpl *fromNode) } if (fromTabIndex == 0) { - // Just need to find the next selectable node after fromNode (in document order) that doesn't have a tab index + // Just need to tqfind the next selectable node after fromNode (in document order) that doesn't have a tab index NodeImpl *n = fromNode->traverseNextNode(); while (n && !(n->isTabFocusable() && n->tabIndex() == 0)) n = n->traverseNextNode(); @@ -1471,7 +1471,7 @@ NodeImpl *DocumentImpl::nextFocusNode(NodeImpl *fromNode) // Find the lowest tab index out of all the nodes except fromNode, that is greater than or equal to fromNode's // tab index. For nodes with the same tab index as fromNode, we are only interested in those that come after // fromNode in document order. - // If we don't find a suitable tab index, the next focus node will be one with a tab index of 0. + // If we don't tqfind a suitable tab index, the next focus node will be one with a tab index of 0. unsigned short lowestSuitableTabIndex = 65535; NodeImpl *n; @@ -1578,7 +1578,7 @@ NodeImpl *DocumentImpl::previousFocusNode(NodeImpl *fromNode) // Find the lowest tab index out of all the nodes except fromNode, that is less than or equal to fromNode's // tab index. For nodes with the same tab index as fromNode, we are only interested in those before // fromNode. - // If we don't find a suitable tab index, then there will be no previous focus node. + // If we don't tqfind a suitable tab index, then there will be no previous focus node. unsigned short highestSuitableTabIndex = 0; NodeImpl *n; @@ -1622,7 +1622,7 @@ NodeImpl *DocumentImpl::previousFocusNode(NodeImpl *fromNode) } } -ElementImpl* DocumentImpl::findAccessKeyElement(TQChar c) +ElementImpl* DocumentImpl::tqfindAccessKeyElement(TQChar c) { c = c.upper(); for( NodeImpl* n = this; @@ -1668,9 +1668,9 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con { // get delay and url TQString str = content.string().stripWhiteSpace(); - int pos = str.find(TQRegExp("[;,]")); + int pos = str.tqfind(TQRegExp("[;,]")); if ( pos == -1 ) - pos = str.find(TQRegExp("[ \t]")); + pos = str.tqfind(TQRegExp("[ \t]")); bool ok = false; int delay = kMax( 0, content.implementation()->toInt(&ok) ); @@ -1685,7 +1685,7 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con pos++; while(pos < (int)str.length() && str[pos].isSpace()) pos++; str = str.mid(pos); - if(str.find("url", 0, false ) == 0) str = str.mid(3); + if(str.tqfind("url", 0, false ) == 0) str = str.mid(3); str = str.stripWhiteSpace(); if ( str.length() && str[0] == '=' ) str = str.mid( 1 ).stripWhiteSpace(); while(str.length() && @@ -1881,17 +1881,17 @@ NodeImpl::Id DocumentImpl::getId( NodeImpl::IdType _type, DOMStringImpl* _nsURI, TQString name = cs ? n.string() : n.string().upper(); if (!_nsURI) { - id = (NodeImpl::Id)(long) map->ids.find( name ); + id = (NodeImpl::Id)(long) map->ids.tqfind( name ); if (!id && _type != NodeImpl::NamespaceId) { - id = (NodeImpl::Id)(long) map->ids.find( "aliases: " + name ); + id = (NodeImpl::Id)(long) map->ids.tqfind( "aliases: " + name ); } } else { - id = (NodeImpl::Id)(long) map->ids.find( name ); + id = (NodeImpl::Id)(long) map->ids.tqfind( name ); if (!readonly && id && _prefix && _prefix->l) { // we were called in registration mode... check if the alias exists TQConstString px( _prefix->s, _prefix->l ); TQString qn("aliases: " + (cs ? px.string() : px.string().upper()) + ":" + name); - if (!map->ids.find( qn )) { + if (!map->ids.tqfind( qn )) { map->ids.insert( qn, (void*)id ); } } @@ -2067,7 +2067,7 @@ void DocumentImpl::recalcStyleSelector() TQPtrList oldStyleSheets = m_styleSheets->styleSheets; m_styleSheets->styleSheets.clear(); - TQString sheetUsed = view() ? view()->part()->d->m_sheetUsed.replace("&&", "&") : TQString(); + TQString sheetUsed = view() ? view()->part()->d->m_sheetUsed.tqreplace("&&", "&") : TQString(); bool autoselect = sheetUsed.isEmpty(); if (autoselect && !m_preferredStylesheetSet.isEmpty()) sheetUsed = m_preferredStylesheetSet.string(); @@ -2141,9 +2141,9 @@ void DocumentImpl::recalcStyleSelector() if ( title != sheetUsed ) sheet = 0; // don't use it - title = title.replace('&', "&&"); + title = title.tqreplace('&', "&&"); - if ( !m_availableSheets.contains( title ) ) + if ( !m_availableSheets.tqcontains( title ) ) m_availableSheets.append( title ); } } @@ -2170,7 +2170,7 @@ void DocumentImpl::recalcStyleSelector() // or we found the sheet we selected if (sheetUsed.isEmpty() || (!canResetSheet && tokenizer()) || - m_availableSheets.contains(sheetUsed)) { + m_availableSheets.tqcontains(sheetUsed)) { break; } @@ -2280,7 +2280,7 @@ void DocumentImpl::setFocusNode(NodeImpl *newFocusNode) if (m_focusNode != newFocusNode) return; // eww, I suck. set the qt focus correctly - // ### find a better place in the code for this + // ### tqfind a better place in the code for this if (view()) { if (!m_focusNode->renderer() || !m_focusNode->renderer()->isWidget()) view()->setFocus(); @@ -2690,7 +2690,7 @@ NodeListImpl::Cache* DOM::DocumentImpl::acquireCachedNodeListInfo( //Check to see if we have this sort of item cached. NodeListImpl::Cache* cached = - (type == NodeListImpl::UNCACHEABLE) ? 0 : m_nodeListCache.find(key.hash()); + (type == NodeListImpl::UNCACHEABLE) ? 0 : m_nodeListCache.tqfind(key.hash()); if (cached) { if (cached->key == key) { @@ -2710,7 +2710,7 @@ NodeListImpl::Cache* DOM::DocumentImpl::acquireCachedNodeListInfo( if (type != NodeListImpl::UNCACHEABLE) { newInfo->ref(); //Add the cache's reference - m_nodeListCache.replace(key.hash(), newInfo); + m_nodeListCache.tqreplace(key.hash(), newInfo); } return newInfo; diff --git a/khtml/xml/dom_docimpl.h b/khtml/xml/dom_docimpl.h index 5e50c09a4..be26b0737 100644 --- a/khtml/xml/dom_docimpl.h +++ b/khtml/xml/dom_docimpl.h @@ -166,7 +166,7 @@ public: /** Returns true if the item exists */ - bool contains(const TQString& id); + bool tqcontains(const TQString& id); /** Returns the information for the given ID @@ -198,7 +198,7 @@ public: DocumentFragmentImpl *createDocumentFragment (); TextImpl *createTextNode ( DOMStringImpl* data ) { return new TextImpl( docPtr(), data); } TextImpl *createTextNode ( const TQString& data ) - { return createTextNode(new DOMStringImpl(data.unicode(), data.length())); } + { return createTextNode(new DOMStringImpl(data.tqunicode(), data.length())); } CommentImpl *createComment ( DOMStringImpl* data ); CDATASectionImpl *createCDATASection ( DOMStringImpl* data ); ProcessingInstructionImpl *createProcessingInstruction ( const DOMString &target, DOMStringImpl* data ); @@ -485,7 +485,7 @@ public: */ NodeImpl *previousFocusNode(NodeImpl *fromNode); - ElementImpl* findAccessKeyElement(TQChar c); + ElementImpl* tqfindAccessKeyElement(TQChar c); int nodeAbsIndex(NodeImpl *node); NodeImpl *nodeWithAbsIndex(int absIndex); @@ -616,7 +616,7 @@ protected: TQConstString px( _prefix->s, _prefix->l ); TQString name = cs ? n.string() : n.string().upper(); TQString qn("aliases: " + (cs ? px.string() : px.string().upper()) + ":" + name); - if (!ids.find( qn )) { + if (!ids.tqfind( qn )) { ids.insert( qn, (void*)id ); } } diff --git a/khtml/xml/dom_elementimpl.cpp b/khtml/xml/dom_elementimpl.cpp index c41bef3dc..21401e106 100644 --- a/khtml/xml/dom_elementimpl.cpp +++ b/khtml/xml/dom_elementimpl.cpp @@ -855,7 +855,7 @@ DOMString ElementImpl::toString() const for (NodeImpl *child = firstChild(); child != NULL; child = child->nextSibling()) { DOMString kid = child->toString(); - result += TQConstString(kid.unicode(), kid.length()).string(); + result += TQConstString(kid.tqunicode(), kid.length()).string(); } result += "ownerElement() == m_element) { // Already have this attribute. - // DOMTS core-1 test "hc_elementreplaceattributewithself" says we should return it. + // DOMTS core-1 test "hc_elementtqreplaceattributewithself" says we should return it. return attr; } - unsigned int mask = nsAware ? ~0L : NodeImpl_IdLocalMask; - NodeImpl::Id id = (attr->id() & mask); + unsigned int tqmask = nsAware ? ~0L : NodeImpl_IdLocalMask; + NodeImpl::Id id = (attr->id() & tqmask); for (unsigned long i = 0; i < m_attrCount; i++) { - if ((m_attrs[i].id() & mask) == id) { + if ((m_attrs[i].id() & tqmask) == id) { // if we are called with a qualified name, filter out NS-aware elements with non-matching name. if (qName && (namespacePart(m_attrs[i].id()) != defaultNamespace) && strcasecmp(m_attrs[i].name(), DOMString(qName))) continue; - // Attribute exists; replace it + // Attribute exists; tqreplace it if (id == ATTR_ID) m_element->updateId(m_attrs[i].val(), attr->val()); - Node replaced = m_attrs[i].createAttr(m_element,m_element->docPtr()); + Node tqreplaced = m_attrs[i].createAttr(m_element,m_element->docPtr()); m_attrs[i].free(); m_attrs[i].m_attrId = 0; /* "has implementation" flag */ m_attrs[i].m_data.attr = attr; @@ -1089,7 +1089,7 @@ Node NamedAttrMapImpl::setNamedItem ( NodeImpl* arg, bool nsAware, DOMStringImpl m_element->parseAttribute(&m_attrs[i]); m_element->attributeChanged(m_attrs[i].id()); // ### dispatch mutation events - return replaced; + return tqreplaced; } } @@ -1142,10 +1142,10 @@ DOMStringImpl *NamedAttrMapImpl::valueAt(unsigned long index) const DOMStringImpl *NamedAttrMapImpl::getValue(NodeImpl::Id id, bool nsAware, DOMStringImpl* qName) const { - unsigned int mask = nsAware ? ~0L : NodeImpl_IdLocalMask; - id = (id & mask); + unsigned int tqmask = nsAware ? ~0L : NodeImpl_IdLocalMask; + id = (id & tqmask); for (unsigned long i = 0; i < m_attrCount; i++) - if ((m_attrs[i].id() & mask) == id) { + if ((m_attrs[i].id() & tqmask) == id) { // if we are called with a qualified name, filter out NS-aware elements with non-matching name. if (qName && (namespacePart(m_attrs[i].id()) != defaultNamespace) && strcasecmp(m_attrs[i].name(), qName)) @@ -1167,12 +1167,12 @@ void NamedAttrMapImpl::setValue(NodeImpl::Id id, DOMStringImpl *value, DOMString removeNamedItem(id, nsAware, qName, exceptioncode); return; } - unsigned int mask = nsAware ? ~0L : NodeImpl_IdLocalMask; - NodeImpl::Id mid = (id & mask); + unsigned int tqmask = nsAware ? ~0L : NodeImpl_IdLocalMask; + NodeImpl::Id mid = (id & tqmask); // Check for an existing attribute. for (unsigned long i = 0; i < m_attrCount; i++) { - if ((m_attrs[i].id() & mask) == mid) { + if ((m_attrs[i].id() & tqmask) == mid) { // if we are called with a qualified name, filter out NS-aware elements with non-matching name. if (qName && (namespacePart(m_attrs[i].id()) != defaultNamespace) && strcasecmp(m_attrs[i].name(), DOMString(qName))) diff --git a/khtml/xml/dom_elementimpl.h b/khtml/xml/dom_elementimpl.h index ee1be3e4a..019920b76 100644 --- a/khtml/xml/dom_elementimpl.h +++ b/khtml/xml/dom_elementimpl.h @@ -302,7 +302,7 @@ public: virtual bool isReadOnly() { return false; } AttributeImpl *attrAt(unsigned long index) const { return &m_attrs[index]; } - // ### replace idAt and getValueAt with attrAt + // ### tqreplace idAt and getValueAt with attrAt NodeImpl::Id idAt(unsigned long index) const; DOMStringImpl *valueAt(unsigned long index) const; DOMStringImpl *getValue(NodeImpl::Id id, bool nsAware = false, DOMStringImpl* qName = 0) const; @@ -333,7 +333,7 @@ inline bool checkQualifiedName(const DOMString &qualifiedName, const DOMString & return false; } - // INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character. + // INVALID_CHARACTER_ERR: Raised if the specified qualified name tqcontains an illegal character. if (!qualifiedName.isNull() && !Element::khtmlValidQualifiedName(qualifiedName) && ( !qualifiedName.isEmpty() || !nameCanBeEmpty ) ) { if (pExceptioncode) diff --git a/khtml/xml/dom_nodeimpl.cpp b/khtml/xml/dom_nodeimpl.cpp index 137928c81..e51d16523 100644 --- a/khtml/xml/dom_nodeimpl.cpp +++ b/khtml/xml/dom_nodeimpl.cpp @@ -133,7 +133,7 @@ NodeImpl *NodeImpl::insertBefore( NodeImpl *, NodeImpl *, int &exceptioncode ) return 0; } -void NodeImpl::replaceChild( NodeImpl *, NodeImpl *, int &exceptioncode ) +void NodeImpl::tqreplaceChild( NodeImpl *, NodeImpl *, int &exceptioncode ) { exceptioncode = DOMException::HIERARCHY_REQUEST_ERR; } @@ -588,7 +588,7 @@ void NodeImpl::handleLocalEvents(EventImpl *evt, bool useCapture) Event ev = evt; // removeEventListener (e.g. called from a JS event listener) might - // invalidate the item after the current iterator (which "it" is pointing to). + // tqinvalidate the item after the current iterator (which "it" is pointing to). // So we make a copy of the list. TQValueList listeners = *m_regdListeners.listeners; TQValueList::iterator it; @@ -605,7 +605,7 @@ void NodeImpl::handleLocalEvents(EventImpl *evt, bool useCapture) if (current.useCapture == useCapture && evt->id() == EventImpl::CLICK_EVENT) { MouseEventImpl* me = static_cast(evt); if (me->button() == 0) { - // To find whether to call onclick or ondblclick, we can't + // To tqfind whether to call onclick or ondblclick, we can't // * use me->detail(), it's 2 when clicking twice w/o moving, even very slowly // * use me->qEvent(), it's not available when using initMouseEvent/dispatchEvent // So we currently store a bool in MouseEventImpl. If anyone needs to trigger @@ -669,7 +669,7 @@ void NodeImpl::checkSetPrefix(const DOMString &_prefix, int &exceptioncode) // Perform error checking as required by spec for setting Node.prefix. Used by // ElementImpl::setPrefix() and AttrImpl::setPrefix() - // INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character. + // INVALID_CHARACTER_ERR: Raised if the specified prefix tqcontains an illegal character. if (!Element::khtmlValidPrefix(_prefix)) { exceptioncode = DOMException::INVALID_CHARACTER_ERR; return; @@ -698,7 +698,7 @@ void NodeImpl::checkSetPrefix(const DOMString &_prefix, int &exceptioncode) void NodeImpl::checkAddChild(NodeImpl *newChild, int &exceptioncode) { // Perform error checking as required by spec for adding a new child. Used by - // appendChild(), replaceChild() and insertBefore() + // appendChild(), tqreplaceChild() and insertBefore() // Not mentioned in spec: throw NOT_FOUND_ERR if newChild is null if (!newChild) { @@ -768,7 +768,7 @@ bool NodeImpl::childAllowed( NodeImpl *newChild ) NodeImpl::StyleChange NodeImpl::diff( khtml::RenderStyle *s1, khtml::RenderStyle *s2 ) { - // This method won't work when a style contains noninherited properties with "inherit" value. + // This method won't work when a style tqcontains noninherited properties with "inherit" value. StyleChange ch = NoInherit; EDisplay display1 = s1 ? s1->display() : NONE; @@ -989,7 +989,7 @@ DOMStringImpl* NodeImpl::textContent() const delete kidText; } } - return new DOMStringImpl(out.unicode(), out.length()); + return new DOMStringImpl(out.tqunicode(), out.length()); } //------------------------------------------------------------------------- @@ -1099,7 +1099,7 @@ NodeImpl *NodeBaseImpl::insertBefore ( NodeImpl *newChild, NodeImpl *refChild, i return newChild; } -void NodeBaseImpl::replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ) +void NodeBaseImpl::tqreplaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ) { exceptioncode = 0; @@ -1427,7 +1427,7 @@ void NodeBaseImpl::cloneChildNodes(NodeImpl *clone) } } -// I don't like this way of implementing the method, but I didn't find any +// I don't like this way of implementing the method, but I didn't tqfind any // other way. Lars bool NodeBaseImpl::getUpperLeftCorner(int &xPos, int &yPos) const { @@ -1440,7 +1440,7 @@ bool NodeBaseImpl::getUpperLeftCorner(int &xPos, int &yPos) const return true; } - // find the next text/image child, to get a position + // tqfind the next text/image child, to get a position while(o) { if(o->firstChild()) o = o->firstChild(); @@ -1484,7 +1484,7 @@ bool NodeBaseImpl::getLowerRightCorner(int &xPos, int &yPos) const yPos += o->height() + o->borderTopExtra() + o->borderBottomExtra(); return true; } - // find the last text/image child, to get a position + // tqfind the last text/image child, to get a position while(o) { if(o->lastChild()) o = o->lastChild(); @@ -2060,7 +2060,7 @@ bool RegisteredListenerList::stillContainsListener(const RegisteredEventListener { if (!listeners) return false; - return listeners->find(listener) != listeners->end(); + return listeners->tqfind(listener) != listeners->end(); } RegisteredListenerList::~RegisteredListenerList() { diff --git a/khtml/xml/dom_nodeimpl.h b/khtml/xml/dom_nodeimpl.h index 1e53edf19..263df8fb6 100644 --- a/khtml/xml/dom_nodeimpl.h +++ b/khtml/xml/dom_nodeimpl.h @@ -86,17 +86,17 @@ private: #define NodeImpl_IdNSMask 0xffff0000 #define NodeImpl_IdLocalMask 0x0000ffff -const Q_UINT16 defaultNamespace = 0; -const Q_UINT16 xhtmlNamespace = 1; -const Q_UINT16 emptyNamespace = 2; -const Q_UINT16 anyNamespace = 0xffff; -const Q_UINT16 anyLocalName = 0xffff; +const TQ_UINT16 defaultNamespace = 0; +const TQ_UINT16 xhtmlNamespace = 1; +const TQ_UINT16 emptyNamespace = 2; +const TQ_UINT16 anyNamespace = 0xffff; +const TQ_UINT16 anyLocalName = 0xffff; -inline Q_UINT16 localNamePart(Q_UINT32 id) { return id & NodeImpl_IdLocalMask; } -inline Q_UINT16 namespacePart(Q_UINT32 id) { return (((unsigned int)id) & NodeImpl_IdNSMask) >> 16; } -inline Q_UINT32 makeId(Q_UINT16 n, Q_UINT16 l) { return (n << 16) | l; } +inline TQ_UINT16 localNamePart(TQ_UINT32 id) { return id & NodeImpl_IdLocalMask; } +inline TQ_UINT16 namespacePart(TQ_UINT32 id) { return (((unsigned int)id) & NodeImpl_IdNSMask) >> 16; } +inline TQ_UINT32 makeId(TQ_UINT16 n, TQ_UINT16 l) { return (n << 16) | l; } -const Q_UINT32 anyQName = makeId(anyNamespace, anyLocalName); +const TQ_UINT32 anyQName = makeId(anyNamespace, anyLocalName); class NodeImpl : public khtml::TreeShared { @@ -116,12 +116,12 @@ public: virtual NodeListImpl *childNodes(); virtual NodeImpl *firstChild() const; virtual NodeImpl *lastChild() const; - // insertBefore, replaceChild and appendChild also close newChild + // insertBefore, tqreplaceChild and appendChild also close newChild // unlike the speed optimized addChild (which is used by the parser) virtual NodeImpl *insertBefore ( NodeImpl *newChild, NodeImpl *refChild, int &exceptioncode ); /* These two methods may delete the old node, so make sure to reference it if you need it */ - virtual void replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ); + virtual void tqreplaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ); virtual void removeChild ( NodeImpl *oldChild, int &exceptioncode ); virtual NodeImpl *appendChild ( NodeImpl *newChild, int &exceptioncode ); virtual bool hasChildNodes ( ) const; @@ -140,7 +140,7 @@ public: virtual bool isDocumentNode() const { return false; } virtual bool isXMLElementNode() const { return false; } virtual bool isGenericFormElement() const { return false; } - virtual bool containsOnlyWhitespace() const { return false; } + virtual bool tqcontainsOnlyWhitespace() const { return false; } virtual bool contentEditable() const; // helper functions not being part of the DOM @@ -155,7 +155,7 @@ public: // appendChild(), and returns the node into which will be parsed next. virtual NodeImpl *addChild(NodeImpl *newChild); - typedef Q_UINT32 Id; + typedef TQ_UINT32 Id; // id() is used to easily and exactly identify a node. It // is optimized for quick comparison and low memory consumption. // its value depends on the owner document of the node and is @@ -299,7 +299,7 @@ public: virtual NodeImpl *childNode(unsigned long index); /** - * Does a pre-order traversal of the tree to find the node next node after this one. This uses the same order that + * Does a pre-order traversal of the tree to tqfind the node next node after this one. This uses the same order that * the tags appear in the source file. * * @param stayWithin If not null, the traversal will stop once the specified node is reached. This can be used to @@ -312,7 +312,7 @@ public: NodeImpl *traverseNextNode(NodeImpl *stayWithin = 0) const; /** - * Does a reverse pre-order traversal to find the node that comes before the current one in document order + * Does a reverse pre-order traversal to tqfind the node that comes before the current one in document order * * see traverseNextNode() */ @@ -407,7 +407,7 @@ public: /** * Notifies the node that it has been inserted into the document. This is called during document parsing, and also - * when a node is added through the DOM methods insertBefore(), appendChild() or replaceChild(). Note that this only + * when a node is added through the DOM methods insertBefore(), appendChild() or tqreplaceChild(). Note that this only * happens when the node becomes part of the document tree, i.e. only when the document is actually an ancestor of * the node. The call happens _after_ the node has been added to the tree. * @@ -497,7 +497,7 @@ public: virtual NodeImpl *firstChild() const; virtual NodeImpl *lastChild() const; virtual NodeImpl *insertBefore ( NodeImpl *newChild, NodeImpl *refChild, int &exceptioncode ); - virtual void replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ); + virtual void tqreplaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ); virtual void removeChild ( NodeImpl *oldChild, int &exceptioncode ); virtual NodeImpl *appendChild ( NodeImpl *newChild, int &exceptioncode ); virtual bool hasChildNodes ( ) const; @@ -537,7 +537,7 @@ protected: bool checkIsChild( NodeImpl *oldchild, int &exceptioncode ); // ### - // find out if a node is allowed to be our child + // tqfind out if a node is allowed to be our child void dispatchChildInsertedEvents( NodeImpl *child, int &exceptioncode ); void dispatchChildRemovalEvents( NodeImpl *child, int &exceptioncode ); }; diff --git a/khtml/xml/dom_restyler.cpp b/khtml/xml/dom_restyler.cpp index 0050c4a03..699a5ab59 100644 --- a/khtml/xml/dom_restyler.cpp +++ b/khtml/xml/dom_restyler.cpp @@ -45,7 +45,7 @@ void DynamicDomRestyler::removeDependency(ElementImpl* subject, ElementImpl* dep void DynamicDomRestyler::removeDependencies(ElementImpl* subject, StructuralDependencyType type) { - KMultiMap::List* my_dependencies = reverse_map.find(subject); + KMultiMap::List* my_dependencies = reverse_map.tqfind(subject); if (!my_dependencies) return; @@ -60,7 +60,7 @@ void DynamicDomRestyler::removeDependencies(ElementImpl* subject, StructuralDepe void DynamicDomRestyler::resetDependencies(ElementImpl* subject) { - KMultiMap::List* my_dependencies = reverse_map.find(subject); + KMultiMap::List* my_dependencies = reverse_map.tqfind(subject); if (!my_dependencies) return; @@ -78,7 +78,7 @@ void DynamicDomRestyler::resetDependencies(ElementImpl* subject) void DynamicDomRestyler::restyleDepedent(ElementImpl* dependency, StructuralDependencyType type) { assert(type < LastStructuralDependency); - KMultiMap::List* dep = dependency_map[type].find(dependency); + KMultiMap::List* dep = dependency_map[type].tqfind(dependency); if (!dep) return; diff --git a/khtml/xml/dom_stringimpl.cpp b/khtml/xml/dom_stringimpl.cpp index bb1a728e9..e50babf28 100644 --- a/khtml/xml/dom_stringimpl.cpp +++ b/khtml/xml/dom_stringimpl.cpp @@ -54,15 +54,15 @@ DOMStringImpl::DOMStringImpl(const char *str) } // FIXME: should be a cached flag maybe. -bool DOMStringImpl::containsOnlyWhitespace() const +bool DOMStringImpl::tqcontainsOnlyWhitespace() const { if (!s) return true; for (uint i = 0; i < l; i++) { TQChar c = s[i]; - if (c.unicode() <= 0x7F) { - if (c.unicode() > ' ') + if (c.tqunicode() <= 0x7F) { + if (c.tqunicode() > ' ') return false; } else { if (c.direction() != TQChar::DirWS) @@ -286,18 +286,18 @@ khtml::Length* DOMStringImpl::toCoordsArray(int& len) const } str = str.simplifyWhiteSpace(); - len = str.contains(' ') + 1; + len = str.tqcontains(' ') + 1; khtml::Length* r = new khtml::Length[len]; int i = 0; int pos = 0; int pos2; - while((pos2 = str.find(' ', pos)) != -1) { - r[i++] = parseLength((TQChar *) str.unicode()+pos, pos2-pos); + while((pos2 = str.tqfind(' ', pos)) != -1) { + r[i++] = parseLength((TQChar *) str.tqunicode()+pos, pos2-pos); pos = pos2+1; } - r[i] = parseLength((TQChar *) str.unicode()+pos, str.length()-pos); + r[i] = parseLength((TQChar *) str.tqunicode()+pos, str.length()-pos); return r; } @@ -307,7 +307,7 @@ khtml::Length* DOMStringImpl::toLengthArray(int& len) const TQString str(s, l); str = str.simplifyWhiteSpace(); - len = str.contains(',') + 1; + len = str.tqcontains(',') + 1; // If we have no commas, we have no array. if( len == 1 ) @@ -319,14 +319,14 @@ khtml::Length* DOMStringImpl::toLengthArray(int& len) const int pos = 0; int pos2; - while((pos2 = str.find(',', pos)) != -1) { - r[i++] = parseLength((TQChar *) str.unicode()+pos, pos2-pos); + while((pos2 = str.tqfind(',', pos)) != -1) { + r[i++] = parseLength((TQChar *) str.tqunicode()+pos, pos2-pos); pos = pos2+1; } /* IE Quirk: If the last comma is the last char skip it and reduce len by one */ if (str.length()-pos > 0) - r[i] = parseLength((TQChar *) str.unicode()+pos, str.length()-pos); + r[i] = parseLength((TQChar *) str.tqunicode()+pos, str.length()-pos); else len--; diff --git a/khtml/xml/dom_stringimpl.h b/khtml/xml/dom_stringimpl.h index cd7128967..78d7dcb0c 100644 --- a/khtml/xml/dom_stringimpl.h +++ b/khtml/xml/dom_stringimpl.h @@ -79,7 +79,7 @@ public: DOMStringImpl *collapseWhiteSpace(bool preserveLF, bool preserveWS); const TQChar &operator [] (int pos) { return s[pos]; } - bool containsOnlyWhitespace() const; + bool tqcontainsOnlyWhitespace() const; // ignores trailing garbage, unlike QString int toInt(bool* ok = 0) const; @@ -92,7 +92,7 @@ public: DOMStringImpl *capitalize(bool noFirstCap=false) const; DOMStringImpl *escapeHTML(); - TQChar *unicode() const { return s; } + TQChar *tqunicode() const { return s; } uint length() const { return l; } TQString string() const; diff --git a/khtml/xml/dom_textimpl.cpp b/khtml/xml/dom_textimpl.cpp index 015135428..6c07b9c47 100644 --- a/khtml/xml/dom_textimpl.cpp +++ b/khtml/xml/dom_textimpl.cpp @@ -155,7 +155,7 @@ void CharacterDataImpl::deleteData( const unsigned long offset, const unsigned l oldStr->deref(); } -void CharacterDataImpl::replaceData( const unsigned long offset, const unsigned long count, const DOMString &arg, int &exceptioncode ) +void CharacterDataImpl::tqreplaceData( const unsigned long offset, const unsigned long count, const DOMString &arg, int &exceptioncode ) { exceptioncode = 0; if ((long)count < 0) @@ -189,9 +189,9 @@ DOMString CharacterDataImpl::nodeValue() const return str; } -bool CharacterDataImpl::containsOnlyWhitespace() const +bool CharacterDataImpl::tqcontainsOnlyWhitespace() const { - return str->containsOnlyWhitespace(); + return str->tqcontainsOnlyWhitespace(); } void CharacterDataImpl::setNodeValue( const DOMString &_nodeValue, int &exceptioncode ) @@ -372,7 +372,7 @@ bool TextImpl::rendererIsNeeded(RenderStyle *style) if (!CharacterDataImpl::rendererIsNeeded(style)) { return false; } - bool onlyWS = containsOnlyWhitespace(); + bool onlyWS = tqcontainsOnlyWhitespace(); if (!onlyWS) { return true; } diff --git a/khtml/xml/dom_textimpl.h b/khtml/xml/dom_textimpl.h index 07e4909f6..a966a23a4 100644 --- a/khtml/xml/dom_textimpl.h +++ b/khtml/xml/dom_textimpl.h @@ -51,9 +51,9 @@ public: virtual void appendData ( const DOMString &arg, int &exceptioncode ); virtual void insertData ( const unsigned long offset, const DOMString &arg, int &exceptioncode ); virtual void deleteData ( const unsigned long offset, const unsigned long count, int &exceptioncode ); - virtual void replaceData ( const unsigned long offset, const unsigned long count, const DOMString &arg, int &exceptioncode ); + virtual void tqreplaceData ( const unsigned long offset, const unsigned long count, const DOMString &arg, int &exceptioncode ); - virtual bool containsOnlyWhitespace() const; + virtual bool tqcontainsOnlyWhitespace() const; // DOM methods overridden from parent classes @@ -135,7 +135,7 @@ public: DOMStringImpl *renderString() const; virtual DOMString toString() const; - /** Return the text for the node, with < replaced with < and so on. + /** Return the text for the node, with < tqreplaced with < and so on. * @param startOffset The number of characters counted from the left, zero indexed, counting "<" as one character, to start from. Use -1 to start from 0. * @param endOffset The number of characters counted from the left, zero indexed, counting "<" as one character, to end on. Use -1 to end at the end of the string. * @return An html escaped version of the substring. diff --git a/khtml/xml/xml_tokenizer.cpp b/khtml/xml/xml_tokenizer.cpp index 7c043815a..37fc36f02 100644 --- a/khtml/xml/xml_tokenizer.cpp +++ b/khtml/xml/xml_tokenizer.cpp @@ -42,7 +42,7 @@ using namespace DOM; using namespace khtml; XMLIncrementalSource::XMLIncrementalSource() - : TQXmlInputSource(), m_pos( 0 ), m_unicode( 0 ), + : TQXmlInputSource(), m_pos( 0 ), m_tqunicode( 0 ), m_finished( false ) { } @@ -59,13 +59,13 @@ TQChar XMLIncrementalSource::next() else if ( m_data.length() <= m_pos ) return TQXmlInputSource::EndOfData; else - return m_unicode[m_pos++]; + return m_tqunicode[m_pos++]; } void XMLIncrementalSource::setData( const TQString& str ) { m_data = str; - m_unicode = m_data.unicode(); + m_tqunicode = m_data.tqunicode(); m_pos = 0; if ( !str.isEmpty() ) m_finished = false; @@ -78,7 +78,7 @@ void XMLIncrementalSource::setData( const TQByteArray& data ) void XMLIncrementalSource::appendXML( const TQString& str ) { m_data += str; - m_unicode = m_data.unicode(); + m_tqunicode = m_data.tqunicode(); } TQString XMLIncrementalSource::data() @@ -152,11 +152,11 @@ void XMLHandler::fixUpNSURI(TQString& uri, const TQString& qname) { /* QXml does not resolve the namespaces of attributes in the same tag that preceed the xmlns declaration. This fixes up that case */ - if (uri.isEmpty() && qname.find(':') != -1) { + if (uri.isEmpty() && qname.tqfind(':') != -1) { TQXmlNamespaceSupport ns; TQString localName, prefix; ns.splitName(qname, prefix, localName); - if (namespaceInfo.contains(prefix)) { + if (namespaceInfo.tqcontains(prefix)) { uri = namespaceInfo[prefix].top(); } } @@ -289,7 +289,7 @@ bool XMLHandler::comment(const TQString & ch) if (currentNode()->nodeType() == Node::TEXT_NODE) exitText(); // ### handle exceptions - currentNode()->addChild(m_doc->createComment(new DOMStringImpl(ch.unicode(), ch.length()))); + currentNode()->addChild(m_doc->createComment(new DOMStringImpl(ch.tqunicode(), ch.length()))); return true; } @@ -299,7 +299,7 @@ bool XMLHandler::processingInstruction(const TQString &target, const TQString &d exitText(); // ### handle exceptions ProcessingInstructionImpl *pi = - m_doc->createProcessingInstruction(target, new DOMStringImpl(data.unicode(), data.length())); + m_doc->createProcessingInstruction(target, new DOMStringImpl(data.tqunicode(), data.length())); currentNode()->addChild(pi); pi->checkStyleSheet(); return true; @@ -364,7 +364,7 @@ bool XMLHandler::internalEntityDecl(const TQString &name, const TQString &value) { EntityImpl *e = new EntityImpl(m_doc,name); // ### further parse entities inside the value and add them as separate nodes (or entityreferences)? - e->addChild(m_doc->createTextNode(new DOMStringImpl(value.unicode(), value.length()))); + e->addChild(m_doc->createTextNode(new DOMStringImpl(value.tqunicode(), value.length()))); if (m_doc->doctype()) static_cast(m_doc->doctype()->entities())->addNode(e); return true; diff --git a/khtml/xml/xml_tokenizer.h b/khtml/xml/xml_tokenizer.h index cbf5cd5dd..0af3ec3a4 100644 --- a/khtml/xml/xml_tokenizer.h +++ b/khtml/xml/xml_tokenizer.h @@ -116,7 +116,7 @@ private: State state; }; -class Tokenizer : public QObject +class Tokenizer : public TQObject { Q_OBJECT public: @@ -155,7 +155,7 @@ public: private: TQString m_data; uint m_pos; - const TQChar *m_unicode; + const TQChar *m_tqunicode; bool m_finished; }; -- cgit v1.2.1