summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoTextObject.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-16 09:56:31 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-16 09:56:31 -0600
commitc9cb4f487428aad5d8cda5e3a4b9ad87390d7e54 (patch)
tree1ee1912ac4bb966475f0db0f2a78678661b4b4a5 /lib/kotext/KoTextObject.cpp
parent94844816550ad672ccfcdc25659c625546239998 (diff)
downloadkoffice-c9cb4f487428aad5d8cda5e3a4b9ad87390d7e54.tar.gz
koffice-c9cb4f487428aad5d8cda5e3a4b9ad87390d7e54.zip
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 94844816550ad672ccfcdc25659c625546239998.
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 afd18909..30bf6dd3 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 paraglayout from next parag (next can't be 0 here)
+ // Get paragtqlayout 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 repaint = ( insertFlags & DoNotRepaint ) == 0;
+ const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0;
//kdDebug(32500) << "KoTextObject::insert txt=" << txt << endl;
bool tinyRepaint = !checkNewLine;
- if ( repaint )
+ if ( tqrepaint )
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
- // invalidate the next parag, only format the current one
+ // tqinvalidate 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 repaint from current line
+ // Speed optimization: if we only type a char, only tqrepaint from current line
// (In fact the one before. When typing a space, a word could move up to the
- // line before, we need to repaint it too...)
+ // line before, we need to tqrepaint 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 ( repaint ) {
+ if ( tqrepaint ) {
emit repaintChanged( this );
emit ensureCursorVisible();
emit showCursor();
- // 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 )
+ // 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 )
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 ) && repaint )
- selectionChangedNotify(); // does the repaint
+ if ( textdoc->removeSelection( selectionId ) && tqrepaint )
+ selectionChangedNotify(); // does the tqrepaint
}
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::fromLatin1("\r\n") );
+ TQRegExp crlf( TQString::tqfromLatin1("\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()->invalidate(0);
+ cursor->parag()->tqinvalidate(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()->alignment() == align )
+ (int)cursor->parag()->tqalignment() == 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.alignment = align;
+ undoRedoInfo.newParagLayout.tqalignment = 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 repaint )
+KCommand * KoTextObject::removeSelectedTextCommand( KoTextCursor * cursor, KoTextDocument::SelectionId selectionId, bool tqrepaint )
{
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 ( repaint )
+ if ( tqrepaint )
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 repaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/replace
- if ( repaint )
+ const bool tqrepaint = ( insertFlags & DoNotRepaint ) == 0; // DoNotRepaint is set during search/replace
+ if ( tqrepaint )
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, repaint );
+ KCommand* removeSelCmd = removeSelectedTextCommand( cursor, selectionId, tqrepaint );
if ( removeSelCmd )
macroCmd->addCommand( removeSelCmd );
@@ -1625,7 +1625,7 @@ KCommand* KoTextObject::replaceSelectionCommand( KoTextCursor * cursor, const TQ
format->removeRef();
setLastFormattedParag( c1.parag() );
- if ( repaint )
+ if ( tqrepaint )
{
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 repaint )
+void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length, bool tqrepaint )
{
if ( !m_highlightSelectionAdded )
{
@@ -1656,20 +1656,20 @@ void KoTextObject::highlightPortion( KoTextParag * parag, int index, int length,
m_highlightSelectionAdded = true;
}
- removeHighlight(repaint); // remove previous highlighted selection
+ removeHighlight(tqrepaint); // 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 ( repaint ) {
+ if ( tqrepaint ) {
parag->setChanged( true );
emit repaintChanged( this );
}
}
-void KoTextObject::removeHighlight(bool repaint)
+void KoTextObject::removeHighlight(bool tqrepaint)
{
if ( textdoc->hasSelection( KoTextDocument::HighlightSelection, true ) )
{
@@ -1677,7 +1677,7 @@ void KoTextObject::removeHighlight(bool repaint)
oldParag->setChanged( true );
textdoc->removeSelection( KoTextDocument::HighlightSelection );
}
- if ( repaint )
+ if ( tqrepaint )
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)").arg(m_lastFormatted->paragId());
+ if ( m_lastFormatted ) id = TQString(" (%1)").tqarg(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.at(i)!=' ')
+ if(text.tqat(i)!=' ')
{
- TQChar prev = text.at(TQMAX(i-1,0));
+ TQChar prev = text.tqat(TQMAX(i-1,0));
if(i==0 || prev == ' ' || prev == '\n' || prev == '\t')
- text=text.replace(i, 1, text.at(i).upper() );
+ text=text.replace(i, 1, text.tqat(i).upper() );
else
- text=text.replace(i, 1, text.at(i).lower() );
+ text=text.replace(i, 1, text.tqat(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.at(i)!=text.at(i).upper())
+ if(text.tqat(i)!=text.tqat(i).upper())
repl=repl.upper();
- else if(text.at(i).lower()!=text.at(i))
+ else if(text.tqat(i).lower()!=text.tqat(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.at(i).upper() );
+ text=text.replace(i, 1, text.tqat(i).upper() );
}
}
break;
@@ -2167,7 +2167,7 @@ KoTextCursor KoTextObject::pasteOasisText( const TQDomElement &bodyElem, KoOasis
context.styleStack().restore();
lastParagraph->setChanged( true );
- lastParagraph->invalidate( 0 );
+ lastParagraph->tqinvalidate( 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.alignment=align;
+ format.tqalignment=align;
return setParagLayoutFormatCommand(&format,KoParagLayout::Alignment);
}