]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/tex2lyx.cpp
Capitalize labels of floats, etc. Fixes #11993.
[lyx.git] / src / tex2lyx / tex2lyx.cpp
index 667fad76b6f88d08a1d7ea1a8ff3f99b32d97a1a..1b11a45ba43515be484b18605ed84d177ee5b366 100644 (file)
 #include "LayoutModuleList.h"
 #include "ModuleList.h"
 #include "Preamble.h"
-#include "TextClass.h"
 
 #include "support/ConsoleApplication.h"
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/ExceptionMessage.h"
 #include "support/filetools.h"
 #include "support/lassert.h"
@@ -195,8 +195,8 @@ InsetLayout const * findInsetLayoutWithoutModule(TextClass const & tc,
                if (ilay.second.latexname() == name &&
                    (latexparam.empty() ||
                     (!ilay.second.latexparam().empty() && suffixIs(latexparam, ilay.second.latexparam()))) &&
-                   ((command && ilay.second.latextype() == InsetLayout::COMMAND) ||
-                    (!command && ilay.second.latextype() == InsetLayout::ENVIRONMENT)))
+                   ((command && ilay.second.latextype() == InsetLaTeXType::COMMAND) ||
+                    (!command && ilay.second.latextype() == InsetLaTeXType::ENVIRONMENT)))
                        return &(ilay.second);
        }
        return 0;
@@ -371,7 +371,7 @@ bool checkModule(string const & name, bool command)
                if (layout) {
                        found_style = true;
                        dpre = layout->preamble();
-                       std::set<std::string> lreqs = layout->required();
+                       std::set<std::string> const & lreqs = layout->required();
                        if (!lreqs.empty())
                                cmd_reqs.insert(lreqs.begin(), lreqs.end());
                } else if (insetlayout) {
@@ -620,7 +620,7 @@ public:
                  argc_(argc), argv_(argv)
        {
        }
-       void doExec()
+       void doExec() override
        {
                try {
                        int const exit_status = run();
@@ -927,10 +927,10 @@ bool tex2lyx(idocstream & is, ostream & os, string const & encoding,
        // class may not be known before. It neds to be done before parsing
        // body, since otherwise the commands/environments provided by the
        // modules would be parsed as ERT.
-       for (size_t i = 0; i < preloaded_modules.size(); ++i) {
-               if (!addModule(preloaded_modules[i])) {
+       for (auto const & module : preloaded_modules) {
+               if (!addModule(module)) {
                        cerr << "Error: Could not load module \""
-                            << preloaded_modules[i] << "\"." << endl;
+                            << module << "\"." << endl;
                        return false;
                }
        }