diff options
| author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
|---|---|---|
| committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
| commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
| tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /umbrello/umbrello/textblock.cpp | |
| parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
| download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip | |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/textblock.cpp')
| -rw-r--r-- | umbrello/umbrello/textblock.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/umbrello/umbrello/textblock.cpp b/umbrello/umbrello/textblock.cpp index e9779875..f3ea35fe 100644 --- a/umbrello/umbrello/textblock.cpp +++ b/umbrello/umbrello/textblock.cpp @@ -19,7 +19,7 @@ #include "textblock.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> // local includes #include "codedocument.h" @@ -30,8 +30,8 @@ // Constructors/Destructors // -TextBlock::TextBlock ( CodeDocument * parent, const QString & text ) - : QObject ( (QObject *)parent, "textBlock") +TextBlock::TextBlock ( CodeDocument * parent, const TQString & text ) + : TQObject ( (TQObject *)parent, "textBlock") { initFields(parent); setText(text); @@ -73,7 +73,7 @@ CodeDocument * TextBlock::getParentDocument ( ) { * The actual text of this code block. * @param new_var the new value of m_text */ -void TextBlock::setText ( const QString &new_var ) { +void TextBlock::setText ( const TQString &new_var ) { m_text = new_var; } @@ -81,7 +81,7 @@ void TextBlock::setText ( const QString &new_var ) { * Add text to this object. * */ -void TextBlock::appendText ( const QString &new_text ) { +void TextBlock::appendText ( const TQString &new_text ) { m_text = m_text + new_text; } @@ -90,7 +90,7 @@ void TextBlock::appendText ( const QString &new_text ) { * The actual text of this code block. * @return the value of m_text */ -QString TextBlock::getText ( ) const { +TQString TextBlock::getText ( ) const { return m_text; } @@ -99,7 +99,7 @@ QString TextBlock::getText ( ) const { * may be used to find this text block in the code document * to which it belongs. */ -QString TextBlock::getTag( ) const { +TQString TextBlock::getTag( ) const { return m_tag; } @@ -108,7 +108,7 @@ QString TextBlock::getTag( ) const { * may be used to find this text block in the code document * to which it belongs. */ -void TextBlock::setTag ( const QString &value ) { +void TextBlock::setTag ( const TQString &value ) { m_tag = value; } @@ -144,21 +144,21 @@ int TextBlock::getIndentationLevel ( ) { return m_indentationLevel; } -QString TextBlock::getNewLineEndingChars ( ) { +TQString TextBlock::getNewLineEndingChars ( ) { CodeGenerationPolicy * policy = UMLApp::app()->getCommonPolicy(); return policy->getNewLineEndingChars(); } -QString TextBlock::getIndentation() { +TQString TextBlock::getIndentation() { CodeGenerationPolicy * policy = UMLApp::app()->getCommonPolicy(); return policy->getIndentation(); } -QString TextBlock::getIndentationString ( int level ) { +TQString TextBlock::getIndentationString ( int level ) { if (!level) level = m_indentationLevel; - QString indentAmount = getIndentation(); - QString indentation = ""; + TQString indentAmount = getIndentation(); + TQString indentation = ""; for(int i=0; i<level; i++) indentation.append(indentAmount); return indentation; @@ -177,20 +177,20 @@ QString TextBlock::getIndentationString ( int level ) { int TextBlock::firstEditableLine() { return 0; } int TextBlock::lastEditableLine() { return 0; } -QString TextBlock::getNewEditorLine ( int amount ) { +TQString TextBlock::getNewEditorLine ( int amount ) { return getIndentationString(amount); } // will remove indenation from this text block. -QString TextBlock::unformatText ( const QString & text, const QString & indent ) +TQString TextBlock::unformatText ( const TQString & text, const TQString & indent ) { - QString output = text; - QString myIndent = indent; + TQString output = text; + TQString myIndent = indent; if(myIndent.isEmpty()) myIndent = getIndentationString(); if(!output.isEmpty()) - output.remove(QRegExp('^'+myIndent)); + output.remove(TQRegExp('^'+myIndent)); return output; } @@ -200,22 +200,22 @@ void TextBlock::release () { //this->deleteLater(); } -QString TextBlock::formatMultiLineText ( const QString &work, const QString &linePrefix, - const QString& breakStr, bool addBreak, bool lastLineHasBreak ) { - QString output = ""; - QString text = work; - QString endLine = getNewLineEndingChars(); - int matches = text.contains(QRegExp(breakStr)); +TQString TextBlock::formatMultiLineText ( const TQString &work, const TQString &linePrefix, + const TQString& breakStr, bool addBreak, bool lastLineHasBreak ) { + TQString output = ""; + TQString text = work; + TQString endLine = getNewLineEndingChars(); + int matches = text.contains(TQRegExp(breakStr)); if(matches) { // check that last part of string matches, if not, then // we have to tack on extra match - if(!text.contains(QRegExp(breakStr+"\\$"))) + if(!text.contains(TQRegExp(breakStr+"\\$"))) matches++; for(int i=0; i < matches; i++) { - QString line = text.section(QRegExp(breakStr),i,i); + TQString line = text.section(TQRegExp(breakStr),i,i); output += linePrefix + line; if((i != matches-1) || lastLineHasBreak) output += endLine; // add break to line @@ -229,10 +229,10 @@ QString TextBlock::formatMultiLineText ( const QString &work, const QString &lin return output; } -void TextBlock::setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement) +void TextBlock::setAttributesOnNode ( TQDomDocument & doc, TQDomElement & blockElement) { - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); if (&doc != 0 ) { @@ -240,7 +240,7 @@ void TextBlock::setAttributesOnNode ( QDomDocument & doc, QDomElement & blockEle // only write these if different from defaults if(getIndentationLevel()) - blockElement.setAttribute("indentLevel",QString::number(getIndentationLevel())); + blockElement.setAttribute("indentLevel",TQString::number(getIndentationLevel())); if(!m_text.isEmpty()) blockElement.setAttribute("text",encodeText(m_text,endLine)); if(!getWriteOutText()) @@ -263,9 +263,9 @@ void TextBlock::setAttributesFromObject(TextBlock * obj) } -void TextBlock::setAttributesFromNode (QDomElement & root ) { +void TextBlock::setAttributesFromNode (TQDomElement & root ) { - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); setIndentationLevel(root.attribute("indentLevel","0").toInt()); setTag(root.attribute("tag","")); @@ -278,31 +278,31 @@ void TextBlock::setAttributesFromNode (QDomElement & root ) { // encode text for XML storage // we simply convert all types of newLines to the "\n" or 
 // entity. -QString TextBlock::encodeText(const QString& text, const QString &endLine) { - QString encoded = text; - encoded.replace(QRegExp(endLine),"
"); +TQString TextBlock::encodeText(const TQString& text, const TQString &endLine) { + TQString encoded = text; + encoded.replace(TQRegExp(endLine),"
"); return encoded; } // encode text for XML storage // we simply convert all types of newLines to the "\n" or 
 // entity. -QString TextBlock::decodeText(const QString& text, const QString &endLine) { - QString decoded = text; - decoded.replace(QRegExp("
"),endLine); +TQString TextBlock::decodeText(const TQString& text, const TQString &endLine) { + TQString decoded = text; + decoded.replace(TQRegExp("
"),endLine); return decoded; } /** * @return QString */ -QString TextBlock::toString ( ) +TQString TextBlock::toString ( ) { // simple output method if(m_writeOutText && !m_text.isEmpty()) { - QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); + TQString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars(); return formatMultiLineText(m_text, getIndentationString(), endLine); } else return ""; |
