From: Jürgen Spitzmüller Date: Sat, 23 May 2009 05:59:44 +0000 (+0000) Subject: InsetBibitem.cpp: fix bibitemWidest. X-Git-Tag: 2.0.0~6479 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=caf8a509fa7da24a49fa7eaf3aee80189e15de16;p=features.git InsetBibitem.cpp: fix bibitemWidest. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29805 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index c3c3799e23..554eb57411 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -199,6 +199,8 @@ docstring bibitemWidest(Buffer const & buffer) font. */ + docstring lbl; + ParagraphList::const_iterator it = buffer.paragraphs().begin(); ParagraphList::const_iterator end = buffer.paragraphs().end(); @@ -224,12 +226,14 @@ docstring bibitemWidest(Buffer const & buffer) // potentially the wrong one. int const wx = label.size(); - if (wx > w) + if (wx > w) { w = wx; + lbl = label; + } } - if (bitem && !bitem->bibLabel().empty()) - return bitem->bibLabel(); + if (!lbl.empty()) + return lbl; return from_ascii("99"); }