mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
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:
parent
12df886453
commit
60cf37471d
@ -148,6 +148,9 @@ int GuiFontMetrics::width(QString const & ucs2) const
|
|||||||
|
|
||||||
int GuiFontMetrics::signedWidth(docstring const & s) const
|
int GuiFontMetrics::signedWidth(docstring const & s) const
|
||||||
{
|
{
|
||||||
|
if (s.empty())
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (s[0] == '-')
|
if (s[0] == '-')
|
||||||
return -width(&(s[1]), s.length() - 1);
|
return -width(&(s[1]), s.length() - 1);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user