]> git.lyx.org Git - lyx.git/blobdiff - src/graph.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / graph.C
index 876394da753d095c7040d67c72ac2c6dfcfe250b..87c67fc0758f989088f24fcd50a8f622c6bb425d 100644 (file)
@@ -8,13 +8,15 @@
  * Full author contact details are available in file CREDITS.
  */
 
+#include <config.h>
+
 #include "graph.h"
 #include "format.h"
 
 #include <algorithm>
 
-using std::queue;
 using std::vector;
+using std::reverse;
 
 
 int Graph::bfs_init(int s, bool clear_visited)
@@ -75,11 +77,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<int>::const_iterator cit =
                        vertices_[i].out_vertices.begin();