diff options
Diffstat (limited to 'quanta/components/csseditor/stylesheetparser.cpp')
-rw-r--r-- | quanta/components/csseditor/stylesheetparser.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/quanta/components/csseditor/stylesheetparser.cpp b/quanta/components/csseditor/stylesheetparser.cpp index b8cbf306..db36ea4c 100644 --- a/quanta/components/csseditor/stylesheetparser.cpp +++ b/quanta/components/csseditor/stylesheetparser.cpp @@ -19,10 +19,10 @@ #include <klocale.h> #include <kdebug.h> -static const QString msg1(i18n("has not been closed")), +static const TQString msg1(i18n("has not been closed")), msg2(i18n("needs an opening parenthesis ")); -stylesheetParser::stylesheetParser(const QString& s){ +stylesheetParser::stylesheetParser(const TQString& s){ m_styleSheet = s; m_styleSheet=m_styleSheet.right(m_styleSheet.length()-whiteSpaces(0)); m_stopProcessing = false; @@ -32,7 +32,7 @@ stylesheetParser::stylesheetParser(const QString& s){ int stylesheetParser::whiteSpaces(int d){ int ws=0; for( unsigned int i=d;i<m_styleSheet.length();i++){ - QString temp; + TQString temp; if(m_styleSheet[i] == ' ' || m_styleSheet[i] == '\n' || m_styleSheet[i] == '\t' ) ws++; else break; @@ -63,7 +63,7 @@ void stylesheetParser::parseComment(){ bool stopProcessingComment=false; unsigned int k; for(k=2;k<m_styleSheet.length()-1;k++){ - QString temp; + TQString temp; temp.append(m_styleSheet[k]).append(m_styleSheet[k+1]); if(temp=="*/") { k+=2; @@ -74,8 +74,8 @@ void stylesheetParser::parseComment(){ if(stopProcessingComment){ int ws=whiteSpaces(k); - QPair<QString,unsigned int> tmp(m_styleSheet.left(k+ws),++m_orderNumber); - m_stylesheetStructure["/*"+QString::number(m_orderNumber,10)]=tmp; + QPair<TQString,unsigned int> tmp(m_styleSheet.left(k+ws),++m_orderNumber); + m_stylesheetStructure["/*"+TQString::number(m_orderNumber,10)]=tmp; m_styleSheet=m_styleSheet.right(m_styleSheet.length()-k-ws); parse(); } @@ -87,8 +87,8 @@ void stylesheetParser::parseComment(){ } } -unsigned int stylesheetParser::numberOfParenthesisInAParenthesisBlock(parenthesisKind p, const QString& b){ - QChar searchFor = '{'; +unsigned int stylesheetParser::numberOfParenthesisInAParenthesisBlock(parenthesisKind p, const TQString& b){ + TQChar searchFor = '{'; if (p == closed) searchFor = '}'; int num = 0; @@ -106,7 +106,7 @@ unsigned int stylesheetParser::numberOfParenthesisInAParenthesisBlock(parenthesi return num; } -int findParanthesis(const QString& string, const QChar &ch, int startPos = 0) +int findParanthesis(const TQString& string, const TQChar &ch, int startPos = 0) { int pos = -1; int len = string.length(); @@ -134,7 +134,7 @@ void stylesheetParser::parseSelector(){ return; } - QString temp(m_styleSheet.left(closingParenthesisPos+1)); + TQString temp(m_styleSheet.left(closingParenthesisPos+1)); if(numberOfParenthesisInAParenthesisBlock(closed,temp) < numberOfParenthesisInAParenthesisBlock(opened,temp)){ m_stopProcessing = true; @@ -154,21 +154,21 @@ void stylesheetParser::parseSelector(){ openingParentheses = numberOfParenthesisInAParenthesisBlock(closed,m_styleSheet.left(closingParenthesisPos+1)); //m_styleSheet.left(closingParenthesisPos+1).contains("{"); if(openingParentheses==closingParentheses){ - QString selectorName=m_styleSheet.left(findParanthesis(m_styleSheet, '{')/*m_styleSheet.find("{")*/).stripWhiteSpace(), + TQString selectorName=m_styleSheet.left(findParanthesis(m_styleSheet, '{')/*m_styleSheet.find("{")*/).stripWhiteSpace(), selectorValue=m_styleSheet.mid(findParanthesis(m_styleSheet, '{')/*m_styleSheet.find("{")*/+1, closingParenthesisPos - m_styleSheet.find("{") -1); selectorName.remove("\n").remove("\t"); selectorValue.remove("\n").remove("\t"); - QPair<QString,unsigned int> tmp(selectorValue,++m_orderNumber); + QPair<TQString,unsigned int> tmp(selectorValue,++m_orderNumber); if (m_stylesheetStructure.contains(selectorName)) { uint i = 2; - QString s = selectorName + QString("-v%1").arg(i); + TQString s = selectorName + TQString("-v%1").arg(i); while (m_stylesheetStructure.contains(s)) { i++; - s = selectorName + QString("-v%1").arg(i); + s = selectorName + TQString("-v%1").arg(i); } selectorName = s; } @@ -219,8 +219,8 @@ void stylesheetParser::parseAtRules1(){ } int ws=whiteSpaces(closingParenthesisPos+1); - QPair<QString,unsigned int> tmp(m_styleSheet.left(closingParenthesisPos+1+ws),++m_orderNumber); - m_stylesheetStructure["@rule"+QString::number(m_orderNumber,10)]=tmp; + QPair<TQString,unsigned int> tmp(m_styleSheet.left(closingParenthesisPos+1+ws),++m_orderNumber); + m_stylesheetStructure["@rule"+TQString::number(m_orderNumber,10)]=tmp; m_styleSheet=m_styleSheet.right(m_styleSheet.length()-closingParenthesisPos-1-ws); parse(); } @@ -236,8 +236,8 @@ void stylesheetParser::parseAtRules2(){ } int ws=whiteSpaces(semicolonPos+1); - QPair<QString,unsigned int> tmp(m_styleSheet.left(semicolonPos+1+ws),++m_orderNumber); - m_stylesheetStructure["@rule"+QString::number(m_orderNumber,10)]=tmp; + QPair<TQString,unsigned int> tmp(m_styleSheet.left(semicolonPos+1+ws),++m_orderNumber); + m_stylesheetStructure["@rule"+TQString::number(m_orderNumber,10)]=tmp; m_styleSheet=m_styleSheet.right(m_styleSheet.length()-semicolonPos-1-ws); parse(); } |