From caf8a509fa7da24a49fa7eaf3aee80189e15de16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 23 May 2009 05:59:44 +0000 Subject: [PATCH] InsetBibitem.cpp: fix bibitemWidest. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29805 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetBibitem.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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"); } -- 2.39.2