]> git.lyx.org Git - features.git/commitdiff
We cannot access theFontMetrics in command line mode.
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 May 2009 05:47:40 +0000 (05:47 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 May 2009 05:47:40 +0000 (05:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29804 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetNomencl.cpp

index 8cb01e8b46291440724b18355d87ff8bd49dfd79..33c7366557a630dea28d2e18c280d579429d30c6 100644 (file)
@@ -24,6 +24,7 @@
 #include "InsetList.h"
 #include "LaTeXFeatures.h"
 #include "Length.h"
+#include "LyX.h"
 #include "MetricsInfo.h"
 #include "sgml.h"
 
@@ -242,8 +243,9 @@ docstring nomenclWidest(Buffer const & buffer)
                                nomencl->getParam("symbol");
                        // This is only an approximation,
                        // but the best we can get.
-                       int const wx =
-                               theFontMetrics(Font()).width(symbol);
+                       int const wx = use_gui ?
+                               theFontMetrics(Font()).width(symbol) :
+                               symbol.size();
                        if (wx > w) {
                                w = wx;
                                symb = symbol;