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 /kword/KWTextImage.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 'kword/KWTextImage.cpp')
-rw-r--r-- | kword/KWTextImage.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kword/KWTextImage.cpp b/kword/KWTextImage.cpp index 4f2cde40..0a036d87 100644 --- a/kword/KWTextImage.cpp +++ b/kword/KWTextImage.cpp @@ -27,7 +27,7 @@ #include "KWTextImage.h" -KWTextImage::KWTextImage( KWTextDocument *textdoc, const QString & filename ) +KWTextImage::KWTextImage( KWTextDocument *textdoc, const TQString & filename ) : KoTextCustomItem( textdoc ), place( PlaceInline ) { KWDocument * doc = textdoc->textFrameSet()->kWordDocument(); @@ -53,18 +53,18 @@ void KWTextImage::resize() if ( m_deleted ) return; if ( !m_image.isNull() ) { - //KWDocument * doc = static_cast<KWTextDocument *>(parent)->textFrameSet()->kWordDocument(); + //KWDocument * doc = static_cast<KWTextDocument *>(tqparent)->textFrameSet()->kWordDocument(); width = m_image.getOriginalSize().width(); // width is a 100%-zoom pixel size. We want a LU pixel size -> we simply need 'to LU', i.e. ptToLayoutPt width = KoTextZoomHandler::ptToLayoutUnitPt( width ); height = m_image.getOriginalSize().height(); height = KoTextZoomHandler::ptToLayoutUnitPt( height ); kdDebug() << "KWTextImage::resize: " << width << ", " << height << endl; - // no! m_image.setSize( QSize( width, height ) ); + // no! m_image.setSize( TQSize( width, height ) ); } } -void KWTextImage::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, int /*ascentpix*/, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected, int /*offset*/, bool drawingShadow) +void KWTextImage::drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int /*ascentpix*/, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected, int /*offset*/, bool drawingShadow) { if ( drawingShadow ) return; @@ -78,54 +78,54 @@ void KWTextImage::drawCustomItem( QPainter* p, int x, int y, int wpix, int hpix, return; } - QSize imgSize( wpix, hpix ); + TQSize imgSize( wpix, hpix ); - QRect rect( QPoint(x, y), imgSize ); - if ( !rect.intersects( QRect( cx, cy, cw, ch ) ) ) + TQRect rect( TQPoint(x, y), imgSize ); + if ( !rect.intersects( TQRect( cx, cy, cw, ch ) ) ) return; - QPixmap pixmap=m_image.generatePixmap( imgSize, true ); + TQPixmap pixmap=m_image.generatePixmap( imgSize, true ); //if ( placement() == PlaceInline ) p->drawPixmap( x, y, pixmap ); //else // p->drawPixmap( cx, cy, pixmap, cx - x, cy - y, cw, ch ); - if ( selected && placement() == PlaceInline && p->device()->devType() != QInternal::Printer ) { - p->fillRect( rect , QBrush( cg.highlight(), QBrush::Dense4Pattern) ); + if ( selected && placement() == PlaceInline && p->device()->devType() != TQInternal::Printer ) { + p->fillRect( rect , TQBrush( cg.highlight(), TQBrush::Dense4Pattern) ); } } -void KWTextImage::save( QDomElement & parentElem ) +void KWTextImage::save( TQDomElement & tqparentElem ) { // This code is similar to KWPictureFrameSet::save - KWDocument * doc = static_cast<KWTextDocument *>(parent)->textFrameSet()->kWordDocument(); + KWDocument * doc = static_cast<KWTextDocument *>(tqparent)->textFrameSet()->kWordDocument(); - QDomElement imageElem = parentElem.ownerDocument().createElement( "PICTURE" ); - parentElem.appendChild( imageElem ); + TQDomElement imageElem = tqparentElem.ownerDocument().createElement( "PICTURE" ); + tqparentElem.appendChild( imageElem ); //imageElem.setAttribute( "keepAspectRatio", "true" ); - QDomElement elem = parentElem.ownerDocument().createElement( "KEY" ); + TQDomElement elem = tqparentElem.ownerDocument().createElement( "KEY" ); imageElem.appendChild( elem ); image().getKey().saveAttributes( elem ); // Now we must take care that a <KEY> element will be written as a child of <PICTURES> doc->addTextImageRequest( this ); } -void KWTextImage::load( QDomElement & parentElem ) +void KWTextImage::load( TQDomElement & tqparentElem ) { // This code is similar to KWPictureFrameSet::load - KWDocument * doc = static_cast<KWTextDocument *>(parent)->textFrameSet()->kWordDocument(); + KWDocument * doc = static_cast<KWTextDocument *>(tqparent)->textFrameSet()->kWordDocument(); // <IMAGE> (KOffice 1.0) or <PICTURE> (KWord 1.2) - QDomNode node=parentElem.namedItem( "PICTURE" ); + TQDomNode node=tqparentElem.namedItem( "PICTURE" ); if ( node.isNull() ) { - node=parentElem.namedItem( "IMAGE" ); + node=tqparentElem.namedItem( "IMAGE" ); } - QDomElement image = node.toElement(); + TQDomElement image = node.toElement(); if ( image.isNull() ) - image = parentElem; // The data is directly child of <FORMAT> + image = tqparentElem; // The data is directly child of <FORMAT> // <KEY> - QDomElement keyElement = image.namedItem( "KEY" ).toElement(); + TQDomElement keyElement = image.namedItem( "KEY" ).toElement(); if ( !keyElement.isNull() ) { KoPictureKey key; @@ -136,10 +136,10 @@ void KWTextImage::load( QDomElement & parentElem ) else { // <FILENAME> (old format, up to KWord-1.1-beta2) - QDomElement filenameElement = image.namedItem( "FILENAME" ).toElement(); + TQDomElement filenameElement = image.namedItem( "FILENAME" ).toElement(); if ( !filenameElement.isNull() ) { - QString filename = filenameElement.attribute( "value" ); + TQString filename = filenameElement.attribute( "value" ); m_image.setKey( KoPictureKey( filename ) ); doc->addTextImageRequest( this ); } |