Andreas Holzammer schrieb:
Hi,

as it seems, somebody has added that there is no direct conversion of an
ascii to an QString, so thats where these errors are comming from. I
started to fix these but as it seems it is too much for me. I dont have
the time to fix them all. To get the impression, i added the fix for the
below problem, but after that there are others showing up like this. So
feel free to fix the issues.

cheers

Attached a full patch. It was sent to Allan Sandfeld Jensen some time ago but I got no reaction...


HTH
Christian
diff --git a/khtml/css/css_base.cpp b/khtml/css/css_base.cpp
index 25008fb..7c5edf9 100644
--- a/khtml/css/css_base.cpp
+++ b/khtml/css/css_base.cpp
@@ -416,13 +416,13 @@ DOMString CSSSelector::selectorText() const
     if ( cs->tagHistory ) {
         DOMString tagHistoryText = cs->tagHistory->selectorText();
         if ( cs->relation == DirectAdjacent )
-            str = tagHistoryText + " + " + str;
+            str = tagHistoryText + DOMString(" + ") + str;
         else if ( cs->relation == IndirectAdjacent )
-            str = tagHistoryText + " ~ " + str;
+            str = tagHistoryText + DOMString(" ~ ") + str;
         else if ( cs->relation == Child )
-            str = tagHistoryText + " > " + str;
+            str = tagHistoryText + DOMString(" > ") + str;
         else // Descendant
-            str = tagHistoryText + " " + str;
+            str = tagHistoryText + DOMString(" ") + str;
     }
     return str;
 }
diff --git a/khtml/css/css_ruleimpl.h b/khtml/css/css_ruleimpl.h
index baf5abf..206130b 100644
--- a/khtml/css/css_ruleimpl.h
+++ b/khtml/css/css_ruleimpl.h
@@ -76,7 +76,7 @@ public:
 
     DOMString encoding() const { return m_encoding; }
     void setEncoding(DOMString _encoding) { m_encoding = _encoding; }
-    virtual DOM::DOMString cssText() const { return DOMString("@charset \"") + 
m_encoding + "\";"; }
+    virtual DOM::DOMString cssText() const { return DOMString("@charset \"") + 
m_encoding + DOMString("\";"); }
 protected:
     DOMString m_encoding;
 };
diff --git a/khtml/css/css_valueimpl.cpp b/khtml/css/css_valueimpl.cpp
index 196b80d..3fb2898 100644
--- a/khtml/css/css_valueimpl.cpp
+++ b/khtml/css/css_valueimpl.cpp
@@ -849,10 +849,10 @@ DOM::DOMString CSSStyleDeclarationImpl::cssText() const
         if (positionXProp->value()->isValueList() || 
positionYProp->value()->isValueList())
             positionValue = getLayeredShortHandValue(properties, 2);
         else
-            positionValue = positionXProp->value()->cssText() + " " + 
positionYProp->value()->cssText();
+            positionValue = positionXProp->value()->cssText() + DOMString(" ") 
+ positionYProp->value()->cssText();
         result += DOMString("background-position: ") + positionValue
                                                      + 
DOMString((positionXProp->isImportant() ? " !important" : ""))
-                                                     + "; ";
+                                                     + DOMString("; ");
     } else {
         if (positionXProp)
             result += positionXProp->cssText();
@@ -1264,10 +1264,10 @@ DOM::DOMString CSSPrimitiveValueImpl::cssText() const
         {
             RectImpl* rectVal = getRectValue();
             text = "rect(";
-            text += rectVal->top()->cssText() + " ";
-            text += rectVal->right()->cssText() + " ";
-            text += rectVal->bottom()->cssText() + " ";
-            text += rectVal->left()->cssText() + ")";
+            text += rectVal->top()->cssText() + DOMString(" ");
+            text += rectVal->right()->cssText() + DOMString(" ");
+            text += rectVal->bottom()->cssText() + DOMString(" ");
+            text += rectVal->left()->cssText() + DOMString(")");
             break;
         }
        case CSSPrimitiveValue::CSS_RGBCOLOR:
diff --git a/khtml/dom/QualifiedName.cpp b/khtml/dom/QualifiedName.cpp
index c07cbe4..2682daa 100644
--- a/khtml/dom/QualifiedName.cpp
+++ b/khtml/dom/QualifiedName.cpp
@@ -98,7 +98,7 @@ DOMString QualifiedName::tagName() const
     DOMString localName = m_localName.toString();
     if (prefix.isEmpty())
         return localName;
-    return prefix + ":" + localName;
+    return prefix + DOMString(":") + localName;
 }
 
 DOMString QualifiedName::prefix() const
@@ -118,7 +118,7 @@ DOMString QualifiedName::namespaceURI() const
 
 DOMString QualifiedName::toString() const
 {
-    return prefix() + ":" + localName();
+    return prefix() + DOMString(":") + localName();
 }
 
 }
diff --git a/khtml/dom/dom_string.h b/khtml/dom/dom_string.h
diff --git a/khtml/ecma/kjs_window.cpp b/khtml/ecma/kjs_window.cpp
index 5437591..5b363f4 100644
--- a/khtml/ecma/kjs_window.cpp
+++ b/khtml/ecma/kjs_window.cpp
@@ -2654,7 +2654,7 @@ JSValue* Location::getValueProperty(ExecState *exec, int 
token) const
     case Host: {
       UString str = url.host();
       if (url.port() > 0)
-        str = str + QString(":") + QString::number((int)url.port());
+        str += QString(QLatin1Char(':') + QString::number((int)url.port()));
       return jsString(str);
       // Note: this is the IE spec. The NS spec swaps the two, it says
       // "The hostname property is the concatenation of the host and port 
properties, separated by a colon."
diff --git a/khtml/xml/dom2_rangeimpl.cpp b/khtml/xml/dom2_rangeimpl.cpp
index 1a555e1..e1db5c0 100644
--- a/khtml/xml/dom2_rangeimpl.cpp
+++ b/khtml/xml/dom2_rangeimpl.cpp
@@ -1070,7 +1070,7 @@ DOMString RangeImpl::toHTML( int &exceptioncode )
                 in_li = true;
                 break;
          }
-          text = static_cast<ElementImpl *>(n)->openTagStartToString(true 
/*expand img urls*/)+">" +text; // prepends "<tagname key=value>"
+          text = static_cast<ElementImpl *>(n)->openTagStartToString(true 
/*expand img urls*/)+DOMString(">") +text; // prepends "<tagname key=value>"
       }
       startdepth--;
     }
@@ -1119,7 +1119,7 @@ DOMString RangeImpl::toHTML( int &exceptioncode )
                case ID_THEAD:
                    if(num_tables>0) {
                        if(elementId == ID_TABLE) num_tables--;
-                       text = static_cast<ElementImpl 
*>(n)->openTagStartToString(true /*expand img urls*/)+">" +text;
+                       text = static_cast<ElementImpl 
*>(n)->openTagStartToString(true /*expand img urls*/)+DOMString(">") +text;
                        text += "</";
                        text += static_cast<ElementImpl *>(n)->tagName();
                        text += ">";
@@ -1129,7 +1129,7 @@ DOMString RangeImpl::toHTML( int &exceptioncode )
 
                 case ID_LI:
                    if(!in_li) break;
-                    text = static_cast<ElementImpl 
*>(n)->openTagStartToString(true /*expand img urls*/)+">" +text;
+                    text = static_cast<ElementImpl 
*>(n)->openTagStartToString(true /*expand img urls*/)+DOMString(">") +text;
                    text += "</";
                    text += static_cast<ElementImpl *>(n)->tagName();
                    text += ">";
@@ -1155,7 +1155,7 @@ DOMString RangeImpl::toHTML( int &exceptioncode )
                case ID_H5:
                    //should small, etc be here?   so hard to decide.  this is 
such a hack :(
                    //There's probably tons of others you'd want here.
-                    text = static_cast<ElementImpl 
*>(n)->openTagStartToString(true /*expand img urls*/)+">" +text;
+                    text = static_cast<ElementImpl 
*>(n)->openTagStartToString(true /*expand img urls*/)+DOMString(">") +text;
                    text += "</";
                    text += static_cast<ElementImpl *>(n)->tagName();
                    text += ">";
@@ -1166,7 +1166,7 @@ DOMString RangeImpl::toHTML( int &exceptioncode )
     }
 
 
-    if(!hasBodyTag) text = DOMString("<body>") + text + "</body>";
+    if(!hasBodyTag) text = DOMString("<body>") + text + DOMString("</body>");
     else if(!hasHtmlTag) {
       text = DOMString("<html xmlns=\"http://www.w3.org/1999/xhtml\";>\n"
                      "<head>\n"
@@ -1174,7 +1174,7 @@ DOMString RangeImpl::toHTML( int &exceptioncode )
                      "<meta name=\"Generator\" content=\"KHTML, the KDE Web 
Page Viewer\" />\n"
                      "</head>\n") +
            text +
-           "</html>";
+           DOMString("</html>");
     }
     text = DOMString("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 
Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n") + text;
 
diff --git a/khtml/xml/dom_elementimpl.cpp b/khtml/xml/dom_elementimpl.cpp
index 2a90072..0f4ddf3 100644
--- a/khtml/xml/dom_elementimpl.cpp
+++ b/khtml/xml/dom_elementimpl.cpp
@@ -146,7 +146,7 @@ DOMString AttrImpl::name() const
 
     DOMString p = m_prefix.toString();
     if (!p.isEmpty())
-        return p + ":" + n;
+        return p + DOMString(":") + n;
 
     return n;
 }
@@ -492,7 +492,7 @@ DOMString ElementImpl::tagName() const
 
     DOMString prefix = m_prefix.toString();
     if (!prefix.isEmpty())
-        return prefix + ":" + tn;
+        return prefix + DOMString(":") + tn;
 
     return tn;
 }
@@ -503,7 +503,7 @@ DOMString ElementImpl::nonCaseFoldedTagName() const
 
     DOMString prefix = m_prefix.toString();
     if (!prefix.isEmpty())
-        return prefix + ":" + tn;
+        return prefix + DOMString(":") + tn;
 
     return tn;
 }
@@ -1229,7 +1229,7 @@ DOMString ElementImpl::openTagStartToString(bool 
expandurls) const
             PrefixName prefix = attribute.m_prefix;
             DOMString current;
             if (prefix.id())
-                current = prefix.toString() + ":" + attribute.localName();
+                current = prefix.toString() + DOMString(":") + 
attribute.localName();
             else
                 current = attribute.localName();
             if (m_htmlCompat)
diff --git a/khtml/xml/dom_textimpl.cpp b/khtml/xml/dom_textimpl.cpp
index 1645b13..ec00bfb 100644
--- a/khtml/xml/dom_textimpl.cpp
+++ b/khtml/xml/dom_textimpl.cpp
@@ -313,7 +313,7 @@ bool CommentImpl::childTypeAllowed( unsigned short /*type*/ 
)
 DOMString CommentImpl::toString() const
 {
     // FIXME: substitute entity references as needed!
-    return DOMString("<!--") + nodeValue() + "-->";
+    return DOMString("<!--") + nodeValue() + DOMString("-->");
 }
 
 // ---------------------------------------------------------------------------
@@ -636,7 +636,7 @@ TextImpl *CDATASectionImpl::createNew(DOMStringImpl *_str)
 
 DOMString CDATASectionImpl::toString() const
 {
-    return DOMString("<![CDATA[") + nodeValue() + "]]>";
+    return DOMString("<![CDATA[") + nodeValue() + DOMString("]]>");
 }
 
 // ---------------------------------------------------------------------------
diff --git a/khtml/xpath/parser.cpp b/khtml/xpath/parser.cpp
index e024d88..dc8a490 100644
--- a/khtml/xpath/parser.cpp
+++ b/khtml/xpath/parser.cpp
@@ -1645,7 +1645,7 @@ yyreduce:
 /* Line 1464 of yacc.c  */
 #line 203 "parser.y"
     {
-               (yyval.str) = new DOMString( *(yyvsp[(1) - (3)].str) + "()" );
+               (yyval.str) = new DOMString( *(yyvsp[(1) - (3)].str) + 
DOMString("()") );
        ;}
     break;
 
diff --git a/khtml/xpath/parser.y b/khtml/xpath/parser.y
index 60b2057..1706dcd 100644
--- a/khtml/xpath/parser.y
+++ b/khtml/xpath/parser.y
@@ -201,7 +201,7 @@ NodeTest:
        |
        NODETYPE '(' ')'
        {
-               $$ = new DOMString( *$1 + "()" );
+               $$ = new DOMString( *$1 + DOMString("()") );
        }
        |
        PI '(' ')'
_______________________________________________
Kde-windows mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-windows

Reply via email to