]> git.lyx.org Git - lyx.git/blobdiff - src/buffer_funcs.cpp
Fix dialog handling of Insert Plain Text
[lyx.git] / src / buffer_funcs.cpp
index 967ccf47a06008bf520376a495b3b603d6ea06e2..0ff060c38f0ce884ff92567c74517fe392c968f9 100644 (file)
 #include "insets/InsetInclude.h"
 
 #include "support/filetools.h"
-#include "support/fs_extras.h"
 #include "support/lyxlib.h"
-
-#include <boost/bind.hpp>
-
-using std::min;
-using std::string;
+#include "support/lstrings.h"
 
 
 namespace lyx {
@@ -72,12 +67,6 @@ using support::unlink;
 namespace Alert = frontend::Alert;
 
 
-bool checkIfLoaded(FileName const & fn)
-{
-       return theBufferList().getBuffer(fn.absFilename());
-}
-
-
 Buffer * checkAndLoadLyXFile(FileName const & filename)
 {
        // File already open?
@@ -97,9 +86,8 @@ Buffer * checkAndLoadLyXFile(FileName const & filename)
                if (theBufferList().close(checkBuffer, false))
                        // Load it again.
                        return checkAndLoadLyXFile(filename);
-               else
-                       // The file could not be closed.
-                       return 0;
+               // The file could not be closed.
+               return 0;
        }
 
        if (filename.isReadable()) {
@@ -223,19 +211,16 @@ depth_type getItemDepth(ParIterator const & it)
                Paragraph & prev_par = *prev_it;
                depth_type const prev_depth = getDepth(prev_it);
                if (labeltype == prev_par.layout()->labeltype) {
-                       if (prev_depth < min_depth) {
+                       if (prev_depth < min_depth)
                                return prev_par.itemdepth + 1;
-                       }
-                       else if (prev_depth == min_depth) {
+                       if (prev_depth == min_depth)
                                return prev_par.itemdepth;
-                       }
                }
                min_depth = std::min(min_depth, prev_depth);
                // small optimization: if we are at depth 0, we won't
                // find anything else
-               if (prev_depth == 0) {
+               if (prev_depth == 0)
                        return 0;
-               }
        }
 }