Commit ab6b2858 authored by Jan Hambrecht's avatar Jan Hambrecht

fix coding style issues

parent 957b5d20
......@@ -47,26 +47,26 @@ public:
Private() : deleteClipShapes(true)
{
}
~Private()
{
if(deleteClipShapes)
if (deleteClipShapes)
qDeleteAll(clipPathShapes);
}
QList<KoPathShape*> clipPathShapes;
bool deleteClipShapes;
};
KoClipData::KoClipData(KoPathShape * clipPathShape)
: d(new Private())
KoClipData::KoClipData(KoPathShape *clipPathShape)
: d(new Private())
{
Q_ASSERT(clipPathShape);
d->clipPathShapes.append(clipPathShape);
}
KoClipData::KoClipData(const QList<KoPathShape*> & clipPathShapes)
: d(new Private())
KoClipData::KoClipData(const QList<KoPathShape*> &clipPathShapes)
: d(new Private())
{
Q_ASSERT(clipPathShapes.count());
d->clipPathShapes = clipPathShapes;
......@@ -90,18 +90,18 @@ void KoClipData::removeClipShapesOwnership()
class KoClipPath::Private
{
public:
Private(KoClipData * data)
: clipData(data)
Private(KoClipData *data)
: clipData(data)
{}
~Private()
{
}
void compileClipPath(KoShape *shapeToClip)
{
QList<KoPathShape*> clipShapes = clipData->clipPathShapes();
if(!clipShapes.count())
if (!clipShapes.count())
return;
initialShapeSize = shapeToClip->outlineRect().size();
......@@ -109,8 +109,8 @@ public:
QTransform transformToShape = initialTransformToShape * scaleToPercent(initialShapeSize);
foreach(KoPathShape * path, clipShapes) {
if(!path)
foreach(KoPathShape *path, clipShapes) {
if (!path)
continue;
// map clip path to shape coordinates of clipped shape
QTransform m = path->absoluteTransformation(0) * transformToShape;
......@@ -127,8 +127,8 @@ public:
QSizeF initialShapeSize; ///< initial size of clipped shape
};
KoClipPath::KoClipPath(KoShape *shapeToClip, KoClipData * clipData)
: d( new Private(clipData) )
KoClipPath::KoClipPath(KoShape *shapeToClip, KoClipData *clipData)
: d( new Private(clipData) )
{
d->compileClipPath(shapeToClip);
}
......@@ -148,11 +148,11 @@ Qt::FillRule KoClipPath::clipRule() const
return d->clipPath.fillRule();
}
void KoClipPath::applyClipping(KoShape *shapeToClip, QPainter & painter, const KoViewConverter &converter)
void KoClipPath::applyClipping(KoShape *shapeToClip, QPainter &painter, const KoViewConverter &converter)
{
QPainterPath clipPath;
KoShape *shape = shapeToClip;
while(shape) {
while (shape) {
if (shape->clipPath()) {
QTransform m = scaleFromPercent(shape->outlineRect().size()) * shape->absoluteTransformation(0);
if (clipPath.isEmpty())
......
......@@ -38,17 +38,17 @@ class FLAKE_EXPORT KoClipData : public QSharedData
{
public:
/// Creates clip path data from a single path shape, takes ownership of the path shape
KoClipData(KoPathShape * clipPathShape);
KoClipData(KoPathShape *clipPathShape);
/// Creates clip path data from multiple path shapes, takes ownership of the path shapes
KoClipData(const QList<KoPathShape*> & clipPathShapes);
KoClipData(const QList<KoPathShape*> &clipPathShapes);
/// Destroys the clip path data
~KoClipData();
/// Returns the clip path shapes
QList<KoPathShape*> clipPathShapes() const;
/// Gives up ownership of clip path shapes
void removeClipShapesOwnership();
......@@ -66,7 +66,7 @@ public:
* @param shapeToClip the shape to clip
* @param clipData shared clipping data containing the clip paths
*/
KoClipPath(KoShape *shapeToClip, KoClipData * clipData);
KoClipPath(KoShape *shapeToClip, KoClipData *clipData);
~KoClipPath();
......@@ -78,21 +78,21 @@ public:
/// Returns the current clip path with coordinates in percent of the clipped shape size
QPainterPath path() const;
/// Returns the current clip path scaled to match the specified shape size
QPainterPath pathForSize(const QSizeF &size) const;
/// Returns the clip path shapes
/// Returns the clip path shapes
QList<KoPathShape*> clipPathShapes() const;
/**
* Returns the transformation used to transform the clip data path shapes
/**
* Returns the transformation used to transform the clip data path shapes
* to shape coordinates of the clipped shape
*/
QTransform clipDataTransformation() const;
/// Applies the clipping to the given painter
static void applyClipping(KoShape *shape, QPainter & painter, const KoViewConverter &converter);
static void applyClipping(KoShape *shape, QPainter &painter, const KoViewConverter &converter);
private:
class Private;
......
......@@ -132,8 +132,7 @@ KoShapePrivate::~KoShapePrivate()
delete fill;
if (filterEffectStack && !filterEffectStack->deref())
delete filterEffectStack;
if (clipPath)
delete clipPath;
delete clipPath;
qDeleteAll(eventActions);
}
......@@ -1155,7 +1154,7 @@ KoShapeShadow *KoShape::shadow() const
return d->shadow;
}
void KoShape::setClipPath( KoClipPath * clipPath )
void KoShape::setClipPath(KoClipPath *clipPath)
{
Q_D(KoShape);
d->clipPath = clipPath;
......
......@@ -639,7 +639,7 @@ public:
KoShapeShadow *shadow() const;
/// Sets a new clip path, removing the old one
void setClipPath( KoClipPath * clipPath );
void setClipPath(KoClipPath *clipPath);
/// Returns the currently set clip path or 0 if there is no clip path set
KoClipPath * clipPath() const;
......
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