Fix potential crash. Passing an empty string happens _very_ often.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15803 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-11-08 11:32:33 +00:00
parent 12df886453
commit 60cf37471d

View File

@ -148,6 +148,9 @@ int GuiFontMetrics::width(QString const & ucs2) const
int GuiFontMetrics::signedWidth(docstring const & s) const
{
if (s.empty())
return 0;
if (s[0] == '-')
return -width(&(s[1]), s.length() - 1);
else