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 /lib/kofficecore/KoPictureWmf.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 'lib/kofficecore/KoPictureWmf.cpp')
-rw-r--r-- | lib/kofficecore/KoPictureWmf.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/kofficecore/KoPictureWmf.cpp b/lib/kofficecore/KoPictureWmf.cpp index 96872af7..ccbab362 100644 --- a/lib/kofficecore/KoPictureWmf.cpp +++ b/lib/kofficecore/KoPictureWmf.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qbuffer.h> -#include <qpainter.h> -#include <qpicture.h> -#include <qpixmap.h> +#include <tqbuffer.h> +#include <tqpainter.h> +#include <tqpicture.h> +#include <tqpixmap.h> #include <kdebug.h> #include <kdeversion.h> @@ -35,7 +35,7 @@ #include "KoPictureBase.h" #include "KoPictureWmf.h" -KoPictureWmf::KoPictureWmf(void) : m_clipart(KoPictureType::formatVersionQPicture) +KoPictureWmf::KoPictureWmf(void) : m_clipart(KoPictureType::formatVersionTQPicture) { } @@ -58,15 +58,15 @@ bool KoPictureWmf::isNull(void) const return m_clipart.isNull(); } -void KoPictureWmf::drawQPicture(QPicture& clipart, QPainter& painter, +void KoPictureWmf::drawTQPicture(TQPicture& clipart, TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh) { kdDebug(30003) << "Drawing KoPictureWmf " << this << endl; kdDebug(30003) << " x=" << x << " y=" << y << " width=" << width << " height=" << height << endl; kdDebug(30003) << " sx=" << sx << " sy=" << sy << " sw=" << sw << " sh=" << sh << endl; painter.save(); - // Thanks to Harri, Qt3 makes it much easier than Qt2 ;) - QRect br = clipart.boundingRect(); + // Thanks to Harri, TQt3 makes it much easier than TQt2 ;) + TQRect br = clipart.boundingRect(); kdDebug(30003) << " Bounding rect. " << br << endl; painter.translate(x,y); // Translating must be done before scaling! @@ -78,12 +78,12 @@ void KoPictureWmf::drawQPicture(QPicture& clipart, QPainter& painter, painter.restore(); } -void KoPictureWmf::draw(QPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) +void KoPictureWmf::draw(TQPainter& painter, int x, int y, int width, int height, int sx, int sy, int sw, int sh, bool /*fastMode*/) { - drawQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); + drawTQPicture(m_clipart, painter, x, y, width, height, sx, sy, sw, sh); } -bool KoPictureWmf::loadData(const QByteArray& array, const QString& /* extension */) +bool KoPictureWmf::loadData(const TQByteArray& array, const TQString& /* extension */) { // Second, create the original clipart kdDebug(30003) << "Trying to load clipart... (Size:" << array.size() << ")" << endl; @@ -97,32 +97,32 @@ bool KoPictureWmf::loadData(const QByteArray& array, const QString& /* extension } m_originalSize = wmf.boundingRect().size(); // draw wmf file with relative coordinate - wmf.play(m_clipart, true); + wmf.play(*TQT_TQPAINTDEVICE(&m_clipart), true); return true; } -bool KoPictureWmf::save(QIODevice* io) const +bool KoPictureWmf::save(TQIODevice* io) const { - // We save the raw data, as the SVG supposrt in QPicture is poor - Q_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns Q_LONG but size() Q_ULONG! + // We save the raw data, as the SVG supposrt in TQPicture is poor + TQ_ULONG size=io->writeBlock(m_rawData); // WARNING: writeBlock returns TQ_LONG but size() TQ_ULONG! return (size==m_rawData.size()); } -QSize KoPictureWmf::getOriginalSize(void) const +TQSize KoPictureWmf::getOriginalSize(void) const { return m_originalSize; } -QPixmap KoPictureWmf::generatePixmap(const QSize& size, bool /*smoothScale*/) +TQPixmap KoPictureWmf::generatePixmap(const TQSize& size, bool /*smoothScale*/) { // Not sure if it works, but it worked for KoPictureFilePreviewWidget::setClipart - QPixmap pixmap(size); - QPainter p; + TQPixmap pixmap(size); + TQPainter p; p.begin( &pixmap ); - p.setBackgroundColor( Qt::white ); - pixmap.fill( Qt::white ); + p.setBackgroundColor( TQt::white ); + pixmap.fill( TQt::white ); if ( m_originalSize.width() && m_originalSize.height() ) p.scale( (double)pixmap.width() / (double)m_originalSize.width(), (double)pixmap.height() / (double)m_originalSize.height() ); @@ -131,7 +131,7 @@ QPixmap KoPictureWmf::generatePixmap(const QSize& size, bool /*smoothScale*/) return pixmap; } -QString KoPictureWmf::getMimeType(const QString& /* extension */) const +TQString KoPictureWmf::getMimeType(const TQString& /* extension */) const { return "image/x-wmf"; } |