diff options
Diffstat (limited to 'quanta/components/csseditor/stylesheetparser.cpp')
-rw-r--r-- | quanta/components/csseditor/stylesheetparser.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/quanta/components/csseditor/stylesheetparser.cpp b/quanta/components/csseditor/stylesheetparser.cpp index db36ea4c..7374ce9a 100644 --- a/quanta/components/csseditor/stylesheetparser.cpp +++ b/quanta/components/csseditor/stylesheetparser.cpp @@ -20,7 +20,7 @@ #include <kdebug.h> static const TQString msg1(i18n("has not been closed")), - msg2(i18n("needs an opening parenthesis ")); + msg2(i18n("needs an opening tqparenthesis ")); stylesheetParser::stylesheetParser(const TQString& s){ m_styleSheet = s; @@ -74,7 +74,7 @@ void stylesheetParser::parseComment(){ if(stopProcessingComment){ int ws=whiteSpaces(k); - QPair<TQString,unsigned int> tmp(m_styleSheet.left(k+ws),++m_orderNumber); + TQPair<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,7 +87,7 @@ void stylesheetParser::parseComment(){ } } -unsigned int stylesheetParser::numberOfParenthesisInAParenthesisBlock(parenthesisKind p, const TQString& b){ +unsigned int stylesheetParser::numberOfParenthesisInAParenthesisBlock(tqparenthesisKind p, const TQString& b){ TQChar searchFor = '{'; if (p == closed) searchFor = '}'; @@ -151,24 +151,24 @@ void stylesheetParser::parseSelector(){ int closingParentheses = 1, openingParentheses = 0; while(true){ - openingParentheses = numberOfParenthesisInAParenthesisBlock(closed,m_styleSheet.left(closingParenthesisPos+1)); //m_styleSheet.left(closingParenthesisPos+1).contains("{"); + openingParentheses = numberOfParenthesisInAParenthesisBlock(closed,m_styleSheet.left(closingParenthesisPos+1)); //m_styleSheet.left(closingParenthesisPos+1).tqcontains("{"); if(openingParentheses==closingParentheses){ - 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); + TQString selectorName=m_styleSheet.left(findParanthesis(m_styleSheet, '{')/*m_styleSheet.tqfind("{")*/).stripWhiteSpace(), + selectorValue=m_styleSheet.mid(findParanthesis(m_styleSheet, '{')/*m_styleSheet.tqfind("{")*/+1, closingParenthesisPos - m_styleSheet.tqfind("{") -1); selectorName.remove("\n").remove("\t"); selectorValue.remove("\n").remove("\t"); - QPair<TQString,unsigned int> tmp(selectorValue,++m_orderNumber); + TQPair<TQString,unsigned int> tmp(selectorValue,++m_orderNumber); - if (m_stylesheetStructure.contains(selectorName)) + if (m_stylesheetStructure.tqcontains(selectorName)) { uint i = 2; - TQString s = selectorName + TQString("-v%1").arg(i); - while (m_stylesheetStructure.contains(s)) + TQString s = selectorName + TQString("-v%1").tqarg(i); + while (m_stylesheetStructure.tqcontains(s)) { i++; - s = selectorName + TQString("-v%1").arg(i); + s = selectorName + TQString("-v%1").tqarg(i); } selectorName = s; } @@ -176,7 +176,7 @@ void stylesheetParser::parseSelector(){ break; } else { - closingParenthesisPos = findParanthesis(m_styleSheet, '{',closingParenthesisPos+1)/*m_styleSheet.find("}",closingParenthesisPos+1)*/; + closingParenthesisPos = findParanthesis(m_styleSheet, '{',closingParenthesisPos+1)/*m_styleSheet.tqfind("}",closingParenthesisPos+1)*/; closingParentheses++; } } @@ -188,13 +188,13 @@ void stylesheetParser::parseSelector(){ void stylesheetParser::parseAtRules1(){ //TODO this needs to be fixed : in case the at rule is not properly closed the parser hangs - if(m_styleSheet.find("{") == -1) { + if(m_styleSheet.tqfind("{") == -1) { m_stopProcessing = true; emit errorOccurred(m_styleSheet.mid(0,20) + "...\n " + msg2); return; } - int closingParenthesisPos = m_styleSheet.find("}"), + int closingParenthesisPos = m_styleSheet.tqfind("}"), closingParentheses = 0; if(closingParenthesisPos==-1) return; @@ -202,12 +202,12 @@ void stylesheetParser::parseAtRules1(){ int openingParentheses=0; while(true){ - openingParentheses = m_styleSheet.left(closingParenthesisPos+1).contains("{"); + openingParentheses = m_styleSheet.left(closingParenthesisPos+1).tqcontains("{"); if(openingParentheses==closingParentheses) break; else { - closingParenthesisPos = m_styleSheet.find("}",closingParenthesisPos+1); + closingParenthesisPos = m_styleSheet.tqfind("}",closingParenthesisPos+1); if( closingParenthesisPos!= -1 ) closingParentheses++; else { @@ -219,7 +219,7 @@ void stylesheetParser::parseAtRules1(){ } int ws=whiteSpaces(closingParenthesisPos+1); - QPair<TQString,unsigned int> tmp(m_styleSheet.left(closingParenthesisPos+1+ws),++m_orderNumber); + TQPair<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(); @@ -227,7 +227,7 @@ void stylesheetParser::parseAtRules1(){ void stylesheetParser::parseAtRules2(){ //TODO this needs to be fixed : in case the at rule is not properly closed the parser hangs - int semicolonPos = m_styleSheet.find(";"); + int semicolonPos = m_styleSheet.tqfind(";"); if(semicolonPos==-1) { m_stopProcessing = true; @@ -236,7 +236,7 @@ void stylesheetParser::parseAtRules2(){ } int ws=whiteSpaces(semicolonPos+1); - QPair<TQString,unsigned int> tmp(m_styleSheet.left(semicolonPos+1+ws),++m_orderNumber); + TQPair<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(); |