Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c85caa88 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink

some trivial qreal != double issues

svn path=/trunk/koffice/; revision=851896
parent a37895ff
......@@ -55,7 +55,7 @@ KoLineBorder::KoLineBorder( const KoLineBorder & other )
KoLineBorder::KoLineBorder(qreal lineWidth, const QColor &color)
: d(new Private())
{
d->pen.setWidthF( qMax(0.0,lineWidth) );
d->pen.setWidthF( qMax(qreal(0.0),lineWidth) );
d->pen.setJoinStyle(Qt::MiterJoin);
d->color = color;
}
......@@ -185,7 +185,7 @@ Qt::PenJoinStyle KoLineBorder::joinStyle() const
void KoLineBorder::setLineWidth( qreal lineWidth )
{
d->pen.setWidthF( qMax(0.0,lineWidth) );
d->pen.setWidthF( qMax(qreal(0.0),lineWidth) );
}
qreal KoLineBorder::lineWidth() const
......
......@@ -373,7 +373,7 @@ bool KoPathPoint::isSmooth( KoPathPoint * prev, KoPathPoint * next ) const
// normalize tangent vectors
qreal l1 = sqrt( t1.x()*t1.x() + t1.y()*t1.y() );
qreal l2 = sqrt( t2.x()*t2.x() + t2.y()*t2.y() );
if ( qFuzzyCompare( l1 + 1, 1.0 ) || qFuzzyCompare( l2 + 1, 1.0 ) )
if ( qFuzzyCompare( l1 + 1, qreal(1.0) ) || qFuzzyCompare( l2 + 1, qreal(1.0) ) )
return true;
t1 /= l1;
......@@ -381,7 +381,7 @@ bool KoPathPoint::isSmooth( KoPathPoint * prev, KoPathPoint * next ) const
qreal scalar = t1.x()*t2.x() + t1.y()*t2.y();
// tangents are parallel if t1*t2 = |t1|*|t2|
return qFuzzyCompare( scalar, 1.0 );
return qFuzzyCompare( scalar, qreal(1.0) );
}
void KoPathPoint::removeFromGroup()
......
......@@ -301,13 +301,13 @@ QList<QPointF> KoPathSegment::intersections( const KoPathSegment &segment ) cons
qreal d2 = distanceFromChord( d->second->controlPoint1() );
if ( d1*d2 > 0.0 )
{
dmin = 0.75 * qMin( 0.0, qMin( d1, d2 ) );
dmax = 0.75 * qMax( 0.0, qMax( d1, d2 ) );
dmin = 0.75 * qMin( qreal(0.0), qMin( d1, d2 ) );
dmax = 0.75 * qMax( qreal(0.0), qMax( d1, d2 ) );
}
else
{
dmin = 4.0/9.0 * qMin( 0.0, qMin( d1, d2 ) );
dmax = 4.0/9.0 * qMax( 0.0, qMax( d1, d2 ) );
dmin = 4.0/9.0 * qMin( qreal(0.0), qMin( d1, d2 ) );
dmax = 4.0/9.0 * qMax( qreal(0.0), qMax( d1, d2 ) );
}
}
......
......@@ -192,8 +192,8 @@ QPointF KoPatternBackground::referencePointOffset() const
void KoPatternBackground::setReferencePointOffset( const QPointF &offset )
{
qreal ox = qMax( 0.0, qMin( 100.0, offset.x() ) );
qreal oy = qMax( 0.0, qMin( 100.0, offset.y() ) );
qreal ox = qMax( qreal(0.0), qMin( qreal(100.0), offset.x() ) );
qreal oy = qMax( qreal(0.0), qMin( qreal(100.0), offset.y() ) );
d->refPointOffsetPercent = QPointF( ox, oy );
}
......
......@@ -412,7 +412,7 @@ void KoShape::update(const QRectF &shape) const
const QPainterPath KoShape::outline() const
{
QPainterPath path;
path.addRect(QRectF( QPointF(0, 0), QSizeF( qMax(d->size.width(), 0.0001), qMax(d->size.height(), 0.0001) ) ));
path.addRect(QRectF( QPointF(0, 0), QSizeF( qMax(d->size.width(), qreal(0.0001)), qMax(d->size.height(), qreal(0.0001)) ) ));
return path;
}
......
......@@ -63,7 +63,7 @@ QTextDocument *KoDocumentSectionToolTip::createDocument( const QModelIndex &inde
const QString html = QString( "<html><body>%1</body></html>" ).arg( body );
doc->setHtml( html );
doc->setTextWidth( qMin( doc->size().width(), 500.0 ) );
doc->setTextWidth( qMin( doc->size().width(), qreal(500.0) ) );
return doc;
}
......
......@@ -48,8 +48,8 @@ KoGuideLineDia::KoGuideLineDia( QWidget *parent, qreal pos, qreal minPos, qreal
setMainWidget(page);
new QLabel( i18n( "Position:" ), page );
m_position= new KoUnitDoubleSpinBox( page );
m_position->setMinMaxStep( qMax( 0.00, minPos ), qMax( 0.00, maxPos ), 1.0 );
m_position->changeValue( qMax( 0.00, pos ) );
m_position->setMinMaxStep( qMax( qreal(0.00), minPos ), qMax( qreal(0.00), maxPos ), 1.0 );
m_position->changeValue( qMax( qreal(0.00), pos ) );
m_position->setUnit( unit );
m_position->setFocus();
}
......@@ -86,8 +86,8 @@ KoGuideLineDia::KoGuideLineDia( QWidget *parent, QPointF &pos, QRectF &rect,
KHBox *hbox = new KHBox( vbox );
QLabel *label = new QLabel( i18n( "&Position:" ), hbox );
m_position= new KoUnitDoubleSpinBox( hbox );
m_position->setMinMaxStep( qMax( 0.0, m_rect.left() ), qMax( 0.0, m_rect.right() ), 1.0 );
m_position->changeValue( qMax( 0.0, pos.x() ) );
m_position->setMinMaxStep( qMax( qreal(0.0), m_rect.left() ), qMax( qreal(0.0), m_rect.right() ), 1.0 );
m_position->changeValue( qMax( qreal(0.0), pos.x() ) );
m_position->setUnit( unit );
m_position->setFocus();
label->setBuddy( m_position );
......@@ -119,8 +119,8 @@ void KoGuideLineDia::slotOrientationChanged()
{
if ( m_hButton->isChecked() )
{
m_position->setMinimum( qMax( 0.0, m_rect.top() ) );
m_position->setMaximum( qMax( 0.0, m_rect.bottom() ) );
m_position->setMinimum( qMax( qreal(0.0), m_rect.top() ) );
m_position->setMaximum( qMax( qreal(0.0), m_rect.bottom() ) );
if ( ! m_positionChanged )
{
disconnect( m_position, SIGNAL( valueChanged( double ) ), this, SLOT( slotPositionChanged() ) );
......@@ -130,8 +130,8 @@ void KoGuideLineDia::slotOrientationChanged()
}
else if ( m_vButton->isChecked() )
{
m_position->setMinimum( qMax( 0.0, m_rect.left() ) );
m_position->setMaximum( qMax( 0.0, m_rect.right() ) );
m_position->setMinimum( qMax( qreal(0.0), m_rect.left() ) );
m_position->setMaximum( qMax( qreal(0.0), m_rect.right() ) );
if ( ! m_positionChanged )
{
disconnect( m_position, SIGNAL( valueChanged( double ) ), this, SLOT( slotPositionChanged() ) );
......
......@@ -188,8 +188,8 @@ void KoPageLayoutWidget::marginsChanged() {
if(left + right > d->pageLayout.width - 10) {
// make sure the actual text area is never smaller than 10 points.
qreal diff = d->pageLayout.width - 10 - left - right;
left = qMin(d->pageLayout.width - 10, qMax(0.0, left - diff / 2.0));
right = qMax(0.0, right - d->pageLayout.width - 10 - left);
left = qMin(d->pageLayout.width - 10, qMax(qreal(0.0), left - diff / qreal(2.0)));
right = qMax(qreal(0.0), right - d->pageLayout.width - 10 - left);
}
if(d->widget.singleSided->isChecked()) {
......
......@@ -50,7 +50,7 @@ QTextDocument *KoIconToolTip::createDocument( const QModelIndex &index )
const QString html = QString( "<html><body>%1</body></html>" ).arg( body );
doc->setHtml( html );
doc->setTextWidth( qMin( doc->size().width(), 500.0 ) );
doc->setTextWidth( qMin( doc->size().width(), qreal(500.0) ) );
return doc;
}
......
......@@ -109,7 +109,7 @@ QRectF HorizontalPaintingStrategy::drawBackground(const KoRulerPrivate *d, QPain
QRectF rectangle;
rectangle.setX(qMax(0, d->offset));
rectangle.setY(2);
rectangle.setWidth(qMin((qreal) d->ruler->width() - 1.0 - rectangle.x(), (d->offset >= 0 ) ? lengthInPixel : lengthInPixel + d->offset ));
rectangle.setWidth(qMin(qreal(d->ruler->width() - 1.0 - rectangle.x()), (d->offset >= 0 ) ? lengthInPixel : lengthInPixel + d->offset ));
rectangle.setHeight( d->ruler->height() - 6.0);
QRectF activeRangeRectangle;
activeRangeRectangle.setX(qMax(rectangle.x() + 1,
......@@ -376,7 +376,7 @@ QRectF VerticalPaintingStrategy::drawBackground(const KoRulerPrivate *d, QPainte
rectangle.setX(0);
rectangle.setY(qMax(0, d->offset));
rectangle.setWidth(d->ruler->width() - 1.0);
rectangle.setHeight(qMin((qreal)d->ruler->height() - 1.0 - rectangle.y(), (d->offset >= 0 ) ? lengthInPixel : lengthInPixel + d->offset ));
rectangle.setHeight(qMin(qreal(d->ruler->height() - 1.0 - rectangle.y()), (d->offset >= 0 ) ? lengthInPixel : lengthInPixel + d->offset ));
QRectF activeRangeRectangle;
activeRangeRectangle.setX(rectangle.x() + 1);
......@@ -554,7 +554,7 @@ void HorizontalDistancesPaintingStrategy::drawDistanceLine(const KoRulerPrivate
// Draw the arrow lines
qreal arrowLength = (line.length() - fontMetrics.width(label)) / 2 - 2;
arrowLength = qMax(0.0, arrowLength);
arrowLength = qMax(qreal(0.0), arrowLength);
QLineF startArrow(line.p1(), line.pointAt(arrowLength / line.length()));
QLineF endArrow(line.p2(), line.pointAt(1.0 - arrowLength / line.length()));
painter.drawLine(startArrow);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment