, m_oldFillRule(Qt::WindingFill)
, m_fillOpacity(1.0)
, m_oldFillOpacity(0)
- , m_gradientResolved(1)
- , m_fillRuleSet(0)
- , m_fillOpacitySet(0)
- , m_fillSet(0)
+ , m_gradientResolved(true)
+ , m_fillRuleSet(false)
+ , m_fillOpacitySet(false)
+ , m_fillSet(false)
{
}
void QSvgFillStyle::setFillRule(Qt::FillRule f)
{
- m_fillRuleSet = 1;
+ m_fillRuleSet = true;
m_fillRule = f;
}
void QSvgFillStyle::setFillOpacity(qreal opacity)
{
- m_fillOpacitySet = 1;
+ m_fillOpacitySet = true;
m_fillOpacity = opacity;
}
void QSvgFillStyle::setFillStyle(QSvgFillStyleProperty* style)
{
m_style = style;
- m_fillSet = 1;
+ m_fillSet = true;
}
void QSvgFillStyle::setBrush(QBrush brush)
{
m_fill = brush;
m_style = 0;
- m_fillSet = 1;
+ m_fillSet = true;
}
void QSvgFillStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states)
QSvgFontStyle::QSvgFontStyle(QSvgFont *font, QSvgTinyDocument *doc)
: m_svgFont(font)
, m_doc(doc)
- , m_familySet(0)
- , m_sizeSet(0)
- , m_styleSet(0)
- , m_variantSet(0)
- , m_weightSet(0)
- , m_textAnchorSet(0)
+ , m_familySet(false)
+ , m_sizeSet(false)
+ , m_styleSet(false)
+ , m_variantSet(false)
+ , m_weightSet(false)
+ , m_textAnchorSet(false)
{
}
QSvgFontStyle::QSvgFontStyle()
: m_svgFont(0)
, m_doc(0)
- , m_familySet(0)
- , m_sizeSet(0)
- , m_styleSet(0)
- , m_variantSet(0)
- , m_weightSet(0)
- , m_textAnchorSet(0)
+ , m_familySet(false)
+ , m_sizeSet(false)
+ , m_styleSet(false)
+ , m_variantSet(false)
+ , m_weightSet(false)
+ , m_textAnchorSet(false)
{
}
, m_strokeDashOffset(0)
, m_oldStrokeDashOffset(0)
, m_style(0)
- , m_gradientResolved(1)
- , m_vectorEffect(0)
- , m_oldVectorEffect(0)
- , m_strokeSet(0)
- , m_strokeDashArraySet(0)
- , m_strokeDashOffsetSet(0)
- , m_strokeLineCapSet(0)
- , m_strokeLineJoinSet(0)
- , m_strokeMiterLimitSet(0)
- , m_strokeOpacitySet(0)
- , m_strokeWidthSet(0)
- , m_vectorEffectSet(0)
+ , m_gradientResolved(true)
+ , m_vectorEffect(false)
+ , m_oldVectorEffect(false)
+ , m_strokeSet(false)
+ , m_strokeDashArraySet(false)
+ , m_strokeDashOffsetSet(false)
+ , m_strokeLineCapSet(false)
+ , m_strokeLineJoinSet(false)
+ , m_strokeMiterLimitSet(false)
+ , m_strokeOpacitySet(false)
+ , m_strokeWidthSet(false)
+ , m_vectorEffectSet(false)
{
}
} else {
m_stroke.setDashPattern(dashes);
}
- m_strokeDashArraySet = 1;
+ m_strokeDashArraySet = true;
}
QSvgSolidColorStyle::QSvgSolidColorStyle(const QColor &color)
qreal m_oldFillOpacity;
QString m_gradientId;
- uint m_gradientResolved : 1;
+ bool m_gradientResolved;
- uint m_fillRuleSet : 1;
- uint m_fillOpacitySet : 1;
- uint m_fillSet : 1;
+ bool m_fillRuleSet;
+ bool m_fillOpacitySet;
+ bool m_fillSet;
};
class QSvgViewportFillStyle : public QSvgStyleProperty
// Store the _pixel_ size in the font. Since QFont::setPixelSize() only takes an int, call
// QFont::SetPointSize() instead. Set proper font size just before rendering.
m_qfont.setPointSizeF(size);
- m_sizeSet = 1;
+ m_sizeSet = true;
}
void setTextAnchor(Qt::Alignment anchor)
{
m_textAnchor = anchor;
- m_textAnchorSet = 1;
+ m_textAnchorSet = true;
}
void setFamily(const QString &family)
{
m_qfont.setFamily(family);
- m_familySet = 1;
+ m_familySet = true;
}
void setStyle(QFont::Style fontStyle) {
m_qfont.setStyle(fontStyle);
- m_styleSet = 1;
+ m_styleSet = true;
}
void setVariant(QFont::Capitalization fontVariant)
{
m_qfont.setCapitalization(fontVariant);
- m_variantSet = 1;
+ m_variantSet = true;
}
static int SVGToQtWeight(int weight);
void setWeight(int weight)
{
m_weight = weight;
- m_weightSet = 1;
+ m_weightSet = true;
}
QSvgFont * svgFont() const
Qt::Alignment m_oldTextAnchor;
int m_oldWeight;
- uint m_familySet : 1;
- uint m_sizeSet : 1;
- uint m_styleSet : 1;
- uint m_variantSet : 1;
- uint m_weightSet : 1;
- uint m_textAnchorSet : 1;
+ bool m_familySet;
+ bool m_sizeSet;
+ bool m_styleSet;
+ bool m_variantSet;
+ bool m_weightSet;
+ bool m_textAnchorSet;
};
class QSvgStrokeStyle : public QSvgStyleProperty
{
m_stroke.setBrush(brush);
m_style = 0;
- m_strokeSet = 1;
+ m_strokeSet = true;
}
void setStyle(QSvgFillStyleProperty *style)
{
m_style = style;
- m_strokeSet = 1;
+ m_strokeSet = true;
}
void setDashArray(const QVector<qreal> &dashes);
void setDashArrayNone()
{
m_stroke.setStyle(Qt::SolidLine);
- m_strokeDashArraySet = 1;
+ m_strokeDashArraySet = true;
}
void setDashOffset(qreal offset)
{
m_strokeDashOffset = offset;
- m_strokeDashOffsetSet = 1;
+ m_strokeDashOffsetSet = true;
}
void setLineCap(Qt::PenCapStyle cap)
{
m_stroke.setCapStyle(cap);
- m_strokeLineCapSet = 1;
+ m_strokeLineCapSet = true;
}
void setLineJoin(Qt::PenJoinStyle join)
{
m_stroke.setJoinStyle(join);
- m_strokeLineJoinSet = 1;
+ m_strokeLineJoinSet = true;
}
void setMiterLimit(qreal limit)
{
m_stroke.setMiterLimit(limit);
- m_strokeMiterLimitSet = 1;
+ m_strokeMiterLimitSet = true;
}
void setOpacity(qreal opacity)
{
m_strokeOpacity = opacity;
- m_strokeOpacitySet = 1;
+ m_strokeOpacitySet = true;
}
void setWidth(qreal width)
{
m_stroke.setWidthF(width);
- m_strokeWidthSet = 1;
+ m_strokeWidthSet = true;
Q_ASSERT(!m_strokeDashArraySet); // set width before dash array.
}
void setVectorEffect(bool nonScalingStroke)
{
m_vectorEffect = nonScalingStroke;
- m_vectorEffectSet = 1;
+ m_vectorEffectSet = true;
}
QSvgFillStyleProperty* style() const
QSvgFillStyleProperty *m_style;
QString m_gradientId;
- uint m_gradientResolved : 1;
- uint m_vectorEffect : 1;
- uint m_oldVectorEffect : 1;
-
- uint m_strokeSet : 1;
- uint m_strokeDashArraySet : 1;
- uint m_strokeDashOffsetSet : 1;
- uint m_strokeLineCapSet : 1;
- uint m_strokeLineJoinSet : 1;
- uint m_strokeMiterLimitSet : 1;
- uint m_strokeOpacitySet : 1;
- uint m_strokeWidthSet : 1;
- uint m_vectorEffectSet : 1;
+ bool m_gradientResolved;
+ bool m_vectorEffect;
+ bool m_oldVectorEffect;
+
+ bool m_strokeSet;
+ bool m_strokeDashArraySet;
+ bool m_strokeDashOffsetSet;
+ bool m_strokeLineCapSet;
+ bool m_strokeLineJoinSet;
+ bool m_strokeMiterLimitSet;
+ bool m_strokeOpacitySet;
+ bool m_strokeWidthSet;
+ bool m_vectorEffectSet;
};
class QSvgSolidColorStyle : public QSvgFillStyleProperty