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/kotext/KoTextZoomHandler.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/kotext/KoTextZoomHandler.cpp')
-rw-r--r-- | lib/kotext/KoTextZoomHandler.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/kotext/KoTextZoomHandler.cpp b/lib/kotext/KoTextZoomHandler.cpp index 306c7f2f4..e7e6d1b4a 100644 --- a/lib/kotext/KoTextZoomHandler.cpp +++ b/lib/kotext/KoTextZoomHandler.cpp @@ -19,7 +19,7 @@ #include "KoTextZoomHandler.h" #include <kdebug.h> -#include <qpaintdevice.h> +#include <tqpaintdevice.h> #include <KoUnit.h> #include <KoGlobal.h> @@ -36,54 +36,54 @@ int KoTextZoomHandler::fontSizeToLayoutUnit( double ptSizeFloat, bool forPrint ) } #endif -double KoTextZoomHandler::layoutUnitToFontSize( int luSize, bool /*forPrint*/ ) const +double KoTextZoomHandler::tqlayoutUnitToFontSize( int luSize, bool /*forPrint*/ ) const { - // Qt will use QPaintDevice::x11AppDpiY() to go from pt to pixel for fonts - return layoutUnitPtToPt( luSize ) * m_zoomedResolutionY -#ifdef Q_WS_X11 - / POINT_TO_INCH(QPaintDevice::x11AppDpiY()) + // TQt will use TQPaintDevice::x11AppDpiY() to go from pt to pixel for fonts + return tqlayoutUnitPtToPt( luSize ) * m_zoomedResolutionY +#ifdef TQ_WS_X11 + / POINT_TO_INCH(TQPaintDevice::x11AppDpiY()) #endif ; } -int KoTextZoomHandler::layoutUnitToPixelX( int x, int w ) const +int KoTextZoomHandler::tqlayoutUnitToPixelX( int x, int w ) const { - // We call layoutUnitToPixelX on the right value, i.e. x+w-1, + // We call tqlayoutUnitToPixelX on the right value, i.e. x+w-1, // and then determine the height from the result (i.e. right-left+1). - // Calling layoutUnitToPixelX(w) leads to rounding problems. - return layoutUnitToPixelY( x + w - 1 ) - layoutUnitToPixelY( x ) + 1; + // Calling tqlayoutUnitToPixelX(w) leads to rounding problems. + return tqlayoutUnitToPixelY( x + w - 1 ) - tqlayoutUnitToPixelY( x ) + 1; } -int KoTextZoomHandler::layoutUnitToPixelY( int y, int h ) const +int KoTextZoomHandler::tqlayoutUnitToPixelY( int y, int h ) const { - // We call layoutUnitToPixelY on the bottom value, i.e. y+h-1, + // We call tqlayoutUnitToPixelY on the bottom value, i.e. y+h-1, // and then determine the height from the result (i.e. bottom-top+1). - // Calling layoutUnitToPixelY(h) leads to rounding problems. - return layoutUnitToPixelY( y + h - 1 ) - layoutUnitToPixelY( y ) + 1; + // Calling tqlayoutUnitToPixelY(h) leads to rounding problems. + return tqlayoutUnitToPixelY( y + h - 1 ) - tqlayoutUnitToPixelY( y ) + 1; } -int KoTextZoomHandler::layoutUnitToPixelX( int lupix ) const +int KoTextZoomHandler::tqlayoutUnitToPixelX( int lupix ) const { return int( static_cast<double>( lupix * m_zoomedResolutionX ) / ( static_cast<double>( m_layoutUnitFactor ) * m_resolutionX ) ); } -int KoTextZoomHandler::layoutUnitToPixelY( int lupix ) const +int KoTextZoomHandler::tqlayoutUnitToPixelY( int lupix ) const { - // qRound replaced with a truncation, too many problems (e.g. bottom of parags) + // tqRound replaced with a truncation, too many problems (e.g. bottom of parags) return int( static_cast<double>( lupix * m_zoomedResolutionY ) / ( static_cast<double>( m_layoutUnitFactor ) * m_resolutionY ) ); } int KoTextZoomHandler::pixelToLayoutUnitX( int x ) const { - return qRound( static_cast<double>( x * m_layoutUnitFactor * m_resolutionX ) + return tqRound( static_cast<double>( x * m_layoutUnitFactor * m_resolutionX ) / m_zoomedResolutionX ); } int KoTextZoomHandler::pixelToLayoutUnitY( int y ) const { - return qRound( static_cast<double>( y * m_layoutUnitFactor * m_resolutionY ) + return tqRound( static_cast<double>( y * m_layoutUnitFactor * m_resolutionY ) / m_zoomedResolutionY ); } |