]> git.lyx.org Git - features.git/commitdiff
small simplification and speedup for InsetFoot::updateLabels
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Aug 2009 12:51:27 +0000 (12:51 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Aug 2009 12:51:27 +0000 (12:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30966 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetFoot.cpp

index c5ecf4879b232f442181a48235b35e4c6c38e9ea..d1e0097c420634a548f95bdc945b22034c3878c2 100644 (file)
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/gettext.h"
-#include "support/lstrings.h"
 
 using namespace std;
 
 namespace lyx {
 
-using support::bformat;
-
 InsetFoot::InsetFoot(Buffer const & buf)
        : InsetFootlike(buf)
 {}
@@ -43,14 +40,12 @@ void InsetFoot::updateLabels(ParIterator const & it)
 {
        BufferParams const & bp = buffer().masterBuffer()->params();
        Counters & cnts = bp.documentClass().counters();
-       docstring const foot = from_ascii("footnote");
-       Paragraph const & outer =  it.paragraph();
+       static docstring const foot = from_ascii("footnote");
+       Paragraph const & outer = it.paragraph();
        if (!outer.layout().intitle && cnts.hasCounter(foot)) {
                cnts.step(foot);
-               // FIXME: the counter should format itself.
-               custom_label_= bformat(from_utf8("%1$s %2$s"),
-                                      translateIfPossible(getLayout().labelstring()),
-                                      cnts.theCounter(foot, outer.getParLanguage(bp)->code()));
+               custom_label_= translateIfPossible(getLayout().labelstring()) 
+                       + ' ' + cnts.theCounter(foot, outer.getParLanguage(bp)->code());
                setLabel(custom_label_);
        
        }