diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/components/csseditor/cssshpropertyparser.cpp | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/components/csseditor/cssshpropertyparser.cpp')
-rw-r--r-- | quanta/components/csseditor/cssshpropertyparser.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/quanta/components/csseditor/cssshpropertyparser.cpp b/quanta/components/csseditor/cssshpropertyparser.cpp index d02c39a5..d117b5f5 100644 --- a/quanta/components/csseditor/cssshpropertyparser.cpp +++ b/quanta/components/csseditor/cssshpropertyparser.cpp @@ -18,15 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "cssshpropertyparser.h" -#include <qregexp.h> +#include <tqregexp.h> //#include <kdebug.h> -CSSSHPropertyParser::CSSSHPropertyParser(const QString& s){ - QStringList l1, - l2=QStringList::split(",",s); +CSSSHPropertyParser::CSSSHPropertyParser(const TQString& s){ + TQStringList l1, + l2=TQStringList::split(",",s); - for ( QStringList::Iterator it = l2.begin(); it != l2.end(); ++it ) { - QString temp; + for ( TQStringList::Iterator it = l2.begin(); it != l2.end(); ++it ) { + TQString temp; temp=removeBeginningWhiteSpaces((*it)); temp=removeEndingWhiteSpaces(temp); l1.append(temp); @@ -37,26 +37,26 @@ CSSSHPropertyParser::CSSSHPropertyParser(const QString& s){ CSSSHPropertyParser::~CSSSHPropertyParser(){} -QString CSSSHPropertyParser::removeEndingWhiteSpaces(const QString& s){ +TQString CSSSHPropertyParser::removeEndingWhiteSpaces(const TQString& s){ int index = s.length()-1; while(s[index] == ' ' ) index--; return s.left(index+1); } -QString CSSSHPropertyParser::removeBeginningWhiteSpaces(const QString& s){ +TQString CSSSHPropertyParser::removeBeginningWhiteSpaces(const TQString& s){ int index = 0; while(s[index] == ' ' ) index++; return s.right(s.length()-index); } -QString CSSSHPropertyParser::extractFunctionList(){ - QRegExp functionListPattern("\\s*([a-zA-Z0-9_]*\\([\\W\\w]*\\))\\s*"); +TQString CSSSHPropertyParser::extractFunctionList(){ + TQRegExp functionListPattern("\\s*([a-zA-Z0-9_]*\\([\\W\\w]*\\))\\s*"); functionListPattern.search(m_propertyToParse); return functionListPattern.cap(1); } -QString CSSSHPropertyParser::extractQuotedStringList(){ - QString temp; +TQString CSSSHPropertyParser::extractQuotedStringList(){ + TQString temp; bool stop = false; unsigned int i=0; while(!stop && i<m_propertyToParse.length() ){ @@ -70,39 +70,39 @@ QString CSSSHPropertyParser::extractQuotedStringList(){ return temp; } -QString CSSSHPropertyParser::extractURIList(){//extract things like url('...') or url("..") or url("..."), url(..... +TQString CSSSHPropertyParser::extractURIList(){//extract things like url('...') or url("..") or url("..."), url(..... //kdDebug(24000) << "\n\n\nextractURIList()\n\n\n"; - QRegExp URIListPattern("\\s*(url\\([\\W\\w]*\\))\\s*"); + TQRegExp URIListPattern("\\s*(url\\([\\W\\w]*\\))\\s*"); URIListPattern.search(m_propertyToParse); return URIListPattern.cap(1); } -QStringList CSSSHPropertyParser::parse(){ - QStringList tokenList; +TQStringList CSSSHPropertyParser::parse(){ + TQStringList tokenList; bool stop = false; m_propertyToParse = removeBeginningWhiteSpaces(m_propertyToParse); while(!stop){ - QString temp; + TQString temp; for(unsigned int i=0;i<m_propertyToParse.length() ;i++){ if(m_propertyToParse[i] == ' ') break;// tokens are delimited by a blank temp+=m_propertyToParse[i]; } if(temp.contains("url(") !=0 ){ - QString foundURIList = extractURIList(); + TQString foundURIList = extractURIList(); m_propertyToParse = removeBeginningWhiteSpaces(m_propertyToParse.remove(foundURIList)); tokenList.append(foundURIList); } else if(temp.contains("(")!=0){ - QString foundFunctionList = extractFunctionList(); + TQString foundFunctionList = extractFunctionList(); m_propertyToParse = removeBeginningWhiteSpaces(m_propertyToParse.remove(foundFunctionList)); tokenList.append(foundFunctionList); } else if(temp.contains("'")!=0 || temp.contains("\"")!=0 || temp.contains(",")!=0){ - QString foundQuotedStringList = extractQuotedStringList(); + TQString foundQuotedStringList = extractQuotedStringList(); m_propertyToParse = removeBeginningWhiteSpaces(m_propertyToParse.remove(foundQuotedStringList)); tokenList.append(foundQuotedStringList); } |