]> git.lyx.org Git - features.git/commitdiff
InsetNomencl.cpp: remove hardcoded symbol width
authorUwe Stöhr <uwestoehr@web.de>
Fri, 22 May 2009 23:23:09 +0000 (23:23 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Fri, 22 May 2009 23:23:09 +0000 (23:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29797 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetNomencl.cpp

index d73b701f2929dab14b57304b3fdf2cedbb38f0d3..8cb01e8b46291440724b18355d87ff8bd49dfd79 100644 (file)
@@ -261,21 +261,21 @@ int InsetPrintNomencl::latex(odocstream & os, OutputParams const &) const
        int lines = 0;
        if (getParam("set_width") == "auto") {
                docstring widest = nomenclWidest(buffer());
-               // set the label width via nomencl's command
-               // \nomlabelwidth. This must be output before the command
+               // Set the label width via nomencl's command \nomlabelwidth.
+               // This must be output before the command
                // \printnomenclature
                if (!widest.empty()) {
                        // assure that the width is never below the
-                       // predefined value of 1 cm
-                       // FIXME: Why this?
-                       os << "\\settowidth{\\nomlabelwidth}{"
+                       // value predefined in nomencl.cfg
+                       os << "\\newlength{\\symbwidth}\n";
+                       os << "\\settowidth{\\symbwidth}{"
                           << widest
                           << "}\n";
                        os << "\\ifthenelse{%\n";
-                       os << "\\lengthtest{\\nomlabelwidth < 1cm}}\n";
-                       os << " {\\setlength{\\nomlabelwidth}{1cm}}\n";
+                       os << "\\lengthtest{\\symbwidth < \\nomlabelwidth}}\n";
+                       os << " {\\setlength{\\symbwidth}{\\nomlabelwidth}}\n";
                        os << " {}\n";
-                       lines += 5;
+                       lines += 6;
                }
        } else if (getParam("set_width") == "custom") {
                // custom length as optional arg of \printnomenclature