diff options
Diffstat (limited to 'kword/KWFormulaFrameSet.cpp')
-rw-r--r-- | kword/KWFormulaFrameSet.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/kword/KWFormulaFrameSet.cpp b/kword/KWFormulaFrameSet.cpp index 7f167a239..970b0de08 100644 --- a/kword/KWFormulaFrameSet.cpp +++ b/kword/KWFormulaFrameSet.cpp @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qfile.h> +#include <tqfile.h> #include "KWFormulaFrameSet.h" @@ -53,7 +53,7 @@ /******************************************************************/ /* Class: KWFormulaFrameSet */ /******************************************************************/ -KWFormulaFrameSet::KWFormulaFrameSet( KWDocument *doc, const QString & name ) +KWFormulaFrameSet::KWFormulaFrameSet( KWDocument *doc, const TQString & name ) : KWFrameSet( doc ), m_changed( false ), m_edit( 0 ) { if ( name.isEmpty() ) @@ -64,11 +64,11 @@ KWFormulaFrameSet::KWFormulaFrameSet( KWDocument *doc, const QString & name ) init(); } -KWFormulaFrameSet::KWFormulaFrameSet( KWDocument* doc, const QDomElement& frameTag, - const QDomElement& mathTag, KoOasisContext& context ) +KWFormulaFrameSet::KWFormulaFrameSet( KWDocument* doc, const TQDomElement& frameTag, + const TQDomElement& mathTag, KoOasisContext& context ) : KWFrameSet( doc ), m_changed( false ), m_edit( 0 ) { - m_name = frameTag.attributeNS( KoXmlNS::draw, "name", QString::null ); + m_name = frameTag.attributeNS( KoXmlNS::draw, "name", TQString() ); if ( doc->frameSetByName( m_name ) ) // already exists! m_name = doc->generateFramesetName( m_name + " %1" ); @@ -92,10 +92,10 @@ void KWFormulaFrameSet::init() // there is no need to move the KFormulaContainer anymore, it remains at (0,0). formula->moveTo( 0, 0 ); - connect( formula, SIGNAL( formulaChanged( double, double ) ), - this, SLOT( slotFormulaChanged( double, double ) ) ); - connect( formula, SIGNAL( errorMsg( const QString& ) ), - this, SLOT( slotErrorMessage( const QString& ) ) ); + connect( formula, TQT_SIGNAL( formulaChanged( double, double ) ), + this, TQT_SLOT( slotFormulaChanged( double, double ) ) ); + connect( formula, TQT_SIGNAL( errorMsg( const TQString& ) ), + this, TQT_SLOT( slotErrorMessage( const TQString& ) ) ); /* if ( isFloating() ) { @@ -108,7 +108,7 @@ void KWFormulaFrameSet::init() } } */ - QRect rect = formula->boundingRect(); + TQRect rect = formula->boundingRect(); slotFormulaChanged(rect.width(), rect.height()); } @@ -154,8 +154,8 @@ KWFrameSetEdit* KWFormulaFrameSet::createFrameSetEdit(KWCanvas* canvas) } void KWFormulaFrameSet::drawFrameContents( KWFrame* /*frame*/, - QPainter* painter, const QRect& crect, - const QColorGroup& cg, bool onlyChanged, + TQPainter* painter, const TQRect& crect, + const TQColorGroup& cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit* /*edit*/, KWViewMode * ) { @@ -164,10 +164,10 @@ void KWFormulaFrameSet::drawFrameContents( KWFrame* /*frame*/, if ( resetChanged ) m_changed = false; - bool printing = painter->device()->devType() == QInternal::Printer; + bool printing = painter->device()->devType() == TQInternal::Printer; bool clipping = true; - QPainter *p; - QPixmap* pix = 0L; + TQPainter *p; + TQPixmap* pix = 0L; if ( printing ) { p = painter; clipping = painter->hasClipping(); @@ -178,7 +178,7 @@ void KWFormulaFrameSet::drawFrameContents( KWFrame* /*frame*/, } else { pix = doubleBufferPixmap( crect.size() ); - p = new QPainter( pix ); + p = new TQPainter( pix ); p->translate( -crect.x(), -crect.y() ); } @@ -219,9 +219,9 @@ void KWFormulaFrameSet::slotFormulaChanged( double width, double height ) m_frames.first()->setHeight( height ); updateFrames(); - kWordDocument()->layout(); + kWordDocument()->tqlayout(); if ( ( oldWidth != width ) || ( oldHeight != height ) ) { - kWordDocument()->repaintAllViews( false ); + kWordDocument()->tqrepaintAllViews( false ); kWordDocument()->updateRulerFrameStartEnd(); } @@ -234,7 +234,7 @@ void KWFormulaFrameSet::slotFormulaChanged( double width, double height ) } } -void KWFormulaFrameSet::slotErrorMessage( const QString& msg ) +void KWFormulaFrameSet::slotErrorMessage( const TQString& msg ) { KMessageBox::error( /*m_widget*/ 0, msg ); } @@ -244,16 +244,16 @@ MouseMeaning KWFormulaFrameSet::getMouseMeaningInsideFrame( const KoPoint& ) return MEANING_MOUSE_INSIDE_TEXT; } -QDomElement KWFormulaFrameSet::save(QDomElement& parentElem, bool saveFrames) +TQDomElement KWFormulaFrameSet::save(TQDomElement& tqparentElem, bool saveFrames) { if ( m_frames.isEmpty() ) // Deleted frameset -> don't save - return QDomElement(); - QDomElement framesetElem = parentElem.ownerDocument().createElement("FRAMESET"); - parentElem.appendChild(framesetElem); + return TQDomElement(); + TQDomElement framesetElem = tqparentElem.ownerDocument().createElement("FRAMESET"); + tqparentElem.appendChild(framesetElem); KWFrameSet::saveCommon(framesetElem, saveFrames); - QDomElement formulaElem = parentElem.ownerDocument().createElement("FORMULA"); + TQDomElement formulaElem = tqparentElem.ownerDocument().createElement("FORMULA"); framesetElem.appendChild(formulaElem); formula->save(formulaElem); return framesetElem; @@ -266,37 +266,37 @@ void KWFormulaFrameSet::saveOasis(KoXmlWriter& writer, KoSavingContext& context, KTempFile contentTmpFile; contentTmpFile.setAutoDelete( true ); - QFile* tmpFile = contentTmpFile.file(); + TQFile* tmpFile = contentTmpFile.file(); - QTextStream stream(tmpFile); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream(tmpFile); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); formula->saveMathML( stream, true ); tmpFile->close(); writer.startElement( "draw:object" ); writer.startElement( "math:math" ); - writer.addCompleteElement( tmpFile ); + writer.addCompleteElement( TQT_TQIODEVICE(tmpFile) ); writer.endElement(); // math:math writer.endElement(); // draw:object writer.endElement(); // draw:frame } -void KWFormulaFrameSet::load(QDomElement& attributes, bool loadFrames) +void KWFormulaFrameSet::load(TQDomElement& attributes, bool loadFrames) { KWFrameSet::load(attributes, loadFrames); - QDomElement formulaElem = attributes.namedItem("FORMULA").toElement(); + TQDomElement formulaElem = attributes.namedItem("FORMULA").toElement(); paste( formulaElem ); } -void KWFormulaFrameSet::paste( QDomNode& formulaElem ) +void KWFormulaFrameSet::paste( TQDomNode& formulaElem ) { if (!formulaElem.isNull()) { if (formula == 0) { formula = m_doc->formulaDocument()->createFormula( -1, false ); - connect(formula, SIGNAL(formulaChanged(double, double)), - this, SLOT(slotFormulaChanged(double, double))); - connect( formula, SIGNAL( errorMsg( const QString& ) ), - this, SLOT( slotErrorMessage( const QString& ) ) ); + connect(formula, TQT_SIGNAL(formulaChanged(double, double)), + this, TQT_SLOT(slotFormulaChanged(double, double))); + connect( formula, TQT_SIGNAL( errorMsg( const TQString& ) ), + this, TQT_SLOT( slotErrorMessage( const TQString& ) ) ); } m_doc->formulaDocument()->setCreationStrategy( "Oasis" ); if ( !formula->loadMathML( formulaElem.firstChild().toElement() ) ) { @@ -334,22 +334,22 @@ void KWFormulaFrameSet::setAnchorFormat( KoTextFormat* format, int /*frameNum*/ } -QPixmap* KWFormulaFrameSet::m_bufPixmap = 0; +TQPixmap* KWFormulaFrameSet::m_bufPixmap = 0; // stolen from KWDocument // However, I don't see if a formula frame can be an underlying // frame. That is why I use my own buffer. -QPixmap* KWFormulaFrameSet::doubleBufferPixmap( const QSize& s ) +TQPixmap* KWFormulaFrameSet::doubleBufferPixmap( const TQSize& s ) { if ( !m_bufPixmap ) { - int w = QABS( s.width() ); - int h = QABS( s.height() ); - m_bufPixmap = new QPixmap( w, h ); + int w = TQABS( s.width() ); + int h = TQABS( s.height() ); + m_bufPixmap = new TQPixmap( w, h ); } else { if ( m_bufPixmap->width() < s.width() || m_bufPixmap->height() < s.height() ) { - m_bufPixmap->resize( QMAX( s.width(), m_bufPixmap->width() ), - QMAX( s.height(), m_bufPixmap->height() ) ); + m_bufPixmap->resize( TQMAX( s.width(), m_bufPixmap->width() ), + TQMAX( s.height(), m_bufPixmap->height() ) ); } } @@ -362,10 +362,10 @@ KWFormulaFrameSetEdit::KWFormulaFrameSetEdit(KWFormulaFrameSet* fs, KWCanvas* ca { formulaView = new KFormula::View( fs->getFormula() ); - connect( formulaView, SIGNAL( cursorChanged( bool, bool ) ), - this, SLOT( cursorChanged( bool, bool ) ) ); - connect( fs->getFormula(), SIGNAL( leaveFormula( Container*, FormulaCursor*, int ) ), - this, SLOT( slotLeaveFormula( Container*, FormulaCursor*, int ) ) ); + connect( formulaView, TQT_SIGNAL( cursorChanged( bool, bool ) ), + this, TQT_SLOT( cursorChanged( bool, bool ) ) ); + connect( fs->getFormula(), TQT_SIGNAL( leaveFormula( Container*, FormulaCursor*, int ) ), + this, TQT_SLOT( slotLeaveFormula( Container*, FormulaCursor*, int ) ) ); fs->m_edit = this; @@ -391,21 +391,21 @@ KWFormulaFrameSetEdit::~KWFormulaFrameSetEdit() formulaView = 0; formulaFrameSet()->getFormula()->startEvaluation(); formulaFrameSet()->setChanged(); - m_canvas->repaintChanged( formulaFrameSet(), true ); + m_canvas->tqrepaintChanged( formulaFrameSet(), true ); delete dcop; } const KFormula::View* KWFormulaFrameSetEdit::getFormulaView() const { return formulaView; } KFormula::View* KWFormulaFrameSetEdit::getFormulaView() { return formulaView; } -void KWFormulaFrameSetEdit::keyPressEvent( QKeyEvent* event ) +void KWFormulaFrameSetEdit::keyPressEvent( TQKeyEvent* event ) { //kdDebug(32001) << "KWFormulaFrameSetEdit::keyPressEvent" << endl; formulaView->keyPressEvent( event ); } -void KWFormulaFrameSetEdit::mousePressEvent( QMouseEvent* event, - const QPoint&, +void KWFormulaFrameSetEdit::mousePressEvent( TQMouseEvent* event, + const TQPoint&, const KoPoint& pos ) { // [Note that this method is called upon RMB and MMB as well, now] @@ -413,16 +413,16 @@ void KWFormulaFrameSetEdit::mousePressEvent( QMouseEvent* event, formulaView->mousePressEvent( event, pos-tl ); } -void KWFormulaFrameSetEdit::mouseMoveEvent( QMouseEvent* event, - const QPoint&, +void KWFormulaFrameSetEdit::mouseMoveEvent( TQMouseEvent* event, + const TQPoint&, const KoPoint& pos ) { KoPoint tl = m_currentFrame->topLeft(); formulaView->mouseMoveEvent( event, pos-tl ); } -void KWFormulaFrameSetEdit::mouseReleaseEvent( QMouseEvent* event, - const QPoint&, +void KWFormulaFrameSetEdit::mouseReleaseEvent( TQMouseEvent* event, + const TQPoint&, const KoPoint& pos ) { KoPoint tl = m_currentFrame->topLeft(); @@ -461,7 +461,7 @@ void KWFormulaFrameSetEdit::paste() formulaView->getDocument()->paste(); } -void KWFormulaFrameSetEdit::pasteData( QMimeSource* /*data*/, int /*provides*/, bool ) +void KWFormulaFrameSetEdit::pasteData( TQMimeSource* /*data*/, int /*provides*/, bool ) { paste(); // TODO use data, for DnD } @@ -488,7 +488,7 @@ void KWFormulaFrameSetEdit::removeFormula() // This call will destroy us! We cannot use 'this' afterwards! exitRight(); - QKeyEvent keyEvent( QEvent::KeyPress, Key_Backspace, 0, 0 ); + TQKeyEvent keyEvent( TQEvent::KeyPress, Key_Backspace, 0, 0 ); canvas->currentFrameSetEdit()->keyPressEvent( &keyEvent ); } } @@ -499,15 +499,15 @@ void KWFormulaFrameSetEdit::cursorChanged( bool visible, bool /*selecting*/ ) if ( m_currentFrame ) { // Add the cursor position to the (zoomed) frame position - QPoint nPoint = frameSet()->kWordDocument()->zoomPoint( m_currentFrame->topLeft() ); + TQPoint nPoint = frameSet()->kWordDocument()->zoomPoint( m_currentFrame->topLeft() ); nPoint += formulaView->getCursorPoint(); // Apply viewmode conversion - QPoint p = m_canvas->viewMode()->normalToView( nPoint ); + TQPoint p = m_canvas->viewMode()->normalToView( nPoint ); m_canvas->ensureVisible( p.x(), p.y() ); } } formulaFrameSet()->setChanged(); - m_canvas->repaintChanged( formulaFrameSet(), true ); + m_canvas->tqrepaintChanged( formulaFrameSet(), true ); } void KWFormulaFrameSetEdit::slotLeaveFormula( KFormula::Container*, |