From 94844816550ad672ccfcdc25659c625546239998 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:32:11 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kpresenter/KPrTextObject.cpp | 218 +++++++++++++++++++++---------------------- 1 file changed, 109 insertions(+), 109 deletions(-) (limited to 'kpresenter/KPrTextObject.cpp') diff --git a/kpresenter/KPrTextObject.cpp b/kpresenter/KPrTextObject.cpp index 6cec5fc22..0194e1fe1 100644 --- a/kpresenter/KPrTextObject.cpp +++ b/kpresenter/KPrTextObject.cpp @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include @@ -239,7 +239,7 @@ void KPrTextObject::saveOasisMarginElement( KoGenStyle &styleobjectauto ) const if ( bright != 0.0 ) styleobjectauto.addPropertyPt("fo:padding-right", bright ); - //add vertical tqalignment + //add vertical alignment switch( m_textVertAlign ) { case KP_TOP: @@ -272,15 +272,15 @@ void KPrTextObject::loadOasis(const TQDomElement &element, KoOasisContext& conte if( styleStack.hasAttributeNS( KoXmlNS::fo, "padding-right" ) ) bright = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, "padding-right" ) ); kdDebug()<<" KPrTextObject::loadOasis : btp :"<load( element ); + layout.counter = new KoParagCounter; + layout.counter->load( element ); } KoTabulatorList tabList; @@ -1140,110 +1140,110 @@ KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocu tabList.append( tab ); } } - tqlayout.setTabList( tabList ); + layout.setTabList( tabList ); - return tqlayout; + return layout; } -void KPrTextObject::saveParagLayout( const KoParagLayout& tqlayout, TQDomElement & parentElem ) +void KPrTextObject::saveParagLayout( const KoParagLayout& layout, TQDomElement & parentElem ) { TQDomDocument doc = parentElem.ownerDocument(); TQDomElement element = doc.createElement( "NAME" ); parentElem.appendChild( element ); - if ( tqlayout.style ) - element.setAttribute( "value", tqlayout.style->name() ); + if ( layout.style ) + element.setAttribute( "value", layout.style->name() ); else kdWarning() << "KWTextParag::saveParagLayout: style==0L!" << endl; - if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 || - tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 || - tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 ) + if ( layout.margins[TQStyleSheetItem::MarginFirstLine] != 0 || + layout.margins[TQStyleSheetItem::MarginLeft] != 0 || + layout.margins[TQStyleSheetItem::MarginRight] != 0 ) { element = doc.createElement( "INDENTS" ); parentElem.appendChild( element ); - if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 ) - element.setAttribute( "first", tqlayout.margins[TQStyleSheetItem::MarginFirstLine] ); - if ( tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 ) - element.setAttribute( "left", tqlayout.margins[TQStyleSheetItem::MarginLeft] ); - if ( tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 ) - element.setAttribute( "right", tqlayout.margins[TQStyleSheetItem::MarginRight] ); + if ( layout.margins[TQStyleSheetItem::MarginFirstLine] != 0 ) + element.setAttribute( "first", layout.margins[TQStyleSheetItem::MarginFirstLine] ); + if ( layout.margins[TQStyleSheetItem::MarginLeft] != 0 ) + element.setAttribute( "left", layout.margins[TQStyleSheetItem::MarginLeft] ); + if ( layout.margins[TQStyleSheetItem::MarginRight] != 0 ) + element.setAttribute( "right", layout.margins[TQStyleSheetItem::MarginRight] ); } - if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 || - tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 ) + if ( layout.margins[TQStyleSheetItem::MarginTop] != 0 || + layout.margins[TQStyleSheetItem::MarginBottom] != 0 ) { element = doc.createElement( "OFFSETS" ); parentElem.appendChild( element ); - if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 ) - element.setAttribute( "before", tqlayout.margins[TQStyleSheetItem::MarginTop] ); - if ( tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 ) - element.setAttribute( "after", tqlayout.margins[TQStyleSheetItem::MarginBottom] ); + if ( layout.margins[TQStyleSheetItem::MarginTop] != 0 ) + element.setAttribute( "before", layout.margins[TQStyleSheetItem::MarginTop] ); + if ( layout.margins[TQStyleSheetItem::MarginBottom] != 0 ) + element.setAttribute( "after", layout.margins[TQStyleSheetItem::MarginBottom] ); } - if ( tqlayout.lineSpacingType != KoParagLayout::LS_SINGLE ) + if ( layout.lineSpacingType != KoParagLayout::LS_SINGLE ) { element = doc.createElement( "LINESPACING" ); parentElem.appendChild( element ); - if ( tqlayout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) + if ( layout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) element.setAttribute( "type", "oneandhalf" ); - else if ( tqlayout.lineSpacingType == KoParagLayout::LS_DOUBLE ) + else if ( layout.lineSpacingType == KoParagLayout::LS_DOUBLE ) element.setAttribute( "type", "double" ); - else if ( tqlayout.lineSpacingType == KoParagLayout::LS_CUSTOM ) + else if ( layout.lineSpacingType == KoParagLayout::LS_CUSTOM ) { element.setAttribute( "type", "custom" ); - element.setAttribute( "spacingvalue", tqlayout.lineSpacingValue()); + element.setAttribute( "spacingvalue", layout.lineSpacingValue()); } - else if ( tqlayout.lineSpacingType == KoParagLayout::LS_AT_LEAST ) + else if ( layout.lineSpacingType == KoParagLayout::LS_AT_LEAST ) { element.setAttribute( "type", "atleast" ); - element.setAttribute( "spacingvalue", tqlayout.lineSpacingValue()); + element.setAttribute( "spacingvalue", layout.lineSpacingValue()); } - else if ( tqlayout.lineSpacingType == KoParagLayout::LS_MULTIPLE ) + else if ( layout.lineSpacingType == KoParagLayout::LS_MULTIPLE ) { element.setAttribute( "type", "multiple" ); - element.setAttribute( "spacingvalue", tqlayout.lineSpacingValue()); + element.setAttribute( "spacingvalue", layout.lineSpacingValue()); } else kdDebug(33001) << " error in lineSpacing Type" << endl; } - if ( tqlayout.leftBorder.penWidth() > 0 ) + if ( layout.leftBorder.penWidth() > 0 ) { element = doc.createElement( "LEFTBORDER" ); parentElem.appendChild( element ); - tqlayout.leftBorder.save( element ); + layout.leftBorder.save( element ); } - if ( tqlayout.rightBorder.penWidth() > 0 ) + if ( layout.rightBorder.penWidth() > 0 ) { element = doc.createElement( "RIGHTBORDER" ); parentElem.appendChild( element ); - tqlayout.rightBorder.save( element ); + layout.rightBorder.save( element ); } - if ( tqlayout.topBorder.penWidth() > 0 ) + if ( layout.topBorder.penWidth() > 0 ) { element = doc.createElement( "TOPBORDER" ); parentElem.appendChild( element ); - tqlayout.topBorder.save( element ); + layout.topBorder.save( element ); } - if ( tqlayout.bottomBorder.penWidth() > 0 ) + if ( layout.bottomBorder.penWidth() > 0 ) { element = doc.createElement( "BOTTOMBORDER" ); parentElem.appendChild( element ); - tqlayout.bottomBorder.save( element ); + layout.bottomBorder.save( element ); } - if ( tqlayout.counter && tqlayout.counter->numbering() != KoParagCounter::NUM_NONE ) + if ( layout.counter && layout.counter->numbering() != KoParagCounter::NUM_NONE ) { element = doc.createElement( "COUNTER" ); parentElem.appendChild( element ); - if (tqlayout.counter ) - tqlayout.counter->save( element ); + if (layout.counter ) + layout.counter->save( element ); } - KoTabulatorList tabList = tqlayout.tabList(); + KoTabulatorList tabList = layout.tabList(); KoTabulatorList::ConstIterator it = tabList.begin(); for ( ; it != tabList.end() ; it++ ) { @@ -1287,25 +1287,25 @@ void KPrTextObject::recalcPageNum( KPrPage *page ) } var->resize(); - var->paragraph()->tqinvalidate( 0 ); // size may have changed -> need reformatting ! + var->paragraph()->invalidate( 0 ); // size may have changed -> need reformatting ! var->paragraph()->setChanged( true ); } } } -void KPrTextObject::tqlayout() +void KPrTextObject::layout() { - tqinvalidate(); + invalidate(); // Get the thing going though, repainting doesn't call formatMore m_textobj->formatMore( 2 ); } -void KPrTextObject::tqinvalidate() +void KPrTextObject::invalidate() { - //kdDebug(33001) << "KWTextFrameSet::tqinvalidate " << getName() << endl; + //kdDebug(33001) << "KWTextFrameSet::invalidate " << getName() << endl; m_textobj->setLastFormattedParag( textDocument()->firstParag() ); textDocument()->formatter()->setViewFormattingChars( m_doc->viewFormattingChars() ); - textDocument()->tqinvalidate(); // lazy tqlayout, real update follows upon next tqrepaint + textDocument()->invalidate(); // lazy layout, real update follows upon next repaint } // For the "paragraph after paragraph" effect @@ -1380,7 +1380,7 @@ void KPrTextObject::drawCursor( TQPainter *p, KoTextCursor *cursor, bool cursorV //p->fillRect( clip, TQt::blue ); TQPixmap *pix = 0; - TQColorGroup cg = TQApplication::tqpalette().active(); + TQColorGroup cg = TQApplication::palette().active(); cg.setColor( TQColorGroup::Base, m_doc->txtBackCol() ); uint drawingFlags = KoTextDocument::DrawSelections; @@ -1451,13 +1451,13 @@ KPrTextView * KPrTextObject::createKPTextView( KPrCanvas * _canvas, bool temp ) void KPrTextObject::removeHighlight () { - m_textobj->removeHighlight( true /*tqrepaint*/ ); + m_textobj->removeHighlight( true /*repaint*/ ); } -void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length, KPrCanvas* canvas, bool tqrepaint, KDialogBase* dialog ) +void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length, KPrCanvas* canvas, bool repaint, KDialogBase* dialog ) { - m_textobj->highlightPortion( parag, index, length, tqrepaint ); - if ( tqrepaint ) + m_textobj->highlightPortion( parag, index, length, repaint ); + if ( repaint ) { KPrDocument* doc = canvas->getView()->kPresenterDoc(); @@ -1582,7 +1582,7 @@ void KPrTextObject::slotAfterFormatting( int bottom, KoTextParag* lastFormatted, if ( ( bottom > availHeight ) || // this parag is already below the avail height ( lastFormatted && (bottom + lastFormatted->rect().height() > availHeight) ) ) // or next parag will be below it { - int difference = ( bottom + 2 ) - availHeight; // in tqlayout unit pixels + int difference = ( bottom + 2 ) - availHeight; // in layout unit pixels if( lastFormatted && bottom + lastFormatted->rect().height() > availHeight ) { difference += lastFormatted->rect().height(); @@ -1616,7 +1616,7 @@ void KPrTextObject::slotAfterFormatting( int bottom, KoTextParag* lastFormatted, // Do recalculate the new available height though slotAvailableHeightNeeded(); m_doc->updateRuler(); - m_doc->tqrepaint( true ); + m_doc->repaint( true ); *abort = false; } } @@ -1822,7 +1822,7 @@ void KPrTextView::copy() //kdDebug(33001)<<"void KPrTextView::copy() "<hasSelection( KoTextDocument::Standard ) ) { TQDragObject *drag = newDrag( 0 ); - TQApplication::tqclipboard()->setData( drag ); + TQApplication::clipboard()->setData( drag ); } } @@ -1830,11 +1830,11 @@ void KPrTextView::paste() { //kdDebug(33001) << "KPrTextView::paste()" << endl; - TQMimeSource *data = TQApplication::tqclipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); TQCString returnedMimeType = KoTextObject::providesOasis( data ); if ( !returnedMimeType.isEmpty() ) { - TQByteArray arr = data->tqencodedData( returnedMimeType ); + TQByteArray arr = data->encodedData( returnedMimeType ); if ( arr.size() ) { #if 0 @@ -1850,13 +1850,13 @@ void KPrTextView::paste() } else { - // Note: TQClipboard::text() seems to do a better job than tqencodedData( "text/plain" ) + // Note: TQClipboard::text() seems to do a better job than encodedData( "text/plain" ) // In particular it handles charsets (in the mimetype). - TQString text = TQApplication::tqclipboard()->text(); + TQString text = TQApplication::clipboard()->text(); if ( !text.isEmpty() ) textObject()->pasteText( cursor(), text, currentFormat(), true /*removeSelected*/ ); } - kpTextObject()->tqlayout(); + kpTextObject()->layout(); } void KPrTextView::updateUI( bool updateFormat, bool force ) @@ -1864,9 +1864,9 @@ void KPrTextView::updateUI( bool updateFormat, bool force ) KoTextView::updateUI( updateFormat, force ); // Paragraph settings KoTextParag * parag = static_cast( cursor()->parag()); - if ( m_paragLayout.tqalignment != parag->resolveAlignment() || force ) { - m_paragLayout.tqalignment = parag->resolveAlignment(); - m_canvas->getView()->alignChanged( m_paragLayout.tqalignment ); + if ( m_paragLayout.alignment != parag->resolveAlignment() || force ) { + m_paragLayout.alignment = parag->resolveAlignment(); + m_canvas->getView()->alignChanged( m_paragLayout.alignment ); } // Counter @@ -2356,7 +2356,7 @@ void KPrTextView::insertVariable( KoVariable *var, KoTextFormat *format, bool re customItemsMap ); if ( refreshCustomMenu && var->type() == VT_CUSTOM ) kpTextObject()->kPresenterDocument()->refreshMenuCustomVariable(); - kpTextObject()->kPresenterDocument()->tqrepaint( kpTextObject() ); + kpTextObject()->kPresenterDocument()->repaint( kpTextObject() ); } } @@ -2379,7 +2379,7 @@ TQDragObject * KPrTextView::newDrag( TQWidget * parent ) KPrDocument * doc = kpTextObject()->kPresenterDocument(); - doc->getVariableCollection()->variableSetting()->setModificationDate( TQDateTime::tqcurrentDateTime() ); + doc->getVariableCollection()->variableSetting()->setModificationDate( TQDateTime::currentDateTime() ); doc->recalcVariables( VT_DATE ); doc->recalcVariables( VT_TIME ); doc->recalcVariables( VT_STATISTIC ); @@ -2472,7 +2472,7 @@ void KPrTextView::dropEvent( TQDropEvent * e ) KCommand *cmd = textView()->prepareDropMove( dropCursor ); if(cmd) { - kpTextObject()->tqlayout(); + kpTextObject()->layout(); macroCmd->addCommand(cmd); addMacroCmd = true; } @@ -2490,7 +2490,7 @@ void KPrTextView::dropEvent( TQDropEvent * e ) TQCString returnedTypeMime = KoTextObject::providesOasis( e ); if ( !returnedTypeMime.isEmpty() ) { - TQByteArray arr = e->tqencodedData( returnedTypeMime ); + TQByteArray arr = e->encodedData( returnedTypeMime ); if ( arr.size() ) { KCommand *cmd = kpTextObject()->pasteOasis( cursor(), arr, false ); -- cgit v1.2.3