summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoTextObject.cpp')
-rw-r--r--lib/kotext/KoTextObject.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/lib/kotext/KoTextObject.cpp b/lib/kotext/KoTextObject.cpp
index 30bf6dd3..afd18909 100644
--- a/lib/kotext/KoTextObject.cpp
+++ b/lib/kotext/KoTextObject.cpp
@@ -564,7 +564,7 @@ void KoTextObject::doKeyboardAction( KoTextCursor * cursor, KoTextFormat * & /*c
undoRedoInfo.oldParagLayouts << parag->paragLayout();
}
if ( cursor->atParagEnd() ) {
- // Get paragtqlayout from next parag (next can't be 0 here)
+ // Get paraglayout from next parag (next can't be 0 here)
KoParagLayout paragLayout = parag->next()->paragLayout();
if ( cursor->remove() )
{
@@ -602,10 +602,10 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
return;
const bool checkNewLine = insertFlags & CheckNewLine;
const bool removeSelected = ( insertFlags & DoNotRemoveSelected ) == 0;
- const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0;
+ const bool repaint = ( insertFlags & DoNotRepaint ) == 0;
//kdDebug(32500) << "KoTextObject::insert txt=" << txt << endl;
bool tinyRepaint = !checkNewLine;
- if ( tqrepaint )
+ if ( repaint )
emit hideCursor();
if ( textdoc->hasSelection( selectionId, true ) && removeSelected ) {
kdDebug() << k_funcinfo << "removing selection " << selectionId << endl;
@@ -673,7 +673,7 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
}
// Speed optimization: if we only type a char, and it doesn't
- // tqinvalidate the next parag, only format the current one
+ // invalidate the next parag, only format the current one
// ### This idea is wrong. E.g. when the last parag grows and must create a new page.
#if 0
KoTextParag *parag = cursor->parag();
@@ -687,9 +687,9 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
// Doing this here means callers don't have to do it, and cursor can be positionned correctly.
ensureFormatted( cursor->parag() );
- // Speed optimization: if we only type a char, only tqrepaint from current line
+ // Speed optimization: if we only type a char, only repaint from current line
// (In fact the one before. When typing a space, a word could move up to the
- // line before, we need to tqrepaint it too...)
+ // line before, we need to repaint it too...)
if ( !checkNewLine && tinyRepaint && !wasChanged )
{
// insert() called format() which called setChanged().
@@ -703,12 +703,12 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
parag->setLineChanged( origLine - 1 ); // if origLine=0, it'll pass -1, which is 'all'
}
- if ( tqrepaint ) {
+ if ( repaint ) {
emit repaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
- // we typed the first char of a paragraph in AlignAuto mode -> show correct tqalignment in UI
- if ( oldCursor.index() == 0 && oldCursor.parag()->tqalignment() == TQt::AlignAuto )
+ // we typed the first char of a paragraph in AlignAuto mode -> show correct alignment in UI
+ if ( oldCursor.index() == 0 && oldCursor.parag()->alignment() == TQt::AlignAuto )
emit updateUI( true );
}
@@ -722,8 +722,8 @@ void KoTextObject::insert( KoTextCursor * cursor, KoTextFormat * currentFormat,
if ( !removeSelected ) {
// ## not sure why we do this. I'd prefer leaving the selection unchanged...
// but then it'd need adjustements in the offsets etc.
- if ( textdoc->removeSelection( selectionId ) && tqrepaint )
- selectionChangedNotify(); // does the tqrepaint
+ if ( textdoc->removeSelection( selectionId ) && repaint )
+ selectionChangedNotify(); // does the repaint
}
if ( !customItemsMap.isEmpty()
&& !commandName.isNull() /* see replace-selection; #139890 */ ) {
@@ -748,7 +748,7 @@ void KoTextObject::pasteText( KoTextCursor * cursor, const TQString & text, KoTe
kdDebug(32500) << "KoTextObject::pasteText cursor parag=" << cursor->parag()->paragId() << endl;
TQString t = text;
// Need to convert CRLF to NL
- TQRegExp crlf( TQString::tqfromLatin1("\r\n") );
+ TQRegExp crlf( TQString::fromLatin1("\r\n") );
t.replace( crlf, TQChar('\n') );
// Convert non-printable chars
for ( int i=0; (uint) i<t.length(); i++ ) {
@@ -1066,7 +1066,7 @@ KCommand * KoTextObject::setFormatCommand( KoTextCursor * cursor, KoTextFormat *
if ( cursor->parag()->length() == 1 ) {
newFormat->addRef();
cursor->parag()->setFormat( newFormat );
- cursor->parag()->tqinvalidate(0);
+ cursor->parag()->invalidate(0);
cursor->parag()->format();
emit repaintChanged( this );
}
@@ -1146,7 +1146,7 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
if ( protectContent() )
return 0L;
if ( !textdoc->hasSelection( selectionId, true ) && cursor &&
- (int)cursor->parag()->tqalignment() == align )
+ (int)cursor->parag()->alignment() == align )
return 0L; // No change needed.
emit hideCursor();
@@ -1165,7 +1165,7 @@ KCommand * KoTextObject::setAlignCommand( KoTextCursor * cursor, int align, KoTe
}
formatMore( 2 );
emit repaintChanged( this );
- undoRedoInfo.newParagLayout.tqalignment = align;
+ undoRedoInfo.newParagLayout.alignment = align;
KoTextParagCommand *cmd = new KoTextParagCommand(
textdoc, undoRedoInfo.id, undoRedoInfo.eid,
undoRedoInfo.oldParagLayouts, undoRedoInfo.newParagLayout,
@@ -1547,7 +1547,7 @@ void KoTextObject::removeSelectedText( KoTextCursor * cursor, KoTextDocument::Se
undoRedoInfo.clear();
}
-KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool tqrepaint )
+KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool repaint )
{
if ( protectContent() )
return 0L;
@@ -1578,7 +1578,7 @@ KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTex
undoRedoInfo.type = UndoRedoInfo::Invalid; // we don't want clear() to create a command
undoRedoInfo.clear();
- if ( tqrepaint )
+ if ( repaint )
selectionChangedNotify();
return macroCmd;
}
@@ -1592,8 +1592,8 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const TQ
if ( protectContent() )
return 0L;
Q_ASSERT( ( insertFlags & DoNotRemoveSelected ) == 0 ); // nonsensical
- const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/replace
- if ( tqrepaint )
+ const bool repaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/replace
+ if ( repaint )
emit hideCursor();
// This could be improved to use a macro command only when there's a selection to remove.
KMacroCommand * macroCmd = new KMacroCommand( cmdName );
@@ -1604,7 +1604,7 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const TQ
format->addRef();
// Remove selected text, if any
- KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, tqrepaint );
+ KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, repaint );
if ( removeSelCmd )
macroCmd->addCommand( removeSelCmd );
@@ -1625,7 +1625,7 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const TQ
format->removeRef();
setLastFormattedParag( c1.parag() );
- if ( tqrepaint )
+ if ( repaint )
{
formatMore( 2 );
emit repaintChanged( this );
@@ -1645,7 +1645,7 @@ KCommand * KoTextObject::insertParagraphCommand( KoTextCursor *cursor )
return replaceSelectionCommand( cursor, "\n", TQString(), KoTextDocument::Standard, CheckNewLine );
}
-void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool tqrepaint )
+void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool repaint )
{
if ( !m_highlightSelectionAdded )
{
@@ -1656,20 +1656,20 @@ void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length,
m_highlightSelectionAdded = true;
}
- removeHighlight(tqrepaint); // remove previous highlighted selection
+ removeHighlight(repaint); // remove previous highlighted selection
KoTextCursor cursor( textdoc );
cursor.setParag( parag );
cursor.setIndex( index );
textdoc->setSelectionStart( KoTextDocument::HighlightSelection, &cursor );
cursor.setIndex( index + length );
textdoc->setSelectionEnd( KoTextDocument::HighlightSelection, &cursor );
- if ( tqrepaint ) {
+ if ( repaint ) {
parag->setChanged( true );
emit repaintChanged( this );
}
}
-void KoTextObject::removeHighlight(bool tqrepaint)
+void KoTextObject::removeHighlight(bool repaint)
{
if ( textdoc->hasSelection( KoTextDocument::HighlightSelection, true ) )
{
@@ -1677,7 +1677,7 @@ void KoTextObject::removeHighlight(bool tqrepaint)
oldParag->setChanged( true );
textdoc->removeSelection( KoTextDocument::HighlightSelection );
}
- if ( tqrepaint )
+ if ( repaint )
emit repaintChanged( this );
}
@@ -1831,7 +1831,7 @@ bool KoTextObject::formatMore( int count /* = 10 */, bool emitAfterFormatting /*
}
#ifdef DEBUG_FORMAT_MORE
TQString id;
- if ( m_lastFormatted ) id = TQString(" (%1)").tqarg(m_lastFormatted->paragId());
+ if ( m_lastFormatted ) id = TQString(" (%1)").arg(m_lastFormatted->paragId());
kdDebug(32500) << "formatMore finished formatting. "
<< " bottom=" << bottom
<< " m_lastFormatted=" << m_lastFormatted << id
@@ -2041,13 +2041,13 @@ TQString KoTextObject::textChangedCase(const TQString& _text,KoChangeCaseDia::Ty
case KoChangeCaseDia::TitleCase:
for(uint i=0;i<text.length();i++)
{
- if(text.tqat(i)!=' ')
+ if(text.at(i)!=' ')
{
- TQChar prev = text.tqat(TQMAX(i-1,0));
+ TQChar prev = text.at(TQMAX(i-1,0));
if(i==0 || prev == ' ' || prev == '\n' || prev == '\t')
- text=text.replace(i, 1, text.tqat(i).upper() );
+ text=text.replace(i, 1, text.at(i).upper() );
else
- text=text.replace(i, 1, text.tqat(i).lower() );
+ text=text.replace(i, 1, text.at(i).lower() );
}
}
break;
@@ -2055,9 +2055,9 @@ TQString KoTextObject::textChangedCase(const TQString& _text,KoChangeCaseDia::Ty
for(uint i=0;i<text.length();i++)
{
TQString repl=TQString(text.at(i));
- if(text.tqat(i)!=text.tqat(i).upper())
+ if(text.at(i)!=text.at(i).upper())
repl=repl.upper();
- else if(text.tqat(i).lower()!=text.tqat(i))
+ else if(text.at(i).lower()!=text.at(i))
repl=repl.lower();
text=text.replace(i, 1, repl );
}
@@ -2069,7 +2069,7 @@ TQString KoTextObject::textChangedCase(const TQString& _text,KoChangeCaseDia::Ty
{
TQChar prev = text.at(TQMAX(i-1,0));
if(i==0 || prev == '\n' ||prev.isPunct())
- text=text.replace(i, 1, text.tqat(i).upper() );
+ text=text.replace(i, 1, text.at(i).upper() );
}
}
break;
@@ -2167,7 +2167,7 @@ KoTextCursor KoTextObject::pasteOasisText( const TQDomElement &bodyElem, KoOasis
context.styleStack().restore();
lastParagraph->setChanged( true );
- lastParagraph->tqinvalidate( 0 );
+ lastParagraph->invalidate( 0 );
// Now split this parag, to make room for the next paragraphs
resultCursor.setParag( lastParagraph );
@@ -2692,7 +2692,7 @@ KCommand *KoTextFormatInterface::setDefaultFormatCommand()
KCommand *KoTextFormatInterface::setAlignCommand(int align)
{
KoParagLayout format( *currentParagLayoutFormat() );
- format.tqalignment=align;
+ format.alignment=align;
return setParagLayoutFormatCommand(&format,KoParagLayout::Alignment);
}