]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Pure HTML output for math macros.
[lyx.git] / src / insets / InsetNomencl.cpp
index 90c7258a4d739f64c8f1f39f840e56dcf4efd4db..57f38647d0d845ded7a2b7f25b962dc70abd7054 100644 (file)
@@ -26,7 +26,6 @@
 #include "LaTeXFeatures.h"
 #include "Length.h"
 #include "LyX.h"
-#include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
 #include "sgml.h"
@@ -269,25 +268,26 @@ docstring nomenclWidest(Buffer const & buffer, OutputParams const & runparams)
                }
        }
        // return the widest (or an empty) string
-       if (!symb.empty()) {
-               docstring latex_symb;
-               for (size_t n = 0; n < symb.size(); ++n) {
-                       try {
-                               latex_symb += runparams.encoding->latexChar(symb[n]);
-                       } catch (EncodingException & /* e */) {
-                               if (runparams.dryrun) {
-                                       latex_symb += "<" + _("LyX Warning: ")
-                                                  + _("uncodable character") + " '";
-                                       latex_symb += docstring(1, symb[n]);
-                                       latex_symb += "'>";
-                               }
+       if (symb.empty())
+               return symb;
+
+       // we have to encode the string properly
+       docstring latex_symb;
+       for (size_t n = 0; n < symb.size(); ++n) {
+               try {
+                       latex_symb += runparams.encoding->latexChar(symb[n]);
+               } catch (EncodingException & /* e */) {
+                       if (runparams.dryrun) {
+                               latex_symb += "<" + _("LyX Warning: ")
+                                          + _("uncodable character") + " '";
+                               latex_symb += docstring(1, symb[n]);
+                               latex_symb += "'>";
                        }
                }
-               return latex_symb;
        }
-       return symb;
-}
+       return latex_symb;
 }
+} // namespace anon
 
 
 int InsetPrintNomencl::latex(odocstream & os, OutputParams const & runparams_in) const