]> git.lyx.org Git - features.git/commitdiff
nomenclWidest(): take (proper) formatting into account.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 3 Dec 2017 10:57:11 +0000 (11:57 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 3 Dec 2017 10:57:11 +0000 (11:57 +0100)
src/insets/InsetNomencl.cpp

index 05a5dea8cda6aaeda27c6c9072faee405cc02a4f..07c2bed97303643f10826e3cef5a51261a43435f 100644 (file)
@@ -365,7 +365,8 @@ docstring nomenclWidest(Buffer const & buffer, OutputParams const & runparams)
                                continue;
                        nomencl = static_cast<InsetNomencl const *>(inset);
                        docstring const symbol =
-                               nomencl->getParam("symbol");
+                               nomencl->params().prepareCommand(runparams, nomencl->getParam("symbol"),
+                                                       nomencl->findInfo(string())["symbol"].handling());
                        // This is only an approximation,
                        // but the best we can get.
                        int const wx = use_gui ?
@@ -378,17 +379,7 @@ docstring nomenclWidest(Buffer const & buffer, OutputParams const & runparams)
                }
        }
        // return the widest (or an empty) string
-       if (symb.empty())
-               return symb;
-
-       // we have to encode the string properly
-       pair<docstring, docstring> latex_symb =
-               runparams.encoding->latexString(symb, runparams.dryrun);
-       if (!latex_symb.second.empty())
-               LYXERR0("Omitting uncodable characters '"
-                       << latex_symb.second
-                       << "' in nomencl widest string!");
-       return latex_symb.first;
+       return symb;
 }
 } // namespace