]> git.lyx.org Git - features.git/commitdiff
InsetBibitem.cpp: fix bibitemWidest.
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 May 2009 05:59:44 +0000 (05:59 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 May 2009 05:59:44 +0000 (05:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29805 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetBibitem.cpp

index c3c3799e23df084f2cf57008ee46575424a32da4..554eb57411a5d1b92b7c1296768c891d8e01609e 100644 (file)
@@ -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");
 }