X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraph.C;h=93533274320245531a83823130879494b04840c7;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=876394da753d095c7040d67c72ac2c6dfcfe250b;hpb=cba1fa5848f23cdddfe5f7b1d98f00a0039b2170;p=lyx.git diff --git a/src/graph.C b/src/graph.C index 876394da75..9353327432 100644 --- a/src/graph.C +++ b/src/graph.C @@ -8,13 +8,19 @@ * Full author contact details are available in file CREDITS. */ +#include + #include "graph.h" #include "format.h" #include -using std::queue; + +namespace lyx { + using std::vector; +using std::reverse; +using std::fill; int Graph::bfs_init(int s, bool clear_visited) @@ -75,11 +81,14 @@ Graph::getReachable(int from, bool only_viewable, int const i = Q_.front(); Q_.pop(); Format const & format = formats.get(i); - if (format.name() == "lyx") - continue; - if (!only_viewable || !format.viewer().empty() || - format.isChildFormat()) + if (!only_viewable || !format.viewer().empty()) result.push_back(i); + else if (format.isChildFormat()) { + Format const * const parent = + formats.getFormat(format.parentFormat()); + if (parent && !parent->viewer().empty()) + result.push_back(i); + } vector::const_iterator cit = vertices_[i].out_vertices.begin(); @@ -191,3 +200,6 @@ void Graph::addEdge(int s, int t) } vector Graph::vertices_; + + +} // namespace lyx