Commit 347df8e5 authored by Jan Hambrecht's avatar Jan Hambrecht

implement optionally checking visibility recursively


svn path=/trunk/koffice/; revision=811861
parent f8ed4304
......@@ -542,8 +542,17 @@ void KoShape::setVisible(bool on) {
d->visible = on;
}
bool KoShape::isVisible() const {
bool KoShape::isVisible( bool recursive ) const {
if( ! recursive )
return d->visible;
KoShapeContainer * parentShape = parent();
while( parentShape )
{
if( ! parentShape->isVisible() )
return false;
parentShape = parentShape->parent();
}
return true;
}
void KoShape::setPrintable(bool on)
......
......@@ -351,9 +351,10 @@ public:
* Returns current visibility state of this shape.
* Being visible means being painted, as well as being used for
* things like guidelines or searches.
* @param recursive when true, checks visibility recursively
* @return current visibility state of this shape.
*/
bool isVisible() const;
bool isVisible( bool recursive = false ) const;
/**
* Changes the shape to be printable or not. The default is true.
......
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