Introduce Buffer::hasChildren() and use it.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35531 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-09-29 12:17:24 +00:00
parent f5696b8872
commit 7ff1a60d12
3 changed files with 10 additions and 4 deletions

View File

@ -2514,6 +2514,12 @@ DocIterator Buffer::firstChildPosition(Buffer const * child)
}
bool Buffer::hasChildren() const
{
return !d->children_positions.empty();
}
void Buffer::getChildren(ListOfBuffers & clist, bool grand_children) const
{
// loop over children

View File

@ -316,6 +316,9 @@ public:
/// \return true if \p child is a child of this \c Buffer.
bool isChild(Buffer * child) const;
/// \return true if this \c Buffer has children
bool hasChildren() const;
/// return a vector of all children (and grandchildren)
ListOfBuffers getChildren(bool grand_children = true) const;

View File

@ -2782,10 +2782,7 @@ void GuiDocument::paramsToDialog()
}
// Master/Child
ListOfBuffers children;
if (bufferview())
children = buffer().getChildren(false);
if (children.empty()) {
if (!buffer().hasChildren()) {
masterChildModule->childrenTW->clear();
includeonlys_.clear();
docPS->showPanel(qt_("Child Documents"), false);