diff -r c3f7beb4e9f4 -r 16af22e2c155 misc.cpp --- a/misc.cpp Fri Dec 29 13:52:17 2006 +0000 +++ b/misc.cpp Tue Apr 08 08:28:37 2008 +0000 @@ -83,22 +83,6 @@ } -// returns masked "<" ">" "&" -QString quotemeta(const QString &s) -{ - QString r=s; - QRegExp rx("&(?!amp;)"); - r.replace ( rx,"&"); - rx.setPattern( ">"); - r.replace ( rx,">"); - rx.setPattern( "<"); - r.replace ( rx,"<"); - rx.setPattern( "\""); - r.replace ( rx,"""); - return r; -} - - qreal max(qreal a, qreal b) { if (a>b) @@ -106,75 +90,3 @@ return b; } -int xmlObj::actindent=0; // make instance of actindent - -xmlObj::xmlObj() -{ - indentwidth=4; -} - - -// returns -QString xmlObj::singleElement(QString s, QString at) -{ - return indent() + "<" + s +" " + at +" " + "/>\n"; -} - -// returns -QString xmlObj::beginElement(QString s) -{ - return indent() + "<" + s + ">\n"; -} - -// returns -QString xmlObj::beginElement(QString s, QString at) -{ - return indent() + "<" + s + " " + at + ">\n"; -} - -// returns -QString xmlObj::endElement(QString s) -{ - return indent() + "\n"; -} - -// returns at="val" -QString xmlObj::attribut(QString at, QString val) -{ - return " " + at + "=\"" + quotemeta (val) + "\""; -} - -// returns val -QString xmlObj::valueElement(QString el, QString val) -{ - return indent() + "<" + el + ">" + quotemeta(val) + "\n"; -} - -// returns val -QString xmlObj::valueElement(QString el, QString val, QString at) -{ - return indent() + "<" + el + " " + at + ">" + quotemeta(val) + "\n"; -} - -void xmlObj::incIndent() -{ - actindent++; -} - -void xmlObj::decIndent() -{ - actindent--; - if (actindent<0) actindent=0; -} - -QString xmlObj::indent() -{ - QString s; - int i; - for (i=0; i