]> git.lyx.org Git - features.git/blobdiff - src/LaTeXFeatures.cpp
Unify naming of menu items
[features.git] / src / LaTeXFeatures.cpp
index 3d67128f58069129dc7ed13364339a6e55971729..347a3e04501113d6d1afb0cca100891d6eadb767 100644 (file)
@@ -27,7 +27,6 @@
 #include "LaTeXFonts.h"
 #include "LaTeXPackages.h"
 #include "Layout.h"
-#include "Lexer.h"
 #include "LyXRC.h"
 #include "TextClass.h"
 #include "TexRow.h"
@@ -37,9 +36,8 @@
 
 #include "support/debug.h"
 #include "support/docstream.h"
-#include "support/FileName.h"
+#include "support/docstring.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/regex.h"
 
@@ -1163,10 +1161,6 @@ char const * bibliofeatures[] = {
        "named"
 };
 
-int const nb_bibliofeatures = sizeof(bibliofeatures) / sizeof(char const *);
-
-int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
-
 } // namespace
 
 
@@ -1258,9 +1252,9 @@ string const LaTeXFeatures::getPackages() const
 
        //  These are all the 'simple' includes.  i.e
        //  packages which we just \usepackage{package}
-       for (int i = 0; i < nb_simplefeatures; ++i) {
-               if (mustProvide(simplefeatures[i]))
-                       packages << "\\usepackage{" << simplefeatures[i] << "}\n";
+       for (char const * feature : simplefeatures) {
+               if (mustProvide(feature))
+                       packages << "\\usepackage{" << feature << "}\n";
        }
 
        // The rest of these packages are somewhat more complicated
@@ -1420,10 +1414,9 @@ string const LaTeXFeatures::getPackages() const
                packages << "\\usepackage{esint}\n";
 
        // Known bibliography packages (simple \usepackage{package})
-       for (int i = 0; i < nb_bibliofeatures; ++i) {
-               if (mustProvide(bibliofeatures[i]))
-                       packages << "\\usepackage{"
-                                << bibliofeatures[i] << "}\n";
+       for (char const * feature : bibliofeatures) {
+               if (mustProvide(feature))
+                       packages << "\\usepackage{" << feature << "}\n";
        }
 
        // Compatibility between achicago and natbib
@@ -1944,8 +1937,8 @@ docstring const getFloatI18nPreamble(docstring const & type,
 {
        // Check whether name can be encoded in the buffer encoding
        bool encodable = true;
-       for (size_t i = 0; i < name.size(); ++i) {
-               if (!enc.encodable(name[i])) {
+       for (char_type c : name) {
+               if (!enc.encodable(c)) {
                        encodable = false;
                        break;
                }