]> git.lyx.org Git - lyx.git/blobdiff - src/tests/check_layout.cpp
We only support gcc >= 4.9.
[lyx.git] / src / tests / check_layout.cpp
index af2a9c282605987427e1f35ced8f83f577430bb0..afdb66777dfc3b3abef6a1f7ff3214ea2f53c0a8 100644 (file)
@@ -1,5 +1,6 @@
 #include <config.h>
 
+#include "../support/debug.h"
 #include "../support/FileName.h"
 #include "../support/filetools.h"
 #include "../Format.h"
 #include "../support/Package.h"
 
 #include <cstdlib>
+#include <fstream>
 #include <iostream>
+#include <sstream>
+using namespace std;
 
 
 namespace lyx {
 namespace frontend {
 namespace Alert {
-void warning(docstring const & title, docstring const & message, bool const &)
+void warning(docstring const & title, docstring const & message, bool)
 {
        LYXERR0(title);
        LYXERR0(message);
 }
-}
-}
+} // namespace Alert
+} // namespace frontend
 
 bool LaTeXFeatures::isAvailable(std::string const &)
 {
@@ -35,7 +39,7 @@ bool Formats::isZippedFile(support::FileName const &) const
 {
        return false;
 }
-}
+} // namespace lyx
 
 
 using namespace lyx::support;
@@ -47,14 +51,14 @@ using namespace std;
 bool test_Layout(string const & input, string const & output)
 {
        FileName const ifn(makeAbsPath(input));
-    LayoutFileList & l = LayoutFileList::get();
-       LayoutFileIndex i = l.addLocalLayout(ifn.onlyFileName(), ifn.onlyPath().absFileName());
+       LayoutFileList & l = LayoutFileList::get();
+       LayoutFileIndex i = onlyFileName(l.addLocalLayout(ifn.onlyFileName(), ifn.onlyPath().absFileName()));
        if (i.empty()) {
                cerr << "Could not read layout file " << input << ".layout.\n";
                return false;
        }
        LayoutFile const & f = l[i];
-       ostream * os = NULL;
+       ostream * os = nullptr;
        if (output == "-")
                os = &cout;
        else if (!output.empty())
@@ -115,7 +119,7 @@ bool test_Layout(string const & input, string const & output)
 
 int main(int argc, char * argv[])
 {
-       os::init(argc, argv);
+       os::init(argc, &argv);
        lyxerr.setStream(cerr);
        if (argc < 2 || argc > 3) {
                cerr << "Usage: " << argv[0] << " <input layout file> [<output layout file>]\n";