From fc2f9e27964d72f9685fe10f0d0f109d33b381b4 Mon Sep 17 00:00:00 2001 From: spitz Date: Sat, 23 May 2009 05:47:40 +0000 Subject: [PATCH] We cannot access theFontMetrics in command line mode. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29804 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetNomencl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index 8cb01e8b46..33c7366557 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -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; -- 2.11.4.GIT