Commit bece3cec authored by Thomas Zander's avatar Thomas Zander

Fix constness of methods

CCMAIL: koffice-devel@kde.org

svn path=/trunk/koffice/; revision=1151042
parent 75993000
...@@ -82,7 +82,7 @@ KoLineBorder& KoLineBorder::operator = (const KoLineBorder &rhs) ...@@ -82,7 +82,7 @@ KoLineBorder& KoLineBorder::operator = (const KoLineBorder &rhs)
return *this; return *this;
} }
void KoLineBorder::fillStyle(KoGenStyle &style, KoShapeSavingContext &context) void KoLineBorder::fillStyle(KoGenStyle &style, KoShapeSavingContext &context) const
{ {
QPen pen = d->pen; QPen pen = d->pen;
if (d->brush.gradient()) if (d->brush.gradient())
...@@ -92,7 +92,7 @@ void KoLineBorder::fillStyle(KoGenStyle &style, KoShapeSavingContext &context) ...@@ -92,7 +92,7 @@ void KoLineBorder::fillStyle(KoGenStyle &style, KoShapeSavingContext &context)
KoOdfGraphicStyles::saveOdfStrokeStyle(style, context.mainStyles(), pen); KoOdfGraphicStyles::saveOdfStrokeStyle(style, context.mainStyles(), pen);
} }
void KoLineBorder::borderInsets(const KoShape *shape, KoInsets &insets) void KoLineBorder::borderInsets(const KoShape *shape, KoInsets &insets) const
{ {
Q_UNUSED(shape); Q_UNUSED(shape);
qreal lineWidth = d->pen.widthF(); qreal lineWidth = d->pen.widthF();
...@@ -111,7 +111,7 @@ void KoLineBorder::borderInsets(const KoShape *shape, KoInsets &insets) ...@@ -111,7 +111,7 @@ void KoLineBorder::borderInsets(const KoShape *shape, KoInsets &insets)
insets.right = lineWidth; insets.right = lineWidth;
} }
bool KoLineBorder::hasTransparency() bool KoLineBorder::hasTransparency() const
{ {
return d->color.alpha() > 0; return d->color.alpha() > 0;
} }
......
...@@ -92,9 +92,9 @@ public: ...@@ -92,9 +92,9 @@ public:
/// Returns the strokes brush /// Returns the strokes brush
QBrush lineBrush() const; QBrush lineBrush() const;
virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context); virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context) const;
virtual void borderInsets(const KoShape *shape, KoInsets &insets); virtual void borderInsets(const KoShape *shape, KoInsets &insets) const;
virtual bool hasTransparency(); virtual bool hasTransparency() const;
virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter); virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter);
virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter, const QColor &color); virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter, const QColor &color);
......
...@@ -561,9 +561,9 @@ KoShapeApplicationData *KoShape::applicationData() const ...@@ -561,9 +561,9 @@ KoShapeApplicationData *KoShape::applicationData() const
return d->appData; return d->appData;
} }
bool KoShape::hasTransparency() bool KoShape::hasTransparency() const
{ {
Q_D(KoShape); Q_D(const KoShape);
if (! d->fill) if (! d->fill)
return true; return true;
else else
......
...@@ -342,7 +342,7 @@ public: ...@@ -342,7 +342,7 @@ public:
* you should override it and always return true if your shape is not square. * you should override it and always return true if your shape is not square.
* @return if the shape is (partly) transparent. * @return if the shape is (partly) transparent.
*/ */
virtual bool hasTransparency(); virtual bool hasTransparency() const;
/** /**
* Sets shape level transparency. * Sets shape level transparency.
......
...@@ -39,7 +39,7 @@ KoShapeBackground::~KoShapeBackground() ...@@ -39,7 +39,7 @@ KoShapeBackground::~KoShapeBackground()
delete d_ptr; delete d_ptr;
} }
bool KoShapeBackground::hasTransparency() bool KoShapeBackground::hasTransparency() const
{ {
return false; return false;
} }
......
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
virtual void paint(QPainter &painter, const QPainterPath &fillPath) const = 0; virtual void paint(QPainter &painter, const QPainterPath &fillPath) const = 0;
/// Returns if the background has some transparency. /// Returns if the background has some transparency.
virtual bool hasTransparency(); virtual bool hasTransparency() const;
/** /**
* Fills the style object * Fills the style object
......
...@@ -47,24 +47,24 @@ public: ...@@ -47,24 +47,24 @@ public:
virtual ~KoShapeBorderModel(); virtual ~KoShapeBorderModel();
/** /**
* @brief Fill the style object * @brief Fill the style object (aka save)
* *
* @param style object * @param style object
* @param context used for saving * @param context used for saving
*/ */
virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context) = 0; virtual void fillStyle(KoGenStyle &style, KoShapeSavingContext &context) const = 0;
/** /**
* Return a borderInsets object filled with the size inside the shape that this border takes. * Return a borderInsets object filled with the size inside the shape that this border takes.
* @param shape the shape the insets will be calculated for * @param shape the shape the insets will be calculated for
* @param insets the insets object that will be filled and returned. * @param insets the insets object that will be filled and returned.
*/ */
virtual void borderInsets(const KoShape *shape, KoInsets &insets) = 0; virtual void borderInsets(const KoShape *shape, KoInsets &insets) const = 0;
/** /**
* Returns true if there is some transparency, false if the border is fully opaque. * Returns true if there is some transparency, false if the border is fully opaque.
* @return if the border is transparent. * @return if the border is transparent.
*/ */
virtual bool hasTransparency() = 0; virtual bool hasTransparency() const = 0;
/** /**
* Paint the border. * Paint the border.
* This method should paint the border around shape. * This method should paint the border around shape.
......
...@@ -29,7 +29,7 @@ FolderBorder::FolderBorder() ...@@ -29,7 +29,7 @@ FolderBorder::FolderBorder()
{ {
} }
void FolderBorder::borderInsets(const KoShape *shape, KoInsets &insets) void FolderBorder::borderInsets(const KoShape *shape, KoInsets &insets) const
{ {
Q_ASSERT(shape); Q_ASSERT(shape);
insets.left = 1; insets.left = 1;
...@@ -43,7 +43,7 @@ void FolderBorder::borderInsets(const KoShape *shape, KoInsets &insets) ...@@ -43,7 +43,7 @@ void FolderBorder::borderInsets(const KoShape *shape, KoInsets &insets)
} }
} }
bool FolderBorder::hasTransparency() bool FolderBorder::hasTransparency() const
{ {
return false; return false;
} }
......
...@@ -32,11 +32,11 @@ class FolderBorder : public KoShapeBorderModel ...@@ -32,11 +32,11 @@ class FolderBorder : public KoShapeBorderModel
public: public:
FolderBorder(); FolderBorder();
/// reimplemented from KoShapeBorderModel /// reimplemented from KoShapeBorderModel
virtual void fillStyle(KoGenStyle &, KoShapeSavingContext &) {} virtual void fillStyle(KoGenStyle &, KoShapeSavingContext &) const {}
/// reimplemented from KoShapeBorderModel /// reimplemented from KoShapeBorderModel
virtual void borderInsets(const KoShape *shape, KoInsets &insets); virtual void borderInsets(const KoShape *shape, KoInsets &insets) const;
/// reimplemented from KoShapeBorderModel /// reimplemented from KoShapeBorderModel
virtual bool hasTransparency(); virtual bool hasTransparency() const;
/// reimplemented from KoShapeBorderModel /// reimplemented from KoShapeBorderModel
virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter); virtual void paint(KoShape *shape, QPainter &painter, const KoViewConverter &converter);
/// reimplemented from KoShapeBorderModel /// reimplemented from KoShapeBorderModel
......
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