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

implement optionally checking visibility recursively


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