summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoBorder.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoBorder.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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/KoBorder.cpp')
-rw-r--r--lib/kotext/KoBorder.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/kotext/KoBorder.cpp b/lib/kotext/KoBorder.cpp
index 01cfbea0..5c7461e6 100644
--- a/lib/kotext/KoBorder.cpp
+++ b/lib/kotext/KoBorder.cpp
@@ -18,7 +18,7 @@
*/
#include "KoBorder.h"
-#include <qdom.h>
+#include <tqdom.h>
#include <kdebug.h>
#include "KoZoomHandler.h"
#include "KoTextFormat.h"
@@ -27,16 +27,16 @@
#include <float.h>
static const struct BorderStyle {
- QPen::PenStyle penStyle;
- QCString oasisName;
- QCString uiStringStyle;
+ Qt::PenStyle penStyle;
+ TQCString oasisName;
+ TQCString uiStringStyle;
} s_borderStyles[] = {
- { QPen::SolidLine, "solid", "_________" }, // SOLID
- { QPen::DashLine, "dashed", "___ ___ __" }, // DASH
- { QPen::DotLine, "dotted", "_ _ _ _ _ _" }, // DOT
- { QPen::DashDotLine, "dot-dash", "___ _ ___ _" }, // DASH_DOT
- { QPen::DashDotDotLine, "dot-dot-dash", "___ _ _ ___" }, // DASH_DOT_DOT
- { QPen::SolidLine, "double", "===========" } // DOUBLE_LINE
+ { Qt::SolidLine, "solid", "_________" }, // SOLID
+ { Qt::DashLine, "dashed", "___ ___ __" }, // DASH
+ { Qt::DotLine, "dotted", "_ _ _ _ _ _" }, // DOT
+ { Qt::DashDotLine, "dot-dash", "___ _ ___ _" }, // DASH_DOT
+ { Qt::DashDotDotLine, "dot-dot-dash", "___ _ _ ___" }, // DASH_DOT_DOT
+ { Qt::SolidLine, "double", "===========" } // DOUBLE_LINE
};
KoBorder::KoBorder()
@@ -45,7 +45,7 @@ KoBorder::KoBorder()
setPenWidth( 1 );
}
-KoBorder::KoBorder( const QColor & c, BorderStyle s, double width )
+KoBorder::KoBorder( const TQColor & c, BorderStyle s, double width )
: color( c ), m_style( s )
{
setPenWidth( width );
@@ -74,9 +74,9 @@ void KoBorder::setPenWidth(double _w)
ptWidth = _w;
}
-QPen KoBorder::borderPen( const KoBorder & _brd, int width, QColor defaultColor )
+TQPen KoBorder::borderPen( const KoBorder & _brd, int width, TQColor defaultColor )
{
- QPen pen( _brd.color, width );
+ TQPen pen( _brd.color, width );
if ( !_brd.color.isValid() )
pen.setColor( defaultColor );
@@ -86,7 +86,7 @@ QPen KoBorder::borderPen( const KoBorder & _brd, int width, QColor defaultColor
}
// KOffice-1.3 file format (deprecated)
-KoBorder KoBorder::loadBorder( const QDomElement & elem )
+KoBorder KoBorder::loadBorder( const TQDomElement & elem )
{
KoBorder bd;
if ( elem.hasAttribute("red") )
@@ -101,7 +101,7 @@ KoBorder KoBorder::loadBorder( const QDomElement & elem )
return bd;
}
-void KoBorder::loadFoBorder( const QString& border )
+void KoBorder::loadFoBorder( const TQString& border )
{
//string like "0.088cm solid #800000"
@@ -110,10 +110,10 @@ void KoBorder::loadFoBorder( const QString& border )
return;
}
- // ## isn't it faster to use QStringList::split than parse it 3 times?
- QString _width = border.section(' ', 0, 0);
- QCString _style = border.section(' ', 1, 1).latin1();
- QString _color = border.section(' ', 2, 2);
+ // ## isn't it faster to use TQStringList::split than parse it 3 times?
+ TQString _width = border.section(' ', 0, 0);
+ TQCString _style = border.section(' ', 1, 1).latin1();
+ TQString _color = border.section(' ', 2, 2);
//TODO: let the user choose a more precise border width (in the current unit)
double const penWidth = KoUnit::parseValue( _width, 1.0 );
@@ -146,17 +146,17 @@ void KoBorder::loadFoBorder( const QString& border )
}
if ( _color.isEmpty() )
- color = QColor();
+ color = TQColor();
else
color.setNamedColor( _color );
}
-QString KoBorder::saveFoBorder() const
+TQString KoBorder::saveFoBorder() const
{
- if ( QABS( ptPenWidth ) < 1E-10 ) // i.e. ptPenWidth == 0
+ if ( TQABS( ptPenWidth ) < 1E-10 ) // i.e. ptPenWidth == 0
return "none";
//string like "2pt solid #800000"
- QString str = QString::number( ptPenWidth, 'g', DBL_DIG );
+ TQString str = TQString::number( ptPenWidth, 'g', DBL_DIG );
str += "pt ";
str += s_borderStyles[ m_style ].oasisName;
if ( color.isValid() ) {
@@ -167,7 +167,7 @@ QString KoBorder::saveFoBorder() const
}
// KOffice-1.3 file format (deprecated)
-void KoBorder::save( QDomElement & elem ) const
+void KoBorder::save( TQDomElement & elem ) const
{
if (color.isValid()) {
elem.setAttribute("red", color.red());
@@ -178,7 +178,7 @@ void KoBorder::save( QDomElement & elem ) const
elem.setAttribute("width", ptPenWidth);
}
-KoBorder::BorderStyle KoBorder::getStyle( const QString &style )
+KoBorder::BorderStyle KoBorder::getStyle( const TQString &style )
{
for ( uint i = 0; i < sizeof( s_borderStyles ) / sizeof *s_borderStyles; ++i ) {
if ( style == s_borderStyles[i].uiStringStyle.data() )
@@ -188,7 +188,7 @@ KoBorder::BorderStyle KoBorder::getStyle( const QString &style )
return KoBorder::SOLID;
}
-QString KoBorder::getStyle( const BorderStyle &style )
+TQString KoBorder::getStyle( const BorderStyle &style )
{
return s_borderStyles[style].uiStringStyle;
}
@@ -197,17 +197,17 @@ int KoBorder::zoomWidthX( double ptWidth, KoZoomHandler * zoomHandler, int minbo
{
// If a border was set, then zoom it and apply a minimum of 1, so that it's always visible.
// If no border was set, apply minborder ( 0 for paragraphs, 1 for frames )
- return ptWidth > 0 ? QMAX( 1, zoomHandler->zoomItX( ptWidth ) /*applies qRound*/ ) : minborder;
+ return ptWidth > 0 ? TQMAX( 1, zoomHandler->zoomItX( ptWidth ) /*applies tqRound*/ ) : minborder;
}
int KoBorder::zoomWidthY( double ptWidth, KoZoomHandler * zoomHandler, int minborder )
{
// If a border was set, then zoom it and apply a minimum of 1, so that it's always visible.
// If no border was set, apply minborder ( 0 for paragraphs, 1 for frames )
- return ptWidth > 0 ? QMAX( 1, zoomHandler->zoomItY( ptWidth ) /*applies qRound*/ ) : minborder;
+ return ptWidth > 0 ? TQMAX( 1, zoomHandler->zoomItY( ptWidth ) /*applies tqRound*/ ) : minborder;
}
-void KoBorder::drawBorders( QPainter& painter, KoZoomHandler * zoomHandler, const QRect& rect, const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& topBorder, const KoBorder& bottomBorder, int minborder, const QPen& defaultPen, bool drawTopBorder /* = true */, bool drawBottomBorder /* = true */)
+void KoBorder::drawBorders( TQPainter& painter, KoZoomHandler * zoomHandler, const TQRect& rect, const KoBorder& leftBorder, const KoBorder& rightBorder, const KoBorder& topBorder, const KoBorder& bottomBorder, int minborder, const TQPen& defaultPen, bool drawTopBorder /* = true */, bool drawBottomBorder /* = true */)
{
int topBorderWidth = zoomWidthY( topBorder.width(), zoomHandler, minborder );
int bottomBorderWidth = zoomWidthY( bottomBorder.width(), zoomHandler, minborder );
@@ -228,7 +228,7 @@ void KoBorder::drawBorders( QPainter& painter, KoZoomHandler * zoomHandler, cons
//kdDebug(32500) << " penWidths: top=" << topBorderPenWidth << " bottom=" << bottomBorderPenWidth
// << " left=" << leftBorderPenWidth << " right=" << rightBorderPenWidth << endl;
- QColor defaultColor = KoTextFormat::defaultTextColor( &painter );
+ TQColor defaultColor = KoTextFormat::defaultTextColor( &painter );
if ( topBorderWidth > 0 && drawTopBorder )
{