small simplification and speedup for InsetFoot::updateLabels

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30966 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-08-10 12:51:27 +00:00
parent 23e01eb866
commit 1c867a17b2

View File

@ -26,14 +26,11 @@
#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_);
}