Commit a76db3ea authored by C. Boemann's avatar C. Boemann

Rename overruleChildZValues to be an enum instead

parent d159d755
......@@ -461,9 +461,9 @@ QTransform KoShape::transformation() const
return d->localMatrix;
}
bool KoShape::overruleChildZValues()
KoShape::ChildZOrderPolicy KoShape::childZOrderPolicy()
{
return true;
return ChildZDefault;
}
bool KoShape::compareShapeZIndex(KoShape *s1, KoShape *s2)
......@@ -484,7 +484,7 @@ bool KoShape::compareShapeZIndex(KoShape *s1, KoShape *s2)
foundCommonParent = true;
break;
}
if (parentShapeS2->overruleChildZValues()) {
if (parentShapeS2->childZOrderPolicy() == KoShape::ChildZParentChild) {
index2 = parentShapeS2->zIndex();
}
runThrough2 = runThrough2 + parentShapeS2->runThrough();
......@@ -492,7 +492,7 @@ bool KoShape::compareShapeZIndex(KoShape *s1, KoShape *s2)
}
if (!foundCommonParent) {
if (parentShapeS1->overruleChildZValues()) {
if (parentShapeS1->childZOrderPolicy() == KoShape::ChildZParentChild) {
index1 = parentShapeS1->zIndex();
}
runThrough1 = runThrough1 + parentShapeS1->runThrough();
......
......@@ -593,13 +593,24 @@ public:
*/
virtual void update(const QRectF &rect) const;
/// Used by compareShapeZIndex() to order shapes
enum ChildZOrderPolicy {
ChildZDefault,
ChildZParentChild = ChildZDefault, ///< normal parent/child ordering
ChildZPassThrough ///< children are considered equal to this shape
};
/**
* Returns if during compareShapeZIndex() this shape should overrule
* it childrens z alues with it's own. The default behaviour is to do so
* but for special cases (like Calligra's TextShape) it can be overloaded
* @returns if we overrule z order (default impl. returns true)
* Returns if during compareShapeZIndex() how this shape portrays the values
* of its children. The default behaviour is to let this shape's z values take
* the place of its childrens values, so you get a parent/child relationship.
* The children are naturally still ordered relatively to their z values
*
* But for special cases (like Calligra's TextShape) it can be overloaded to return
* ChildZPassThrough which means the children keep their own z values
* @returns the z order policy of this shape
*/
virtual bool overruleChildZValues();
virtual ChildZOrderPolicy childZOrderPolicy();
/**
* This is a method used to sort a list using the STL sorting methods.
......
......@@ -62,7 +62,7 @@ public:
QRectF outlineRect() const;
///reimplemented
bool overruleChildZValues() {return false;}
ChildZOrderPolicy childZOrderPolizy() {return KoShape::ChildZPassThrough;}
/// set the image collection which is needed to draw bullet from images
void setImageCollection(KoImageCollection *collection) { m_imageCollection = collection; }
......
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