diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kpresenter/KPrTextObject.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpresenter/KPrTextObject.cpp')
-rw-r--r-- | kpresenter/KPrTextObject.cpp | 828 |
1 files changed, 414 insertions, 414 deletions
diff --git a/kpresenter/KPrTextObject.cpp b/kpresenter/KPrTextObject.cpp index 74d3ee7e..90b3c66f 100644 --- a/kpresenter/KPrTextObject.cpp +++ b/kpresenter/KPrTextObject.cpp @@ -48,17 +48,17 @@ #include <kdeversion.h> #include <kmultipledrag.h> -#include <qfont.h> -#include <qfile.h> -#include <qwidget.h> -#include <qpicture.h> -#include <qpainter.h> -#include <qwmatrix.h> -#include <qdom.h> -#include <qapplication.h> -#include <qfontdatabase.h> -#include <qpopupmenu.h> -#include <qclipboard.h> +#include <tqfont.h> +#include <tqfile.h> +#include <tqwidget.h> +#include <tqpicture.h> +#include <tqpainter.h> +#include <tqwmatrix.h> +#include <tqdom.h> +#include <tqapplication.h> +#include <tqfontdatabase.h> +#include <tqpopupmenu.h> +#include <tqclipboard.h> #include <KoParagCounter.h> #include <kaction.h> @@ -77,33 +77,33 @@ using namespace std; #undef S_NONE // Solaris defines it in sys/signal.h -const QString &KPrTextObject::tagTEXTOBJ=KGlobal::staticQString("TEXTOBJ"); -const QString &KPrTextObject::attrLineSpacing=KGlobal::staticQString("lineSpacing"); -const QString &KPrTextObject::attrParagSpacing=KGlobal::staticQString("paragSpacing"); -const QString &KPrTextObject::attrMargin=KGlobal::staticQString("margin"); -const QString &KPrTextObject::attrBulletType1=KGlobal::staticQString("bulletType1"); -const QString &KPrTextObject::attrBulletType2=KGlobal::staticQString("bulletType2"); -const QString &KPrTextObject::attrBulletType3=KGlobal::staticQString("bulletType3"); -const QString &KPrTextObject::attrBulletType4=KGlobal::staticQString("bulletType4"); -const QString &KPrTextObject::attrBulletColor1=KGlobal::staticQString("bulletColor1"); -const QString &KPrTextObject::attrBulletColor2=KGlobal::staticQString("bulletColor2"); -const QString &KPrTextObject::attrBulletColor3=KGlobal::staticQString("bulletColor3"); -const QString &KPrTextObject::attrBulletColor4=KGlobal::staticQString("bulletColor4"); -const QString &KPrTextObject::tagP=KGlobal::staticQString("P"); -const QString &KPrTextObject::attrAlign=KGlobal::staticQString("align"); -const QString &KPrTextObject::attrType=KGlobal::staticQString("type"); -const QString &KPrTextObject::attrDepth=KGlobal::staticQString("depth"); -const QString &KPrTextObject::tagTEXT=KGlobal::staticQString("TEXT"); -const QString &KPrTextObject::attrFamily=KGlobal::staticQString("family"); -const QString &KPrTextObject::attrPointSize=KGlobal::staticQString("pointSize"); -const QString &KPrTextObject::attrBold=KGlobal::staticQString("bold"); -const QString &KPrTextObject::attrItalic=KGlobal::staticQString("italic"); -const QString &KPrTextObject::attrUnderline=KGlobal::staticQString("underline"); -const QString &KPrTextObject::attrStrikeOut=KGlobal::staticQString("strikeOut"); -const QString &KPrTextObject::attrColor=KGlobal::staticQString("color"); -const QString &KPrTextObject::attrWhitespace=KGlobal::staticQString("whitespace"); -const QString &KPrTextObject::attrTextBackColor=KGlobal::staticQString("textbackcolor"); -const QString &KPrTextObject::attrVertAlign=KGlobal::staticQString("VERTALIGN"); +const TQString &KPrTextObject::tagTEXTOBJ=KGlobal::staticQString("TEXTOBJ"); +const TQString &KPrTextObject::attrLineSpacing=KGlobal::staticQString("lineSpacing"); +const TQString &KPrTextObject::attrParagSpacing=KGlobal::staticQString("paragSpacing"); +const TQString &KPrTextObject::attrMargin=KGlobal::staticQString("margin"); +const TQString &KPrTextObject::attrBulletType1=KGlobal::staticQString("bulletType1"); +const TQString &KPrTextObject::attrBulletType2=KGlobal::staticQString("bulletType2"); +const TQString &KPrTextObject::attrBulletType3=KGlobal::staticQString("bulletType3"); +const TQString &KPrTextObject::attrBulletType4=KGlobal::staticQString("bulletType4"); +const TQString &KPrTextObject::attrBulletColor1=KGlobal::staticQString("bulletColor1"); +const TQString &KPrTextObject::attrBulletColor2=KGlobal::staticQString("bulletColor2"); +const TQString &KPrTextObject::attrBulletColor3=KGlobal::staticQString("bulletColor3"); +const TQString &KPrTextObject::attrBulletColor4=KGlobal::staticQString("bulletColor4"); +const TQString &KPrTextObject::tagP=KGlobal::staticQString("P"); +const TQString &KPrTextObject::attrAlign=KGlobal::staticQString("align"); +const TQString &KPrTextObject::attrType=KGlobal::staticQString("type"); +const TQString &KPrTextObject::attrDepth=KGlobal::staticQString("depth"); +const TQString &KPrTextObject::tagTEXT=KGlobal::staticQString("TEXT"); +const TQString &KPrTextObject::attrFamily=KGlobal::staticQString("family"); +const TQString &KPrTextObject::attrPointSize=KGlobal::staticQString("pointSize"); +const TQString &KPrTextObject::attrBold=KGlobal::staticQString("bold"); +const TQString &KPrTextObject::attrItalic=KGlobal::staticQString("italic"); +const TQString &KPrTextObject::attrUnderline=KGlobal::staticQString("underline"); +const TQString &KPrTextObject::attrStrikeOut=KGlobal::staticQString("strikeOut"); +const TQString &KPrTextObject::attrColor=KGlobal::staticQString("color"); +const TQString &KPrTextObject::attrWhitespace=KGlobal::staticQString("whitespace"); +const TQString &KPrTextObject::attrTextBackColor=KGlobal::staticQString("textbackcolor"); +const TQString &KPrTextObject::attrVertAlign=KGlobal::staticQString("VERTALIGN"); KPrTextObject::KPrTextObject( KPrDocument *doc ) @@ -111,8 +111,8 @@ KPrTextObject::KPrTextObject( KPrDocument *doc ) { m_doc=doc; m_textVertAlign = KP_TOP; - // Default color should be QColor() ... but kpresenter isn't fully color-scheme-aware yet - KoTextFormatCollection* fc = new KoTextFormatCollection( doc->defaultFont(), Qt::black, doc->globalLanguage(), doc->globalHyphenation() ); + // Default color should be TQColor() ... but kpresenter isn't fully color-scheme-aware yet + KoTextFormatCollection* fc = new KoTextFormatCollection( doc->defaultFont(), TQt::black, doc->globalLanguage(), doc->globalHyphenation() ); KPrTextDocument * textdoc = new KPrTextDocument( this, fc ); if ( m_doc->tabStopValue() != -1 ) textdoc->setTabStops( m_doc->zoomHandler()->ptToLayoutUnitPixX( m_doc->tabStopValue() )); @@ -132,22 +132,22 @@ KPrTextObject::KPrTextObject( KPrDocument *doc ) bbottom = 0.0; alignVertical = 0.0; - connect( m_textobj, SIGNAL( newCommand( KCommand * ) ), - SLOT( slotNewCommand( KCommand * ) ) ); - connect( m_textobj, SIGNAL( availableHeightNeeded() ), - SLOT( slotAvailableHeightNeeded() ) ); - connect( m_textobj, SIGNAL( repaintChanged( KoTextObject* ) ), - SLOT( slotRepaintChanged() ) ); + connect( m_textobj, TQT_SIGNAL( newCommand( KCommand * ) ), + TQT_SLOT( slotNewCommand( KCommand * ) ) ); + connect( m_textobj, TQT_SIGNAL( availableHeightNeeded() ), + TQT_SLOT( slotAvailableHeightNeeded() ) ); + connect( m_textobj, TQT_SIGNAL( tqrepaintChanged( KoTextObject* ) ), + TQT_SLOT( slotRepaintChanged() ) ); - // Send our "repaintChanged" signals to the document. - connect( this, SIGNAL( repaintChanged( KPrTextObject * ) ), - m_doc, SLOT( slotRepaintChanged( KPrTextObject * ) ) ); - connect(m_textobj, SIGNAL( showFormatObject(const KoTextFormat &) ), - SLOT( slotFormatChanged(const KoTextFormat &)) ); - connect( m_textobj, SIGNAL( afterFormatting( int, KoTextParag*, bool* ) ), - SLOT( slotAfterFormatting( int, KoTextParag*, bool* ) ) ); - connect( m_textobj, SIGNAL( paragraphDeleted( KoTextParag*) ), - SLOT( slotParagraphDeleted(KoTextParag*) )); + // Send our "tqrepaintChanged" signals to the document. + connect( this, TQT_SIGNAL( tqrepaintChanged( KPrTextObject * ) ), + m_doc, TQT_SLOT( slotRepaintChanged( KPrTextObject * ) ) ); + connect(m_textobj, TQT_SIGNAL( showFormatObject(const KoTextFormat &) ), + TQT_SLOT( slotFormatChanged(const KoTextFormat &)) ); + connect( m_textobj, TQT_SIGNAL( afterFormatting( int, KoTextParag*, bool* ) ), + TQT_SLOT( slotAfterFormatting( int, KoTextParag*, bool* ) ) ); + connect( m_textobj, TQT_SIGNAL( paragraphDeleted( KoTextParag*) ), + TQT_SLOT( slotParagraphDeleted(KoTextParag*) )); } @@ -169,11 +169,11 @@ void KPrTextObject::slotParagraphDeleted(KoTextParag*_parag) m_doc->spellCheckParagraphDeleted( _parag, this); } -QBrush KPrTextObject::getBrush() const +TQBrush KPrTextObject::getBrush() const { - QBrush tmpBrush( m_brush.getBrush() ); + TQBrush tmpBrush( m_brush.getBrush() ); if(!tmpBrush.color().isValid()) - tmpBrush.setColor(QApplication::palette().color( QPalette::Active, QColorGroup::Base )); + tmpBrush.setColor(TQApplication::palette().color( TQPalette::Active, TQColorGroup::Base )); return tmpBrush; } @@ -207,9 +207,9 @@ void KPrTextObject::setSize( double _width, double _height ) } } -QDomDocumentFragment KPrTextObject::save( QDomDocument& doc, double offset ) +TQDomDocumentFragment KPrTextObject::save( TQDomDocument& doc, double offset ) { - QDomDocumentFragment fragment=KPr2DObject::save(doc, offset); + TQDomDocumentFragment fragment=KPr2DObject::save(doc, offset); fragment.appendChild(saveKTextObject( doc )); return fragment; } @@ -239,7 +239,7 @@ void KPrTextObject::saveOasisMarginElement( KoGenStyle &styleobjectauto ) const if ( bright != 0.0 ) styleobjectauto.addPropertyPt("fo:padding-right", bright ); - //add vertical alignment + //add vertical tqalignment switch( m_textVertAlign ) { case KP_TOP: @@ -256,7 +256,7 @@ void KPrTextObject::saveOasisMarginElement( KoGenStyle &styleobjectauto ) const // fo:padding-top="1.372cm" fo:padding-bottom="0.711cm" fo:padding-left="1.118cm" fo:padding-right="1.27cm" } -void KPrTextObject::loadOasis(const QDomElement &element, KoOasisContext& context, +void KPrTextObject::loadOasis(const TQDomElement &element, KoOasisContext& context, KPrLoadingInfo *info ) { KPr2DObject::loadOasis(element, context, info); @@ -272,28 +272,28 @@ void KPrTextObject::loadOasis(const QDomElement &element, KoOasisContext& contex if( styleStack.hasAttributeNS( KoXmlNS::fo, "padding-right" ) ) bright = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, "padding-right" ) ); kdDebug()<<" KPrTextObject::loadOasis : btp :"<<btop<<" bbottom :"<<bbottom<<" bleft :"<<bleft<<" bright :"<<bright<<endl; - // vertical alignment + // vertical tqalignment if ( styleStack.hasAttributeNS( KoXmlNS::draw, "textarea-vertical-align" ) ) { - QString alignment = styleStack.attributeNS( KoXmlNS::draw, "textarea-vertical-align" ); - if ( alignment == "top" ) + TQString tqalignment = styleStack.attributeNS( KoXmlNS::draw, "textarea-vertical-align" ); + if ( tqalignment == "top" ) m_textVertAlign= KP_TOP; - else if ( alignment == "middle" ) + else if ( tqalignment == "middle" ) m_textVertAlign= KP_CENTER; - else if ( alignment == "bottom" ) + else if ( tqalignment == "bottom" ) m_textVertAlign= KP_BOTTOM; } kdDebug()<<" vertical Alignment :"<< ( ( m_textVertAlign== KP_TOP ) ? "top" : ( m_textVertAlign== KP_CENTER ) ? "center": "bottom" )<<endl; - QDomElement tmp = KoDom::namedItemNS( element, KoXmlNS::draw, "text-box"); + TQDomElement tmp = KoDom::namedItemNS( element, KoXmlNS::draw, "text-box"); m_textobj->loadOasisContent( tmp, context, m_doc->styleCollection() ); resizeTextDocument(); // this will to formatMore() } -double KPrTextObject::load(const QDomElement &element) +double KPrTextObject::load(const TQDomElement &element) { double offset=KPr2DObject::load(element); - QDomElement e=element.namedItem(tagTEXTOBJ).toElement(); + TQDomElement e=element.namedItem(tagTEXTOBJ).toElement(); if(!e.isNull()) { if ( e.hasAttribute( "protectcontent")) setProtectContent((bool)e.attribute( "protectcontent" ).toInt()); @@ -307,7 +307,7 @@ double KPrTextObject::load(const QDomElement &element) bbottom = e.attribute( "bbottompt").toDouble(); if ( e.hasAttribute("verticalAlign")) { - QString str =e.attribute("verticalAlign"); + TQString str =e.attribute("verticalAlign"); if ( str == "bottom" ) m_textVertAlign= KP_BOTTOM; else if ( str == "center" ) @@ -367,12 +367,12 @@ void KPrTextObject::shadowCompatibility() //force to reset shadow compatibility between koffice 1.1 and 1.2 shadowDirection = SD_RIGHT_BOTTOM; shadowDistance = 0; - shadowColor = Qt::gray; + shadowColor = TQt::gray; } // Standard paint method for KP2DObjects. -void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, +void KPrTextObject::paint( TQPainter *_painter, KoTextZoomHandler*_zoomHandler, int pageNum, bool drawingShadow, bool drawContour ) { // Never draw shadow (in text objects, it's a character property, not an object property) @@ -385,7 +385,7 @@ void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, } // Special method for drawing a text object that is being edited -void KPrTextObject::paintEdited( QPainter *_painter, KoTextZoomHandler*_zoomHandler, +void KPrTextObject::paintEdited( TQPainter *_painter, KoTextZoomHandler*_zoomHandler, bool onlyChanged, KoTextCursor* cursor, bool resetChanged ) { _painter->save(); @@ -398,7 +398,7 @@ void KPrTextObject::paintEdited( QPainter *_painter, KoTextZoomHandler*_zoomHand } // Common functionality for the above 2 methods -void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, +void KPrTextObject::paint( TQPainter *_painter, KoTextZoomHandler*_zoomHandler, bool onlyChanged, KoTextCursor* cursor, bool resetChanged, bool drawContour ) { @@ -406,9 +406,9 @@ void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, double oh = ext.height(); double pw = pen.pointWidth() / 2; if ( drawContour ) { - QPen pen3( Qt::black, 1, Qt::DotLine ); + TQPen pen3( TQt::black, 1, TQt::DotLine ); _painter->setPen( pen3 ); - _painter->setRasterOp( Qt::NotXorROP ); + _painter->setRasterOp( TQt::NotXorROP ); _painter->drawRect( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw), _zoomHandler->zoomItX(ow), _zoomHandler->zoomItY( oh) ); @@ -416,22 +416,22 @@ void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, } _painter->save(); - QPen pen2 = pen.zoomedPen(_zoomHandler); - //QRect clip=QRect(_zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw), _zoomHandler->zoomItX( ow - 2 * pw),_zoomHandler->zoomItY( oh - 2 * pw)); + TQPen pen2 = pen.zoomedPen(_zoomHandler); + //TQRect clip=TQRect(_zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw), _zoomHandler->zoomItX( ow - 2 * pw),_zoomHandler->zoomItY( oh - 2 * pw)); //setupClipRegion( _painter, clip ); //for debug - //_painter->fillRect( clip, Qt::blue ); + //_painter->fillRect( clip, TQt::blue ); _painter->setPen( pen2 ); - if ( editingTextObj && _painter->device() && _painter->device()->devType() != QInternal::Printer) // editing text object - _painter->setBrush( QBrush( m_doc->txtBackCol(), Qt::SolidPattern ) ); + if ( editingTextObj && _painter->device() && _painter->device()->devType() != TQInternal::Printer) // editing text object + _painter->setBrush( TQBrush( m_doc->txtBackCol(), TQt::SolidPattern ) ); else { // Handle the rotation, draw the background/border, then call drawText() if ( getFillType() == FT_BRUSH || !gradient ) { _painter->setBrush( getBrush() ); } else { - QSize size( _zoomHandler->zoomSize( ext ) ); + TQSize size( _zoomHandler->zoomSize( ext ) ); gradient->setSize( size ); _painter->drawPixmap( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItX(pw), gradient->pixmap(), 0, 0, _zoomHandler->zoomItX( ow - 2 * pw ), @@ -454,13 +454,13 @@ void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, // When they are drawn outside of the object, this can be moved to the standard paint() method, // so that we don't have to do it while editing the object, maybe. if ( m_doc->firstView() && m_doc->firstView()->getCanvas()->getEditMode() && - getDrawEditRect() && getPen().style() == Qt::NoPen ) + getDrawEditRect() && getPen().style() == TQt::NoPen ) { _painter->save(); - _painter->setPen( QPen( Qt::gray, 1, Qt::DotLine ) ); - _painter->setBrush( Qt::NoBrush ); - _painter->setRasterOp( Qt::NotXorROP ); + _painter->setPen( TQPen( TQt::gray, 1, TQt::DotLine ) ); + _painter->setBrush( TQt::NoBrush ); + _painter->setRasterOp( TQt::NotXorROP ); _painter->drawRect( 0, 0, _zoomHandler->zoomItX(ow), _zoomHandler->zoomItY( oh) ); _painter->restore(); @@ -469,25 +469,25 @@ void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, // This method simply draws the paragraphs in the given painter // Assumes the painter is already set up correctly. -void KPrTextObject::drawText( QPainter* _painter, KoTextZoomHandler *zoomHandler, bool onlyChanged, KoTextCursor* cursor, bool resetChanged ) +void KPrTextObject::drawText( TQPainter* _painter, KoTextZoomHandler *zoomHandler, bool onlyChanged, KoTextCursor* cursor, bool resetChanged ) { //kdDebug(33001) << "KPrTextObject::drawText onlyChanged=" << onlyChanged << " cursor=" << cursor << " resetChanged=" << resetChanged << endl; recalcVerticalAlignment(); - QColorGroup cg = QApplication::palette().active(); + TQColorGroup cg = TQApplication::tqpalette().active(); _painter->save(); _painter->translate( m_doc->zoomHandler()->zoomItX( bLeft()), m_doc->zoomHandler()->zoomItY( bTop()+alignVertical)); - if ( !editingTextObj || (_painter->device() && _painter->device()->devType() == QInternal::Printer)) - cg.setBrush( QColorGroup::Base, NoBrush ); + if ( !editingTextObj || (_painter->device() && _painter->device()->devType() == TQInternal::Printer)) + cg.setBrush( TQColorGroup::Base, Qt::NoBrush ); else - cg.setColor( QColorGroup::Base, m_doc->txtBackCol() ); + cg.setColor( TQColorGroup::Base, m_doc->txtBackCol() ); - QRect r = zoomHandler->zoomRect( KoRect( 0, 0, innerWidth(), innerHeight() ) ); + TQRect r = zoomHandler->zoomRect( KoRect( 0, 0, innerWidth(), innerHeight() ) ); bool editMode = false; if( m_doc->firstView() && m_doc->firstView()->getCanvas()) editMode = m_doc->firstView()->getCanvas()->getEditMode(); uint drawingFlags = 0; - if ( _painter->device() && _painter->device()->devType() != QInternal::Printer ) + if ( _painter->device() && _painter->device()->devType() != TQInternal::Printer ) drawingFlags |= KoTextDocument::DrawSelections; if ( m_doc->backgroundSpellCheckEnabled() && editMode ) drawingFlags |= KoTextDocument::DrawMisspelledLine; @@ -533,14 +533,14 @@ int KPrTextObject::getSubPresSteps() const } -QDomElement KPrTextObject::saveKTextObject( QDomDocument& doc ) +TQDomElement KPrTextObject::saveKTextObject( TQDomDocument& doc ) { #if 0 KTextEditParag *parag = ktextobject.document()->firstParag(); KTextEditDocument::TextSettings textSettings = ktextobject.document()->textSettings(); #endif - QDomElement textobj=doc.createElement(tagTEXTOBJ); + TQDomElement textobj=doc.createElement(tagTEXTOBJ); if ( isProtectContent() ) textobj.setAttribute( "protectcontent", (int)isProtectContent()); if (bleft !=0.0) @@ -583,9 +583,9 @@ QDomElement KPrTextObject::saveKTextObject( QDomDocument& doc ) return textobj; } -void KPrTextObject::saveFormat( QDomElement & element, KoTextFormat*lastFormat ) +void KPrTextObject::saveFormat( TQDomElement & element, KoTextFormat*lastFormat ) { - QString tmpFamily, tmpColor, tmpTextBackColor; + TQString tmpFamily, tmpColor, tmpTextBackColor; unsigned int tmpBold=false, tmpItalic=false, tmpUnderline=false,tmpStrikeOut=false; int tmpVerticalAlign=-1; @@ -616,7 +616,7 @@ void KPrTextObject::saveFormat( QDomElement & element, KoTextFormat*lastFormat ) element.setAttribute(attrUnderline, "wave"); else if(tmpUnderline) element.setAttribute(attrUnderline, tmpUnderline); - QString strLineType=KoTextFormat::underlineStyleToString( lastFormat->underlineStyle() ); + TQString strLineType=KoTextFormat::underlineStyleToString( lastFormat->underlineStyle() ); element.setAttribute( "underlinestyleline", strLineType ); if ( lastFormat->textUnderlineColor().isValid() ) element.setAttribute( "underlinecolor", lastFormat->textUnderlineColor().name() ); @@ -629,7 +629,7 @@ void KPrTextObject::saveFormat( QDomElement & element, KoTextFormat*lastFormat ) element.setAttribute(attrStrikeOut, "single-bold"); else if(tmpStrikeOut) element.setAttribute(attrStrikeOut, tmpStrikeOut); - QString strLineType=KoTextFormat::strikeOutStyleToString( lastFormat->strikeOutStyle() ); + TQString strLineType=KoTextFormat::strikeOutStyleToString( lastFormat->strikeOutStyle() ); element.setAttribute( "strikeoutstyleline", strLineType ); } @@ -657,14 +657,14 @@ void KPrTextObject::saveFormat( QDomElement & element, KoTextFormat*lastFormat ) element.setAttribute("language", lastFormat->language()); } -QDomElement KPrTextObject::saveHelper(const QString &tmpText,KoTextFormat*lastFormat , QDomDocument &doc) +TQDomElement KPrTextObject::saveHelper(const TQString &tmpText,KoTextFormat*lastFormat , TQDomDocument &doc) { - QDomElement element=doc.createElement(tagTEXT); + TQDomElement element=doc.createElement(tagTEXT); saveFormat ( element, lastFormat ); if(tmpText.stripWhiteSpace().isEmpty()) - // working around a bug in QDom + // working around a bug in TQDom element.setAttribute(attrWhitespace, tmpText.length()); element.appendChild(doc.createTextNode(tmpText)); return element; @@ -676,9 +676,9 @@ void KPrTextObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainSty saveOasisMarginElement( styleObjectAuto ); } -void KPrTextObject::loadKTextObject( const QDomElement &elem ) +void KPrTextObject::loadKTextObject( const TQDomElement &elem ) { - QDomElement e = elem.firstChild().toElement(); + TQDomElement e = elem.firstChild().toElement(); KoTextParag *lastParag = static_cast<KoTextParag *>(textDocument()->firstParag()); int i = 0; int listNum = 0; @@ -689,11 +689,11 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) int topBorder = 0; while ( !e.isNull() ) { - QValueList<QDomElement> listVariable; + TQValueList<TQDomElement> listVariable; listVariable.clear(); if ( e.tagName() == tagP ) { - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); //skip the whitespace if it's a bullet/number if( e.hasAttribute( attrType ) && n.hasAttribute( attrWhitespace ) ) @@ -708,13 +708,13 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) double depth = 0.0; if( e.hasAttribute(attrDepth) ) { depth = e.attribute( attrDepth ).toDouble(); - paragLayout.margins[QStyleSheetItem::MarginLeft] = depth * MM_TO_POINT(10.0); + paragLayout.margins[TQStyleSheetItem::MarginLeft] = depth * MM_TO_POINT(10.0); } //kdDebug(33001) << k_funcinfo << "old bullet depth is: " << depth << endl; // 1.1 compatibility (bullets) - QString type; + TQString type; if( e.hasAttribute(attrType) ) type = e.attribute( attrType ); @@ -727,8 +727,8 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) paragLayout.counter = new KoParagCounter; paragLayout.counter->setStyle(KoParagCounter::STYLE_DISCBULLET); paragLayout.counter->setNumbering(KoParagCounter::NUM_LIST); - paragLayout.counter->setPrefix(QString::null); - paragLayout.counter->setSuffix(QString::null); + paragLayout.counter->setPrefix(TQString()); + paragLayout.counter->setSuffix(TQString()); } // This is for very old (KOffice-1.0) documents. @@ -742,24 +742,24 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) // Apply values coming from 1.0 or 1.1 documents if ( paragLayout.lineSpacingValue() == 0 ) paragLayout.setLineSpacingValue(lineSpacing); - if ( paragLayout.margins[ QStyleSheetItem::MarginTop ] == 0 ) - paragLayout.margins[ QStyleSheetItem::MarginTop ] = topBorder; - if ( paragLayout.margins[ QStyleSheetItem::MarginBottom ] == 0 ) - paragLayout.margins[ QStyleSheetItem::MarginBottom ] = bottomBorder; + if ( paragLayout.margins[ TQStyleSheetItem::MarginTop ] == 0 ) + paragLayout.margins[ TQStyleSheetItem::MarginTop ] = topBorder; + if ( paragLayout.margins[ TQStyleSheetItem::MarginBottom ] == 0 ) + paragLayout.margins[ TQStyleSheetItem::MarginBottom ] = bottomBorder; lastParag->setParagLayout( paragLayout ); - //lastParag->setAlign(Qt::AlignAuto); + //lastParag->setAlign(TQt::AlignAuto); if(e.hasAttribute(attrAlign)) { int tmpAlign=e.attribute( attrAlign ).toInt(); if(tmpAlign==1 || tmpAlign==0 /* a kpresenter version I think a cvs version saved leftAlign = 0 for header/footer */) - lastParag->setAlign(Qt::AlignLeft); + lastParag->setAlign(TQt::AlignLeft); else if(tmpAlign==2) - lastParag->setAlign(Qt::AlignRight); + lastParag->setAlign(TQt::AlignRight); else if(tmpAlign==4) - lastParag->setAlign(Qt::AlignHCenter); + lastParag->setAlign(TQt::AlignHCenter); else if(tmpAlign==8) - lastParag->setAlign(Qt::AlignJustify); + lastParag->setAlign(TQt::AlignJustify); else kdDebug(33001) << "Error in e.attribute( attrAlign ).toInt()" << endl; } @@ -777,7 +777,7 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) KoTextFormat fm = loadFormat( n, lastParag->paragraphFormat(), m_doc->defaultFont(), m_doc->globalLanguage(), m_doc->globalHyphenation() ); - QString txt = n.firstChild().toText().data(); + TQString txt = n.firstChild().toText().data(); if(n.hasAttribute(attrWhitespace)) { int ws=n.attribute(attrWhitespace).toInt(); @@ -801,7 +801,7 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) } } else if ( e.tagName() == "UNSORTEDLISTTYPE" ) { if ( listNum < 4 ) { - //QColor c( e.attribute( "red" ).toInt(), e.attribute( "green" ).toInt(), e.attribute( "blue" ).toInt() ); + //TQColor c( e.attribute( "red" ).toInt(), e.attribute( "green" ).toInt(), e.attribute( "blue" ).toInt() ); // ## settings.bulletColor[ listNum++ ] = c; } } @@ -815,23 +815,23 @@ void KPrTextObject::loadKTextObject( const QDomElement &elem ) } } -void KPrTextObject::loadVariable( QValueList<QDomElement> & listVariable,KoTextParag *lastParag, int offset ) +void KPrTextObject::loadVariable( TQValueList<TQDomElement> & listVariable,KoTextParag *lastParag, int offset ) { - QValueList<QDomElement>::Iterator it = listVariable.begin(); - QValueList<QDomElement>::Iterator end = listVariable.end(); + TQValueList<TQDomElement>::Iterator it = listVariable.begin(); + TQValueList<TQDomElement>::Iterator end = listVariable.end(); for ( ; it != end ; ++it ) { - QDomElement elem = *it; + TQDomElement elem = *it; if ( !elem.hasAttribute("pos")) continue; int index = elem.attribute("pos").toInt(); index+=offset; - QDomElement varElem = elem.namedItem( "VARIABLE" ).toElement(); + TQDomElement varElem = elem.namedItem( "VARIABLE" ).toElement(); if ( !varElem.isNull() ) { - QDomElement typeElem = varElem.namedItem( "TYPE" ).toElement(); + TQDomElement typeElem = varElem.namedItem( "TYPE" ).toElement(); int type = typeElem.attribute( "type" ).toInt(); - QString key = typeElem.attribute( "key" ); + TQString key = typeElem.attribute( "key" ); int correct = 0; if (typeElem.hasAttribute( "correct" )) correct = typeElem.attribute("correct").toInt(); @@ -853,12 +853,12 @@ void KPrTextObject::loadVariable( QValueList<QDomElement> & listVariable,KoTextP } } -KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat, const QFont & defaultFont, - const QString & defaultLanguage, bool hyphen ) +KoTextFormat KPrTextObject::loadFormat( TQDomElement &n, KoTextFormat * refFormat, const TQFont & defaultFont, + const TQString & defaultLanguage, bool hyphen ) { KoTextFormat format; format.setHyphenation( hyphen ); - QFont fn; + TQFont fn; if ( refFormat ) { format = *refFormat; @@ -870,9 +870,9 @@ KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat if ( !n.isNull() ) { - QFontDatabase fdb; - QStringList families = fdb.families(); - if ( families.findIndex( n.attribute( attrFamily ) ) != -1 ) + TQFontDatabase fdb; + TQStringList families = fdb.tqfamilies(); + if ( families.tqfindIndex( n.attribute( attrFamily ) ) != -1 ) fn.setFamily( n.attribute( attrFamily ) ); else fn = defaultFont; @@ -893,7 +893,7 @@ KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat if(n.hasAttribute( attrUnderline )) { - QString value = n.attribute( attrUnderline ); + TQString value = n.attribute( attrUnderline ); if ( value == "double" ) format.setUnderlineType ( KoTextFormat::U_DOUBLE); else if ( value == "single" ) @@ -909,11 +909,11 @@ KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat format.setUnderlineStyle( KoTextFormat::stringToUnderlineStyle( n.attribute("underlinestyleline") )); if (n.hasAttribute("underlinecolor")) - format.setTextUnderlineColor(QColor(n.attribute("underlinecolor"))); + format.setTextUnderlineColor(TQColor(n.attribute("underlinecolor"))); if(n.hasAttribute(attrStrikeOut)) { - QString value = n.attribute( attrStrikeOut ); + TQString value = n.attribute( attrStrikeOut ); if ( value == "double" ) format.setStrikeOutType ( KoTextFormat::S_DOUBLE); else if ( value == "single" ) @@ -926,24 +926,24 @@ KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat if (n.hasAttribute("strikeoutstyleline")) { - QString strLineType = n.attribute("strikeoutstyleline"); + TQString strLineType = n.attribute("strikeoutstyleline"); format.setStrikeOutStyle( KoTextFormat::stringToStrikeOutStyle( strLineType )); } - QString color = n.attribute( attrColor ); + TQString color = n.attribute( attrColor ); fn.setPointSize( size ); fn.setBold( bold ); fn.setItalic( italic ); //kdDebug(33001) << "KPrTextObject::loadFormat: family=" << fn.family() << " size=" << fn.pointSize() << endl; - QColor col( color ); + TQColor col( color ); format.setFont( fn ); format.setColor( col ); - QString textBackColor=n.attribute(attrTextBackColor); + TQString textBackColor=n.attribute(attrTextBackColor); if(!textBackColor.isEmpty()) { - QColor tmpCol(textBackColor); - tmpCol=tmpCol.isValid() ? tmpCol : QApplication::palette().color( QPalette::Active, QColorGroup::Base ); + TQColor tmpCol(textBackColor); + tmpCol=tmpCol.isValid() ? tmpCol : TQApplication::palette().color( TQPalette::Active, TQColorGroup::Base ); format.setTextBackgroundColor(tmpCol); } if(n.hasAttribute(attrVertAlign)) @@ -970,9 +970,9 @@ KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat return format; } -KoParagLayout KPrTextObject::loadParagLayout( QDomElement & parentElem, KPrDocument *doc, bool findStyle) +KoParagLayout KPrTextObject::loadParagLayout( TQDomElement & tqparentElem, KPrDocument *doc, bool findStyle) { - KoParagLayout layout; + KoParagLayout tqlayout; // Only when loading paragraphs, not when loading styles if ( findStyle ) @@ -980,10 +980,10 @@ KoParagLayout KPrTextObject::loadParagLayout( QDomElement & parentElem, KPrDocum KoParagStyle *style; // Name of the style. If there is no style, then we do not supply // any default! - QDomElement element = parentElem.namedItem( "NAME" ).toElement(); + TQDomElement element = tqparentElem.namedItem( "NAME" ).toElement(); if ( !element.isNull() ) { - QString styleName = element.attribute( "value" ); + TQString styleName = element.attribute( "value" ); style = doc->styleCollection()->findStyle( styleName ); if (!style) { @@ -998,128 +998,128 @@ KoParagLayout KPrTextObject::loadParagLayout( QDomElement & parentElem, KPrDocum style = doc->styleCollection()->findStyle( "Standard" ); } Q_ASSERT(style); - layout.style = style; + tqlayout.style = style; } - QDomElement element = parentElem.namedItem( "INDENTS" ).toElement(); + TQDomElement element = tqparentElem.namedItem( "INDENTS" ).toElement(); if ( !element.isNull() ) { double val=0.0; if(element.hasAttribute("first")) val=element.attribute("first").toDouble(); - layout.margins[QStyleSheetItem::MarginFirstLine] = val; + tqlayout.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=QMAX(0, element.attribute( "left").toDouble()); - layout.margins[QStyleSheetItem::MarginLeft] = val; + val=TQMAX(0, element.attribute( "left").toDouble()); + tqlayout.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=QMAX(0, element.attribute("right").toDouble()); - layout.margins[QStyleSheetItem::MarginRight] = val; + val=TQMAX(0, element.attribute("right").toDouble()); + tqlayout.margins[TQStyleSheetItem::MarginRight] = val; } - element = parentElem.namedItem( "LINESPACING" ).toElement(); + element = tqparentElem.namedItem( "LINESPACING" ).toElement(); if ( !element.isNull() ) { //compatibility with koffice 1.1 if ( element.hasAttribute( "value" )) { - QString value = element.attribute( "value" ); + TQString value = element.attribute( "value" ); if ( value == "oneandhalf" ) { - layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; - layout.setLineSpacingValue(0); + tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + tqlayout.setLineSpacingValue(0); } else if ( value == "double" ) { - layout.lineSpacingType = KoParagLayout::LS_DOUBLE; - layout.setLineSpacingValue(0); + tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; + tqlayout.setLineSpacingValue(0); } else { - layout.lineSpacingType = KoParagLayout::LS_CUSTOM; - layout.setLineSpacingValue(value.toDouble()); + tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; + tqlayout.setLineSpacingValue(value.toDouble()); } } else { - QString type = element.attribute( "type" ); + TQString type = element.attribute( "type" ); if ( type == "oneandhalf" ) { - layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; - layout.setLineSpacingValue(0); + tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + tqlayout.setLineSpacingValue(0); } else if ( type == "double" ) { - layout.lineSpacingType = KoParagLayout::LS_DOUBLE; - layout.setLineSpacingValue(0); + tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; + tqlayout.setLineSpacingValue(0); } else if ( type == "custom" ) { - layout.lineSpacingType = KoParagLayout::LS_CUSTOM; - layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); + tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; + tqlayout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); } else if ( type == "atleast" ) { - layout.lineSpacingType = KoParagLayout::LS_AT_LEAST; - layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); + tqlayout.lineSpacingType = KoParagLayout::LS_AT_LEAST; + tqlayout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); } else if ( type == "multiple" ) { - layout.lineSpacingType = KoParagLayout::LS_MULTIPLE; - layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); + tqlayout.lineSpacingType = KoParagLayout::LS_MULTIPLE; + tqlayout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble()); } } } - element = parentElem.namedItem( "OFFSETS" ).toElement(); + element = tqparentElem.namedItem( "OFFSETS" ).toElement(); if ( !element.isNull() ) { double val =0.0; if(element.hasAttribute("before")) - val=QMAX(0, element.attribute("before").toDouble()); - layout.margins[QStyleSheetItem::MarginTop] = val; + val=TQMAX(0, element.attribute("before").toDouble()); + tqlayout.margins[TQStyleSheetItem::MarginTop] = val; val = 0.0; if(element.hasAttribute("after")) - val=QMAX(0, element.attribute("after").toDouble()); - layout.margins[QStyleSheetItem::MarginBottom] = val; + val=TQMAX(0, element.attribute("after").toDouble()); + tqlayout.margins[TQStyleSheetItem::MarginBottom] = val; } - element = parentElem.namedItem( "LEFTBORDER" ).toElement(); + element = tqparentElem.namedItem( "LEFTBORDER" ).toElement(); if ( !element.isNull() ) - layout.leftBorder = KoBorder::loadBorder( element ); + tqlayout.leftBorder = KoBorder::loadBorder( element ); else - layout.leftBorder.setPenWidth( 0); + tqlayout.leftBorder.setPenWidth( 0); - element = parentElem.namedItem( "RIGHTBORDER" ).toElement(); + element = tqparentElem.namedItem( "RIGHTBORDER" ).toElement(); if ( !element.isNull() ) - layout.rightBorder = KoBorder::loadBorder( element ); + tqlayout.rightBorder = KoBorder::loadBorder( element ); else - layout.rightBorder.setPenWidth( 0); + tqlayout.rightBorder.setPenWidth( 0); - element = parentElem.namedItem( "TOPBORDER" ).toElement(); + element = tqparentElem.namedItem( "TOPBORDER" ).toElement(); if ( !element.isNull() ) - layout.topBorder = KoBorder::loadBorder( element ); + tqlayout.topBorder = KoBorder::loadBorder( element ); else - layout.topBorder.setPenWidth(0); + tqlayout.topBorder.setPenWidth(0); - element = parentElem.namedItem( "BOTTOMBORDER" ).toElement(); + element = tqparentElem.namedItem( "BOTTOMBORDER" ).toElement(); if ( !element.isNull() ) - layout.bottomBorder = KoBorder::loadBorder( element ); + tqlayout.bottomBorder = KoBorder::loadBorder( element ); else - layout.bottomBorder.setPenWidth(0); + tqlayout.bottomBorder.setPenWidth(0); - element = parentElem.namedItem( "COUNTER" ).toElement(); + element = tqparentElem.namedItem( "COUNTER" ).toElement(); if ( !element.isNull() ) { - layout.counter = new KoParagCounter; - layout.counter->load( element ); + tqlayout.counter = new KoParagCounter; + tqlayout.counter->load( element ); } KoTabulatorList tabList; - element = parentElem.firstChild().toElement(); + element = tqparentElem.firstChild().toElement(); for ( ; !element.isNull() ; element = element.nextSibling().toElement() ) { if ( element.tagName() == "TABULATOR" ) @@ -1140,115 +1140,115 @@ KoParagLayout KPrTextObject::loadParagLayout( QDomElement & parentElem, KPrDocum tabList.append( tab ); } } - layout.setTabList( tabList ); + tqlayout.setTabList( tabList ); - return layout; + return tqlayout; } -void KPrTextObject::saveParagLayout( const KoParagLayout& layout, QDomElement & parentElem ) +void KPrTextObject::saveParagLayout( const KoParagLayout& tqlayout, TQDomElement & tqparentElem ) { - QDomDocument doc = parentElem.ownerDocument(); - QDomElement element = doc.createElement( "NAME" ); - parentElem.appendChild( element ); - if ( layout.style ) - element.setAttribute( "value", layout.style->name() ); + TQDomDocument doc = tqparentElem.ownerDocument(); + TQDomElement element = doc.createElement( "NAME" ); + tqparentElem.appendChild( element ); + if ( tqlayout.style ) + element.setAttribute( "value", tqlayout.style->name() ); else kdWarning() << "KWTextParag::saveParagLayout: style==0L!" << endl; - if ( layout.margins[QStyleSheetItem::MarginFirstLine] != 0 || - layout.margins[QStyleSheetItem::MarginLeft] != 0 || - layout.margins[QStyleSheetItem::MarginRight] != 0 ) + if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 || + tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 || + tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 ) { element = doc.createElement( "INDENTS" ); - parentElem.appendChild( element ); - if ( layout.margins[QStyleSheetItem::MarginFirstLine] != 0 ) - element.setAttribute( "first", layout.margins[QStyleSheetItem::MarginFirstLine] ); - if ( layout.margins[QStyleSheetItem::MarginLeft] != 0 ) - element.setAttribute( "left", layout.margins[QStyleSheetItem::MarginLeft] ); - if ( layout.margins[QStyleSheetItem::MarginRight] != 0 ) - element.setAttribute( "right", layout.margins[QStyleSheetItem::MarginRight] ); + tqparentElem.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[QStyleSheetItem::MarginTop] != 0 || - layout.margins[QStyleSheetItem::MarginBottom] != 0 ) + if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 || + tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 ) { element = doc.createElement( "OFFSETS" ); - parentElem.appendChild( element ); - if ( layout.margins[QStyleSheetItem::MarginTop] != 0 ) - element.setAttribute( "before", layout.margins[QStyleSheetItem::MarginTop] ); - if ( layout.margins[QStyleSheetItem::MarginBottom] != 0 ) - element.setAttribute( "after", layout.margins[QStyleSheetItem::MarginBottom] ); + tqparentElem.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.lineSpacingType != KoParagLayout::LS_SINGLE ) + if ( tqlayout.lineSpacingType != KoParagLayout::LS_SINGLE ) { element = doc.createElement( "LINESPACING" ); - parentElem.appendChild( element ); - if ( layout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) + tqparentElem.appendChild( element ); + if ( tqlayout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) element.setAttribute( "type", "oneandhalf" ); - else if ( layout.lineSpacingType == KoParagLayout::LS_DOUBLE ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_DOUBLE ) element.setAttribute( "type", "double" ); - else if ( layout.lineSpacingType == KoParagLayout::LS_CUSTOM ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_CUSTOM ) { element.setAttribute( "type", "custom" ); - element.setAttribute( "spacingvalue", layout.lineSpacingValue()); + element.setAttribute( "spacingvalue", tqlayout.lineSpacingValue()); } - else if ( layout.lineSpacingType == KoParagLayout::LS_AT_LEAST ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_AT_LEAST ) { element.setAttribute( "type", "atleast" ); - element.setAttribute( "spacingvalue", layout.lineSpacingValue()); + element.setAttribute( "spacingvalue", tqlayout.lineSpacingValue()); } - else if ( layout.lineSpacingType == KoParagLayout::LS_MULTIPLE ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_MULTIPLE ) { element.setAttribute( "type", "multiple" ); - element.setAttribute( "spacingvalue", layout.lineSpacingValue()); + element.setAttribute( "spacingvalue", tqlayout.lineSpacingValue()); } else kdDebug(33001) << " error in lineSpacing Type" << endl; } - if ( layout.leftBorder.penWidth() > 0 ) + if ( tqlayout.leftBorder.penWidth() > 0 ) { element = doc.createElement( "LEFTBORDER" ); - parentElem.appendChild( element ); - layout.leftBorder.save( element ); + tqparentElem.appendChild( element ); + tqlayout.leftBorder.save( element ); } - if ( layout.rightBorder.penWidth() > 0 ) + if ( tqlayout.rightBorder.penWidth() > 0 ) { element = doc.createElement( "RIGHTBORDER" ); - parentElem.appendChild( element ); - layout.rightBorder.save( element ); + tqparentElem.appendChild( element ); + tqlayout.rightBorder.save( element ); } - if ( layout.topBorder.penWidth() > 0 ) + if ( tqlayout.topBorder.penWidth() > 0 ) { element = doc.createElement( "TOPBORDER" ); - parentElem.appendChild( element ); - layout.topBorder.save( element ); + tqparentElem.appendChild( element ); + tqlayout.topBorder.save( element ); } - if ( layout.bottomBorder.penWidth() > 0 ) + if ( tqlayout.bottomBorder.penWidth() > 0 ) { element = doc.createElement( "BOTTOMBORDER" ); - parentElem.appendChild( element ); - layout.bottomBorder.save( element ); + tqparentElem.appendChild( element ); + tqlayout.bottomBorder.save( element ); } - if ( layout.counter && layout.counter->numbering() != KoParagCounter::NUM_NONE ) + if ( tqlayout.counter && tqlayout.counter->numbering() != KoParagCounter::NUM_NONE ) { element = doc.createElement( "COUNTER" ); - parentElem.appendChild( element ); - if (layout.counter ) - layout.counter->save( element ); + tqparentElem.appendChild( element ); + if (tqlayout.counter ) + tqlayout.counter->save( element ); } - KoTabulatorList tabList = layout.tabList(); + KoTabulatorList tabList = tqlayout.tabList(); KoTabulatorList::ConstIterator it = tabList.begin(); for ( ; it != tabList.end() ; it++ ) { element = doc.createElement( "TABULATOR" ); - parentElem.appendChild( element ); + tqparentElem.appendChild( element ); element.setAttribute( "type", (*it).type ); element.setAttribute( "ptpos", (*it).ptPos ); element.setAttribute( "filling", (*it).filling ); @@ -1258,10 +1258,10 @@ void KPrTextObject::saveParagLayout( const KoParagLayout& layout, QDomElement & void KPrTextObject::recalcPageNum( KPrPage *page ) { - int pgnum=m_doc->pageList().findRef(page); + int pgnum=m_doc->pageList().tqfindRef(page); pgnum+=1; - QPtrListIterator<KoTextCustomItem> cit( textDocument()->allCustomItems() ); + TQPtrListIterator<KoTextCustomItem> cit( textDocument()->allCustomItems() ); for ( ; cit.current() ; ++cit ) { KPrPgNumVariable * var = dynamic_cast<KPrPgNumVariable *>( cit.current() ); @@ -1275,11 +1275,11 @@ void KPrTextObject::recalcPageNum( KPrPage *page ) var->setSectionTitle( page->pageTitle() ); break; case KPrPgNumVariable::VST_PGNUM_PREVIOUS: - var->setPgNum( QMAX( pgnum -1 , 0) + + var->setPgNum( TQMAX( pgnum -1 , 0) + kPresenterDocument()->getVariableCollection()->variableSetting()->startingPageNumber()); break; case KPrPgNumVariable::VST_PGNUM_NEXT: - var->setPgNum( QMIN( (int)m_doc->getPageNums(), pgnum+1 ) + + var->setPgNum( TQMIN( (int)m_doc->getPageNums(), pgnum+1 ) + kPresenterDocument()->getVariableCollection()->variableSetting()->startingPageNumber()); break; default: @@ -1287,29 +1287,29 @@ void KPrTextObject::recalcPageNum( KPrPage *page ) } var->resize(); - var->paragraph()->invalidate( 0 ); // size may have changed -> need reformatting ! + var->paragraph()->tqinvalidate( 0 ); // size may have changed -> need reformatting ! var->paragraph()->setChanged( true ); } } } -void KPrTextObject::layout() +void KPrTextObject::tqlayout() { - invalidate(); - // Get the thing going though, repainting doesn't call formatMore + tqinvalidate(); + // Get the thing going though, tqrepainting doesn't call formatMore m_textobj->formatMore( 2 ); } -void KPrTextObject::invalidate() +void KPrTextObject::tqinvalidate() { - //kdDebug(33001) << "KWTextFrameSet::invalidate " << getName() << endl; + //kdDebug(33001) << "KWTextFrameSet::tqinvalidate " << getName() << endl; m_textobj->setLastFormattedParag( textDocument()->firstParag() ); textDocument()->formatter()->setViewFormattingChars( m_doc->viewFormattingChars() ); - textDocument()->invalidate(); // lazy layout, real update follows upon next repaint + textDocument()->tqinvalidate(); // lazy tqlayout, real update follows upon next tqrepaint } // For the "paragraph after paragraph" effect -void KPrTextObject::drawParags( QPainter *painter, KoTextZoomHandler* zoomHandler, const QColorGroup& cg, int from, int to ) +void KPrTextObject::drawParags( TQPainter *painter, KoTextZoomHandler* zoomHandler, const TQColorGroup& cg, int from, int to ) { // The fast and difficult way would be to call drawParagWYSIWYG // only on the paragraphs to be drawn. Then we have duplicate quite some code @@ -1322,15 +1322,15 @@ void KPrTextObject::drawParags( QPainter *painter, KoTextZoomHandler* zoomHandle if( m_doc->firstView() && m_doc->firstView()->getCanvas()) editMode = m_doc->firstView()->getCanvas()->getEditMode(); - QRect r = zoomHandler->zoomRect( KoRect( 0, 0, innerWidth(), innerHeight() ) ); + TQRect r = zoomHandler->zoomRect( KoRect( 0, 0, innerWidth(), innerHeight() ) ); KoTextParag *parag = textDocument()->firstParag(); while ( parag ) { if ( !parag->isValid() ) parag->format(); if ( i == from ) - r.setTop( m_doc->zoomHandler()->layoutUnitToPixelY( parag->rect().top() ) ); + r.setTop( m_doc->zoomHandler()->tqlayoutUnitToPixelY( parag->rect().top() ) ); if ( i == to ) { - r.setBottom( m_doc->zoomHandler()->layoutUnitToPixelY( parag->rect().bottom() ) ); + r.setBottom( m_doc->zoomHandler()->tqlayoutUnitToPixelY( parag->rect().bottom() ) ); break; } ++i; @@ -1347,41 +1347,41 @@ void KPrTextObject::drawParags( QPainter *painter, KoTextZoomHandler* zoomHandle true /*resetChanged*/, drawingFlags ); } -void KPrTextObject::drawCursor( QPainter *p, KoTextCursor *cursor, bool cursorVisible, KPrCanvas* canvas ) +void KPrTextObject::drawCursor( TQPainter *p, KoTextCursor *cursor, bool cursorVisible, KPrCanvas* canvas ) { // The implementation is very related to KWord's KWTextFrameSet::drawCursor KoTextZoomHandler *zh = m_doc->zoomHandler(); - QPoint origPix = zh->zoomPoint( orig+KoPoint(bLeft(), bTop()+alignVertical) ); + TQPoint origPix = zh->zoomPoint( orig+KoPoint(bLeft(), bTop()+alignVertical) ); // Painter is already translated for diffx/diffy, but not for the object yet p->translate( origPix.x(), origPix.y() ); if ( angle != 0 ) rotateObject( p, zh ); KoTextParag* parag = cursor->parag(); - QPoint topLeft = parag->rect().topLeft(); // in QRT coords + TQPoint topLeft = parag->rect().topLeft(); // in TQRT coords int lineY; // Cursor height, in pixels - int cursorHeight = zh->layoutUnitToPixelY( topLeft.y(), parag->lineHeightOfChar( cursor->index(), 0, &lineY ) ); - QPoint iPoint( topLeft.x() + cursor->x(), + int cursorHeight = zh->tqlayoutUnitToPixelY( topLeft.y(), parag->lineHeightOfChar( cursor->index(), 0, &lineY ) ); + TQPoint iPoint( topLeft.x() + cursor->x(), topLeft.y() + lineY ); // from now on, iPoint will be in pixels - iPoint = zh->layoutUnitToPixel( iPoint ); + iPoint = zh->tqlayoutUnitToPixel( iPoint ); - QPoint vPoint = iPoint; // vPoint and iPoint are the same currently + TQPoint vPoint = iPoint; // vPoint and iPoint are the same currently // do not simplify this, will be useful with viewmodes. //int xadj = parag->at( cursor->index() )->pixelxadj; //iPoint.rx() += xadj; //vPoint.rx() += xadj; // very small clipping around the cursor - QRect clip( vPoint.x() - 5, vPoint.y() , 10, cursorHeight ); + TQRect clip( vPoint.x() - 5, vPoint.y() , 10, cursorHeight ); setupClipRegion( p, clip ); // for debug only! - //p->fillRect( clip, Qt::blue ); + //p->fillRect( clip, TQt::blue ); - QPixmap *pix = 0; - QColorGroup cg = QApplication::palette().active(); - cg.setColor( QColorGroup::Base, m_doc->txtBackCol() ); + TQPixmap *pix = 0; + TQColorGroup cg = TQApplication::tqpalette().active(); + cg.setColor( TQColorGroup::Base, m_doc->txtBackCol() ); uint drawingFlags = KoTextDocument::DrawSelections; if ( m_doc->backgroundSpellCheckEnabled() ) @@ -1400,7 +1400,7 @@ void KPrTextObject::drawCursor( QPainter *p, KoTextCursor *cursor, bool cursorVi textDocument()->drawParagWYSIWYG( p, parag, - QMAX(0, iPoint.x() - 5), // negative values create problems + TQMAX(0, iPoint.x() - 5), // negative values create problems iPoint.y(), clip.width(), clip.height(), pix, cg, m_doc->zoomHandler(), cursorVisible, cursor, FALSE /*resetChanged*/, drawingFlags ); @@ -1411,8 +1411,8 @@ void KPrTextObject::drawCursor( QPainter *p, KoTextCursor *cursor, bool cursorVi cursor->parag()->setChanged( false ); // XIM Position - QPoint ximPoint = vPoint; - QFont f = parag->at( cursor->index() )->format()->font(); + TQPoint ximPoint = vPoint; + TQFont f = parag->at( cursor->index() )->format()->font(); canvas->setXimPosition( ximPoint.x() + origPix.x(), ximPoint.y() + origPix.y(), 0, cursorHeight - parag->lineSpacing( line ), &f ); } @@ -1441,7 +1441,7 @@ void KPrTextObject::slotAvailableHeightNeeded() void KPrTextObject::slotRepaintChanged() { - emit repaintChanged( this ); + emit tqrepaintChanged( this ); } KPrTextView * KPrTextObject::createKPTextView( KPrCanvas * _canvas, bool temp ) @@ -1451,13 +1451,13 @@ KPrTextView * KPrTextObject::createKPTextView( KPrCanvas * _canvas, bool temp ) void KPrTextObject::removeHighlight () { - m_textobj->removeHighlight( true /*repaint*/ ); + m_textobj->removeHighlight( true /*tqrepaint*/ ); } -void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length, KPrCanvas* canvas, bool repaint, KDialogBase* dialog ) +void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length, KPrCanvas* canvas, bool tqrepaint, KDialogBase* dialog ) { - m_textobj->highlightPortion( parag, index, length, repaint ); - if ( repaint ) + m_textobj->highlightPortion( parag, index, length, tqrepaint ); + if ( tqrepaint ) { KPrDocument* doc = canvas->getView()->kPresenterDoc(); @@ -1472,7 +1472,7 @@ void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length // ** slow method ** KPrPage* page = doc->findPage( this ); if ( page ) { - int pageNum = doc->pageList().findRef( page ); + int pageNum = doc->pageList().tqfindRef( page ); // if the pageNum is -1 the object is located on the master slide if ( pageNum > -1 ) { @@ -1482,8 +1482,8 @@ void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length kdWarning(33001) << "object " << this << " not found in any page!?" << endl; } // Now ensure text is fully visible - QRect rect = m_doc->zoomHandler()->zoomRect( getRect() ); - QRect expose = m_doc->zoomHandler()->layoutUnitToPixel( parag->rect() ); + TQRect rect = m_doc->zoomHandler()->zoomRect( getRect() ); + TQRect expose = m_doc->zoomHandler()->tqlayoutUnitToPixel( parag->rect() ); expose.moveBy( rect.x(), rect.y() ); canvas->ensureVisible( (expose.left()+expose.right()) / 2, // point = center of the rect (expose.top()+expose.bottom()) / 2, @@ -1491,7 +1491,7 @@ void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length (expose.bottom()-expose.top()) / 2); #if KDE_IS_VERSION(3,1,90) if ( dialog ) { - QRect globalRect( expose ); + TQRect globalRect( expose ); globalRect.moveTopLeft( canvas->mapToGlobal( globalRect.topLeft() ) ); KDialog::avoidArea( dialog, globalRect ); } @@ -1499,7 +1499,7 @@ void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length } } -KCommand * KPrTextObject::pasteOasis( KoTextCursor * cursor, const QByteArray & data, bool removeSelected ) +KCommand * KPrTextObject::pasteOasis( KoTextCursor * cursor, const TQByteArray & data, bool removeSelected ) { //kdDebug(33001) << "KPrTextObject::pasteOasis" << endl; KMacroCommand * macroCmd = new KMacroCommand( i18n("Paste Text") ); @@ -1514,11 +1514,11 @@ KCommand * KPrTextObject::pasteOasis( KoTextCursor * cursor, const QByteArray & KPrOasisPasteTextCommand * cmd = new KPrOasisPasteTextCommand( textDocument(), cursor->parag()->paragId(), cursor->index(), data ); textDocument()->addCommand( cmd ); - macroCmd->addCommand( new KoTextCommand( m_textobj, /*cmd, */QString::null ) ); + macroCmd->addCommand( new KoTextCommand( m_textobj, /*cmd, */TQString() ) ); *cursor = *( cmd->execute( cursor ) ); m_textobj->formatMore( 2 ); - emit repaintChanged( this ); + emit tqrepaintChanged( this ); m_textobj->emitEnsureCursorVisible(); m_textobj->emitUpdateUI( true ); m_textobj->emitShowCursor(); @@ -1527,7 +1527,7 @@ KCommand * KPrTextObject::pasteOasis( KoTextCursor * cursor, const QByteArray & } -void KPrTextObject::setShadowParameter(int _distance,ShadowDirection _direction,const QColor &_color) +void KPrTextObject::setShadowParameter(int _distance,ShadowDirection _direction,const TQColor &_color) { int sx = 0; int sy = 0; @@ -1578,11 +1578,11 @@ void KPrTextObject::applyStyleChange( KoStyleChangeDefMap changed ) void KPrTextObject::slotAfterFormatting( int bottom, KoTextParag* lastFormatted, bool* abort) { recalcVerticalAlignment(); - int availHeight = availableHeight() - m_doc->zoomHandler()->ptToLayoutUnitPixY(alignmentValue()); + int availHeight = availableHeight() - m_doc->zoomHandler()->ptToLayoutUnitPixY(tqalignmentValue()); 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 layout unit pixels + int difference = ( bottom + 2 ) - availHeight; // in tqlayout unit pixels if( lastFormatted && bottom + lastFormatted->rect().height() > availHeight ) { difference += lastFormatted->rect().height(); @@ -1601,22 +1601,22 @@ void KPrTextObject::slotAfterFormatting( int bottom, KoTextParag* lastFormatted, // We only auto-grow. We don't auto-shrink. if(difference > 0 && !isProtect()) { - double wantedPosition = m_doc->zoomHandler()->layoutUnitPtToPt( m_doc->zoomHandler()->pixelYToPt( difference ) ) + double wantedPosition = m_doc->zoomHandler()->tqlayoutUnitPtToPt( m_doc->zoomHandler()->pixelYToPt( difference ) ) + getRect().bottom(); const KoPageLayout& p = m_doc->pageLayout(); double pageBottom = p.ptHeight - p.ptBottom; - double newBottom = QMIN( wantedPosition, pageBottom ); // don't grow bigger than the page - newBottom = QMAX( newBottom, getOrig().y() ); // avoid negative heights + double newBottom = TQMIN( wantedPosition, pageBottom ); // don't grow bigger than the page + newBottom = TQMAX( newBottom, getOrig().y() ); // avoid negative heights //kdDebug(33001) << k_funcinfo << " current bottom=" << getRect().bottom() << " newBottom=" << newBottom << endl; if ( getRect().bottom() != newBottom ) { // We resize the text object, but skipping the KPrTextObject::setSize code - // (which invalidates everything etc.) + // (which tqinvalidates everything etc.) KPrObject::setSize( getSize().width(), newBottom - getOrig().y() ); // Do recalculate the new available height though slotAvailableHeightNeeded(); m_doc->updateRuler(); - m_doc->repaint( true ); + m_doc->tqrepaint( true ); *abort = false; } } @@ -1652,7 +1652,7 @@ KCommand * KPrTextObject::textContentsToHeight() } } - double textHeight = m_doc->zoomHandler()->layoutUnitPtToPt( textHeightLU ); + double textHeight = m_doc->zoomHandler()->tqlayoutUnitPtToPt( textHeightLU ); double lineSpacing = ( innerHeight() - textHeight ) / numLines; // this gives the linespacing diff to apply, in pt //kdDebug(33001) << k_funcinfo << "lineSpacing=" << lineSpacing << endl; @@ -1681,18 +1681,18 @@ KCommand * KPrTextObject::textObjectToContents() KoTextParag * parag = textDocument()->firstParag(); double txtWidth = 10; for ( ; parag ; parag = parag->next() ) - txtWidth = QMAX( txtWidth, m_doc->zoomHandler()->layoutUnitPtToPt( parag->widthUsed() )); + txtWidth = TQMAX( txtWidth, m_doc->zoomHandler()->tqlayoutUnitPtToPt( parag->widthUsed() )); // Calculate text height int heightLU = textDocument()->height(); - double txtHeight = m_doc->zoomHandler()->layoutUnitPtToPt( heightLU ); + double txtHeight = m_doc->zoomHandler()->tqlayoutUnitPtToPt( heightLU ); // Compare with current object's size KoSize sizeDiff = KoSize( txtWidth, txtHeight ) - innerRect().size(); if( !sizeDiff.isNull() ) { // The command isn't named since it's always put into a macro command. - return new KPrResizeCmd( QString::null, KoPoint( 0, 0 ), sizeDiff, this, m_doc); + return new KPrResizeCmd( TQString(), KoPoint( 0, 0 ), sizeDiff, this, m_doc); } return 0L; } @@ -1732,7 +1732,7 @@ void KPrTextObject::setVerticalAligment( VerticalAlignmentType _type) void KPrTextObject::recalcVerticalAlignment() { - double txtHeight = m_doc->zoomHandler()->layoutUnitPtToPt( m_doc->zoomHandler()->pixelYToPt( textDocument()->height() ) ) + btop + bbottom; + double txtHeight = m_doc->zoomHandler()->tqlayoutUnitPtToPt( m_doc->zoomHandler()->pixelYToPt( textDocument()->height() ) ) + btop + bbottom; double diffy = getSize().height() - txtHeight; //kdDebug(33001) << k_funcinfo << "txtHeight: " << txtHeight << " rectHeight:" << getSize().height() << " -> diffy=" << diffy << endl; @@ -1755,17 +1755,17 @@ void KPrTextObject::recalcVerticalAlignment() } } -QPoint KPrTextObject::cursorPos(KPrCanvas *canvas, KoTextCursor *cursor) const +TQPoint KPrTextObject::cursorPos(KPrCanvas *canvas, KoTextCursor *cursor) const { KoTextZoomHandler *zh = m_doc->zoomHandler(); - QPoint origPix = zh->zoomPoint( orig+KoPoint(bLeft(), bTop()+alignVertical) ); + TQPoint origPix = zh->zoomPoint( orig+KoPoint(bLeft(), bTop()+alignVertical) ); KoTextParag* parag = cursor->parag(); - QPoint topLeft = parag->rect().topLeft(); // in QRT coords + TQPoint topLeft = parag->rect().topLeft(); // in TQRT coords int lineY = 0; // Cursor height, in pixels - //int cursorHeight = zh->layoutUnitToPixelY( topLeft.y(), parag->lineHeightOfChar( cursor->index(), 0, &lineY ) ); - QPoint iPoint( topLeft.x() + cursor->x(), topLeft.y() + lineY ); - iPoint = zh->layoutUnitToPixel( iPoint ); + //int cursorHeight = zh->tqlayoutUnitToPixelY( topLeft.y(), parag->lineHeightOfChar( cursor->index(), 0, &lineY ) ); + TQPoint iPoint( topLeft.x() + cursor->x(), topLeft.y() + lineY ); + iPoint = zh->tqlayoutUnitToPixel( iPoint ); iPoint.rx() -= canvas->diffx(); iPoint.ry() -= canvas->diffy(); return origPix+iPoint; @@ -1779,12 +1779,12 @@ KPrTextView::KPrTextView( KPrTextObject * txtObj, KPrCanvas *_canvas, bool temp m_kptextobj=txtObj; if (temp) return; - connect( txtObj->textObject(), SIGNAL( selectionChanged(bool) ), - m_canvas, SIGNAL( selectionChanged(bool) ) ); + connect( txtObj->textObject(), TQT_SIGNAL( selectionChanged(bool) ), + m_canvas, TQT_SIGNAL( selectionChanged(bool) ) ); KoTextView::setReadWrite( txtObj->kPresenterDocument()->isReadWrite() ); - connect( textView(), SIGNAL( cut() ), SLOT( cut() ) ); - connect( textView(), SIGNAL( copy() ), SLOT( copy() ) ); - connect( textView(), SIGNAL( paste() ), SLOT( paste() ) ); + connect( textView(), TQT_SIGNAL( cut() ), TQT_SLOT( cut() ) ); + connect( textView(), TQT_SIGNAL( copy() ), TQT_SLOT( copy() ) ); + connect( textView(), TQT_SIGNAL( paste() ), TQT_SLOT( paste() ) ); updateUI( true, true ); txtObj->setEditingTextObj( true ); @@ -1804,8 +1804,8 @@ KoTextViewIface* KPrTextView::dcopObject() void KPrTextView::terminate(bool removeSelection) { - disconnect( textView()->textObject(), SIGNAL( selectionChanged(bool) ), - m_canvas, SIGNAL( selectionChanged(bool) ) ); + disconnect( textView()->textObject(), TQT_SIGNAL( selectionChanged(bool) ), + m_canvas, TQT_SIGNAL( selectionChanged(bool) ) ); textView()->terminate(removeSelection); } @@ -1821,8 +1821,8 @@ void KPrTextView::copy() { //kdDebug(33001)<<"void KPrTextView::copy() "<<endl; if ( textDocument()->hasSelection( KoTextDocument::Standard ) ) { - QDragObject *drag = newDrag( 0 ); - QApplication::clipboard()->setData( drag ); + TQDragObject *drag = newDrag( 0 ); + TQApplication::tqclipboard()->setData( drag ); } } @@ -1830,15 +1830,15 @@ void KPrTextView::paste() { //kdDebug(33001) << "KPrTextView::paste()" << endl; - QMimeSource *data = QApplication::clipboard()->data(); - QCString returnedMimeType = KoTextObject::providesOasis( data ); + TQMimeSource *data = TQApplication::tqclipboard()->data(); + TQCString returnedMimeType = KoTextObject::providesOasis( data ); if ( !returnedMimeType.isEmpty() ) { - QByteArray arr = data->encodedData( returnedMimeType ); + TQByteArray arr = data->tqencodedData( returnedMimeType ); if ( arr.size() ) { #if 0 - QFile paste( "/tmp/oasis.tmp" ); + TQFile paste( "/tmp/oasis.tmp" ); paste.open( IO_WriteOnly ); paste.writeBlock( arr ); paste.close(); @@ -1850,13 +1850,13 @@ void KPrTextView::paste() } else { - // Note: QClipboard::text() seems to do a better job than encodedData( "text/plain" ) + // Note: TQClipboard::text() seems to do a better job than tqencodedData( "text/plain" ) // In particular it handles charsets (in the mimetype). - QString text = QApplication::clipboard()->text(); + TQString text = TQApplication::tqclipboard()->text(); if ( !text.isEmpty() ) textObject()->pasteText( cursor(), text, currentFormat(), true /*removeSelected*/ ); } - kpTextObject()->layout(); + kpTextObject()->tqlayout(); } 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<KoTextParag*>( cursor()->parag()); - if ( m_paragLayout.alignment != parag->resolveAlignment() || force ) { - m_paragLayout.alignment = parag->resolveAlignment(); - m_canvas->getView()->alignChanged( m_paragLayout.alignment ); + if ( m_paragLayout.tqalignment != parag->resolveAlignment() || force ) { + m_paragLayout.tqalignment = parag->resolveAlignment(); + m_canvas->getView()->alignChanged( m_paragLayout.tqalignment ); } // Counter @@ -1905,17 +1905,17 @@ void KPrTextView::updateUI( bool updateFormat, bool force ) m_canvas->getView()->showStyle( m_paragLayout.style->name() ); } - if( m_paragLayout.margins[QStyleSheetItem::MarginLeft] != parag->margin(QStyleSheetItem::MarginLeft) - || m_paragLayout.margins[QStyleSheetItem::MarginFirstLine] != parag->margin(QStyleSheetItem::MarginFirstLine) - || m_paragLayout.margins[QStyleSheetItem::MarginRight] != parag->margin(QStyleSheetItem::MarginRight) + if( m_paragLayout.margins[TQStyleSheetItem::MarginLeft] != parag->margin(TQStyleSheetItem::MarginLeft) + || m_paragLayout.margins[TQStyleSheetItem::MarginFirstLine] != parag->margin(TQStyleSheetItem::MarginFirstLine) + || m_paragLayout.margins[TQStyleSheetItem::MarginRight] != parag->margin(TQStyleSheetItem::MarginRight) || force ) { - m_paragLayout.margins[QStyleSheetItem::MarginFirstLine] = parag->margin(QStyleSheetItem::MarginFirstLine); - m_paragLayout.margins[QStyleSheetItem::MarginLeft] = parag->margin(QStyleSheetItem::MarginLeft); - m_paragLayout.margins[QStyleSheetItem::MarginRight] = parag->margin(QStyleSheetItem::MarginRight); - m_canvas->getView()->showRulerIndent( m_paragLayout.margins[QStyleSheetItem::MarginLeft], - m_paragLayout.margins[QStyleSheetItem::MarginFirstLine], - m_paragLayout.margins[QStyleSheetItem::MarginRight], + m_paragLayout.margins[TQStyleSheetItem::MarginFirstLine] = parag->margin(TQStyleSheetItem::MarginFirstLine); + m_paragLayout.margins[TQStyleSheetItem::MarginLeft] = parag->margin(TQStyleSheetItem::MarginLeft); + m_paragLayout.margins[TQStyleSheetItem::MarginRight] = parag->margin(TQStyleSheetItem::MarginRight); + m_canvas->getView()->showRulerIndent( m_paragLayout.margins[TQStyleSheetItem::MarginLeft], + m_paragLayout.margins[TQStyleSheetItem::MarginFirstLine], + m_paragLayout.margins[TQStyleSheetItem::MarginRight], parag->string()->isRightToLeft() ); } @@ -1943,12 +1943,12 @@ void KPrTextView::ensureCursorVisible() int w = 1; KPrDocument *doc= m_kptextobj->kPresenterDocument(); KoPoint pt= kpTextObject()->getOrig(); - pt.setX( doc->zoomHandler()->layoutUnitPtToPt( doc->zoomHandler()->pixelXToPt( x) ) +pt.x()); - pt.setY( doc->zoomHandler()->layoutUnitPtToPt( doc->zoomHandler()->pixelYToPt( y ))+pt.y() ); + pt.setX( doc->zoomHandler()->tqlayoutUnitPtToPt( doc->zoomHandler()->pixelXToPt( x) ) +pt.x()); + pt.setY( doc->zoomHandler()->tqlayoutUnitPtToPt( doc->zoomHandler()->pixelYToPt( y ))+pt.y() ); - QPoint p = m_kptextobj->kPresenterDocument()->zoomHandler()->zoomPoint( pt ); - w = m_kptextobj->kPresenterDocument()->zoomHandler()->layoutUnitToPixelX( w ); - h = m_kptextobj->kPresenterDocument()->zoomHandler()->layoutUnitToPixelY( h ); + TQPoint p = m_kptextobj->kPresenterDocument()->zoomHandler()->zoomPoint( pt ); + w = m_kptextobj->kPresenterDocument()->zoomHandler()->tqlayoutUnitToPixelX( w ); + h = m_kptextobj->kPresenterDocument()->zoomHandler()->tqlayoutUnitToPixelY( h ); m_canvas->ensureVisible( p.x(), p.y() + h / 2, w, h / 2 + 2 ); } @@ -1973,7 +1973,7 @@ bool KPrTextView::doToolTipCompletion( KoTextCursor* cursor, KoTextParag *parag, } return false; } -void KPrTextView::showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos) +void KPrTextView::showToolTipBox(KoTextParag *parag, int index, TQWidget *widget, const TQPoint &pos) { if( m_kptextobj->kPresenterDocument()->allowAutoFormat() ) { @@ -1999,7 +1999,7 @@ void KPrTextView::textIncreaseIndent() bool KPrTextView::textDecreaseIndent() { - if (m_paragLayout.margins[QStyleSheetItem::MarginLeft]>0) + if (m_paragLayout.margins[TQStyleSheetItem::MarginLeft]>0) { m_canvas->setTextDepthMinus(); return true; @@ -2008,7 +2008,7 @@ bool KPrTextView::textDecreaseIndent() return false; } -void KPrTextView::doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, QChar ch ) +void KPrTextView::doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, TQChar ch ) { if( m_kptextobj->kPresenterDocument()->allowAutoFormat()) { @@ -2018,7 +2018,7 @@ void KPrTextView::doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int in } } -bool KPrTextView::doIgnoreDoubleSpace(KoTextParag * parag, int index,QChar ch ) +bool KPrTextView::doIgnoreDoubleSpace(KoTextParag * parag, int index,TQChar ch ) { if( m_kptextobj->kPresenterDocument()->allowAutoFormat()) { @@ -2034,12 +2034,12 @@ void KPrTextView::startDrag() { textView()->dragStarted(); m_canvas->dragStarted(); - QDragObject *drag = newDrag( m_canvas ); + TQDragObject *drag = newDrag( m_canvas ); if ( !kpTextObject()->kPresenterDocument()->isReadWrite() ) drag->dragCopy(); else { - if ( drag->drag() && QDragObject::target() != m_canvas ) + if ( drag->drag() && TQDragObject::target() != m_canvas ) textObject()->removeSelectedText( cursor() ); } } @@ -2070,29 +2070,29 @@ bool KPrTextView::pgDownKeyPressed() return true; } -void KPrTextView::keyPressEvent( QKeyEvent *e ) +void KPrTextView::keyPressEvent( TQKeyEvent *e ) { //Calculate position of tooltip for autocompletion - const QPoint pos = kpTextObject()->cursorPos(m_canvas, cursor()); + const TQPoint pos = kpTextObject()->cursorPos(m_canvas, cursor()); textView()->handleKeyPressEvent( e, m_canvas, pos ); } -void KPrTextView::keyReleaseEvent( QKeyEvent *e ) +void KPrTextView::keyReleaseEvent( TQKeyEvent *e ) { handleKeyReleaseEvent(e); } -void KPrTextView::imStartEvent( QIMEvent *e ) +void KPrTextView::imStartEvent( TQIMEvent *e ) { handleImStartEvent(e); } -void KPrTextView::imComposeEvent( QIMEvent *e ) +void KPrTextView::imComposeEvent( TQIMEvent *e ) { handleImComposeEvent(e); } -void KPrTextView::imEndEvent( QIMEvent *e ) +void KPrTextView::imEndEvent( TQIMEvent *e ) { handleImEndEvent(e); } @@ -2116,20 +2116,20 @@ void KPrTextView::drawCursor( bool b ) if ( !kpTextObject()->kPresenterDocument()->isReadWrite() ) return; - QPainter painter( m_canvas ); + TQPainter painter( m_canvas ); painter.translate( -m_canvas->diffx(), -m_canvas->diffy() ); painter.setBrushOrigin( -m_canvas->diffx(), -m_canvas->diffy() ); kpTextObject()->drawCursor( &painter, cursor(), b, m_canvas ); } -// Convert a mouse position into a QRT document position -QPoint KPrTextView::viewToInternal( const QPoint & pos ) const +// Convert a mouse position into a TQRT document position +TQPoint KPrTextView::viewToInternal( const TQPoint & pos ) const { #if 0 KoTextZoomHandler* zh = kpTextObject()->kPresenterDocument()->zoomHandler(); - QPoint tmp(pos); - QWMatrix m; + TQPoint tmp(pos); + TQWMatrix m; m.translate( zh->zoomItX(kpTextObject()->getSize().width() / 2.0), zh->zoomItY(kpTextObject()->getSize().height() / 2.0) ); m.rotate( kpTextObject()->getAngle() ); @@ -2167,7 +2167,7 @@ QPoint KPrTextView::viewToInternal( const QPoint & pos ) const return kpTextObject()->viewToInternal( pos, m_canvas ); } -void KPrTextView::mousePressEvent( QMouseEvent *e, const QPoint &/*_pos*/) +void KPrTextView::mousePressEvent( TQMouseEvent *e, const TQPoint &/*_pos*/) { bool addParag = handleMousePressEvent( e, viewToInternal( e->pos() ),true /*bool canStartDrag*/, kpTextObject()->kPresenterDocument()->insertDirectCursor() ); @@ -2176,12 +2176,12 @@ void KPrTextView::mousePressEvent( QMouseEvent *e, const QPoint &/*_pos*/) kpTextObject()->kPresenterDocument()->setModified( true ); } -void KPrTextView::mouseDoubleClickEvent( QMouseEvent *e, const QPoint &pos) +void KPrTextView::mouseDoubleClickEvent( TQMouseEvent *e, const TQPoint &pos) { handleMouseDoubleClickEvent( e, pos ); } -void KPrTextView::mouseMoveEvent( QMouseEvent *e, const QPoint &_pos ) +void KPrTextView::mouseMoveEvent( TQMouseEvent *e, const TQPoint &_pos ) { if ( textView()->maybeStartDrag( e ) ) return; @@ -2189,9 +2189,9 @@ void KPrTextView::mouseMoveEvent( QMouseEvent *e, const QPoint &_pos ) textView()->handleMouseMoveEvent( e,viewToInternal( e->pos() ) ); } -bool KPrTextView::isLinkVariable( const QPoint & pos ) +bool KPrTextView::isLinkVariable( const TQPoint & pos ) { - const QPoint iPoint = viewToInternal( pos ); + const TQPoint iPoint = viewToInternal( pos ); KoLinkVariable* linkVariable = dynamic_cast<KoLinkVariable *>( textObject()->variableAtPoint( iPoint ) ); return linkVariable != 0; } @@ -2206,19 +2206,19 @@ void KPrTextView::openLink() } } -void KPrTextView::mouseReleaseEvent( QMouseEvent *, const QPoint & ) +void KPrTextView::mouseReleaseEvent( TQMouseEvent *, const TQPoint & ) { handleMouseReleaseEvent(); } -void KPrTextView::showPopup( KPrView *view, const QPoint &point, QPtrList<KAction>& actionList ) +void KPrTextView::showPopup( KPrView *view, const TQPoint &point, TQPtrList<KAction>& actionList ) { - QString word = wordUnderCursor( *cursor() ); + TQString word = wordUnderCursor( *cursor() ); view->unplugActionList( "datatools" ); view->unplugActionList( "datatools_link" ); view->unplugActionList( "spell_result_action" ); view->unplugActionList( "variable_action" ); - QPtrList<KAction> &variableList = view->variableActionList(); + TQPtrList<KAction> &variableList = view->variableActionList(); variableList.clear(); actionList.clear(); @@ -2232,7 +2232,7 @@ void KPrTextView::showPopup( KPrView *view, const QPoint &point, QPtrList<KActio if( variableList.count()>0) { view->plugActionList( "variable_action", variableList ); - QPopupMenu * popup = view->popupMenu("variable_popup"); + TQPopupMenu * popup = view->popupMenu("variable_popup"); Q_ASSERT(popup); if (popup) popup->popup( point ); // using exec() here breaks the spellcheck tool (event loop pb) @@ -2244,7 +2244,7 @@ void KPrTextView::showPopup( KPrView *view, const QPoint &point, QPtrList<KActio actionList = dataToolActionList(view->kPresenterDoc()->instance(), word, singleWord); //kdDebug(33001) << "KWView::openPopupMenuInsideFrame plugging actionlist with " << actionList.count() << " actions" << endl; KoLinkVariable* linkVar = dynamic_cast<KoLinkVariable *>( var ); - QPopupMenu * popup; + TQPopupMenu * popup; if ( !linkVar ) { view->plugActionList( "datatools", actionList ); @@ -2259,7 +2259,7 @@ void KPrTextView::showPopup( KPrView *view, const QPoint &point, QPtrList<KActio { if ( singleWord ) { - QPtrList<KAction> actionCheckSpellList =view->listOfResultOfCheckWord( word ); + TQPtrList<KAction> actionCheckSpellList =view->listOfResultOfCheckWord( word ); if ( actionCheckSpellList.count()>0) { view->plugActionList( "spell_result_action", actionCheckSpellList ); @@ -2283,7 +2283,7 @@ void KPrTextView::showPopup( KPrView *view, const QPoint &point, QPtrList<KActio } } -void KPrTextView::insertCustomVariable( const QString &name) +void KPrTextView::insertCustomVariable( const TQString &name) { KPrDocument * doc = kpTextObject()->kPresenterDocument(); KoVariable * var = new KoCustomVariable( textDocument(), name, doc->variableFormatCollection()->format( "STRING" ), @@ -2291,7 +2291,7 @@ void KPrTextView::insertCustomVariable( const QString &name) insertVariable( var ); } -void KPrTextView::insertLink(const QString &_linkName, const QString & hrefName) +void KPrTextView::insertLink(const TQString &_linkName, const TQString & hrefName) { KPrDocument * doc = kpTextObject()->kPresenterDocument(); KoVariable * var = new KoLinkVariable( textDocument(), _linkName, hrefName, @@ -2300,7 +2300,7 @@ void KPrTextView::insertLink(const QString &_linkName, const QString & hrefName) insertVariable( var ); } -void KPrTextView::insertComment(const QString &_comment) +void KPrTextView::insertComment(const TQString &_comment) { KPrDocument * doc = kpTextObject()->kPresenterDocument(); @@ -2318,7 +2318,7 @@ void KPrTextView::insertVariable( int type, int subtype ) if ( type == VT_CUSTOM ) { KoCustomVarDialog dia( m_canvas ); - if ( dia.exec() == QDialog::Accepted ) + if ( dia.exec() == TQDialog::Accepted ) { KoCustomVariable *v = new KoCustomVariable( textDocument(), dia.name(), doc->variableFormatCollection()->format( "STRING" ), @@ -2356,20 +2356,20 @@ void KPrTextView::insertVariable( KoVariable *var, KoTextFormat *format, bool re customItemsMap ); if ( refreshCustomMenu && var->type() == VT_CUSTOM ) kpTextObject()->kPresenterDocument()->refreshMenuCustomVariable(); - kpTextObject()->kPresenterDocument()->repaint( kpTextObject() ); + kpTextObject()->kPresenterDocument()->tqrepaint( kpTextObject() ); } } -bool KPrTextView::canDecode( QMimeSource *e ) +bool KPrTextView::canDecode( TQMimeSource *e ) { - return kpTextObject()->kPresenterDocument()->isReadWrite() && ( KoTextObject::providesOasis( e ) || QTextDrag::canDecode( e ) ); + return kpTextObject()->kPresenterDocument()->isReadWrite() && ( !KoTextObject::providesOasis( e ).isNull() || TQTextDrag::canDecode( e ) ); } -QDragObject * KPrTextView::newDrag( QWidget * parent ) +TQDragObject * KPrTextView::newDrag( TQWidget * tqparent ) { - QBuffer buffer; - const QCString mimeType = "application/vnd.oasis.opendocument.text"; - KoStore * store = KoStore::createStore( &buffer, KoStore::Write, mimeType ); + TQBuffer buffer; + const TQCString mimeType = "application/vnd.oasis.opendocument.text"; + KoStore * store = KoStore::createStore( TQT_TQIODEVICE(&buffer), KoStore::Write, mimeType ); Q_ASSERT( store ); Q_ASSERT( !store->bad() ); @@ -2379,7 +2379,7 @@ QDragObject * KPrTextView::newDrag( QWidget * parent ) KPrDocument * doc = kpTextObject()->kPresenterDocument(); - doc->getVariableCollection()->variableSetting()->setModificationDate( QDateTime::currentDateTime() ); + doc->getVariableCollection()->variableSetting()->setModificationDate( TQDateTime::tqcurrentDateTime() ); doc->recalcVariables( VT_DATE ); doc->recalcVariables( VT_TIME ); doc->recalcVariables( VT_STATISTIC ); @@ -2393,7 +2393,7 @@ QDragObject * KPrTextView::newDrag( QWidget * parent ) bodyWriter->startElement( "office:body" ); bodyWriter->startElement( "office:text" ); - const QString plainText = textDocument()->copySelection( *bodyWriter, savingContext, KoTextDocument::Standard ); + const TQString plainText = textDocument()->copySelection( *bodyWriter, savingContext, KoTextDocument::Standard ); bodyWriter->endElement(); // office:text bodyWriter->endElement(); // office:body @@ -2415,9 +2415,9 @@ QDragObject * KPrTextView::newDrag( QWidget * parent ) delete store; - KMultipleDrag* multiDrag = new KMultipleDrag( parent ); + KMultipleDrag* multiDrag = new KMultipleDrag( tqparent ); if ( !plainText.isEmpty() ) - multiDrag->addDragObject( new QTextDrag( plainText, 0 ) ); + multiDrag->addDragObject( new TQTextDrag( plainText, 0 ) ); KoStoreDrag* storeDrag = new KoStoreDrag( mimeType, 0 ); kdDebug() << k_funcinfo << "setting zip data: " << buffer.buffer().size() << " bytes." << endl; storeDrag->setEncodedData( buffer.buffer() ); @@ -2425,7 +2425,7 @@ QDragObject * KPrTextView::newDrag( QWidget * parent ) return multiDrag; } -void KPrTextView::dragEnterEvent( QDragEnterEvent *e ) +void KPrTextView::dragEnterEvent( TQDragEnterEvent *e ) { if ( !canDecode( e ) ) { @@ -2435,14 +2435,14 @@ void KPrTextView::dragEnterEvent( QDragEnterEvent *e ) e->acceptAction(); } -void KPrTextView::dragMoveEvent( QDragMoveEvent *e, const QPoint & ) +void KPrTextView::dragMoveEvent( TQDragMoveEvent *e, const TQPoint & ) { if ( !canDecode( e ) ) { e->ignore(); return; } - QPoint iPoint = viewToInternal( e->pos() ); + TQPoint iPoint = viewToInternal( e->pos() ); textObject()->emitHideCursor(); placeCursor( iPoint ); @@ -2450,29 +2450,29 @@ void KPrTextView::dragMoveEvent( QDragMoveEvent *e, const QPoint & ) e->acceptAction(); // here or out of the if ? } -void KPrTextView::dropEvent( QDropEvent * e ) +void KPrTextView::dropEvent( TQDropEvent * e ) { if ( canDecode( e ) ) { KPrDocument *doc = kpTextObject()->kPresenterDocument(); e->acceptAction(); KoTextCursor dropCursor( textDocument() ); - QPoint dropPoint = viewToInternal( e->pos() ); + TQPoint dropPoint = viewToInternal( e->pos() ); KMacroCommand *macroCmd=new KMacroCommand(i18n("Paste Text")); bool addMacroCmd = false; dropCursor.place( dropPoint, textDocument()->firstParag() ); kdDebug(33001) << "KPrTextView::dropEvent dropCursor at parag=" << dropCursor.parag()->paragId() << " index=" << dropCursor.index() << endl; if ( ( e->source() == m_canvas ) && - e->action() == QDropEvent::Move && + e->action() == TQDropEvent::Move && // this is the indicator that the source and dest text objects are the same textDocument()->hasSelection( KoTextDocument::Standard ) ) { - //kdDebug(33001)<<"decodeFrameSetNumber( QMimeSource *e ) :"<<numberFrameSet<<endl; + //kdDebug(33001)<<"decodeFrameSetNumber( TQMimeSource *e ) :"<<numberFrameSet<<endl; KCommand *cmd = textView()->prepareDropMove( dropCursor ); if(cmd) { - kpTextObject()->layout(); + kpTextObject()->tqlayout(); macroCmd->addCommand(cmd); addMacroCmd = true; } @@ -2487,10 +2487,10 @@ void KPrTextView::dropEvent( QDropEvent * e ) textDocument()->removeSelection( KoTextDocument::Standard ); textObject()->selectionChangedNotify(); } - QCString returnedTypeMime = KoTextObject::providesOasis( e ); + TQCString returnedTypeMime = KoTextObject::providesOasis( e ); if ( !returnedTypeMime.isEmpty() ) { - QByteArray arr = e->encodedData( returnedTypeMime ); + TQByteArray arr = e->tqencodedData( returnedTypeMime ); if ( arr.size() ) { KCommand *cmd = kpTextObject()->pasteOasis( cursor(), arr, false ); @@ -2503,8 +2503,8 @@ void KPrTextView::dropEvent( QDropEvent * e ) } else { - QString text; - if ( QTextDrag::decode( e, text ) ) + TQString text; + if ( TQTextDrag::decode( e, text ) ) textObject()->pasteText( cursor(), text, currentFormat(), false /*do not remove selected text*/ ); } @@ -2515,26 +2515,26 @@ void KPrTextView::dropEvent( QDropEvent * e ) } } -void KPrTextObject::saveParagraph( QDomDocument& doc,KoTextParag * parag,QDomElement &parentElem, +void KPrTextObject::saveParagraph( TQDomDocument& doc,KoTextParag * parag,TQDomElement &tqparentElem, int from /* default 0 */, int to /* default length()-2 */ ) { if(!parag) return; - QDomElement paragraph=doc.createElement(tagP); + TQDomElement paragraph=doc.createElement(tagP); int tmpAlign=0; switch(parag->resolveAlignment()) { - case Qt::AlignLeft: + case TQt::AlignLeft: tmpAlign=1; break; - case Qt::AlignRight: + case TQt::AlignRight: tmpAlign=2; break; - case Qt::AlignHCenter: + case TQt::AlignHCenter: tmpAlign=4; break; - case Qt::AlignJustify: + case TQt::AlignJustify: tmpAlign=8; } if(tmpAlign!=1) @@ -2542,12 +2542,12 @@ void KPrTextObject::saveParagraph( QDomDocument& doc,KoTextParag * parag,QDomEle saveParagLayout( parag->paragLayout(), paragraph ); KoTextFormat *lastFormat = 0; - QString tmpText; + TQString tmpText; for ( int i = from; i <= to; ++i ) { KoTextStringChar &c = parag->string()->at(i); if ( c.isCustom() ) { - QDomElement variable = doc.createElement("CUSTOM"); + TQDomElement variable = doc.createElement("CUSTOM"); variable.setAttribute("pos", (i-from)); saveFormat( variable, c.format() ); paragraph.appendChild( variable ); @@ -2557,30 +2557,30 @@ void KPrTextObject::saveParagraph( QDomDocument& doc,KoTextParag * parag,QDomEle if ( lastFormat ) paragraph.appendChild(saveHelper(tmpText, lastFormat, doc)); lastFormat = static_cast<KoTextFormat*> (c.format()); - tmpText=QString::null; + tmpText=TQString(); } - tmpText+=QString(c.c); + tmpText+=TQString(c.c); } if ( lastFormat ) paragraph.appendChild(saveHelper(tmpText, lastFormat, doc)); else paragraph.appendChild(saveHelper(tmpText, parag->string()->at(0).format(), doc)); - parentElem.appendChild(paragraph); + tqparentElem.appendChild(paragraph); } KoPen KPrTextObject::defaultPen() const { - return KoPen( Qt::black, 1.0, Qt::NoPen ); + return KoPen( TQt::black, 1.0, Qt::NoPen ); } -QPoint KPrTextObject::viewToInternal( const QPoint & pos, KPrCanvas* canvas ) const +TQPoint KPrTextObject::viewToInternal( const TQPoint & pos, KPrCanvas* canvas ) const { KoTextZoomHandler* zh = kPresenterDocument()->zoomHandler(); - QPoint iPoint = pos - zh->zoomPoint( + TQPoint iPoint = pos - zh->zoomPoint( getOrig() + KoPoint( bLeft(), - bTop() + alignmentValue()) ); + bTop() + tqalignmentValue()) ); iPoint = zh->pixelToLayoutUnit( - QPoint( iPoint.x() + canvas->diffx(), iPoint.y() + canvas->diffy() ) ); + TQPoint( iPoint.x() + canvas->diffx(), iPoint.y() + canvas->diffy() ) ); return iPoint; } |