diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-21 14:05:41 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-21 14:05:41 -0600 |
commit | 2d6954f69caf63ed5057bd8e1405a65d7d970292 (patch) | |
tree | 88e6436b2e81d4e68313f02a9021054252e14cc4 /kpresenter/KPrTextObject.cpp | |
parent | f0de9e167e289ab7dc33e57f077c1f04ec7c68c8 (diff) | |
download | koffice-2d6954f69caf63ed5057bd8e1405a65d7d970292.tar.gz koffice-2d6954f69caf63ed5057bd8e1405a65d7d970292.zip |
Rename obsolete tq methods to standard names
Diffstat (limited to 'kpresenter/KPrTextObject.cpp')
-rw-r--r-- | kpresenter/KPrTextObject.cpp | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/kpresenter/KPrTextObject.cpp b/kpresenter/KPrTextObject.cpp index 6c16133e..87db439d 100644 --- a/kpresenter/KPrTextObject.cpp +++ b/kpresenter/KPrTextObject.cpp @@ -473,7 +473,7 @@ void KPrTextObject::drawText( TQPainter* _painter, KoTextZoomHandler *zoomHandle { //kdDebug(33001) << "KPrTextObject::drawText onlyChanged=" << onlyChanged << " cursor=" << cursor << " resetChanged=" << resetChanged << endl; recalcVerticalAlignment(); - TQColorGroup cg = TQApplication::tqpalette().active(); + TQColorGroup cg = TQApplication::palette().active(); _painter->save(); _painter->translate( m_doc->zoomHandler()->zoomItX( bLeft()), m_doc->zoomHandler()->zoomItY( bTop()+alignVertical)); if ( !editingTextObj || (_painter->device() && _painter->device()->devType() == TQInternal::Printer)) @@ -972,7 +972,7 @@ KoTextFormat KPrTextObject::loadFormat( TQDomElement &n, KoTextFormat * refForma KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocument *doc, bool findStyle) { - KoParagLayout tqlayout; + KoParagLayout layout; // Only when loading paragraphs, not when loading styles if ( findStyle ) @@ -998,7 +998,7 @@ KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocu style = doc->styleCollection()->findStyle( "Standard" ); } Q_ASSERT(style); - tqlayout.style = style; + layout.style = style; } TQDomElement element = parentElem.namedItem( "INDENTS" ).toElement(); @@ -1007,17 +1007,17 @@ KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocu double val=0.0; if(element.hasAttribute("first")) val=element.attribute("first").toDouble(); - tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = val; + layout.margins[TQStyleSheetItem::MarginFirstLine] = val; val=0.0; if(element.hasAttribute( "left")) // The GUI prevents a negative indent, so let's fixup broken docs too val=TQMAX(0, element.attribute( "left").toDouble()); - tqlayout.margins[TQStyleSheetItem::MarginLeft] = val; + layout.margins[TQStyleSheetItem::MarginLeft] = val; val=0.0; if(element.hasAttribute("right")) // The GUI prevents a negative indent, so let's fixup broken docs too val=TQMAX(0, element.attribute("right").toDouble()); - tqlayout.margins[TQStyleSheetItem::MarginRight] = val; + layout.margins[TQStyleSheetItem::MarginRight] = val; } element = parentElem.namedItem( "LINESPACING" ).toElement(); if ( !element.isNull() ) @@ -1028,18 +1028,18 @@ KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocu TQString value = element.attribute( "value" ); if ( value == "oneandhalf" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; - tqlayout.setLineSpacingValue(0); + layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + layout.setLineSpacingValue(0); } else if ( value == "double" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; - tqlayout.setLineSpacingValue(0); + layout.lineSpacingType = KoParagLayout::LS_DOUBLE; + layout.setLineSpacingValue(0); } else { - tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; - tqlayout.setLineSpacingValue(value.toDouble()); + layout.lineSpacingType = KoParagLayout::LS_CUSTOM; + layout.setLineSpacingValue(value.toDouble()); } } else @@ -1047,28 +1047,28 @@ KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocu TQString type = element.attribute( "type" ); if ( type == "oneandhalf" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; - tqlayout.setLineSpacingValue(0); + layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + layout.setLineSpacingValue(0); } else if ( type == "double" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; - tqlayout.setLineSpacingValue(0); + layout.lineSpacingType = KoParagLayout::LS_DOUBLE; + layout.setLineSpacingValue(0); } else if ( type == "custom" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; - tqlayout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); + layout.lineSpacingType = KoParagLayout::LS_CUSTOM; + layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); } else if ( type == "atleast" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_AT_LEAST; - tqlayout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); + layout.lineSpacingType = KoParagLayout::LS_AT_LEAST; + layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); } else if ( type == "multiple" ) { - tqlayout.lineSpacingType = KoParagLayout::LS_MULTIPLE; - tqlayout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); + layout.lineSpacingType = KoParagLayout::LS_MULTIPLE; + layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); } } } @@ -1079,43 +1079,43 @@ KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & parentElem, KPrDocu double val =0.0; if(element.hasAttribute("before")) val=TQMAX(0, element.attribute("before").toDouble()); - tqlayout.margins[TQStyleSheetItem::MarginTop] = val; + layout.margins[TQStyleSheetItem::MarginTop] = val; val = 0.0; if(element.hasAttribute("after")) val=TQMAX(0, element.attribute("after").toDouble()); - tqlayout.margins[TQStyleSheetItem::MarginBottom] = val; + layout.margins[TQStyleSheetItem::MarginBottom] = val; } element = parentElem.namedItem( "LEFTBORDER" ).toElement(); if ( !element.isNull() ) - tqlayout.leftBorder = KoBorder::loadBorder( element ); + layout.leftBorder = KoBorder::loadBorder( element ); else - tqlayout.leftBorder.setPenWidth( 0); + layout.leftBorder.setPenWidth( 0); element = parentElem.namedItem( "RIGHTBORDER" ).toElement(); if ( !element.isNull() ) - tqlayout.rightBorder = KoBorder::loadBorder( element ); + layout.rightBorder = KoBorder::loadBorder( element ); else - tqlayout.rightBorder.setPenWidth( 0); + layout.rightBorder.setPenWidth( 0); element = parentElem.namedItem( "TOPBORDER" ).toElement(); if ( !element.isNull() ) - tqlayout.topBorder = KoBorder::loadBorder( element ); + layout.topBorder = KoBorder::loadBorder( element ); else - tqlayout.topBorder.setPenWidth(0); + layout.topBorder.setPenWidth(0); element = parentElem.namedItem( "BOTTOMBORDER" ).toElement(); if ( !element.isNull() ) - tqlayout.bottomBorder = KoBorder::loadBorder( element ); + layout.bottomBorder = KoBorder::loadBorder( element ); else - tqlayout.bottomBorder.setPenWidth(0); + layout.bottomBorder.setPenWidth(0); element = parentElem.namedItem( "COUNTER" ).toElement(); if ( !element.isNull() ) { - tqlayout.counter = new KoParagCounter; - tqlayout.counter->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++ ) { @@ -1293,7 +1293,7 @@ void KPrTextObject::recalcPageNum( KPrPage *page ) } } -void KPrTextObject::tqlayout() +void KPrTextObject::layout() { invalidate(); // Get the thing going though, repainting doesn't call formatMore @@ -1305,7 +1305,7 @@ void KPrTextObject::invalidate() //kdDebug(33001) << "KWTextFrameSet::invalidate " << getName() << endl; m_textobj->setLastFormattedParag( textDocument()->firstParag() ); textDocument()->formatter()->setViewFormattingChars( m_doc->viewFormattingChars() ); - textDocument()->invalidate(); // lazy tqlayout, real update follows upon next repaint + 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; @@ -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(); @@ -1822,7 +1822,7 @@ void KPrTextView::copy() //kdDebug(33001)<<"void KPrTextView::copy() "<<endl; if ( textDocument()->hasSelection( KoTextDocument::Standard ) ) { TQDragObject *drag = newDrag( 0 ); - TQApplication::tqclipboard()->setData( drag ); + TQApplication::clipboard()->setData( drag ); } } @@ -1830,7 +1830,7 @@ 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() ) { @@ -1852,11 +1852,11 @@ void KPrTextView::paste() { // 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 ) @@ -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; } |