summaryrefslogtreecommitdiffstats
path: root/src/kile/kileedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kile/kileedit.cpp')
-rw-r--r--src/kile/kileedit.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/kile/kileedit.cpp b/src/kile/kileedit.cpp
index c56d7fb..a9203d3 100644
--- a/src/kile/kileedit.cpp
+++ b/src/kile/kileedit.cpp
@@ -108,8 +108,8 @@ void EditorExtension::insertTag(const KileAction::TagData& data, Kate::View *vie
bool wrap = ( (!data.tagEnd.isNull()) && doc->hasSelection());
//%C before or after the selection
- bool before = data.tagBegin.tqcontains("%C");
- bool after = data.tagEnd.tqcontains("%C");
+ bool before = data.tagBegin.contains("%C");
+ bool after = data.tagEnd.contains("%C");
//save current cursor position
int para=view->cursorLine();
@@ -123,7 +123,7 @@ void EditorExtension::insertTag(const KileAction::TagData& data, Kate::View *vie
int dxIndentEnv = 0;
// environment tag
- bool envtag = data.tagBegin.tqcontains("%E") || data.tagEnd.tqcontains("%E");
+ bool envtag = data.tagBegin.contains("%E") || data.tagEnd.contains("%E");
TQString whitespace = getWhiteSpace( doc->textLine(para).left(index) );
//if there is a selection act as if cursor is at the beginning of selection
@@ -157,7 +157,7 @@ void EditorExtension::insertTag(const KileAction::TagData& data, Kate::View *vie
// strip one of two consecutive line ends
int len = sel.length();
- if ( tagEnd.at(0)=='\n' && len>0 && sel.tqfind('\n',-1)==len-1 )
+ if ( tagEnd.at(0)=='\n' && len>0 && sel.find('\n',-1)==len-1 )
sel.truncate( len-1 );
// now add the selection
@@ -172,19 +172,19 @@ void EditorExtension::insertTag(const KileAction::TagData& data, Kate::View *vie
}
else if ( envtag )
{
- ins.tqreplace("%E",whitespace+m_envAutoIndent);
- tagEnd.tqreplace("%E",whitespace+m_envAutoIndent);
+ ins.replace("%E",whitespace+m_envAutoIndent);
+ tagEnd.replace("%E",whitespace+m_envAutoIndent);
if ( data.dy > 0 )
dxIndentEnv = whitespace.length() + m_envAutoIndent.length();
}
- tagEnd.tqreplace("\\end{",whitespace+"\\end{");
+ tagEnd.replace("\\end{",whitespace+"\\end{");
ins += tagEnd + trailing;
//do some replacements
TQFileInfo fi( doc->url().path());
- ins.tqreplace("%S", fi.baseName(true));
- ins.tqreplace("%B", s_bullet);
+ ins.replace("%S", fi.baseName(true));
+ ins.replace("%B", s_bullet);
//insert first part of tag at cursor position
doc->insertText(para,index,ins);
@@ -192,13 +192,13 @@ void EditorExtension::insertTag(const KileAction::TagData& data, Kate::View *vie
//move cursor to the new position
if ( before || after )
{
- int n = data.tagBegin.tqcontains("\n")+ data.tagEnd.tqcontains("\n");
+ int n = data.tagBegin.contains("\n")+ data.tagEnd.contains("\n");
if (wrap) n += para_end > para ? para_end-para : para-para_end;
for (int line = para_begin; line <= para_begin+n; ++line)
{
- if (doc->textLine(line).tqcontains("%C"))
+ if (doc->textLine(line).contains("%C"))
{
- int i=doc->textLine(line).tqfind("%C");
+ int i=doc->textLine(line).find("%C");
para_cursor = line; index_cursor = i;
doc->removeText(line,i,line,i+2);
break;
@@ -1348,7 +1348,7 @@ bool EditorExtension::isEnvironmentPosition(Kate::Document *doc, uint row, uint
int startcol = ( textline[col] == '\\' ) ? col - 1 : col;
if ( startcol >= 1 )
{
- int pos = textline.tqfindRev(m_reg,startcol);
+ int pos = textline.findRev(m_reg,startcol);
env.len = m_reg.matchedLength();
if ( pos!=-1 && (uint)pos<col && col<=(uint)pos+env.len )
{
@@ -1375,7 +1375,7 @@ bool EditorExtension::isEnvironmentPosition(Kate::Document *doc, uint row, uint
}
// check if there is a match in this line from the current position to the right
- if ( textline[col]=='\\' && col==(uint)textline.tqfind(m_reg,col) )
+ if ( textline[col]=='\\' && col==(uint)textline.find(m_reg,col) )
{
envright.row = row;
envright.col = col;
@@ -2004,7 +2004,7 @@ bool EditorExtension::getCurrentWord(Kate::Document *doc, uint row, uint col, Ed
if ( col > 0 )
{
reg.setPattern(pattern1);
- pos = textline.tqfindRev(reg,col-1);
+ pos = textline.findRev(reg,col-1);
if ( pos != -1 ) { // found an illegal character
x1 = pos + 1;
if ( mode == smTex ) {
@@ -2019,7 +2019,7 @@ bool EditorExtension::getCurrentWord(Kate::Document *doc, uint row, uint col, Ed
// search at the current position
reg.setPattern(pattern2);
- pos = textline.tqfind(reg,col);
+ pos = textline.find(reg,col);
if ( pos!=-1 && (uint)pos==col )
{
x2 = pos + reg.matchedLength();
@@ -2365,7 +2365,7 @@ bool EditorExtension::insertDoubleQuotes()
bool openfound = false;
if ( iface->searchText(row,col,reg,&r,&c,&l,true) )
{
- openfound = ( doc->textLine(r).tqfind(m_leftDblQuote,c) == (int)c );
+ openfound = ( doc->textLine(r).find(m_leftDblQuote,c) == (int)c );
//KILE_DEBUG() << "pattern=" << reg.pattern() << " " << reg.cap(1) << " r=" << r << " c=" << c << " open=" << openfound<< endl;
}
@@ -2378,7 +2378,7 @@ bool EditorExtension::insertDoubleQuotes()
// insert a language specific doublequote close
int startcol = col - m_leftDblQuote.length();
//KILE_DEBUG() << "startcol=" << startcol << " col=" << col << endl;
- if ( startcol>=0 && textline.tqfind(m_leftDblQuote,startcol) == (int)startcol )
+ if ( startcol>=0 && textline.find(m_leftDblQuote,startcol) == (int)startcol )
{
doc->removeText(row,startcol,row,startcol+m_leftDblQuote.length());
doc->insertText(row,startcol,"\"");
@@ -2395,7 +2395,7 @@ bool EditorExtension::insertDoubleQuotes()
// insert a language specific doublequote open
int startcol = col - m_rightDblQuote.length();
//KILE_DEBUG() << "startcol=" << startcol << " col=" << col << endl;
- if ( startcol>=0 && textline.tqfind(m_rightDblQuote,startcol) == (int)startcol )
+ if ( startcol>=0 && textline.find(m_rightDblQuote,startcol) == (int)startcol )
{
doc->removeText(row,startcol,row,startcol+m_rightDblQuote.length());
doc->insertText(row,startcol,"\"");
@@ -2428,7 +2428,7 @@ void EditorExtension::insertIntelligentTabulator()
// try to align tabulator with textline above
if ( currentRow >= 1 )
{
- int tabpos = view->getDoc()->textLine(currentRow-1).tqfind('&',currentCol);
+ int tabpos = view->getDoc()->textLine(currentRow-1).find('&',currentCol);
if ( tabpos >= 0 )
{
currentCol = tabpos;
@@ -2476,7 +2476,7 @@ bool EditorExtension::eventInsertEnvironment(Kate::View *view)
else
{
envname = m_regexpEnter.cap(4);
- endenv = m_regexpEnter.cap(2).tqreplace("\\begin","\\end") + '\n';
+ endenv = m_regexpEnter.cap(2).replace("\\begin","\\end") + '\n';
}
if ( shouldCompleteEnv(envname, view) )
@@ -2515,8 +2515,8 @@ bool EditorExtension::shouldCompleteEnv(const TQString &env, Kate::View *view)
view->cursorPositionReal(&realLine, &realColumn);
for ( int i = realLine; i < num; ++i)
{
- numBeginsFound += view->getDoc()->textLine(i).tqcontains(reTestBegin);
- numEndsFound += view->getDoc()->textLine(i).tqcontains(reTestEnd);
+ numBeginsFound += view->getDoc()->textLine(i).contains(reTestBegin);
+ numEndsFound += view->getDoc()->textLine(i).contains(reTestEnd);
KILE_DEBUG() << "line is " << i << " numBeginsFound = " << numBeginsFound << " , " << "numEndsFound = " << numEndsFound << endl;
if ( numEndsFound >= numBeginsFound )
return false;
@@ -2570,11 +2570,11 @@ bool EditorExtension::insideVerb(Kate::View *view)
TQRegExp reg("\\\\verb(\\*?)(.)");
while ( true )
{
- int pos = textline.tqfind(reg,startpos);
+ int pos = textline.find(reg,startpos);
if ( pos<0 || col<(uint)pos+6+reg.cap(1).length() )
return false;
- pos = textline.tqfind(reg.cap(2),pos+6+reg.cap(1).length());
+ pos = textline.find(reg.cap(2),pos+6+reg.cap(1).length());
if ( pos<0 || col<=(uint)pos )
return true;
@@ -2711,7 +2711,7 @@ bool EditorExtension::findEndOfDocument(Kate::Document *doc, uint row, uint col,
while ( iface->searchText(row,col,"\\end{document}",&rowFound,&colFound,&lenFound) )
{
textline = getTextLineReal(doc,rowFound);
- if ( textline.tqfind("\\end{document}",colFound) == (int)colFound )
+ if ( textline.find("\\end{document}",colFound) == (int)colFound )
return true;
row = rowFound;