]> git.lyx.org Git - lyx.git/blobdiff - src/Graph.cpp
Document NeedCProtect -1
[lyx.git] / src / Graph.cpp
index 97427bcf1a662566b720ca1a89612099523eb072..0165bdacc9a4c95d626f21996f83f010c1a52959 100644 (file)
@@ -4,7 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Dekel Tsur (original code)
- * \author Richard Heck (re-implementation)
+ * \author Richard Kimberly Heck (re-implementation)
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -17,8 +17,6 @@
 #include "support/debug.h"
 #include "support/lassert.h"
 
-#include <algorithm>
-
 using namespace std;
 
 namespace lyx {
@@ -28,7 +26,7 @@ bool Graph::bfs_init(int s, bool clear_visited, queue<int> & Q)
 {
        if (s < 0)
                return false;
-       
+
        if (!Q.empty())
                Q = queue<int>();
 
@@ -47,11 +45,11 @@ bool Graph::bfs_init(int s, bool clear_visited, queue<int> & Q)
 
 
 Graph::EdgePath const
-       Graph::getReachableTo(int target, bool clear_visited)
+       Graph::getReachableTo(int to, bool clear_visited)
 {
        EdgePath result;
        queue<int> Q;
-       if (!bfs_init(target, clear_visited, Q))
+       if (!bfs_init(to, clear_visited, Q))
                return result;
 
        // Here's the logic, which is shared by the other routines.
@@ -63,7 +61,7 @@ Graph::EdgePath const
        while (!Q.empty()) {
                int const current = Q.front();
                Q.pop();
-               if (current != target || formats.get(target).name() != "lyx")
+               if (current != to || theFormats().get(to).name() != "lyx")
                        result.push_back(current);
 
                vector<Arrow *>::iterator it = vertices_[current].in_arrows.begin();
@@ -93,12 +91,12 @@ Graph::EdgePath const
        while (!Q.empty()) {
                int const current = Q.front();
                Q.pop();
-               Format const & format = formats.get(current);
+               Format const & format = theFormats().get(current);
                if (!only_viewable || !format.viewer().empty())
                        result.push_back(current);
                else if (format.isChildFormat()) {
                        Format const * const parent =
-                               formats.getFormat(format.parentFormat());
+                               theFormats().getFormat(format.parentFormat());
                        if (parent && !parent->viewer().empty())
                                result.push_back(current);
                }